diff options
Diffstat (limited to 'home')
-rw-r--r-- | home/flag.asm | 33 | ||||
-rw-r--r-- | home/map.asm | 12 | ||||
-rw-r--r-- | home/menu.asm | 2 | ||||
-rw-r--r-- | home/string.asm | 37 | ||||
-rw-r--r-- | home/window.asm | 65 |
5 files changed, 62 insertions, 87 deletions
diff --git a/home/flag.asm b/home/flag.asm index 099f4bf0..3d144ba7 100644 --- a/home/flag.asm +++ b/home/flag.asm @@ -1,39 +1,35 @@ -ResetMapBufferEventFlags:: ; 2e50 +ResetMapBufferEventFlags:: ; 2f10 (0:2f10) xor a - ld hl, EventFlags + ld hl, wEventFlags ld [hli], a ret -; 2e56 -ResetBikeFlags:: ; 2e56 +ResetBikeFlags:: ; 2f16 (0:2f16) xor a - ld hl, BikeFlags + ld hl, wBikeFlags ld [hli], a ld [hl], a ret -; 2e5d -ResetFlashIfOutOfCave:: ; 2e5d +ResetFlashIfOutOfCave:: ; 2f1d (0:2f1d) ld a, [wPermission] cp $2 - jr z, .asm_2e69 + jr z, .asm_2f29 cp $1 - jr z, .asm_2e69 + jr z, .asm_2f29 ret -.asm_2e69 - ld hl, StatusFlags +.asm_2f29 + ld hl, wStatusFlags res 2, [hl] ret -; 2e6f - -EventFlagAction:: ; 0x2e6f - ld hl, EventFlags +EventFlagAction:: + ld hl, wEventFlags call FlagAction ret -FlagAction:: ; 0x2e76 +FlagAction:: ; 2f36 (0:2f36) ; Perform action b on bit de in flag array hl. ; inputs: @@ -99,14 +95,11 @@ FlagAction:: ; 0x2e76 and [hl] ld [hl], a ret -; 0x2ead - -CheckReceivedDex:: ; 2ead +CheckReceivedDex:: ld de, ENGINE_POKEDEX ld b, CHECK_FLAG callba EngineFlagAction ld a, c and a ret -; 2ebb diff --git a/home/map.asm b/home/map.asm index 8dee046f..5da4d27d 100644 --- a/home/map.asm +++ b/home/map.asm @@ -194,10 +194,10 @@ ReturnToMapFromSubmenu:: Function2086:: call Clear_wc6e8 - call Function2f10 - call Function2f1d + call ResetMapBufferEventFlags + call ResetFlashIfOutOfCave call GetCurrentMapTrigger - call Function2f16 + call ResetBikeFlags ld a, $5 call RunMapCallback callba Function97c2a @@ -287,7 +287,7 @@ Function212d:: jr nz, .asm_2151 ld hl, wVramState set 0, [hl] - call Function2ef1 + call SafeUpdateSprites .asm_2151 xor a ld [wd182], a @@ -2100,7 +2100,7 @@ FadeToMenu:: call LoadStandardMenuDataHeader callba Function8c3ab call Function30ff - call Function2f93 + call DisableSpriteUpdates ret CloseSubmenu:: @@ -2122,7 +2122,7 @@ FinishExitMenu:: call Function3583 call Function3456 callba FadeInPalettes - call Function2fa4 + call EnableSpriteUpdates ret ReturnToMapWithSpeechTextbox:: diff --git a/home/menu.asm b/home/menu.asm index bbc29b34..7e9d4840 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -216,7 +216,7 @@ MenuWriteText:: ; 1cf6 (0:1cf6) ld [hBGMapMode], a call GetMenuIndexSet call RunMenuItemPrintingFunction - call Function2ef1 + call SafeUpdateSprites ld a, [hOAMUpdate] push af ld a, $1 diff --git a/home/string.asm b/home/string.asm index 70a0f2dd..6f804a96 100644 --- a/home/string.asm +++ b/home/string.asm @@ -1,38 +1,31 @@ -InitString:: ; 2ef6 -; Init a string of length c. +InitString:: push hl - jr _InitString -; 2ef9 + jr InitString_ -InitName:: ; 2ef9 -; Intended for names, so this function is limited to ten characters. +InitName:: push hl - ld c, 10 -; 2efc - -_InitString:: ; 2efc -; if the string pointed to by hl is empty (defined as "zero or more spaces -; followed by a null"), then initialize it to the string pointed to by de. + ld c, $a +InitString_:: push bc -.loop +.asm_2fbd ld a, [hli] - cp "@" - jr z, .blank - cp " " - jr nz, .notblank + cp $50 + jr z, .asm_2fc9 + cp $7f + jr nz, .asm_2fd4 dec c - jr nz, .loop -.blank + jr nz, .asm_2fbd +.asm_2fc9 pop bc ld l, e ld h, d pop de - ld b, 0 + ld b, $0 inc c call CopyBytes ret -.notblank + +.asm_2fd4 pop bc pop hl ret -; 2f17 diff --git a/home/window.asm b/home/window.asm index 32494ee3..a22ab18b 100644 --- a/home/window.asm +++ b/home/window.asm @@ -1,84 +1,69 @@ -RefreshScreen:: ; 2dba - +Function2e80:: ; 2e80 (0:2e80) call ClearWindowData ld a, [hROMBank] push af - ld a, BANK(Function6454) ; and BANK(Function64bf) + ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; and BANK(LoadFonts_NoOAMUpdate) rst Bankswitch - - call Function6454 - call Function2e20 - call Function64bf - + call ReanchorBGMap_NoOAMUpdate + call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap + call LoadFonts_NoOAMUpdate pop af rst Bankswitch ret -; 2dcf - -CloseText:: ; 2dcf +CloseText ld a, [hOAMUpdate] push af ld a, $1 ld [hOAMUpdate], a - call .CloseText - pop af ld [hOAMUpdate], a - ld hl, VramState - res 6, [hl] ret -; 2de2 -.CloseText ; 2de2 +.CloseText: call ClearWindowData xor a ld [hBGMapMode], a call OverworldTextModeSwitch - call Function2e20 + call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap xor a ld [hBGMapMode], a - call Function2e31 + call SafeUpdateSprites ld a, $90 ld [hWY], a - call ReplaceKrisSprite - callba ReturnFromMapSetupScript - callba LoadOverworldFont + callba Function1415c + call Functiond97 + ld hl, wd565 + res 7, [hl] + call ResetBGWindow ret -; 2e08 -OpenText:: ; 2e08 +OpenText:: call ClearWindowData ld a, [hROMBank] push af - ld a, BANK(Function6454) ; and BANK(Function64bf) + ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; and BANK(LoadFonts_NoOAMUpdate) rst Bankswitch - - call Function6454 ; clear bgmap + call ReanchorBGMap_NoOAMUpdate call SpeechTextBox - call Function2e20 ; anchor bgmap - call Function64bf ; load font + call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap + call LoadFonts_NoOAMUpdate pop af rst Bankswitch - ret -; 2e20 -Function2e20:: ; 2e20 +_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 2ee3 (0:2ee3) ld a, [hOAMUpdate] push af ld a, $1 ld [hOAMUpdate], a - - callba Function104110 - + call Function348e pop af ld [hOAMUpdate], a ret -; 2e31 -Function2e31:: ; 2e31 +SafeUpdateSprites:: ; 2ef1 (0:2ef1) ld a, [hOAMUpdate] push af ld a, [hBGMapMode] @@ -96,4 +81,8 @@ Function2e31:: ; 2e31 pop af ld [hOAMUpdate], a ret -; 2e4e + +Function2f0e:: + scf + ret + |