Skip to content

Commit

Permalink
Fix detection of PAL region in A78 header.
Browse files Browse the repository at this point in the history
  • Loading branch information
wavemotion-dave committed Oct 26, 2022
1 parent d0c5361 commit 4394684
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Binary file modified A7800DS.nds
Binary file not shown.
3 changes: 2 additions & 1 deletion arm9/source/emu/Cartridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void cartridge_ReadHeader(const byte* header) {

myCartInfo.cardctrl1 = header[55];
myCartInfo.cardctrl2 = header[56];
myCartInfo.region = header[57];
myCartInfo.region = header[57] & 1;
myCartInfo.hsc = (header[58]&1 ? HSC_YES:HSC_NO);
myCartInfo.steals_cycles = true; // By default, assume the cart steals cycles
myCartInfo.uses_wsync = true; // By default, assume the cart uses wsync
Expand Down Expand Up @@ -423,4 +423,5 @@ void cartridge_Release( )
myCartInfo.steals_cycles = false;
myCartInfo.uses_wsync = false;
myCartInfo.hasHeader = false;
last_bank = 255;
}
2 changes: 1 addition & 1 deletion arm9/source/emu/Database.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ bool database_Load(byte *digest)
myCartInfo.yScale = 220;
myCartInfo.diff1 = DIFF_A;
myCartInfo.diff2 = DIFF_A;
myCartInfo.region = NTSC;
myCartInfo.steals_cycles = STEAL_CYCLE;
myCartInfo.uses_wsync = false;
myCartInfo.spare1 = 0;
Expand All @@ -268,6 +267,7 @@ bool database_Load(byte *digest)
// -------------------------------------------------------------------
if (myCartInfo.hasHeader == false)
{
myCartInfo.region = NTSC;
if (cartridge_size == (144*1024)) myCartInfo.cardtype = CT_SUPLRG;
else myCartInfo.cardtype = (cartridge_size <= (48*1024)) ? CT_NORMAL:CT_SUPROM;
myCartInfo.pokeyType = POKEY_NONE;
Expand Down

0 comments on commit 4394684

Please sign in to comment.