diff options
author | YamaArashi <shadow962@live.com> | 2015-02-07 18:37:40 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2015-02-07 18:37:40 -0800 |
commit | 32f7cf12de9f841f76a3f2010caf6d7a80d47bcc (patch) | |
tree | 3568312441db2bbd4acf0f6885913980f4c0eaad | |
parent | 4fd7a42b235b68ffc11d4f02305b695c2ed05549 (diff) |
Named wram symbols
-rwxr-xr-x | engine/battle/4.asm | 12 | ||||
-rwxr-xr-x | engine/battle/core.asm | 22 | ||||
-rwxr-xr-x | engine/battle/e.asm | 10 | ||||
-rwxr-xr-x | engine/cable_club.asm | 4 | ||||
-rwxr-xr-x | engine/evos_moves.asm | 16 | ||||
-rwxr-xr-x | engine/experience.asm | 4 | ||||
-rw-r--r-- | engine/menu/bills_pc.asm | 4 | ||||
-rwxr-xr-x | engine/menu/party_menu.asm | 4 | ||||
-rwxr-xr-x | engine/menu/players_pc.asm | 12 | ||||
-rwxr-xr-x | engine/menu/start_sub_menus.asm | 4 | ||||
-rwxr-xr-x | engine/menu/status_screen.asm | 40 | ||||
-rwxr-xr-x | engine/overworld/map_sprites.asm | 6 | ||||
-rw-r--r-- | engine/overworld/movement.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/pokemart.asm | 8 | ||||
-rwxr-xr-x | engine/predefs7.asm | 4 | ||||
-rw-r--r-- | home.asm | 54 | ||||
-rw-r--r-- | hram.asm | 3 | ||||
-rwxr-xr-x | main.asm | 16 | ||||
-rwxr-xr-x | scripts/ceruleanhouse2.asm | 4 | ||||
-rwxr-xr-x | wram.asm | 39 |
20 files changed, 133 insertions, 137 deletions
diff --git a/engine/battle/4.asm b/engine/battle/4.asm index 37ffaa05..97db1ba3 100755 --- a/engine/battle/4.asm +++ b/engine/battle/4.asm @@ -26,9 +26,9 @@ Func_128f6: ; 128f6 (4:68f6) asm_128fb: ; 128fb (4:68fb) ld [wListMenuID], a push hl - ld a, [wcf99] + ld a, [wLoadedMonHP] ld b, a - ld a, [wcf9a] + ld a, [wLoadedMonHP + 1] ld c, a or b jr nz, .asm_12913 @@ -39,9 +39,9 @@ asm_128fb: ; 128fb (4:68fb) ld d, a jp DrawHPBarAndFraction .asm_12913 - ld a, [wcfba] + ld a, [wLoadedMonMaxHP] ld d, a - ld a, [wcfbb] + ld a, [wLoadedMonMaxHP + 1] ld e, a predef HPBarLength ld a, $6 @@ -64,12 +64,12 @@ DrawHPBarAndFraction: ; 12924 (4:6924) ld bc, SCREEN_WIDTH + 1 ; below bar .printHPFraction add hl, bc - ld de, wcf99 + ld de, wLoadedMonHP ld bc, $203 call PrintNumber ld a, "/" ld [hli], a - ld de, wcfba + ld de, wLoadedMonMaxHP ld bc, $203 call PrintNumber pop hl diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 6ea2c55b..a502ed7c 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1899,23 +1899,23 @@ DrawPlayerHUDAndHPBar: ; 3cd60 (f:4d60) call CenterMonName call PlaceString ld hl, wBattleMonSpecies - ld de, wcf98 + ld de, wLoadedMon ld bc, $c call CopyData ld hl, wBattleMonLevel - ld de, wcfb9 + ld de, wLoadedMonLevel ld bc, $b call CopyData hlCoord 14, 8 push hl inc hl - ld de, wcf9c + ld de, wLoadedMonStatus call PrintStatusConditionNotFainted pop hl jr nz, .asm_3cdae call PrintLevel .asm_3cdae - ld a, [wcf98] + ld a, [wLoadedMonSpecies] ld [wcf91], a hlCoord 10, 9 predef DrawHP @@ -1965,7 +1965,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec) pop hl jr nz, .skipPrintLevel ; if the mon has a status condition, skip printing the level ld a, [wEnemyMonLevel] - ld [wcfb9], a + ld [wLoadedMonLevel], a call PrintLevel .skipPrintLevel ld hl, wEnemyMonHP @@ -2270,9 +2270,9 @@ BagWasSelected: jr nz, DisplayPlayerBag ; no, it is a normal battle ld hl, OldManItemList ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a jr DisplayBagMenu OldManItemList: @@ -2284,9 +2284,9 @@ DisplayPlayerBag: ; get the pointer to player's bag when in a normal battle ld hl, wNumBagItems ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a DisplayBagMenu: xor a @@ -4451,7 +4451,7 @@ GetEnemyMonStat: ; 3df1c (f:5f1c) ld [wd0b5], a call GetMonHeader ld hl, wEnemyMonDVs - ld de, wcfaf + ld de, wLoadedMonSpeedExp ld a, [hli] ld [de], a inc de @@ -4459,7 +4459,7 @@ GetEnemyMonStat: ; 3df1c (f:5f1c) ld [de], a pop bc ld b, $0 - ld hl, wcfa4 + ld hl, wLoadedMonSpeedExp - $b ; this base address makes CalcStat look in [wLoadedMonSpeedExp] for DVs call CalcStat pop de ret diff --git a/engine/battle/e.asm b/engine/battle/e.asm index 9f93baa6..ff3ac839 100755 --- a/engine/battle/e.asm +++ b/engine/battle/e.asm @@ -665,18 +665,18 @@ Func_39bd5: ; 39bd5 (e:5bd5) .asm_39c18 ld [W_LISTTYPE], a ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a ld a, e ld [wcf8d], a ld a, d ld [wcf8e], a - ld bc, ItemPrices ; $4608 + ld bc, ItemPrices ld a, c - ld [wcf8f], a + ld [wItemPrices], a ld a, b - ld [wcf90], a + ld [wItemPrices + 1], a ret Func_39c37: ; 39c37 (e:5c37) diff --git a/engine/cable_club.asm b/engine/cable_club.asm index 68c6a8dc..ff25fd5e 100755 --- a/engine/cable_club.asm +++ b/engine/cable_club.asm @@ -578,7 +578,7 @@ TradeCenter_SelectMon: ReturnToCableClubRoom: ; 577d (1:577d) call GBPalWhiteOutWithDelay3 - ld hl, wcfc4 + ld hl, wCharRAMInUseForText ld a, [hl] push af push hl @@ -808,7 +808,7 @@ TradeCenter_Trade: ld a, c ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes - ld de, wcf98 + ld de, wLoadedMon ld bc, wEnemyMon2 - wEnemyMon1 call CopyData call AddEnemyMonToPlayerParty diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm index 2c504104..2eef7ba7 100755 --- a/engine/evos_moves.asm +++ b/engine/evos_moves.asm @@ -88,7 +88,7 @@ Evolution_PartyMonLoop: ; loop over party mons jp nz, .nextEvoEntry1 ; if not trading, go to the next evolution entry ld a, [hli] ; level requirement ld b, a - ld a, [wcfb9] + ld a, [wLoadedMonLevel] cp b ; is the mon's level greater than the evolution requirement? jp c, Evolution_PartyMonLoop ; if so, go the next mon jr .asm_3adb6 @@ -101,7 +101,7 @@ Evolution_PartyMonLoop: ; loop over party mons .checkLevel ld a, [hli] ; level requirement ld b, a - ld a, [wcfb9] + ld a, [wLoadedMonLevel] cp b ; is the mon's level greater than the evolution requirement? jp c, .nextEvoEntry2 ; if so, go the next evolution entry .asm_3adb6 @@ -136,7 +136,7 @@ Evolution_PartyMonLoop: ; loop over party mons pop hl ld a, [hl] ld [wd0b5], a - ld [wcf98], a + ld [wLoadedMonSpecies], a ld [wHPBarMaxHP + 1], a ld a, MONSTER_NAME ld [W_LISTTYPE], a @@ -169,8 +169,8 @@ Evolution_PartyMonLoop: ; loop over party mons ld [W_MONHDEXNUM], a pop af ld [wd11e], a - ld hl, wcfa8 - ld de, wcfba + ld hl, wLoadedMonHPExp - 1 + ld de, wLoadedMonStats ld b, $1 call CalcStats ld a, [wWhichPokemon] @@ -186,14 +186,14 @@ Evolution_PartyMonLoop: ; loop over party mons ld a, [hli] ld b, a ld c, [hl] - ld hl, wcfbb + ld hl, wLoadedMonMaxHP + 1 ld a, [hld] sub c ld c, a ld a, [hl] sbc b ld b, a - ld hl, wcf9a + ld hl, wLoadedMonHP + 1 ld a, [hl] add c ld [hld], a @@ -226,7 +226,7 @@ Evolution_PartyMonLoop: ; loop over party mons call Evolution_FlagAction pop de pop hl - ld a, [wcf98] + ld a, [wLoadedMonSpecies] ld [hl], a push hl ld l, e diff --git a/engine/experience.asm b/engine/experience.asm index 91f1dd5d..68d22843 100755 --- a/engine/experience.asm +++ b/engine/experience.asm @@ -1,6 +1,6 @@ ; calculates the level a mon should be based on its current exp CalcLevelFromExperience: ; 58f43 (16:4f43) - ld a, [wcf98] + ld a, [wLoadedMonSpecies] ld [wd0b5], a call GetMonHeader ld d, $1 ; init level to 1 @@ -8,7 +8,7 @@ CalcLevelFromExperience: ; 58f43 (16:4f43) inc d ; increment level call CalcExperience push hl - ld hl, wcfa8 ; current exp + ld hl, wLoadedMonExp + 2 ; current exp ; compare exp needed for level d with current exp ld a, [H_MULTIPLICAND + 2] ld c, a diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index a26c5aed..9e8422c0 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -325,9 +325,9 @@ Func_216b3: ; 216b3 (8:56b3) Func_216be: ; 216be (8:56be) ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a xor a ld [wcf93], a ld [wListMenuID], a ; wListMenuID diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index a2c02481..86474be9 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -83,7 +83,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld bc,14 ; 14 columns to the right add hl,bc - ld de,wcf9c + ld de,wLoadedMonStatus call PrintStatusCondition pop hl push hl @@ -134,7 +134,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld hl,EvosMovesPointerTable ld b,0 - ld a,[wcf98] ; pokemon ID + ld a,[wLoadedMonSpecies] dec a add a rl b diff --git a/engine/menu/players_pc.asm b/engine/menu/players_pc.asm index 5f1175eb..5217befa 100755 --- a/engine/menu/players_pc.asm +++ b/engine/menu/players_pc.asm @@ -97,9 +97,9 @@ Func_79ab: ; 79ab (1:79ab) call PrintText ld hl, wNumBagItems ; wNumBagItems ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a xor a ld [wcf93], a ld a, $3 @@ -151,9 +151,9 @@ Func_7a28: ; 7a28 (1:7a28) call PrintText ld hl, wNumBoxItems ; wNumBoxItems ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a xor a ld [wcf93], a ld a, $3 @@ -205,9 +205,9 @@ Func_7aa5: ; 7aa5 (1:7aa5) call PrintText ld hl, wNumBoxItems ; wNumBoxItems ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a xor a ld [wcf93], a ld a, $3 diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index 1bedb0ea..589224ab 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -308,10 +308,10 @@ StartMenu_Item: ; 13302 (4:7302) jr .exitMenu .notInCableClubRoom ld bc,wNumBagItems - ld hl,wcf8b + ld hl,wList ld a,c ld [hli],a - ld [hl],b ; store item bag pointer at wcf8b (for DisplayListMenuID) + ld [hl],b ; store item bag pointer at wList (for DisplayListMenuID) xor a ld [wcf93],a ld a,ITEMLISTMENU diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm index 2fc5e713..79daa0c0 100755 --- a/engine/menu/status_screen.asm +++ b/engine/menu/status_screen.asm @@ -4,11 +4,11 @@ StatusScreen: ; 12953 (4:6953) ld a, [wcc49] cp $2 ; 2 means we're in a PC box jr c, .DontRecalculate ; 0x1295b $14 - ld a, [wcf9b] - ld [wcfb9], a + ld a, [wLoadedMonBoxLevel] + ld [wLoadedMonLevel], a ld [W_CURENEMYLVL], a - ld hl, wcfa8 - ld de, wcfba + ld hl, wLoadedMonHPExp - 1 + ld de, wLoadedMonStats ld b, $1 call CalcStats ; Recalculate stats .DontRecalculate @@ -61,7 +61,7 @@ StatusScreen: ; 12953 (4:6953) ld b, $3 call GoPAL_SET ; SGB palette hlCoord 16, 6 - ld de, wcf9c + ld de, wLoadedMonStatus call PrintStatusCondition jr nz, .StatusWritten ; 0x129fc $9 hlCoord 16, 6 @@ -96,7 +96,7 @@ StatusScreen: ; 12953 (4:6953) hlCoord 12, 16 call PlaceString ; OT hlCoord 12, 14 - ld de, wcfa4 + ld de, wLoadedMonOTID ld bc, $8205 ; 5 call PrintNumber ; ID Number ld d, $0 @@ -203,14 +203,14 @@ PrintStatsBox: ; 12ae4 (4:6ae4) pop hl pop bc add hl, bc - ld de, wcfbc + ld de, wLoadedMonAttack ld bc, $0203 ; three digits call PrintStat - ld de, wcfbe + ld de, wLoadedMonDefense call PrintStat - ld de, wcfc0 + ld de, wLoadedMonSpeed call PrintStat - ld de, wcfc2 + ld de, wLoadedMonSpecial jp PrintNumber PrintStat push hl @@ -235,7 +235,7 @@ StatusScreen2: ; 12b57 (4:6b57) ld bc, $0005 ld hl, wd0dc call FillMemory - ld hl, wcfa0 + ld hl, wLoadedMonMoves ld de, wd0dc ld bc, $0004 call CopyData @@ -269,7 +269,7 @@ StatusScreen2: ; 12b57 (4:6b57) ld a, "-" call Func_12ccb ; Fill the rest with -- .InitPP ; 12bbb - ld hl, wcfa0 + ld hl, wLoadedMonMoves deCoord 14, 10 ld b, $0 .PrintPP ; 12bc3 @@ -323,12 +323,12 @@ StatusScreen2: ; 12b57 (4:6b57) hlCoord 9, 3 ld de, EXPPointsText call PlaceString - ld a, [wcfb9] ; level + ld a, [wLoadedMonLevel] ; level push af cp MAX_LEVEL jr z, .Level100 ; 0x12c20 $4 inc a - ld [wcfb9], a ; Increase temporarily if not 100 + ld [wLoadedMonLevel], a ; Increase temporarily if not 100 .Level100 hlCoord 14, 6 ld [hl], $70 ; 1-tile "to" @@ -336,13 +336,13 @@ StatusScreen2: ; 12b57 (4:6b57) inc hl call PrintLevel pop af - ld [wcfb9], a - ld de, wcfa6 + ld [wLoadedMonLevel], a + ld de, wLoadedMonExp hlCoord 12, 4 ld bc, $0307 call PrintNumber ; exp call .asm_12c86 - ld de, wcfa6 + ld de, wLoadedMonExp hlCoord 7, 6 ld bc, $0307 call PrintNumber @@ -368,13 +368,13 @@ StatusScreen2: ; 12b57 (4:6b57) call GBPalWhiteOut jp ClearScreen .asm_12c86 ; This does some magic with lvl/exp? - ld a, [wcfb9] ; Load level + ld a, [wLoadedMonLevel] ; Load level cp MAX_LEVEL jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100 inc a ld d, a callab CalcExperience - ld hl, wcfa8 + ld hl, wLoadedMonExp + 2 ld a, [$ff98] sub [hl] ld [hld], a @@ -386,7 +386,7 @@ StatusScreen2: ; 12b57 (4:6b57) ld [hld], a ret .asm_12ca7 - ld hl, wcfa6 + ld hl, wLoadedMonExp xor a ld [hli], a ld [hli], a diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 81443c9f..16403759 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -159,7 +159,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) ld l,e pop de ld b,a - ld a,[wcfc4] + ld a,[wCharRAMInUseForText] bit 0,a ; reloading upper half of tile patterns after displaying text? jr nz,.skipFirstLoad ; if so, skip loading data into the lower half ld a,b @@ -180,7 +180,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) jr nc,.noCarry3 inc d .noCarry3 - ld a,[wcfc4] + ld a,[wCharRAMInUseForText] bit 0,a ; reloading upper half of tile patterns after displaying text? jr nz,.loadWhileLCDOn pop af @@ -264,7 +264,7 @@ InitOutsideMapSprites: ; 1797b (5:797b) cp a,$f0 ; does the map have 2 sprite sets? call nc,GetSplitMapSpriteSetID ; if so, choose the appropriate one ld b,a ; b = spriteSetID - ld a,[wcfc4] + ld a,[wCharRAMInUseForText] bit 0,a ; reloading upper half of tile patterns after displaying text? jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set ld a,[W_SPRITESETID] diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 3b9cac7d..1658b0e9 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -52,7 +52,7 @@ UpdatePlayerSprite: ; 4e31 (1:4e31) jr .asm_4eab .asm_4e86 ld [wSpriteStateData1 + 9], a - ld a, [wcfc4] + ld a, [wCharRAMInUseForText] bit 0, a jr nz, .asm_4e7d .asm_4e90 @@ -130,7 +130,7 @@ Func_4ed1: ; 4ed1 (1:4ed1) bit 7, a jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80 ld b, a - ld a, [wcfc4] + ld a, [wCharRAMInUseForText] bit 0, a jp nz, notYetMoving ld a, b diff --git a/engine/overworld/pokemart.asm b/engine/overworld/pokemart.asm index 4bc4c341..8325b93f 100755 --- a/engine/overworld/pokemart.asm +++ b/engine/overworld/pokemart.asm @@ -50,9 +50,9 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) call DisplayTextBoxID ; draw money text box ld hl,wNumBagItems ld a,l - ld [wcf8b],a + ld [wList],a ld a,h - ld [wcf8c],a + ld [wList + 1],a xor a ld [wcf93],a ld [wCurrentMenuItem],a @@ -124,9 +124,9 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) call DisplayTextBoxID ; draw money text box ld hl,wStringBuffer2 + 11 ld a,l - ld [wcf8b],a + ld [wList],a ld a,h - ld [wcf8c],a + ld [wList + 1],a xor a ld [wCurrentMenuItem],a inc a diff --git a/engine/predefs7.asm b/engine/predefs7.asm index b6c3bbbc..e2f58ca8 100755 --- a/engine/predefs7.asm +++ b/engine/predefs7.asm @@ -3,9 +3,9 @@ Func_1c9c6: ; 1c9c6 (7:49c6) call PrintText ld hl, wStringBuffer2 + 11 ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a ld a, [wListScrollOffset] ; wcc36 push af xor a @@ -239,7 +239,7 @@ DrawHPBar:: ; 1336 (0:1336) ret -; loads pokemon data from one of multiple sources to wcf98 +; loads pokemon data from one of multiple sources to wLoadedMon ; loads base stats to W_MONHDEXNUM ; INPUT: ; [wWhichPokemon] = index of pokemon within party/box @@ -250,7 +250,7 @@ DrawHPBar:: ; 1336 (0:1336) ; 03: daycare ; OUTPUT: ; [wcf91] = pokemon ID -; wcf98 = base address of pokemon data +; wLoadedMon = base address of pokemon data ; W_MONHDEXNUM = base address of base stats LoadMonData:: ; 1372 (0:1372) ld hl, LoadMonData_ @@ -515,12 +515,12 @@ PrintStatusConditionNotFainted ; 14f6 ; function to print pokemon level, leaving off the ":L" if the level is at least 100 ; INPUT: ; hl = destination address -; [wcfb9] = level +; [wLoadedMonLevel] = level PrintLevel:: ; 150b (0:150b) ld a,$6e ; ":L" tile ID ld [hli],a ld c,2 ; number of digits - ld a,[wcfb9] ; level + ld a,[wLoadedMonLevel] ; level cp a,100 jr c,PrintLevelCommon ; if level at least 100, write over the ":L" tile @@ -531,12 +531,12 @@ PrintLevel:: ; 150b (0:150b) ; prints the level without leaving off ":L" regardless of level ; INPUT: ; hl = destination address -; [wcfb9] = level +; [wLoadedMonLevel] = level PrintLevelFull:: ; 151b (0:151b) ld a,$6e ; ":L" tile ID ld [hli],a ld c,3 ; number of digits - ld a,[wcfb9] ; level + ld a,[wLoadedMonLevel] ; level PrintLevelCommon:: ; 1523 (0:1523) ld [wd11e],a @@ -1183,7 +1183,7 @@ CloseTextDisplay:: ; 29e8 (0:29e8) ld [H_LOADEDROMBANK],a ld [$2000],a call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns) - ld hl,wcfc4 + ld hl,wCharRAMInUseForText res 0,[hl] ld a,[wd732] bit 3,a ; used fly warp @@ -1372,7 +1372,7 @@ AddItemToInventory:: ; 2bcf (0:2bcf) ; INPUT: ; [wListMenuID] = list menu ID -; [wcf8b] = address of the list (2 bytes) +; [wList] = address of the list (2 bytes) DisplayListMenuID:: ; 2be6 (0:2be6) xor a ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer @@ -1392,9 +1392,9 @@ DisplayListMenuID:: ; 2be6 (0:2be6) xor a ld [wMenuItemToSwap],a ; 0 means no item is currently being swapped ld [wd12a],a - ld a,[wcf8b] + ld a,[wList] ld l,a - ld a,[wcf8c] + ld a,[wList + 1] ld h,a ; hl = address of the list ld a,[hl] ld [wd12a],a ; [wd12a] = number of list entries @@ -1485,9 +1485,9 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53) ; if it's an item menu sla c ; item entries are 2 bytes long, so multiply by 2 .skipMultiplying - ld a,[wcf8b] + ld a,[wList] ld l,a - ld a,[wcf8c] + ld a,[wList + 1] ld h,a inc hl ; hl = beginning of list entries ld b,0 @@ -1516,7 +1516,7 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53) jr .storeChosenEntry .pokemonList ld hl,wPartyCount - ld a,[wcf8b] + ld a,[wList] cp l ; is it a list of party pokemon or box pokemon? ld hl,wPartyMonNicks jr z,.getPokemonName @@ -1707,9 +1707,9 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) ld b,$09 ld c,$0e call ClearScreenArea - ld a,[wcf8b] + ld a,[wList] ld e,a - ld a,[wcf8c] + ld a,[wList + 1] ld d,a inc de ; de = beginning of list entries ld a,[wListScrollOffset] @@ -1753,7 +1753,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) .pokemonPCMenu push hl ld hl,wPartyCount - ld a,[wcf8b] + ld a,[wList] cp l ; is it a list of party pokemon or box pokemon? ld hl,wPartyMonNicks jr z,.getPokemonName @@ -1798,7 +1798,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) push af push hl ld hl,wPartyCount - ld a,[wcf8b] + ld a,[wList] cp l ; is it a list of party pokemon or box pokemon? ld a,$00 jr z,.next @@ -1819,8 +1819,8 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) and a ; is it a list of party pokemon or box pokemon? jr z,.skipCopyingLevel .copyLevel - ld a,[wcf9b] - ld [wcfb9],a + ld a,[wLoadedMonBoxLevel] + ld [wLoadedMonLevel],a .skipCopyingLevel pop hl ld bc,$001c @@ -3335,11 +3335,11 @@ GetName:: ; 376b (0:376b) ret GetItemPrice:: ; 37df (0:37df) -; Stores item's price as BCD in [H_DOWNARROWBLINKCNT1] and [[H_DOWNARROWBLINKCNT2] +; Stores item's price as BCD at hItemPrice (3 bytes) ; Input: [wcf91] = item id ld a, [H_LOADEDROMBANK] push af - ld a, [wListMenuID] ; wListMenuID + ld a, [wListMenuID] cp MOVESLISTMENU ld a, BANK(ItemPrices) jr nz, .asm_37ed @@ -3347,7 +3347,7 @@ GetItemPrice:: ; 37df (0:37df) .asm_37ed ld [H_LOADEDROMBANK], a ld [$2000], a - ld hl, wcf8f + ld hl, wItemPrices ld a, [hli] ld h, [hl] ld l, a @@ -3361,11 +3361,11 @@ GetItemPrice:: ; 37df (0:37df) jr nz, .asm_3802 dec hl ld a, [hld] - ld [$ff8d], a + ld [hItemPrice + 2], a ld a, [hld] - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [hItemPrice + 1], a ld a, [hl] - ld [H_DOWNARROWBLINKCNT1], a ; $ff8b + ld [hItemPrice], a jr .asm_381c .getTMPrice ld a, Bank(GetMachinePrice) @@ -3373,7 +3373,7 @@ GetItemPrice:: ; 37df (0:37df) ld [$2000], a call GetMachinePrice .asm_381c - ld de, H_DOWNARROWBLINKCNT1 ; $ff8b + ld de, hItemPrice pop af ld [H_LOADEDROMBANK], a ld [$2000], a @@ -4540,7 +4540,7 @@ GetHealthBarColor:: ; Copy the current map's sprites' tile patterns to VRAM again after they have ; been overwritten by other tile patterns. ReloadMapSpriteTilePatterns:: ; 3e08 (0:3e08) - ld hl, wcfc4 + ld hl, wCharRAMInUseForText ld a, [hl] push af res 0, [hl] @@ -12,6 +12,8 @@ hSoftReset EQU $FF8A hBaseTileID EQU $FF8B +hItemPrice EQU $FF8B + ; counters for blinking down arrow H_DOWNARROWBLINKCNT1 EQU $FF8B H_DOWNARROWBLINKCNT2 EQU $FF8C @@ -152,6 +154,7 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10 H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn ; bit 0: draw HP fraction to the right of bar instead of below (for party menu) +; bit 1: menu is double spaced hFlags_0xFFF6 EQU $FFF6 hJoyInput EQU $FFF8 @@ -85,7 +85,7 @@ LoadMonData_: ; 1: enemymon ; 2: boxmon ; 3: daycaremon -; Return monster id at wcf91 and its data at wcf98. +; Return monster id at wcf91 and its data at wLoadedMon. ; Also load base stats at W_MONHDEXNUM for convenience. ld a, [wDayCareMonSpecies] @@ -125,7 +125,7 @@ LoadMonData_: call AddNTimes .copyMonData - ld de, wcf98 + ld de, wLoadedMon ld bc, wPartyMon2 - wPartyMon1 jp CopyData @@ -808,7 +808,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) cp a,ITEMLISTMENU jp nz,DisplayListMenuIDLoop ; only rearrange item list menus push hl - ld hl,wcf8b + ld hl,wList ld a,[hli] ld h,[hl] ld l,a @@ -854,7 +854,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) call DelayFrames push hl push de - ld hl,wcf8b + ld hl,wList ld a,[hli] ld h,[hl] ld l,a @@ -916,7 +916,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) jr .done .combineItemSlots ld [hl],a ; put the sum in the second item slot - ld hl,wcf8b + ld hl,wList ld a,[hli] ld h,[hl] ld l,a @@ -1022,7 +1022,7 @@ DisplayTextIDInit: ; 7096 (1:7096) .drawTextBoxBorder call TextBoxBorder .skipDrawingTextBoxBorder - ld hl,wcfc4 + ld hl,wCharRAMInUseForText set 0,[hl] ld hl,wFlags_0xcd60 bit 4,[hl] @@ -3823,8 +3823,8 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d) call AddNTimes ld e, l ld d, h - ld hl, wcf98 - call CopyData ; write new mon's data (from wcf98) + ld hl, wLoadedMon + call CopyData ; write new mon's data (from wLoadedMon) ld hl, wPartyMonOT ld a, [wPartyCount] dec a diff --git a/scripts/ceruleanhouse2.asm b/scripts/ceruleanhouse2.asm index 3fa72183..a40d9224 100755 --- a/scripts/ceruleanhouse2.asm +++ b/scripts/ceruleanhouse2.asm @@ -22,9 +22,9 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15) call LoadItemList ld hl, wStringBuffer2 + 11 ld a, l - ld [wcf8b], a + ld [wList], a ld a, h - ld [wcf8c], a + ld [wList + 1], a xor a ld [wcf93], a ld [wMenuItemToSwap], a @@ -786,12 +786,15 @@ wStringBuffer2:: ; cf70 wStringBuffer3:: ; cf81 ds 9 + 1 -wcf8b:: ds 1 -wcf8c:: ds 1 +wList:: ; cf8b + ds 2 + wcf8d:: ds 1 wcf8e:: ds 1 -wcf8f:: ds 1 -wcf90:: ds 1 + +wItemPrices:: ; cf8f + ds 2 + wcf91:: ds 1 wWhichPokemon:: ; cf92 @@ -807,25 +810,15 @@ wListMenuID:: ; cf94 wcf95:: ds 1 wcf96:: ds 1 wcf97:: ds 1 -wcf98:: ds 1 -wcf99:: ds 1 -wcf9a:: ds 1 -wcf9b:: ds 1 -wcf9c:: ds 4 -wcfa0:: ds 4 -wcfa4:: ds 2 -wcfa6:: ds 2 -wcfa8:: ds 7 -wcfaf:: ds 10 -wcfb9:: ds 1 -wcfba:: ds 1 -wcfbb:: ds 1 -wcfbc:: ds 2 -wcfbe:: ds 2 -wcfc0:: ds 2 -wcfc2:: ds 2 - -wcfc4:: ds 1 + +; LoadMonData copies mon data here +wLoadedMon:: party_struct wLoadedMon ; cf98 + +wCharRAMInUseForText:: ; cfc4 +; bit 0: the space in VRAM that is used to store walking tile patterns for +; the player and NPCs is in use for text tile patterns. this means +; that movement must be disabled. + ds 1 wWalkCounter:: ; cfc5 ; walk animation counter |