- more work on a backup memory stuff (fix Fokemons :) broken by me on r4807)
This commit is contained in:
mtabachenko 2013-10-23 19:00:12 +00:00
parent 68525db6d9
commit 4ce78d5e49
3 changed files with 11 additions and 13 deletions

View File

@ -2460,7 +2460,6 @@ u32 DmaController::read32()
static INLINE void write_auxspicnt(const int proc, const int size, const int adr, const int val) static INLINE void write_auxspicnt(const int proc, const int size, const int adr, const int val)
{ {
//u16 oldCnt = MMU.AUX_SPI_CNT;
bool csOld = (MMU.AUX_SPI_CNT & (1 << 6))?true:false; bool csOld = (MMU.AUX_SPI_CNT & (1 << 6))?true:false;
switch(size) switch(size)
@ -2477,6 +2476,9 @@ static INLINE void write_auxspicnt(const int proc, const int size, const int adr
//printf("MMU%c: cnt %04X, old %04X\n", proc?'7':'9', MMU.AUX_SPI_CNT, oldCnt); //printf("MMU%c: cnt %04X, old %04X\n", proc?'7':'9', MMU.AUX_SPI_CNT, oldCnt);
if (MMU.AUX_SPI_CNT == 0)
MMU_new.backupDevice.reset_command(false);
if (!cs && csOld) if (!cs && csOld)
{ {
//printf("MMU%c: CS changed from HIGH to LOW *****\n", proc?'7':'9'); //printf("MMU%c: CS changed from HIGH to LOW *****\n", proc?'7':'9');

View File

@ -244,12 +244,7 @@ void BackupDevice::detect()
printf("Autodetecting with autodetect_size=%d\n",autodetect_size); printf("Autodetecting with autodetect_size=%d\n",autodetect_size);
const u8 sm64_sig[] = {0x01,0x80,0x00,0x00}; //detect based on rules
if(autodetect_size == 4 && !memcmp(&data_autodetect[0],sm64_sig,4))
{
addr_size = 2;
}
else //detect based on rules
switch(autodetect_size) switch(autodetect_size)
{ {
case 0: case 0:
@ -257,11 +252,11 @@ void BackupDevice::detect()
addr_size = 1; //choose 1 just to keep the busted savefile from growing too big addr_size = 1; //choose 1 just to keep the busted savefile from growing too big
if(!memcmp(gameInfo.header.gameCode,"AL3", 3)) break; //spongebob atlantis squarepantis. if(!memcmp(gameInfo.header.gameCode,"AL3", 3)) break; //spongebob atlantis squarepantis.
//if(!memcmp(gameInfo.header.gameCode,"AH5",3)) break; //over the hedge
if(!memcmp(gameInfo.header.gameCode,"AVH", 3)) break; //over the hedge - Hammy Goes Nuts! if(!memcmp(gameInfo.header.gameCode,"AVH", 3)) break; //over the hedge - Hammy Goes Nuts!
if(!memcmp(gameInfo.header.gameCode,"AQ3", 3)) break; //spider-man 3 if(!memcmp(gameInfo.header.gameCode,"AQ3", 3)) break; //spider-man 3
msgbox->error("Catastrophic error while autodetecting save type.\nIt will need to be specified manually\n"); printf("Catastrophic error while autodetecting save type.\nIt will need to be specified manually\n");
//msgbox->error("Catastrophic error while autodetecting save type.\nIt will need to be specified manually\n");
break; break;
case 2: case 2:
//the modern typical case for small eeproms //the modern typical case for small eeproms
@ -279,6 +274,7 @@ void BackupDevice::detect()
case 4: case 4:
//a modern typical case //a modern typical case
addr_size = 3; addr_size = 3;
if(!memcmp(gameInfo.header.gameCode,"ASM", 3)) addr_size = 2; //super mario 64 ds
break; break;
default: default:
//the archaic case: write the address and then some modulo-4 number of bytes //the archaic case: write the address and then some modulo-4 number of bytes

View File

@ -76,7 +76,7 @@ public:
bool load_state(EMUFILE* is); bool load_state(EMUFILE* is);
//commands from mmu //commands from mmu
void reset_command() { reset_command_state = true; }; void reset_command(bool state = true) { reset_command_state = state; };
u8 data_command(u8,int); u8 data_command(u8,int);
std::vector<u8> data; std::vector<u8> data;