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;
break;
}
armNextPC -= 2;
reg[15].I -= 2;
if (armState)
ARM_PREFETCH
else
THUMB_PREFETCH
for(i=0,j=0;i<12;i++)
j ^= DotCodeData[i];
@ -511,6 +516,10 @@ void BIOS_EReader_ScanCard(int swi_num)
}
armNextPC -= 2;
reg[15].I -= 2;
if (armState)
ARM_PREFETCH
else
THUMB_PREFETCH
}
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;
armNextPC = reg[15].I;
reg[15].I += 4;
ARM_PREFETCH
} else {
reg[15].I = reg[base].I & 0xFFFFFFFE;
armNextPC = reg[15].I;
reg[15].I += 2;
THUMB_PREFETCH
}
}
else if (swi_num == 0xE4)

View File

@ -1113,12 +1113,12 @@ void MainWnd::OnFileLoadDotCode()
//getHandle()
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,
"RAW",
(LPCTSTR *)exts,
NULL,
"Load Nintendo E-Reader Dotcode",
"Load e-Reader Dot Code",
FALSE);
if (file.DoModal() == IDOK)
{
@ -1135,12 +1135,12 @@ void MainWnd::OnFileSaveDotCode()
//getHandle()
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,
"RAW",
(LPCTSTR *)exts,
NULL,
"Save Nintendo E-Reader Dotcode",
"Save e-Reader Dot Code",
TRUE);
if (file.DoModal() == IDOK)
{

View File

@ -1601,9 +1601,6 @@ BEGIN
MENUITEM "Open GB...", ID_FILE_OPEN_GB
MENUITEM "Close", ID_FILE_CLOSE
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 SEPARATOR
POPUP "Recent"
@ -1652,7 +1649,10 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "Pause", ID_FILE_PAUSE
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"
BEGIN
MENUITEM "&Battery file...", ID_FILE_IMPORT_BATTERYFILE