Fixed the e-Reader region error by refreshing the CPU prefetch after a patch is made.

This commit is contained in:
skidau 2015-04-03 10:48:28 +00:00
parent e47ac18e30
commit 9b05099491
3 changed files with 19 additions and 8 deletions

View File

@ -383,8 +383,13 @@ void BIOS_EReader_ScanCard(int swi_num)
GFpow = 0x3000A6C; GFpow = 0x3000A6C;
break; break;
} }
armNextPC -= 2; armNextPC -= 2;
reg[15].I -= 2; reg[15].I -= 2;
if (armState)
ARM_PREFETCH
else
THUMB_PREFETCH
for(i=0,j=0;i<12;i++) for(i=0,j=0;i<12;i++)
j ^= DotCodeData[i]; j ^= DotCodeData[i];
@ -511,6 +516,10 @@ void BIOS_EReader_ScanCard(int swi_num)
} }
armNextPC -= 2; armNextPC -= 2;
reg[15].I -= 2; reg[15].I -= 2;
if (armState)
ARM_PREFETCH
else
THUMB_PREFETCH
} }
else if ((swi_num == 0xE3) || (swi_num == 0xE5)) //Dotcode data else if ((swi_num == 0xE3) || (swi_num == 0xE5)) //Dotcode data
{ {
@ -609,10 +618,12 @@ void BIOS_EReader_ScanCard(int swi_num)
reg[15].I = reg[base].I & 0xFFFFFFFC; reg[15].I = reg[base].I & 0xFFFFFFFC;
armNextPC = reg[15].I; armNextPC = reg[15].I;
reg[15].I += 4; reg[15].I += 4;
ARM_PREFETCH
} else { } else {
reg[15].I = reg[base].I & 0xFFFFFFFE; reg[15].I = reg[base].I & 0xFFFFFFFE;
armNextPC = reg[15].I; armNextPC = reg[15].I;
reg[15].I += 2; reg[15].I += 2;
THUMB_PREFETCH
} }
} }
else if (swi_num == 0xE4) else if (swi_num == 0xE4)

View File

@ -1113,12 +1113,12 @@ void MainWnd::OnFileLoadDotCode()
//getHandle() //getHandle()
FileDlg file(0, //Get the proper handle somehow, and put it here. FileDlg file(0, //Get the proper handle somehow, and put it here.
"", "",
"E-Reader dot code (*.bin, *.raw)|*.bin;*.raw|All Files (*.*)|*.*||", "e-Reader dot code (*.bin, *.raw)|*.bin;*.raw|All Files (*.*)|*.*||",
0, 0,
"RAW", "RAW",
(LPCTSTR *)exts, (LPCTSTR *)exts,
NULL, NULL,
"Load Nintendo E-Reader Dotcode", "Load e-Reader Dot Code",
FALSE); FALSE);
if (file.DoModal() == IDOK) if (file.DoModal() == IDOK)
{ {
@ -1135,12 +1135,12 @@ void MainWnd::OnFileSaveDotCode()
//getHandle() //getHandle()
FileDlg file(0, //Get the proper handle somehow, and put it here. FileDlg file(0, //Get the proper handle somehow, and put it here.
"", "",
"E-Reader dot code (*.raw)|*.raw|All Files (*.*)|*.*||", "e-Reader Dot Code (*.raw)|*.raw|All Files (*.*)|*.*||",
0, 0,
"RAW", "RAW",
(LPCTSTR *)exts, (LPCTSTR *)exts,
NULL, NULL,
"Save Nintendo E-Reader Dotcode", "Save e-Reader Dot Code",
TRUE); TRUE);
if (file.DoModal() == IDOK) if (file.DoModal() == IDOK)
{ {

View File

@ -1601,9 +1601,6 @@ BEGIN
MENUITEM "Open GB...", ID_FILE_OPEN_GB MENUITEM "Open GB...", ID_FILE_OPEN_GB
MENUITEM "Close", ID_FILE_CLOSE MENUITEM "Close", ID_FILE_CLOSE
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Load E-Reader DotCode...", ID_FILE_LOAD_DOTCODE
MENUITEM "Save E-Reader DotCode...", ID_FILE_SAVE_DOTCODE
MENUITEM SEPARATOR
MENUITEM "&Link with...", ID_OPTIONS_LINK_OPTIONS MENUITEM "&Link with...", ID_OPTIONS_LINK_OPTIONS
MENUITEM SEPARATOR MENUITEM SEPARATOR
POPUP "Recent" POPUP "Recent"
@ -1652,7 +1649,10 @@ BEGIN
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Pause", ID_FILE_PAUSE MENUITEM "Pause", ID_FILE_PAUSE
MENUITEM "Reset", ID_FILE_RESET MENUITEM "Reset", ID_FILE_RESET
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Load e-Reader Dot Code...", ID_FILE_LOAD_DOTCODE
MENUITEM "Save e-Reader Dot Code...", ID_FILE_SAVE_DOTCODE
MENUITEM SEPARATOR
POPUP "Import" POPUP "Import"
BEGIN BEGIN
MENUITEM "&Battery file...", ID_FILE_IMPORT_BATTERYFILE MENUITEM "&Battery file...", ID_FILE_IMPORT_BATTERYFILE