summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-06-06 16:11:16 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2018-06-06 16:11:16 -0400
commit884e0f67f8cd0151784c90fa18682ef45cd3bf6a (patch)
tree0c6750172578aa3e8230a7a34b4aca5e4ac07a98 /home
parentbad561848af1a20143ac290a92ecdfb9748a14e0 (diff)
Disassemble home calls to Multiply and Divide
Diffstat (limited to 'home')
-rw-r--r--home/print_text.asm21
-rw-r--r--home/util.asm53
2 files changed, 70 insertions, 4 deletions
diff --git a/home/print_text.asm b/home/print_text.asm
index e8b4eeb..0a17688 100644
--- a/home/print_text.asm
+++ b/home/print_text.asm
@@ -48,4 +48,23 @@ PrintLetterDelay:: ; 33a3 (0:33a3)
pop de
pop hl
ret
-; 0x33e3 \ No newline at end of file
+; 0x33e3
+
+CopyDataUntil:: ; 33e3
+; 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.
+
+.asm_33e3: ; 00:33e3
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, h
+ cp b
+ jr nz, .asm_33e3
+ ld a, l
+ cp c
+ jr nz, .asm_33e3
+ ret
diff --git a/home/util.asm b/home/util.asm
index 6591da2..8efe322 100644
--- a/home/util.asm
+++ b/home/util.asm
@@ -1,12 +1,59 @@
INCLUDE "constants.asm"
if DEBUG
-SECTION "Misc Utility Functions", ROM0[$341F]
+SECTION "Misc Utility Functions", ROM0[$33EF]
else
-SECTION "Misc Utility Functions", ROM0[$33E3]
+SECTION "Misc Utility Functions", ROM0[$33B3]
endc
-_341F:: ; 341f
+Function33ef::
+ ; hl = src
+ ; de = dest
+ ; b = y
+ ; c = x
+ push hl
+ push de
+ push bc
+ ld a, b
+ dec a
+ dec a
+ ld b, $0
+.asm_33f7: ; 00:33f7
+ add hl, bc
+ dec a
+ jr nz, .asm_33f7
+ pop bc
+ dec b
+ ld a, b
+ push hl
+ add hl, bc
+ ld d, h
+ ld e, l
+ pop hl
+.asm_3403: ; 00:3403
+ push af
+ push bc
+ call CopyBytes
+ pop bc
+ push bc
+ ld a, c
+ xor $ff
+ ld c, a
+ ld b, $ff
+ inc bc
+ add hl, bc
+ ld d, h
+ ld e, l
+ add hl, bc
+ pop bc
+ pop af
+ dec a
+ jr nz, .asm_3403
+ pop hl
+ pop de
+ jp CopyBytes
+
+SkipNames:: ; 341f
; Returns hl + a * 6
and a
ret z