summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIIMarckus <iimarckus@gmail.com>2012-07-04 22:27:23 -0600
committerIIMarckus <iimarckus@gmail.com>2012-07-04 22:27:23 -0600
commit699cbaa8176bc384d98561bf627581fc54cba130 (patch)
tree12f63db02e3fcbe0bcab3cd719a5d0e8744c0a94
parent92e80be51b3ec02c77b3d0365722f0e8c50af2d7 (diff)
Add special 0x66, the Game Boy version check.
-rw-r--r--main.asm25
1 files changed, 23 insertions, 2 deletions
diff --git a/main.asm b/main.asm
index 1d037a928..b80eb58ff 100644
--- a/main.asm
+++ b/main.asm
@@ -660,7 +660,7 @@ SpecialsPointers: ; 0xc029
dbw $01,$741d
dbw $03,$4472
dbw $09,$65ee
- dbw $03,$4478
+ dbw BANK(SpecialGameboyCheck),SpecialGameboyCheck
dbw $03,$44b9
dbw $05,$6dc7
dbw $0a,$62a0
@@ -779,7 +779,28 @@ SpecialSnorlaxAwake: ; 0xc43d
db $24,$09
db $ff
-INCBIN "baserom.gbc",$c472,$c5d2 - $c472
+INCBIN "baserom.gbc",$c472,$c478 - $c472
+
+SpecialGameboyCheck: ; 0xc478
+ ld a, [$ff00+$e6]
+ and a
+ jr nz, .color
+ ld a, [$ff00+$e7]
+ and a
+ jr nz, .unknown
+ xor a
+ jr .done
+.unknown ; XXX what is this?
+ ld a, $1
+ jr .done
+
+.color
+ ld a, $2
+.done
+ ld [$c2dd], a
+ ret
+
+INCBIN "baserom.gbc",$c48f,$c5d2 - $c48f
PrintNumber_PrintDigit: ; c5d2
INCBIN "baserom.gbc",$c5d2,$c644 - $c5d2