Skip to content

Commit 1eb6f61

Browse files
committed
Identify JOYP_SGB_MLT_REQ constant
1 parent bdbc8cb commit 1eb6f61

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

constants/misc_constants.asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ DEF TRUE EQU 1
1010

1111
; input
1212
DEF NO_INPUT EQU 0
13+
14+
; SGB command MLT_REQ can be used to detect SGB hardware
15+
DEF JOYP_SGB_MLT_REQ EQU %00000011

engine/gfx/palettes.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ CheckSGB:
462462
ei
463463
call Wait7000
464464
ldh a, [rJOYP]
465-
and $3
466-
cp $3
465+
and JOYP_SGB_MLT_REQ
466+
cp JOYP_SGB_MLT_REQ
467467
jr nz, .isSGB
468468
ld a, JOYP_SGB_ZERO
469469
ldh [rJOYP], a
@@ -494,8 +494,8 @@ CheckSGB:
494494
call Wait7000
495495
call Wait7000
496496
ldh a, [rJOYP]
497-
and $3
498-
cp $3
497+
and JOYP_SGB_MLT_REQ
498+
cp JOYP_SGB_MLT_REQ
499499
jr nz, .isSGB
500500
call SendMltReq1Packet
501501
and a

0 commit comments

Comments
 (0)