Move all misc/ and unknown/ files to meaningful directories

This commit is contained in:
Remy Oukaour 2017-12-15 13:21:47 -05:00
parent ebf3bfb6b2
commit dc76bf804f
22 changed files with 293 additions and 292 deletions

View File

@ -28,7 +28,6 @@ engine/credits.o \
data/pokemon/egg_moves.o \ data/pokemon/egg_moves.o \
data/pokemon/evos_attacks.o \ data/pokemon/evos_attacks.o \
data/pokemon/dex_entries.o \ data/pokemon/dex_entries.o \
misc/crystal_misc.o \
text/common_text.o \ text/common_text.o \
gfx/pics.o gfx/pics.o
@ -202,8 +201,8 @@ gfx/pokegear/pokegear_sprites.2bpp: tools/gfx += --trim-whitespace
gfx/unknown/ascii_font.2bpp: tools/gfx += --trim-whitespace gfx/unknown/ascii_font.2bpp: tools/gfx += --trim-whitespace
gfx/unknown/bold_font.1bpp: tools/gfx += --trim-whitespace gfx/unknown/bold_font.1bpp: tools/gfx += --trim-whitespace
gfx/unknown/egg_animated.2bpp: tools/gfx += --trim-whitespace gfx/unknown/electro_ball.2bpp: tools/gfx += --trim-whitespace
gfx/unknown/egg_animated_nonmatching.2bpp: tools/gfx += --remove-duplicates --remove-xflip gfx/unknown/electro_ball_nonmatching.2bpp: tools/gfx += --remove-duplicates --remove-xflip
gfx/unknown/mobile_splash.2bpp: tools/gfx += --remove-duplicates --remove-xflip gfx/unknown/mobile_splash.2bpp: tools/gfx += --remove-duplicates --remove-xflip
gfx/unknown/pichu_animated.2bpp: tools/gfx += --trim-whitespace gfx/unknown/pichu_animated.2bpp: tools/gfx += --trim-whitespace
gfx/unknown/unknown_egg.2bpp: rgbgfx += -h gfx/unknown/unknown_egg.2bpp: rgbgfx += -h

View File

@ -1,4 +1,4 @@
; BattleTowerAction arguments (see misc/battle_tower_5c.asm) ; BattleTowerAction arguments (see mobile/battle_tower_5c.asm)
const_def const_def
const BATTLETOWERACTION_CHECK_EXPLANATION_READ const BATTLETOWERACTION_CHECK_EXPLANATION_READ
const BATTLETOWERACTION_SET_EXPLANATION_READ const BATTLETOWERACTION_SET_EXPLANATION_READ

View File

@ -1,7 +1,7 @@
BattleTowerTrainers: ; 1f814e BattleTowerTrainers: ; 1f814e
; The trainer class is not used in Crystal 1.0 due to a bug. ; The trainer class is not used in Crystal 1.0 due to a bug.
; Instead, the sixth character in the trainer's name is used. ; Instead, the sixth character in the trainer's name is used.
; See misc/battle_tower_47.asm ; See mobile/battle_tower_47.asm
db "HANSON@@@@", FISHER db "HANSON@@@@", FISHER
db "SAWYER@@@@", POKEMANIAC db "SAWYER@@@@", POKEMANIAC
db "MASUDA@@@@", GUITARIST db "MASUDA@@@@", GUITARIST

View File

@ -55,7 +55,7 @@ INCBIN "gfx/font/weekday_kanji.2bpp"
; f8f24 ; f8f24
OverworldPhoneIconGFX: ; f8f24 OverworldPhoneIconGFX: ; f8f24
INCBIN "gfx/mobile/overworld_phone_icon.2bpp" INCBIN "gfx/font/overworld_phone_icon.2bpp"
; f8f34 ; f8f34
GFX_f8f34: ; unused bold letters + unown chars GFX_f8f34: ; unused bold letters + unown chars

View File

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 82 B

