Metropolis, a proper ZX80/81 demo

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

Re: Metropolis, a proper ZX80/81 demo

Post by nollkolltroll » Tue Dec 19, 2017 5:32 pm

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: 47
Joined: Sun Jun 03, 2012 1:18 pm
Location: Dundee, Scotland

Re: Metropolis, a proper ZX80/81 demo

Post by kpalser » Tue Dec 19, 2017 11:53 pm

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
IMG_7393.PNG (1.36 MiB) Viewed 180 times
Kevin

nollkolltroll
Posts: 206
Joined: Sat Sep 27, 2014 7:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post by nollkolltroll » Wed Dec 20, 2017 7:15 am

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: 132
Joined: Wed Jan 08, 2014 11:29 am

Re: Metropolis, a proper ZX80/81 demo

Post by olofsen » Wed Dec 20, 2017 7:18 am

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 8:00 am, edited 1 time in total.

nollkolltroll
Posts: 206
Joined: Sat Sep 27, 2014 7:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post by nollkolltroll » Wed Dec 20, 2017 7:52 am

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: 47
Joined: Sun Jun 03, 2012 1:18 pm
Location: Dundee, Scotland

Re: Metropolis, a proper ZX80/81 demo

Post by kpalser » Wed Dec 20, 2017 8:06 am

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: 1283
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Metropolis, a proper ZX80/81 demo

Post by Andy Rea » Wed Dec 20, 2017 11:29 am

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.
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

nollkolltroll
Posts: 206
Joined: Sat Sep 27, 2014 7:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post by nollkolltroll » Wed Dec 20, 2017 3:47 pm

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 12 times
/Adam

nollkolltroll
Posts: 206
Joined: Sat Sep 27, 2014 7:02 pm
Location: Stockholm, Sweden

Re: Metropolis, a proper ZX80/81 demo

Post by nollkolltroll » Wed Dec 20, 2017 6:58 pm

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 12 times
/Adam

olofsen
Posts: 132
Joined: Wed Jan 08, 2014 11:29 am

Re: Metropolis, a proper ZX80/81 demo

Post by olofsen » Wed Dec 20, 2017 7:52 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest