Memotech HRG: ROM mirroring!

Discussions about Sinclair ZX80 and ZX81 Hardware
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Memotech HRG: ROM mirroring!

Post by XavSnap »

Hi,
I target the code to reinit the Memotech HRG:
;------------------------------------
;-Basic sub-routine entry. -
;+----------------------------------+
; Lb4082 ; <- USR Basic Enty.
;+----------------------------------+
ORG $4082 ; [@16514/@h4082]
Lb4082: ; <- USR Basic Enty.
LD HL,$0000
LD DE,$0000
LD BC,$0400
LDIR
RET ; ==========================
I had to create a buffer (ram 0 to &400) in Vb81...

But, in EO... this program can't work properly:
FR.P
Memotech HRG RAM 0-h400
(3.73 KiB) Downloaded 219 times
Text&P file:http://zx81.ordi5.free.fr/programmes/Me ... ncais.zip (Type RUN, and NEW)

Image

... the ROM steel in read-only statement.
A "write" process (POKE/LD/LDIR...) seem to be the trigger to read the mirrored ROM.
:?
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Memotech HRG: ROM mirroring!

Post by siggi »

Hi Xav
did you disable "write protect" of the ROM (in "Advanced settings": "Protect ROM from Writes")?
Write-Protect-Rom.jpg
Regards
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Memotech HRG: ROM mirroring!

Post by sirmorris »

Hmm.

Code: Select all

        // Memotech Hi-res board has 1k of RAM available at address 8192
        // permanently and overlaid the ROM at address 0 when z80.i is odd
        // or data is written to address 0-1k

        if (Address<=zx81.ROMTOP && zx81.protectROM)
        {
                if ((zx81.truehires==HIRESMEMOTECH) && (Address<1024))
                        memhrg[Address]=Data;
                return;
        }
It looks like EO handles this already. ROM protection must be enabled. Disable RAM at 8K. Have you enabled memotech hires in the options?

So what is this program supposed to do? My school-boy french hints that it might be a fun translation of the ZX81 commands into French. The thing is, the RAM will only be overlaid on the ROM when the i register is odd.

Code: Select all

        // Memotech Hi-res board has 1k of RAM available at address 8192
        // permanently and overlaid the ROM at address 0 when z80.i is odd
        if ((Address<1024 && (zx81.truehires==HIRESMEMOTECH)) && (z80.i&1))
        {
                data=memhrg[Address];
        }
Changing the i register will affect character rendering so how is this supposed to work?
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Memotech HRG: ROM mirroring!

Post by sirmorris »

Hmm the second.

Wilf has analysed the board and produced some hints. I think there is a button which needs to be pressed to toggle the RAM/ROM overlaying. I also think that some initialisation of the HRG is necessary before things work as expected.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Memotech HRG: ROM mirroring!

Post by Moggy »

sirmorris wrote: Thu Feb 22, 2018 3:09 pm Hmm the second.

Wilf has analysed the board and produced some hints. I think there is a button which needs to be pressed to toggle the RAM/ROM overlaying. I also think that some initialisation of the HRG is necessary before things work as expected.
Correct on both points.

The manual can be found here...

http://www.zx81.de/memotech/_frame_e.htm
User avatar
gammaray
Posts: 590
Joined: Sun Apr 17, 2016 2:44 am
Location: Texas

Re: Memotech HRG: ROM mirroring!

Post by gammaray »

translation memotech.png
Very ZEN...or very THEN which will get you THEN!

Immerse yourself into "being the program" ;)
Last edited by gammaray on Thu Feb 22, 2018 10:21 pm, edited 1 time in total.
5-TS1000,UK ZX81<-Sheelagh, US ZX81, 2-TS1500/KDLX , 3-TS2040 printer, 2-TS2020 cassette decks, ZXPAND+AY, ZeddyNET, ZXBlast, UDG, ZX8CCB, AERCO, BUILDS/REPAIRS ZX Spectrum, ZX80 Minstrel, ZXMAX48 v1 v2, 2-TS-2068, ROM, 16kRAM
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Memotech HRG: ROM mirroring!

Post by 1024MAK »

I think Google lost the plot in the last sentence :lol:

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Memotech HRG: ROM mirroring!

Post by XavSnap »

:lol:

@siggi, Yes, but the rom seem to be "protected" or reloaded anyway.
// Memotech Hi-res board has 1k of RAM available at address 8192
// permanently and overlaid the ROM at address 0 when z80.i is odd
All POKE in the 0-400 memory room are stored At 2000...

POKE 276,CODE"a" equal POKE 276+8193,CODE"a"
A PEEK (276+8193) must be CODE"a"
and
PRINT PEEK (276) =CODE "a"
But I don't (can't) understand where the Z80 peek them datas!
In the rom, or in the mirror!
The LDIR function can't Peek in the rom to copy it.... and Peek in the buffer after it's copy!
If the copy is an inboard process like the Larken buffering, the Basic monitor can't read the buffer from the ZX cpu call!
:?
This program can't run as is...
:mrgreen:
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Memotech HRG: ROM mirroring!

Post by XavSnap »

On the XuR,
I buffered the first segment (0-&400), but the binary reader don't display it! :?

This segment is a RAM, but filled at the reset... not, by the "LDIR" from the Memotech ROM. (peek<&400=ROM source if h2000>PC>h2800..)

All Pokes are sent to the buffer... how replace the main rom.
The HRG Rom is located at &2000, and can't be the buffer Ram // or // the poked byte is redirect in a ram at the same location...
HRG0.JPG
HRG1.JPG
HRG2.JPG
But, this mirroring was build to run this demo on this emulator, and, I don't know if it work on a true HRG board!
:oops:

Another mystery in this program:
The rom is patched on a blank ram!!!
And updated on itself after changes!
POKEs... and the LDIR function...
The best way to mirror the rom is to LDIR (copy) the Rom in the Ram THEN it able to patch it in the RAM!

Note: Not easy to type-in a program in French!!!
:lol:
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Memotech HRG: ROM mirroring!

Post by sirmorris »

The Memotech hardware presumably does something like this:

when you write to addresses 0000-0fff enable RAM, disable ROM
when you read from addresses 0000-0fff and I register is even, disable RAM, enable the ROM
when you read from addresses 0000-0fff and I register is odd, enable RAM, disable ROM

Under normal circumstances you cannot replace the ROM at 0000-0fff with the shadow RAM because the I register needs to be set to $1E in order for the character generator to work. If you change I register then the characters on screen will be messed up, psuedo hires.

When the button is pressed the normal display is switched for the hires display routine and the I register can be changed. THis will allow the RAM to shadow the ROM.

The switch needs to be emulated in order for the display swapping, and therefore the ROM overlay, to work.

I think.
Post Reply