News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Zilog peripheral chips

Started by litwr, 16:13, 26 May 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

litwr

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.

TotO

#1
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 expansion.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

GUNHED

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.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

litwr


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.

GUNHED

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. 
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

andycadley

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.

GUNHED

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.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

andycadley

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.

GUNHED

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.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

litwr

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.

GUNHED

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, ...).
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod