Finish making the tune a program
The user's conversion, which I reverted while I was working out whether it was half done or broken. It was half done: an sbx application wants its #Include above #Program, because services.asm ends in a #Vectors block and a #Base written after that has no segment to be the base of. So the include moves up, the bases move a page with everything else, and the test starts it from the shell instead of booting it. It plays for 9,469,987 cycles, 9,423,527 of them waiting, which is the same 567 frames of music it played as a boot image. BEING A PROGRAM MEANS ITS VECTOR IS THE SYSTEM'S TO INSTALL. It brings the screen's, so that it has a beat to play to, and CosmOS puts it in when the tune starts and takes it back out when it stops - a thing a boot image never had to have right, and the second program here to exercise the version two format at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
3449405b18
commit
b04e4b7d1c
@@ -35,8 +35,12 @@
|
|||||||
; that the inner loop is two: the note, and letting go of it. That split is what the selector
|
; that the inner loop is two: the note, and letting go of it. That split is what the selector
|
||||||
; and value registers are for - see Making A Noise in the Programming Manual.
|
; and value registers are for - see Making A Noise in the Programming Manual.
|
||||||
|
|
||||||
|
#Include services.asm
|
||||||
|
|
||||||
#Program
|
#Program
|
||||||
|
|
||||||
|
#Base 0x5000
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
|
||||||
; ---- The instrument ----
|
; ---- The instrument ----
|
||||||
@@ -182,7 +186,7 @@ lastRing:
|
|||||||
CIF
|
CIF
|
||||||
RSTA
|
RSTA
|
||||||
OUTA 0x35
|
OUTA 0x35
|
||||||
HALT
|
SWI osExit
|
||||||
|
|
||||||
; Sixty times a second, and it has nothing to do. WAIT only needs something to have happened,
|
; Sixty times a second, and it has nothing to do. WAIT only needs something to have happened,
|
||||||
; and this is the something. A handler still has to exist: an interrupt with nothing installed
|
; and this is the something. A handler still has to exist: an interrupt with nothing installed
|
||||||
@@ -192,6 +196,8 @@ frame:
|
|||||||
|
|
||||||
#Data
|
#Data
|
||||||
|
|
||||||
|
#Base 0x3000
|
||||||
|
|
||||||
; ---- Notes and how long they last ----
|
; ---- Notes and how long they last ----
|
||||||
;
|
;
|
||||||
; Pairs: a MIDI note, then a count of frames. 60 is middle C and every 12 is an octave. A zero
|
; Pairs: a MIDI note, then a count of frames. 60 is middle C and every 12 is an octave. A zero
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -34,7 +35,7 @@ outer.script 376
|
|||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
crossed.txt 560
|
crossed.txt 560
|
||||||
21 files, 1 directory
|
22 files, 1 directory
|
||||||
> exit
|
> exit
|
||||||
halted
|
halted
|
||||||
Execution halted.
|
Execution halted.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -23,7 +24,7 @@ nonl.script 38
|
|||||||
outer.script 376
|
outer.script 376
|
||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
20 files, 1 directory
|
21 files, 1 directory
|
||||||
> drive 1
|
> drive 1
|
||||||
> dir
|
> dir
|
||||||
other.txt 28
|
other.txt 28
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -40,7 +41,7 @@ nonl.script 38
|
|||||||
outer.script 376
|
outer.script 376
|
||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
20 files, 1 directory
|
21 files, 1 directory
|
||||||
> exit
|
> exit
|
||||||
halted
|
halted
|
||||||
Execution halted.
|
Execution halted.
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -30,7 +31,7 @@ nonl.script 38
|
|||||||
outer.script 376
|
outer.script 376
|
||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
20 files, 1 directory
|
21 files, 1 directory
|
||||||
> exit
|
> exit
|
||||||
halted
|
halted
|
||||||
Execution halted.
|
Execution halted.
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -116,7 +117,7 @@ nonl.script 38
|
|||||||
outer.script 376
|
outer.script 376
|
||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
20 files, 1 directory
|
21 files, 1 directory
|
||||||
> exit
|
> exit
|
||||||
halted
|
halted
|
||||||
Execution halted.
|
Execution halted.
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -35,7 +36,7 @@ nonl.script 38
|
|||||||
outer.script 376
|
outer.script 376
|
||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
20 files, 1 directory
|
21 files, 1 directory
|
||||||
> exit
|
> exit
|
||||||
halted
|
halted
|
||||||
Execution halted.
|
Execution halted.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -23,7 +24,7 @@ nonl.script 38
|
|||||||
outer.script 376
|
outer.script 376
|
||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
20 files, 1 directory
|
21 files, 1 directory
|
||||||
> load
|
> load
|
||||||
load what?
|
load what?
|
||||||
> load nosuch.sbx
|
> load nosuch.sbx
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Grid.sbx 559
|
|||||||
Press.sbx 872
|
Press.sbx 872
|
||||||
Mode.sbx 48
|
Mode.sbx 48
|
||||||
Crash.sbx 632
|
Crash.sbx 632
|
||||||
|
tune.sbx 306
|
||||||
notes.txt 21
|
notes.txt 21
|
||||||
Apps <dir>
|
Apps <dir>
|
||||||
hi.script 121
|
hi.script 121
|
||||||
@@ -21,7 +22,7 @@ nonl.script 38
|
|||||||
outer.script 376
|
outer.script 376
|
||||||
inner.script 44
|
inner.script 44
|
||||||
loop.script 35
|
loop.script 35
|
||||||
20 files, 1 directory
|
21 files, 1 directory
|
||||||
> load Say.sbx
|
> load Say.sbx
|
||||||
loaded, starting at 5000
|
loaded, starting at 5000
|
||||||
> run the disk took its time
|
> run the disk took its time
|
||||||
|
|||||||
@@ -1,2 +1,7 @@
|
|||||||
|
CosmOS
|
||||||
|
> tune
|
||||||
|
finished
|
||||||
|
> exit
|
||||||
|
halted
|
||||||
Execution halted.
|
Execution halted.
|
||||||
[exit 0]
|
[exit 0]
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
tune
|
||||||
|
exit
|
||||||
@@ -129,6 +129,12 @@ for i in 1 2 3 4 5 6 7 8; do "$TOOL" put "$DISKS/sbfs.img" "filler$i.txt" >/dev/
|
|||||||
"$ROOT/Assembler" -I "$ROOT/Programs/CosmOS/Source" \
|
"$ROOT/Assembler" -I "$ROOT/Programs/CosmOS/Source" \
|
||||||
"$ROOT/Programs/CosmOS/Apps/Crash.asm" -o "$WORK/Crash.sbx" >/dev/null
|
"$ROOT/Programs/CosmOS/Apps/Crash.asm" -o "$WORK/Crash.sbx" >/dev/null
|
||||||
"$TOOL" put "$DISKS/cosmos.img" "$WORK/Crash.sbx" >/dev/null
|
"$TOOL" put "$DISKS/cosmos.img" "$WORK/Crash.sbx" >/dev/null
|
||||||
|
# tune.sbx, which used to be a boot image and is now a program like any other. It brings a
|
||||||
|
# vector of its own - the screen's, so that it has a beat to play to - which makes it the
|
||||||
|
# second thing here that the version two format exists for.
|
||||||
|
"$ROOT/Assembler" -I "$ROOT/Programs/CosmOS/Source" \
|
||||||
|
"$ROOT/Programs/Examples/tune.asm" -o "$WORK/tune.sbx" >/dev/null
|
||||||
|
"$TOOL" put "$DISKS/cosmos.img" "$WORK/tune.sbx" >/dev/null
|
||||||
printf 'this is not a program' > notes.txt
|
printf 'this is not a program' > notes.txt
|
||||||
"$TOOL" put "$DISKS/cosmos.img" notes.txt >/dev/null
|
"$TOOL" put "$DISKS/cosmos.img" notes.txt >/dev/null
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -61,7 +61,12 @@ picture | Examples/picture.asm | run | -
|
|||||||
# music at 16,667 cycles a frame is 9.45 million, so twelve leaves room to lengthen the tune
|
# music at 16,667 cycles a frame is 9.45 million, so twelve leaves room to lengthen the tune
|
||||||
# without coming back here - and a failure saying "cycle limit reached" means somebody added
|
# without coming back here - and a failure saying "cycle limit reached" means somebody added
|
||||||
# bars, not that anything broke.
|
# bars, not that anything broke.
|
||||||
tune | Examples/tune.asm | run | - | 12000000
|
#
|
||||||
|
# IT IS A PROGRAM NOW rather than a boot image, so the shell starts it and the machine it
|
||||||
|
# plays on is the one somebody would really be sitting at. That also means its vector is
|
||||||
|
# INSTALLED BY THE SYSTEM and taken back out when it stops, which is a thing a boot image
|
||||||
|
# never had to have right.
|
||||||
|
tune | CosmOS/Source/cosmos.asm | run | tune.in | 12000000 | disks/cosmos.img
|
||||||
8bitSieve | Examples/primeSieve/8bitSieve.asm | run | - | -
|
8bitSieve | Examples/primeSieve/8bitSieve.asm | run | - | -
|
||||||
16bitSegmentedSieve | Examples/primeSieve/16bitSieve.asm | run | - | -
|
16bitSegmentedSieve | Examples/primeSieve/16bitSieve.asm | run | - | -
|
||||||
# The four pointer rewrite. It emits exactly the same primes as the line above, which
|
# The four pointer rewrite. It emits exactly the same primes as the line above, which
|
||||||
|
|||||||
Reference in New Issue
Block a user