get it to do more interesting things
This commit is contained in:
parent
93330d2670
commit
4d3f346edc
|
@ -175,7 +175,7 @@ void ARMv5::JumpTo(u32 addr, bool restorecpsr)
|
||||||
// aging cart debug crap
|
// aging cart debug crap
|
||||||
//if (addr == 0x0201764C) printf("capture test %d: R1=%08X\n", R[6], R[1]);
|
//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 == 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 oldregion = R[15] >> 24;
|
||||||
u32 newregion = addr >> 24;
|
u32 newregion = addr >> 24;
|
||||||
|
@ -243,6 +243,8 @@ void ARMv4::JumpTo(u32 addr, bool restorecpsr)
|
||||||
else addr &= ~0x1;
|
else addr &= ~0x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if (addr==0x037D5A18) printf("SHITTY FUNC. %08X\n", R[15]);
|
||||||
|
|
||||||
u32 oldregion = R[15] >> 23;
|
u32 oldregion = R[15] >> 23;
|
||||||
u32 newregion = addr >> 23;
|
u32 newregion = addr >> 23;
|
||||||
|
|
||||||
|
|
|
@ -817,6 +817,7 @@ u16 ARM9IORead16(u32 addr)
|
||||||
{
|
{
|
||||||
switch (addr)
|
switch (addr)
|
||||||
{
|
{
|
||||||
|
case 0x04004004: return 0; // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
return NDS::ARM9IORead16(addr);
|
return NDS::ARM9IORead16(addr);
|
||||||
|
|
|
@ -133,7 +133,6 @@ void WriteCnt(u8 val)
|
||||||
{
|
{
|
||||||
printf("I2C: write CNT %02X\n", val);
|
printf("I2C: write CNT %02X\n", val);
|
||||||
|
|
||||||
val &= 0xF7;
|
|
||||||
// TODO: check ACK flag
|
// TODO: check ACK flag
|
||||||
// TODO: transfer delay
|
// TODO: transfer delay
|
||||||
// TODO: IRQ
|
// TODO: IRQ
|
||||||
|
@ -141,41 +140,47 @@ void WriteCnt(u8 val)
|
||||||
|
|
||||||
if (val & (1<<7))
|
if (val & (1<<7))
|
||||||
{
|
{
|
||||||
bool islast = Cnt & (1<<0);
|
bool islast = val & (1<<0);
|
||||||
|
|
||||||
if (val & (1<<5))
|
if (val & (1<<5))
|
||||||
{
|
{
|
||||||
// read
|
// read
|
||||||
printf("I2C read, device=%02X, cnt=%02X, last=%d\n", Device, Cnt, islast);
|
val &= 0xF7;
|
||||||
|
|
||||||
switch (Device)
|
switch (Device)
|
||||||
{
|
{
|
||||||
case 0x4A: Data = DSi_BPTWL::Read(islast); break;
|
case 0x4A: Data = DSi_BPTWL::Read(islast); break;
|
||||||
default: Data = 0; break;
|
default: Data = 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("I2C read, device=%02X, cnt=%02X, data=%02X, last=%d\n", Device, val, Data, islast);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// write
|
// write
|
||||||
printf("I2C write, device=%02X, cnt=%02X, last=%d\n", Device, Cnt, islast);
|
val &= 0xE7;
|
||||||
|
|
||||||
if (val & (1<<1))
|
if (val & (1<<1))
|
||||||
{
|
{
|
||||||
Device = Data;
|
Device = Data & 0xFE;
|
||||||
printf("I2C: start, device=%02X\n", Device);
|
printf("I2C: %s start, device=%02X\n", (Data&0x01)?"read":"write", Device);
|
||||||
|
|
||||||
switch (Device)
|
switch (Device)
|
||||||
{
|
{
|
||||||
case 0x4A: DSi_BPTWL::Start(); return;
|
case 0x4A: DSi_BPTWL::Start(); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
printf("I2C write, device=%02X, cnt=%02X, data=%02X, last=%d\n", Device, val, Data, islast);
|
||||||
|
|
||||||
switch (Device)
|
switch (Device)
|
||||||
{
|
{
|
||||||
case 0x4A: DSi_BPTWL::Write(Data, islast); break;
|
case 0x4A: DSi_BPTWL::Write(Data, islast); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val |= (1<<4);
|
||||||
}
|
}
|
||||||
|
|
||||||
val &= 0x7F;
|
val &= 0x7F;
|
||||||
|
|
Loading…
Reference in New Issue