Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom TAP loader with SCREEN$
#2
(01-17-2021, 06:24 PM)patters Wrote: I have a Sinclair BASIC loader for my game which will CLEAR 32767, load a SCREEN$, LOAD ""CODE, and finally RANDOMIZE USR 32678. I have assembled the loader and the SCREEN$ into a TAP file - but how to I get zxbc.py to append its output to this TAP file? I can't seem to get it to work.

When I try:
Code:
./zxbc.py -t --append-binary ../loader+scr.tap ../arti12.bas
 
I get a file arti12.tap as expected but it doesn't load the machine code. If I browse the TAP file in Fuse emulator I see that zxbc.py appears to have prepended an additional self-contained TAP file into the loader TAP file, rather than appended the binary data. Am I doing this wrong, or is this a bug?

I have managed to work around the issue by producing a .bin file instead, and then Fuse's 'Import Binary Data' option and then saving the memory range back out to the mounted TAP file - but it would be much nicer to automate that with zxbc.py if possible.

Thanks

As you know, ZX Basic creates a default simple basic loader if you specify -B (or --BASIC) option.
But if you want to compose a multi-binary file, this is a different thing.

ZX Basic does not allow (currently) to provide your own BASIC loaded (I've been working on that, and it's near to be done, but it takes time). Basically, you can provide your own .bas loaded + binaries (screens, etc) + .BAS source code. It's not ready. Sorry.

"Append-binary" can be repeated multiple times. It will append the given binary file(s) at the end of the .TAP file one after another.
A possible solution is:

  1. Create your main BASIC program (by default ORGs as 32768) and save it in .BIN (raw) format (don't use -t or -T)
    zxbc mygame.bas (this will create mygame.bin, you can use -o <filename> so set output filename)
  2. Create a screen and save it in binary (i.e. SCR) raw format
  3. Create a loader in ZX BASIC and save al together:
This is an example of a loader.bas in ZX Basic:
Code:
10 BORDER 0: PAPER 0: INK 7: CLS
20 LOAD "" SCREEN$
30 LOAD "" CODE 32768
40 RANDOMIZE USR 32768

Compile this with:
Code:
zxbc --org=26000 -taB loader.bas --append-binary screen.scr --append-binary main.bin
Try this, and tell me, please Angel
Reply


Messages In This Thread
Custom TAP loader with SCREEN$ - by patters - 01-17-2021, 06:24 PM
RE: Custom TAP loader with SCREEN$ - by boriel - 01-17-2021, 09:09 PM
RE: Custom TAP loader with SCREEN$ - by boriel - 01-17-2021, 11:08 PM
RE: Custom TAP loader with SCREEN$ - by patters - 01-18-2021, 12:30 AM
RE: Custom TAP loader with SCREEN$ - by boriel - 01-18-2021, 03:36 PM
RE: Custom TAP loader with SCREEN$ - by patters - 01-18-2021, 04:06 PM
RE: Custom TAP loader with SCREEN$ - by boriel - 01-18-2021, 05:47 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)