2018-06-24 14:09:41 +00:00
|
|
|
PrintLetterDelay::
|
2018-04-05 04:35:14 +00:00
|
|
|
; Wait before printing the next letter.
|
|
|
|
|
|
|
|
; The text speed setting in wOptions is actually a frame count:
|
|
|
|
; fast: 1 frame
|
|
|
|
; mid: 3 frames
|
|
|
|
; slow: 5 frames
|
|
|
|
|
2019-04-08 12:15:10 +00:00
|
|
|
; wTextboxFlags[!0] and A or B override text speed with a one-frame delay.
|
|
|
|
; wOptions[4] and wTextboxFlags[!1] disable the delay.
|
2018-04-05 04:35:14 +00:00
|
|
|
|
|
|
|
ld a, [wOptions]
|
|
|
|
bit NO_TEXT_SCROLL, a
|
|
|
|
ret nz
|
|
|
|
|
|
|
|
; non-scrolling text?
|
2019-04-08 12:15:10 +00:00
|
|
|
ld a, [wTextboxFlags]
|
2018-04-05 04:35:14 +00:00
|
|
|
bit NO_TEXT_DELAY_F, a
|
|
|
|
ret z
|
|
|
|
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
|
|
|
|
ld hl, hOAMUpdate
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
|
|
|
|
; orginally turned oam update off...
|
|
|
|
; ld a, 1
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
; force fast scroll?
|
2019-04-08 12:15:10 +00:00
|
|
|
ld a, [wTextboxFlags]
|
2018-04-05 04:35:14 +00:00
|
|
|
bit FAST_TEXT_DELAY_F, a
|
|
|
|
jr z, .fast
|
|
|
|
|
|
|
|
; text speed
|
|
|
|
ld a, [wOptions]
|
|
|
|
and %111
|
|
|
|
jr .updatedelay
|
|
|
|
|
|
|
|
.fast
|
|
|
|
ld a, TEXT_DELAY_FAST
|
|
|
|
|
|
|
|
.updatedelay
|
|
|
|
ld [wTextDelayFrames], a
|
|
|
|
|
|
|
|
.checkjoypad
|
|
|
|
call GetJoypad
|
|
|
|
|
|
|
|
; input override
|
|
|
|
ld a, [wDisableTextAcceleration]
|
|
|
|
and a
|
|
|
|
jr nz, .wait
|
|
|
|
|
|
|
|
; Wait one frame if holding A or B.
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hJoyDown]
|
2018-04-05 04:35:14 +00:00
|
|
|
bit A_BUTTON_F, a
|
|
|
|
jr z, .checkb
|
|
|
|
jr .delay
|
|
|
|
.checkb
|
|
|
|
bit B_BUTTON_F, a
|
|
|
|
jr z, .wait
|
|
|
|
|
|
|
|
.delay
|
|
|
|
call DelayFrame
|
|
|
|
jr .end
|
|
|
|
|
|
|
|
.wait
|
|
|
|
ld a, [wTextDelayFrames]
|
|
|
|
and a
|
|
|
|
jr nz, .checkjoypad
|
|
|
|
|
|
|
|
.end
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hOAMUpdate], a
|
2018-04-05 04:35:14 +00:00
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
CopyDataUntil::
|
2018-04-05 04:35:14 +00:00
|
|
|
; Copy [hl .. bc) to de.
|
|
|
|
|
|
|
|
; In other words, the source data is
|
|
|
|
; from hl up to but not including bc,
|
|
|
|
; and the destination is de.
|
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, h
|
|
|
|
cp b
|
|
|
|
jr nz, CopyDataUntil
|
|
|
|
ld a, l
|
|
|
|
cp c
|
|
|
|
jr nz, CopyDataUntil
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
PrintNum::
|
2018-04-05 04:35:14 +00:00
|
|
|
homecall _PrintNum
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
MobilePrintNum::
|
2018-04-05 04:35:14 +00:00
|
|
|
homecall _MobilePrintNum
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
FarPrintText::
|
2020-04-06 17:02:23 +00:00
|
|
|
ldh [hTempBank], a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hROMBank]
|
2018-04-05 04:35:14 +00:00
|
|
|
push af
|
2020-04-06 17:02:23 +00:00
|
|
|
ldh a, [hTempBank]
|
2018-04-05 04:35:14 +00:00
|
|
|
rst Bankswitch
|
|
|
|
|
|
|
|
call PrintText
|
|
|
|
|
|
|
|
pop af
|
|
|
|
rst Bankswitch
|
|
|
|
ret
|
2020-02-21 22:48:51 +00:00
|
|
|
|
|
|
|
CallPointerAt::
|
|
|
|
ldh a, [hROMBank]
|
|
|
|
push af
|
|
|
|
ld a, [hli]
|
|
|
|
rst Bankswitch
|
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
|
|
|
|
call _hl_
|
|
|
|
|
|
|
|
pop hl
|
|
|
|
ld a, h
|
|
|
|
rst Bankswitch
|
|
|
|
ret
|