Rom Filing System stream generator

handy tools that can assist in the development of new software
Post Reply
julie_m
Posts: 587
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Rom Filing System stream generator

Post by julie_m »

I have written a simple utility for creating a byte stream in the correct format for inclusion in a sideways ROM image that can be read by the RFS:

https://github.com/JulieMontoya/Random_Beeb_Stuff/blob/main/sideways_rom_ram/make_rfs

You might need to alter the first line to point to the Perl interpreter on your own system.

Instructions may be found here but are summarised below:

Make a control file like this, where each line specifies a host-side filename (or just * to create an empty file; this may be used as the first file, to include a title in the listing produced by *CAT), the filename as it should appear in the RFS image, optional load and execution addresses and a flag to indicate special treatment (translation of \n to \r):

Code: Select all

# comment; ignored
*              TITLE
host_filename1 [ rfs_filename1 [ load_addr [exec_addr ] ] ] [T]
host_filename2 [ rfs_filename2 [ load_addr [exec_addr ] ] ] [T]
  • Lines beginning with a comment mark are ignored
  • Fields are separated by any whitespace (spaces or tabs)
  • If the target-side filename is *, a zero-byte file will be created on the target side
  • If no target-side filename is specified, the host-side filename will be used
  • Addresses are in hex, 1-4 digits, with no prefix
  • If no execution address is specified, the load address will be used
  • If no load address is specified, &0000 will be used
  • A final "T" indicates a text file; this will have all \n characters translated to \r to match the BBC's expectations
Now run
$ make_rfs -b begin_addr -i control_file -o output_file
where begin_addr is the address at which the RFS image must start (i.e., what gets poked into &F6 and &F7 by Service &0D).

An example control file, for an RFS image containing a zero-byte title file (which appears first when *CAT is used), a BASIC program, a machine code program (possibly BeebAsm output) intended to be loaded at and executed from particular addresses, a couple of MODE 7 screen saves and a text file:

Code: Select all

#  Create a title file with no content
*                **HELLO1**
# host_filename  beeb_name   load  exec  [T]
hello1.bas       HELLO       1900  8023
#  Execution address is different from load address
hello1.o         MCODE       2E00  2E16
pic1.m7          PIC1        7C00
pic2.m7          PIC2        7C00
#  T at end means translate line endings
instructions     !INSTR                   T
Up until now, I have just borrowed the service code from the example in chapter 11 of the Electron Advanced User Guide (pages 172 - 182) and all has worked nicely (use -b 8080 when generating the stream file, PRINT~code%+&80 and *LOAD it at that address); but I intend to make my own version anyway, and maybe make it able to self-load on a Model B with no *SRLOAD, just so I can feel more like it's All My Own Work.
Post Reply

Return to “development tools”