Sync coordinate macros with pokecrystal

This commit is contained in:
Rangi 2020-07-07 11:30:10 -04:00
parent 45ed05decf
commit 13129459f1
75 changed files with 675 additions and 661 deletions

View file

@ -184,17 +184,17 @@ CopyScreenTileBufferToVRAM::
ld c, 6
ld hl, $600 * 0
coord de, 0, 6 * 0
decoord 0, 6 * 0
call .setup
call DelayFrame
ld hl, $600 * 1
coord de, 0, 6 * 1
decoord 0, 6 * 1
call .setup
call DelayFrame
ld hl, $600 * 2
coord de, 0, 6 * 2
decoord 0, 6 * 2
call .setup
jp DelayFrame
@ -217,7 +217,7 @@ ClearScreen::
; for the bg map to update.
ld bc, 20 * 18
inc b
coord hl, 0, 0
hlcoord 0, 0
ld a, " "
.loop
ld [hli], a

View file

@ -31,7 +31,7 @@ DisplayListMenuID::
call DisplayTextBoxID ; draw the menu text box
call UpdateSprites ; disable sprites behind the text box
; the code up to .skipMovingSprites appears to be useless
coord hl, 4, 2 ; coordinates of upper left corner of menu text box
hlcoord 4, 2 ; coordinates of upper left corner of menu text box
lb de, 9, 14 ; height and width of menu text box
ld a, [wListMenuID]
and a ; is it a PC pokemon list?
@ -67,12 +67,12 @@ DisplayListMenuIDLoop::
jr z, .notOldManBattle
.oldManBattle
ld a, "▶"
Coorda 5, 4 ; place menu cursor in front of first menu entry
ldcoord_a 5, 4 ; place menu cursor in front of first menu entry
ld c, 80
call DelayFrames
xor a
ld [wCurrentMenuItem], a
coord hl, 5, 4
hlcoord 5, 4
ld a, l
ld [wMenuCursorLocation], a
ld a, h
@ -194,23 +194,23 @@ DisplayListMenuIDLoop::
DisplayChooseQuantityMenu::
; text box dimensions/coordinates for just quantity
coord hl, 15, 9
hlcoord 15, 9
ld b, 1 ; height
ld c, 3 ; width
ld a, [wListMenuID]
cp PRICEDITEMLISTMENU
jr nz, .drawTextBox
; text box dimensions/coordinates for quantity and price
coord hl, 7, 9
hlcoord 7, 9
ld b, 1 ; height
ld c, 11 ; width
.drawTextBox
call TextBoxBorder
coord hl, 16, 10
hlcoord 16, 10
ld a, [wListMenuID]
cp PRICEDITEMLISTMENU
jr nz, .printInitialQuantity
coord hl, 8, 10
hlcoord 8, 10
.printInitialQuantity
ld de, InitialQuantityText
call PlaceString
@ -250,7 +250,7 @@ DisplayChooseQuantityMenu::
ld a, [wMaxItemQuantity]
ld [hl], a
.handleNewQuantity
coord hl, 17, 10
hlcoord 17, 10
ld a, [wListMenuID]
cp PRICEDITEMLISTMENU
jr nz, .printQuantity
@ -289,13 +289,13 @@ DisplayChooseQuantityMenu::
ldh a, [hDivideBCDQuotient + 2]
ldh [hMoney + 2], a
.skipHalvingPrice
coord hl, 12, 10
hlcoord 12, 10
ld de, SpacesBetweenQuantityAndPriceText
call PlaceString
ld de, hMoney ; total price
ld c, $a3
call PrintBCDNumber
coord hl, 9, 10
hlcoord 9, 10
.printQuantity
ld de, wItemQuantity ; current quantity
lb bc, LEADING_ZEROES | 1, 2 ; 1 byte, 2 digits
@ -334,7 +334,7 @@ ExitListMenu::
ret
PrintListMenuEntries::
coord hl, 5, 3
hlcoord 5, 3
ld b, 9
ld c, 14
call ClearScreenArea
@ -359,7 +359,7 @@ PrintListMenuEntries::
jr nc, .noCarry
inc d
.noCarry
coord hl, 6, 4 ; coordinates of first list entry name
hlcoord 6, 4 ; coordinates of first list entry name
ld b, 4 ; print 4 names
.loop
ld a, b

View file

