mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-22 15:12:18 +13:00
Move all code out of home.asm into home/
This results in 64 home/*.asm files, comparable to pokecrystal's 57.
This commit is contained in:
parent
51ac538c25
commit
bbf2f51a02
35 changed files with 1754 additions and 1758 deletions
45
home/print_text.asm
Normal file
45
home/print_text.asm
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
; This function is used to wait a short period after printing a letter to the
|
||||
; screen unless the player presses the A/B button or the delay is turned off
|
||||
; through the [wd730] or [wLetterPrintingDelayFlags] flags.
|
||||
PrintLetterDelay::
|
||||
ld a, [wd730]
|
||||
bit 6, a
|
||||
ret nz
|
||||
ld a, [wLetterPrintingDelayFlags]
|
||||
bit 1, a
|
||||
ret z
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ld a, [wLetterPrintingDelayFlags]
|
||||
bit 0, a
|
||||
jr z, .waitOneFrame
|
||||
ld a, [wOptions]
|
||||
and $f
|
||||
ldh [hFrameCounter], a
|
||||
jr .checkButtons
|
||||
.waitOneFrame
|
||||
ld a, 1
|
||||
ldh [hFrameCounter], a
|
||||
.checkButtons
|
||||
call Joypad
|
||||
ldh a, [hJoyHeld]
|
||||
.checkAButton
|
||||
bit 0, a ; is the A button pressed?
|
||||
jr z, .checkBButton
|
||||
jr .endWait
|
||||
.checkBButton
|
||||
bit 1, a ; is the B button pressed?
|
||||
jr z, .buttonsNotPressed
|
||||
.endWait
|
||||
call DelayFrame
|
||||
jr .done
|
||||
.buttonsNotPressed ; if neither A nor B is pressed
|
||||
ldh a, [hFrameCounter]
|
||||
and a
|
||||
jr nz, .checkButtons
|
||||
.done
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue