Side margin with Z-Xtricator

Emulator and emulator development specific topics
Post Reply
User avatar
kpalser
Posts: 57
Joined: Sun Jun 03, 2012 2:18 pm
Location: Dundee, Scotland

Side margin with Z-Xtricator

Post by kpalser » Mon Nov 25, 2013 9:44 pm

Folks,

To further my challenge of perfecting my zx81 emulator I shifted testing to focus on Z-Xtricator and its pseudo hires INT mode 2 routine. It has been an excellent exercise for identifying and correcting some flaws.

Some questions:
1) Have any of you fired up Z-Xtricator on a real ZX81 recently? See the attached screen shots on my emulator and Eighty One (via WINE on Mac OS X). Both seem to have a too short lefthand side margin (but only in the main scrolling game section using the hires routine). My effort seems to be off by 16 pixels and Eighty One by just 8 pixels. Before I start analysing the cycles used in this routine, on a real machine is the margin centred correctly with the 4 characters in both side margins?
my emulator.png
My emulator
my emulator.png (11.2 KiB) Viewed 2018 times
Eighty One.png
Eighty One
Eighty One.png (46.53 KiB) Viewed 2018 times
2) Why did Software Farm decide to split it into two tape files? Any technical reason? The only advantage I can fathom is perhaps cheaper production costs with a shorter tape by using both sides of the cassette.

3) http://www.pictureviewerpro.com/hosting ... refarm.htm - So any update on Julian Chappell's whereabouts post Software Farm?

Thanks

karingal
Posts: 30
Joined: Mon Feb 04, 2013 2:30 pm

Re: Side margin with Z-Xtricator

Post by karingal » Tue Nov 26, 2013 1:29 am

How the hell do you load ZX-Xtricator?

I'd like to test it on Spud81 but can't even work out how to load it on EightyOne...

karingal
Posts: 30
Joined: Mon Feb 04, 2013 2:30 pm

Re: Side margin with Z-Xtricator

Post by karingal » Tue Nov 26, 2013 2:09 am

OK, I was being a bit of a div.

Got it working...
Spud81.jpg
Spud81.jpg (34.59 KiB) Viewed 2003 times
How does the border look?

sirmorris
Posts: 2813
Joined: Thu May 08, 2008 5:45 pm

Re: Side margin with Z-Xtricator

Post by sirmorris » Tue Nov 26, 2013 10:09 pm

Sweet :)

I hear confession is good for the soul - care to tell what the problem was??

User avatar
kpalser
Posts: 57
Joined: Sun Jun 03, 2012 2:18 pm
Location: Dundee, Scotland

Re: Side margin with Z-Xtricator

Post by kpalser » Tue Nov 26, 2013 11:17 pm

Checked out Spud81 and it is the best screen centred emulator for Z-Xtricator. If you see the attached screenshot on another Software Farm hires game, in these cases Spud81 demonstrates a larger left margin and so with Z-Xtricator it looks squarely centred. (Not criticisng Spud81 - I think it is a stirling effort!)
Spud81 WINE.png
Forty Niner using Spud81 via WINE
Spud81 WINE.png (24 KiB) Viewed 1958 times
This screenshot also shows the first video line is offset after the top margin, which had me stumped for months with my own emulator until I read Wilf’s article: http://www.user.dccnet.com/wrigter/inde ... 81WAIT.htm (in addition to all the other points in his excellent Video Tutorial http://www.user.dccnet.com/wrigter/inde ... torial.htm) Paraphrased in my own source code comments: “The TR1 in the ZX81 schematic is used for syncing the NMI response at L0066. This is done by inserting the WAIT state betweens T2 and T3 of the M1 cycle of the RST to L0066. In other words, after the first 2 clock cycles (T1 & T2), for the remaining duration of the NMI pulse the normal 11 cycles to get to L0066 is extended by waits so that the NMI routine always starts at exactly the same point within the 206 repeated cycles.”. Eventually after careful experimenting I had something that worked with technically justifiable values from the explanations found in various web sources documenting the Z80 and ZX81. Seemed to work well in all cases until I came across this margin problem in Z-Xtricator… So back to reviewing large instruction traces and their cycles against the interrupts..