@ -103,7 +103,7 @@ OverworldLoopLessDelay::
jr nz, .checkForOpponent
bit 0, a
jr nz, .checkForOpponent
aCoord 8, 9
lda_coord 8, 9
ld [wTilePlayerStandingOn], a ; unused?
call DisplayTextID ; display either the start menu or the NPC/sign text
ld a, [wEnteringCableClub]
@ -688,7 +688,7 @@ CheckMapConnections::
; function to play a sound when changing maps
PlayMapChangeSound::
aCoord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on
lda_coord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on
cp $0b ; door tile in tileset 0
jr nz, .didNotGoThroughDoor
ld a, SFX_GO_INSIDE
@ -1297,7 +1297,7 @@ CheckForJumpingAndTilePairCollisions::
; if not jumping
CheckForTilePairCollisions2::
aCoord 8, 9 ; tile the player is on
lda_coord 8, 9 ; tile the player is on
ld [wTilePlayerStandingOn], a
CheckForTilePairCollisions::
@ -1438,7 +1438,7 @@ LoadCurrentMapView::
ld bc, $2
add hl, bc
.copyToVisibleAreaBuffer
coord de, 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank
decoord 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank
ld b, SCREEN_HEIGHT
.rowLoop2
ld c, SCREEN_WIDTH
@ -1711,7 +1711,7 @@ MoveTileBlockMapPointerNorth::
; the portion of the map that was newly exposed due to the player's movement
ScheduleNorthRowRedraw::
coord hl, 0, 0
hlcoord 0, 0
call CopyToRedrawRowOrColumnSrcTiles
ld a, [wMapViewVRAMPointer]
ldh [hRedrawRowOrColumnDest], a
@ -1733,7 +1733,7 @@ CopyToRedrawRowOrColumnSrcTiles::
ret
ScheduleSouthRowRedraw::
coord hl, 0, 16
hlcoord 0, 16
call CopyToRedrawRowOrColumnSrcTiles
ld a, [wMapViewVRAMPointer]
ld l, a
@ -1752,7 +1752,7 @@ ScheduleSouthRowRedraw::
ret
ScheduleEastColumnRedraw::
coord hl, 18, 0
hlcoord 18, 0
call ScheduleColumnRedrawHelper
ld a, [wMapViewVRAMPointer]
ld c, a
@ -1790,7 +1790,7 @@ ScheduleColumnRedrawHelper::
ret
ScheduleWestColumnRedraw::
coord hl, 0, 0
hlcoord 0, 0
call ScheduleColumnRedrawHelper
ld a, [wMapViewVRAMPointer]
ldh [hRedrawRowOrColumnDest], a
@ -2342,7 +2342,7 @@ LoadMapData::
call LoadTilesetTilePatternData
call LoadCurrentMapView
; copy current map view to VRAM
coord hl, 0, 0
hlcoord 0, 0
ld de, vBGMap0
ld b, 18
.vramCopyLoop

View file

