aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--constants/misc_constants.asm3
-rw-r--r--engine/gfx/palettes.asm8
2 files changed, 7 insertions, 4 deletions
diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm
index a542b4a7..8bd6f223 100644
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -10,3 +10,6 @@ DEF TRUE EQU 1
; input
DEF NO_INPUT EQU 0
+
+; SGB command MLT_REQ can be used to detect SGB hardware
+DEF JOYP_SGB_MLT_REQ EQU %00000011
diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm
index fe69144c..429d8123 100644
--- a/engine/gfx/palettes.asm
+++ b/engine/gfx/palettes.asm
@@ -462,8 +462,8 @@ CheckSGB:
ei
call Wait7000
ldh a, [rJOYP]
- and $3
- cp $3
+ and JOYP_SGB_MLT_REQ
+ cp JOYP_SGB_MLT_REQ
jr nz, .isSGB
ld a, JOYP_SGB_ZERO
ldh [rJOYP], a
@@ -494,8 +494,8 @@ CheckSGB:
call Wait7000
call Wait7000
ldh a, [rJOYP]
- and $3
- cp $3
+ and JOYP_SGB_MLT_REQ
+ cp JOYP_SGB_MLT_REQ
jr nz, .isSGB
call SendMltReq1Packet
and a