Skip to content

Commit

Permalink
md, minor cleanup for region code handling
Browse files Browse the repository at this point in the history
  • Loading branch information
irixxxx committed Jun 15, 2024
1 parent 93a1482 commit 1a357e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 0 additions & 4 deletions pico/cart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,10 +1341,6 @@ static void PicoCartDetect(const char *carthw_cfg)
memset(Pico.sv.data, 0xff, Pico.sv.size);
}

// Unusual region 'code'
if (rom_strcmp(0x1f0, "EUROPE") == 0 || rom_strcmp(0x1f0, "Europe") == 0)
*(u32 *) (Pico.rom + 0x1f0) = CPU_LE4(0x20204520);

// tweak for Blackthorne: master SH2 overwrites stack of slave SH2 being in PWM
// interrupt. On real hardware, nothing happens since slave fetches the values
// it has written from its cache, but picodrive doesn't emulate caching.
Expand Down
8 changes: 7 additions & 1 deletion pico/pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,21 @@ PICO_INTERNAL void PicoDetectRegion(void)
{
int support=0, hw=0, i;
unsigned char pal=0;
char *pr = (char *)(Pico.rom + 0x1f0);

if (PicoIn.regionOverride)
{
support = PicoIn.regionOverride;
}
else if (strcmp(pr, "EUROPE") == 0 || strcmp(pr, "Europe") == 0)
{
// Unusual cartridge region 'code'
support|=8;
}
else
{
// Read cartridge region data:
unsigned short *rd = (unsigned short *)(Pico.rom + 0x1f0);
unsigned short *rd = (unsigned short *)pr;
int region = (rd[0] << 16) | rd[1];

for (i = 0; i < 4; i++)
Expand Down

0 comments on commit 1a357e7

Please sign in to comment.