Skip to content

Commit

Permalink
m32x: make PWM timer interrupt interval bits read-only from the MD si…
Browse files Browse the repository at this point in the history
…de (#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)
  • Loading branch information
jsgroth authored Feb 5, 2025
1 parent 330a329 commit 8a75015
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ares/md/m32x/io-external.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ auto M32X::writeExternalIO(n1 upper, n1 lower, n24 address, n16 data) -> void {
//pwm.dreqIRQ = data.bit(7) = readonly;
}
if(upper) {
pwm.timer = data.bit(8,11);
pwm.periods = 0;
//pwm.timer = data.bit(8,11) = readonly;
//pwm.periods = 0 = readonly;
}
}

Expand Down

0 comments on commit 8a75015

Please sign in to comment.