summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchaos-lord <dd4791.mariokarter@hotmail.co.uk>2017-07-20 22:52:33 +0100
committerchaos-lord <dd4791.mariokarter@hotmail.co.uk>2017-07-20 22:52:33 +0100
commit39a1a4286b0ac11c4af252ed4c9364d419288400 (patch)
treeff94ba1b4fe7f78d8eed69fc7e6e8530aa849479
parent0d77f92e5ba629293b6b12e23595263ced9904e6 (diff)
missed one
-rw-r--r--home/text.asm44
1 files changed, 22 insertions, 22 deletions
diff --git a/home/text.asm b/home/text.asm
index 238af3a..052b9a2 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -1,6 +1,6 @@
INCLUDE "text/scrolling_text.asm"
-Func_30db: ; 0x30db
+EnableBottomText: ; 0x30db
ld a, $86
ld [hWY], a ;force text bar up
ld a, $1
@@ -520,9 +520,9 @@ Func_3357: ; 0x3357
jr nz, .asm_336b
ret
-Func_3372: ; 0x3372
+LoadScoreTextFromStack: ; 0x3372 load stationary text header DE into HL, then load 4 byte BCD score from the stack into the buffer, ending in an 0 and space
ld a, $1
- ld [hli], a
+ ld [hli], a ;load 1, then first 4 bytes of de into hl
ld a, [de]
ld [hli], a
inc de
@@ -538,49 +538,49 @@ Func_3372: ; 0x3372
pop af
ld e, a
ld d, wBottomMessageText / $100
- ld hl, sp + 5
+ ld hl, sp + 5 ;access a 4 byte buffer stored previously on the stack
lb bc, 8, 1
-.asm_338a
+.Loop
ld a, [hl]
swap a
- and $f
- call Func_33a7
+ and $f ;get 10's digit
+ call LoadBCDDigitAsText
dec b
ld a, [hld]
- and $f
- call Func_33a7
+ and $f ;get units digit
+ call LoadBCDDigitAsText
dec b
- jr nz, .asm_338a
- ld a, $30
+ jr nz, .Loop ;loop 4 times
+ ld a, "0"
ld [de], a
inc de
- ld a, $20
+ ld a, " " ;end with a 0 and a space
ld [de], a
inc de
xor a
ld [de], a
ret
-Func_33a7: ; 0x33a7
- jr nz, .asm_33b0
+LoadBCDDigitAsText: ; 0x33a7 Enter BCD digit a into text DE. b is a loop counter and c is a "have you entered a digit yet" flag
+ jr nz, .EnterDigit ;if no digit, not end of loop and not yet entered a digit, skip
ld a, b
dec a
- jr z, .asm_33b0
+ jr z, .EnterDigit
ld a, c
and a
ret nz
-.asm_33b0
- add $30
+.EnterDigit
+ add "0" ;load digit into de
ld [de], a
inc de
- ld c, $0
+ ld c, $0 ;mark that a digit has been entered
ld a, b
cp $6
- jr z, .asm_33be
+ jr z, .EnterComma
cp $3
- ret nz
-.asm_33be
- ld a, $2c
+ ret nz ;if b is 3 or 6, load a seperator comma into the text
+.EnterComma
+ ld a, ","
ld [de], a
inc de
ret