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
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