1

Topic: Getting started

Hi everyone,

I recently purchased a DivMMC Future for my Spectrum +3 and would like to do more with it than just load games super-fast. I've updated to esxDOS 0.8.7 and am hoping I can use it to transfer data between a PC and my +3--e.g. for storing on 3-inch diskette--and to use it as a modern storage device for programs running on my +3. However, I'm struggling to find good documentation for the various BASIC commands and machine-code routines that I can use, plus the workings of (experimental) .128 mode are tricky to delve into as wrong moves seem to result in reboots. I'm reasonably competent at programming the Spectrum and have written machine-code software to use both +3DOS and ZX Interface 1 routines, so I should be okay with esxdos, with the right information. I'm also happy to contribute to the project, if I usefully can. Anyone point me in the right direction?

Thanks in advance,
Georgeo.

2

Re: Getting started

I´m sure you will find help here.

But you should be more precise, what you would like to do.

Please read his: https://www.bytedelight.com/?p=2945
and this https://www.bytedelight.com/?p=3155

Reset is "normal" when switching from 48k Mode to 128k Editor with .128 - see Video: https://www.youtube.com/watch?v=joR8iqb-iJU

What file-operations are you willing to do? Primary in BASIC or in MCODE?

3

Re: Getting started

Hi Luzie,

Thanks. These are useful links. I'd seen the first one before, but not the note about .128 mode being limited to use of NMI to load snapshots.

I can confirm that +3DOS commands (BASIC and m/code) do work from .128 mode, though any attempt to use the extended BASIC, or 'dot' commands in esxDOS, leads to a crash.

Currently, I'm just experimenting with DivMMC. I'd like to transfer some of my software onto SD card rather than diskette, to give my aging floppy drive a break. I've ported various tape-based games and programs to work from diskette. Sometimes it is just a case of updating the BASIC loader, though most games require a bit more work, and I end up writing a machine-code +3DOS loader.

Having got programs from tape to disk, I hope it is easier to get them onto DivMMC, though I need to work out what esxDOS calls are equivalent to +3DOS ones.

I realise I could just use TAP files or snapshots, though that seems less satisfactory and doesn't work so well for multi-loader games or programs.

It looks from other comments on the forum that there are a set of RST 08 hook codes for accessing esxDOS from m/code. Are they documented anywhere?

Thanks again,
Georgeo.

4

Re: Getting started

georgeo wrote:

I recently purchased a DivMMC Future for my Spectrum +3 and would like to do more with it than just load games super-fast.

I think for what you want to do, you would be much better using the divMMC in passive mode and installing the Spectrum +3e ROMs by Garry Lancaster in your machine.

https://www.worldofspectrum.org/zxplus3e/

esxDOS has very limited integration with 48 BASIC, no integration with +3 BASIC, and no way of accessing floppy disks.

5

Re: Getting started

georgeo wrote:

It looks from other comments on the forum that there are a set of RST 08 hook codes for accessing esxDOS from m/code. Are they documented anywhere?

You should have a look here: http://board.esxdos.org/viewtopic.php?pid=1349#p1349
It´s for esxDOS 0.8.5, but you can see, what can be done with esxDOS via mcode.

It´s with all various disk-systems on the Spectrum (as they use there own syntax): You have to do convert every media-operation like load or save. I´ve seem approaches in MC for Betadisk/TR-DOS to place a BASIC-Line in TR-DOS-BASIC-Syntax in RAM and than call the BASIC ROM there to get it running.

From: https://cygnus.speccy.cz/popis_trdos-assembler.php

CHADD    equ    23645        ; Location of SOS variable CHADD
    ld    hl,(CHADD)    ; Start to save true CHADD
    ld    (TEMP),HL    ; Temporary store of true CHADD
    ld    HL,SAVE        ; Address of SAVE routine
    ld    (CHADD),HL    ; CHADD now points to our routine
    call    15619        ; ENTER TRDOS SAVE via chadd
    jp    BACK        ; Jump to program point from which the whole routine was called
    ld    HL,(CHADD)

    ld    (TEMP),HL    ; The routine for LOAD now repeats
    ld    HL,49500    ; the above with just the address
    ld    (CHADD),HL    ; changed.
    call    15619
BACK    ld    HL,(TEMP)    ; Start to restore CHADD
    ld    (CHADD),HL    ; Reload original CHADD
    ret            ; Return from where you came
TEMP    defs    2        ; Label allocating memory for temporary storage

SAVE    defb    234        ; code for REM
    defm    ":"
    defb    248        ; code for SAVE
    defb    34        ; code for "
    defm    "filename"
    defb    34        ; code for "
    defb    13

LOAD    defb    234        ; code for REM
    defm    ":"
    defb    239        ; code for SAVE
    defb    34        ; code for "
    defm    "filename"
    defb    34        ; code for "
    defb    13

If it "just games with multiloaders" you want to have on divMMC, I think you should have a look for .TRD-Diskimages with hacked games which support multiload. Those can e.g. be found on "Virtual TRDOS site" at: https://vtrd.in/games.php?t=a . They maybe run via TRDOS-Emulator of esxDOS.

6

Re: Getting started

Hi Luzie,

Thanks again. I'll take a look at the disassembly and see if I can make a simple Hello World-like loader to get things started.

Speak to you soon,
George.

7

Re: Getting started

Hi George,

