Z80 NMI

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Post Reply
Graz
Very interested
Posts: 81
Joined: Thu Aug 23, 2007 12:36 am
Location: Orlando, FL

Z80 NMI

Post by Graz » Tue Dec 09, 2008 12:57 am

Does anyone know what generates an NMI on the Z80? According to the schematics I have, it's connected to the VDP (pin 70, labeled /NMI). However, I can't find the Z80's NMI mentioned in any documentation, and none of the ROMs I've looked at have a handler at 66h, suggesting that it can at least be disabled on the VDP end. Have I missed something?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Dec 09, 2008 3:55 am

NMI is generated only in SMS mode when you ground one address line on cart slot, otherwise NMI never happens.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Post by HardWareMan » Tue Dec 09, 2008 3:58 am

TmEE co.(TM) wrote:NMI is generated only in SMS mode when you ground one address line on cart slot, otherwise NMI never happens.
Wich one address line? SMS mode - M3 signal on cartrige slot (B31) on ground?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Dec 09, 2008 8:40 am

M3 is the B30 signal, and it needs to be grounded for SMS mode, and A23 is the signal used for Pause (in SMS, Pause is connected to Z80 NMI line). In MD mode, NMI never happens.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Graz
Very interested
Posts: 81
Joined: Thu Aug 23, 2007 12:36 am
Location: Orlando, FL

Post by Graz » Tue Dec 09, 2008 4:53 pm

If I understand correctly, on a real SMS the NMI is generated in hardware by the pause button. This button is not present on the genesis, but is on the power base converter. Then, the power base converter grounds M3 to signal SMS compatibility mode.
You say that A23 is used for pause. Does the pause button on the power base converter connect directly to this line? How does that in turn generate the Z80 NMI via the VDP so that the SMS game will pause?

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Tue Dec 09, 2008 6:54 pm

the M3 pin is connected to the VDP, I/O chip and to the Bus Arbitrer (the glue chip), this apparently put those three chips in SMS compatibility mode

the Z80 NMI input is connected to the Bus Arbitrer

most probably, when M3 is asserted, as soon as A23 state changes, the bus arbitrer triggers a NMI interrupt on Z80 side

Graz
Very interested
Posts: 81
Joined: Thu Aug 23, 2007 12:36 am
Location: Orlando, FL

Post by Graz » Wed Dec 10, 2008 12:47 am

That's interesting. I wonder if there is any way to programatically generate an NMI from the 68K. Has anyone ever probed the undocumented area above A11200? It makes sense that if Sega were to plan such a feature, that is where the register would be. For example, what happens when a write is performed to A11300?

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Post by HardWareMan » Wed Dec 10, 2008 3:32 am

TmEE co.(TM) wrote:M3 is the B30 signal, and it needs to be grounded for SMS mode, and A23 is the signal used for Pause (in SMS, Pause is connected to Z80 NMI line). In MD mode, NMI never happens.
Sure, my mistake. It is B30, becouse B31 is !TIME signal.
So, when MD in M3 mode, A23 routed directly to Z80 NMI, or trough some pulse-forming logic? I mean, Z80 NMI signal is edge sensitive signal, and no need to make pulse with normed width.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Dec 10, 2008 6:48 am

There are some extra components involved in SMS1, I only have SMS2 and its more integrated than SMS1...
I wonder if there actually is something in the undocumented I/O area... I guess things are probably just mirrored there.
The NMI could be useful command exchanges, place your data in Z80 RAM and trigger NMI...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Graz
Very interested
Posts: 81
Joined: Thu Aug 23, 2007 12:36 am
Location: Orlando, FL

Post by Graz » Wed Dec 10, 2008 5:06 pm

Mirroring usually occurs because of incomplete address decoding. As the Genesis only has (documented) registers at A11000, A11100, and A11200, it makes me wonder what, if anything, might be at A11300. If wrapping occurs, there's probably a mirror of A11000 at A11400, leaving a convenient gap at A11300.
I do have a setup to run code on real hardware. Perhaps I'll experiment some if I can find time. The ability to trigger an interrupt from one CPU to the other in either direction could be quite handy.

Post Reply