Skip to content

Commit 8a75015

Browse files
authored
m32x: make PWM timer interrupt interval bits read-only from the MD side (#1813)
Per page 24 of the 32X hardware manual, the PWM timer interrupt interval is read-only from the Mega Drive side. This change fixes incorrect sound effects in Primal Rage. If the 68000 is allowed to write to these bits, it will change the PWM timer interval from 1 to 16 during game boot, which breaks the game's PWM sound driver code. Primal Rage title screen audio before this change: [primal-rage-before.webm](https://github.com/user-attachments/assets/0d8a33d1-22fb-4664-a802-00715541e67f) After: [primal-rage-after.webm](https://github.com/user-attachments/assets/87a3cdfe-85a4-45e7-8ea8-bc3e5bde4f7a)
1 parent 330a329 commit 8a75015

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ares/md/m32x/io-external.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ auto M32X::writeExternalIO(n1 upper, n1 lower, n24 address, n16 data) -> void {
267267
//pwm.dreqIRQ = data.bit(7) = readonly;
268268
}
269269
if(upper) {
270-
pwm.timer = data.bit(8,11);
271-
pwm.periods = 0;
270+
//pwm.timer = data.bit(8,11) = readonly;
271+
//pwm.periods = 0 = readonly;
272272
}
273273
}
274274

0 commit comments

Comments
 (0)