Detecting HRG

Discussion about ZX80 / ZX81 Software
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Detecting HRG

Post by RWAP »

With the various ways of creating hi-res graphics on the ZX81, what is the best way of detecting whether it is available?

This should be available from BASIC, so that a program loader can check which version to load !!

Forthretro.new.fr suggests:
POKE 8192, 0
LET A=PEEK 8192
PRINT A

iF A=0 then Hi Res.

Is there a better way which would cope with more than just the HRG drivers, such as UDGs at 8K?
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Detecting HRG

Post by sirmorris »

FR is right, there are only 2 classes of software HRG, those which require RAM at 8k, and the others :)

'There's no UDG without fire' as they say. Oh that's right, they don't actually say that - it's 'there's no UDG without additional hardware' Yes. That's it.

;)
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Detecting HRG

Post by siggi »

RWAP wrote:With the various ways of creating hi-res graphics on the ZX81, what is the best way of detecting whether it is available?
IMHO it is not possible. IMHO the application using HRG (or UDG) and the HRG (or UDG) environment are"fixed coupled", because the appliction need to know, where the HIRES image is located (using Wilf's WRX allows the image at every 512 byte address boundary, so it can be anywhere in ram) and which resolution it has, and how (which order) the pixels need to be written into the image.
This should be available from BASIC, so that a program loader can check which version to load !!

Forthretro.new.fr suggests:
POKE 8192, 0
LET A=PEEK 8192
PRINT A

iF A=0 then Hi Res.
This test detects only ANY ram at 8K. But you do not know, whether it is usable for UDG (needs address lines coming from the ULA, not from the Z80) or HRG (needs to be readable not only during Z80 memory read cycles (e. g. during PEEK), but also during refresh cycles, which cannot be tested by BASIC).

@Charlie: IMHO there are 2 classes of HRG: those which require a hardware modification (like TRUE HRG, e. g. WRX) and those which don't (like PSEUDO HRG, e. g. from SOFTWARE FARM).

And IMHO there are 3 other classes of HRG: those which run on a 1K Zeddy (like WIlf's 1K-WRX), those which run on a "true" 16K Zeddy (like XTRIGATOR), and those which run on any Zeddy with enough ram (WRX, 8..64K).

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
Forthretro.new.fr
Posts: 32
Joined: Thu Nov 19, 2009 9:34 pm

Re: Detecting HRG

Post by Forthretro.new.fr »

Siggi,

Thanks, but the question asked by Rich, as I could understand, was from the PROGRAMMER point of view.

The purpose, clearly, is to ask the programmer to include (if possible) a Low Res and a HGR version of the same programm.
The programm detect if the required configuration is avaible and, according the test, launch the Low Res OR the HGR version.

It is to say : If your programm need one of the classes of HGR, could you detect if the zetty's configuration the player use is OK ?

1- For pseudo HGR, no test (I mean no Graphic test) is needed. (question solved). Now, if enough RAM (1, 2, 16, 32 or 48K is another problem)
2- For those which require RAM at 8k, I gave a test I can include in my program since I use this kind of HGR and I know where my HIRES image is located.(question solved)
3- But the Rich's question : "With the various (understand other ) ways of creating hi-res graphics on the ZX81, what is the best way of detecting whether it is available? remain unsolved.
Can a programmer using other hi-res graphics than RAM at 8k include a test ?

A+ Dominique
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Detecting HRG

Post by siggi »

Forthretro.new.fr wrote:Siggi,

Thanks, but the question asked by Rich, as I could understand, was from the PROGRAMMER point of view.

The purpose, clearly, is to ask the programmer to include (if possible) a Low Res and a HGR version of the same programm.
The programm detect if the required configuration is avaible and, according the test, launch the Low Res OR the HGR version.

It is to say : If your programm need one of the classes of HGR, could you detect if the zetty's configuration the player use is OK ?
No, that is not possible. The program can only detect (using PEEK/POKE), whether there is ram, where the HIRES software wants to write its HIRES image to. But it cannot detect, whether this ram region is able to display UDG or HIRES. The only possibitily would be to show a test picture and ask the user, whether he can see it.
1- For pseudo HGR, no test (I mean no Graphic test) is needed. (question solved). Now, if enough RAM (1, 2, 16, 32 or 48K is another problem)
2- For those which require RAM at 8k, I gave a test I can include in my program since I use this kind of HGR and I know where my HIRES image is located.(question solved)
No, not solved: as written before: you know only, that there is ANY ram at 8K. But it can be "normal" ram, not usable for UDG or HRG.
3- But the Rich's question : "With the various (understand other ) ways of creating hi-res graphics on the ZX81, what is the best way of detecting whether it is available? remain unsolved.
The best solution is already done by Wilf or Matthias: their HIRES-programs use only their own HIRES-program package and don't work with other HIRES variants (Note: HIRES/UDG is a non-standard-feature of non-standard-Zeddies!). Nevertheless they don't know, whether the user can see the HIRES-image (if the ram is not modified for HIRES).
Can a programmer using other hi-res graphics than RAM at 8k include a test ?
A PEEK/POKE ram test (at 8K or anywhere else) does not give information, whether that ram there can display UDG or HIRES!!!
Example: if you do your PEEK/POKE test in a standard 16K ram pack, you would find, that there is ram. But it is not usable for HIRES (without hardware modification).

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Detecting HRG

Post by Moggy »

sirmorris wrote:FR is right, there are only 2 classes of software HRG, those which require RAM at 8k, and the others :)

'There's no UDG without fire' as they say. Oh that's right, they don't actually say that - it's 'there's no UDG without additional hardware' Yes. That's it.

;)
I thought the software farm managed it on a standard zeddy with no added hardware I have heard this called pseudo hi-res, I have all their software and the end result is just as good as any other method and works straight out of the box with no string twiddling or lever pulling!! :twisted:
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Detecting HRG

