shithub: pokered

Download patch

ref: 46337960bfe3aa82dcd51cada5b646ee42e2005f
parent: d0c027be62b6ce19fc301b9b0c2921d1dc014c2e
author: IIMarckus <iimarckus@gmail.com>
date: Fri Nov 19 18:27:27 EST 2010

add some delay-related functions

hg-commit-id: de967f59fa61


--- a/pokered.asm
+++ b/pokered.asm
@@ -521,8 +521,17 @@
 	ld [$2000],a
 	ret
 
-INCBIN "baserom.gbc",$35EC,$3A87 - $35EC
+INCBIN "baserom.gbc",$35EC,$3739 - $35EC
 
+Delay: ; 3739
+; wait n times, where n is the value in c
+	call ConserveBattery
+	dec c
+	jr nz,Delay
+	ret
+
+INCBIN "baserom.gbc",$3740,$3A87 - $3740
+
 AddNTimes: ; 3A87
 ; add bc to hl a times
 	and a
@@ -547,7 +556,13 @@
 	ld bc,$C4B9
 	jp $1B40
 
-INCBIN "baserom.gbc",$3C5F,$3E6D - $3C5F
+INCBIN "baserom.gbc",$3C5F,$3DD7 - $3C5F
+Delay3: ; 3DD7
+; call Delay with a parameter of 3
+	ld c,3
+	jp Delay
+
+INCBIN "baserom.gbc",$3DDC,$3E6D - $3DDC
 
 Predef: ; 3E6D
 ; runs a predefined ASM command, where the command ID is read from $D0B7