Compare commits
2 Commits
428029e062
...
a6e6364a7e
Author | SHA1 | Date |
---|---|---|
Nico | a6e6364a7e | |
Nico | 84deaea3d2 |
|
@ -0,0 +1,7 @@
|
|||
all: player.rom run
|
||||
|
||||
player.rom: player.tal engine.tal
|
||||
uxnasm player.tal player.rom
|
||||
|
||||
run: player.rom
|
||||
uxnemu player.rom
|
17
engine.tal
17
engine.tal
|
@ -1,5 +1,4 @@
|
|||
( TODO
|
||||
multiple channels
|
||||
commmands )
|
||||
|
||||
@k-tick
|
||||
|
@ -11,13 +10,16 @@ commmands )
|
|||
&play
|
||||
POP
|
||||
#ff .kalama/tick STZ
|
||||
.kalama/line LDZ #01 ADD STHk ( line )
|
||||
#00 SWP #0003 MUL2 ( lineaddr* )
|
||||
.kalama/songpos LDZ2 DUP2 ( songpos* songpos* lineaddr* )
|
||||
.kalama/line LDZ #01 ADD STHk ( rst: line )
|
||||
#00 SWP #0003 MUL2 ;&lineaddr STA2 ( store line address offset )
|
||||
.kalama/songpos LDZ2 DUP2 ( songpos* songpos )
|
||||
( don't play if song pos is ffff aka song is stopped or over )
|
||||
#ffff EQU2 ,&no-play JCN ( songpos* lineaddr* )
|
||||
#0005 ADD2 .kalama/module LDZ2 ADD2 ( songposinmod* lineaddr* )
|
||||
LDA ( -- pattern1 lineaddr* ) ;k-get-pattern/run JSR2 ADD2 #00 ;k-play-line/run JSR2 ( -- )
|
||||
#ffff EQU2 ;&no-play JCN2 ( songpos* )
|
||||
#0005 ADD2 .kalama/module LDZ2 ADD2 ( songposinmod* )
|
||||
DUP2 LDA ;k-get-pattern/run JSR2 ;&lineaddr LDA2 ADD2 #00 ;k-play-line/run JSR2
|
||||
DUP2 #0001 ADD2 LDA ;k-get-pattern/run JSR2 ;&lineaddr LDA2 ADD2 #01 ;k-play-line/run JSR2
|
||||
DUP2 #0002 ADD2 LDA ;k-get-pattern/run JSR2 ;&lineaddr LDA2 ADD2 #02 ;k-play-line/run JSR2
|
||||
#0003 ADD2 LDA ;k-get-pattern/run JSR2 ;&lineaddr LDA2 ADD2 #03 ;k-play-line/run JSR2
|
||||
STHrk #0f EQU ,&next JCN
|
||||
STHr .kalama/line STZ
|
||||
RTN
|
||||
|
@ -38,6 +40,7 @@ RTN
|
|||
&no-play
|
||||
POP2 POP2 POPr
|
||||
RTN
|
||||
&lineaddr $2
|
||||
|
||||
( initialises kalama with module data )
|
||||
@k-init-module ( addr* -- )
|
||||
|
|
|
@ -49,11 +49,11 @@ a song row is 4 bytes. Each byte is a pattern number, with the first byte being
|
|||
|
||||
Patterns contain 0x10 lines of note data. Patterns are ordered sequentially in the file and there can be up to 255 patterns in a file.
|
||||
|
||||
A pattern line consists of 3 bytes. The first byte contains a note ( up to 0x7f ) and the next two bytes contain an effect and a parameter for that effect. No note is represented by the byte 00. 0xff represents a note off/note stop. No effect is also represented by 00.
|
||||
A pattern line consists of 3 bytes. The first byte contains a note ( up to 0x7f ) and the next two bytes contain a command and a parameter for that effect. No note is represented by the byte 00. 0xff represents a note off/note stop. No effect is also represented by 00.
|
||||
|
||||
### Effects
|
||||
### Commands
|
||||
|
||||
(what an effect should be drawn as in an editor is in parenthesis)
|
||||
(what an command should be drawn as in an editor is in parenthesis)
|
||||
|
||||
More soon probably
|
||||
|
||||
|
@ -64,7 +64,7 @@ More soon probably
|
|||
* 0x05 (S) - set sustain to argument (1-0f)
|
||||
* 0x06 (R) - set release to argument (1-0f)
|
||||
* 0x07 (T) - set song speed to argument (1-0f)
|
||||
|
||||
* 0x08 (L) - set sample loop ( 00: off, otherwise: on )
|
||||
## Instruments
|
||||
|
||||
Instruments contain a sample and some default parameters for that sample. Everything is in the same format expected by the audio device.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
( a blank file )
|
||||
|
||||
%DEBUG { ;print-hex/byte JSR2 #0a18 DEO }
|
||||
|
@ -149,7 +150,7 @@ ff 00 00
|
|||
@DEBUG-instruments
|
||||
( instrument 00 )
|
||||
0002 ( sample length )
|
||||
ff ( volume )
|
||||
88 ( volume )
|
||||
80 ( flags - loop sample )
|
||||
0060 ( ADSR )
|
||||
ff 00 ( square wave sample data )
|
||||
|
|
Reference in New Issue