Order lists hold one-byte sequence indices and 0x80 holds a one-byte patch index. Two tables, PatchTable and SequenceTable, are the only places an address lives. THAT IS WHAT MAKES A TUNE LOADABLE WITHOUT WALKING IT. Nothing inside a sequence or an order list is an address, so putting one in memory means adding the load address to two arrays and nothing else. The alternative is a loader that parses every sequence looking for addresses to correct, which is a loader a malformed file can walk off a cliff. Doing it now, while the tune is still assembled in, means the file form and the assembled form are the same shape - so reading a tune from a file will change no engine code at all. The whole point of the rung. The patch each voice starts on moved from four calls in a row into VoiceStart, four declared bytes, and loadStartPatches reads them. A starting instrument is state and belongs where state goes: the user's ruling is that a voice with undefined state is an error, prompted by noticing that a program run a second time starts with the memory the first run left, because loading is what initialises and running is not. Order lists also halved in size, which was not the reason but is welcome. Hand-writing the two tables is exactly the tedium the compiler exists to remove - every sequence counted into its place, and moving one means renumbering. Better to feel that here than after a tool has baked the shape in. Verified by rendering: bar for bar the same piece. break.sh confirms the scaling, since an index is doubled to reach a two-byte entry and halving that step lands on the wrong sequence and fails four checks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
48 lines
1.1 KiB
Plaintext
48 lines
1.1 KiB
Plaintext
CosmOS
|
|
> Say before Sprite
|
|
it says: before Sprite
|
|
finished
|
|
> Sprite
|
|
A ball, over the shell's own words. Nothing underneath is written to. Press a key.
|
|
finished
|
|
> Say after Sprite
|
|
it says: after Sprite
|
|
finished
|
|
> dir
|
|
greet.sbx 211
|
|
hello.sbx 53
|
|
Life.sbx 1396
|
|
Snake.sbx 2164
|
|
Keys.sbx 664
|
|
Say.sbx 156
|
|
Break.sbx 149
|
|
Grid.sbx 571
|
|
Press.sbx 872
|
|
Mode.sbx 48
|
|
Flip.sbx 173
|
|
Sprite.sbx 442
|
|
Depth.sbx 672
|
|
Lander.sbx 9201
|
|
Pad.sbx 264
|
|
Crash.sbx 632
|
|
vars.script 50
|
|
blocks.script 343
|
|
loops.script 272
|
|
tune.sbx 318
|
|
Play.sbx 939
|
|
notes.txt 21
|
|
Apps <dir>
|
|
hi.script 121
|
|
bad.script 45
|
|
plain.script 24
|
|
cross.script 280
|
|
nonl.script 38
|
|
outer.script 376
|
|
inner.script 44
|
|
loop.script 35
|
|
30 files, 1 directory
|
|
> exit
|
|
halted
|
|
Execution halted.
|
|
[exit 0]
|