View File

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 692 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -32,7 +32,7 @@
charmap "<ROCKET>", $5e ; "ROCKET" charmap "<ROCKET>", $5e ; "ROCKET"
charmap "<DEXEND>", $5f charmap "<DEXEND>", $5f
; Actual characters (from gfx/misc/font_extra.png) ; Actual characters (from gfx/font/font_extra.png)
charmap "<BOLD_A>", $60 ; unused charmap "<BOLD_A>", $60 ; unused
charmap "<BOLD_B>", $61 ; unused charmap "<BOLD_B>", $61 ; unused
@ -68,7 +68,7 @@
charmap "┘", $7e charmap "┘", $7e
charmap " ", $7f charmap " ", $7f
; Actual characters (from gfx/misc/font_battle_extra.png) ; Actual characters (from gfx/font/font_battle_extra.png)
charmap "<LV>", $6e charmap "<LV>", $6e
@ -86,13 +86,13 @@
charmap "<BLACK>", $60 ; from gfx/mobile/phone_tiles.2bpp charmap "<BLACK>", $60 ; from gfx/mobile/phone_tiles.2bpp
charmap "▲", $61 ; gfx/font/up_arrow.png charmap "▲", $61 ; gfx/font/up_arrow.png
charmap "<PHONE>", $62 ; gfx/mobile/overworld_phone_icon.2bpp charmap "<PHONE>", $62 ; gfx/font/overworld_phone_icon.2bpp
charmap "_", $62 ; from gfx/battle/hp_exp_bar_border.1bpp charmap "_", $62 ; from gfx/battle/hp_exp_bar_border.1bpp
charmap "", $6e ; gfx/font/feet_inches.png charmap "", $6e ; gfx/font/feet_inches.png
charmap "″", $6f ; gfx/font/feet_inches.png charmap "″", $6f ; gfx/font/feet_inches.png
; Actual characters (from gfx/misc/font.png) ; Actual characters (from gfx/font/font.png)
charmap "A", $80 charmap "A", $80
charmap "B", $81 charmap "B", $81

285
main.asm
View File

@ -563,7 +563,235 @@ ApplyPokerusTick: ; 13988
INCLUDE "event/bug_contest_2.asm" INCLUDE "event/bug_contest_2.asm"
INCLUDE "unknown/013a47.asm" CorrectErrorsInPlayerParty: ; unreferenced
ld hl, PartyCount
ld a, [hl]
and a
ret z
cp PARTY_LENGTH + 1
jr c, .party_length_okay
ld a, PARTY_LENGTH
ld [hl], a
.party_length_okay
inc hl
ld b, a
ld c, 0
.loop1
ld a, [hl]
and a
jr z, .invalid_species
cp NUM_POKEMON + 1
jr z, .invalid_species
cp EGG + 1
jr c, .next_species
.invalid_species
ld [hl], SMEARGLE
push hl
push bc
ld a, c
ld hl, PartyMon1Species
call GetPartyLocation
ld [hl], SMEARGLE
pop bc
pop hl
.next_species
inc hl
inc c
dec b
jr nz, .loop1
ld [hl], $ff
ld hl, PartyMon1
ld a, [PartyCount]
ld d, a
ld e, 0
.loop2
push de
push hl
ld b, h
ld c, l
ld a, [hl]
and a
jr z, .invalid_species_2
cp NUM_POKEMON + 1
jr c, .check_level
.invalid_species_2
ld [hl], SMEARGLE
push de
ld d, 0
ld hl, PartySpecies
add hl, de
pop de
ld a, SMEARGLE
ld [hl], a
.check_level
ld [CurSpecies], a
call GetBaseData
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
cp MIN_LEVEL
ld a, MIN_LEVEL
jr c, .invalid_level
ld a, [hl]
cp MAX_LEVEL
jr c, .load_level
ld a, MAX_LEVEL
.invalid_level
ld [hl], a
.load_level
ld [CurPartyLevel], a
ld hl, MON_MAXHP
add hl, bc
ld d, h
ld e, l
ld hl, MON_STAT_EXP - 1
add hl, bc
ld b, $1
predef CalcPkmnStats
pop hl
ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc
pop de
inc e
dec d
jr nz, .loop2
ld de, PartyMonNicknames
ld a, [PartyCount]
ld b, a
ld c, 0
.loop3
push bc
call .GetLengthOfStringWith6CharCap
push de
callba CheckStringForErrors
pop hl
pop bc
jr nc, .valid_nickname
push bc
push hl
ld hl, PartySpecies
push bc
ld b, 0
add hl, bc
pop bc
ld a, [hl]
cp EGG
ld hl, .TAMAGO
jr z, .got_nickname
ld [wd265], a
call GetPokemonName
ld hl, StringBuffer1
.got_nickname
pop de
ld bc, PKMN_NAME_LENGTH
call CopyBytes
pop bc
.valid_nickname
inc c
dec b
jr nz, .loop3
ld de, PartyMonOT
ld a, [PartyCount]
ld b, a
ld c, 0
.loop4
push bc
call .GetLengthOfStringWith6CharCap
push de
callba CheckStringForErrors
pop hl
jr nc, .valid_ot_name
ld d, h
ld e, l
ld hl, PlayerName
ld bc, NAME_LENGTH
call CopyBytes
.valid_ot_name
pop bc
inc c
dec b
jr nz, .loop4
ld hl, PartyMon1Moves
ld a, [PartyCount]
ld b, a
.loop5
push hl
ld c, NUM_MOVES
ld a, [hl]
and a
jr z, .invalid_move
cp NUM_ATTACKS + 1
jr c, .moves_loop
.invalid_move
ld [hl], POUND
.moves_loop
ld a, [hl]
and a
jr z, .fill_invalid_moves
cp NUM_ATTACKS + 1
jr c, .next_move
.fill_invalid_moves
xor a
ld [hli], a
dec c
jr nz, .fill_invalid_moves
jr .next_pokemon
.next_move
inc hl
dec c
jr nz, .moves_loop
.next_pokemon
pop hl
push bc
ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc
pop bc
dec b
jr nz, .loop5
ret
; 13b6b
.TAMAGO: ; 13b6b
db "タマゴ@@@"
; 13b71
.GetLengthOfStringWith6CharCap: ; 13b71
push de
ld c, 1
ld b, NAME_LENGTH_JAPANESE
.search_loop
ld a, [de]
cp "@"
jr z, .done
inc de
inc c
dec b
jr nz, .search_loop
dec c
dec de
ld a, "@"
ld [de], a
.done
pop de
ret
; 13b87
GetSquareRoot: ; 13b87 GetSquareRoot: ; 13b87
; Return the square root of de in b. ; Return the square root of de in b.
@ -5139,7 +5367,7 @@ INCLUDE "mobile/mobile_46.asm"
SECTION "battle_tower_47", ROMX SECTION "battle_tower_47", ROMX
INCLUDE "misc/battle_tower_47.asm" INCLUDE "mobile/battle_tower_47.asm"
SECTION "bank5B", ROMX SECTION "bank5B", ROMX
@ -5170,6 +5398,8 @@ _UpdateBattleHUDs:
callba FinishBattleAnim callba FinishBattleAnim
ret ret
INCLUDE "mobile/mobile_5e.asm"
INCLUDE "mobile/mobile_5f.asm" INCLUDE "mobile/mobile_5f.asm"
@ -5655,50 +5885,9 @@ SECTION "Battle Tower Trainer Data", ROMX
INCLUDE "data/battle_tower_2.asm" INCLUDE "data/battle_tower_2.asm"
SECTION "bank7D", ROMX SECTION "Mobile News Data", ROMX
db $cc, $6b, $1e ; XXX INCLUDE "mobile/news/news.asm"
Function1f4003: ; 1f4003
; XXX
ld a, $6
call GetSRAMBank
ld hl, .unknown_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.unknown_data
INCBIN "unknown/1f4018.bin"
Function1f4dbe: ; 1f4dbe
; XXX
ld a, $6
call GetSRAMBank
ld hl, .unknown_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.unknown_data
INCBIN "unknown/1f4dd3.bin"
Function1f5d9f: ; 1f5d9f
ld a, $6
call GetSRAMBank
ld hl, .unknown_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.unknown_data
INCBIN "unknown/1f5db4.bin"
SECTION "bank7E", ROMX SECTION "bank7E", ROMX
@ -5710,10 +5899,10 @@ INCLUDE "engine/odd_eggs.asm"
SECTION "bank7F", ROMX SECTION "bank7F", ROMX
SECTION "stadium2", ROMX SECTION "Mobile Stadium 2", ROMX
IF DEF(CRYSTAL11) IF DEF(CRYSTAL11)
INCBIN "misc/stadium2_2.bin" INCBIN "mobile/stadium/stadium2_2.bin"
ELSE ELSE
INCBIN "misc/stadium2_1.bin" INCBIN "mobile/stadium/stadium2_1.bin"
ENDC ENDC

