actual DSi camera support (#1520)

basically feeding something that isn't a fixed stripe pattern, and emulating enough of the camera hardware to make this work
This commit is contained in:
Arisotura
2022-10-02 16:47:57 +02:00
committed by GitHub
parent c1c4cbc838
commit 3f4573574a
23 changed files with 2024 additions and 270 deletions

View File

@ -723,8 +723,8 @@ bool DoSavestate_Scheduler(Savestate* file)
DSi_SDHost::FinishRX,
DSi_SDHost::FinishTX,
DSi_NWifi::MSTimer,
DSi_Camera::IRQ,
DSi_Camera::Transfer,
DSi_CamModule::IRQ,
DSi_CamModule::TransferScanline,
DSi_DSP::DSPCatchUpU32,
nullptr
@ -1282,6 +1282,21 @@ void SetLidClosed(bool closed)
}
}
void CamInputFrame(int cam, u32* data, int width, int height, bool rgb)
{
// TODO: support things like the GBA-slot camera addon
// whenever these are emulated
if (ConsoleType == 1)
{
switch (cam)
{
case 0: return DSi_CamModule::Camera0->InputFrame(data, width, height, rgb);
case 1: return DSi_CamModule::Camera1->InputFrame(data, width, height, rgb);
}
}
}
void MicInputFrame(s16* data, int samples)
{
return SPI_TSC::MicInputFrame(data, samples);
@ -2004,7 +2019,7 @@ void debug(u32 param)
fwrite(&val, 4, 1, shit);
}
fclose(shit);
shit = fopen("debug/directboot7.bin", "wb");
shit = fopen("debug/camera7.bin", "wb");
for (u32 i = 0x02000000; i < 0x04000000; i+=4)
{
u32 val = DSi::ARM7Read32(i);