camera: fix bugs that Epicpkmn11's camera demo revealed
This commit is contained in:
parent
a6e88bf6c0
commit
ac9a4cfd6d
|
@ -217,7 +217,7 @@ void TransferScanline(u32 line)
|
|||
{
|
||||
// return raw data
|
||||
|
||||
memcpy(dstbuf, &tmpbuf[copystart], copylen);
|
||||
memcpy(dstbuf, &tmpbuf[copystart], copylen*sizeof(u32));
|
||||
}
|
||||
|
||||
u32 numscan = Cnt & 0x000F;
|
||||
|
@ -577,19 +577,13 @@ int Camera::TransferScanline(u32* buffer, int maxlen)
|
|||
|
||||
void Camera::I2C_Start()
|
||||
{
|
||||
DataPos = 0;
|
||||
}
|
||||
|
||||
u8 Camera::I2C_Read(bool last)
|
||||
{
|
||||
u8 ret;
|
||||
|
||||
if (DataPos < 2)
|
||||
{
|
||||
printf("DSi_Camera: WHAT??\n");
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DataPos & 0x1)
|
||||
{
|
||||
ret = RegData & 0xFF;
|
||||
|
@ -600,7 +594,6 @@ u8 Camera::I2C_Read(bool last)
|
|||
RegData = I2C_ReadReg(RegAddr);
|
||||
ret = RegData >> 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (last) DataPos = 0;
|
||||
else DataPos++;
|
||||
|
|
|
@ -201,7 +201,7 @@ void DoSavestate(Savestate* file)
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue