========================================================================
       CONSOLE APPLICATION : BootThis
========================================================================

This is a console application used to convert a single OSI binary executable
program into a bootable disk format. 

This is useful when wanting to quickly boot an application not needing an
underlying disk operating system.

The disk format created by BootThis is supported on all OSI systems, but
it is not in OS65D format exactly. The track header is the same but the
track data consists of a normal OSI sector containing The # of pages, a sector 
load address and up to 8*256-3 (5") or 12*256-3 (8") bytes of data.
The generated image will contain a directory track compatible with OS65D, 
unless the space(track) is used by a large loading program.

There are two parts to this program, a 6502 assembler routine and a c++ 
application which generates binary OSI Dump format disk images (.65D) 
in either 8" or 5.25" formats.  This disk format is understood by WinOSI 
emulator and OSIhfe used to create disk images for the HxC/FlashFloppy 
Floppy Disk emulator.

The 6502 program loaded into memory can be located anywhere in the OSI 
address space except zero page which is where the relocated loader is located.

The BootThis disk image uses Track 0 to load a one page loader.  Subsequent 
tracks contain the specified executable, split into 8 or 12 page tracks 
(depending on disk size). The last data track may be shorter than the rest, 
but the OSI will load files padded to the next evenly divisible 256 byte size. 
The last track is used to specify an executable address only, and indicates 
the end of data. This address is stored in the C3 65A monitor 'Go' location,
as well as the C1P Warm Start address.

If an error is encountered during read, the OSI Reset vector is called.

A pseudo 65D directory track is created by default which can contain a boot label
as long as the space required for the executable does not exceed the directory 
track location in length. (~21K for 8"/track8 or ~20K 5.25"/track12) Otherwise there
will be no directory.

Usage: BootThis -[leo58] infile [outfile]
       Create OSI booting disk image from infile
       Infile is expected to be 6502 OSI executable
       -5 create 5.25" disk image
       -8 create 8" disk image
       -lxxxx specify load (target) address in hex for included file
       -exxxx specify execution address in hex for included file
       -n"DiskName" 6 chars per line disk label for OS65D Dir
       -t Write infile as single boot track with no processing of data
       -o overwrite existing output file
 infile contains OSI 6502 program
 outfile is generated based on infile name if it is not specifed.  (infilename.65d)

Example: create a 5.25" disk image using a program named "gameX.bin" which loads in memory at $300 and starts at $E00. The program is in binary format, and the target file is gamex.65d
BootThis -5 -l0300 -e0E00 -n"GAMEX  FOR   OSI" gameX.bin


Building BootThis
The c++ code will compile on Windows/Mac/Linux.
It consists of an embedded 6502 program for the OSI, built from trackload.asm. 
If you change trackload.asm, you need to run the A65 assembler and convert the resulting
binary file into an encapsulated form "trackload.cpp". The hexembed program is used to 
generate this file (also included). On Windows all this can be accomplished by running the trackload.bat file to generate the embedded binary data, and compiling the project with Visual Studio. (VC6 to DevStudio 2019 etc.) On Mac/Linux you will need to compile hexembed and A65, place the executables in the BootThis source folder and execute trackload.sh to build trackload.cpp.   Once this has been done, run make to generate bootthis executable.

Changes/Updates
V1.4 - Correct 65A Go address placement
V1.5 - Correct 2nd page of directory listing
