aboutsummaryrefslogtreecommitdiff
path: root/src/DSi_I2C.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DSi_I2C.cpp')
-rw-r--r--src/DSi_I2C.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/DSi_I2C.cpp b/src/DSi_I2C.cpp
index 5d13b2a..5889bef 100644
--- a/src/DSi_I2C.cpp
+++ b/src/DSi_I2C.cpp
@@ -169,7 +169,6 @@ u32 Device;
bool Init()
{
if (!DSi_BPTWL::Init()) return false;
- if (!DSi_Camera::Init()) return false;
return true;
}
@@ -177,7 +176,6 @@ bool Init()
void DeInit()
{
DSi_BPTWL::DeInit();
- DSi_Camera::DeInit();
}
void Reset()
@@ -188,7 +186,6 @@ void Reset()
Device = -1;
DSi_BPTWL::Reset();
- DSi_Camera::Reset();
}
void DoSavestate(Savestate* file)
@@ -200,12 +197,11 @@ void DoSavestate(Savestate* file)
file->Var32(&Device);
DSi_BPTWL::DoSavestate(file);
- // cameras are savestated from the DSi_Camera module
}
void WriteCnt(u8 val)
{
- //printf("I2C: write CNT %02X, %08X\n", val, NDS::GetPC(1));
+ //printf("I2C: write CNT %02X, %02X, %08X\n", val, Data, NDS::GetPC(1));
// TODO: check ACK flag
// TODO: transfer delay
@@ -224,8 +220,8 @@ void WriteCnt(u8 val)
switch (Device)
{
case 0x4A: Data = DSi_BPTWL::Read(islast); break;
- case 0x78: Data = DSi_Camera0->I2C_Read(islast); break;
- case 0x7A: Data = DSi_Camera1->I2C_Read(islast); break;
+ case 0x78: Data = DSi_CamModule::Camera0->I2C_Read(islast); break;
+ case 0x7A: Data = DSi_CamModule::Camera1->I2C_Read(islast); break;
case 0xA0:
case 0xE0: Data = 0xFF; break;
default:
@@ -250,8 +246,8 @@ void WriteCnt(u8 val)
switch (Device)
{
case 0x4A: DSi_BPTWL::Start(); break;
- case 0x78: DSi_Camera0->I2C_Start(); break;
- case 0x7A: DSi_Camera1->I2C_Start(); break;
+ case 0x78: DSi_CamModule::Camera0->I2C_Start(); break;
+ case 0x7A: DSi_CamModule::Camera1->I2C_Start(); break;
case 0xA0:
case 0xE0: ack = false; break;
default:
@@ -267,8 +263,8 @@ void WriteCnt(u8 val)
switch (Device)
{
case 0x4A: DSi_BPTWL::Write(Data, islast); break;
- case 0x78: DSi_Camera0->I2C_Write(Data, islast); break;
- case 0x7A: DSi_Camera1->I2C_Write(Data, islast); break;
+ case 0x78: DSi_CamModule::Camera0->I2C_Write(Data, islast); break;
+ case 0x7A: DSi_CamModule::Camera1->I2C_Write(Data, islast); break;
case 0xA0:
case 0xE0: ack = false; break;
default: