get it to do more interesting things

This commit is contained in:
Arisotura 2019-06-15 18:30:12 +02:00
parent 93330d2670
commit 4d3f346edc
3 changed files with 16 additions and 8 deletions

View File

@ -175,7 +175,7 @@ void ARMv5::JumpTo(u32 addr, bool restorecpsr)
// 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==0x037CA0D0) printf("VLORP %08X\n", R[15]);
//if (addr==0x037CA0D0) printf("VLORP %08X\n", R[15]);
u32 oldregion = R[15] >> 24;
u32 newregion = addr >> 24;
@ -243,6 +243,8 @@ void ARMv4::JumpTo(u32 addr, bool restorecpsr)
else addr &= ~0x1;
}
//if (addr==0x037D5A18) printf("SHITTY FUNC. %08X\n", R[15]);
u32 oldregion = R[15] >> 23;
u32 newregion = addr >> 23;

View File

@ -817,6 +817,7 @@ u16 ARM9IORead16(u32 addr)
{
switch (addr)
{
case 0x04004004: return 0; // TODO
}
return NDS::ARM9IORead16(addr);

View File

@ -133,7 +133,6 @@ void WriteCnt(u8 val)
{
printf("I2C: write CNT %02X\n", val);
val &= 0xF7;
// TODO: check ACK flag
// TODO: transfer delay
// TODO: IRQ
@ -141,41 +140,47 @@ void WriteCnt(u8 val)
if (val & (1<<7))
{
bool islast = Cnt & (1<<0);
bool islast = val & (1<<0);
if (val & (1<<5))
{
// read
printf("I2C read, device=%02X, cnt=%02X, last=%d\n", Device, Cnt, islast);
val &= 0xF7;
switch (Device)
{
case 0x4A: Data = DSi_BPTWL::Read(islast); break;
default: Data = 0; break;
}
printf("I2C read, device=%02X, cnt=%02X, data=%02X, last=%d\n", Device, val, Data, islast);
}
else
{
// write
printf("I2C write, device=%02X, cnt=%02X, last=%d\n", Device, Cnt, islast);
val &= 0xE7;
if (val & (1<<1))
{
Device = Data;
printf("I2C: start, device=%02X\n", Device);
Device = Data & 0xFE;
printf("I2C: %s start, device=%02X\n", (Data&0x01)?"read":"write", Device);
switch (Device)
{
case 0x4A: DSi_BPTWL::Start(); return;
case 0x4A: DSi_BPTWL::Start(); break;
}
}
else
{
printf("I2C write, device=%02X, cnt=%02X, data=%02X, last=%d\n", Device, val, Data, islast);
switch (Device)
{
case 0x4A: DSi_BPTWL::Write(Data, islast); break;
}
}
val |= (1<<4);
}
val &= 0x7F;