Here in thr cpc wiki
https://www.cpcwiki.eu/index.php/NMI#:~:text=The%20built%2Din%20components%20in,Multiface%20II%20(Romantic%20Robot)
It says nmi is not handled on cpc, does that mean no nmi is called (without external hardware) or in fact it is handled but it only returns?
You have to swear that you won't enable InternalLowRom.
there is no good code there
ORG &0066
.L0066
LD HL,&B82D
.L0069
LD (HL),&0000
INC HL
DJNZ L0069
LD B,A
LD C,&00FF
XOR C
RET NZ
LD B,A
LD E,A
LD D,A
RET
Quote from: zhulien on 07:07, 23 February 25Here in thr cpc wiki
https://www.cpcwiki.eu/index.php/NMI#:~:text=The%20built%2Din%20components%20in,Multiface%20II%20(Romantic%20Robot)
It says nmi is not handled on cpc, does that mean no nmi is called (without external hardware) or in fact it is handled but it only returns?
The article is very clear:
- the original CPC lower rom doesn't handle NMIs
- if you want to handle NMIs you have to disable the lower rom or replace it (otherwise some crap will happen, see McArtis code)
- no internal CPC hardware is generating NMIs
- there are hardware expansions, which can generate NMIs
Quote from: Prodatron on 11:22, 23 February 25Quote from: zhulien on 07:07, 23 February 25Here in thr cpc wiki
https://www.cpcwiki.eu/index.php/NMI#:~:text=The%20built%2Din%20components%20in,Multiface%20II%20(Romantic%20Robot)
It says nmi is not handled on cpc, does that mean no nmi is called (without external hardware) or in fact it is handled but it only returns?
The article is very clear:
- the original CPC lower rom doesn't handle NMIs
- if you want to handle NMIs you have to disable the lower rom or replace it (otherwise some crap will happen, see McArtis code)
- no internal CPC hardware is generating NMIs
- there are hardware expansions, which can generate NMIs
I don't think it's clear. What I had read was regardless of interrupt mode on a Z80, an NMI will trigger if hardware triggers it. Even a RET is a handler, otherwise an NMI would cause the CPC to crash. Or is that not the case? But how you summarised it to me that is clear.
For an NMI a RET is not a handler but a RETN is ;)
See here an example, where the NMI is used to detect a PlayCity:
https://www.cpcwiki.eu/index.php/PlayCity#PlayCity_detection
Still not sure, what is unclear for you.
Quote from: zhulien on 12:46, 23 February 25Quote from: Prodatron on 11:22, 23 February 25Quote from: zhulien on 07:07, 23 February 25Here in thr cpc wiki
https://www.cpcwiki.eu/index.php/NMI#:~:text=The%20built%2Din%20components%20in,Multiface%20II%20(Romantic%20Robot)
It says nmi is not handled on cpc, does that mean no nmi is called (without external hardware) or in fact it is handled but it only returns?
The article is very clear:
- the original CPC lower rom doesn't handle NMIs
- if you want to handle NMIs you have to disable the lower rom or replace it (otherwise some crap will happen, see McArtis code)
- no internal CPC hardware is generating NMIs
- there are hardware expansions, which can generate NMIs
I don't think it's clear. What I had read was regardless of interrupt mode on a Z80, an NMI will trigger if hardware triggers it. Even a RET is a handler, otherwise an NMI would cause the CPC to crash. Or is that not the case? But how you summarised it to me that is clear.
If external hardware raises an NMI, the Z80 will always call the NMI handler routine. But the CPC ROM does not have suitable code there, so the machine will crash if the Lower ROM happens to be active at the time.