I know that Amstrad CPC/PCW, MSX, and ZX Spectrum never use RETI instruction. I am curious is there any system in the world which can use this instruction? As I know Zilog didn't produce their interrupt controller chip. So it seems that RETI has been completely useless. Maybe somebody knows more about it. Thank you.
RETI / RETN must be used with the Z80 CTC chip. In other case, the Z80 CPU will not aknowledge the next interrupt properly.
In example, on CPC with the PlayCity (https://www.cpcwiki.eu/index.php/PlayCity) expansion.
Quote from: litwr on 16:13, 26 May 20
I know that Amstrad CPC/PCW, MSX, and ZX Spectrum never use RETI instruction. I am curious is there any system in the world which can use this instruction? As I know Zilog didn't produce their interrupt controller chip. So it seems that RETI has been completely useless. Maybe somebody knows more about it. Thank you.
Well some of my games and FutureOS run in Interrupt Mode 2, therefore RETI is used. Especially on the 6128 Plus RETI is in such a case important.
Thank you very much.
Quote from: GUNHED on 16:59, 26 May 20
Well some of my games and FutureOS run in Interrupt Mode 2, therefore RETI is used. Especially on the 6128 Plus RETI is in such a case important.
As I know interrupt mode 2 and RETI are rather independent features, aren't they? Or both of them can work only with the CTC? IMHO RETN doesn't depend on any external chip, it is used in the ZX Spectrum ROM.
Quote from: litwr on 07:28, 27 May 20
Thank you very much.As I know interrupt mode 2 and RETI are rather independent features, aren't they? Or both of them can work only with the CTC? IMHO RETN doesn't depend on any external chip, it is used in the ZX Spectrum ROM.
Well, I don't know about Spectrum world. I only know some other Z80 systems. Like Tot0 told, as soon as there are chips which provide an interrupt_end signal its needed. You can google for Z80 and daisy chain IIRC. The reason is to chain different interrupt sources. The spectrum has only one, but the 6128 Plus and expanded CPCs can have multiple. Therefore RETI is mandatory.
The CPC Plus doesn't pay any attention to RETI. It clears the PPI interrupt on interrupt acknowledge to retain compatibility with the old Gate Array method. If you turn on the very buggy interrupt redirection it could theoretically turn off the right DMA interrupt too, but since it gets this wrong there isn't any point. You have to manually clear the DMA interrupt states and after that just doing a RET is perfectly fine.
Maybe, if no external hardware is connected. But I love the PlayCity. And using RETI is good practice. No need to use 'dirty' code. 'dirty' may be the wrong word, but you know what I mean.
Sure, but it's another NOP lost every time. Which can be quite an overhead if you're doing right raster effects on a Plus etc.
YMMV.
Quote from: andycadley on 15:36, 28 May 20
Sure, but it's another NOP lost every time. Which can be quite an overhead if you're doing right raster effects on a Plus etc.
YMMV.
Oh, well there may be that case that this us is needed. Ok, then use RET if you like - of course. However, usually we have 6 interrupts per second (without anything additional), so we loose 6 / 1.000.000 us. That's not that painful. Guess to unroll loops will help more. :)
Quote from: GUNHED on 16:59, 26 May 20
Well some of my games and FutureOS run in Interrupt Mode 2, therefore RETI is used. Especially on the 6128 Plus RETI is in such a case important.
I am curious why to use Interrupt Mode 2 with the Amstrad CPC or PCW? I know that the ZX Spectrum people have to use it because the interrupt vector for mode 1 is in ROM. The CPC has it in RAM... Interrupt mode 2 without Zilog's dedicated chips requires a 257 byte table - it is not little for 8-bit system. Thank you.
Yes, there is a 257 byte table needed for the CPC - or less in some cases. But using IM 2 does not only enable to use expansions, it also has a great advantage: The lower RAM block can be used completely (for example a 2nd screen, or when using 32 KB V-RAM Overscan, ...).