summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-05-30 21:18:23 -0500
committerBryan Bishop <kanzure@gmail.com>2012-05-30 21:18:23 -0500
commitded5884f533c6ea32c220d6214dbc2138eeae31f (patch)
tree8cf1918427125f030258c2e8b8761957f73d45bb
parent42596ae1d62008568f9d121670211804584a6275 (diff)
copy in StringCmp from pokered
-rw-r--r--main.asm22
1 files changed, 18 insertions, 4 deletions
diff --git a/main.asm b/main.asm
index 18d6960b3..6dfcd4809 100644
--- a/main.asm
+++ b/main.asm
@@ -234,15 +234,29 @@ AddNTimes: ; 0x30fe
INCBIN "baserom.gbc",$3105,$313d-$3105
+PrintLetterDelay: ; 313d
; This function is used to wait a short period after printing a letter to the
; screen unless the player presses the A/B button or the delay is turned off
-; through the [$cfcc] or [$cfcf] flags. In pokered, these were [$d730] and
-; [$d358].
-PrintLetterDelay: ; 313d
+; through the [$cfcc] or [$cfcf] flags.
INCBIN "baserom.gbc",$313d,$318c - $313d
; 0x318c
-INCBIN "baserom.gbc",$318c,$4000 - $318c
+INCBIN "baserom.gbc",$318c,$31db - $318c
+
+StringCmp: ; 31db
+; Compare strings, c bytes in length, at de and hl.
+; Often used to compare big endian numbers in battle calculations.
+ ld a, [de]
+ cp [hl]
+ ret nz
+ inc de
+ inc hl
+ dec c
+ jr nz, StringCmp
+ ret
+; 0x31e4
+
+INCBIN "baserom.gbc",$31e4,$4000 - $31e4
SECTION "bank1",DATA,BANK[$1]