Page 1 of 23

ZX81+35 Clone

Posted: Sun Nov 22, 2015 11:51 pm
by GCHarder
https://revspace.nl/ZX81%2B34_ZX81_clone
Anyone know about this? Looks interesting.

Regards;

Greg

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 12:14 am
by Andy Rea
is there a way to contact the author

his hsync counter is resetting on the vsync, which of course is wrong :-)

it should only reset with an int-ack and then the hsync is generated 16 clock cycles later

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 12:36 am
by chernandezba
Andy Rea wrote:is there a way to contact the author

his hsync counter is resetting on the vsync, which of course is wrong :-)

it should only reset with an int-ack and then the hsync is generated 16 clock cycles later
Andy, do you mean the Maskable interrupt generated when bit 6 of R register changes from 1 to 0?

Thanks
Cesar

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 8:06 am
by RetroTechie
Andy is right. Horizontal syncs in a ZX81 are generated at a constant 207-cycle interval (63.7 usec / scanline), and this only gets reset by an interrupt acknowledge (Z80 /IORQ and /M1 both active). Unlike vertical syncs which are software-generated (the same way as in a ZX80, in fact) and don't affect hsync generator in any way.

Doing it any other way may work, but probably will result in timing differences (depending on software used). Read: may look okay at first glance, but not 100% ZX81 behaviour upon closer inspection.
chernandezba wrote:Andy, do you mean the Maskable interrupt generated when bit 6 of R register changes from 1 to 0?
That would be because Z80's /INT line is hard-wired to the A6 line in a ZX81. Other than how this affects software: unrelated to the above.

Spotted this project a while ago. Looks like it's getting along nicely... 8-)

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 8:59 am
by Paul
Andy Rea wrote:is there a way to contact the author
Hi Andy
I contacted them (tried my Dutch after all these years again).
Waiting for an answer now.
kind regards Paul

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 9:47 am
by chernandezba
Well I have a doubt related with this; this behavior is not well emulated in my ZEsarUX so the display is not 100% correct in some games... So:
-when bit 6 of r register changes from 1 to 0, a maskable interrupt is generated. Then, as Andy says, a hsync is generated after 16 cycles of the int ack. So, if we are in a loop changing r register to a constant value, for example 0, the interrupt will never be fired and never will be generated a hsync? So the hsync is not fired at a constant interval?

-the other question is related to nmi... When it is fired? At the end of every scanline, at fixed 207 cycle interval?
Or it depends on the hsync? In the last case, it will depend on when the maskable interrupt is fired and the two types of interrupt would be fired almost at the same time...

Thanks,
Cesar

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 5:18 pm
by PokeMon
The hsync counter is free running and reset all 207 cycles. It is additionally reset with a INT ACK. But if not INT ACK is present the hsync still appears every 207 clock cycles. This can not be turned off. This INT ACK reset is used for synchronization of display output only. The hsync pulse is delayed 16 clock cycles to the tv output and kept 16 clock cylces long as far as I know. It differs a bit to ZX80 logic.

The NMI is touched with every hsync pulse (synchronous). You can switch off the NMI but not the hsync.

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 6:06 pm
by 1024MAK
The hsync counter is a hardware divider/counter. It works completely independently of the CPU. It is always on and always counting. As Pokemon and others have said, when it overflows, it automatically resets and restarts. It is also possible to reset and restart it as described above.

Mark

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 10:42 pm
by Andy Rea
The CPU samples the interrupt
signal (INT) with the rising edge of the final clock at the end of any instruction. The
signal is not accepted if the internal CPU software controlled interrupt enable flip-flop is
not set or if the BUSREQ signal is active. When the signal is accepted, a special M1 cycle
is generated. During this special M1 cycle, the IORQ signal becomes active (instead of the
normal MREQ) to indicate that the interrupting device can place an 8-bit vector on the
data bus. Two wait states are automatically added to this cycle. These states are added so
that a ripple priority interrupt scheme can be easily implemented. The two wait states
allow sufficient time for the ripple signals to stabilize and identify which I/O device must
insert the response vector.

so the int-ack is the signal M1 = low and IORQ = low at the same time,

hope this helps

Re: ZX81 Clone

Posted: Mon Nov 23, 2015 11:05 pm
by chernandezba
Thanks to everyone.
I didn't know that an INT ack resets the hsync counter. I will modify my emulator to follow this behaviour so maybe display will be emulated better.

Cheers
Cesar