del jpj.trd
del boot.tap
del boot.tzx
del boot.txt
del boot_1.bin
del boot.
del boot.B
trdtool # jpj.trd
bas2tap boot.bas
tzx_display boot
ren boot_1.bin boot.B
trdtool boot.bas
trdtool + jpj.trd boot.B
It almost works, but the header of the boot is wrong - left side is the wrong one, right side is one I made manually from TR-Dos. The 13 bytes of the Standard Data block after it is correct. What am I doing wrong?
It looks like the 'bad' image has the file type set to 'b' as opposed to 'B'. The ASCII code for 'b' is 98, so that should at least explain the 'custom header type #98' thing. Something to do with trdtool perhaps? BASIC files need some spesshul treatment in TR-DOS in order to enable autostart from line N and whatnot (a special marker must be put after the program data, which shouldn't be accounted for in the file length), and I can't see any of this in the readme for trdtool. It might be just that it only supports adding regular CODE files or similar.
I wonder if you need to add the spesshul stuff when the basic file is boot.B?
You don't need to tell TR-Dos what line number you want to start it from when you do a SAVE "boot", so I think I might be able to get away with just capitalizing the .B. Will try it.
Last edited by Seven.FFF on Fri Dec 08, 2017 7:39 pm, edited 1 time in total.
Yes, it's probably less relevant in the case of boot.B, the only difference I can think of is when it is loaded with LOAD or LOAD "boot". Otherwise, the default implied command for those is RUN.
Looking at my own loader, the autostart marker is #80 #AA placed after the final #0D at the end of the BASIC program. This is followed by the autostart line number as a little endian WORD (unlike the BASIC format that uses big endian). These four bytes should be saved together with the program data, but not add to the program length that is recorded in the file descriptor.
That '...5616' is just leftovers from executing the BASIC command to save the program, it's only there since the data is saved in chunks of 256 bytes.