sirmorris - Took me couple of attempts to load the p files on Spud81 for the Z-Xtricator until I found a different set of files on the web that loaded perfectly. I suspect some .p sources for some reason have a strange E-LINE value, which often isn’t a problem if it is just being plonked into the memory instead of being tape loaded.

User avatar
PokeMon
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: Side margin with Z-Xtricator

Post by PokeMon » Wed Nov 27, 2013 12:13 am

kpalser wrote:sirmorris - Took me couple of attempts to load the p files on Spud81 for the Z-Xtricator until I found a different set of files on the web that loaded perfectly. I suspect some .p sources for some reason have a strange E-LINE value, which often isn’t a problem if it is just being plonked into the memory instead of being tape loaded.
In my experience some programs omit the $80 value as last byte as marker for VARS_ADDR / begin of WORKSPACE.
The emulator Eightyone takes the program anyway but real hardware won't when this byte is missing.

karingal
Posts: 30
Joined: Mon Feb 04, 2013 2:30 pm

Re: Side margin with Z-Xtricator

Post by karingal » Wed Nov 27, 2013 2:22 am

IIRC (and it's been quite a while since I looked at the Spud81 source), Spud81 emulates the correct border height and width.
For some reason EightyOne make the border a little too wide and has a nasty hangover on the right edge when running FortyNiner.

The positive thing from all this is I've decide to update Spud81 and add a few more features, ideas welcome!!

Moggy
Posts: 1761
Joined: Wed Jun 18, 2008 2:00 pm

Re: Side margin with Z-Xtricator

Post by Moggy » Thu Nov 28, 2013 3:21 pm

I quite like the old spudster, how about different roms forth asmic etc :?:
Just a thought.

You're right about eighty one there does seem some jiggery pokery going on with the screen display at certain times.
The H4th ROM runs ok display wise on eighty one but burn the ROM file to an EPROM and use on real kit, the screen is definitely too far up and to the right.
Also if you print a full screen of chr$ then invert the screen the mask is printed one chr$ to the left leaving a one chr$ wide non-inverted right hand margin.
But on eighty one runs ok so suggesting a bit of kerfluging somewhere.

User avatar
kpalser
Posts: 57
Joined: Sun Jun 03, 2012 2:18 pm
Location: Dundee, Scotland

Re: Side margin with Z-Xtricator

Post by kpalser » Sun Dec 08, 2013 12:03 am

So after a week of evenings reviewing all timing and cycle calculations to try and account for my emulator having the equivalent of two character spaces in the left hand side (LHS) margin and six in the right (RHS), I decided to load Z-Xtricator up on a real ZX81…

So obviously in the photos below I’m using a modern TV 16:9 flatscreen. This is with the original TV lead (no composite video mod) and the result is some shocking ghosting.

Important detail: Even before I load Z-Xtricator into the real ZX81, when I filled the screen with characters I could see that the left hand side margin is about 12% larger than the right margin. I take this to be just negligible given that the TV is processing an old analogue signal. Certainly it is no where near the in 1:3 margin difference in favour of the RHS during the hires routine. This detail aside, the image is stretched proportionally along the width of the screen.
full.png
Full in game screen displayed
full.png (648.67 KiB) Viewed 1831 times
LHS vs RHS.png
Margin comparison
LHS vs RHS.png (223.16 KiB) Viewed 1831 times
Conclusion from the photos:
The Z-Xtrictor has a clearly smaller LHS margin. The RHS margin is approximately double the width.

Since there is already a 12% error noted above in the TV margin before running the game, it would be fair to assume that under perfect conditions the LHS margin would be even smaller and even closer to my emulators results.

So I am satisfied that my emulator is reproducing accurately the correct margins for this game. If someone can prove me wrong I’d genuinely welcome your input (for example pics on a good CRT display).

—-

Another strange point about the game. Depending on the p file sources that I load into my real ZX81 there are versions with a start screen and versions without. The following is from the .P Package from http://www.zx81stuff.org.uk/zx81/genera ... cator.html.
start.JPG
Start screen
start.JPG (110.4 KiB) Viewed 1831 times
Note that it is perfectly centred. I can’t tell you whether the same is true of the in game graphics because it soft reseted as soon as I passed the screen that explains the keys to use to control the ship. If you do add more images or test data to this thread please include the URL to the game source files used.

Post Reply