ref: b9980afa2603efe3da4d531a99fb04e145a20785
parent: d0582479dfb02b3ac1bb3e5a67e215620f228549
author: IIMarckus <iimarckus@gmail.com>
date: Tue Dec 27 11:56:56 EST 2011
Add some functions that MoveSprite calls. hg-commit-id: a5ed1444c203
--- a/pokered.asm
+++ b/pokered.asm
@@ -1086,7 +1086,40 @@
HiddenPrefix:
db "HM"
-INCBIN "baserom.gbc",$3040,$35BC - $3040
+INCBIN "baserom.gbc",$3040,$3541 - $3040
+
+Function3541: ; 3541
+; XXX what do these three functions do
+ push hl
+ call Function354E
+ ld [hl],$FF
+ call Function3558
+ ld [hl],$FF
+ pop hl
+ ret
+
+Function354E: ; 354E
+ ld h,$C2
+ ld a,[$FF8C] ; the sprite to move
+ swap a
+ add a,6
+ ld l,a
+ ret
+
+Function3558: ; 3558
+ push de
+ ld hl,$D4E4
+ ld a,[$FF8C] ; the sprite to move
+ dec a
+ add a
+ ld d,0
+ ld e,a
+ add hl,de
+ pop de
+ ret
+
+INCBIN "baserom.gbc",$3566,$35BC - $3566
+
BankswitchHome: ; 35BC
; switches to bank # in a
; Only use this when in the home bank!
@@ -1127,10 +1160,11 @@
MoveSprite: ; 363A
; move the sprite [$FF8C] with the movement pointed to by de
- call $3541
+; actually only copies the movement data to $CC5B for later
+ call Function3541
push hl
push bc
- call $354E
+ call Function354E
xor a
ld [hl],a
ld hl,$CC5B