ZX81+35 Clone

Discussions about Sinclair ZX80 and ZX81 Hardware
Post Reply
User avatar
GCHarder
Posts: 427
Joined: Sat Dec 14, 2013 7:46 pm

ZX81+35 Clone

Post by GCHarder »

https://revspace.nl/ZX81%2B34_ZX81_clone
Anyone know about this? Looks interesting.

Regards;

Greg
Last edited by GCHarder on Fri Jul 29, 2016 11:49 pm, edited 1 time in total.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ZX81 Clone

Post 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
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZX81 Clone

Post 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
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
User avatar
RetroTechie
Posts: 379
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: ZX81 Clone

Post 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-)
User avatar
Paul
Posts: 1511
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: ZX81 Clone

Post 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
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZX81 Clone

Post 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
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: ZX81 Clone

Post 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.
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 Clone

Post 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
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: ZX81 Clone

Post 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
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZX81 Clone

Post 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
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
Post Reply