News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

cursor as nmi

Started by arnoldemu, 09:51, 08 April 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

I don't know if I mentioned it before.

I was wondering what would happen if I connected the crtc's cursor output to the z80's nmi.

I know the nmi is edge triggered - not sure which edge. (low-high, or high-low?)

I also know the nmi should be asserted for a certain amount of time so that it is recognised in the last cycle of any z80 instruction.

I am thinking that perhaps the crtc's cursor strobe will not be active for long enough, so in fact the nmi will never be triggered?

The idea would be an experiment into raster based line interrupts on cpc, AND to see how the cursor would work on CPC AND to see if it's worth emulating, or in fact is generated by the crtc type 3 or type 4.

Another idea is to somehow mix the cursor into the video signal to see it, but I think it's 5v out, and probably needs some resistor adding or it'll overload the colours??

The final idea was to set it up as some kind of external interrupt, but that would involve lots of extra logic such as a flip-flop or similar to remember it, decoding for i/o port to clear it etc etc

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bryce

The Z80s NMI is triggered on the negative edge. As far as I can remember though, it only needs to be triggered for about half a cycle, the CPU latches it until the end of the current command execution. So your idea might work.

Bryce.

TFM

Maybe it would be better to have an external device to generate NMIs, because the Firmware doesn't catch it, so a NMI on a normal CPC would probably crash the system (not under FutureOS). But if you have a device that can be switched on by software, then if would be possible to install NMI drivers for BASIC/AMSDOS first and then start NMI generation.

Also a kind of synchronisation with the scanlines of the CRT would be desirable.

This NMI ideas is one I really like  ;D

And btw. it would add new worlds to floppy disc operations  ;)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

arnoldemu

Quote from: TFM/FS on 17:46, 08 April 11
Maybe it would be better to have an external device to generate NMIs, because the Firmware doesn't catch it, so a NMI on a normal CPC would probably crash the system (not under FutureOS). But if you have a device that can be switched on by software, then if would be possible to install NMI drivers for BASIC/AMSDOS first and then start NMI generation.

Also a kind of synchronisation with the scanlines of the CRT would be desirable.

This NMI ideas is one I really like  ;D

And btw. it would add new worlds to floppy disc operations  ;)
I agree with what you are saying... I would need to check but the cursor may not be initialised for display by the firmware.

The other thing was to connect the IRQ output of the fdc to nmi, so we can have nmi loading (with special software of course).

The reason NMI is better, is because it requires less logic to set/clear etc.

I haven't tried these ideas yet ...

EDIT: The firmware wouldn't catch a normal external interrupt (a normal maskable interrupt generated by an external device) as you know, and a driver would be needed to implement this too. I still wonder if there was any hardware that actually generated a external maskable interrupt for cpc.. I would be interested to see the driver code and how they hooked it into the firmware.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TFM

Doesn't the Amstrad SIO (not PACE) RS 232 use the INT ??? Like I know it does.

The firmware does check indeed if the INT comes from the outside, therefore it checks (using EI and DI) how long the INT is active. The internal INT is only shortly active, but an external is longer active.

But I wanted to say that the NMI would jump into the nirvana...

I got honestly no idea if the not initialized hardware cursor of the CRTC will generate signals of not ???   Somebody with an oscilloscope could help.

However I still think this whole complex is very worth thinking about.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

arnoldemu

Quote from: TFM/FS on 05:27, 13 April 11
Doesn't the Amstrad SIO (not PACE) RS 232 use the INT ??? Like I know it does.

The firmware does check indeed if the INT comes from the outside, therefore it checks (using EI and DI) how long the INT is active. The internal INT is only shortly active, but an external is longer active.

But I wanted to say that the NMI would jump into the nirvana...

I got honestly no idea if the not initialized hardware cursor of the CRTC will generate signals of not ???   Somebody with an oscilloscope could help.

However I still think this whole complex is very worth thinking about.
SIO: I've not seen anything to confirm it yet, but I hope it does.

NMI: Well I emulated it in Arnold, and assuming the emulation is accurate it should work. However, the firmware is not setup for NMI. No default NMI handler, and free mem starts at &40 (NMI vector is at &66). So to make it work you need to turn off the firmware, OR as the multiface does, page in your own rom when you generate one, so it can't be used without patching the OS ROM it seems.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TFM

Well, if the NMI is present constantly... then it's probably really needed to patch the lower ROM and parts of the OS.

If it would be the case that the NMI ist 'OFF' when switching on the CPC, then it would be enough to load an RSX = driver or so.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

arnoldemu

Quote from: TFM/FS on 23:55, 30 April 11
Well, if the NMI is present constantly... then it's probably really needed to patch the lower ROM and parts of the OS.

If it would be the case that the NMI ist 'OFF' when switching on the CPC, then it would be enough to load an RSX = driver or so.
I agree with you, the lower ROM needs patching if the NMI should work cleanly with the firmware.
The problem is that when the NMI comes, as you know the rom could be enabled or not.
The lower rom has code here, so it's not going to work. So the firmware needs some kind of KL ADD NMI and KL DEL NMI handlers ;)

Initially the cursor is set to 0000. The CRTC initialises MA to 0 when it has reset, so the cursor address could hit. start/end cursor lines are set to 0, I'm not sure if that means a single line cursor or not. So the NMI *can* hit. I now need to test on real hardware to know for sure.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TFM

Good luck! And keep us informed :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

andycadley

Does it need to be an nmi? The firmware can support ordinary interrupts from an external source, can't it?

TFM

Yes, the firmware does support external interrupts. Therefore it checks how long the INT lasts. But here it's more about the NMI advantages. Think about floppy disc drivers for example, or a kind of scan line interrupt. The NMI would open new worlds  ;)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod