diff options
author | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-06-07 14:36:55 -0400 |
---|---|---|
committer | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-06-07 14:36:55 -0400 |
commit | 51c3bd8b762c7c7412b44472f7dd4aac2cc11ef7 (patch) | |
tree | 2d6066a2bc993d95ba6e50dca1209692c3ace142 | |
parent | e66ff56ab78b6d03133d6e673ab954f3445cb3b1 (diff) |
Fixed many homebank functions.
Func_159b, fade.asm, init.asm, lcdc.asm, play_time.asm, serial.asm,
text.asm.
Added some wram/hram addresses too.
-rw-r--r-- | home.asm | 15 | ||||
-rw-r--r-- | home/fade.asm | 21 | ||||
-rw-r--r-- | home/init.asm | 10 | ||||
-rw-r--r-- | home/lcdc.asm | 19 | ||||
-rw-r--r-- | home/play_time.asm | 2 | ||||
-rw-r--r-- | home/serial.asm | 69 | ||||
-rw-r--r-- | home/text.asm | 154 | ||||
-rw-r--r-- | hram.asm | 2 | ||||
-rwxr-xr-x | wram.asm | 11 |
9 files changed, 184 insertions, 119 deletions
@@ -1078,8 +1078,19 @@ Func_157c:: ; 157c (0:157c) pop bc pop hl ret - -INCLUDE "data/collision.asm" + +Func_159b:: ; 159b (0:159b) + ld a,[H_LOADEDROMBANK] + ld b,a + push af + callsb Func_fd2a1 + pop af + call BankswitchCommon + ret + +;INCLUDE "data/collision.asm" + +INCLUDE "home/lcdc.asm" IsTilePassable:: ; 15c3 (0:15c3) ; sets carry if tile is passable, resets carry otherwise diff --git a/home/fade.asm b/home/fade.asm index 08e087b4..166ba9ee 100644 --- a/home/fade.asm +++ b/home/fade.asm @@ -1,7 +1,7 @@ ; These routines manage gradual fading ; (e.g., entering a doorway) -LoadGBPal:: - ld a, [wMapPalOffset] ;tells if cur.map is dark (requires HM5_FLASH?) +LoadGBPal:: ; 1e6f (0:1e6f) + ld a, [wMapPalOffset] ; tells if W_CURMAP is dark (requires HM5_FLASH?) ld b, a ld hl, FadePal4 ld a, l @@ -16,31 +16,37 @@ LoadGBPal:: ld [rOBP0], a ld a, [hli] ld [rOBP1], a + call Func_3021 + call Func_3040 + call Func_3061 ret -GBFadeInFromBlack:: +GBFadeInFromBlack:: ; 1e8f (0:1e8f) ld hl, FadePal1 ld b, 4 jr GBFadeIncCommon -GBFadeOutToWhite:: +GBFadeOutToWhite:: ; 1e96 (0:1e96) ld hl, FadePal6 ld b, 3 -GBFadeIncCommon: +GBFadeIncCommon: ; 1e9b (0:1e9b) ld a, [hli] ld [rBGP], a ld a, [hli] ld [rOBP0], a ld a, [hli] ld [rOBP1], a + call Func_3021 + call Func_3040 + call Func_3061 ld c, 8 call DelayFrames dec b jr nz, GBFadeIncCommon ret -GBFadeOutToBlack:: +GBFadeOutToBlack:: ; 1eb6 (0:1eb6) ld hl, FadePal4 + 2 ld b, 4 jr GBFadeDecCommon @@ -56,6 +62,9 @@ GBFadeDecCommon: ld [rOBP0], a ld a, [hld] ld [rBGP], a + call Func_3021 + call Func_3040 + call Func_3061 ld c, 8 call DelayFrames dec b diff --git a/home/init.asm b/home/init.asm index 202bd110..e4d980ef 100644 --- a/home/init.asm +++ b/home/init.asm @@ -1,11 +1,11 @@ -SoftReset:: +SoftReset:: ; 1d08 (0:1d08) call StopAllSounds call GBPalWhiteOut ld c, $20 call DelayFrames ; fallthrough -Init:: +Init:: ; 1d10 ; Program init. rLCDC_DEFAULT EQU %11100011 @@ -51,7 +51,7 @@ rLCDC_DEFAULT EQU %11100011 or c jr nz, .loop - call ClearVram + call ClearVram ; 1dc6 ld hl, $ff80 ld bc, $ffff - $ff80 @@ -70,6 +70,8 @@ rLCDC_DEFAULT EQU %11100011 ld [hSCX], a ld [hSCY], a ld [$ff0f], a + ld [wc0f3], a + ld [wc0f4], a ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL ld [rIE], a @@ -118,7 +120,7 @@ rLCDC_DEFAULT EQU %11100011 jp SetDefaultNamesBeforeTitlescreen -ClearVram: +ClearVram: ; 1dc6 (0:1dc6) ld hl, $8000 ld bc, $2000 xor a diff --git a/home/lcdc.asm b/home/lcdc.asm new file mode 100644 index 00000000..7057f755 --- /dev/null +++ b/home/lcdc.asm @@ -0,0 +1,19 @@ +LCDC:: ; 15ac (0:15ac) + push af + ld a,[hLCDCPointer] ; doubles as enabling byte + and a + jr z,.noLCDCInterrupt + push hl + ld a,[rLY] + ld l,a + ld h,$c7 + ld h,[hl] ; h != not part of pointer + ld a,[hLCDCPointer] + ld l,a + ld a,h + ld h,$ff + ld [hl],a + pop hl +.noLCDCInterrupt + pop af + reti
\ No newline at end of file diff --git a/home/play_time.asm b/home/play_time.asm index 16802f7e..3d605a57 100644 --- a/home/play_time.asm +++ b/home/play_time.asm @@ -46,7 +46,7 @@ TrackPlayTime: ; 1ef5 (0:1ef5) ld [W_PLAYTIMEMINUTES], a ret -CountDownIgnoreInputBitReset: ; 18e36 (6:4e36) +CountDownIgnoreInputBitReset: ; 1f54 (0:1f54) ld a, [wIgnoreInputCounter] and a jr nz, .asm_1f5e diff --git a/home/serial.asm b/home/serial.asm index 1f0146d9..3c5c343b 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -1,8 +1,11 @@ -Serial:: ; 2125 (0:2125) +Serial:: ; 1f78 (0:1f78) push af push bc push de push hl + ld a, [wUnknownSerialFlag_d49a] + bit 0,a + jp nz,Func_2162 ld a, [hSerialConnectionStatus] inc a jr z, .connectionNotYetEstablished @@ -86,84 +89,84 @@ Serial_ExchangeBytes:: ; 216f (0:216f) jr nz, .loop ret -Serial_ExchangeByte:: ; 219a (0:219a) +Serial_ExchangeByte:: ; 1ff6 (0:1ff6) xor a ld [hSerialReceivedNewData], a ld a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK - jr nz, .asm_21a7 + jr nz, .asm_2003 ld a, START_TRANSFER_INTERNAL_CLOCK ld [rSC], a -.asm_21a7 +.asm_2003 ld a, [hSerialReceivedNewData] and a - jr nz, .asm_21f1 + jr nz, .asm_204d ld a, [hSerialConnectionStatus] cp USING_EXTERNAL_CLOCK - jr nz, .asm_21cc + jr nz, .asm_2028 call IsUnknownCounterZero - jr z, .asm_21cc + jr z, .asm_2028 call WaitLoop_15Iterations push hl ld hl, wUnknownSerialCounter + 1 inc [hl] - jr nz, .asm_21c3 + jr nz, .asm_201f dec hl inc [hl] -.asm_21c3 +.asm_201f pop hl call IsUnknownCounterZero - jr nz, .asm_21a7 + jr nz, .asm_2003 jp SetUnknownCounterToFFFF -.asm_21cc +.asm_2028 ld a, [rIE] and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) cp (1 << SERIAL) - jr nz, .asm_21a7 + jr nz, .asm_2003 ld a, [wUnknownSerialCounter2] dec a ld [wUnknownSerialCounter2], a - jr nz, .asm_21a7 + jr nz, .asm_2003 ld a, [wUnknownSerialCounter2 + 1] dec a ld [wUnknownSerialCounter2 + 1], a - jr nz, .asm_21a7 + jr nz, .asm_2003 ld a, [hSerialConnectionStatus] cp USING_EXTERNAL_CLOCK - jr z, .asm_21f1 + jr z, .asm_204d ld a, 255 .waitLoop dec a jr nz, .waitLoop -.asm_21f1 +.asm_204d xor a ld [hSerialReceivedNewData], a ld a, [rIE] and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) sub (1 << SERIAL) - jr nz, .asm_2204 + jr nz, .asm_2060 ld [wUnknownSerialCounter2], a ld a, $50 ld [wUnknownSerialCounter2 + 1], a -.asm_2204 +.asm_2060 ld a, [hSerialReceiveData] cp SERIAL_NO_DATA_BYTE ret nz call IsUnknownCounterZero - jr z, .asm_221f + jr z, .asm_207b push hl ld hl, wUnknownSerialCounter + 1 ld a, [hl] dec a ld [hld], a inc a - jr nz, .asm_2219 + jr nz, .asm_2075 dec [hl] -.asm_2219 +.asm_2075 pop hl call IsUnknownCounterZero jr z, SetUnknownCounterToFFFF -.asm_221f +.asm_207b ld a, [rIE] and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) cp (1 << SERIAL) @@ -174,14 +177,14 @@ Serial_ExchangeByte:: ; 219a (0:219a) call DelayFrame jp Serial_ExchangeByte -WaitLoop_15Iterations:: ; 2231 (0:2231) +WaitLoop_15Iterations:: ; 208d (0:208d) ld a, 15 .waitLoop dec a jr nz, .waitLoop ret -IsUnknownCounterZero:: ; 2237 (0:2237) +IsUnknownCounterZero:: ; 2093 (0:2093) push hl ld hl, wUnknownSerialCounter ld a, [hli] @@ -190,7 +193,7 @@ IsUnknownCounterZero:: ; 2237 (0:2237) ret ; a is always 0 when this is called -SetUnknownCounterToFFFF:: ; 223f (0:223f) +SetUnknownCounterToFFFF:: ; 209b (0:209b) dec a ld [wUnknownSerialCounter], a ld [wUnknownSerialCounter + 1], a @@ -223,9 +226,9 @@ Serial_ExchangeLinkMenuSelection:: ; 2247 (0:2247) jr nz, .loop ret -Serial_PrintWaitingTextAndSyncAndExchangeNybble:: ; 226e (0:226e) +Serial_PrintWaitingTextAndSyncAndExchangeNybble:: ; 20ca (0:20ca) call SaveScreenTilesToBuffer1 - callab PrintWaitingText + callab PrintWaitingText ; 1:4b89 call Serial_SyncAndExchangeNybble jp LoadScreenTilesFromBuffer1 @@ -269,7 +272,7 @@ Serial_SyncAndExchangeNybble:: ; 227f (0:227f) ld [wSerialSyncAndExchangeNybbleReceiveData], a ret -Serial_ExchangeNybble:: ; 22c3 (0:22c3) +Serial_ExchangeNybble:: ; 211f (0:211f) call .doExchange ld a, [wSerialExchangeNybbleSendData] add $60 @@ -292,7 +295,7 @@ Serial_ExchangeNybble:: ; 22c3 (0:22c3) ld [wSerialExchangeNybbleReceiveData], a ret -Serial_SendZeroByte:: ; 22ed (0:22ed) +Serial_SendZeroByte:: ; 2149 (0:2149) xor a ld [hSerialSendData], a ld a, [hSerialConnectionStatus] @@ -310,3 +313,11 @@ Serial_TryEstablishingExternallyClockedConnection:: ; 22fa (0:22fa) ld a, START_TRANSFER_EXTERNAL_CLOCK ld [rSC], a ret + +Func_2162:: ; 2162 (0:2162) + call Func_2fa7 + pop hl + pop de + pop bc + pop af + reti
\ No newline at end of file diff --git a/home/text.asm b/home/text.asm index 276b652e..ce2f3aa7 100644 --- a/home/text.asm +++ b/home/text.asm @@ -1,4 +1,4 @@ -TextBoxBorder:: +TextBoxBorder:: ; 16f0 (0:16f0) ; Draw a cxb text box at hl. ; top row @@ -37,7 +37,7 @@ TextBoxBorder:: ld [hl], "┘" ret -NPlaceChar:: +NPlaceChar:: ; 171d (0:171d) ; Place char a c times. ld d, c .loop @@ -46,23 +46,23 @@ NPlaceChar:: jr nz, .loop ret -PlaceString:: ; 1955 (0:1955) +PlaceString:: ; 1723 (0:1723) push hl -PlaceNextChar:: ; 1956 (0:1956) +PlaceNextChar:: ; 1724 (0:1724) ld a,[de] cp "@" - jr nz,.PlaceText + jr nz,Char4ETest ld b,h ld c,l pop hl ret -.PlaceText +Char4ETest:: ; 172d (0:172d) cp $4E jr nz,.next ld bc,$0028 - ld a,[hFlags_0xFFF6] + ld a,[hFlags_0xFFFA] bit 2,a jr z,.next2 ld bc,$14 @@ -70,7 +70,7 @@ PlaceNextChar:: ; 1956 (0:1956) pop hl add hl,bc push hl - jp Next19E8 + jp Next17B6 ; 17b6 .next cp $4F @@ -78,7 +78,7 @@ PlaceNextChar:: ; 1956 (0:1956) pop hl hlCoord 1, 16 push hl - jp Next19E8 + jp Next17B6 .next3 ; Check against a dictionary and a @@ -123,11 +123,11 @@ PlaceNextChar:: ; 1956 (0:1956) jp z,Char5A ld [hli],a call PrintLetterDelay -Next19E8:: ; 19e8 (0:19e8) +Next17B6:: ; 17b6 (0:17b6) inc de jp PlaceNextChar -Char00:: ; 19ec (0:19ec) +Char00:: ; 17ba (0:17ba) ld b,h ld c,l pop hl @@ -135,56 +135,56 @@ Char00:: ; 19ec (0:19ec) dec de ret -Char00Text:: ; 0x19f4 “%d ERROR.” - TX_FAR _Char00Text +Char00Text:: ; 17c2 (0:17c2) ; “%d ERROR.” + TX_FAR _Char00Text ; a0c66 (28:4c66) db "@" -Char52:: ; 0x19f9 player’s name +Char52:: ; 17c7 (0:17c7) ; player’s name push de ld de,wPlayerName jr FinishDTE -Char53:: ; 19ff (0:19ff) ; rival’s name +Char53:: ; 17cd (0:17cd) ; rival’s name push de ld de,W_RIVALNAME jr FinishDTE -Char5D:: ; 1a05 (0:1a05) ; TRAINER +Char5D:: ; 17d3 (0:17d3) ; TRAINER push de ld de,Char5DText jr FinishDTE -Char5C:: ; 1a0b (0:1a0b) ; TM +Char5C:: ; 17d9 (0:17d9) ; TM push de ld de,Char5CText jr FinishDTE -Char5B:: ; 1a11 (0:1a11) ; PC +Char5B:: ; 17df (0:17df) ; PC push de ld de,Char5BText jr FinishDTE -Char5E:: ; 1a17 (0:1a17) ; ROCKET +Char5E:: ; 17e5 (0:17e5) ; ROCKET push de ld de,Char5EText jr FinishDTE -Char54:: ; 1a1d (0:1a1d) ; POKé +Char54:: ; 17eb (0:17eb) ; POKé push de ld de,Char54Text jr FinishDTE -Char56:: ; 1a23 (0:1a23) ; …… +Char56:: ; 17f1 (0:17f1) ; …… push de ld de,Char56Text jr FinishDTE -Char4A:: ; 1a29 (0:1a29) ; PKMN +Char4A:: ; 17f7 (0:17f7) ; PKMN push de ld de,Char4AText jr FinishDTE -Char59:: ; 1a2f (0:1a2f) +Char59:: ; 17fb (0:17fb) ; depending on whose turn it is, print ; enemy active monster’s name, prefixed with “Enemy ” ; or @@ -194,7 +194,7 @@ Char59:: ; 1a2f (0:1a2f) xor 1 jr MonsterNameCharsCommon -Char5A:: ; 1a35 (0:1a35) +Char5A:: ; 1803 (0:1803) ; depending on whose turn it is, print ; player active monster’s name ; or @@ -211,12 +211,11 @@ MonsterNameCharsCommon:: ; 1a37 (0:1a37) ; print “Enemy ” ld de,Char5AText call PlaceString - ld h,b ld l,c ld de,wEnemyMonNick ; enemy active monster name -FinishDTE:: ; 1a4b (0:1a4b) +FinishDTE:: ; 1819 (0:1819) call PlaceString ld h,b ld l,c @@ -224,56 +223,56 @@ FinishDTE:: ; 1a4b (0:1a4b) inc de jp PlaceNextChar -Char5CText:: ; 1a55 (0:1a55) +Char5CText:: ; 1823 (0:1823) db "TM@" -Char5DText:: ; 1a58 (0:1a58) +Char5DText:: ; 1826 (0:1826) db "TRAINER@" -Char5BText:: ; 1a60 (0:1a60) +Char5BText:: ; 182e (0:182e) db "PC@" -Char5EText:: ; 1a63 (0:1a63) +Char5EText:: ; 1831 (0:1830) db "ROCKET@" -Char54Text:: ; 1a6a (0:1a6a) +Char54Text:: ; 1838 (0:1838) db "POKé@" -Char56Text:: ; 1a6f (0:1a6f) +Char56Text:: ; 183d (0:183d) db "……@" -Char5AText:: ; 1a72 (0:1a72) +Char5AText:: ; 1840 (0:1840) db "Enemy @" -Char4AText:: ; 1a79 (0:1a79) +Char4AText:: ; 1847 (0:1847) db $E1,$E2,"@" ; PKMN -Char55:: ; 1a7c (0:1a7c) +Char55:: ; 184a (0:184a) push de ld b,h ld c,l ld hl,Char55Text - call TextCommandProcessor + call TextCommandProcessor ; 1919 ld h,b ld l,c pop de inc de jp PlaceNextChar -Char55Text:: ; 1a8c (0:1a8c) +Char55Text:: ; 185a (0:185a) ; equivalent to Char4B - TX_FAR _Char55Text + TX_FAR _Char55Text ; a0c73 (28:4c73) db "@" -Char5F:: ; 1a91 (0:1a91) +Char5F:: ; 185f (0:185f) ; ends a Pokédex entry ld [hl],"." pop hl ret -Char58:: ; 1a95 (0:1a95) +Char58:: ; 1863 (0:1863) ld a,[wLinkState] cp LINK_STATE_BATTLING - jp z,Next1AA2 + jp z,Next1870 ld a,$EE Coorda 18, 16 -Next1AA2:: ; 1aa2 (0:1aa2) - call ProtectedDelay3 - call ManualTextScroll - ld a,$7F +Next1870:: ; 1870 (0:1870) + call ProtectedDelay3 ; 1913 + call ManualTextScroll ; 388e + ld a,$7F ; space Coorda 18, 16 Char57:: ; 1aad (0:1aad) pop hl @@ -281,10 +280,10 @@ Char57:: ; 1aad (0:1aad) dec de ret -Char58Text:: ; 1ab3 (0:1ab3) +Char58Text:: ; 1881 (0:1881) db "@" -Char51:: ; 1ab4 (0:1ab4) +Char51:: ; 1882 (0:1882) push de ld a,$EE Coorda 18, 16 @@ -297,9 +296,16 @@ Char51:: ; 1ab4 (0:1ab4) call DelayFrames pop de hlCoord 1, 14 - jp Next19E8 - -Char49:: ; 1ad5 (0:1ad5) + jp Next17B6 + +Char49:: ; 18a3 (0:18a3) + ld a,[hFlags_0xfffa] + bit 3,a + jr z,.Char49 + ld a,$4e + jp Char4ETest + +.Char49 push de ld a,$EE Coorda 18, 16 @@ -314,7 +320,7 @@ Char49:: ; 1ad5 (0:1ad5) pop hl hlCoord 1, 11 push hl - jp Next19E8 + jp Next17B6 Char4B:: ; 1af8 (0:1af8) ld a,$EE @@ -328,13 +334,13 @@ Char4B:: ; 1af8 (0:1af8) ;fall through Char4C:: ; 1b0a (0:1b0a) push de - call Next1B18 - call Next1B18 + call Next18F1 ; 18f1 + call Next18F1 hlCoord 1, 16 pop de - jp Next19E8 + jp Next17B6 -Next1B18:: ; 1b18 (0:1b18) +Next18F1:: ; 18f1 (0:18f1) hlCoord 0, 14 deCoord 0, 13 ld b,$3C @@ -361,7 +367,7 @@ Next1B18:: ; 1b18 (0:1b18) ret -ProtectedDelay3:: ; 1b3a (0:1b3a) +ProtectedDelay3:: ; 1913 (0:1913) push bc call Delay3 pop bc @@ -411,7 +417,7 @@ NextTextCommand:: ; 1b55 (0:1b55) ; AAAA = address of upper left corner ; BB = height ; CC = width -TextCommand04:: ; 1b78 (0:1b78) +TextCommand04:: ; 1951 (0:1951) pop hl ld a,[hli] ld e,a @@ -430,7 +436,7 @@ TextCommand04:: ; 1b78 (0:1b78) ; place string inline ; 00{string} -TextCommand00:: ; 1b8a (0:1b8a) +TextCommand00:: ; 1963 (0:1963) pop hl ld d,h ld e,l @@ -445,7 +451,7 @@ TextCommand00:: ; 1b8a (0:1b8a) ; place string from RAM ; 01AAAA ; AAAA = address of string -TextCommand01:: ; 1b97 (0:1b97) +TextCommand01:: ; 1970 (0:1970) pop hl ld a,[hli] ld e,a @@ -464,7 +470,7 @@ TextCommand01:: ; 1b97 (0:1b97) ; BB ; bits 0-4 = length in bytes ; bits 5-7 = unknown flags -TextCommand02:: ; 1ba5 (0:1ba5) +TextCommand02:: ; 197e (0:197e) pop hl ld a,[hli] ld e,a @@ -484,7 +490,7 @@ TextCommand02:: ; 1ba5 (0:1ba5) ; repoint destination address ; 03AAAA ; AAAA = new destination address -TextCommand03:: ; 1bb7 (0:1bb7) +TextCommand03:: ; 1990 (0:1990) pop hl ld a,[hli] ld [wcc3a],a @@ -497,7 +503,7 @@ TextCommand03:: ; 1bb7 (0:1bb7) ; repoint destination to second line of dialogue text box ; 05 ; (no arguments) -TextCommand05:: ; 1bc5 (0:1bc5) +TextCommand05:: ; 199e (0:199e) pop hl bcCoord 1, 16 ; address of second line of dialogue text box jp NextTextCommand @@ -505,7 +511,7 @@ TextCommand05:: ; 1bc5 (0:1bc5) ; blink arrow and wait for A or B to be pressed ; 06 ; (no arguments) -TextCommand06:: ; 1bcc (0:1bcc) +TextCommand06:: ; 19a5 (0:19a5) ld a,[wLinkState] cp a,LINK_STATE_BATTLING jp z,TextCommand0D @@ -522,18 +528,18 @@ TextCommand06:: ; 1bcc (0:1bcc) ; scroll text up one line ; 07 ; (no arguments) -TextCommand07:: ; 1be7 (0:1be7) +TextCommand07:: ; 19c0 (0:19c0) ld a," " Coorda 18, 16 ; place blank space in lower right corner of dialogue text box - call Next1B18 ; scroll up text - call Next1B18 + call Next18F1 ; scroll up text + call Next18F1 pop hl bcCoord 1, 16 ; address of second line of dialogue text box jp NextTextCommand ; execute asm inline ; 08{code} -TextCommand08:: ; 1bf9 (0:1bf9) +TextCommand08:: ; 19d2 (0:19d2) pop hl ld de,NextTextCommand push de ; return address @@ -545,7 +551,7 @@ TextCommand08:: ; 1bf9 (0:1bf9) ; BB ; bits 0-3 = how many digits to display ; bits 4-7 = how long the number is in bytes -TextCommand09:: ; 1bff (0:1bff) +TextCommand09:: ; 19d8 (0:19d8) pop hl ld a,[hli] ld e,a @@ -572,7 +578,7 @@ TextCommand09:: ; 1bff (0:1bff) ; wait half a second if the user doesn't hold A or B ; 0A ; (no arguments) -TextCommand0A:: ; 1c1d (0:1c1d) +TextCommand0A:: ; 19f6 (0:19f6) push bc call Joypad ld a,[hJoyHeld] @@ -588,7 +594,7 @@ TextCommand0A:: ; 1c1d (0:1c1d) ; plays sounds ; this actually handles various command ID's, not just 0B ; (no arguments) -TextCommand0B:: ; 1c31 (0:1c31) +TextCommand0B:: ; 1a0a (0:1a0a) pop hl push bc dec hl @@ -640,7 +646,7 @@ TextCommandSounds:: ; 1c64 (0:1c64) ; draw ellipses ; 0CAA ; AA = number of ellipses to draw -TextCommand0C:: ; 1c78 (0:1c78) +TextCommand0C:: ; 1a51 (0:1a51) pop hl ld a,[hli] ld d,a @@ -669,7 +675,7 @@ TextCommand0C:: ; 1c78 (0:1c78) ; wait for A or B to be pressed ; 0D ; (no arguments) -TextCommand0D:: ; 1c9a (0:1c9a) +TextCommand0D:: ; 1a73 (0:1a73) push bc call ManualTextScroll ; wait for A or B to be pressed pop bc @@ -680,7 +686,7 @@ TextCommand0D:: ; 1c9a (0:1c9a) ; 17AAAABB ; AAAA = address of text commands ; BB = bank -TextCommand17:: ; 1ca3 (0:1ca3) +TextCommand17:: ; 1a7c (0:1a7c) pop hl ld a,[H_LOADEDROMBANK] push af @@ -701,7 +707,7 @@ TextCommand17:: ; 1ca3 (0:1ca3) ld [$2000],a jp NextTextCommand -TextCommandJumpTable:: ; 1cc1 (0:1cc1) +TextCommandJumpTable:: ; 1a9a (0:1a9a) dw TextCommand00 dw TextCommand01 dw TextCommand02 @@ -155,6 +155,8 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10 H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn +hLCDCPointer EQU $FFF4 + hJoyInput EQU $FFF5 ; bit 0: draw HP fraction to the right of bar instead of below (for party menu) @@ -1631,8 +1631,8 @@ wDestinationWarpID:: ; d42f ; if $ff, the player's coordinates are not updated when entering the map ds 1 -wd430:: ds 1 ; d430 -wd431:: ds 1 ; d431 +wd430:: ds 1 ; d42f +wd431:: ds 1 ; d430 ds 2 @@ -1650,7 +1650,12 @@ wd44b:: ds 1 wd472:: ds 1 wd473:: ds 1 - ds 61 + ds 39 + +wUnknownSerialFlag_d49a:: ds 1 ; d499 +wUnknownSerialFlag_d49b:: ds 1 ; d49a + + ds 21 wd4b0:: ds 1 ; number of signs on the map wd4b1:: ds 32 ; starting address for sign coords |