support for tiny EEPROM

This commit is contained in:
StapleButter 2017-03-23 23:47:55 +01:00
parent 49314244e1
commit 4f5eb6caa0
2 changed files with 42 additions and 3 deletions

View File

@ -171,8 +171,9 @@ void ARM::JumpTo(u32 addr, bool restorecpsr)
else addr &= ~0x1;
}
if (addr == 0x0201764C) printf("capture test %d: R1=%08X\n", R[6], R[1]);
if (addr == 0x020175D8) printf("capture test %d: res=%08X\n", R[6], R[0]);
// aging cart debug crap
//if (addr == 0x0201764C) printf("capture test %d: R1=%08X\n", R[6], R[1]);
//if (addr == 0x020175D8) printf("capture test %d: res=%08X\n", R[6], R[0]);
if (addr & 0x1)
{

View File

@ -268,7 +268,45 @@ void Write_Null(u8 val, bool islast) {}
void Write_EEPROMTiny(u8 val, bool islast)
{
// TODO
switch (CurCmd)
{
case 0x02:
case 0x0A:
if (DataPos < 1)
{
Addr = val;
Data = 0;
}
else
{
SRAM[(Addr & 0xFF) | ((CurCmd==0x0A)?0x100:0)] = val;
Addr++;
}
break;
case 0x03:
case 0x0B:
if (DataPos < 1)
{
Addr = val;
Data = 0;
}
else
{
Data = SRAM[(Addr & 0xFF) | ((CurCmd==0x0B)?0x100:0)];
Addr++;
}
break;
case 0x9F:
Data = 0xFF;
break;
default:
if (DataPos==0)
printf("unknown tiny EEPROM save command %02X\n", CurCmd);
break;
}
}
void Write_EEPROM(u8 val, bool islast)