Sparkplug (self-extracting version)

discuss general risc os software applications and utilities
Related forum: adventures


Post Reply
paintings
Posts: 27
Joined: Mon Jul 13, 2020 7:41 pm
Contact:

Sparkplug (self-extracting version)

Post by paintings »

Since I was responsible (if that's the right word) for packaging SparkPlug into a self-extracting format some 25 years ago, it seems appropriate that I should answer the call for a self-extracting SparkPlug that doesn't look for !System on startup.

This version is designed to run on RISC OS 3. It should work on RISC OS 4.02, but this is untested.

Built on RISC OS 3.71 (RPCEmu 0.9.3).
Also tested on a RISC OS 3.11 build without !Boot or !System (ArchiEmu on a Raspberry Pi running RISC OS 5.26).

It's in the form of a Zip file: unpack the archive on any system (a PC is fine for this part), copy the "Splug-RO3" file to the RISC OS machine, set its filetype to BASIC and double-click.

Now that I've remembered how to do all this, I can easily knock together a version suitable for RISC OS 2 (i.e. with CLib bundled) if there's any interest.
Attachments
sparkplug-ro3.zip
(81.26 KiB) Downloaded 35 times
User avatar
IanS
Posts: 1533
Joined: Mon Aug 31, 2009 7:02 pm
Contact:

Re: Sparkplug (self-extracting version)

Post by IanS »

paintings wrote:
Thu Sep 10, 2020 4:46 pm
Now that I've remembered how to do all this, I can easily knock together a version suitable for RISC OS 2 (i.e. with CLib bundled) if there's any interest.
That's fantastic, thanks.
I presume a RO2 version would also work on RO3 (and above?), a single version that works on everything would be nice.
paintings
Posts: 27
Joined: Mon Jul 13, 2020 7:41 pm
Contact:

Re: Sparkplug (self-extracting version)

Post by paintings »

The reason I was thinking of separate versions for RO2 and RO3 relates to CLib.

For RISC OS 2, you must have CLib, as the version in ROM is too old.
For RISC OS 3, you don't need CLib, as the ROM already contains a suitable version.

My plan was be to bundle CLib alongside !SparkPlug, and write the instructions to say "double-click on CLib before running !SparkPlug for the first time, then copy CLib to System:Modules as soon as it is available". The catch is, you only want that to happen on RISC OS 2 - if someone were to do that on RISC OS 3, the wrong version of CLib could be softloaded.

Anyway, I should be able to upload the RISC OS 2 version later tonight.
richw
Posts: 85
Joined: Tue Oct 28, 2014 9:54 pm
Contact:

Re: Sparkplug (self-extracting version)

Post by richw »

Don't you just need to make the system$path check in the !run file only happen if the check for CLib fails? So the same version could work on RISC OS 2 and 3?
paintings
Posts: 27
Joined: Mon Jul 13, 2020 7:41 pm
Contact:

Re: Sparkplug (self-extracting version)

Post by paintings »

Herewith the RISC OS 2 version, complete with CLib.

Please note this is an older version of SparkPlug (2.23) as I couldn't get SparkPlug 2.26 to run under RISC OS 2.
Attachments
sparkplug-ro2.zip
(114.29 KiB) Downloaded 19 times
User avatar
IanS
Posts: 1533
Joined: Mon Aug 31, 2009 7:02 pm
Contact:

Re: Sparkplug (self-extracting version)

Post by IanS »

paintings wrote:
Thu Sep 10, 2020 4:46 pm
Now that I've remembered how to do all this...
Can you write a few words about how you did this. It may be useful to others (I'm interested in creating a self extracting version of the ZIDEFS tools and !hform to get a bare machine with no software up and running with an IDE podule)
paintings
Posts: 27
Joined: Mon Jul 13, 2020 7:41 pm
Contact:

Re: Sparkplug (self-extracting version)

Post by paintings »

The distributed file consists of:
1. A BASIC program (BARK) that unpacks the archive
2. The archive itself.

BARK - originally written by David Pilling - does the heavy lifting of unpacking the archive. If my memory serves (it's been nearly 30 years and I have long since lost my notes) the original BARK program operated in a more conventional fashion: it asked you for a file to unpack, then opened the file and unpacked it.

The modified version of BARK used here doesn't open a file: instead it looks for an archive stored just above TOP in memory and unpacks it to the Currently Selected Directory (CSD).

To get just the BARK program from my archive, unpack "sparkplug-ro3.zip" to obtain "Splug-RO3", then load it into !Edit and save it as "BARK". If this has worked, BARK will be 4810 bytes in length. If you started with Splug-RO2, BARK will be 4811 bytes in length.

To create a new self-extracting archive:
  • Use Spark (or SparkFS) to create a Spark-format archive. Ensure you select "Crunch" as the compression method.
  • Note down the size of the archive file you have created.
  • Modify line 70 of the BARK program to set LOMEM (e.g. if your archive is 55000 bytes I would suggest LOMEM=TOP+55002). If you set this value too low, the end of the archive will be overwritten during the unpacking process and the program will abend.
  • Concatenate BARK and your archive. I used !Edit for this purpose (load BARK, go to end of file, drag&drop archive, save as new_dist)
  • Set the filetype of new_dist to BASIC.
The default WimpSlot is usually 640K, which would allow for archives up to about 600K to be unpacked. Larger archives will require a larger WimpSlot to be set before unpacking.

As BARK is written in BASIC, it should work on all RISC OS versions. I haven't tested it on Arthur, sorry...
User avatar
IanS
Posts: 1533
Joined: Mon Aug 31, 2009 7:02 pm
Contact:

Re: Sparkplug (self-extracting version)

Post by IanS »

paintings wrote:
Tue Dec 29, 2020 6:13 pm
To create a new self-extracting archive:
That all works, Thanks.
User avatar
BeebMaster
Posts: 3861
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Sparkplug (self-extracting version)

Post by BeebMaster »

Just been playing with this, and I can confirm it works on the Native ARM Pi Tube Direct (except the *SETTYPE part, but that can easily be replaced with OSFILE.)
Image
Post Reply

Return to “32-bit acorn software: other”