From b3e38f1246cfcbb1a16b37b6e7e26328cbb796b5 Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 15 Jun 2020 17:41:02 -0400 Subject: Remove Crystal-only CaughtData --- constants/pokemon_data_constants.asm | 5 -- data/maps/sgb_roof_pal_inds.asm | 2 - data/moves/tmhm_moves.asm | 3 +- data/pokemon/egg_moves.asm | 8 --- data/sgb_ctrl_packets.asm | 2 - engine/pokemon/caught_data.asm | 130 ----------------------------------- engine/pokemon/caught_nickname.asm | 130 +++++++++++++++++++++++++++++++++++ engine/pokemon/move_mon.asm | 8 +-- macros/wram.asm | 7 +- main.asm | 2 +- 10 files changed, 138 insertions(+), 159 deletions(-) delete mode 100644 engine/pokemon/caught_data.asm create mode 100644 engine/pokemon/caught_nickname.asm diff --git a/constants/pokemon_data_constants.asm b/constants/pokemon_data_constants.asm index bdcb83f7..fcc76549 100644 --- a/constants/pokemon_data_constants.asm +++ b/constants/pokemon_data_constants.asm @@ -82,11 +82,6 @@ MON_DVS EQUS "(wPartyMon1DVs - wPartyMon1)" MON_PP EQUS "(wPartyMon1PP - wPartyMon1)" MON_HAPPINESS EQUS "(wPartyMon1Happiness - wPartyMon1)" MON_PKRUS EQUS "(wPartyMon1PokerusStatus - wPartyMon1)" -MON_CAUGHTDATA EQUS "(wPartyMon1CaughtData - wPartyMon1)" -MON_CAUGHTLEVEL EQUS "(wPartyMon1CaughtLevel - wPartyMon1)" -MON_CAUGHTTIME EQUS "(wPartyMon1CaughtTime - wPartyMon1)" -MON_CAUGHTGENDER EQUS "(wPartyMon1CaughtGender - wPartyMon1)" -MON_CAUGHTLOCATION EQUS "(wPartyMon1CaughtLocation - wPartyMon1)" MON_LEVEL EQUS "(wPartyMon1Level - wPartyMon1)" MON_STATUS EQUS "(wPartyMon1Status - wPartyMon1)" MON_HP EQUS "(wPartyMon1HP - wPartyMon1)" diff --git a/data/maps/sgb_roof_pal_inds.asm b/data/maps/sgb_roof_pal_inds.asm index a2620e19..ac6779b1 100644 --- a/data/maps/sgb_roof_pal_inds.asm +++ b/data/maps/sgb_roof_pal_inds.asm @@ -1,5 +1,3 @@ -; Crystal does not support SGB, so this is unused. - MapGroupRoofSGBPalInds: ; entries correspond to map groups db PREDEFPAL_ROUTES diff --git a/data/moves/tmhm_moves.asm b/data/moves/tmhm_moves.asm index 81c7d0ba..b283993a 100644 --- a/data/moves/tmhm_moves.asm +++ b/data/moves/tmhm_moves.asm @@ -59,8 +59,7 @@ TMHMMoves: db FLASH db WHIRLPOOL db WATERFALL -; Move tutor (Crystal-only) + db 0 ; end db 0 db 0 db 0 - db 0 ; end diff --git a/data/pokemon/egg_moves.asm b/data/pokemon/egg_moves.asm index 6576a8df..9378a871 100644 --- a/data/pokemon/egg_moves.asm +++ b/data/pokemon/egg_moves.asm @@ -3,14 +3,6 @@ INCLUDE "constants.asm" SECTION "Egg Moves", ROMX -; All instances of Charm, Steel Wing, Sweet Scent, and Lovely Kiss were -; removed from egg move lists in Crystal. -; Sweet Scent and Steel Wing were redundant since they're TMs, and -; Charm and Lovely Kiss were unobtainable. - -; Staryu's egg moves were removed in Crystal, because Staryu is genderless -; and can only breed with Ditto. - INCLUDE "data/pokemon/egg_move_pointers.asm" BulbasaurEggMoves: diff --git a/data/sgb_ctrl_packets.asm b/data/sgb_ctrl_packets.asm index b3c2b040..3990e469 100644 --- a/data/sgb_ctrl_packets.asm +++ b/data/sgb_ctrl_packets.asm @@ -37,8 +37,6 @@ sgb_data_snd: MACRO db \3 ; length (1-11) ENDM -; Crystal does not support SGB, so this is unused. - PalTrnPacket: sgb_pal_trn MltReq1Packet: sgb_mlt_req 1 MltReq2Packet: sgb_mlt_req 2 diff --git a/engine/pokemon/caught_data.asm b/engine/pokemon/caught_data.asm deleted file mode 100644 index 408e284a..00000000 --- a/engine/pokemon/caught_data.asm +++ /dev/null @@ -1,130 +0,0 @@ -CheckPartyFullAfterContest: - ld a, [wContestMon] - and a - jp z, .DidntCatchAnything - ld [wCurPartySpecies], a - ld [wCurSpecies], a - call GetBaseData - ld hl, wPartyCount - ld a, [hl] - cp PARTY_LENGTH - jp nc, .TryAddToBox - inc a - ld [hl], a - ld c, a - ld b, 0 - add hl, bc - ld a, [wContestMon] - ld [hli], a - ld [wCurSpecies], a - ld a, -1 - ld [hl], a - ld hl, wPartyMon1Species - ld a, [wPartyCount] - dec a - ld bc, PARTYMON_STRUCT_LENGTH - call AddNTimes - ld d, h - ld e, l - ld hl, wContestMon - ld bc, PARTYMON_STRUCT_LENGTH - call CopyBytes - ld a, [wPartyCount] - dec a - ld hl, wPartyMonOT - call SkipNames - ld d, h - ld e, l - ld hl, wPlayerName - call CopyBytes - ld a, [wCurPartySpecies] - ld [wNamedObjectIndexBuffer], a - call GetPokemonName - ld hl, wStringBuffer1 - ld de, wMonOrItemNameBuffer - ld bc, MON_NAME_LENGTH - call CopyBytes - call GiveANickname_YesNo - jr c, .Party_SkipNickname - ld a, [wPartyCount] - dec a - ld [wCurPartyMon], a - xor a - ld [wMonType], a - ld de, wMonOrItemNameBuffer - callfar InitNickname - -.Party_SkipNickname: - ld a, [wPartyCount] - dec a - ld hl, wPartyMonNicknames - call SkipNames - ld d, h - ld e, l - ld hl, wMonOrItemNameBuffer - call CopyBytes - xor a - ld [wContestMonSpecies], a - and a - ld [wScriptVar], a - ret - -.TryAddToBox: - ld a, BANK(sBoxCount) - call OpenSRAM - ld hl, sBoxCount - ld a, [hl] - cp MONS_PER_BOX - call CloseSRAM - jr nc, .BoxFull - xor a - ld [wCurPartyMon], a - ld hl, wContestMon - ld de, wBufferMon - ld bc, BOXMON_STRUCT_LENGTH - call CopyBytes - ld hl, wPlayerName - ld de, wBufferMonOT - ld bc, NAME_LENGTH - call CopyBytes - callfar InsertPokemonIntoBox - ld a, [wCurPartySpecies] - ld [wNamedObjectIndexBuffer], a - call GetPokemonName - call GiveANickname_YesNo - ld hl, wStringBuffer1 - jr c, .Box_SkipNickname - ld a, BOXMON - ld [wMonType], a - ld de, wMonOrItemNameBuffer - callfar InitNickname - ld hl, wMonOrItemNameBuffer - -.Box_SkipNickname: - ld a, BANK(sBoxMonNicknames) - call OpenSRAM - ld de, sBoxMonNicknames - ld bc, MON_NAME_LENGTH - call CopyBytes - call CloseSRAM - -.BoxFull: - xor a - ld [wContestMon], a - ld a, BUGCONTEST_BOXED_MON - ld [wScriptVar], a - ret - -.DidntCatchAnything: - ld a, BUGCONTEST_NO_CATCH - ld [wScriptVar], a - ret - -GiveANickname_YesNo: - ld hl, CaughtAskNicknameText - call PrintText - jp YesNoBox - -CaughtAskNicknameText: - text_far _CaughtAskNicknameText - text_end diff --git a/engine/pokemon/caught_nickname.asm b/engine/pokemon/caught_nickname.asm new file mode 100644 index 00000000..408e284a --- /dev/null +++ b/engine/pokemon/caught_nickname.asm @@ -0,0 +1,130 @@ +CheckPartyFullAfterContest: + ld a, [wContestMon] + and a + jp z, .DidntCatchAnything + ld [wCurPartySpecies], a + ld [wCurSpecies], a + call GetBaseData + ld hl, wPartyCount + ld a, [hl] + cp PARTY_LENGTH + jp nc, .TryAddToBox + inc a + ld [hl], a + ld c, a + ld b, 0 + add hl, bc + ld a, [wContestMon] + ld [hli], a + ld [wCurSpecies], a + ld a, -1 + ld [hl], a + ld hl, wPartyMon1Species + ld a, [wPartyCount] + dec a + ld bc, PARTYMON_STRUCT_LENGTH + call AddNTimes + ld d, h + ld e, l + ld hl, wContestMon + ld bc, PARTYMON_STRUCT_LENGTH + call CopyBytes + ld a, [wPartyCount] + dec a + ld hl, wPartyMonOT + call SkipNames + ld d, h + ld e, l + ld hl, wPlayerName + call CopyBytes + ld a, [wCurPartySpecies] + ld [wNamedObjectIndexBuffer], a + call GetPokemonName + ld hl, wStringBuffer1 + ld de, wMonOrItemNameBuffer + ld bc, MON_NAME_LENGTH + call CopyBytes + call GiveANickname_YesNo + jr c, .Party_SkipNickname + ld a, [wPartyCount] + dec a + ld [wCurPartyMon], a + xor a + ld [wMonType], a + ld de, wMonOrItemNameBuffer + callfar InitNickname + +.Party_SkipNickname: + ld a, [wPartyCount] + dec a + ld hl, wPartyMonNicknames + call SkipNames + ld d, h + ld e, l + ld hl, wMonOrItemNameBuffer + call CopyBytes + xor a + ld [wContestMonSpecies], a + and a + ld [wScriptVar], a + ret + +.TryAddToBox: + ld a, BANK(sBoxCount) + call OpenSRAM + ld hl, sBoxCount + ld a, [hl] + cp MONS_PER_BOX + call CloseSRAM + jr nc, .BoxFull + xor a + ld [wCurPartyMon], a + ld hl, wContestMon + ld de, wBufferMon + ld bc, BOXMON_STRUCT_LENGTH + call CopyBytes + ld hl, wPlayerName + ld de, wBufferMonOT + ld bc, NAME_LENGTH + call CopyBytes + callfar InsertPokemonIntoBox + ld a, [wCurPartySpecies] + ld [wNamedObjectIndexBuffer], a + call GetPokemonName + call GiveANickname_YesNo + ld hl, wStringBuffer1 + jr c, .Box_SkipNickname + ld a, BOXMON + ld [wMonType], a + ld de, wMonOrItemNameBuffer + callfar InitNickname + ld hl, wMonOrItemNameBuffer + +.Box_SkipNickname: + ld a, BANK(sBoxMonNicknames) + call OpenSRAM + ld de, sBoxMonNicknames + ld bc, MON_NAME_LENGTH + call CopyBytes + call CloseSRAM + +.BoxFull: + xor a + ld [wContestMon], a + ld a, BUGCONTEST_BOXED_MON + ld [wScriptVar], a + ret + +.DidntCatchAnything: + ld a, BUGCONTEST_NO_CATCH + ld [wScriptVar], a + ret + +GiveANickname_YesNo: + ld hl, CaughtAskNicknameText + call PrintText + jp YesNoBox + +CaughtAskNicknameText: + text_far _CaughtAskNicknameText + text_end diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm index b1988f68..36c74140 100644 --- a/engine/pokemon/move_mon.asm +++ b/engine/pokemon/move_mon.asm @@ -235,10 +235,10 @@ endr ; PokerusStatus ld [de], a inc de - ; CaughtData/CaughtTime/CaughtLevel + ; Unused1 ld [de], a inc de - ; CaughtGender/CaughtLocation + ; Unused2 ld [de], a inc de @@ -298,10 +298,10 @@ endr ; PokerusStatus ld [de], a inc de - ; CaughtData/CaughtTime/CaughtLevel + ; Unused1 ld [de], a inc de - ; CaughtGender/CaughtLocation + ; Unused2 ld [de], a inc de diff --git a/macros/wram.asm b/macros/wram.asm index 590d1b9d..81be4730 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -20,11 +20,8 @@ box_struct: MACRO \1PP:: ds NUM_MOVES \1Happiness:: db \1PokerusStatus:: db -\1CaughtData:: -\1CaughtTime:: -\1CaughtLevel:: db -\1CaughtGender:: -\1CaughtLocation:: db +\1Unused1:: db +\1Unused2:: db \1Level:: db \1End:: ENDM diff --git a/main.asm b/main.asm index c8777586..a24b5687 100644 --- a/main.asm +++ b/main.asm @@ -282,7 +282,7 @@ SECTION "bank31_2", ROMX INCLUDE "engine/events/pokerus/check_pokerus.asm" INCLUDE "engine/events/lucky_number.asm" -INCLUDE "engine/pokemon/caught_data.asm" +INCLUDE "engine/pokemon/caught_nickname.asm" SECTION "bank32", ROMX -- cgit v1.2.3