yet I see there´s a problem with the code I post here:

It uses a CALL 15619 in the Betadisk/TR-DOS-ROM. This can´t be found in the Standard ZX ROM. And I don´t know, if/how esxDOS TRDOS-Emulator handles it...

I just have to try...

Hope to find some time today for this an will report back here.

8 (edited by Luzie 2019-10-04 17:52:15)

Re: Getting started

georgeo wrote:

Hi Luzie,

Thanks again. I'll take a look at the disassembly and see if I can make a simple Hello World-like loader to get things started.

Speak to you soon,
George.

Hi George,

I tested the code it paste here and it comes out, that it´s only to use for running TRDOS-commands. It´s not possible to run e.g.
PRINT "Hello World"
with it.

Maybe it´s possible calling routines in Standard ZX ROM, but I have to do more research for this. On first look I have found some infos that may be of interest for you:

On: https://www.worldofspectrum.org/forums/ … ks-via-asm
I found under:
https://www.worldofspectrum.org/forums/ … ent_914889
this:

For esxdos, it's very hard to find documentation, however there is this:
https://dailly.blogspot.ca/2017/07/esxd … ccess.html

Under: https://www.worldofspectrum.org/forums/ … ent_907684
I found this:

You have to look up each disk system's manual. The +3's is here:
https://www.worldofspectrum.org/ZXSpect … 8pt27.html
You'll also find information on the +3 from other sources, for example Residos probably has something on it.

9

Re: Getting started

Hi Luzie,

Sorry, I wasn't very clear. My plan is to try a simple load operation using the RST 0x08 hook codes which are listed in the Z88DK source code--e.g. call Open File, Read File, Close File, to see if the hook codes work. I can then try them from +3 BASIC mode, since I assume it is only the command parsing that doesn't work in +3 BASIC mode.

If it works, then I am in good shape for porting programs -- since it looks very similar to the way you access Microdrives, etc. from m/code.

I'm working on a real +3 for this, as I assume esxdos is not supported in many emulators, so I need to refresh my memory on how to use HiSoft Devpac first.

Thanks again,
George.

10

Re: Getting started

georgeo wrote:

My plan is to try a simple load operation using the RST 0x08 hook codes which are listed in the Z88DK source code--e.g. call Open File, Read File, Close File, to see if the hook codes work. I can then try them from +3 BASIC mode, since I assume it is only the command parsing that doesn't work in +3 BASIC mode.

Perhaps I wasn't sufficiently clear earlier. +3BASIC is not supported. The chance of you avoiding hitting at least one memory area that causes the divMMC to page in its own RAM and crash your program is negligible. The reason esxDOS forces 48 BASIC is because it is only designed to work with that ROM. The .128 command switches to ROM 0, but it doesn't solve the incompatibility. I think George Velesoft has a softROM that works with all RAM mode on the divMMC, but that's the UK128, not the +3. There's also the DerbyPro ROM (where the 128 editor was completely refactored to avoid crashing). The *only* way to safely use +3BASIC with divMMC is with the +3e ROMs. And then the SD card can't be FAT formatted.

11

Re: Getting started

Hi AOwen,

Thanks. What triggers DIVMMC to activate? I know about NMI button and I assume RST 08 (like ZX Interface 1) but it sounds as if something else too? I was wondering how it intercepted BASIC load and save to tape operations.

Thanks again,
Georgeo.

12

Re: Getting started

georgeo wrote:

What triggers DIVMMC to activate? I know about NMI button and I assume RST 08 (like ZX Interface 1) but it sounds as if something else too? I was wondering how it intercepted BASIC load and save to tape operations.

The PC register triggers divMMC. It triggers on the following addresses:

$0000        : initialization
$0008        : hook codes
$0038        : maskable interrupt
$0066        : non-maskable interrupt
$04C6        : LOAD routine
$0562        : SAVE routine
$1FF8 - $1FFF    : map off area
$3D00 - $3FFF    : TR-DOS traps

There's a fairly good chance that an extended +3 BASIC error code that goes via RST8 will end up triggering divMMC. If any code gets called at the address of the LOAD and SAVE routines in the other ROMs, that will trigger it (this is why the 32K version of 128 BASIC crashes). Calls in the map off area could conceivably drop back into the wrong ROM. The biggest problem is that there can be no executable code in the area used by the FONT in the BASIC ROM. Any call to any of these addresses triggers TR-DOS emulation. It's a safe bet that at least one of the +3 ROMs will hit an address here. So unless you have the source to the +3 ROMs and you are able to refactor them, trying to use esxDOS with +3 BASIC is a non-starter.

Sorry to be the bearer of bad tidings.

13

Re: Getting started

Ah, okay. That is a much more extensive list of triggers than I expected, and explains why the device is so sensitive when running in +3 BASIC. I'll focus my machine code experiments on USR0 mode.

Thanks again,
Georgeo.

14

Re: Getting started

georgeo wrote:

Ah, okay. That is a much more extensive list of triggers than I expected, and explains why the device is so sensitive when running in +3 BASIC. I'll focus my machine code experiments on USR0 mode.

Thanks again,

You're most welcome. If you are able to get the +3e ROMs burned and fit them to your machine, I'd encourage you to give them a go as they will enable you to use the SD card and floppies at the same time when the divMMC is in passive mode. In active mode you can continue to use esxDOS as normal.