Page 2 of 3

Re: Metropolis, a proper ZX80/81 demo

Posted: Tue Dec 19, 2017 6:32 pm
by nollkolltroll
Found a bug in the ZX81 version, so I've removed autostart in mtrpls81.p and updated the zip-file. Now it should behave properly even on the ZX81 :D
Please reload your code!

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 12:53 am
by kpalser
Hi Adam,

Bearing in mind that I haven't fired it up on a real ZX81 yet - attached is what the latest version looks like on my emulator. The horizontal position is now always consistent but a black bar is now present with a scrambled image to the right of it. Hopefully this is just limited to a just a quirky flaw in my emulation code.
IMG_7393.PNG
(1.36 MiB) Downloaded 268 times
Kevin

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 8:15 am
by nollkolltroll
Kevin: a consistent bar is good, that means the timing is off by a fixed amount in either the emu or my code. If the bar changes place depending on when the program is started, I have a much bigger problem.
I'll see if I can replicate the problem here at my end, take it from there.

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 8:18 am
by olofsen
It really is a proper demo, because it doesn't work properly on the latest sz81 emulator either (in zx81 mode, it does in zx80 mode)...! As far as I understand it, the in/out combination, which is normally used to produce Vsyncs, is used here to produce Hsyncs. A Vsync resets the "rowcounter", which selects which of the 8 sets of 8 pixels is used for the graphics. On the other hand, a Hsync (or actually the INT which occurs at the end of the line) increments the rowcounter. So the scrambled image probably occurs because the rowcounter is not zero... Timing is critical if the rowcounter is almost simultaneously incremented and reset...

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 8:52 am
by nollkolltroll
Olofsen: you are indeed correct. I produce in/out HSyncs at the same time as the HSync generator to be able to reset the line counter without disturbing the picture. Unfortunately there seems to be a bad case of incompatibility between my HW ZX81 and the rest of you. This leads to a software generated HSync and a hardware generated HSync at another time, so 2 HSyncs per line. Very bad.
The ZX80, 8k or 4k ROM version does not have any of these problems.

Unfortunately my ZX81 gives me the correct timing every one of the 20 times I've tried it with the new non-autostarting version. Running with a ZXpand+ 1.12 connected to a real Sony CRT monitor. The Sony also has the ability to delay the picture so I can see the syncs in order to trim them properly without an oscilloscope.

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 9:06 am
by kpalser
I need to digest the comments above properly - the working day is about to start..

Initial thoughts after sleeping on this I think that the black bar is the hsync pulse outside the hsync acceptance window. And that following the recent change in my CRT emulation code for the vertical sync trigger duration constant that I need to work on enforcing a vertical retrace blanking period. Perhaps when this is place the results will be nearer the expected outcome. I'll look into this again at the weekend. This is a good opportunity to improve my emulator.

Kevin

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 12:29 pm
by Andy Rea
Wow :ugeek: what an amazing piece of coding, fabulous use of hi-res and some extra special timing trickery going on. Only watched the video but can't wait to try on real hardware.

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 4:47 pm
by nollkolltroll
Kevin: I think your emu is good, since doing HSyncs twice per raster SHOULD show one of them in some way. I've had a real CRT show the same effect before I got the SW HSync on HW HSync timed properly. Unfortunately, it seems my machine is too kind to me, and other machines do not line up nice and easy...

I have a solution that hopefully works for all, but splits the code into 3 different versions: 4k ZX80, 8k ZX80 and proper ZX81. Please try at will.

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 7:58 pm
by nollkolltroll
And here is an even fresher version with 4 lines VSync to make the Chroma interface happy.

Re: Metropolis, a proper ZX80/81 demo

Posted: Wed Dec 20, 2017 8:52 pm
by olofsen
Thank you for the newer versions, these work on sz81 as well! However, the version that works well on the real thing but not on an emulator also helps in understanding how things really work. It would be even more interesting if that one works on one ZX81 but not on another... ;)