From 40c17c906b2b3f65b3b04b1933b90238a7ac5566 Mon Sep 17 00:00:00 2001 From: yenatch Date: Mon, 26 May 2014 14:04:56 -0700 Subject: Remove most static wram addresses. Use labels instead. For unknown addresses, use "w
". Label overleads are still an issue. --- engine/menu/party_menu.asm | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'engine/menu/party_menu.asm') diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index dbb6a40e..aefb2438 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -1,4 +1,4 @@ -; [$D07D] = menu type / message ID +; [wd07d] = menu type / message ID ; if less than $F0, it is a menu type ; menu types: ; 00: normal pokemon menu (e.g. Start menu) @@ -25,18 +25,18 @@ DrawPartyMenu_: ; 12cd2 (4:6cd2) callba Func_71791 ; load pokemon icon graphics RedrawPartyMenu_: ; 12ce3 (4:6ce3) - ld a,[$D07D] + ld a,[wd07d] cp a,$04 jp z,.printMessage call ErasePartyMenuCursors - callba SendBlkPacket_PartyMenu ; loads some data to $cf2e + callba SendBlkPacket_PartyMenu ; loads some data to wcf2e FuncCoord 3,0 ld hl,Coord ld de,W_PARTYMON1 xor a ld c,a ld [$FF8C],a ; loop counter - ld [$CF2D],a + ld [wcf2d],a .loop ld a,[de] cp a,$FF ; reached the terminator? @@ -58,7 +58,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) call LoadMonData pop hl push hl - ld a,[$CC35] + ld a,[wcc35] and a ; is the player swapping pokemon positions? jr z,.skipUnfilledRightArrow ; if the player is swapping pokemon positions @@ -76,7 +76,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) inc hl inc hl .skipUnfilledRightArrow - ld a,[$D07D] ; menu type + ld a,[wd07d] ; menu type cp a,$03 jr z,.teachMoveMenu cp a,$05 @@ -84,7 +84,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld bc,14 ; 14 columns to the right add hl,bc - ld de,$CF9C + ld de,wcf9c call PrintStatusCondition pop hl push hl @@ -137,25 +137,25 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld hl,EvosMovesPointerTable ld b,0 - ld a,[$CF98] ; pokemon ID + ld a,[wcf98] ; pokemon ID dec a add a rl b ld c,a add hl,bc - ld de,$CD6D + ld de,wcd6d ld a,BANK(EvosMovesPointerTable) ld bc,2 call FarCopyData - ld hl,$CD6D + ld hl,wcd6d ld a,[hli] ld h,[hl] ld l,a - ld de,$CD6D + ld de,wcd6d ld a,BANK(EvosMovesPointerTable) ld bc,13 call FarCopyData - ld hl,$CD6D + ld hl,wcd6d ld de,.notAbleToEvolveText ; loop through the pokemon's evolution entries .checkEvolutionsLoop @@ -170,7 +170,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) dec hl dec hl ld b,[hl] - ld a,[$D156] ; evolution stone item ID + ld a,[wd156] ; evolution stone item ID inc hl inc hl inc hl @@ -194,12 +194,12 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) ld b,$0A call GoPAL_SET .printMessage - ld hl,$D730 + ld hl,wd730 ld a,[hl] push af push hl set 6,[hl] ; turn off letter printing delay - ld a,[$D07D] ; message ID + ld a,[wd07d] ; message ID cp a,$F0 jr nc,.printItemUseMessage add a @@ -230,7 +230,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) ld h,[hl] ld l,a push hl - ld a,[$CF06] + ld a,[wcf06] ld hl,W_PARTYMON1NAME call GetPartyMonName pop hl @@ -315,14 +315,14 @@ RareCandyText: ; 12ec0 (4:6ec0) db "@" SetPartyMenuHealthBarColor: ; 12ec7 (4:6ec7) - ld hl, $cf1f - ld a, [$cf2d] + ld hl, wcf1f + ld a, [wcf2d] ld c, a ld b, $0 add hl, bc call GetHealthBarColor ld b, $fc call GoPAL_SET - ld hl, $cf2d + ld hl, wcf2d inc [hl] ret -- cgit v1.2.3 From 53ae0e93fad9f4c3eaef92f102b1eeb531e59d68 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 14 Jun 2014 04:12:40 -0700 Subject: Use monster struct macros in wram. Rename related labels for consistency. --- engine/menu/party_menu.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/menu/party_menu.asm') diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index aefb2438..8ad5260d 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -32,7 +32,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) callba SendBlkPacket_PartyMenu ; loads some data to wcf2e FuncCoord 3,0 ld hl,Coord - ld de,W_PARTYMON1 + ld de,wPartySpecies xor a ld c,a ld [$FF8C],a ; loop counter @@ -46,7 +46,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld a,c push hl - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName pop hl call PlaceString ; print the pokemon's name @@ -231,7 +231,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) ld l,a push hl ld a,[wcf06] - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName pop hl call PrintText -- cgit v1.2.3 From b36f793667924f868282ce979fabab3e95d642a5 Mon Sep 17 00:00:00 2001 From: yenatch Date: Mon, 16 Jun 2014 13:57:26 -0700 Subject: Use macros for predef calls/jumps instead of static ids. --- engine/menu/party_menu.asm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engine/menu/party_menu.asm') diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index 8ad5260d..d0a74c11 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -93,8 +93,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) set 0,a ld [$FFF6],a add hl,bc - ld a,$60 - call Predef ; draw HP bar and prints current / max HP + predef Func_128f6 ; draw HP bar and prints current / max HP ld a,[$FFF6] res 0,a ld [$FFF6],a @@ -103,8 +102,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) jr .printLevel .teachMoveMenu push hl - ld a,$43 - call Predef ; check if the pokemon can learn the move + predef CanLearnTM ; check if the pokemon can learn the move pop hl ld de,.ableToLearnMoveText ld a,c -- cgit v1.2.3 From bd533aa79bbe1998fd2b699bd7205da2de4fe55c Mon Sep 17 00:00:00 2001 From: "U-Fish-PC\\Daniel" Date: Wed, 25 Jun 2014 16:58:27 -0400 Subject: Use *Coord instead of FuncCoord Using 'Coord =' doesn't like using wTileMap So use hlCoord, deCoord, bcCoord, aCoord, Coorda, or dwCoord to avoid static addresses --- engine/menu/party_menu.asm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engine/menu/party_menu.asm') diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index d0a74c11..4e47361b 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -30,8 +30,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) jp z,.printMessage call ErasePartyMenuCursors callba SendBlkPacket_PartyMenu ; loads some data to wcf2e - FuncCoord 3,0 - ld hl,Coord + hlCoord 3, 0 ld de,wPartySpecies xor a ld c,a -- cgit v1.2.3