News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_zhulien

NMI on cpc

Started by zhulien, 07:07, 23 February 25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zhulien

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?

McArti0

#1
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
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
One chip driver for 512kB(to640) extRAM 6128
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Prodatron

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

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

zhulien

#3
Quote from: Prodatron on 11:22, 23 February 25
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
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.

Prodatron

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.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

andycadley

Quote from: zhulien on 12:46, 23 February 25
Quote from: Prodatron on 11:22, 23 February 25
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
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.

Powered by SMFPacks Menu Editor Mod