New version SP-2-ZX81, SAVE added

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
dr beep
Posts: 2060
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

New version SP-2-ZX81, SAVE added

Post by dr beep »

SP-2-ZX81 version 2.10
----------------------

I found this spanish comment on my latest emulator.
https://trastero.speccy.org/cosas/FLeon ... lacion.txt

The program was altered to add saving but at the cost of the keyboardpicture.

The progam had no saving for several reasons
1) to save a program you need to translate the name from ZX81 ASCII to ZX SPectrum ASCII
2) the program is optimized in speed and almost has no room to add this option
3) the BASIC-part would need extra lines as well
4) the table to add extra options was quite full, had to find room
5) the intrupttable is placed over the SAVE-program in the ZX81ROM

If I want to add saving I needed to solve all this issues

I started to see if the BASIC would stay within memory when I would add extra lines for saving.
I deleted REM-lines and altered floatingpointnumbers into a string to save memory.
Furthermore all numbers were placed in VAL.
I noticed that the pointer to screenrefresh was altered in machinecode (happend before, but I wanted
to solve that problem also. The pointer is now fetched with a short routine on a fixed address.
I added the lines in BASIC, now the room in the program needed to be found.
The translation into ZX Spectrum BASIC is done by typing the name in Spectrumbasic to save.

The routine to return to the correct BASIC-lines is not too long. I had room
for it, but in the table it needed to be added.
I searched the ED-table and found a place for an extra ED-command and 3 bytes to jump to the routine.
So I wanted to add the command in the SAVE-program and I noticed that the place I wanted
to use was taken by the intruptroutinetable.
I skipped the errorcheck on false name and now it was added to the ROM as well.
Next was finding the length of the program in BASIC. I made a small machincoderoutine to do this.
So now you can save your own coding to tape or other hardwarestorage like MDR,Disciple.
SP2ZX81-210.zip
(250.64 KiB) Downloaded 95 times
Post Reply