You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Optimize some HRAM usage
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
DelayFrame::
|
||||
; Wait for one frame
|
||||
ld a, 1
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
|
||||
; Wait for the next VBlank, halting to conserve battery
|
||||
.halt
|
||||
halt
|
||||
nop
|
||||
ld a, [wVBlankOccurred]
|
||||
ldh a, [hVBlankOccurred]
|
||||
and a
|
||||
jr nz, .halt
|
||||
ret
|
||||
|
@@ -295,11 +295,11 @@ JoyTextDelay::
|
||||
and a
|
||||
jr z, .checkframedelay
|
||||
ld a, 15
|
||||
ld [wTextDelayFrames], a
|
||||
ldh [hTextDelayFrames], a
|
||||
ret
|
||||
|
||||
.checkframedelay
|
||||
ld a, [wTextDelayFrames]
|
||||
ldh a, [hTextDelayFrames]
|
||||
and a
|
||||
jr z, .restartframedelay
|
||||
xor a
|
||||
@@ -308,7 +308,7 @@ JoyTextDelay::
|
||||
|
||||
.restartframedelay
|
||||
ld a, 5
|
||||
ld [wTextDelayFrames], a
|
||||
ldh [hTextDelayFrames], a
|
||||
ret
|
||||
|
||||
WaitPressAorB_BlinkCursor::
|
||||
|
@@ -44,7 +44,7 @@ PrintLetterDelay::
|
||||
ld a, TEXT_DELAY_FAST
|
||||
|
||||
.updatedelay
|
||||
ld [wTextDelayFrames], a
|
||||
ldh [hTextDelayFrames], a
|
||||
|
||||
.checkjoypad
|
||||
call GetJoypad
|
||||
@@ -68,7 +68,7 @@ PrintLetterDelay::
|
||||
jr .end
|
||||
|
||||
.wait
|
||||
ld a, [wTextDelayFrames]
|
||||
ldh a, [hTextDelayFrames]
|
||||
and a
|
||||
jr nz, .checkjoypad
|
||||
|
||||
|
@@ -115,7 +115,7 @@ VBlank0::
|
||||
; vblank-sensitive operations are done
|
||||
|
||||
xor a
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
|
||||
; if hWindowHUDLY is active, enable interrupts so the LCD interrupt can trigger
|
||||
ldh a, [hWindowHUDLY]
|
||||
@@ -141,18 +141,18 @@ VBlank0::
|
||||
sbc b
|
||||
ldh [hRandomSub], a
|
||||
|
||||
ld a, [wOverworldDelay]
|
||||
ldh a, [hOverworldDelay]
|
||||
and a
|
||||
jr z, .ok
|
||||
dec a
|
||||
ld [wOverworldDelay], a
|
||||
ldh [hOverworldDelay], a
|
||||
.ok
|
||||
|
||||
ld a, [wTextDelayFrames]
|
||||
ldh a, [hTextDelayFrames]
|
||||
and a
|
||||
jr z, .ok2
|
||||
dec a
|
||||
ld [wTextDelayFrames], a
|
||||
ldh [hTextDelayFrames], a
|
||||
.ok2
|
||||
|
||||
call UpdateJoypad
|
||||
@@ -199,7 +199,7 @@ VBlank2::
|
||||
rst Bankswitch
|
||||
|
||||
xor a
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
ret
|
||||
|
||||
VBlank1::
|
||||
@@ -228,7 +228,7 @@ VBlank1::
|
||||
|
||||
.done
|
||||
xor a
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
|
||||
; get requested ints
|
||||
ldh a, [rIF]
|
||||
@@ -296,7 +296,7 @@ VBlank3::
|
||||
.done
|
||||
|
||||
xor a
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
|
||||
ldh a, [rIF]
|
||||
push af
|
||||
@@ -351,7 +351,7 @@ VBlank4::
|
||||
call UpdateJoypad
|
||||
|
||||
xor a
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
|
||||
call AskSerial
|
||||
|
||||
@@ -385,7 +385,7 @@ VBlank5::
|
||||
.done
|
||||
|
||||
xor a
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
|
||||
call UpdateJoypad
|
||||
|
||||
@@ -433,7 +433,7 @@ VBlank6::
|
||||
.done
|
||||
|
||||
xor a
|
||||
ld [wVBlankOccurred], a
|
||||
ldh [hVBlankOccurred], a
|
||||
|
||||
ld a, BANK(_UpdateSound)
|
||||
rst Bankswitch
|
||||
|
Reference in New Issue
Block a user