Self booting disk for plus 3 with loader
Self booting disk for plus 3 with loader
Dear all,
I have recently published a text adventure game for the ZX Spectrum 48K called The Queen's Footsteps: https://spectrumcomputing.co.uk/entry/3 ... _Footsteps
The game is in three parts and can be loaded from a tap file or audio from a cassette.
Someone requested a version for the Plus 3 in a floppy disk. I thought it was a nice idea.
I use the z88dk compiler as my game is written in C. There is a wonderful option of the compiler that allows to create a bootable disk, showing a loading screen:
https://github.com/z88dk/z88dk/wiki/Pla ... ble-3-disc
That works perfectly with my program, apart the detail that I have to choose between three executables, so I need to write a loader that allows to choose which part of the game one wants to play. With the Amstrad CPC 6128 I did this with a BASIC program that shows a picture and loads the chosen file, I was thinking to do something similar for the Spectrum, but I only have a classic 48K machine and I never used (or seen in person) a +3.
Do you think that would be a reasonable approach? Where would you suggest to start reading documentation for writing such a loader?
Cheers,
D.
I have recently published a text adventure game for the ZX Spectrum 48K called The Queen's Footsteps: https://spectrumcomputing.co.uk/entry/3 ... _Footsteps
The game is in three parts and can be loaded from a tap file or audio from a cassette.
Someone requested a version for the Plus 3 in a floppy disk. I thought it was a nice idea.
I use the z88dk compiler as my game is written in C. There is a wonderful option of the compiler that allows to create a bootable disk, showing a loading screen:
https://github.com/z88dk/z88dk/wiki/Pla ... ble-3-disc
That works perfectly with my program, apart the detail that I have to choose between three executables, so I need to write a loader that allows to choose which part of the game one wants to play. With the Amstrad CPC 6128 I did this with a BASIC program that shows a picture and loads the chosen file, I was thinking to do something similar for the Spectrum, but I only have a classic 48K machine and I never used (or seen in person) a +3.
Do you think that would be a reasonable approach? Where would you suggest to start reading documentation for writing such a loader?
Cheers,
D.
Re: Self booting disk for plus 3 with loader
As for the CPC you just need a simple basic program, all you need to do is name it DISK and it will autorun when you press Loader on the main menu.
The following is a simple loader, just adapt it so you can load each part:
Insert a blank disk and in +3 basic save this as and it will autorun.
The PAUSE 100 at the end is to ensure the drive motor has stopped before the game is launched
There is also a ton of info in the ZX Spectrum +3 manual which you can find here https://spectrumcomputing.co.uk/index.p ... id=2000448 this also covers machine code loaders using the ROM.
TomD
The following is a simple loader, just adapt it so you can load each part:
Code: Select all
10 CLEAR xxxx
20 LOAD "screen" SCREEN$
30 LOAD "code" CODE
40 PAUSE 100
50 RANDOMIZE USR xxxx
Code: Select all
SAVE "DISK" LINE 10
The PAUSE 100 at the end is to ensure the drive motor has stopped before the game is launched
There is also a ton of info in the ZX Spectrum +3 manual which you can find here https://spectrumcomputing.co.uk/index.p ... id=2000448 this also covers machine code loaders using the ROM.
TomD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: Self booting disk for plus 3 with loader
Thank you very much! That's exactly what I was looking for.
Re: Self booting disk for plus 3 with loader
Well, things do not seem to go as smoothly as expected. I still have some maybe trivial questions...
I suspect the culprit is the disk image tool I am using, i.e. iDSK that I successfully used for the Amstrad. I can extract working files from a disk image, but if I put them again in another disk image, the basic loader can not load them correctly anymore:
![Image](https://i.postimg.cc/187BJmqC/does-not-work.png)
Is there a Spectrum +3 reliable disk management tool that can be compiled and run from the command line on an Unix system?
By the way, is there a way on the Spectrum side to know which kind of files is each one listed by the CAT command? (i.e. basic, code, screen, ...)
I suspect the culprit is the disk image tool I am using, i.e. iDSK that I successfully used for the Amstrad. I can extract working files from a disk image, but if I put them again in another disk image, the basic loader can not load them correctly anymore:
![Image](https://i.postimg.cc/187BJmqC/does-not-work.png)
Is there a Spectrum +3 reliable disk management tool that can be compiled and run from the command line on an Unix system?
By the way, is there a way on the Spectrum side to know which kind of files is each one listed by the CAT command? (i.e. basic, code, screen, ...)
Re: Self booting disk for plus 3 with loader
Look "Catalogo ampliado": https://proyectobasiczx.wordpress.com/r ... 80/mh-170/
Or that other:
https://spectrumcomputing.co.uk/entry/2 ... trum/CatDB
Re: Self booting disk for plus 3 with loader
Thank you +3code, Catalogo Ampliado worked very well. The issue is clear:
![Image](https://i.postimg.cc/mPzk592F/cat-amp.png)
QUEENS1.BIN and ZXQUEENS.BIN should be identical. It seems that when I wrote QUEENS1.BIN on the disk image, the attribute "code" was lost. Is there a way to set it correctly, preferably with iDSK or even on the Spectrum side? A hint about where I can find information about it in the documentation may be enough, I have the sources of iDSK and I can try to patch it to fit to my needs, after all...
EDIT: Oh yes, looking at the disk image, I think I see what happens! iDSK adds a wrong header! Now, to solve the issue, I just have to configure iDSK so that no header is added (it should be feasible).
![Image](https://i.postimg.cc/mPzk592F/cat-amp.png)
QUEENS1.BIN and ZXQUEENS.BIN should be identical. It seems that when I wrote QUEENS1.BIN on the disk image, the attribute "code" was lost. Is there a way to set it correctly, preferably with iDSK or even on the Spectrum side? A hint about where I can find information about it in the documentation may be enough, I have the sources of iDSK and I can try to patch it to fit to my needs, after all...
EDIT: Oh yes, looking at the disk image, I think I see what happens! iDSK adds a wrong header! Now, to solve the issue, I just have to configure iDSK so that no header is added (it should be feasible).
Re: Self booting disk for plus 3 with loader
I was able to solve the issue, patching iDSK so that it does not include the AMSDOS header. Thank you to everybody for the very useful help!
The result can be downloaded here: http://davbucci.chez-alice.fr/index.php ... ge=English
(it's the ZX Spectrum +3 version)
It seems that the load/save code still does not work, I am trying to see if there is a limitation associated to the z88dk compiler or if I overlooked something.
The result can be downloaded here: http://davbucci.chez-alice.fr/index.php ... ge=English
(it's the ZX Spectrum +3 version)
It seems that the load/save code still does not work, I am trying to see if there is a limitation associated to the z88dk compiler or if I overlooked something.
Re: Self booting disk for plus 3 with loader
Just one small change, you do need to add a pause before the randomize usr statement otherwise the drive motor just keeps running.DarwinNE wrote: ↑Mon Jul 20, 2020 9:56 am I was able to solve the issue, patching iDSK so that it does not include the AMSDOS header. Thank you to everybody for the very useful help!
The result can be downloaded here: http://davbucci.chez-alice.fr/index.php ... ge=English
(it's the ZX Spectrum +3 version)
It seems that the load/save code still does not work, I am trying to see if there is a limitation associated to the z88dk compiler or if I overlooked something.
TomDD
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: Self booting disk for plus 3 with loader
It turned out that I was using wrong compile options. Now the +3 version can load and save on the disk
![Cool 8-)](./images/smilies/icon_cool.gif)