hardware: expose filesystem type in the hardware info

Filesystem type is detected with a trivial heuristic:
* fx-9860G: CASIOWIN, unless Fugue in the G-III series (OS >= 3.00)
* fx-CG 50: Always Fugue
This commit is contained in:
Lephe 2021-12-06 21:31:00 +01:00
parent 86fad757e1
commit 2e5e56f82e
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
2 changed files with 23 additions and 2 deletions

View file

@ -70,6 +70,7 @@ void hw_detect(void);
#define HWKBD 8 /* Keyboard */
#define HWKBDSF /* Deprecated: use keysc_scan_frequency() */
#define HWDD /* Deprecated: use the T6K11/R61524 API */
#define HWFS 11 /* Filesystem type */
/*
** MPU type
@ -118,6 +119,17 @@ void hw_detect(void);
/* The keyboard uses a KEYSC-based scan method. This is only possible on SH4 */
#define HWKBD_KSI 0x04
/*
** Filesystem type
*/
/* Unknown or no filesystem. */
#define HWFS_NONE 0
/* CASIO's in-house filesystem, now deprecated. */
#define HWFS_CASIOWIN 1
/* Wrapper around Kyoto Software Research's Fugue VFAT implementation. */
#define HWFS_FUGUE 2
#ifdef __cplusplus
}
#endif

View file

@ -78,7 +78,15 @@ void hw_detect(void)
be real, is enough for now.
TODO: Try to detect Graph 35+E II from amount of ROM in BSC? */
char *version = (void *)0x80010020;
if(version[1] == '3') gint[HWCALC] = HWCALC_G35PE2;
if(version[1] == '3')
{
gint[HWCALC] = HWCALC_G35PE2;
gint[HWFS] = HWFS_FUGUE;
}
else
{
gint[HWFS] = HWFS_CASIOWIN;
}
/* Detect RAM by checking if 8804'0000 is the same as 8800'0000. */
@ -121,7 +129,8 @@ void hw_detect(void)
/* Tell Prizms apart from fx-CG 50 by checking the stack address*/
uint32_t stack;
__asm__("mov r15, %0" : "=r"(stack));
gint[HWCALC] = (stack < 0x8c000000) ? HWCALC_PRIZM : HWCALC_FXCG50;
gint[HWCALC] = (stack < 0x8c000000) ? HWCALC_PRIZM : HWCALC_FXCG50;
gint[HWFS] = HWFS_FUGUE;
/* Tell the fx-CG emulator apart using the product ID */
uint8_t *productID = (void *)0x8001ffd0;