The BJL-Loader

1) Transferdatawidth This can be either 4bit or 8bit.
See the Hints for the Programmer.
2) Transfertype Magic word This can be either
22071970 for a program being transferred or
20102001 for raw data.
These 8 digits are actually a HEX-view of a 4byte value. During an upload this value should keep stable, else the transfer is faulty.
3) Copyright notice This gives you an indication which version of the BJL-loader you run. For instance only the 2005-version outputs the Load-/Startaddress (see 5))
4) Statusmessage 2005-version:
After a transfer of raw data this text will change to "Data received! Waiting for upload ...".
5) Load-/Startaddress As soon as a valid Transfertype Magic word is recognized the BJL-loader will output the detected Load-/Startaddress here (this is also a HEX-view of a 4byte-value).
As long as no data-stream is incoming at Port2 of the Jauar-console the BJL-Loader screen stays stable:
But as soon as a valid data-stream is incoming the background-colour of the small text-screen will start to flicker (in older versions of the BJL-Loader the Text-foreground colour was also flickering):

Hints for the user

You can upload several files of raw data, the BJL-loader will stay active after each data-upload, but after a successfull program-upload the received program will be started immediately!
Examples:

If you want to upload an executable program use a DOS-commandline following this example:
BJL_LOAD -n -8 -b 0x10000 test.bin

If you want to upload raw data (like a picture) use a DOS-commandline following this example:
BJL_LOAD -n -8 -d -b 0x180000 greenpic.rgb

Please note that if the data-file contains a header with a load-address (like files of type ABS,COF or JAG do) the -b-commandlineparameter will be ignored!


All possible commandlineparametrs of BJL_LOAD.EXE

BJL Loader for PC from Mar 31 2005
usage: loader [-s skipbytes][-w wait][-b baseaddr][-p lptbase][-n][-8][-h size][-d] <filename>
   skipbytes is # bytes in header to skip.      default = 0
   baseaddr is addr to upload to.               default = 0x00004000
   lptbase specifies base addr of LPT port.     default = 0x378
   wait - counter between longs.                default = 2
   -n => don`t send switch-command
   -8 => use 8Bit transmission (4Bit is default)
   -h => Print # bytes to go every size bytes.  default = 0 == off
   -d => Data upload, loader restarts
	

Hints for the programmer

The BJL-Loader is provided as a single file called LOADER.BIN which can be incorporated into your own Jaguar-projects. It consists of a 68000-part and a GPU-part, the 68000-part does a basic initialization, sets up the screen and installs the GPU-part (which handles the data-transfer) depending on a switch for the Transferdatawidth.

The Transferdatawidth-switch is a RAM-location outside of LOADER.BIN and your own project, it is the 4byte-value at address $8 which has to be set before the BJL-loader is called.

4byte value at $8 is The BJL-loader will use the
<>0 4bit-transfer
0 8bit-transfer

How to incorporate the BJL-Loader into your project:

        .68000
        .TEXT
    .
    ; Shut down your own application (IRQs, DSP and GPU)
    .
    .
    ; Move the INCBINed BJL-loader to a suitable location in the Jaguar's RAM
    lea     BJLLoader,a0
    lea     $1fc000,a1    ; You can move the BJL-loader to any (even) RAM-location,
                          ; the code is PC-relative!
    move.w  #(BJLLoaderEnd-BJLLoader)>>2,d0
.1:
    move.l  (a0)+,(a1)+
    dbra    d0,.1
    ; Let the BJL-Loader use the 8bit-transfer:
    clr.l   $8
    ; And now start the BJL-Loader:
    jmp     $1fc000
    .
    .
        .DATA
    .
    even
BJLLoader:  
    incbin  "loader.bin"
BJLLoaderEnd:
    .
    .