-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
barcrest\mpu3.cpp: Correct 100hz signal to pia6821 ic3 #13215
Conversation
src/mame/barcrest/mpu3.cpp
Outdated
@@ -747,14 +746,14 @@ void mpu3_state::machine_start() | |||
} | |||
|
|||
/* generate a 50 Hz signal (some components rely on this for external sync) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should be updated to say 100 Hz.
src/mame/barcrest/mpu3.cpp
Outdated
m_signal_50hz = m_signal_50hz?0:1; | ||
m_ptm2->set_c1(m_signal_50hz); | ||
m_pia3->cb1_w(~m_signal_50hz); | ||
m_signal_100hz = m_signal_100hz?0:1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're here, may as well clean it up a little: "m_signal_100hz ^= 1" would work to toggle it without needing the compare.
BTW, there are a couple of games which don't run due to a problem in the 6802 core. As the cpu core covers several processors I'm not going to mod it at this point. Might be worth making a note of this somewhere for the future ? |
Those 6802 fixes seem like pretty low-risk changes, but I can check them out if you can give me more info on which MPU3 games break (and ideally the program counter of the bad CLR instruction). |
I don't think 6800 TST is read-modify-write? Try this suggested fix in 6800ops.hxx: I see the read cycle too in Hitachi 6301Y0 manual, so Hitachi kept the dummy read in. |
I had that change in my local copy and I know it fixes the games which don't currently start. The 6802 datasheet lists the TST instruction together with CLR and all other RMW instructions but there is a note attached to it which I didn't spot. I'm happy to do the CLR changes if everyone else is happy they're safe ? |
Yeah, go ahead and add hap's fixes. Also, for the second change, you put: m_signal_100hz = m_signal_100hz^=1; That's one too many assignments, which is why the auto build is complaining. Just "m_signal_100hz ^= 1;" works. And we prefer it with the spaces between the parts like I have there. |
M6801 never performs a write cycle for TST. CLR, on the other hand, is in fact executed as a unary read-modify-write operation on M6800 and M6801, much like it is on M68HC11, M6809, MC68000 (but not its 16-bit and 32-bit successors) and most PDP-11 models. |
That CLR fix is better placed in a new PR. But instead, it's faster to just add it directly, which I did: 035b34a I think at most, a few drivers will get a spammy error.log (debug->new error log window). If it gets too bad, they can add a nopr(). |
Thanks happppp, I was just about to do that. I've now fixed the toggle of m_signal_100hz and changed comments on some games. |
100hz signal to the pia was previously done with m_pia3->cb1_w(~m_signal_50hz);
As m_signal_50hz was an int with a value of 0 or 1 this meant cb1_w() was always being called with a non-zero value.
In addition to the above, it's supposed to be a 100hz signal, not 50hz.
This fixes software which boots and then locks with TURN-ON-DELAY 30 on the display.
Also, fixes software which use the WAI instruction and then lock.