diff --git a/src/engine/platform/arcade.cpp b/src/engine/platform/arcade.cpp index 95a3d7750..3e09dfbe1 100644 --- a/src/engine/platform/arcade.cpp +++ b/src/engine/platform/arcade.cpp @@ -175,7 +175,7 @@ void DivPlatformArcade::tick(bool sysTick) { if (chan[i].std.duty.had) { if (chan[i].std.duty.val>0) { - rWrite(0x0f,0x80|(0x20-chan[i].std.duty.val)); + rWrite(0x0f,0x80|(chan[i].std.duty.val-1)); } else { rWrite(0x0f,0); } @@ -768,9 +768,9 @@ int DivPlatformArcade::dispatch(DivCommand c) { if (c.chan!=7) break; if (c.value) { if (c.value>0x1f) { - rWrite(0x0f,0x80); + rWrite(0x0f,0x80|0x1f); } else { - rWrite(0x0f,0x80|(0x1f-c.value)); + rWrite(0x0f,0x80|(c.value-1)); } } else { rWrite(0x0f,0); diff --git a/src/engine/platform/tx81z.cpp b/src/engine/platform/tx81z.cpp index 52f71aedc..540365cde 100644 --- a/src/engine/platform/tx81z.cpp +++ b/src/engine/platform/tx81z.cpp @@ -134,7 +134,7 @@ void DivPlatformTX81Z::tick(bool sysTick) { if (chan[i].std.duty.had) { if (chan[i].std.duty.val>0) { - rWrite(0x0f,0x80|(0x20-chan[i].std.duty.val)); + rWrite(0x0f,0x80|(chan[i].std.duty.val-1)); } else { rWrite(0x0f,0); } @@ -865,9 +865,9 @@ int DivPlatformTX81Z::dispatch(DivCommand c) { if (c.chan!=7) break; if (c.value) { if (c.value>0x1f) { - rWrite(0x0f,0x80); + rWrite(0x0f,0x80|0x1f); } else { - rWrite(0x0f,0x80|(0x1f-c.value)); + rWrite(0x0f,0x80|(c.value-1)); } } else { rWrite(0x0f,0);