summaryrefslogtreecommitdiff
path: root/home/util.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/util.asm')
-rw-r--r--home/util.asm53
1 files changed, 50 insertions, 3 deletions
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