mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
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
This commit is contained in:
parent
b36f793667
commit
bd533aa79b
53 changed files with 519 additions and 975 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue