diff options
| author | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2014-06-25 16:58:27 -0400 |
|---|---|---|
| committer | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2014-06-25 16:58:27 -0400 |
| commit | bd533aa79bbe1998fd2b699bd7205da2de4fe55c (patch) | |
| tree | 90d7000b49fc29d65a3a90a04074f7a7dd8a475f /home | |
| parent | Use macros for predef calls/jumps instead of static ids. (diff) | |
| download | pokeyellow-bd533aa79bbe1998fd2b699bd7205da2de4fe55c.tar.gz pokeyellow-bd533aa79bbe1998fd2b699bd7205da2de4fe55c.tar.xz pokeyellow-bd533aa79bbe1998fd2b699bd7205da2de4fe55c.zip | |
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
Diffstat (limited to '')
| -rw-r--r-- | home.asm | 53 | ||||
| -rw-r--r-- | home/overworld.asm | 21 | ||||
| -rw-r--r-- | home/text.asm | 60 | ||||
| -rw-r--r-- | home/vcopy.asm | 9 |
4 files changed, 48 insertions, 95 deletions
@@ -1937,8 +1937,7 @@ DisplayListMenuID:: ; 2be6 (0:2be6) ld [wd125],a call DisplayTextBoxID ; draw the menu text box call UpdateSprites ; move sprites - FuncCoord 4,2 ; coordinates of upper left corner of menu text box - ld hl,Coord + hlCoord 4, 2 ; coordinates of upper left corner of menu text box ld de,$090e ; height and width of menu text box ld a,[wListMenuID] and a ; is it a PC pokemon list? @@ -1974,13 +1973,12 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53) jr z,.notOldManBattle .oldManBattle ld a,"▶" - FuncCoord 5,4 - ld [Coord],a ; place menu cursor in front of first menu entry + Coorda 5, 4 ; place menu cursor in front of first menu entry ld c,80 call DelayFrames xor a ld [wCurrentMenuItem],a - ld hl,Coord + hlCoord 5, 4 ld a,l ld [wMenuCursorLocation],a ld a,h @@ -2099,27 +2097,23 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53) DisplayChooseQuantityMenu:: ; 2d57 (0:2d57) ; text box dimensions/coordinates for just quantity - FuncCoord 15,9 - ld hl,Coord + hlCoord 15, 9 ld b,1 ; height ld c,3 ; width ld a,[wListMenuID] cp a,PRICEDITEMLISTMENU jr nz,.drawTextBox ; text box dimensions/coordinates for quantity and price - FuncCoord 7,9 - ld hl,Coord + hlCoord 7, 9 ld b,1 ; height ld c,11 ; width .drawTextBox call TextBoxBorder - FuncCoord 16,10 - ld hl,Coord + hlCoord 16, 10 ld a,[wListMenuID] cp a,PRICEDITEMLISTMENU jr nz,.printInitialQuantity - FuncCoord 8,10 - ld hl,Coord + hlCoord 8, 10 .printInitialQuantity ld de,InitialQuantityText call PlaceString @@ -2159,8 +2153,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57) ld a,[wcf97] ; max quantity ld [hl],a .handleNewQuantity - FuncCoord 17,10 - ld hl,Coord + hlCoord 17, 10 ld a,[wListMenuID] cp a,PRICEDITEMLISTMENU jr nz,.printQuantity @@ -2199,15 +2192,13 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57) ld a,[$ffa4] ld [$ffa1],a .skipHalvingPrice - FuncCoord 12,10 - ld hl,Coord + hlCoord 12, 10 ld de,SpacesBetweenQuantityAndPriceText call PlaceString ld de,$ff9f ; total price ld c,$a3 call PrintBCDNumber - FuncCoord 9,10 - ld hl,Coord + hlCoord 9, 10 .printQuantity ld de,wcf96 ; current quantity ld bc,$8102 ; print leading zeroes, 1 byte, 2 digits @@ -2246,8 +2237,7 @@ ExitListMenu:: ; 2e3b (0:2e3b) ret PrintListMenuEntries:: ; 2e5a (0:2e5a) - FuncCoord 5, 3 - ld hl,Coord + hlCoord 5, 3 ld b,$09 ld c,$0e call ClearScreenArea @@ -2272,8 +2262,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a) jr nc,.noCarry inc d .noCarry - FuncCoord 6,4 ; coordinates of first list entry name - ld hl,Coord + hlCoord 6, 4 ; coordinates of first list entry name ld b,4 ; print 4 names .loop ld a,b @@ -3539,8 +3528,7 @@ Func_35f4:: ; 35f4 (0:35f4) InitYesNoTextBoxParameters:: ; 35ff (0:35ff) xor a ld [wd12c], a - FuncCoord 14, 7 - ld hl, Coord + hlCoord 14, 7 ld bc, $80f ret @@ -3548,8 +3536,7 @@ YesNoChoicePokeCenter:: ; 360a (0:360a) call SaveScreenTilesToBuffer1 ld a, $6 ld [wd12c], a - FuncCoord 11, 6 - ld hl, Coord + hlCoord 11, 6 ld bc, $80c jr DisplayYesNoChoice @@ -3557,8 +3544,7 @@ Func_361a:: ; 361a (0:361a) call SaveScreenTilesToBuffer1 ld a, $3 ld [wd12c], a - FuncCoord 12, 7 - ld hl, Coord + hlCoord 12, 7 ld bc, $080d DisplayYesNoChoice:: ; 3628 (0:3628) ld a, $14 @@ -3995,8 +3981,7 @@ WaitForTextScrollButtonPress:: ; 3865 (0:3865) jr z, .asm_387c call Func_716c6 .asm_387c - FuncCoord 18, 16 - ld hl, Coord + hlCoord 18, 16 call HandleDownArrowBlinkTiming pop hl call JoypadLowSensitivity @@ -4472,8 +4457,7 @@ HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2) and a ; was a key pressed? jr nz,.keyPressed push hl - FuncCoord 18,11 ; coordinates of blinking down arrow in some menus - ld hl,Coord + hlCoord 18, 11 ; coordinates of blinking down arrow in some menus call HandleDownArrowBlinkTiming ; blink down arrow (if any) pop hl ld a,[wMenuJoypadPollCount] @@ -4734,8 +4718,7 @@ PrintText:: ; 3c49 (0:3c49) call Delay3 pop hl Func_3c59:: ; 3c59 (0:3c59) - FuncCoord 1,14 - ld bc,Coord + bcCoord 1, 14 jp TextCommandProcessor ; converts a big-endian binary number into decimal and prints it diff --git a/home/overworld.asm b/home/overworld.asm index 872d63ee..cf36aba8 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -105,8 +105,7 @@ OverworldLoopLessDelay:: jr nz,.checkForOpponent bit 0,a jr nz,.checkForOpponent - FuncCoord 8, 9 - ld a,[Coord] + aCoord 8, 9 ld [wcf0e],a call DisplayTextID ; display either the start menu or the NPC/sign text ld a,[wcc47] @@ -670,8 +669,7 @@ CheckMapConnections:: ; 07ba (0:07ba) ; function to play a sound when changing maps PlayMapChangeSound:: ; 08c9 (0:08c9) - FuncCoord 8, 8 - ld a,[Coord] ; upper left tile of the 4x4 square the player's sprite is standing on + aCoord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on cp a,$0b ; door tile in tileset 0 jr nz,.didNotGoThroughDoor ld a,(SFX_02_57 - SFX_Headers_02) / 3 @@ -1279,8 +1277,7 @@ CheckForJumpingAndTilePairCollisions:: ; 0c2a (0:0c2a) ; if not jumping Func_c44:: ; 0c44 (0:0c44) - FuncCoord 8, 9 - ld a,[Coord] ; tile the player is on + aCoord 8, 9 ; tile the player is on ld [wcf0e],a CheckForTilePairCollisions:: ; 0c4a (0:0c4a) @@ -1694,8 +1691,7 @@ MoveTileBlockMapPointerNorth:: ; 0e85 (0:0e85) ; the portion of the map that was newly exposed due to the player's movement ScheduleNorthRowRedraw:: ; 0e91 (0:0e91) - FuncCoord 0, 0 - ld hl,Coord + hlCoord 0, 0 call ScheduleRowRedrawHelper ld a,[wd526] ld [H_SCREENEDGEREDRAWADDR],a @@ -1717,8 +1713,7 @@ ScheduleRowRedrawHelper:: ; 0ea6 (0:0ea6) ret ScheduleSouthRowRedraw:: ; 0eb2 (0:0eb2) - FuncCoord 0,16 - ld hl,Coord + hlCoord 0, 16 call ScheduleRowRedrawHelper ld a,[wd526] ld l,a @@ -1737,8 +1732,7 @@ ScheduleSouthRowRedraw:: ; 0eb2 (0:0eb2) ret ScheduleEastColumnRedraw:: ; 0ed3 (0:0ed3) - FuncCoord 18,0 - ld hl,Coord + hlCoord 18, 0 call ScheduleColumnRedrawHelper ld a,[wd526] ld c,a @@ -1776,8 +1770,7 @@ ScheduleColumnRedrawHelper:: ; 0ef2 (0:0ef2) ret ScheduleWestColumnRedraw:: ; 0f08 (0:0f08) - FuncCoord 0,0 - ld hl,Coord + hlCoord 0, 0 call ScheduleColumnRedrawHelper ld a,[wd526] ld [H_SCREENEDGEREDRAWADDR],a diff --git a/home/text.asm b/home/text.asm index 46c17b07..abcac9fd 100644 --- a/home/text.asm +++ b/home/text.asm @@ -76,8 +76,7 @@ PlaceNextChar:: ; 1956 (0:1956) cp $4F jr nz,.next3 pop hl - FuncCoord 1, 16 - ld hl,Coord + hlCoord 1, 16 push hl jp Next19E8 @@ -270,14 +269,12 @@ Char58:: ; 1a95 (0:1a95) cp 4 jp z,Next1AA2 ld a,$EE - FuncCoord 18, 16 - ld [Coord],a + Coorda 18, 16 Next1AA2:: ; 1aa2 (0:1aa2) call ProtectedDelay3 call ManualTextScroll ld a,$7F - FuncCoord 18, 16 - ld [Coord],a + Coorda 18, 16 Char57:: ; 1aad (0:1aad) pop hl ld de,Char58Text @@ -290,67 +287,56 @@ Char58Text:: ; 1ab3 (0:1ab3) Char51:: ; 1ab4 (0:1ab4) push de ld a,$EE - FuncCoord 18, 16 - ld [Coord],a + Coorda 18, 16 call ProtectedDelay3 call ManualTextScroll - FuncCoord 1, 13 - ld hl,Coord + hlCoord 1, 13 ld bc,$0412 call ClearScreenArea ld c,$14 call DelayFrames pop de - FuncCoord 1, 14 - ld hl,Coord + hlCoord 1, 14 jp Next19E8 Char49:: ; 1ad5 (0:1ad5) push de ld a,$EE - FuncCoord 18, 16 - ld [Coord],a + Coorda 18, 16 call ProtectedDelay3 call ManualTextScroll - FuncCoord 1, 10 - ld hl,Coord + hlCoord 1, 10 ld bc,$0712 call ClearScreenArea ld c,$14 call DelayFrames pop de pop hl - FuncCoord 1, 11 - ld hl,Coord + hlCoord 1, 11 push hl jp Next19E8 Char4B:: ; 1af8 (0:1af8) ld a,$EE - FuncCoord 18, 16 - ld [Coord],a + Coorda 18, 16 call ProtectedDelay3 push de call ManualTextScroll pop de ld a,$7F - FuncCoord 18, 16 - ld [Coord],a + Coorda 18, 16 ;fall through Char4C:: ; 1b0a (0:1b0a) push de call Next1B18 call Next1B18 - FuncCoord 1, 16 - ld hl,Coord + hlCoord 1, 16 pop de jp Next19E8 Next1B18:: ; 1b18 (0:1b18) - FuncCoord 0, 14 - ld hl,Coord - FuncCoord 0, 13 - ld de,Coord + hlCoord 0, 14 + deCoord 0, 13 ld b,$3C .next ld a,[hli] @@ -358,8 +344,7 @@ Next1B18:: ; 1b18 (0:1b18) inc de dec b jr nz,.next - FuncCoord 1, 16 - ld hl,Coord + hlCoord 1, 16 ld a,$7F ld b,$12 .next2 @@ -514,8 +499,7 @@ TextCommand03:: ; 1bb7 (0:1bb7) ; (no arguments) TextCommand05:: ; 1bc5 (0:1bc5) pop hl - FuncCoord 1, 16 - ld bc,Coord ; address of second line of dialogue text box + bcCoord 1, 16 ; address of second line of dialogue text box jp NextTextCommand ; blink arrow and wait for A or B to be pressed @@ -526,14 +510,12 @@ TextCommand06:: ; 1bcc (0:1bcc) cp a,$04 jp z,TextCommand0D ld a,$ee ; down arrow - FuncCoord 18, 16 - ld [Coord],a ; place down arrow in lower right corner of dialogue text box + Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box push bc call ManualTextScroll ; blink arrow and wait for A or B to be pressed pop bc ld a," " - FuncCoord 18, 16 - ld [Coord],a ; overwrite down arrow with blank space + Coorda 18, 16 ; overwrite down arrow with blank space pop hl jp NextTextCommand @@ -542,13 +524,11 @@ TextCommand06:: ; 1bcc (0:1bcc) ; (no arguments) TextCommand07:: ; 1be7 (0:1be7) ld a," " - FuncCoord 18, 16 - ld [Coord],a ; place blank space in lower right corner of dialogue text box + Coorda 18, 16 ; place blank space in lower right corner of dialogue text box call Next1B18 ; scroll up text call Next1B18 pop hl - FuncCoord 1, 16 - ld bc,Coord ; address of second line of dialogue text box + bcCoord 1, 16 ; address of second line of dialogue text box jp NextTextCommand ; execute asm inline diff --git a/home/vcopy.asm b/home/vcopy.asm index 71487cf1..81fcb991 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -130,8 +130,7 @@ AutoBgMapTransfer:: ; 1d57 (0:1d57) dec a jr z,.transferMiddleThird .transferBottomThird - FuncCoord 0,12 - ld hl,Coord + hlCoord 0, 12 ld sp,hl ld a,[H_AUTOBGTRANSFERDEST + 1] ld h,a @@ -142,8 +141,7 @@ AutoBgMapTransfer:: ; 1d57 (0:1d57) xor a ; TRANSFERTOP jr .doTransfer .transferTopThird - FuncCoord 0,0 - ld hl,Coord + hlCoord 0, 0 ld sp,hl ld a,[H_AUTOBGTRANSFERDEST + 1] ld h,a @@ -152,8 +150,7 @@ AutoBgMapTransfer:: ; 1d57 (0:1d57) ld a,TRANSFERMIDDLE jr .doTransfer .transferMiddleThird - FuncCoord 0,6 - ld hl,Coord + hlCoord 0, 6 ld sp,hl ld a,[H_AUTOBGTRANSFERDEST + 1] ld h,a |
