diff options
author | YamaArashi <shadow962@live.com> | 2015-07-13 15:40:33 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2015-07-13 15:40:33 -0700 |
commit | 0066e09828265cc1cc83eca27e6be76911f187ec (patch) | |
tree | 5e50f7e1527119261f7d8fac0831dfb1490a77cc | |
parent | f66a74b9fcb762d693e89415836386bcad2475b5 (diff) |
named party menu/naming screen wram variables
-rw-r--r-- | constants/misc_constants.asm | 24 | ||||
-rwxr-xr-x | engine/battle/animations.asm | 4 | ||||
-rwxr-xr-x | engine/battle/core.asm | 16 | ||||
-rwxr-xr-x | engine/in_game_trades.asm | 4 | ||||
-rwxr-xr-x | engine/items/items.asm | 46 | ||||
-rwxr-xr-x | engine/menu/naming_screen.asm | 28 | ||||
-rwxr-xr-x | engine/menu/party_menu.asm | 16 | ||||
-rwxr-xr-x | engine/menu/start_sub_menus.asm | 14 | ||||
-rwxr-xr-x | engine/oak_speech2.asm | 8 | ||||
-rw-r--r-- | home.asm | 2 | ||||
-rwxr-xr-x | main.asm | 4 | ||||
-rwxr-xr-x | scripts/daycarem.asm | 2 | ||||
-rwxr-xr-x | scripts/namerater.asm | 4 | ||||
-rwxr-xr-x | wram.asm | 8 |
14 files changed, 105 insertions, 75 deletions
diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 323e2ab6..eca97408 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -85,6 +85,30 @@ SLOTSFISH EQU $0E0C SLOTSBIRD EQU $1210 SLOTSMOUSE EQU $1614 +; party menu types +NORMAL_PARTY_MENU EQU 0 +USE_ITEM_PARTY_MENU EQU 1 +BATTLE_PARTY_MENU EQU 2 +TMHM_PARTY_MENU EQU 3 +SWAP_MONS_PARTY_MENU EQU 4 +EVO_STONE_PARTY_MENU EQU 5 + +; party memu message IDs +ANTIDOTE_MSG EQU $F0 +BURN_HEAL_MSG EQU $F1 +ICE_HEAL_MSG EQU $F2 +AWAKENING_MSG EQU $F3 +PARALYZ_HEAL_MSG EQU $F4 +POTION_MSG EQU $F5 +FULL_HEAL_MSG EQU $F6 +REVIVE_MSG EQU $F7 +RARE_CANDY_MSG EQU $F8 + +; naming screen types +NAME_PLAYER_SCREEN EQU 0 +NAME_RIVAL_SCREEN EQU 1 +NAME_MON_SCREEN EQU 2 + ; serial ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01 diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index ea879e53..83590d4c 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -336,14 +336,14 @@ LoadAnimationTileset: ; 781d2 (1e:41d2) ld d,0 add hl,de ld a,[hli] - ld [wd07d],a ; number of tiles + ld [wTempTilesetNumTiles],a ; number of tiles ld a,[hli] ld e,a ld a,[hl] ld d,a ; de = address of tileset ld hl,vSprites + $310 ld b, BANK(AnimationTileset1) ; ROM bank - ld a,[wd07d] + ld a,[wTempTilesetNumTiles] ld c,a ; number of tiles jp CopyVideoData ; load tileset diff --git a/engine/battle/core.asm b/engine/battle/core.asm index f37da950..a611864d 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1162,8 +1162,8 @@ UseNextMonText: ; 3c7d3 (f:47d3) ; choose next player mon to send out ; stores whether enemy mon has no HP left in Z flag ChooseNextMon: ; 3c7d8 (f:47d8) - ld a, $2 - ld [wd07d], a + ld a, BATTLE_PARTY_MENU + ld [wPartyMenuTypeOrMessageID], a call DisplayPartyMenu .checkIfMonChosen jr nc, .monChosen @@ -1462,8 +1462,8 @@ EnemySendOutFirstMon: ; 3c92a (f:492a) ld a,[wCurrentMenuItem] and a jr nz,.next4 - ld a,2 - ld [wd07d],a + ld a,BATTLE_PARTY_MENU + ld [wPartyMenuTypeOrMessageID],a call DisplayPartyMenu .next9 ld a,1 @@ -2384,8 +2384,8 @@ PartyMenuOrRockOrRun: jp UseBagItem .partyMenuWasSelected call LoadScreenTilesFromBuffer1 - xor a - ld [wd07d], a + xor a ; NORMAL_PARTY_MENU + ld [wPartyMenuTypeOrMessageID], a ld [wMenuItemToSwap], a call DisplayPartyMenu .checkIfPartyMonWasSelected @@ -2403,8 +2403,8 @@ PartyMenuOrRockOrRun: ld bc, $81 ld a, $7f call FillMemory - xor a - ld [wd07d], a + xor a ; NORMAL_PARTY_MENU + ld [wPartyMenuTypeOrMessageID], a call GoBackToPartyMenu jr .checkIfPartyMonWasSelected .partyMonWasSelected diff --git a/engine/in_game_trades.asm b/engine/in_game_trades.asm index 3594a26e..7366996c 100755 --- a/engine/in_game_trades.asm +++ b/engine/in_game_trades.asm @@ -87,8 +87,8 @@ InGameTrade_GetMonName: ; 71b6a (1c:5b6a) INCLUDE "data/trades.asm" InGameTrade_DoTrade: ; 71c07 (1c:5c07) - xor a - ld [wd07d],a + xor a ; NORMAL_PARTY_MENU + ld [wPartyMenuTypeOrMessageID],a dec a ld [wUpdateSpritesEnabled],a call DisplayPartyMenu diff --git a/engine/items/items.asm b/engine/items/items.asm index 24ff544e..fae2a871 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -633,8 +633,8 @@ ItemUseEvoStone: ; da5b (3:5a5b) ld a,[wcf91] ld [wd156],a push af - ld a,$05 ; evolution stone party menu - ld [wd07d],a + ld a,EVO_STONE_PARTY_MENU + ld [wPartyMenuTypeOrMessageID],a ld a,$ff ld [wUpdateSpritesEnabled],a call DisplayPartyMenu @@ -678,8 +678,8 @@ ItemUseMedicine: ; dabb (3:5abb) push af ld a,[wcf91] push af - ld a,$01 - ld [wd07d],a ; item use party menu + ld a,USE_ITEM_PARTY_MENU + ld [wPartyMenuTypeOrMessageID],a ld a,$ff ld [wUpdateSpritesEnabled],a ld a,[wd152] @@ -737,22 +737,22 @@ ItemUseMedicine: ; dabb (3:5abb) ld bc,4 add hl,bc ; hl now points to status ld a,[wcf91] - ld bc,$f008 + ld bc, (ANTIDOTE_MSG << 8) | (1 << PSN) cp a,ANTIDOTE jr z,.checkMonStatus - ld bc,$f110 + ld bc, (BURN_HEAL_MSG << 8) | (1 << BRN) cp a,BURN_HEAL jr z,.checkMonStatus - ld bc,$f220 + ld bc, (ICE_HEAL_MSG << 8) | (1 << FRZ) cp a,ICE_HEAL jr z,.checkMonStatus - ld bc,$f307 + ld bc, (AWAKENING_MSG << 8) | SLP cp a,AWAKENING jr z,.checkMonStatus - ld bc,$f440 + ld bc, (PARALYZ_HEAL_MSG << 8) | (1 << PAR) cp a,PARLYZ_HEAL jr z,.checkMonStatus - ld bc,$f6ff ; Full Heal + ld bc, (FULL_HEAL_MSG << 8) | $ff ; Full Heal .checkMonStatus ld a,[hl] ; pokemon's status and c ; does the pokemon have a status ailment the item can cure? @@ -761,7 +761,7 @@ ItemUseMedicine: ; dabb (3:5abb) xor a ld [hl],a ; remove the status ailment in the party data ld a,b - ld [wd07d],a ; the message to display for the item used + ld [wPartyMenuTypeOrMessageID],a ; the message to display for the item used ld a,[wPlayerMonNumber] cp d ; is pokemon the item was used on active in battle? jp nz,.doneHealing @@ -1078,15 +1078,15 @@ ItemUseMedicine: ; dabb (3:5abb) ld a,[hFlags_0xFFF6] res 0,a ld [hFlags_0xFFF6],a - ld a,$f7 ; revived message - ld [wd07d],a + ld a,REVIVE_MSG + ld [wPartyMenuTypeOrMessageID],a ld a,[wcf91] cp a,REVIVE jr z,.showHealingItemMessage cp a,MAX_REVIVE jr z,.showHealingItemMessage - ld a,$f5 ; standard HP healed message - ld [wd07d],a + ld a,POTION_MSG + ld [wPartyMenuTypeOrMessageID],a jr .showHealingItemMessage .playStatusAilmentCuringSound ld a,(SFX_02_3e - SFX_Headers_02) / 3 ; status ailment curing sound @@ -1257,8 +1257,8 @@ ItemUseMedicine: ; dabb (3:5abb) ld a,[hl] adc b ld [hl],a - ld a,$f8 ; level up message - ld [wd07d],a + ld a,RARE_CANDY_MSG + ld [wPartyMenuTypeOrMessageID],a call RedrawPartyMenu pop de ld a,d @@ -1878,8 +1878,8 @@ ItemUsePPRestore: ; e31e (3:631e) .chooseMon xor a ld [wUpdateSpritesEnabled],a - ld a,$01 ; item use party menu - ld [wd07d],a + ld a,USE_ITEM_PARTY_MENU + ld [wPartyMenuTypeOrMessageID],a call DisplayPartyMenu jr nc,.chooseMove jp .itemNotUsed @@ -2118,8 +2118,8 @@ ItemUseTMHM: ; e479 (3:6479) call CopyData ld a,$ff ld [wUpdateSpritesEnabled],a - ld a,$03 ; teach TM/HM party menu - ld [wd07d],a + ld a,TMHM_PARTY_MENU + ld [wPartyMenuTypeOrMessageID],a call DisplayPartyMenu push af ld hl,wd036 @@ -2650,8 +2650,8 @@ SendNewMonToBox: ; e7a4 (3:67a4) jr nz, .asm_e817 .asm_e82a ld hl, wBoxMonNicks - ld a, $2 - ld [wd07d], a + ld a, NAME_MON_SCREEN + ld [wNamingScreenType], a predef AskName ld a, [W_NUMINBOX] dec a diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm index f77f7331..9bdfbee2 100755 --- a/engine/menu/naming_screen.asm +++ b/engine/menu/naming_screen.asm @@ -27,8 +27,8 @@ AskName: ; 64eb (1:64eb) xor a ld [wUpdateSpritesEnabled], a push hl - ld a, $2 - ld [wd07d], a + ld a, NAME_MON_SCREEN + ld [wNamingScreenType], a call DisplayNamingScreen ld a, [W_ISINBATTLE] and a @@ -53,12 +53,12 @@ DoYouWantToNicknameText: ; 0x6557 TX_FAR _DoYouWantToNicknameText db "@" -Func_655c: ; 655c (1:655c) +DisplayNameRaterScreen: ; 655c (1:655c) ld hl, wHPBarMaxHP xor a ld [wUpdateSpritesEnabled], a - ld a, $2 - ld [wd07d], a + ld a, NAME_MON_SCREEN + ld [wNamingScreenType], a call DisplayNamingScreen call GBPalWhiteOutWithDelay3 call RestoreScreenTilesAndReloadTilePatterns @@ -236,8 +236,8 @@ DisplayNamingScreen: ; 6596 (1:6596) cp $e4 ld de, Handakutens jr z, .asm_66e3 - ld a, [wd07d] - cp $2 + ld a, [wNamingScreenType] + cp NAME_MON_SCREEN jr nc, .checkMonNameLength ld a, [wHPBarMaxHP] cp $7 ; max length of player/rival names @@ -377,8 +377,8 @@ Func_680e: ; 680e (1:680e) ld de, wcf4b call PlaceString hlCoord 10, 3 - ld a, [wd07d] - cp $2 + ld a, [wNamingScreenType] + cp NAME_MON_SCREEN jr nc, .asm_6835 ld b, $7 jr .asm_6837 @@ -390,8 +390,8 @@ Func_680e: ; 680e (1:680e) ld [hli], a dec b jr nz, .asm_6839 - ld a, [wd07d] - cp $2 + ld a, [wNamingScreenType] + cp NAME_MON_SCREEN ld a, [wHPBarMaxHP] jr nc, .asm_684b cp $7 @@ -405,8 +405,8 @@ Func_680e: ; 680e (1:680e) ld [wTopMenuItemX], a ld a, $5 ld [wCurrentMenuItem], a - ld a, [wd07d] - cp $2 + ld a, [wNamingScreenType] + cp NAME_MON_SCREEN ld a, $9 jr nc, .asm_6867 ld a, $6 @@ -462,7 +462,7 @@ CalcStringLength: ; 68eb (1:68eb) PrintNamingText: ; 68f8 (1:68f8) hlCoord 0, 1 - ld a, [wd07d] + ld a, [wNamingScreenType] ld de, YourTextString and a jr z, .notNickname diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index 6b365e2b..edd65a81 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -1,4 +1,4 @@ -; [wd07d] = menu type / message ID +; [wPartyMenuTypeOrMessageID] = menu type / message ID ; if less than $F0, it is a menu type ; menu types: ; 00: normal pokemon menu (e.g. Start menu) @@ -25,11 +25,11 @@ DrawPartyMenu_: ; 12cd2 (4:6cd2) callba LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics RedrawPartyMenu_: ; 12ce3 (4:6ce3) - ld a,[wd07d] - cp a,$04 + ld a,[wPartyMenuTypeOrMessageID] + cp a,SWAP_MONS_PARTY_MENU jp z,.printMessage call ErasePartyMenuCursors - callba SendBlkPacket_PartyMenu ; loads some data to wcf2e + callba SendBlkPacket_PartyMenu hlCoord 3, 0 ld de,wPartySpecies xor a @@ -75,10 +75,10 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) inc hl inc hl .skipUnfilledRightArrow - ld a,[wd07d] ; menu type - cp a,$03 + ld a,[wPartyMenuTypeOrMessageID] ; menu type + cp a,TMHM_PARTY_MENU jr z,.teachMoveMenu - cp a,$05 + cp a,EVO_STONE_PARTY_MENU jr z,.evolutionStoneMenu push hl ld bc,14 ; 14 columns to the right @@ -196,7 +196,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push af push hl set 6,[hl] ; turn off letter printing delay - ld a,[wd07d] ; message ID + ld a,[wPartyMenuTypeOrMessageID] ; message ID cp a,$F0 jr nc,.printItemUseMessage add a diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index 0a940356..d97c3d99 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -12,14 +12,14 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) jp z,RedisplayStartMenu xor a ld [wMenuItemToSwap],a - ld [wd07d],a + ld [wPartyMenuTypeOrMessageID],a ld [wUpdateSpritesEnabled],a call DisplayPartyMenu jr .checkIfPokemonChosen .loop xor a ld [wMenuItemToSwap],a - ld [wd07d],a + ld [wPartyMenuTypeOrMessageID],a call GoBackToPartyMenu .checkIfPokemonChosen jr nc,.chosePokemon @@ -89,8 +89,8 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) cp a,2 ; is there more than one pokemon in the party? jp c,StartMenu_Pokemon ; if not, no switching call SwitchPartyMon_Stats - ld a,$04 ; swap pokemon positions menu - ld [wd07d],a + ld a,SWAP_MONS_PARTY_MENU + ld [wPartyMenuTypeOrMessageID],a call GoBackToPartyMenu jp .checkIfPokemonChosen .choseStats @@ -747,7 +747,7 @@ SwitchPartyMon_Stats: ; 13653 (4:7653) ret .asm_13661 xor a - ld [wd07d], a + ld [wPartyMenuTypeOrMessageID], a ld a, [wMenuItemToSwap] dec a ld b, a @@ -757,7 +757,7 @@ SwitchPartyMon_Stats: ; 13653 (4:7653) jr nz, .asm_1367b xor a ld [wMenuItemToSwap], a - ld [wd07d], a + ld [wPartyMenuTypeOrMessageID], a ret .asm_1367b ld a, b @@ -845,7 +845,7 @@ SwitchPartyMon_Stats: ; 13653 (4:7653) ld [wWhichTrade], a xor a ld [wMenuItemToSwap], a - ld [wd07d], a + ld [wPartyMenuTypeOrMessageID], a pop de pop hl ret diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm index d8043484..49154d13 100755 --- a/engine/oak_speech2.asm +++ b/engine/oak_speech2.asm @@ -12,8 +12,8 @@ LoadDefaultNamesPlayer: ; 695d (1:695d) jr .asm_6999 .asm_697a ld hl, wPlayerName - xor a - ld [wd07d], a + xor a ; NAME_PLAYER_SCREEN + ld [wNamingScreenType], a call DisplayNamingScreen ld a, [wcf4b] cp $50 @@ -45,8 +45,8 @@ LoadDefaultNamesRival: ; 69a4 (1:69a4) jr .asm_69e1 .asm_69c1 ld hl, W_RIVALNAME - ld a, $1 - ld [wd07d], a + ld a, NAME_RIVAL_SCREEN + ld [wNamingScreenType], a call DisplayNamingScreen ld a, [wcf4b] cp $50 @@ -456,7 +456,7 @@ HandlePartyMenuInput:: ; 145a (0:145a) callba ErasePartyMenuCursors xor a ld [wMenuItemToSwap],a - ld [wd07d],a + ld [wPartyMenuTypeOrMessageID],a call RedrawPartyMenu jr HandlePartyMenuInput .handleSwap @@ -3582,8 +3582,8 @@ _AddPartyMon: ; f2e5 (3:72e5) ld a, [$ffe4] dec a call SkipFixedLengthTextEntries - ld a, $2 - ld [wd07d], a + ld a, NAME_MON_SCREEN + ld [wNamingScreenType], a predef AskName .asm_f33f ld hl, wPartyMons diff --git a/scripts/daycarem.asm b/scripts/daycarem.asm index f48584dc..5e80a10f 100755 --- a/scripts/daycarem.asm +++ b/scripts/daycarem.asm @@ -25,7 +25,7 @@ DayCareMText1: ; 56254 (15:6254) call PrintText xor a ld [wUpdateSpritesEnabled], a - ld [wd07d], a + ld [wPartyMenuTypeOrMessageID], a ld [wMenuItemToSwap], a call DisplayPartyMenu push af diff --git a/scripts/namerater.asm b/scripts/namerater.asm index 010dc0cd..c2d028ef 100755 --- a/scripts/namerater.asm +++ b/scripts/namerater.asm @@ -49,7 +49,7 @@ NameRaterText1: ; 1da56 (7:5a56) ld hl, NameRaterText_1dab8 call PrintText xor a - ld [wd07d], a + ld [wPartyMenuTypeOrMessageID], a ld [wUpdateSpritesEnabled], a ld [wMenuItemToSwap], a call DisplayPartyMenu @@ -68,7 +68,7 @@ NameRaterText1: ; 1da56 (7:5a56) jr nz, .asm_1daae ld hl, NameRaterText_1dac2 call PrintText - callba Func_655c + callba DisplayNameRaterScreen jr c, .asm_1daae ld hl, NameRaterText_1dac7 .asm_1daa8 @@ -1232,7 +1232,13 @@ W_ANIMATIONID:: ; d07c ; ID number of the current battle animation ds 1 -wd07d:: ds 1 ; used with naming functions and party display type +wNamingScreenType:: ; d07d + +wPartyMenuTypeOrMessageID:: ; d07d + +wTempTilesetNumTiles:: ; d07d +; temporary storage for the number of tiles in a tileset + ds 1 wSavedListScrollOffset:: ; d07e ; used by the pokemart code to save the existing value of wListScrollOffset |