Skip to content

Commit 33df401

Browse files
committed
Identify JOYP_SGB_MLT_REQ constant
1 parent a17b2c5 commit 33df401

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
@@ -57,3 +57,6 @@ DEF HOF_MASTER_COUNT EQU 200
5757

5858
; card flip
5959
DEF CARDFLIP_DECK_SIZE EQU 4 * 6
60+
61+
; SGB command MLT_REQ can be used to detect SGB hardware
62+
DEF JOYP_SGB_MLT_REQ EQU %00000011

engine/gfx/color.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,8 @@ PushSGBBorderPalsAndWait:
908908
call _PushSGBPals
909909
call SGBDelayCycles
910910
ldh a, [rJOYP]
911-
and $3
912-
cp $3
911+
and JOYP_SGB_MLT_REQ
912+
cp JOYP_SGB_MLT_REQ
913913
jr nz, .carry
914914
ld a, JOYP_SGB_ZERO
915915
ldh [rJOYP], a
@@ -936,8 +936,8 @@ endr
936936
call SGBDelayCycles
937937
call SGBDelayCycles
938938
ldh a, [rJOYP]
939-
and $3
940-
cp $3
939+
and JOYP_SGB_MLT_REQ
940+
cp JOYP_SGB_MLT_REQ
941941
jr nz, .carry
942942
call .FinalPush
943943
and a

0 commit comments

Comments
 (0)