View File

@ -75,7 +75,7 @@ Function17005a: ; 17005a
; 1700b0 ; 1700b0
INCLUDE "misc/battle_tower_5c.asm" INCLUDE "mobile/battle_tower_5c.asm"
Function170be4: ; 170be4 Function170be4: ; 170be4
ld a, $5 ld a, $5

View File

@ -1,5 +1,3 @@
INCLUDE "includes.asm"
SECTION "Misc Crystal", ROMX SECTION "Misc Crystal", ROMX

44
mobile/news/news.asm Normal file
View File

@ -0,0 +1,44 @@
; http://forums.glitchcity.info/index.php?topic=7509.msg206449#msg206449
db $cc, $6b, $1e ; XXX
Function1f4003: ; 1f4003
; XXX
ld a, $6
call GetSRAMBank
ld hl, .news_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.news_data
INCBIN "mobile/news/news_1.bin"
Function1f4dbe: ; 1f4dbe
; XXX
ld a, $6
call GetSRAMBank
ld hl, .news_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.news_data
INCBIN "mobile/news/news_2.bin"
Function1f5d9f: ; 1f5d9f
ld a, $6
call GetSRAMBank
ld hl, .news_data
ld de, $a000
ld bc, $1000
call CopyBytes
call CloseSRAM
ret
.news_data
INCBIN "mobile/news/news_3.bin"

View File

