siggi wrote:I would like (as a first step) load a complete program (like a .P file for ZX81).
- Which Speccy file type is equivalent to a ZX81 P-file? And where (at which address) do I have to load it?
- Do I have to update afterwards some system variables?
- Which address range has to be written to MMC to save a complete program?
The best fitting equivalant is the TAP-file. A TAP-file holds either BASIC, CODE or DATA segments (depending on the header each block of code has).
Also the location where it is loaded is depending on the type of header. BASIC loads from start of basic (which can be altered with a ZX IF 1).
CODE loads according to the header in the data and DATA on the place used for variables.
For completeness, I'll include the structure of a tape header. A header always consists of 17 bytes:
Byte Length Description
---------------------------
0 1 Type (0,1,2 or 3)
1 10 Filename (padded with blanks)
11 2 Length of data block
13 2 Parameter 1
15 2 Parameter 2
The type is 0,1,2 or 3 for a Program, Number array, Character array or Code file. A SCREEN$ file is regarded as a Code file with start address 16384 and length 6912 decimal. If the file is a Program file, parameter 1 holds the autostart line number (or a number >=32768 if no LINE parameter was given) and parameter 2 holds the start of the variable area relative to the start of the program. If it's a Code file, parameter 1 holds the start of the code block when saved, and parameter 2 holds 32768. For data files finally, the byte at position 14 decimal holds the variable name.
And could you tell my the numeric address, where a basic program should be loaded (I don't know the Speccy memory map and of course don't have a ZX IF 1 connected to my Zeddy )
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware http://zx81.ddns.net/ZxTeaM
By heart; game loads at #5ccc
After loading you must jump to the next statement routine in ROM.
When however you have an interface connected with alternative rom then it is much easier to alter the load/save routine only
and so asking the info you need. With my ZX-PC interface I only altered the reading from tape to reading from diskette/harddisk.
I don't want to "patch" the new Sponzy rom now. I just would like to use the FAT32-program like on my Zeddy: it has its own command line interface to load/save file and runs above 32K. That is easier to test than changes in rom.
My idea is, to boot as Zeddy, load the (SPONZY-)FAT32-program from MMC into higth ram (>32K) and switch to SPONZY rom (reboots as 16K-Speccy).
But I found, that the memory above 32K seems to be cleared during SPONZY boot (despite it emulates a 16K Speccy). So the FAT32 program is overwritten ...
Maybe ZSOLT can tell some details about SPONZY boot?
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware http://zx81.ddns.net/ZxTeaM
Hi ZSOLT
AFAIK on a Speccy the usage of the IX register by user programs is allowed. But what about reserved registers of a SPONZY? Are (like in a ZEDDY) the registers AF' and IX "forbidden" (maybe used by the NMI/display routine)? And probably also IY?
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware http://zx81.ddns.net/ZxTeaM
siggi wrote:Hi ZSOLT
AFAIK on a Speccy the usage of the IX register by user programs is allowed. But what about reserved registers of a SPONZY? Are (like in a ZEDDY) the registers AF' and IX "forbidden" (maybe used by the NMI/display routine)? And probably also IY?
Siggi
If you don't use ROM-routines at all then all registers are allowed on the Spectrum.
For systemvars you need IY, but without ROM IY can be used. For returning to BASIC you also need HL', but
without BASIC you may use everything.
in PAL mode: 1 frame ~= 312 scanline (312*207TS -> 19.872 msec ~50,322Hz)
in NTSC mode: 1 frame ~= 262 scanline (262*207TS -> 16.687 msec ~59,925Hz)
It seems that there is a reserve in PAL mode (<20 msec), therefore the length of the frame can be extended. In the revised version 314 scanline forms a frame: 314*207TS -> 19.999 ms ~ 50.002 Hz.
this may cause the flickering display - I rebuilt the program w.312 scanline - try it, pls.
- Which Speccy file type is equivalent to a ZX81 P-file? -> as drBeep wrote the TAP
- And where (at which address) do I have to load it? -> SysVARPROG (23635=$5C53) points to startaddress
- Do I have to update afterwards some system variables? -> Yes, more (e.g. NEWPPC,E PPC,VARS,E LINE,X PTR,WORKSP)
check it in ROM-code (IX points to a header-block) - perhaps easier to use the ROM routines
- Which address range has to be written to MMC to save a complete program? ->
-> from addr. pointed by sysvar PROG to addr. (pointed by E_LINE) -1
Speccy_MEM.png (11.19 KiB) Viewed 5121 times
- How do I switch form SLOW to FAST mode and back?
in BASIC: REM =>fast and REM =>slow - where "=>" is SHIFT+Y
in asm: SW_FAST = call $054c and SW_SLOW = call $1296
SPONZY's RAM check is same as the Speccy's - the above can be a good solution "to 'protect' the upper 32K".
drBeep is right, no reserved registers in SPONZY
Regards,
Zsolt
ps: I will publish the source code with comments as well, as soon as possible. (few months )