Metropolis, a proper ZX80/81 demo

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post 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!
/Adam
User avatar
kpalser
Posts: 80
Joined: Sun Jun 03, 2012 2:18 pm
Location: Dundee, Scotland

Re: Metropolis, a proper ZX80/81 demo

Post 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
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post 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.
/Adam
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: Metropolis, a proper ZX80/81 demo

Post 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...
Last edited by olofsen on Wed Dec 20, 2017 9:00 am, edited 1 time in total.
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post 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.
/Adam
User avatar
kpalser
Posts: 80
Joined: Sun Jun 03, 2012 2:18 pm
Location: Dundee, Scotland

Re: Metropolis, a proper ZX80/81 demo

Post 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
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Metropolis, a proper ZX80/81 demo

Post 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.
what's that Smell.... smells like fresh flux and solder fumes...
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post 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.
Attachments
Metropolis_1.1.zip
(133.5 KiB) Downloaded 195 times
/Adam
nollkolltroll
Posts: 325
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post by nollkolltroll »

And here is an even fresher version with 4 lines VSync to make the Chroma interface happy.
Attachments
Metropolis_1.2.zip
(133.52 KiB) Downloaded 249 times
/Adam
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: Metropolis, a proper ZX80/81 demo

Post 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... ;)
Post Reply