Skip to content

Commit

Permalink
Now works with proper gyro input
Browse files Browse the repository at this point in the history
  • Loading branch information
Gericom committed Dec 28, 2019
1 parent c7c78d0 commit ee7f6a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions arm7/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ extern "C" void rtcomIrq()
{
//sSampleGyro = true;
s16 gyro0 = rtcom_getData();
rtcom_requestNext(4);
rtcom_requestNext(8);
vram_cd->gyroZ = gyro0 | (rtcom_getData() << 8);
rtcom_requestKill();
if(sGyroEnabled)
{
sRtcomState = RTCOM_STATE_EXEC_UCODE3_ACK;
rtcom_requestAsync(RTCOM_REQ_EXECUTE_UCODE, 3);
rtcom_requestAsync(RTCOM_REQ_EXECUTE_UCODE, 7);
}
else
{
Expand Down Expand Up @@ -325,7 +325,7 @@ int main()
rtcom_beginComm();
REG_IE |= IRQ_NETWORK;
sRtcomState = RTCOM_STATE_EXEC_UCODE3_ACK;
rtcom_requestAsync(RTCOM_REQ_EXECUTE_UCODE, 3);
rtcom_requestAsync(RTCOM_REQ_EXECUTE_UCODE, 7);
}
break;
case 0xAA550102: //disable gyro sampling
Expand Down
Binary file modified arm9/data/a11ucode.uc11
Binary file not shown.
2 changes: 1 addition & 1 deletion arm9/source/emu/romGpioGyro.vram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void rio_gyroUpdate()
if(gRioGpioData & 1)
{
vram_cd_t* vramcd_uncached = (vram_cd_t*)(((u32)vram_cd) + UNCACHED_OFFSET);
sGyroSample = (vramcd_uncached->gyroZ >> 5) + 0x6C0;
sGyroSample = ((vramcd_uncached->gyroZ * 79) >> 12) + 0x6C0;//(vramcd_uncached->gyroZ >> 6) + 0x6C0;
}

if(sGyroEdge && !(gRioGpioData & 2))
Expand Down

0 comments on commit ee7f6a0

Please sign in to comment.