Post by RWAP »

I may be barking up the wrong tree as I am not sure how the hi-res works that uses the HRG drivers - if the image is written to the 8k RAM area - how does the ZX81 know to display that image on the screen rather than the low-res text display? Possibly the solution may be in a short machine code routine?

At least a partial solution would be a test to see if the extra functions in the HRG driver are installed - the manual suggests a test:

To check if the application interface is present and the graphic software is installed the following is recommended:
1. Check if memory location 7FE0 is filled with C3 or 195.
2. Check if the two following memory-cells make a value between RAMTOP and 7FE0.
If both conditions are true it is very likely to have the graphic software installed.

What happens if you try to install the HRG drivers on a ZX81 without the memory modification? Does it just crash the ZX81, or if not then maybe the above test is all that is needed to work with Matthias's drivers?
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Detecting HRG

Post by siggi »

RWAP wrote:I may be barking up the wrong tree as I am not sure how the hi-res works that uses the HRG drivers - if the image is written to the 8k RAM area - how does the ZX81 know to display that image on the screen rather than the low-res text display? Possibly the solution may be in a short machine code routine?
The solution IS a (not so short) machine code routine, which replaces the NMI- and /INT-driven Sinclair lores display routine. And thus it knows, where the image is located:
http://www.user.dccnet.com/wrigter/inde ... torial.htm
At least a partial solution would be a test to see if the extra functions in the HRG driver are installed - the manual suggests a test:

To check if the application interface is present and the graphic software is installed the following is recommended:
1. Check if memory location 7FE0 is filled with C3 or 195.
2. Check if the two following memory-cells make a value between RAMTOP and 7FE0.
If both conditions are true it is very likely to have the graphic software installed.
That would fit only to Matthias's Hires routines of the current version ...
What happens if you try to install the HRG drivers on a ZX81 without the memory modification? Does it just crash the ZX81, or if not then maybe the above test is all that is needed to work with Matthias's drivers?
The Zeddy does not crash (using WRX/Matthias' HRG), but nothing more than some vertical black/white lines could be seen.

XTRIGATOR uses another kind of special HIRES display routine and crashes the Zeddy, when it is not run on a real 16K Zeddy (with 16K ram pack), but on a 64K Zeddy.

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
Forthretro.new.fr
Posts: 32
Joined: Thu Nov 19, 2009 9:34 pm

Re: Detecting HRG

Post by Forthretro.new.fr »

siggi wrote:....

No, not solved: as written before: you know only, that there is ANY ram at 8K. But it can be "normal" ram, not usable for UDG or HRG.
Yes solved ! I never asked it and don't need this 8k to be "usable for UDG or HRG".

Since I said that i need address 8192 and the test says I have the address 8192, my problem is solved ! :lol:
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Detecting HRG

Post by RWAP »

By the way, is there any difference in the requirements for WRX (Wilf's) Hi-Res graphics and those from Matthias?

In other words can a program written for WRX (such as ZX4PAINT) work with Matthias's drivers, or do you have to load the WRX drivers?
Post Reply