2022-01-09 14:03:44 +00:00
|
|
|
( a blank file )
|
|
|
|
|
|
|
|
%DEBUG { ;print-hex/byte JSR2 #0a18 DEO }
|
|
|
|
%DEBUG2 { ;print-hex JSR2 #0a18 DEO }
|
|
|
|
%RTN { JMP2r }
|
2022-01-09 16:38:36 +00:00
|
|
|
%10/ { #04 SFT }
|
2022-01-09 14:03:44 +00:00
|
|
|
|
|
|
|
( devices )
|
|
|
|
|
|
|
|
|00 @System &vector $2 &wst $1 &rst $1 &eaddr $2 &ecode $1 &pad $1 &r $2 &g $2 &b $2 &debug $1 &halt $1
|
|
|
|
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
|
|
|
|
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|
|
|
|
|30 @Audio0 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1
|
|
|
|
|40 @Audio1 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1
|
|
|
|
|50 @Audio2 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1
|
|
|
|
|60 @Audio3 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1
|
|
|
|
|80 @Controller &vector $2 &button $1 &key $1 &func $1
|
|
|
|
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2
|
|
|
|
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|
|
|
|
|b0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
|
|
|
|
|
|
|
|
( variables )
|
|
|
|
|
|
|
|
|0000
|
|
|
|
|
|
|
|
@kalama
|
|
|
|
&module $2 ( pointer to start of module file )
|
2022-01-09 16:38:36 +00:00
|
|
|
&loopflags $1 ( if different channels are set to loop )
|
2022-01-09 17:28:15 +00:00
|
|
|
&instruments $2 ( address that instruments start at )
|
2022-01-10 08:14:13 +00:00
|
|
|
&tick $1
|
|
|
|
&line $1
|
|
|
|
&speed $1
|
2022-01-10 21:30:34 +00:00
|
|
|
&songpos $2 ( position in song table )
|
2022-01-09 14:03:44 +00:00
|
|
|
|
|
|
|
( program )
|
|
|
|
|
|
|
|
|0100 ( -> )
|
|
|
|
|
|
|
|
#0fe5 .System/r DEO2
|
|
|
|
#0fc5 .System/g DEO2
|
|
|
|
#0f25 .System/b DEO2
|
|
|
|
|
2022-01-10 08:14:13 +00:00
|
|
|
;module ;k-init-module JSR2
|
2022-01-09 16:38:36 +00:00
|
|
|
|
2022-01-10 08:14:13 +00:00
|
|
|
#00 #00 ;k-load-instrument JSR2
|
|
|
|
|
2022-01-09 14:03:44 +00:00
|
|
|
;on-frame/run .Screen/vector DEO2
|
|
|
|
BRK
|
|
|
|
|
|
|
|
@on-frame ( -> )
|
|
|
|
&run
|
2022-01-10 08:14:13 +00:00
|
|
|
;k-tick/run JSR2
|
2022-01-09 14:03:44 +00:00
|
|
|
BRK
|
|
|
|
|
2022-01-09 16:38:36 +00:00
|
|
|
|
2022-01-09 14:03:44 +00:00
|
|
|
@print-hex ( value* -- )
|
|
|
|
|
|
|
|
SWP ,&byte JSR
|
|
|
|
&byte ( byte -- )
|
|
|
|
STHk #04 SFT ,&parse JSR #18 DEO
|
|
|
|
STHr #0f AND ,&parse JSR #18 DEO
|
|
|
|
RTN
|
|
|
|
&parse ( byte -- char ) DUP #09 GTH ,&above JCN #30 ADD RTN
|
|
|
|
&above #57 ADD RTN
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@print-dec ( value* -- )
|
|
|
|
|
|
|
|
#2710 DIV2k DUP #30 ADD #18 DEO MUL2 SUB2
|
|
|
|
#03e8 DIV2k DUP #30 ADD #18 DEO MUL2 SUB2
|
|
|
|
#0064 DIV2k DUP #30 ADD #18 DEO MUL2 SUB2
|
|
|
|
#000a DIV2k DUP #30 ADD #18 DEO MUL2 SUB2
|
|
|
|
#30 ADD #18 DEO POP
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@print-str ( string* -- )
|
|
|
|
|
|
|
|
#0001 SUB2
|
|
|
|
&while
|
|
|
|
INC2 LDAk DUP #18 DEO ,&while JCN
|
|
|
|
POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2022-01-10 08:18:54 +00:00
|
|
|
~engine.tal
|
|
|
|
|
2022-01-09 14:03:44 +00:00
|
|
|
@module
|
2022-01-10 21:30:34 +00:00
|
|
|
8f 02 02 ( file header - speed 8, loop on, 2 patterns, 2 instruments )
|
2022-01-09 14:03:44 +00:00
|
|
|
0008 ( size )
|
2022-01-10 23:41:14 +00:00
|
|
|
00 ff ff ff
|
|
|
|
01 ff ff ff ( song table, 2 rows )
|
2022-01-13 20:59:06 +00:00
|
|
|
@DEBUG-patterns
|
2022-01-09 14:03:44 +00:00
|
|
|
( pattern 00 )
|
2022-01-10 21:30:34 +00:00
|
|
|
54 02 00 ( C-3 I00 )
|
|
|
|
52 00 00
|
|
|
|
54 00 00
|
|
|
|
4f 00 00
|
|
|
|
4b 00 00
|
|
|
|
4f 00 00
|
|
|
|
48 00 00
|
|
|
|
ff 00 00
|
|
|
|
54 02 00
|
|
|
|
52 00 00
|
|
|
|
54 00 00
|
|
|
|
4f 00 00
|
|
|
|
4b 00 00
|
|
|
|
4f 00 00
|
|
|
|
48 00 00
|
2022-01-10 08:14:13 +00:00
|
|
|
ff 00 00
|
2022-01-09 14:03:44 +00:00
|
|
|
( pattern 01 )
|
2022-01-10 23:41:14 +00:00
|
|
|
54 00 00
|
|
|
|
56 02 00 ( C-3 I00 )
|
|
|
|
57 00 00
|
|
|
|
56 00 00
|
|
|
|
57 00 00
|
|
|
|
54 00 00
|
|
|
|
56 00 00
|
|
|
|
54 00 00
|
|
|
|
56 00 00
|
|
|
|
52 00 00
|
|
|
|
54 00 00
|
|
|
|
52 00 00
|
|
|
|
54 00 00
|
|
|
|
50 00 00
|
|
|
|
54 00 00
|
2022-01-10 08:14:13 +00:00
|
|
|
ff 00 00
|
2022-01-13 20:59:06 +00:00
|
|
|
@DEBUG-instruments
|
2022-01-09 14:03:44 +00:00
|
|
|
( instrument 00 )
|
|
|
|
0002 ( sample length )
|
|
|
|
ff ( volume )
|
|
|
|
80 ( flags - loop sample )
|
2022-01-13 22:19:32 +00:00
|
|
|
50f0 ( ADSR )
|
2022-01-09 14:03:44 +00:00
|
|
|
ff 00 ( square wave sample data )
|
|
|
|
( instrument 01, unused )
|
|
|
|
0008 ( sample length )
|
|
|
|
60 ( volume )
|
|
|
|
00 ( flags - no loop )
|
2022-01-09 16:38:36 +00:00
|
|
|
10f0 ( ADSR )
|
2022-01-09 14:03:44 +00:00
|
|
|
ff de 21 32 fa 43 aa 04 ( 8 random bytes )
|