@ -301,13 +301,13 @@ ROMX $7b
ROMX $7c ROMX $7c
"Battle Tower Trainer Data" "Battle Tower Trainer Data"
ROMX $7d ROMX $7d
"bank7D" "Mobile News Data"
ROMX $7e ROMX $7e
"bank7E" "bank7E"
ROMX $7f ROMX $7f
"bank7F" "bank7F"
org $7de0 org $7de0
"stadium2" "Mobile Stadium 2"
WRAM0 WRAM0
"Stack" "Stack"
"Audio RAM" "Audio RAM"

View File

@ -1,229 +0,0 @@
CorrectErrorsInPlayerParty: ; unreferenced
ld hl, PartyCount
ld a, [hl]
and a
ret z
cp PARTY_LENGTH + 1
jr c, .party_length_okay
ld a, PARTY_LENGTH
ld [hl], a
.party_length_okay
inc hl
ld b, a
ld c, 0
.loop1
ld a, [hl]
and a
jr z, .invalid_species
cp NUM_POKEMON + 1
jr z, .invalid_species
cp EGG + 1
jr c, .next_species
.invalid_species
ld [hl], SMEARGLE
push hl
push bc
ld a, c
ld hl, PartyMon1Species
call GetPartyLocation
ld [hl], SMEARGLE
pop bc
pop hl
.next_species
inc hl
inc c
dec b
jr nz, .loop1
ld [hl], $ff
ld hl, PartyMon1
ld a, [PartyCount]
ld d, a
ld e, 0
.loop2
push de
push hl
ld b, h
ld c, l
ld a, [hl]
and a
jr z, .invalid_species_2
cp NUM_POKEMON + 1
jr c, .check_level
.invalid_species_2
ld [hl], SMEARGLE
push de
ld d, 0
ld hl, PartySpecies
add hl, de
pop de
ld a, SMEARGLE
ld [hl], a
.check_level
ld [CurSpecies], a
call GetBaseData
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
cp MIN_LEVEL
ld a, MIN_LEVEL
jr c, .invalid_level
ld a, [hl]
cp MAX_LEVEL
jr c, .load_level
ld a, MAX_LEVEL
.invalid_level
ld [hl], a
.load_level
ld [CurPartyLevel], a
ld hl, MON_MAXHP
add hl, bc
ld d, h
ld e, l
ld hl, MON_STAT_EXP - 1
add hl, bc
ld b, $1
predef CalcPkmnStats
pop hl
ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc
pop de
inc e
dec d
jr nz, .loop2
ld de, PartyMonNicknames
ld a, [PartyCount]
ld b, a
ld c, 0
.loop3
push bc
call .GetLengthOfStringWith6CharCap
push de
callba CheckStringForErrors
pop hl
pop bc
jr nc, .valid_nickname
push bc
push hl
ld hl, PartySpecies
push bc
ld b, 0
add hl, bc
pop bc
ld a, [hl]
cp EGG
ld hl, .TAMAGO
jr z, .got_nickname
ld [wd265], a
call GetPokemonName
ld hl, StringBuffer1
.got_nickname
pop de
ld bc, PKMN_NAME_LENGTH
call CopyBytes
pop bc
.valid_nickname
inc c
dec b
jr nz, .loop3
ld de, PartyMonOT
ld a, [PartyCount]
ld b, a
ld c, 0
.loop4
push bc
call .GetLengthOfStringWith6CharCap
push de
callba CheckStringForErrors
pop hl
jr nc, .valid_ot_name
ld d, h
ld e, l
ld hl, PlayerName
ld bc, NAME_LENGTH
call CopyBytes
.valid_ot_name
pop bc
inc c
dec b
jr nz, .loop4
ld hl, PartyMon1Moves
ld a, [PartyCount]
ld b, a
.loop5
push hl
ld c, NUM_MOVES
ld a, [hl]
and a
jr z, .invalid_move
cp NUM_ATTACKS + 1
jr c, .moves_loop
.invalid_move
ld [hl], POUND
.moves_loop
ld a, [hl]
and a
jr z, .fill_invalid_moves
cp NUM_ATTACKS + 1
jr c, .next_move
.fill_invalid_moves
xor a
ld [hli], a
dec c
jr nz, .fill_invalid_moves
jr .next_pokemon
.next_move
inc hl
dec c
jr nz, .moves_loop
.next_pokemon
pop hl
push bc
ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc
pop bc
dec b
jr nz, .loop5
ret
; 13b6b
.TAMAGO: ; 13b6b
db "タマゴ@@@"
; 13b71
.GetLengthOfStringWith6CharCap: ; 13b71
push de
ld c, 1
ld b, 6
.search_loop
ld a, [de]
cp "@"
jr z, .done
inc de
inc c
dec b
jr nz, .search_loop
dec c
dec de
ld a, "@"
ld [de], a
.done
pop de
ret
; 13b87