sz81 (gnu/linux) not supporting hires?

Emulator and emulator development specific topics
User avatar
RetroTechie
Posts: 379
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: sz81 (gnu/linux) not supporting hires?

Post by RetroTechie »

Tested a pile of timing-sensitive demo's / true hi-res games etc this evening. With some programs there's some garbage on right side of the screen, and on top there are sometimes a few (1-pixel high) lines that shouldn't be there. But overall I'd say "very impressive!", and summarize results as:

Emulator accuracy = 99.9% ;)

Probably the best thing to do is compare some of the more difficult / 'weird' corner cases with how they work on a real ZX81 (if possible, preferably on a CRT monitor). A few examples:
  • That little proggie where you have "ZX81" text + dotted border around it. On a real ZX81 it's a stable image, but bobbing up & down 1 pixel. Tbh I have NO IDEA what that proggie does exactly, and so far haven't seen a ZX81 emulator that shows it the exact same as on a real ZX81. So I wouldn't worry too much about it. :)
  • That clckfreq proggie is a good check whether screen lines & frames take the same # of clock cycles as on a real ZX81. If you've got your logic / emulation correct, you WILL get the exact # of frames taken, and 100% speed as output. If not, there is still something that's not quite right (however small / unimportant).
  • A fish+shark simulation named Wa-Tor has a hi-res title screen, with the bottom few character rows a bit 'pulled' to one side. Again, some emulators show this effect somehow, but perfection seems impossible...
Anyway: many thx for your efforts, and keep up the good work! :geek:
olofsen wrote:Even the number of tstates per scanline in the screen is variable; I think because the "207 counter" as discussed on this forum is always free running - it is not reset by the INT ACK, (..)
That's not correct! Yes you have a free-running counter that generates a horizontal sync pulse every 207 cycles. But a Z80 interrupt acknowledge (Z80 /IORQ and /M1 active at the same time, see Z80 databooks) resets this counter as well. From what I've read, Grant Searle (zx80nut on this forum) discovered that the hardware-generated hsync pulse starts ~16 clocks after an interrupt acknowledge resets this counter. I suspect that ~16 clocks number isn't too important, but that there's another reset condition besides reaching a max count, IS. This is exactly the kind of thing that allows software to fiddle with the sync signal in ways that produce interesting effects on monitors, but keep syncs juuust constant enough that a monitor doesn't lose sync.

For details on this issue, some good reading starts here.

Btw. is there some way to run alternative ZX81 ROMs and not have them 'patched' in any way by the emulator? (for intercepting tape loads, or similar purposes). In particular I'm thinking about some Forth ROMs that take the place of the original ZX81 ROM, and come with their own display + tape routines. On this emulator, such ROMs produce random results, read: don't work. Another emulator I have here (xz81) has some command line options that disable the tape load patching. Which does allow those ROMs to work.

System used for compile & tests:
Up-to-date Debian "testing"
GCC version 5.2.1
libsdl 1.2.15
Linux kernel 4.1.0-2-amd64
User avatar
RetroTechie
Posts: 379
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: sz81 (gnu/linux) not supporting hires?

Post by RetroTechie »

Of further note: in the Mostek MK3880 manual one can read that a regular (maskable) interrupt is followed by an INTerrupt ACKnowledge cycle. Probably because this signals external hardware to place a jump vector on the data bus.

For a Non Maskable Interrupt, not so (as I read it, anyway). Probably because the call address is always the same and no jump vector is read from the data bus here.

Exact # of clock cycles for these different types of interrupt responses is also different.
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: sz81 (gnu/linux) not supporting hires?

Post by olofsen »

Tested a pile of timing-sensitive demo's / true hi-res games etc this evening.
Thank you for that :)
There are sometimes a few (1-pixel high) lines that shouldn't be there.
Yes, my impression is that these are sync artefacts when indeed these differ too much from normal. With an option to reduce the screen to 320x240 these may be avoided. This is now the default (scaled to 640x480 - in version 2.3.1).
That little proggie where you have "ZX81" text ... bobbing up & down 1 pixel.
This seems to depend on if a "WAIT mod" is present, INT ACK or VSYNC reset (see below) and HSYNC tuning of the TV emulation (with present settings it is bobbing!).
there is still something that's not quite right
Yes, to get it exactly right it might be necessary to track when the emulated Z80 samples the /WAIT signal (because the machine cycles may have different lengths).
Yes you have a free-running counter...
What I meant was that in EightyOne, the counter is not reset by INT ACK, but by VSYNC. So now zx80nut's counter/sync logic is implemented. This causes slight differences in when a new line is started and so when the character row counter is incremented.
Is there some way to run alternative ZX81 ROMs?
Does perhaps LOAD "name.rom;0" with the latest version work for your ROMs?
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: sz81 (gnu/linux) not supporting hires?

Post by stefano »

After having ported z81 to Allegro i took benefit of the already set development environment and experimented a bit with sz81 on Windows.
v2.1.8 is a little outdated but gave nice results, so I'm attaching it.

EDIT: Olofsen asked me what is the point of an old version when the official site provides a Windows port (http://rullf2.xs4all.nl/sz81/index.html) .. I just liked the pre-HRG way to scale the display and I missed the initial "help" message, which here is shown as a popup window.

(EDIT: attachment removed to avoid nasty version overlappings)
sboisvert
Posts: 40
Joined: Mon Nov 02, 2009 3:43 pm

Re: sz81 (gnu/linux) not supporting hires?

Post by sboisvert »

I've taken a stab at getting this to compile for OS X - I've mostly gotten it working (all the files compile), but running into issues at the linking stage (over 200 'duplicate symbols' are reported). Seems the way the headers are structured and included might be at fault :|
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: sz81 (gnu/linux) not supporting hires?

Post by stefano »

Uh.. there's a couple of ways to declare the Allegro headers inclusion; you shouldnt have hard times to port it, though.
sboisvert
Posts: 40
Joined: Mon Nov 02, 2009 3:43 pm

Re: sz81 (gnu/linux) not supporting hires?

Post by sboisvert »

After some more futzing around, I'm happy to report I've managed to get it working on OS X!
SZ81 OS X.png
(148.79 KiB) Downloaded 714 times
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: sz81 (gnu/linux) not supporting hires?

Post by PokeMon »

Hi I am interested in OS X version - where to get ?
Thanks, Karl
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: sz81 (gnu/linux) not supporting hires?

Post by stefano »

Well done ! Did you port the SDL or the Allegro version ?
PeekPoke
Posts: 5
Joined: Sat Jun 11, 2016 12:16 pm

Re: sz81 (gnu/linux) not supporting hires?

Post by PeekPoke »

Hi to all members of this forum,

The ZX81 was my first computer, I bought it back in 1984.
I learned to code in Basic. And I still have it and love it ! :D
I want to buy the Chroma interface so I can plug it to a new TV.

Now, I'm learning machine code with Toni' s Baker " Mastering Machine Code On Your ZX81".

I have a request :
Could someone please please please compile the latest version sz81-2.3.6.tar (with the High Resolution feature) to the Open Pandora console ?
Every day I spend one hour on the train (Half an hour to go to work and Half an hour back home).
I could spend this time to code with the Bug Byte Assembler, play some high res games on the handheld etc ...

Thank you very much.
Post Reply