From 33df401392e9ab6ecebba0e4403bfd8387b77f22 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 11 Aug 2025 16:36:33 -0400 Subject: [PATCH] Identify `JOYP_SGB_MLT_REQ` constant --- constants/misc_constants.asm | 3 +++ engine/gfx/color.asm | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 1620f2d2..c6800d6f 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -57,3 +57,6 @@ DEF HOF_MASTER_COUNT EQU 200 ; card flip DEF CARDFLIP_DECK_SIZE EQU 4 * 6 + +; SGB command MLT_REQ can be used to detect SGB hardware +DEF JOYP_SGB_MLT_REQ EQU %00000011 diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index 3ec0aa04..eee8f725 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -908,8 +908,8 @@ PushSGBBorderPalsAndWait: call _PushSGBPals call SGBDelayCycles ldh a, [rJOYP] - and $3 - cp $3 + and JOYP_SGB_MLT_REQ + cp JOYP_SGB_MLT_REQ jr nz, .carry ld a, JOYP_SGB_ZERO ldh [rJOYP], a @@ -936,8 +936,8 @@ endr call SGBDelayCycles call SGBDelayCycles ldh a, [rJOYP] - and $3 - cp $3 + and JOYP_SGB_MLT_REQ + cp JOYP_SGB_MLT_REQ jr nz, .carry call .FinalPush and a