@ -76,7 +76,7 @@ PlaceNextChar::
cp "<LINE>"
jr nz, .NotLine
pop hl
coord hl, 1, 16
hlcoord 1, 16
push hl
jp NextChar
@ -207,12 +207,12 @@ PromptText::
cp LINK_STATE_BATTLING
jp z, .ok
ld a, "▼"
Coorda 18, 16
ldcoord_a 18, 16
.ok
call ProtectedDelay3
call ManualTextScroll
ld a, " "
Coorda 18, 16
ldcoord_a 18, 16
DoneText::
pop hl
@ -226,49 +226,49 @@ DoneText::
Paragraph::
push de
ld a, "▼"
Coorda 18, 16
ldcoord_a 18, 16
call ProtectedDelay3
call ManualTextScroll
coord hl, 1, 13
hlcoord 1, 13
lb bc, 4, 18
call ClearScreenArea
ld c, 20
call DelayFrames
pop de
coord hl, 1, 14
hlcoord 1, 14
jp NextChar
PageChar::
push de
ld a, "▼"
Coorda 18, 16
ldcoord_a 18, 16
call ProtectedDelay3
call ManualTextScroll
coord hl, 1, 10
hlcoord 1, 10
lb bc, 7, 18
call ClearScreenArea
ld c, 20
call DelayFrames
pop de
pop hl
coord hl, 1, 11
hlcoord 1, 11
push hl
jp NextChar
_ContText::
ld a, "▼"
Coorda 18, 16
ldcoord_a 18, 16
call ProtectedDelay3
push de
call ManualTextScroll
pop de
ld a, " "
Coorda 18, 16
ldcoord_a 18, 16
_ContTextNoPause::
push de
call ScrollTextUpOneLine
call ScrollTextUpOneLine
coord hl, 1, 16
hlcoord 1, 16
pop de
jp NextChar
@ -277,8 +277,8 @@ _ContTextNoPause::
; first time, copy the two rows of text to the "in between" rows that are usually emtpy
; second time, copy the bottom row of text into the top row of text
ScrollTextUpOneLine::
coord hl, 0, 14 ; top row of text
coord de, 0, 13 ; empty line above text
hlcoord 0, 14 ; top row of text
decoord 0, 13 ; empty line above text
ld b, SCREEN_WIDTH * 3
.copyText
ld a, [hli]
@ -286,7 +286,7 @@ ScrollTextUpOneLine::
inc de
dec b
jr nz, .copyText
coord hl, 1, 16
hlcoord 1, 16
ld a, " "
ld b, SCREEN_WIDTH - 2
.clearText
@ -424,7 +424,7 @@ TextCommand_MOVE::
TextCommand_LOW::
; write text at (1,16)
pop hl
coord bc, 1, 16 ; second line of dialogue text box
bccoord 1, 16 ; second line of dialogue text box
jp NextTextCommand
TextCommand_PROMPT_BUTTON::
@ -433,12 +433,12 @@ TextCommand_PROMPT_BUTTON::
cp LINK_STATE_BATTLING
jp z, TextCommand_WAIT_BUTTON
ld a, "▼"
Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box
ldcoord_a 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, " "
Coorda 18, 16 ; overwrite down arrow with blank space
ldcoord_a 18, 16 ; overwrite down arrow with blank space
pop hl
jp NextTextCommand
@ -446,11 +446,11 @@ TextCommand_SCROLL::
; pushes text up two lines and sets the BC cursor to the border tile
; below the first character column of the text box.
ld a, " "
Coorda 18, 16 ; place blank space in lower right corner of dialogue text box
ldcoord_a 18, 16 ; place blank space in lower right corner of dialogue text box
call ScrollTextUpOneLine
call ScrollTextUpOneLine
pop hl
coord bc, 1, 16 ; second line of dialogue text box
bccoord 1, 16 ; second line of dialogue text box
jp NextTextCommand
TextCommand_START_ASM::

View file

@ -134,7 +134,7 @@ AutoBgMapTransfer::
dec a
jr z, .transferMiddleThird
.transferBottomThird
coord hl, 0, 12
hlcoord 0, 12
ld sp, hl
ldh a, [hAutoBGTransferDest + 1]
ld h, a
@ -145,7 +145,7 @@ AutoBgMapTransfer::
xor a ; TRANSFERTOP
jr .doTransfer
.transferTopThird
coord hl, 0, 0
hlcoord 0, 0
ld sp, hl
ldh a, [hAutoBGTransferDest + 1]
ld h, a
@ -154,7 +154,7 @@ AutoBgMapTransfer::
ld a, TRANSFERMIDDLE
jr .doTransfer
.transferMiddleThird
coord hl, 0, 6
hlcoord 0, 6
ld sp, hl
ldh a, [hAutoBGTransferDest + 1]
ld h, a

View file

@ -14,7 +14,7 @@ Func_35f4::
InitYesNoTextBoxParameters::
xor a ; YES_NO_MENU
ld [wTwoOptionMenuID], a
coord hl, 14, 7
hlcoord 14, 7
ld bc, $80f
ret
@ -22,7 +22,7 @@ YesNoChoicePokeCenter::
call SaveScreenTilesToBuffer1
ld a, HEAL_CANCEL_MENU
ld [wTwoOptionMenuID], a
coord hl, 11, 6
hlcoord 11, 6
lb bc, 8, 12
jr DisplayYesNoChoice
@ -30,7 +30,7 @@ WideYesNoChoice:: ; unused
call SaveScreenTilesToBuffer1
ld a, WIDE_YES_NO_MENU
ld [wTwoOptionMenuID], a
coord hl, 12, 7
hlcoord 12, 7
lb bc, 8, 13
DisplayYesNoChoice::