From 5c331e5fa0209be2c62c21c772209de426898686 Mon Sep 17 00:00:00 2001 From: calamari Date: Sun, 25 Sep 2022 10:37:18 -0700 Subject: [PATCH] Add isSlim() macro --- include/gint/hardware.h | 6 ++++++ src/keysc/iokbd.c | 2 +- src/t6k11/t6k11.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/gint/hardware.h b/include/gint/hardware.h index 6955e4d..06924fd 100644 --- a/include/gint/hardware.h +++ b/include/gint/hardware.h @@ -45,6 +45,12 @@ void hw_detect(void); #define isSH4() (!isSH3()) #endif +#if defined(FX9860G) +#define isSlim() (gint[HWCALC] == HWCALC_FX9860G_SLIM) +#else +#define isSlim() 0 +#endif + #ifdef FXCG50 #define isSH3() 0 #define isSH4() 1 diff --git a/src/keysc/iokbd.c b/src/keysc/iokbd.c index bf60e9a..064ac7e 100644 --- a/src/keysc/iokbd.c +++ b/src/keysc/iokbd.c @@ -148,7 +148,7 @@ void iokbd_scan(uint8_t *scan) for(int i = 0; i < 12; i++) scan[i] = iokbd_row(i); /* Translate fx-9860G Slim scancodes to standard scancodes */ - if (gint[HWCALC] == HWCALC_FX9860G_SLIM) + if (isSlim()) { uint8_t slim_scan[12]; for (uint i = 0; i < 10; i++) diff --git a/src/t6k11/t6k11.c b/src/t6k11/t6k11.c index e4e2773..678724a 100644 --- a/src/t6k11/t6k11.c +++ b/src/t6k11/t6k11.c @@ -168,7 +168,7 @@ void t6k11_backlight(int setting) TODO: Document the PFC to remove these addresses */ if(isSH3()) { - if (gint[HWCALC] == HWCALC_FX9860G_SLIM) + if (isSlim()) { port = (void *)0xa4000126; mask = 0x20;