Robotron Z1013: KRT Highres Graphics

Requests for features
Post Reply
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Robotron Z1013: KRT Highres Graphics

Post by RobertK »

There have been three different approaches to add highres graphics to the Z1013:

https://hc-ddr.hucki.net/wiki/doku.php/ ... vollgrafik

KRT graphics is implemented in the JKCEMU emulator ("Extras" -> "Einstellungen" -> Z1013 -> "Erweiterungen" -> "Vollgrafikkarte nach KRT 11 und FA 7/91").

Documentation can be found here (in German, I can help with translation if required):

https://github.com/anchorz/sdcc-z1013-k ... master/doc

Z1013_KRT_11_Grafik.png
Z1013_FA791_1.png
Z1013_FA791_2.png
Z1013_FA791_3.png

It would be nice to have KRT graphics support for the Z1013 target.

Could maybe some parts of the code from here be reused?

https://github.com/anchorz/sdcc-z1013-kc85
stefano
Well known member
Posts: 2165
Joined: Mon Jul 16, 2007 7:39 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by stefano »

I think I put it in z88dk already!

https://www.z88dk.org/forum/viewtopic.php?p=14471
stefano
Well known member
Posts: 2165
Joined: Mon Jul 16, 2007 7:39 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by stefano »

https://github.com/z88dk/z88dk/blob/649 ... efile#L137

..does a "-lgfx9001gfx" option do the trick?
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

When using -lgfx9001gfx for the Z1013, it compiles without error, but instead of graphics primitives some characters appear.

Z1013_lgfx9001krt.jpg

Getmaxx() and Getmaxy() report the Z9001 highres resoulution 320x192 instead of 256x256.

Attached is my simplified plot test from 2018 (ignore the bugs mentioned in the comments, I think most of that has been fixed).
RobertK wrote: Wed Feb 02, 2022 1:43 pm KRT graphics is implemented in the JKCEMU emulator ("Extras" -> "Einstellungen" -> Z1013 -> "Erweiterungen" -> "Vollgrafikkarte nach KRT 11 und FA 7/91").
I have just upgraded to the current JKCEMU version, the settings screen has slightly changed (and "Spectrum graphics" is now emulated as well):

JKCEMU_Z1013_KRT.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

I'll try to take a look at this over the coming days. And thanks for the screenshot it's answered a question I had about whether KRT and the regular display could coexist.

I'm definitely not kicking the can down the road on the CPC work....
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

I've just merged a KRT driver that works on both the z1013 and z9001.

This provides a unified driver for both graphics and generic console that switches between the normal text mode and KRT hires graphics. A nice feature on the z9001 is that colour (on an 8x8px basis) is supported. The respective wiki pages have had some minor updates to detail the screenmdoes.

The way the screen is addressed is quite interesting - the 1k window is banked over the regular text display memory and to go down a pixel row (within an 8x8 character) you just change the paged in graphics bank. Although the principle is similar, the port driving is different and because of the different stride there wasn't a huge amount of portability.

I noticed an issue with the latest jkcemu: I couldn't get .tap program to autostart on the z9001, reverting to 0.9.7 restored the behaviour.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

Fantastic, thanks Dom!

Z1013_KRT_grest.jpg
Two questions/issues:

1. Z1013: can the screen colours be inverted to white on black?

I've tried...

Code: Select all

textcolor(WHITE);
textbackground(BLACK);
...but this has no effect.

2. Z9001: plottest.c works, but sprites are not functional yet, compiling grtest.c gives these errors:

Code: Select all

target/z9001/graphics/putsprite.asm:60: error: undefined symbol: pixeladdress
  ^---- pixeladdress
target/z9001/graphics/putsprite.asm:112: error: undefined symbol: zx_saddrpdown
  ^---- zx_saddrpdown
Attached is the updated grtest.c package.
grtest_Z1013_Z9001.zip
dom wrote: Thu Feb 10, 2022 11:39 pm
I noticed an issue with the latest jkcemu: I couldn't get .tap program to autostart on the z9001, reverting to 0.9.7 restored the behaviour.
Indeed, I will report that to the author.
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

I had a feeling you might ask that about the z1013 graphics. Consider it done - it's a total flip (since it's a B&W machine), so nothing to tune.

The z9001 was confusing me for a while: I'm certain it was working the other night, but today it just ended up crashing. It turns out the keyboard scanning routines were calling directly into ROM rather than using the CP/M style vector. I've now fixed that up (I hope) and sorted out the putsprite issue.

Hopefully that's enough to be considered working now.

Is it worth supporting any of the other graphics cards? How common were they?
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

