The Gigatron boot sequence sets up the system variables and starts the video/sound/vCPU loop.
vCPU will then load and run 'Reset'. 'Reset' completes the initialization, such as setting up the video table,
clearing the screen and writing the reset message (the top two lines of text).
Then 'Reset' loads, from ROM, whatever is included as 'Main' and executes that.
The default 'Main' application is a GCL program that handles the user menu. But we can replace it with something else.
If you have a GT1 file, the ROM v3 builder (ROMv3.py) can gobble it up and place it where the ROM loader (SYS_Exec_88) can see it. For this you just add it to the command line as an argument. For example, our GT1 file might be Apps/Sprite.gt1.
So what we do below is substitute Sprite.gt1 as the new 'Main'!
Building a ROM file, without any of the other applications included, but just ours, goes as follows (I'm using bash):
[Edit 2018-12-27: removed some preparation steps.
With a new commit to the repo, these aren't required any longer.]
Code: Select all
bash> python Core/ROMv3.py Main=Apps/Sprite.gt1 Core/Reset_v3.gcl
runVcpu at 014a cycles 100 info line0
runVcpu at 019a cycles 130 info line1-39 typeC
runVcpu at 01a1 cycles 134 info line1-39 typeABD
runVcpu at 01db cycles 126 info line40
runVcpu at 02ec cycles 148 info line41-520 typeBCD
SYS limits low 100 high 148
Including file Apps/TicTac_v1.gtb label TicTacToe ROM 916b
Lines 170
Variables count 0 bytes 0 end 0030
:
Labeling file Apps/Sprite.gt1 label Main ROM 9ec6
Include file Apps/Sprite.gt1 label Sprite ROM 9ec6
Variables count 0 bytes 0 end 0030
:
Compile file Core/Reset_v3.gcl label Reset ROM a112
Segment at 0200 size 250 used 199 unused 51
Segment at 0300 size 250 used 216 unused 34
Variables count 12 bytes 24 end 0048
: Char Pos PrintChar [79] PrintStartupMessage [132] SetupAudio [27]
: SetupChannel [59] SetupVideo [64] Text [51] fontData i p q
Create file ROMv3.asm
Create file ROMv3.rom
OK used 41728 free 23808 size 131072
Rename it, to avoid confusing it with the real ROMv3:
If you burn this in an EPROM, the Gigatron should do this after power on:
https://youtu.be/5gOGm5qRqOs?t=3
(The screen text will be different, as it will have the Reset-message instead of the Loader-message in it.)
It's not a completely clean ROM image, because some data used by now-absent applications is still in there. That's why it says "used 41728" (words). That's mostly the built-in Parrot and Jupiter images that are still there. But it works.
P.S.1: The regular Main is a GCL program that handles the user menu. If you want to add your program to the menu, you'll have to modify that.
P.S.2: When I do something like this, I normally also modify the version number that 'Reset' prints: from 'ROM v3' into something like 'ROM v3x'. And I put all steps in the Makefile for convenience.
P.S.3: Sprite.gt1 is in the repo, but you can rebuild it from Sprite.gcl if you want. The offline GCL compiler can be invoked directly, or by make:
Code: Select all
bash> make Apps/Sprite.gt1
Core/compilegcl.py "Apps/Sprite.gcl" `dirname ./"Apps/Sprite.gt1"`
Compiling file Apps/Sprite.gcl
Segment at 0200 size 250 used 208 unused 42
Segment at 0300 size 250 used 74 unused 176
Variables count 7 bytes 14 end 003e
: FaceLeft [19] FaceRight [18] Image [150] o p u v
Apply patch 5b86
Execute at 5b86
Create file ./Apps/Sprite.gt1
OK size 300