Setting up an eprom with coral basic interpreter

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
mrtinb
Posts: 1930
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Setting up an eprom with coral basic interpreter

Post by mrtinb »

I think there is a screen in EightyOne, where you can see which addresses are read or written. Different colors in the picture tell you what’s going on.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
xubuntu
Posts: 84
Joined: Sat Jun 18, 2022 12:42 pm
Location: Athens, GR

Re: Setting up an eprom with coral basic interpreter

Post by xubuntu »

A rom is by definition readable only memory or else not writable.

Kindly explain how the zx81 and the spectrum as I hear, was able to write roms.

What means for the actual machine (zx81) to have such switch ?

The emulator is software. The switch on the emulator is only "virtual" and not real.

But what means for the actual machine, the zx81, the switch protection ?

What is that ? Is that a knob ? A circuit ? A jumper ?

Did the zx81 actually have such switch ?

It must have had one otherwise why did the emulator's creator made it? He just came up with it?

How can one switch on/off the write protection on the actual zx81 ?

Thank you
User avatar
mrtinb
Posts: 1930
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Setting up an eprom with coral basic interpreter

Post by mrtinb »

Some have made ZX81 clones e.g. ZX97, that has more than 64 kB of RAM. And the hardware has bank switching to be able to access all RAM.

As an example this 64 kB memory expansion starts with RAM in all locations except where the ROM is (address 0k - 8k). If you flip switch S1 the RAM between 32k - 40k is now visible at address 0k - 8k. So you can load a new "ROM"-image to address 32k - 40k area, and flip the S1 switch. Then this image replaces the location 0k - 8k. You have replaced the ROM with RAM. Another switch S2 write protects the RAM by disabling the /WR-signal to RAM, that is needed to write data to RAM.

This hardware is even so clever that it has battery backup, so your custom "ROM"-image is available next time, even if you turn your computer off.

https://web.archive.org/web/20210224003 ... mories.htm

So the "solution" for writing a ROM with the ZX81 is to install RAM that can be swapped into the area of the ROM address 0k - 8k. However we still need the ROM, otherwise the computer will not start. We only want to switch to our custom image, after the replacement RAM has been filled with a working "ROM"-image. Then we flip the switch. The second switch protects the "ROM"-image to be written to and corrupted by mistake, as it is simply RAM.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
1024MAK
Posts: 5165
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Setting up an eprom with coral basic interpreter

Post by 1024MAK »

In a real ZX81, it’s not possible to write to the ROM and for it to be modified. This due to the mask ROM containing fixed data that cannot be modified. An ERPOM can be written to, but only by a programmer (or equivalent). So for a working microprocessor system like a ZX81, running with a EPROM fitted in its normal place on the board, it can’t be written by the Z80. The only switches on a real ZX81 are the keyboard (membrane), and on “U.S.A.” versions, a switch to select between the two VHF TV channels that the VHF modulator can produce.

The address decoding of the ROM area in a ZX81 is actually 16K bytes (see also this topic). However, the ROM socket on the board is not fully compatible with the 27 series EPROM chips. However, either the board or the EPROM can be modified and will work. Or an adapter board can be made up. A 16K byte EPROM (e.g. a 27128 or a 27C128) would in addition, need a wire adding for the A13 address line.

For details of the ZX81 ROM socket vs. EPROM chips, see here.

Really, the code needs to be altered so that it does not try to write to the ROM area. And instead, uses actual RAM locations where writing and reading of data/variables/stratchpad data is stored.

The project is not easy.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor 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 being good this year.
User avatar
xubuntu
Posts: 84
Joined: Sat Jun 18, 2022 12:42 pm
Location: Athens, GR

Re: Setting up an eprom with coral basic interpreter

Post by xubuntu »

Ok Guys thank so much both of you for the explanations. I think I understood (a bit).

So we can't have an eprom with coral basic running after all.

Nice cold shower.
User avatar
Paul
Posts: 1540
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Setting up an eprom with coral basic interpreter

Post by Paul »

Has anybody verified that the code writes to the area 8-16k?
That's what I assume because I don't know what Eightyone really does.
The code needs to be disassembled in order to prove this. Or at least a breakpoint in eightyone needs to be set to find the position(s)
Don't give up right now!
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
Paul
Posts: 1540
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Setting up an eprom with coral basic interpreter

Post by Paul »

We can still make a ROM that automatically starts and installs coral in RAM.
In the first place it means that less RAM is available for programming.
What does it mean programming wise?
- We need to reserve more RAM at boot time.
- we need to copy the program from ROM to RAM (using ldir)
- we need to call the adress in RAM instead of ROM
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
mrtinb
Posts: 1930
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Setting up an eprom with coral basic interpreter

Post by mrtinb »

At least to make this work on real hardware, a RAM or ROM card is needed at 8k - 16k, in addition to a RAM/ROM card in 0k - 8k.

We have no pre-built hardware for this purpose. The hardware ZXblast, ZXmore, ZX97 or ZXNU could be used for this. ZXblast and ZXmore is no longer available. For ZXNU and ZX97 you need to produce the PCB yourself and solder on all necessary components.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
Paul
Posts: 1540
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Setting up an eprom with coral basic interpreter

Post by Paul »

Sorry Martin, I had to change my post because what Eightyone shows is that coral only uses additional data, no modifications in the code.
I am not familiar with vb81, are you Martin?
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
Paul
Posts: 1540
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Setting up an eprom with coral basic interpreter

Post by Paul »

CORAL.zip
(15.15 KiB) Downloaded 172 times
Here is a new version of CORAL.ROM and CORAL.SYM.
It was my fault. My relocation was faulty.
This Version is ROM-capable and Write to ROM can be disabled.
Now jus get an eprom with it, adapt it to work with ZX81 and feed A13.

Kind regards
Paul
Hardware.jpg
In theory, there is no difference between theory and practice. But, in practice, there is.
Post Reply