Hmm, did you commit your changes? The Z1013 screen colours are still unchanged, and the Z9001 compiler error is still there. Last night's build was however successful.
dom wrote: Sat Feb 12, 2022 1:34 pmIs it worth supporting any of the other graphics cards? How common were they?
I have never seen a Robotron computer in real life, but I will ask on the forum. =D

All I know is that the Spectrum graphics was very complicated to build, and KRT was very simple (only four ICs), so I believe that KRT was far more common.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

I'm an idiot, I ended up doing the changes in a branch. I've now merged it across. So hopefully next time....
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

No problem about the delay. Z1013 is perfect now, thanks!

Z9001 KRT graphics is perfect as well, but every fgetc_cons() call makes the program crash, sometimes the screen gets filled with dots on each character position. You can reproduce it with grtest.c, the crash happens after the text "Press any key to clear screen" appears.

P.S. The JKCEMU emulator issue with the non-autostarting Z9001 TAP files is a bug, the author will fix it for the next release.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

The z9001 one is weird, I was testing on 0.9.7 and I had to change the keyboard routines since they were just hanging when KRT graphics was turned on - I thought that maybe the ROM was different and we were using non-public entry points.

The filling with dots is the effect of filling the text memory with " " which you normally get after the program exits and the monitor program takes over again.

Are you using 0.9.7 or the latest?
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

dom wrote: Tue Feb 15, 2022 10:45 am The filling with dots is the effect of filling the text memory with " " which you normally get after the program exits and the monitor program takes over again.
Ok, then that's the result of the program crashing without switching back to text mode.
dom wrote: Tue Feb 15, 2022 10:45 am Are you using 0.9.7 or the latest?
0.9.7, since I don't know how to start the program if it does not auto-start.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

This one was fun...

It looks like the z9001 monitor uses 64 bytes at the end of the text screen to store state and vectors used by the monitor firmware. When graphics is enabled that memory isn't available (since it's replaced with the graphics memory) so any firmware calls end up effectively in space.

I've added some copying code to duplicate those variables into the KRT graphics memory and things now appear to be working
stefano
Well known member
Posts: 2165
Joined: Mon Jul 16, 2007 7:39 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by stefano »

I thought it worked in the past ? Sorry for leaving you alone in this kind of mess.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

No worries, I think it had the appearance of working - it caught me out as well since I thought it was good for the tests I was running.

It's all good fun, now I'm moving onto restoring the accelerated code you wrote.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

putsprite() and stencil_rende()r now have fast path versions for the hires modes.

Z9001 shows some fantastic colour clash as an added bonus.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

Can't wait to try it, but the binaries in the current nightly are from yesterday 4:07...
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

Sorry I broke the build with some code which didn't compile for Windows. Fingers crossed for tonights build.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

The Z9001 look almost perfect now. But I can't get Deepspace to work, it crashes when the game starts. On one occasion it crashed when I picked up fuel for the first time. Attached is a WIP version.

I have tested joystick input separately (both in text and graphics mode), this works without any problem. And also 1-Bit Sound (sound needs to be activated in JKCEMU like this: Extras -> Audio/Kassette -> third Tab "Ausgang Sound-Generator/Lautsprecher" -> Aktivieren).

The Z9001 target only supports Joystick 1 and 2 for virtual joystick input, you will need a USB joystick/gamepad for testing with JKCEMU (Extras -> Joysticks -> "Verbinden" when a USB-Joystick is connected) . BTW, QAOP-NM would be nice to have and would make testing easier.
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2140
Joined: Sun Jul 15, 2007 10:01 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by dom »

Your wish etc....

I've added qaop-mn as a keyboard joystick and fixed up the crash behaviour - an unbalanced stack when printing the fuel sprite it seems.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

Now everything is fine, mission accomplished!

BTW, yesterday's graphics speed improvement on both targets is impressive!

And thanks for QAOP-NM! I've noticed that the Z9001 seems to require some CP/M-like keyboard polling which slows down gameplay a little (with joystick control gameplay is faster), but we can live with that.
stefano
Well known member
Posts: 2165
Joined: Mon Jul 16, 2007 7:39 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by stefano »

" yesterday's graphics speed improvement on both targets is impressive!" :cool:
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Robotron Z1013: KRT Highres Graphics

Post by RobertK »

dom wrote: Thu Feb 10, 2022 11:39 pmI noticed an issue with the latest jkcemu: I couldn't get .tap program to autostart on the z9001, reverting to 0.9.7 restored the behaviour.
RobertK wrote: Mon Feb 14, 2022 9:33 pm The JKCEMU emulator issue with the non-autostarting Z9001 TAP files is a bug, the author will fix it for the next release.
I've just noticed that some time ago Jens has released version 0.9.8.3 of his emulator in which the Z9001 autostart issue has been fixed, so we can use the latest release again:
http://www.jens-mueller.org/jkcemu/download.html
Post Reply