mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
sms, add system select option
This commit is contained in:
parent
cc1547e8cd
commit
280bfc3ca7
9 changed files with 97 additions and 28 deletions
|
@ -298,7 +298,7 @@ enum media_type_e PicoLoadMedia(const char *filename,
|
|||
|
||||
// simple test for GG. Do this here since m.hardware is nulled in Insert
|
||||
if (PicoIn.AHW & PAHW_SMS) {
|
||||
if (!strcmp(rom->ext,"gg")) {
|
||||
if (!strcmp(rom->ext,"gg") && !PicoIn.hwSelect) {
|
||||
Pico.m.hardware |= 0x1;
|
||||
lprintf("detected GG ROM\n");
|
||||
} else
|
||||
|
|
|
@ -82,6 +82,10 @@ extern void *p32x_bios_g, *p32x_bios_m, *p32x_bios_s;
|
|||
#define PAHW_PICO (1<<3)
|
||||
#define PAHW_SMS (1<<4)
|
||||
|
||||
#define PHWS_AUTO 0
|
||||
#define PHWS_GG 1
|
||||
#define PHWS_SMS 2
|
||||
|
||||
#define PQUIRK_FORCE_6BTN (1<<0)
|
||||
|
||||
// the emulator is configured and some status is reported
|
||||
|
@ -97,6 +101,7 @@ typedef struct PicoInterface
|
|||
unsigned short skipFrame; // skip rendering frame, but still do sound (if enabled) and emulation stuff
|
||||
unsigned short regionOverride; // override the region detection 0: auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe
|
||||
unsigned short autoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP
|
||||
unsigned short hwSelect; // hardware preselected via option menu
|
||||
|
||||
unsigned short quirks; // game-specific quirks: PQUIRK_*
|
||||
unsigned short overclockM68k; // overclock the emulated 68k, in %
|
||||
|
|
28
pico/sms.c
28
pico/sms.c
|
@ -335,6 +335,24 @@ void PicoResetMS(void)
|
|||
ymflag = 0xffff;
|
||||
Pico.m.dirtyPal = 1;
|
||||
|
||||
if (PicoIn.hwSelect) {
|
||||
switch (PicoIn.hwSelect) {
|
||||
case PHWS_GG: Pico.m.hardware |= 0x1; break;
|
||||
default: Pico.m.hardware &= ~0x1; break;
|
||||
}
|
||||
} else {
|
||||
unsigned tmr;
|
||||
|
||||
// check if the ROM header contains more system information to detect GG
|
||||
for (tmr = 0x2000; tmr < 0xbfff && tmr <= Pico.romsize; tmr *= 2) {
|
||||
if (!memcmp(Pico.rom + tmr-16, "TMR SEGA", 8)) {
|
||||
if (Pico.rom[tmr-1] >= 0x50 && Pico.rom[tmr-1] < 0x80)
|
||||
Pico.m.hardware |= 0x1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reset memory mapping
|
||||
PicoMemSetupMS();
|
||||
}
|
||||
|
@ -342,7 +360,6 @@ void PicoResetMS(void)
|
|||
void PicoPowerMS(void)
|
||||
{
|
||||
int s, tmp;
|
||||
unsigned tmr;
|
||||
|
||||
memset(&PicoMem,0,sizeof(PicoMem));
|
||||
memset(&Pico.video,0,sizeof(Pico.video));
|
||||
|
@ -359,15 +376,6 @@ void PicoPowerMS(void)
|
|||
tmp = 1 << s;
|
||||
bank_mask = (tmp - 1) >> 14;
|
||||
|
||||
// check if the ROM header contains more system information to detect GG
|
||||
for (tmr = 0x2000; tmr < 0xbfff && tmr <= Pico.romsize; tmr *= 2) {
|
||||
if (!memcmp(Pico.rom + tmr-16, "TMR SEGA", 8)) {
|
||||
if (Pico.rom[tmr-1] >= 0x50 && Pico.rom[tmr-1] < 0x80)
|
||||
Pico.m.hardware |= 0x1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PicoReset();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue