Home » Archimedes archive » Archimedes World » AW-1991-05.adf » May91 » !AWMay91/Goodies/Coconizer/Tools/Player

!AWMay91/Goodies/Coconizer/Tools/Player

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1991-05.adf » May91
Filename: !AWMay91/Goodies/Coconizer/Tools/Player
Read OK:
File size: 551A bytes
Load address: 0000
Exec address: 0000
File contents
� >Tools.Player
D� ... Alter your last " ]:NEXT p " into  " ]:PROC_Music:NEXT p "
D� And instead of calling your Code, just do the following lines:
(
2end%=Track+pointer
</�''"Start at : &";~code,"End at  : &";~end%
F3�  "Total len: ";end%-code,"Song len: ";pointer
P
Z�'"Save name? "a$
d'� "*Save "+a$+" "+�~code+" "+�~end%
n � "*Settype "+a$+" Absolute"
x�
�
�M-------------------------------------------------------------------------
�
� �_Music
�� p=%1000 �
�4  *RMEnsure Packit 1.50 RMLoad !Coconizer.Packit
�  maxinst=32
�F  � nam$(2002),byt%(2002),loc$(2002),sort%(maxinst),sort$(maxinst)
�  sort$(2)="�"
�  top%=0
�  f%=� "location"
�8  � f%=0 � �'"PLEASE INSERT A SONG DISC":a$=�:� �d\@
�  ȕ � �#f%
�?    top%+=1:nam$(top%)=�#f%:�#f%,byt%(top%):loc$(top%)=�#f%
  �

  �#f%

"H  �'"Please enter song path [SONGS]: "path$:� path$="" path$="songs"
,  � "Cat "+path$
6   �'"Coconizer songfile? "a$
@  a$=path$+"."+a$
J
  f%=� a$
T5  b1=�#f%:b2=�#f%:b3=�#f%:b4=�#f%:b5=�#f%:b6=�#f%
^
  �#f%
h9  � b4=0 � b5>0 � Vocs=b6 � Vocs=b1     :� packed...?
r
|  �_MusicASM
�>  A%=code:B%=Track-1:� Track                  :� Initstore
�?  A%=ufin:B%=L%-1   :� Track                  :� really ALL
�  �
��
�  �_MusicASM
��
�
�� *** LOAD INSTRUMENTS ***
�
��"Channels: ";Vocs
�� b4=0 � b5>0 �
�"  � "PackLoad "+a$+" "+�~Track
��
  � "Load "+a$+" "+�~Track
�

&D� i%=0 � 9*12-1          :� From internat. Octave -3 to Octave 5
0Jn%=i% +4*12                 :� Correct it, as 'Steinway' +0 = Middle C
:4f%=440*(2^((n%-46)/12))     :� Frequency formula
DGFtable!(i%*4)=(f%/(1000000/us))*65536 :� 16bit fixpointed increment
N� i%
X
b�'"NAME: ";$(Track+1);
l;� �46);"Sequencies: ";Track?22;"  Patterns: ";Track?23'
v
�Ipointer=Track!32                                 :� SampleData Offset
�� i%=1 � Track?21
�  Track!(i%*32+ 0)=pointer
�  len=Track!(i%*32+ 4)
�  vol=Track!(i%*32+ 8)
�  rat=Track!(i%*32+12)
�  ren=Track!(i%*32+16)
�  na$=$(Track+i%*32+20)
�0  � �(96+i%);" : ";na$;�18);vol,rat,ren,len;
�[  � j%=1 � top%:� na$<>nam$(j%) � �:�'" -> "na$:$(Track+i%*32+20)=na$:� �30,�8);:� �dZB
�  � " (";byt%(j%);")";
�>  � len>byt%(j%) � len=byt%(j%):Track!(i%*32+4)=len:� "*";
�  � ,(�loc$(j%)-65) � 2 +1
%  sort$(i%)=loc$(j%):sort%(i%)=i%
  pointer+=len+gap
a  � Track+pointer>=L% � �,"More than "+�pointer+" bytes sample data: Assembler limit reached"
 � i%
*�
4
>�
H
  flag%=0
R  � i%=1 � Track?21-1
\[    � sort$(i%)>sort$(i%+1) � Ȕ sort$(i%),sort$(i%+1):Ȕ sort%(i%),sort%(i%+1):flag%=1
f
  � i%
p
� flag%=0
z
�� i%=1 � Track?21
�  s=sort%(i%)
�D  na$=$(Track+s*32+20):adr=Track+Track!(s*32):len=Track!(s*32+4)
�"  fu$="Inst"+sort$(i%)+"."+na$
�
  f=� fu$
�  � f �
�    � na$;", ";
�    $(adr+len)=�gap-1,�0)
�$    ș "OS_GBPB",4,f,adr,len:�#f
�  �
�#    disc=(�sort$(i%)-65) � 2 +1
�3    �'�7;"PLEASE INSERT SAMPLE DISC ";disc:a$=�
�    � �tlC
  �
� i%
�
$
.� �_MusicASM
8
gap=16
B
us =48
L
[OPT p
V
`(;-----------------------------------
j;
t'; THE COCONIZER PLAYER ROUTINE v1.3
~;
�%;   Needs 20% of the ARM-II speed
�;
�;         (c) Mai 1990 by
�$;    Eduard Pfarr & Thomas Alber
�;           of Playfield
�;
�%;   Latest revision - 20 Feb 1991
�;
�(;-----------------------------------
�
�	.v_on
� mov   r12,r14
% mov   r0,#2                ;Ƞ 2

E mov   r1,#208              ;BufferLen of �E channel, total *Vocs
. mov   r2,#us               ;Sample Period
7 mov   r3,#0                ;Default ChannelHandler
(1 mov   r4,#0                ;Default Sheduler
2 swi   "Sound_Configure"
<H mov   r0,#Vocs             ;Ƞ 8 with params doesn't work directly!
FI mov   r1,#0                ;Because then sample rate is set false...
P mov   r2,#0
Z mov   r3,#0
d mov   r4,#0
n swi   "Sound_Configure"
x
� adr   r0,VoiceBase
�K mov   r1,#0                     ;Install our Voice into next free Slot
� swi   "Sound_InstallVoice"
�5 str   r1,Vslot                  ;store used slot
�# adr   r2,Vstereos-4*4*(Vocs=8)
�
� mov   r0,#1
�.vimage
� ldr   r1,[r2],#4
�/ swi   "Sound_Stereo"            ;*Ȣ r0 r1
� add   r0,r0,#1
� cmp   r0,#Vocs
� bLs   vimage

 mov   r0,#Vocs
	.vset
" adr   r1,Vname
,; swi   "Sound_AttachNamedVoice"  ;*CHANNELVOICE r0 "r1"
6 mov   r1,#&170
@; mov   r2,#50               ;Activate all channels once
J mov   r3,#255
T/ swi   "Sound_Control"      ;*� r0 r1 r2 r3
^ subS  r0,r0,#1
h bNe   vset
r
| bl    vabsolut
� bl    v_reset
�< mov   r0,#16               ;Claim EVENT Vector (Nr. 16)
� �adr (1,vinter)
�; adr   r2,Head              ;Entry WorkspacePointer r12
� swi   "OS_Claim"
�4 mov   r0,#14               ;Enable Event Nr. r1
�2 mov   r1,#4                ;(4 = VSync Event)
� swi   "OS_Byte"
�
�1 mov   r0,#Vocs             ;And once more...
� mov   r1,#0
� mov   r2,#0
� mov   r3,#0
 mov   r4,#0
' swi   "Sound_Configure"    ;Grrrh!

&4 mov   r0,#0                ;Read current Volume
0 swi   "Sound_Volume"
:# mov   r0,r0,lsl#1          ;*2
D rsb   r0,r0,#254
N= str   r0,Volume            ;and use it as overall Volume
X mov   pc,r12
b
l;*** �OLUTE CODE
v
�
.vabsolut
� �adr (10,Track)
�
�0 ldr   r1,[r10,#24]         ;Sequence Offset
� add   r1,r10,r1
� str   r1,[r10,#24]
�/ ldr   r2,[r10,#28]         ;Pattern Offset
� add   r2,r10,r2
� str   r2,[r10,#28]
�
�0 ldrB  r1,[r10,#21]         ;Number of Insts
�	.vall
�1 ldr   r2,[r10,r1,lsl#5]    ;Inst Addr Offset
 add   r2,r10,r2
& str   r2,[r10,r1,lsl#5]    ;+i*32
 subS  r1,r1,#1
  bNe   vall
*
46 ldr   r0,[pc]              ;Do not call relocater
>- str   r0,vabsolut          ;two times...
H mov   pc,r14
R
\;*** RESTART TUNE
f
p.v_reset
z �adr (10,Track)
� mov   r1,#64
�+ str   r1,Registers+0       ;Patt Count
� ldr   r2,[r10,#24]
�9 str   r2,Registers+8       ;Current Sequence Pointer
� ldrB  r2,[r2]
� ldr   r3,[r10,#28]
�# add   r3,r3,r2,lsl#10-(Vocs=8)
�8 str   r3,Registers+4       ;Current Pattern Pointer
�
� adr   r11,Head
�. mov   r1,#0:mov r2,#0:mov r3,#0:mov r4,#0
�. mov   r5,#0:mov r6,#0:mov r7,#0:mov r8,#0
� mov   r0,#Vocs
		.vall
	; stmia r11!,{r1-r8}         ;Clear all channel heads...
	 subS  r0,r0,#1
	$ bNe   vall
	. mov   pc,r14
	8
	B ;*** TURN � PLAYER � COCO-ȡ
	L
	V
.v_off
	`5 mov   r0,#13               ;Disable Event Nr. r1
	j2 mov   r1,#4                ;(4 = VSync Event)
	t swi   "OS_Byte"
	~; mov   r0,#16               ;Free EVENT Vector (Nr. 16)
	� adr   r1,vinter
	� adr   r2,Head
	� swi   "OS_Release"
	�
	� ldr   r1,Vslot
	�E swi   "Sound_RemoveVoice"  ;Last but not least... Free VoiceSlot
	� mov   r0,#1
	� mov   r1,#1
	�, swi   "Sound_AttachVoice"  ;Reinit Bell
	� mov   pc,r14
	�
	�
.Vstereos
2 dcd -50      ;Stereo Positions for 4 channels

 dcd -20
 dcd  20
 dcd  50
(
22 dcd-126      ;Stereo Positions for 8 channels
< dcd -90
F dcd -54
P dcd -18
Z dcd  18
d dcd  54
n dcd  90
x dcd 126
�
�.Vslot dcd 0
�
�H;==== șTEM � ======================================================
�
�@; r6 Neg. if new Handler    r10 Pointer to end of DMA buffer
�M; r7 Channel number         r11 Increment (interleaf) to use when writing
�M; r8 Sample period in us    r12 Pointer to (start of DMA + interleaf Ofs)
�M; r9 Pointer to SCCB        Filler is entered in IRQ mode & Ints enabled!
�
�.VoiceBase
�? b     vfill                ;Fill         for smooth adjust
�? b     vfill                ;Update       for tone continue
: b     vfill                ;GateOn       for new tone
? ldmfd r13!,{pc}            ;GateOff      for tone flushing
H ldmfd r13!,{pc}            ;Instantiate,   Attach    VoiceGenerator
"J ldmfd r13!,{pc}            ;DeInstantiate, Detach   to/from a channel
,. ldmfd r13!,{pc}            ;Hello Arthur!
6> dcd   Vname-VoiceBase      ;Offset from VoiceBase to Name
@.Vname dcb "Cocoplex"+�0
J
 align
T
^
.vfill
hC teqP  pc,#(1<<27) � %10   ;Disable IRQ, no more Loser filling!
r= adr   r8,Head              ;We use an own Controll_Block
|4 add   r8,r8,r7,lsl#5       ;point to Head+r7*32
�9 ldmIa r8,{r1-r6}           ;Load 6 working Registers
� ldr   r0,Volume
�E add   r5,r5,r0             ;Add Overall_Volume to Channel_Volume
�
�
.vfilloop
�H]:� n=1 � gap:[OPT p     ;Fill one byte 16 times, for 208 -> 13 runs
�C ldrB  r0,[r3,r1,lsr#16]    ;Load sample byte (HighWord of Pos)
�H subS  r0,r0,r5             ;Minus Volume (where 0=loud & 255=quiet)
� movMi r0,#0
�< strB  r0,[r12],r11         ;And put it into VIDC-buffer
�6 add   r1,r1,r2             ;Add Pitch (fix point)
�]:�:[OPT p
�
H cmp   r4,r1,lsr#16         ;Length exceeded? (Len < fixpointed Pos)
: movLs r1,r6                ;Yes, so RepAt is new Pos,
4 cmp   r1,#0                ;    but is it zero?
&L movEq r2,#0                ;    yes -> Mute Channel (ie Set Pitch to 0)
0< cmp   r12,r10              ;VIDC-Buffer filled already?
:( bLo   vfilloop             ;Nooo...
DF stmIa r8,{r1-r2}           ;Save the two (probably) modified regs
N
XB mov   r0,#%00001000        ;And return with Voice_Active_Flag
b1 teqP  pc,#(0<<27) � %10   ;Enable IRQ again!
l ldmfd r13!,{pc}
v
�	.Head
�K dcd 0                      ;r1 Pos in the sample (Offset in fix point)
�J dcd 0                      ;r2 Increment/Pitch (LowWord for fixpoint)
�1 dcd 0                      ;r3 Sample Adress
�* dcd 0                      ;r4 Length
�A dcd 0                      ;r5 Volume (0=Loud ... 255=Quiet)
�M dcd 0                      ;r6 RepAt (New fixpoint Pos), or 0 for NO REP
�B dcd 0                      ;Byte +24 Value for Auto Volume up
�D                            ;      25   "    "   "   Volume down
�A                            ;      26   "    "   "   Pitch up
�C                            ;      27   "    "   "   Pitch down
�: dcd 0                      ;Byte +28 Actual Info Byte
�:                            ;      29 Actual Comm Byte

9                            ;      30 (Sound FX Flag)

>                            ;      31 Last legal tone/note



 5 dcb �3*32-4*32*(Vocs=8),�0)    ;Add 3 or 7 Heads

*

45.Volume       dcd 0         ;Overall_Sound_Volume

>

HM;==== PLAY EVENT ========================================================

R 

\=;*** DO EVERY VSYNC EFFECTS (#r0=Timer ... $r0=preserved)

f

p
.veffects

z3 ldr   r4,[r12,#4]          ;Load current Pitch

�J cmp   r4,#0                ;No active tone -> sorry, effect disabled!

� movEq pc,r14

�2 ldr   r3,[r12,#24]         ;Load Auto-Effects

�) mov   r10,r14              ;Push r14

�9 andS  r2,r3,#&ff           ;Is there Auto Volume up?

� blNe  v_volup

�; andS  r2,r3,#&ff <<8       ;Is there Auto Volume down?

� movNe r2,r2,lsr#8

� blNe  v_voldown

�8 andS  r2,r3,#&ff <<16      ;Is there Auto Pitch up?

� movNe r2,r2,lsr#16

� blNe  v_arcup

�: andS  r2,r3,#&ff <<24      ;Is there Auto Pitch down?
 movNe r2,r2,lsr#24
 blNe  v_arcdown
) mov   r14,r10              ;Pop  r14
$
.K ldr   r1,[r12,#28]         ;Effect LWord & Last Tone are in the Header
81 andS  r2,r1,#&ff           ;Isolate InfoByte
BE movEq pc,r14               ;if 0, then there's no effect at all!
L6 and   r3,r1,#&ff00         ;Isolate Effect number
VM ldr   r3,[pc,r3,lsr#6]     ;lsr#8 for effect into lowbyte & lsl#2 for *4
` add   pc,pc,r3
j
t. dcd   v_arpeggio-vof1      ; 0 = Arpeggio
~	.vof1
�F dcd   v_slideup-vof1       ; 1 = Slide Pitch up   (till Amis Max)
�F dcd   v_slidedown-vof1     ; 2 = Slide Pitch down (till Amis Min)
�/ dcd   v_volup-vof1         ; 3 = Volume up
�1 dcd   v_voldown-vof1       ; 4 = Volume down
�8 dcd   v_arcup-vof1         ; 5 = Slide Arc Pitch up
�: dcd   v_arcdown-vof1       ; 6 = Slide Arc Pitch down
�
�.v_arpeggio
�B mov   r1,r1,lsr#24         ;Get last stored Tone into lowbyte
�* cmp   r0,#1                ;Time=1 or
�' cmpNe r0,#4                ;Time=4
�F addEq r1,r1,r2,lsr#4       ; ...then add  left InfoNibble to Note
* cmp   r0,#2                ;Time=2 or

' cmpNe r0,#5                ;Time=5
F andEq r2,r2,#&0f           ; ...then add right InfoNibble to Note
 addEq r1,r1,r2
(I ldr   r1,[r11,r1,lsl#2]    ;Get equivalent Frequency from r11=fTable
2, str   r1,[r12,#4]          ;Enter Pitch
< mov   pc,r14
F
P.v_slideup
Z2 add   r1,r4,r2,lsl#6       ; Freq+InfoByte*64
dD cmp   r1,#&18800           ;Min Per = &071, ie OutPutF < &184DA
n strLt r1,[r12,#4]
x mov   pc,r14
�.v_slidedown
�2 sub   r1,r4,r2,lsl#6       ; Freq-InfoByte*64
�D cmp   r1,#&3340            ;Max Per = &358, ie OutPutF > & 3355
� strGt r1,[r12,#4]
� mov   pc,r14
�
�.v_volup
�J cmp   r0,#1                ;Only each first v_interrupt for slow down
� movNe pc,r14
�8 ldr   r1,[r12,#16]         ;There is current Volume
� subS  r1,r1,r2
�J strPl r1,[r12,#16]         ;If not > 0  (Max Vol), then write it back
� mov   pc,r14
.v_voldown
 cmp   r0,#1
 movNe pc,r14
" ldr   r1,[r12,#16]
, add   r1,r1,r2
6 cmp   r1,#255
@J strLs r1,[r12,#16]         ;If not <255 (Min Vol), then write it back
J mov   pc,r14
T
^.v_arcup
hE addS  r1,r4,r2,lsl#4       ;Pitch+InfoByte*16 (for slow sliding)
r strPl r1,[r12,#4]
| mov   pc,r14
�.v_arcdown
�E subS  r1,r4,r2,lsl#4       ;Pitch-InfoByte*16 (for slow sliding)
� strPl r1,[r12,#4]
� mov   pc,r14
�
�;*** ENTRY ȒS � GAME � FX
�
�.fx1
� adr   r12,Head+0*32
� b     fx4+4
�.fx2
� adr   r12,Head+1*32
� b     fx4+4
.fx3
 adr   r12,Head+2*32
 b     fx4+4
&.fx4
0 adr   r12,Head+3*32
: mov   r0,#1
D1 strB  r0,[r12,#30]         ;Set SoundFX flag
N adr   r10,Track
X adr   r11,Ftable
b b     vrule
l
vF;*** �ERRUPT ENTRY Ȓ (#r0=Event No, r12=Workspace [here HeadAdr])
�
�.vinter
�L stmfd r13!,{r1-r11}        ;For not intercepting vector -> push r14 too
�
�L adr   r11,Ftable           ;r11 & r12 pointers are needed in both cases
�
�5 ldmDb r11,{r0,r1}          ;Load Counter & Speed
�) add   r0,r0,#1             ;Counter+
�5 cmp   r0,r1                ;If >= Speed, then...
�M movHs r0,#0                ;      reset Counter    | HS, cause Set_Speed
�C str   r0,[r11,#-8]         ;                       | could set
�L bHs   vplay                ;    & Play one row!    | Speed < Counter...
�
? bl    veffects             ;Well, else support the effects
 add   r12,r12,#32
# bl    veffects             ;2.
  add   r12,r12,#32
*# bl    veffects             ;3.
4 add   r12,r12,#32
># bl    veffects             ;4.
H]
R� Vocs=8 �
\
[OPT p
f add   r12,r12,#32
p# bl    veffects             ;5.
z add   r12,r12,#32
�# bl    veffects             ;6.
� add   r12,r12,#32
�# bl    veffects             ;7.
� add   r12,r12,#32
�# bl    veffects             ;8.
�]
��
�
[OPT p
�' ldmfd r13!,{r1-r11,pc}     ;Return
� 
�4;*** PLAY �E PATTERN-POSITION (ALL 4/8 CHANNELS)
�
�
.vplay
 adr   r6,Registers
9 ldmIa r6,{r7-r9}           ;Load 3 working registers
 adr   r10,Track
$
.# bl    vchannel             ;1.
8 add   r12,r12,#32
B# bl    vchannel             ;2.
L add   r12,r12,#32
V# bl    vchannel             ;3.
` add   r12,r12,#32
j# bl    vchannel             ;4.
t]
~� Vocs=8 �
�
[OPT p
� add   r12,r12,#32
�# bl    vchannel             ;5.
� add   r12,r12,#32
�# bl    vchannel             ;6.
� add   r12,r12,#32
�# bl    vchannel             ;7.
� add   r12,r12,#32
�# bl    vchannel             ;8.
�]
��
�
[OPT p


A subS  r7,r7,#1             ;Pattern_Counter - 1, is it zero?
1 stmNeIa r6,{r7-r8}         ;Not zero yet, so
H ldmNeFd r13!,{r1-r11,pc}   ; don't play new Pattern, Return instead
(
2H mov   r7,#64               ;Well, new Pattern begins, with Count=64
<9 ldrB  r0,[r9,#1]!          ;And get next Pattern Nr.
F1 cmp   r0,#&ff              ;End of Sequence?
PA ldrEq r9,[r10,#24]         ; Yeah -> Reset Sequence Pointer,
ZB ldrEqB 0,[r9]              ;         that means restart Song!
d5 ldr   r8,[r10,#28]         ;Address Patternstart
n> add   r8,r8,r0,lsl#10-(Vocs=8)    ;+ Nr*1024 (or Nr*2048)
x stmIa r6,{r7-r9}
�' ldmfd r13!,{r1-r11,pc}     ;Return
�
�/;*** SUPPLY �E CHANNEL WITH ǖ INFORMATIONS
�
�
.vchannel
�H ldr   r1,[r8],#4           ;Pattern LWord of current Patt_Pos & INC
�
�/ ldrB  r2,[r12,#30]         ;Is SoundFX on?
� cmp   r2,#0
�& bEq   vrule                ;No...
� ldr   r2,[r12,#4]
�A cmp   r2,#0                ;Yes, but is sample still active?
�1 strEqB 2,[r12,#30]         ;No, so cancel FX
 mov   pc,r14


.vrule
"; movS  r0,r1,lsr#24         ;Isolate Tone & Is it zero?
,F bEq   vcomms               ;No Tone -> Perhaps still a Command...
6
@K strB  r0,[r12,#31]         ;Store legal Tone for poss. Arpeggio effect
JI ldr   r0,[r11,r0,lsl#2]    ;Get equivalent Frequency from r11=fTable
T, str   r0,[r12,#4]          ;Enter Pitch
^? andS  r0,r1,#&ff <<16      ;Isolate Instrument-Byte, zero?
hI ldrEq r0,[r12,#20]         ; Y -> Get old RepAt (perhaps a RepTone!)
rL strEq r0,[r12,#00]         ;    & Set as new Pos (same Inst once again)
| bEq   vcomms
�G                            ;Else point to InstPool = Track+Inst*32
�M add   r2,r10,r0,lsr#11     ;lsr#16 for lowbyte &  &  for *32 => lsr#11
�B ldmIa r2,{r0,r2-r5}        ;Read all 5 InstPool Words at once
�5 str   r0,[r12,# 8]         ;Enter Sample Address
�- str   r3,[r12,#16]         ;Enter Volume
�L movS  r0,r4,lsl#16         ;Pos=RepAt (in 16-fixpoint), but is it zero?
�L addNe r2,r4,r5             ; No -> Len (absolute from 0) = RepAt+RepLen
�J movNe r4,r0                ;    -> Head Offset RepAt = fixpoint RepAt
�* str   r0,[r12,# 0]         ;Enter Pos
�- str   r2,[r12,#12]         ;Enter Length
�, str   r4,[r12,#20]         ;Enter RepAt
�
�.vcomms
C and   r0,r1,#&0f <<8       ;Isolate Command-Nibble from DataLW
1 and   r2,r1,#&ff           ;Isolate InfoByte
M ldr   r3,[pc,r0,lsr#6]     ;lsr#8 for Nibble into lowbyte & lsl#2 for *4
& add   pc,pc,r3
0
:, dcd   vef-vof2             ;Effects 0..
D	.vof2
N" dcd   vef-vof2             ;1
X" dcd   vef-vof2             ;2
b" dcd   vef-vof2             ;3
l" dcd   vef-vof2             ;4
v" dcd   vef-vof2             ;5
�" dcd   vef-vof2             ;6
�4 dcd   vstereopos-vof2      ; 7 = Set Stereo Pos
�4 dcd   vautovolup-vof2      ; 8 = Auto Volume up
�6 dcd   vautovoldown-vof2    ; 9 = Auto Volume down
�3 dcd   vautoarcup-vof2      ; A = Auto Pitch up
�5 dcd   vautoarcdown-vof2    ; B = Auto Pitch down
�0 dcd   vsetvol-vof2         ; C = Set Volume
�3 dcd   vpattbreak-vof2      ; D = Pattern Break
�4 dcd   vnop-vof2            ; E = (Not used yet)
�/ dcd   vsetspeed-vof2       ; F = Set Speed
�
�M.vef                        ;Effects, needn't to be done here, but later!
�< strB  r2,[r12,#28]         ;Store InfoByte, for Effects
 mov   r0,r0,lsr#8
< strB  r0,[r12,#29]         ;Store CommByte, for Effects
	.vnop
 + mov   pc,r14               ;and return
*
4.vstereopos
>M adr   r0,Head              ;Get current channel number (little Overhead)
H sub   r0,r12,r0
R5 mov   r0,r0,lsr#3          ;� 8; => 0,4,8,12,...
\ cmp   r0,#7*4
fE movEq r1,   #&60           ;Stereo Image Register   7  = Adr &60
pM addNe r1,r0,#&64           ;Stereo Image Registers 0-6 = Adr &64 upwards
z mov   r1,r1,lsl#24
� orr   r1,r1,r2
� mov   r2,#&3400000
� str   r1,[r2]
�]
�� Vocs=4 �
�
[OPT p
�9 cmp   r0,#3*4              ;Extra Adr of Image Reg 7
� subEq r1,r1,#&10<<24
�A addNe r1,r1,#&10<<24       ;Well, set up twin Image Reg too!
� str   r1,[r2]
�]
��
�
[OPT p
 mov   pc,r14

.vautovolup
$ strB  r2,[r12,#24]
. mov   pc,r14
8.vautovoldown
B strB  r2,[r12,#25]
L mov   pc,r14
V.vautoarcup
` strB  r2,[r12,#26]
j mov   pc,r14
t.vautoarcdown
~ strB  r2,[r12,#27]
� mov   pc,r14
�
�.vsetvol
�= str   r2,[r12,#16]         ;Enter new Volume into Header
� mov   pc,r14
�
�.vpattbreak
�H mov   r7,#1                ;Jump to end of Pattern, ie Patt_Count=1
� mov   pc,r14
�
�.vsetspeed
�. str   r2,Vspeed            ;Set new Speed
 mov   pc,r14


;==== �BAY ====

(>.Registers    dcd 64        ; r7 Pattern_Counter (64 -> 1)
2C              dcd 00        ; r8 Current Pointer in the Pattern
<D              dcd 00        ; r9 Current Pointer in the Sequence
F 
PM.Vcount       dcd 0         ;VSync Counter                |Keep these two
ZJ.Vspeed       dcd 6         ;Speed Counter (default=6)    |  < .Ftable
d
n%.Ftable       ]:P%+=9*12*4:[OPT p
x
.Track
�
�;;Sample Head (at Inst*32)   #00 Absolute Sample Address
�*                     ;      #04 Length
�0                     ;      #08 Volume 0-&ff
�:                     ;      #12 RepeatAt as ByteOffset
�*                     ;      #16 RepLen
�3                     ;      #20 Instrument Name
�
�;====INITSTORE ====
�
� mov   r2,#0
�	.uall
� str   r2,[r0],#4
 cmp   r0,r1
 bLo   uall
 mov   pc,r14
"	.ufin
,
6]:�
@
J-----------------------
T2er ADR (only forwards)
^-----------------------
h� �adr(r%,dest%)
rdis%=dest%-P%-8
|� p=%1000 �
�  d0%=0 :d1%=0
��
�  � dis% � &f �
�    d0%=dis% � &000FF
�    d1%=dis% � &FFF00
�  �
�    d0%=dis% � &00FFF
�    d1%=dis% � &FF000
�  �
�7  � d0%+d1%<>dis% � � �7;"FNadr doesn't suffice!":�
�8  � d0%=0 � d1%=0 � � "FNadr : ADR would do. ";~dis%
��
�
[OPT p
 add r%,pc,#d1%
 add r%,r%,#d0%
]=""
�
00000000  0d 00 0a 13 f4 20 3e 54  6f 6f 6c 73 2e 50 6c 61  |..... >Tools.Pla|
00000010  79 65 72 0d 00 14 44 f4  20 2e 2e 2e 20 41 6c 74  |yer...D. ... Alt|
00000020  65 72 20 79 6f 75 72 20  6c 61 73 74 20 22 20 5d  |er your last " ]|
00000030  3a 4e 45 58 54 20 70 20  22 20 69 6e 74 6f 20 20  |:NEXT p " into  |
00000040  22 20 5d 3a 50 52 4f 43  5f 4d 75 73 69 63 3a 4e  |" ]:PROC_Music:N|
00000050  45 58 54 20 70 20 22 0d  00 1e 44 f4 20 41 6e 64  |EXT p "...D. And|
00000060  20 69 6e 73 74 65 61 64  20 6f 66 20 63 61 6c 6c  | instead of call|
00000070  69 6e 67 20 79 6f 75 72  20 43 6f 64 65 2c 20 6a  |ing your Code, j|
00000080  75 73 74 20 64 6f 20 74  68 65 20 66 6f 6c 6c 6f  |ust do the follo|
00000090  77 69 6e 67 20 6c 69 6e  65 73 3a 0d 00 28 04 0d  |wing lines:..(..|
000000a0  00 32 16 65 6e 64 25 3d  54 72 61 63 6b 2b 70 6f  |.2.end%=Track+po|
000000b0  69 6e 74 65 72 0d 00 3c  2f f1 27 27 22 53 74 61  |inter..</.''"Sta|
000000c0  72 74 20 61 74 20 3a 20  26 22 3b 7e 63 6f 64 65  |rt at : &";~code|
000000d0  2c 22 45 6e 64 20 61 74  20 20 3a 20 26 22 3b 7e  |,"End at  : &";~|
000000e0  65 6e 64 25 0d 00 46 33  f1 20 20 22 54 6f 74 61  |end%..F3.  "Tota|
000000f0  6c 20 6c 65 6e 3a 20 22  3b 65 6e 64 25 2d 63 6f  |l len: ";end%-co|
00000100  64 65 2c 22 53 6f 6e 67  20 6c 65 6e 3a 20 22 3b  |de,"Song len: ";|
00000110  70 6f 69 6e 74 65 72 0d  00 50 04 0d 00 5a 15 e8  |pointer..P...Z..|
00000120  27 22 53 61 76 65 20 6e  61 6d 65 3f 20 22 61 24  |'"Save name? "a$|
00000130  0d 00 64 27 ff 20 22 2a  53 61 76 65 20 22 2b 61  |..d'. "*Save "+a|
00000140  24 2b 22 20 22 2b c3 7e  63 6f 64 65 2b 22 20 22  |$+" "+.~code+" "|
00000150  2b c3 7e 65 6e 64 25 0d  00 6e 20 ff 20 22 2a 53  |+.~end%..n . "*S|
00000160  65 74 74 79 70 65 20 22  2b 61 24 2b 22 20 41 62  |ettype "+a$+" Ab|
00000170  73 6f 6c 75 74 65 22 0d  00 78 05 e0 0d 00 82 04  |solute"..x......|
00000180  0d 00 8c 4d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...M------------|
00000190  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000001c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 00 96  |-------------...|
000001d0  0d dd 20 f2 5f 4d 75 73  69 63 0d 00 a0 0f e7 20  |.. ._Music..... |
000001e0  70 3d 25 31 30 30 30 20  8c 0d 00 aa 34 20 20 2a  |p=%1000 ....4  *|
000001f0  52 4d 45 6e 73 75 72 65  20 50 61 63 6b 69 74 20  |RMEnsure Packit |
00000200  31 2e 35 30 20 52 4d 4c  6f 61 64 20 21 43 6f 63  |1.50 RMLoad !Coc|
00000210  6f 6e 69 7a 65 72 2e 50  61 63 6b 69 74 0d 00 b4  |onizer.Packit...|
00000220  10 20 20 6d 61 78 69 6e  73 74 3d 33 32 0d 00 be  |.  maxinst=32...|
00000230  46 20 20 de 20 6e 61 6d  24 28 32 30 30 32 29 2c  |F  . nam$(2002),|
00000240  62 79 74 25 28 32 30 30  32 29 2c 6c 6f 63 24 28  |byt%(2002),loc$(|
00000250  32 30 30 32 29 2c 73 6f  72 74 25 28 6d 61 78 69  |2002),sort%(maxi|
00000260  6e 73 74 29 2c 73 6f 72  74 24 28 6d 61 78 69 6e  |nst),sort$(maxin|
00000270  73 74 29 0d 00 c8 12 20  20 73 6f 72 74 24 28 32  |st)....  sort$(2|
00000280  29 3d 22 b1 22 0d 00 d2  0c 20 20 74 6f 70 25 3d  |)="."....  top%=|
00000290  30 0d 00 dc 15 20 20 66  25 3d 8e 20 22 6c 6f 63  |0....  f%=. "loc|
000002a0  61 74 69 6f 6e 22 0d 00  e6 38 20 20 e7 20 66 25  |ation"...8  . f%|
000002b0  3d 30 20 8c 20 f1 27 22  50 4c 45 41 53 45 20 49  |=0 . .'"PLEASE I|
000002c0  4e 53 45 52 54 20 41 20  53 4f 4e 47 20 44 49 53  |NSERT A SONG DIS|
000002d0  43 22 3a 61 24 3d be 3a  e5 20 8d 64 5c 40 0d 00  |C":a$=.:. .d\@..|
000002e0  f0 0f 20 20 c8 95 20 ac  20 c5 23 66 25 0d 00 fa  |..  .. . .#f%...|
000002f0  3f 20 20 20 20 74 6f 70  25 2b 3d 31 3a 6e 61 6d  |?    top%+=1:nam|
00000300  24 28 74 6f 70 25 29 3d  be 23 66 25 3a e8 23 66  |$(top%)=.#f%:.#f|
00000310  25 2c 62 79 74 25 28 74  6f 70 25 29 3a 6c 6f 63  |%,byt%(top%):loc|
00000320  24 28 74 6f 70 25 29 3d  be 23 66 25 0d 01 04 07  |$(top%)=.#f%....|
00000330  20 20 ce 0d 01 0e 0a 20  20 d9 23 66 25 0d 01 18  |  .....  .#f%...|
00000340  04 0d 01 22 48 20 20 e8  27 22 50 6c 65 61 73 65  |..."H  .'"Please|
00000350  20 65 6e 74 65 72 20 73  6f 6e 67 20 70 61 74 68  | enter song path|
00000360  20 5b 53 4f 4e 47 53 5d  3a 20 22 70 61 74 68 24  | [SONGS]: "path$|
00000370  3a e7 20 70 61 74 68 24  3d 22 22 20 70 61 74 68  |:. path$="" path|
00000380  24 3d 22 73 6f 6e 67 73  22 0d 01 2c 14 20 20 ff  |$="songs"..,.  .|
00000390  20 22 43 61 74 20 22 2b  70 61 74 68 24 0d 01 36  | "Cat "+path$..6|
000003a0  20 20 20 e8 27 22 43 6f  63 6f 6e 69 7a 65 72 20  |   .'"Coconizer |
000003b0  73 6f 6e 67 66 69 6c 65  3f 20 22 61 24 0d 01 40  |songfile? "a$..@|
000003c0  15 20 20 61 24 3d 70 61  74 68 24 2b 22 2e 22 2b  |.  a$=path$+"."+|
000003d0  61 24 0d 01 4a 0d 20 20  66 25 3d 8e 20 61 24 0d  |a$..J.  f%=. a$.|
000003e0  01 54 35 20 20 62 31 3d  9a 23 66 25 3a 62 32 3d  |.T5  b1=.#f%:b2=|
000003f0  9a 23 66 25 3a 62 33 3d  9a 23 66 25 3a 62 34 3d  |.#f%:b3=.#f%:b4=|
00000400  9a 23 66 25 3a 62 35 3d  9a 23 66 25 3a 62 36 3d  |.#f%:b5=.#f%:b6=|
00000410  9a 23 66 25 0d 01 5e 0a  20 20 d9 23 66 25 0d 01  |.#f%..^.  .#f%..|
00000420  68 39 20 20 e7 20 62 34  3d 30 20 80 20 62 35 3e  |h9  . b4=0 . b5>|
00000430  30 20 8c 20 56 6f 63 73  3d 62 36 20 8b 20 56 6f  |0 . Vocs=b6 . Vo|
00000440  63 73 3d 62 31 20 20 20  20 20 3a f4 20 70 61 63  |cs=b1     :. pac|
00000450  6b 65 64 2e 2e 2e 3f 0d  01 72 04 0d 01 7c 10 20  |ked...?..r...|. |
00000460  20 f2 5f 4d 75 73 69 63  41 53 4d 0d 01 86 3e 20  | ._MusicASM...> |
00000470  20 41 25 3d 63 6f 64 65  3a 42 25 3d 54 72 61 63  | A%=code:B%=Trac|
00000480  6b 2d 31 3a d6 20 54 72  61 63 6b 20 20 20 20 20  |k-1:. Track     |
00000490  20 20 20 20 20 20 20 20  20 20 20 20 20 3a f4 20  |             :. |
000004a0  49 6e 69 74 73 74 6f 72  65 0d 01 90 3f 20 20 41  |Initstore...?  A|
000004b0  25 3d 75 66 69 6e 3a 42  25 3d 4c 25 2d 31 20 20  |%=ufin:B%=L%-1  |
000004c0  20 3a d6 20 54 72 61 63  6b 20 20 20 20 20 20 20  | :. Track       |
000004d0  20 20 20 20 20 20 20 20  20 20 20 3a f4 20 72 65  |           :. re|
000004e0  61 6c 6c 79 20 41 4c 4c  0d 01 9a 07 20 20 e1 0d  |ally ALL....  ..|
000004f0  01 a4 05 cc 0d 01 ae 10  20 20 f2 5f 4d 75 73 69  |........  ._Musi|
00000500  63 41 53 4d 0d 01 b8 05  cd 0d 01 c2 04 0d 01 cc  |cASM............|
00000510  1e f4 20 2a 2a 2a 20 4c  4f 41 44 20 49 4e 53 54  |.. *** LOAD INST|
00000520  52 55 4d 45 4e 54 53 20  2a 2a 2a 0d 01 d6 04 0d  |RUMENTS ***.....|
00000530  01 e0 16 f1 22 43 68 61  6e 6e 65 6c 73 3a 20 22  |...."Channels: "|
00000540  3b 56 6f 63 73 0d 01 ea  13 e7 20 62 34 3d 30 20  |;Vocs..... b4=0 |
00000550  80 20 62 35 3e 30 20 8c  0d 01 f4 22 20 20 ff 20  |. b5>0 ...."  . |
00000560  22 50 61 63 6b 4c 6f 61  64 20 22 2b 61 24 2b 22  |"PackLoad "+a$+"|
00000570  20 22 2b c3 7e 54 72 61  63 6b 0d 01 fe 05 cc 0d  | "+.~Track......|
00000580  02 08 1e 20 20 ff 20 22  4c 6f 61 64 20 22 2b 61  |...  . "Load "+a|
00000590  24 2b 22 20 22 2b c3 7e  54 72 61 63 6b 0d 02 12  |$+" "+.~Track...|
000005a0  05 cd 0d 02 1c 04 0d 02  26 44 e3 20 69 25 3d 30  |........&D. i%=0|
000005b0  20 b8 20 39 2a 31 32 2d  31 20 20 20 20 20 20 20  | . 9*12-1       |
000005c0  20 20 20 3a f4 20 46 72  6f 6d 20 69 6e 74 65 72  |   :. From inter|
000005d0  6e 61 74 2e 20 4f 63 74  61 76 65 20 2d 33 20 74  |nat. Octave -3 t|
000005e0  6f 20 4f 63 74 61 76 65  20 35 0d 02 30 4a 6e 25  |o Octave 5..0Jn%|
000005f0  3d 69 25 20 2b 34 2a 31  32 20 20 20 20 20 20 20  |=i% +4*12       |
00000600  20 20 20 20 20 20 20 20  20 20 3a f4 20 43 6f 72  |          :. Cor|
00000610  72 65 63 74 20 69 74 2c  20 61 73 20 27 53 74 65  |rect it, as 'Ste|
00000620  69 6e 77 61 79 27 20 2b  30 20 3d 20 4d 69 64 64  |inway' +0 = Midd|
00000630  6c 65 20 43 0d 02 3a 34  66 25 3d 34 34 30 2a 28  |le C..:4f%=440*(|
00000640  32 5e 28 28 6e 25 2d 34  36 29 2f 31 32 29 29 20  |2^((n%-46)/12)) |
00000650  20 20 20 20 3a f4 20 46  72 65 71 75 65 6e 63 79  |    :. Frequency|
00000660  20 66 6f 72 6d 75 6c 61  0d 02 44 47 46 74 61 62  | formula..DGFtab|
00000670  6c 65 21 28 69 25 2a 34  29 3d 28 66 25 2f 28 31  |le!(i%*4)=(f%/(1|
00000680  30 30 30 30 30 30 2f 75  73 29 29 2a 36 35 35 33  |000000/us))*6553|
00000690  36 20 3a f4 20 31 36 62  69 74 20 66 69 78 70 6f  |6 :. 16bit fixpo|
000006a0  69 6e 74 65 64 20 69 6e  63 72 65 6d 65 6e 74 0d  |inted increment.|
000006b0  02 4e 08 ed 20 69 25 0d  02 58 04 0d 02 62 1a f1  |.N.. i%..X...b..|
000006c0  27 22 4e 41 4d 45 3a 20  22 3b 24 28 54 72 61 63  |'"NAME: ";$(Trac|
000006d0  6b 2b 31 29 3b 0d 02 6c  3b f1 20 8a 34 36 29 3b  |k+1);..l;. .46);|
000006e0  22 53 65 71 75 65 6e 63  69 65 73 3a 20 22 3b 54  |"Sequencies: ";T|
000006f0  72 61 63 6b 3f 32 32 3b  22 20 20 50 61 74 74 65  |rack?22;"  Patte|
00000700  72 6e 73 3a 20 22 3b 54  72 61 63 6b 3f 32 33 27  |rns: ";Track?23'|
00000710  0d 02 76 04 0d 02 80 49  70 6f 69 6e 74 65 72 3d  |..v....Ipointer=|
00000720  54 72 61 63 6b 21 33 32  20 20 20 20 20 20 20 20  |Track!32        |
00000730  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000740  20 20 20 20 20 20 20 20  20 3a f4 20 53 61 6d 70  |         :. Samp|
00000750  6c 65 44 61 74 61 20 4f  66 66 73 65 74 0d 02 8a  |leData Offset...|
00000760  15 e3 20 69 25 3d 31 20  b8 20 54 72 61 63 6b 3f  |.. i%=1 . Track?|
00000770  32 31 0d 02 94 1e 20 20  54 72 61 63 6b 21 28 69  |21....  Track!(i|
00000780  25 2a 33 32 2b 20 30 29  3d 70 6f 69 6e 74 65 72  |%*32+ 0)=pointer|
00000790  0d 02 9e 1a 20 20 6c 65  6e 3d 54 72 61 63 6b 21  |....  len=Track!|
000007a0  28 69 25 2a 33 32 2b 20  34 29 0d 02 a8 1a 20 20  |(i%*32+ 4)....  |
000007b0  76 6f 6c 3d 54 72 61 63  6b 21 28 69 25 2a 33 32  |vol=Track!(i%*32|
000007c0  2b 20 38 29 0d 02 b2 1a  20 20 72 61 74 3d 54 72  |+ 8)....  rat=Tr|
000007d0  61 63 6b 21 28 69 25 2a  33 32 2b 31 32 29 0d 02  |ack!(i%*32+12)..|
000007e0  bc 1a 20 20 72 65 6e 3d  54 72 61 63 6b 21 28 69  |..  ren=Track!(i|
000007f0  25 2a 33 32 2b 31 36 29  0d 02 c6 1b 20 20 6e 61  |%*32+16)....  na|
00000800  24 3d 24 28 54 72 61 63  6b 2b 69 25 2a 33 32 2b  |$=$(Track+i%*32+|
00000810  32 30 29 0d 02 d0 30 20  20 f1 20 bd 28 39 36 2b  |20)...0  . .(96+|
00000820  69 25 29 3b 22 20 3a 20  22 3b 6e 61 24 3b 8a 31  |i%);" : ";na$;.1|
00000830  38 29 3b 76 6f 6c 2c 72  61 74 2c 72 65 6e 2c 6c  |8);vol,rat,ren,l|
00000840  65 6e 3b 0d 02 da 5b 20  20 e3 20 6a 25 3d 31 20  |en;...[  . j%=1 |
00000850  b8 20 74 6f 70 25 3a e7  20 6e 61 24 3c 3e 6e 61  |. top%:. na$<>na|
00000860  6d 24 28 6a 25 29 20 8c  20 ed 3a e8 27 22 20 2d  |m$(j%) . .:.'" -|
00000870  3e 20 22 6e 61 24 3a 24  28 54 72 61 63 6b 2b 69  |> "na$:$(Track+i|
00000880  25 2a 33 32 2b 32 30 29  3d 6e 61 24 3a f1 20 c4  |%*32+20)=na$:. .|
00000890  33 30 2c bd 38 29 3b 3a  e5 20 8d 64 5a 42 0d 02  |30,.8);:. .dZB..|
000008a0  e4 1a 20 20 f1 20 22 20  28 22 3b 62 79 74 25 28  |..  . " (";byt%(|
000008b0  6a 25 29 3b 22 29 22 3b  0d 02 ee 3e 20 20 e7 20  |j%);")";...>  . |
000008c0  6c 65 6e 3e 62 79 74 25  28 6a 25 29 20 8c 20 6c  |len>byt%(j%) . l|
000008d0  65 6e 3d 62 79 74 25 28  6a 25 29 3a 54 72 61 63  |en=byt%(j%):Trac|
000008e0  6b 21 28 69 25 2a 33 32  2b 34 29 3d 6c 65 6e 3a  |k!(i%*32+4)=len:|
000008f0  f1 20 22 2a 22 3b 0d 02  f8 1e 20 20 f1 20 2c 28  |. "*";....  . ,(|
00000900  97 6c 6f 63 24 28 6a 25  29 2d 36 35 29 20 81 20  |.loc$(j%)-65) . |
00000910  32 20 2b 31 0d 03 02 25  20 20 73 6f 72 74 24 28  |2 +1...%  sort$(|
00000920  69 25 29 3d 6c 6f 63 24  28 6a 25 29 3a 73 6f 72  |i%)=loc$(j%):sor|
00000930  74 25 28 69 25 29 3d 69  25 0d 03 0c 16 20 20 70  |t%(i%)=i%....  p|
00000940  6f 69 6e 74 65 72 2b 3d  6c 65 6e 2b 67 61 70 0d  |ointer+=len+gap.|
00000950  03 16 61 20 20 e7 20 54  72 61 63 6b 2b 70 6f 69  |..a  . Track+poi|
00000960  6e 74 65 72 3e 3d 4c 25  20 85 20 9e 2c 22 4d 6f  |nter>=L% . .,"Mo|
00000970  72 65 20 74 68 61 6e 20  22 2b c3 70 6f 69 6e 74  |re than "+.point|
00000980  65 72 2b 22 20 62 79 74  65 73 20 73 61 6d 70 6c  |er+" bytes sampl|
00000990  65 20 64 61 74 61 3a 20  41 73 73 65 6d 62 6c 65  |e data: Assemble|
000009a0  72 20 6c 69 6d 69 74 20  72 65 61 63 68 65 64 22  |r limit reached"|
000009b0  0d 03 20 08 ed 20 69 25  0d 03 2a 05 f1 0d 03 34  |.. .. i%..*....4|
000009c0  04 0d 03 3e 05 f5 0d 03  48 0d 20 20 66 6c 61 67  |...>....H.  flag|
000009d0  25 3d 30 0d 03 52 19 20  20 e3 20 69 25 3d 31 20  |%=0..R.  . i%=1 |
000009e0  b8 20 54 72 61 63 6b 3f  32 31 2d 31 0d 03 5c 5b  |. Track?21-1..\[|
000009f0  20 20 20 20 e7 20 73 6f  72 74 24 28 69 25 29 3e  |    . sort$(i%)>|
00000a00  73 6f 72 74 24 28 69 25  2b 31 29 20 8c 20 c8 94  |sort$(i%+1) . ..|
00000a10  20 73 6f 72 74 24 28 69  25 29 2c 73 6f 72 74 24  | sort$(i%),sort$|
00000a20  28 69 25 2b 31 29 3a c8  94 20 73 6f 72 74 25 28  |(i%+1):.. sort%(|
00000a30  69 25 29 2c 73 6f 72 74  25 28 69 25 2b 31 29 3a  |i%),sort%(i%+1):|
00000a40  66 6c 61 67 25 3d 31 0d  03 66 0a 20 20 ed 20 69  |flag%=1..f.  . i|
00000a50  25 0d 03 70 0d fd 20 66  6c 61 67 25 3d 30 0d 03  |%..p.. flag%=0..|
00000a60  7a 04 0d 03 84 15 e3 20  69 25 3d 31 20 b8 20 54  |z...... i%=1 . T|
00000a70  72 61 63 6b 3f 32 31 0d  03 8e 11 20 20 73 3d 73  |rack?21....  s=s|
00000a80  6f 72 74 25 28 69 25 29  0d 03 98 44 20 20 6e 61  |ort%(i%)...D  na|
00000a90  24 3d 24 28 54 72 61 63  6b 2b 73 2a 33 32 2b 32  |$=$(Track+s*32+2|
00000aa0  30 29 3a 61 64 72 3d 54  72 61 63 6b 2b 54 72 61  |0):adr=Track+Tra|
00000ab0  63 6b 21 28 73 2a 33 32  29 3a 6c 65 6e 3d 54 72  |ck!(s*32):len=Tr|
00000ac0  61 63 6b 21 28 73 2a 33  32 2b 34 29 0d 03 a2 22  |ack!(s*32+4)..."|
00000ad0  20 20 66 75 24 3d 22 49  6e 73 74 22 2b 73 6f 72  |  fu$="Inst"+sor|
00000ae0  74 24 28 69 25 29 2b 22  2e 22 2b 6e 61 24 0d 03  |t$(i%)+"."+na$..|
00000af0  ac 0d 20 20 66 3d 8e 20  66 75 24 0d 03 b6 0b 20  |..  f=. fu$.... |
00000b00  20 e7 20 66 20 8c 0d 03  c0 13 20 20 20 20 f1 20  | . f .....    . |
00000b10  6e 61 24 3b 22 2c 20 22  3b 0d 03 ca 1d 20 20 20  |na$;", ";....   |
00000b20  20 24 28 61 64 72 2b 6c  65 6e 29 3d c4 67 61 70  | $(adr+len)=.gap|
00000b30  2d 31 2c bd 30 29 0d 03  d4 24 20 20 20 20 c8 99  |-1,.0)...$    ..|
00000b40  20 22 4f 53 5f 47 42 50  42 22 2c 34 2c 66 2c 61  | "OS_GBPB",4,f,a|
00000b50  64 72 2c 6c 65 6e 3a d9  23 66 0d 03 de 07 20 20  |dr,len:.#f....  |
00000b60  cc 0d 03 e8 23 20 20 20  20 64 69 73 63 3d 28 97  |....#    disc=(.|
00000b70  73 6f 72 74 24 28 69 25  29 2d 36 35 29 20 81 20  |sort$(i%)-65) . |
00000b80  32 20 2b 31 0d 03 f2 33  20 20 20 20 f1 27 bd 37  |2 +1...3    .'.7|
00000b90  3b 22 50 4c 45 41 53 45  20 49 4e 53 45 52 54 20  |;"PLEASE INSERT |
00000ba0  53 41 4d 50 4c 45 20 44  49 53 43 20 22 3b 64 69  |SAMPLE DISC ";di|
00000bb0  73 63 3a 61 24 3d be 0d  03 fc 0e 20 20 20 20 e5  |sc:a$=.....    .|
00000bc0  20 8d 74 6c 43 0d 04 06  07 20 20 cd 0d 04 10 08  | .tlC....  .....|
00000bd0  ed 20 69 25 0d 04 1a 05  e1 0d 04 24 04 0d 04 2e  |. i%.......$....|
00000be0  10 dd 20 f2 5f 4d 75 73  69 63 41 53 4d 0d 04 38  |.. ._MusicASM..8|
00000bf0  0a 67 61 70 3d 31 36 0d  04 42 0a 75 73 20 3d 34  |.gap=16..B.us =4|
00000c00  38 0d 04 4c 0a 5b 4f 50  54 20 70 0d 04 56 04 0d  |8..L.[OPT p..V..|
00000c10  04 60 28 3b 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.`(;------------|
00000c20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000c30  2d 2d 2d 2d 2d 2d 2d 0d  04 6a 05 3b 0d 04 74 27  |-------..j.;..t'|
00000c40  3b 20 54 48 45 20 43 4f  43 4f 4e 49 5a 45 52 20  |; THE COCONIZER |
00000c50  50 4c 41 59 45 52 20 52  4f 55 54 49 4e 45 20 76  |PLAYER ROUTINE v|
00000c60  31 2e 33 0d 04 7e 05 3b  0d 04 88 25 3b 20 20 20  |1.3..~.;...%;   |
00000c70  4e 65 65 64 73 20 32 30  25 20 6f 66 20 74 68 65  |Needs 20% of the|
00000c80  20 41 52 4d 2d 49 49 20  73 70 65 65 64 0d 04 92  | ARM-II speed...|
00000c90  05 3b 0d 04 9c 1d 3b 20  20 20 20 20 20 20 20 20  |.;....;         |
00000ca0  28 63 29 20 4d 61 69 20  31 39 39 30 20 62 79 0d  |(c) Mai 1990 by.|
00000cb0  04 a6 24 3b 20 20 20 20  45 64 75 61 72 64 20 50  |..$;    Eduard P|
00000cc0  66 61 72 72 20 26 20 54  68 6f 6d 61 73 20 41 6c  |farr & Thomas Al|
00000cd0  62 65 72 0d 04 b0 1c 3b  20 20 20 20 20 20 20 20  |ber....;        |
00000ce0  20 20 20 6f 66 20 50 6c  61 79 66 69 65 6c 64 0d  |   of Playfield.|
00000cf0  04 ba 05 3b 0d 04 c4 25  3b 20 20 20 4c 61 74 65  |...;...%;   Late|
00000d00  73 74 20 72 65 76 69 73  69 6f 6e 20 2d 20 32 30  |st revision - 20|
00000d10  20 46 65 62 20 31 39 39  31 0d 04 ce 05 3b 0d 04  | Feb 1991....;..|
00000d20  d8 28 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.(;-------------|
00000d30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000d40  2d 2d 2d 2d 2d 2d 0d 04  e2 04 0d 04 ec 09 2e 76  |------.........v|
00000d50  5f 6f 6e 0d 04 f6 12 20  6d 6f 76 20 20 20 72 31  |_on.... mov   r1|
00000d60  32 2c 72 31 34 0d 05 00  25 20 6d 6f 76 20 20 20  |2,r14...% mov   |
00000d70  72 30 2c 23 32 20 20 20  20 20 20 20 20 20 20 20  |r0,#2           |
00000d80  20 20 20 20 20 3b c8 a0  20 32 0d 05 0a 45 20 6d  |     ;.. 2...E m|
00000d90  6f 76 20 20 20 72 31 2c  23 32 30 38 20 20 20 20  |ov   r1,#208    |
00000da0  20 20 20 20 20 20 20 20  20 20 3b 42 75 66 66 65  |          ;Buffe|
00000db0  72 4c 65 6e 20 6f 66 20  ee 45 20 63 68 61 6e 6e  |rLen of .E chann|
00000dc0  65 6c 2c 20 74 6f 74 61  6c 20 2a 56 6f 63 73 0d  |el, total *Vocs.|
00000dd0  05 14 2e 20 6d 6f 76 20  20 20 72 32 2c 23 75 73  |... mov   r2,#us|
00000de0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00000df0  53 61 6d 70 6c 65 20 50  65 72 69 6f 64 0d 05 1e  |Sample Period...|
00000e00  37 20 6d 6f 76 20 20 20  72 33 2c 23 30 20 20 20  |7 mov   r3,#0   |
00000e10  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 44 65  |             ;De|
00000e20  66 61 75 6c 74 20 43 68  61 6e 6e 65 6c 48 61 6e  |fault ChannelHan|
00000e30  64 6c 65 72 0d 05 28 31  20 6d 6f 76 20 20 20 72  |dler..(1 mov   r|
00000e40  34 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |4,#0            |
00000e50  20 20 20 20 3b 44 65 66  61 75 6c 74 20 53 68 65  |    ;Default She|
00000e60  64 75 6c 65 72 0d 05 32  1c 20 73 77 69 20 20 20  |duler..2. swi   |
00000e70  22 53 6f 75 6e 64 5f 43  6f 6e 66 69 67 75 72 65  |"Sound_Configure|
00000e80  22 0d 05 3c 48 20 6d 6f  76 20 20 20 72 30 2c 23  |"..<H mov   r0,#|
00000e90  56 6f 63 73 20 20 20 20  20 20 20 20 20 20 20 20  |Vocs            |
00000ea0  20 3b c8 a0 20 38 20 77  69 74 68 20 70 61 72 61  | ;.. 8 with para|
00000eb0  6d 73 20 64 6f 65 73 6e  27 74 20 77 6f 72 6b 20  |ms doesn't work |
00000ec0  64 69 72 65 63 74 6c 79  21 0d 05 46 49 20 6d 6f  |directly!..FI mo|
00000ed0  76 20 20 20 72 31 2c 23  30 20 20 20 20 20 20 20  |v   r1,#0       |
00000ee0  20 20 20 20 20 20 20 20  20 3b 42 65 63 61 75 73  |         ;Becaus|
00000ef0  65 20 74 68 65 6e 20 73  61 6d 70 6c 65 20 72 61  |e then sample ra|
00000f00  74 65 20 69 73 20 73 65  74 20 66 61 6c 73 65 2e  |te is set false.|
00000f10  2e 2e 0d 05 50 10 20 6d  6f 76 20 20 20 72 32 2c  |....P. mov   r2,|
00000f20  23 30 0d 05 5a 10 20 6d  6f 76 20 20 20 72 33 2c  |#0..Z. mov   r3,|
00000f30  23 30 0d 05 64 10 20 6d  6f 76 20 20 20 72 34 2c  |#0..d. mov   r4,|
00000f40  23 30 0d 05 6e 1c 20 73  77 69 20 20 20 22 53 6f  |#0..n. swi   "So|
00000f50  75 6e 64 5f 43 6f 6e 66  69 67 75 72 65 22 0d 05  |und_Configure"..|
00000f60  78 04 0d 05 82 17 20 61  64 72 20 20 20 72 30 2c  |x..... adr   r0,|
00000f70  56 6f 69 63 65 42 61 73  65 0d 05 8c 4b 20 6d 6f  |VoiceBase...K mo|
00000f80  76 20 20 20 72 31 2c 23  30 20 20 20 20 20 20 20  |v   r1,#0       |
00000f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 49  |              ;I|
00000fa0  6e 73 74 61 6c 6c 20 6f  75 72 20 56 6f 69 63 65  |nstall our Voice|
00000fb0  20 69 6e 74 6f 20 6e 65  78 74 20 66 72 65 65 20  | into next free |
00000fc0  53 6c 6f 74 0d 05 96 1f  20 73 77 69 20 20 20 22  |Slot.... swi   "|
00000fd0  53 6f 75 6e 64 5f 49 6e  73 74 61 6c 6c 56 6f 69  |Sound_InstallVoi|
00000fe0  63 65 22 0d 05 a0 35 20  73 74 72 20 20 20 72 31  |ce"...5 str   r1|
00000ff0  2c 56 73 6c 6f 74 20 20  20 20 20 20 20 20 20 20  |,Vslot          |
00001000  20 20 20 20 20 20 20 20  3b 73 74 6f 72 65 20 75  |        ;store u|
00001010  73 65 64 20 73 6c 6f 74  0d 05 aa 23 20 61 64 72  |sed slot...# adr|
00001020  20 20 20 72 32 2c 56 73  74 65 72 65 6f 73 2d 34  |   r2,Vstereos-4|
00001030  2a 34 2a 28 56 6f 63 73  3d 38 29 0d 05 b4 04 0d  |*4*(Vocs=8).....|
00001040  05 be 10 20 6d 6f 76 20  20 20 72 30 2c 23 31 0d  |... mov   r0,#1.|
00001050  05 c8 0b 2e 76 69 6d 61  67 65 0d 05 d2 15 20 6c  |....vimage.... l|
00001060  64 72 20 20 20 72 31 2c  5b 72 32 5d 2c 23 34 0d  |dr   r1,[r2],#4.|
00001070  05 dc 2f 20 73 77 69 20  20 20 22 53 6f 75 6e 64  |../ swi   "Sound|
00001080  5f 53 74 65 72 65 6f 22  20 20 20 20 20 20 20 20  |_Stereo"        |
00001090  20 20 20 20 3b 2a c8 a2  20 72 30 20 72 31 0d 05  |    ;*.. r0 r1..|
000010a0  e6 13 20 61 64 64 20 20  20 72 30 2c 72 30 2c 23  |.. add   r0,r0,#|
000010b0  31 0d 05 f0 13 20 63 6d  70 20 20 20 72 30 2c 23  |1.... cmp   r0,#|
000010c0  56 6f 63 73 0d 05 fa 11  20 62 4c 73 20 20 20 76  |Vocs.... bLs   v|
000010d0  69 6d 61 67 65 0d 06 04  04 0d 06 0e 13 20 6d 6f  |image........ mo|
000010e0  76 20 20 20 72 30 2c 23  56 6f 63 73 0d 06 18 09  |v   r0,#Vocs....|
000010f0  2e 76 73 65 74 0d 06 22  13 20 61 64 72 20 20 20  |.vset..". adr   |
00001100  72 31 2c 56 6e 61 6d 65  0d 06 2c 3b 20 73 77 69  |r1,Vname..,; swi|
00001110  20 20 20 22 53 6f 75 6e  64 5f 41 74 74 61 63 68  |   "Sound_Attach|
00001120  4e 61 6d 65 64 56 6f 69  63 65 22 20 20 3b 2a 43  |NamedVoice"  ;*C|
00001130  48 41 4e 4e 45 4c 56 4f  49 43 45 20 72 30 20 22  |HANNELVOICE r0 "|
00001140  72 31 22 0d 06 36 13 20  6d 6f 76 20 20 20 72 31  |r1"..6. mov   r1|
00001150  2c 23 26 31 37 30 0d 06  40 3b 20 6d 6f 76 20 20  |,#&170..@; mov  |
00001160  20 72 32 2c 23 35 30 20  20 20 20 20 20 20 20 20  | r2,#50         |
00001170  20 20 20 20 20 20 3b 41  63 74 69 76 61 74 65 20  |      ;Activate |
00001180  61 6c 6c 20 63 68 61 6e  6e 65 6c 73 20 6f 6e 63  |all channels onc|
00001190  65 0d 06 4a 12 20 6d 6f  76 20 20 20 72 33 2c 23  |e..J. mov   r3,#|
000011a0  32 35 35 0d 06 54 2f 20  73 77 69 20 20 20 22 53  |255..T/ swi   "S|
000011b0  6f 75 6e 64 5f 43 6f 6e  74 72 6f 6c 22 20 20 20  |ound_Control"   |
000011c0  20 20 20 3b 2a d4 20 72  30 20 72 31 20 72 32 20  |   ;*. r0 r1 r2 |
000011d0  72 33 0d 06 5e 13 20 73  75 62 53 20 20 72 30 2c  |r3..^. subS  r0,|
000011e0  72 30 2c 23 31 0d 06 68  0f 20 62 4e 65 20 20 20  |r0,#1..h. bNe   |
000011f0  76 73 65 74 0d 06 72 04  0d 06 7c 13 20 62 6c 20  |vset..r...|. bl |
00001200  20 20 20 76 61 62 73 6f  6c 75 74 0d 06 86 12 20  |   vabsolut.... |
00001210  62 6c 20 20 20 20 76 5f  72 65 73 65 74 0d 06 90  |bl    v_reset...|
00001220  3c 20 6d 6f 76 20 20 20  72 30 2c 23 31 36 20 20  |< mov   r0,#16  |
00001230  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 43 6c  |             ;Cl|
00001240  61 69 6d 20 45 56 45 4e  54 20 56 65 63 74 6f 72  |aim EVENT Vector|
00001250  20 28 4e 72 2e 20 31 36  29 0d 06 9a 14 20 a4 61  | (Nr. 16).... .a|
00001260  64 72 20 28 31 2c 76 69  6e 74 65 72 29 0d 06 a4  |dr (1,vinter)...|
00001270  3b 20 61 64 72 20 20 20  72 32 2c 48 65 61 64 20  |; adr   r2,Head |
00001280  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 45 6e  |             ;En|
00001290  74 72 79 20 57 6f 72 6b  73 70 61 63 65 50 6f 69  |try WorkspacePoi|
000012a0  6e 74 65 72 20 72 31 32  0d 06 ae 15 20 73 77 69  |nter r12.... swi|
000012b0  20 20 20 22 4f 53 5f 43  6c 61 69 6d 22 0d 06 b8  |   "OS_Claim"...|
000012c0  34 20 6d 6f 76 20 20 20  72 30 2c 23 31 34 20 20  |4 mov   r0,#14  |
000012d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 45 6e  |             ;En|
000012e0  61 62 6c 65 20 45 76 65  6e 74 20 4e 72 2e 20 72  |able Event Nr. r|
000012f0  31 0d 06 c2 32 20 6d 6f  76 20 20 20 72 31 2c 23  |1...2 mov   r1,#|
00001300  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4               |
00001310  20 3b 28 34 20 3d 20 56  53 79 6e 63 20 45 76 65  | ;(4 = VSync Eve|
00001320  6e 74 29 0d 06 cc 14 20  73 77 69 20 20 20 22 4f  |nt).... swi   "O|
00001330  53 5f 42 79 74 65 22 0d  06 d6 04 0d 06 e0 31 20  |S_Byte".......1 |
00001340  6d 6f 76 20 20 20 72 30  2c 23 56 6f 63 73 20 20  |mov   r0,#Vocs  |
00001350  20 20 20 20 20 20 20 20  20 20 20 3b 41 6e 64 20  |           ;And |
00001360  6f 6e 63 65 20 6d 6f 72  65 2e 2e 2e 0d 06 ea 10  |once more.......|
00001370  20 6d 6f 76 20 20 20 72  31 2c 23 30 0d 06 f4 10  | mov   r1,#0....|
00001380  20 6d 6f 76 20 20 20 72  32 2c 23 30 0d 06 fe 10  | mov   r2,#0....|
00001390  20 6d 6f 76 20 20 20 72  33 2c 23 30 0d 07 08 10  | mov   r3,#0....|
000013a0  20 6d 6f 76 20 20 20 72  34 2c 23 30 0d 07 12 27  | mov   r4,#0...'|
000013b0  20 73 77 69 20 20 20 22  53 6f 75 6e 64 5f 43 6f  | swi   "Sound_Co|
000013c0  6e 66 69 67 75 72 65 22  20 20 20 20 3b 47 72 72  |nfigure"    ;Grr|
000013d0  72 68 21 0d 07 1c 04 0d  07 26 34 20 6d 6f 76 20  |rh!......&4 mov |
000013e0  20 20 72 30 2c 23 30 20  20 20 20 20 20 20 20 20  |  r0,#0         |
000013f0  20 20 20 20 20 20 20 3b  52 65 61 64 20 63 75 72  |       ;Read cur|
00001400  72 65 6e 74 20 56 6f 6c  75 6d 65 0d 07 30 19 20  |rent Volume..0. |
00001410  73 77 69 20 20 20 22 53  6f 75 6e 64 5f 56 6f 6c  |swi   "Sound_Vol|
00001420  75 6d 65 22 0d 07 3a 23  20 6d 6f 76 20 20 20 72  |ume"..:# mov   r|
00001430  30 2c 72 30 2c 6c 73 6c  23 31 20 20 20 20 20 20  |0,r0,lsl#1      |
00001440  20 20 20 20 3b 2a 32 0d  07 44 15 20 72 73 62 20  |    ;*2..D. rsb |
00001450  20 20 72 30 2c 72 30 2c  23 32 35 34 0d 07 4e 3d  |  r0,r0,#254..N=|
00001460  20 73 74 72 20 20 20 72  30 2c 56 6f 6c 75 6d 65  | str   r0,Volume|
00001470  20 20 20 20 20 20 20 20  20 20 20 20 3b 61 6e 64  |            ;and|
00001480  20 75 73 65 20 69 74 20  61 73 20 6f 76 65 72 61  | use it as overa|
00001490  6c 6c 20 56 6f 6c 75 6d  65 0d 07 58 11 20 6d 6f  |ll Volume..X. mo|
000014a0  76 20 20 20 70 63 2c 72  31 32 0d 07 62 04 0d 07  |v   pc,r12..b...|
000014b0  6c 14 3b 2a 2a 2a 20 94  4f 4c 55 54 45 20 43 4f  |l.;*** .OLUTE CO|
000014c0  44 45 0d 07 76 04 0d 07  80 0d 2e 76 61 62 73 6f  |DE..v......vabso|
000014d0  6c 75 74 0d 07 8a 14 20  a4 61 64 72 20 28 31 30  |lut.... .adr (10|
000014e0  2c 54 72 61 63 6b 29 0d  07 94 04 0d 07 9e 30 20  |,Track).......0 |
000014f0  6c 64 72 20 20 20 72 31  2c 5b 72 31 30 2c 23 32  |ldr   r1,[r10,#2|
00001500  34 5d 20 20 20 20 20 20  20 20 20 3b 53 65 71 75  |4]         ;Sequ|
00001510  65 6e 63 65 20 4f 66 66  73 65 74 0d 07 a8 14 20  |ence Offset.... |
00001520  61 64 64 20 20 20 72 31  2c 72 31 30 2c 72 31 0d  |add   r1,r10,r1.|
00001530  07 b2 17 20 73 74 72 20  20 20 72 31 2c 5b 72 31  |... str   r1,[r1|
00001540  30 2c 23 32 34 5d 0d 07  bc 2f 20 6c 64 72 20 20  |0,#24].../ ldr  |
00001550  20 72 32 2c 5b 72 31 30  2c 23 32 38 5d 20 20 20  | r2,[r10,#28]   |
00001560  20 20 20 20 20 20 3b 50  61 74 74 65 72 6e 20 4f  |      ;Pattern O|
00001570  66 66 73 65 74 0d 07 c6  14 20 61 64 64 20 20 20  |ffset.... add   |
00001580  72 32 2c 72 31 30 2c 72  32 0d 07 d0 17 20 73 74  |r2,r10,r2.... st|
00001590  72 20 20 20 72 32 2c 5b  72 31 30 2c 23 32 38 5d  |r   r2,[r10,#28]|
000015a0  0d 07 da 04 0d 07 e4 30  20 6c 64 72 42 20 20 72  |.......0 ldrB  r|
000015b0  31 2c 5b 72 31 30 2c 23  32 31 5d 20 20 20 20 20  |1,[r10,#21]     |
000015c0  20 20 20 20 3b 4e 75 6d  62 65 72 20 6f 66 20 49  |    ;Number of I|
000015d0  6e 73 74 73 0d 07 ee 09  2e 76 61 6c 6c 0d 07 f8  |nsts.....vall...|
000015e0  31 20 6c 64 72 20 20 20  72 32 2c 5b 72 31 30 2c  |1 ldr   r2,[r10,|
000015f0  72 31 2c 6c 73 6c 23 35  5d 20 20 20 20 3b 49 6e  |r1,lsl#5]    ;In|
00001600  73 74 20 41 64 64 72 20  4f 66 66 73 65 74 0d 08  |st Addr Offset..|
00001610  02 14 20 61 64 64 20 20  20 72 32 2c 72 31 30 2c  |.. add   r2,r10,|
00001620  72 32 0d 08 0c 26 20 73  74 72 20 20 20 72 32 2c  |r2...& str   r2,|
00001630  5b 72 31 30 2c 72 31 2c  6c 73 6c 23 35 5d 20 20  |[r10,r1,lsl#5]  |
00001640  20 20 3b 2b 69 2a 33 32  0d 08 16 13 20 73 75 62  |  ;+i*32.... sub|
00001650  53 20 20 72 31 2c 72 31  2c 23 31 0d 08 20 0f 20  |S  r1,r1,#1.. . |
00001660  62 4e 65 20 20 20 76 61  6c 6c 0d 08 2a 04 0d 08  |bNe   vall..*...|
00001670  34 36 20 6c 64 72 20 20  20 72 30 2c 5b 70 63 5d  |46 ldr   r0,[pc]|
00001680  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 44  |              ;D|
00001690  6f 20 6e 6f 74 20 63 61  6c 6c 20 72 65 6c 6f 63  |o not call reloc|
000016a0  61 74 65 72 0d 08 3e 2d  20 73 74 72 20 20 20 72  |ater..>- str   r|
000016b0  30 2c 76 61 62 73 6f 6c  75 74 20 20 20 20 20 20  |0,vabsolut      |
000016c0  20 20 20 20 3b 74 77 6f  20 74 69 6d 65 73 2e 2e  |    ;two times..|
000016d0  2e 0d 08 48 11 20 6d 6f  76 20 20 20 70 63 2c 72  |...H. mov   pc,r|
000016e0  31 34 0d 08 52 04 0d 08  5c 15 3b 2a 2a 2a 20 52  |14..R...\.;*** R|
000016f0  45 53 54 41 52 54 20 54  55 4e 45 0d 08 66 04 0d  |ESTART TUNE..f..|
00001700  08 70 0c 2e 76 5f 72 65  73 65 74 0d 08 7a 14 20  |.p..v_reset..z. |
00001710  a4 61 64 72 20 28 31 30  2c 54 72 61 63 6b 29 0d  |.adr (10,Track).|
00001720  08 84 11 20 6d 6f 76 20  20 20 72 31 2c 23 36 34  |... mov   r1,#64|
00001730  0d 08 8e 2b 20 73 74 72  20 20 20 72 31 2c 52 65  |...+ str   r1,Re|
00001740  67 69 73 74 65 72 73 2b  30 20 20 20 20 20 20 20  |gisters+0       |
00001750  3b 50 61 74 74 20 43 6f  75 6e 74 0d 08 98 17 20  |;Patt Count.... |
00001760  6c 64 72 20 20 20 72 32  2c 5b 72 31 30 2c 23 32  |ldr   r2,[r10,#2|
00001770  34 5d 0d 08 a2 39 20 73  74 72 20 20 20 72 32 2c  |4]...9 str   r2,|
00001780  52 65 67 69 73 74 65 72  73 2b 38 20 20 20 20 20  |Registers+8     |
00001790  20 20 3b 43 75 72 72 65  6e 74 20 53 65 71 75 65  |  ;Current Seque|
000017a0  6e 63 65 20 50 6f 69 6e  74 65 72 0d 08 ac 12 20  |nce Pointer.... |
000017b0  6c 64 72 42 20 20 72 32  2c 5b 72 32 5d 0d 08 b6  |ldrB  r2,[r2]...|
000017c0  17 20 6c 64 72 20 20 20  72 33 2c 5b 72 31 30 2c  |. ldr   r3,[r10,|
000017d0  23 32 38 5d 0d 08 c0 23  20 61 64 64 20 20 20 72  |#28]...# add   r|
000017e0  33 2c 72 33 2c 72 32 2c  6c 73 6c 23 31 30 2d 28  |3,r3,r2,lsl#10-(|
000017f0  56 6f 63 73 3d 38 29 0d  08 ca 38 20 73 74 72 20  |Vocs=8)...8 str |
00001800  20 20 72 33 2c 52 65 67  69 73 74 65 72 73 2b 34  |  r3,Registers+4|
00001810  20 20 20 20 20 20 20 3b  43 75 72 72 65 6e 74 20  |       ;Current |
00001820  50 61 74 74 65 72 6e 20  50 6f 69 6e 74 65 72 0d  |Pattern Pointer.|
00001830  08 d4 04 0d 08 de 13 20  61 64 72 20 20 20 72 31  |....... adr   r1|
00001840  31 2c 48 65 61 64 0d 08  e8 2e 20 6d 6f 76 20 20  |1,Head.... mov  |
00001850  20 72 31 2c 23 30 3a 6d  6f 76 20 72 32 2c 23 30  | r1,#0:mov r2,#0|
00001860  3a 6d 6f 76 20 72 33 2c  23 30 3a 6d 6f 76 20 72  |:mov r3,#0:mov r|
00001870  34 2c 23 30 0d 08 f2 2e  20 6d 6f 76 20 20 20 72  |4,#0.... mov   r|
00001880  35 2c 23 30 3a 6d 6f 76  20 72 36 2c 23 30 3a 6d  |5,#0:mov r6,#0:m|
00001890  6f 76 20 72 37 2c 23 30  3a 6d 6f 76 20 72 38 2c  |ov r7,#0:mov r8,|
000018a0  23 30 0d 08 fc 13 20 6d  6f 76 20 20 20 72 30 2c  |#0.... mov   r0,|
000018b0  23 56 6f 63 73 0d 09 06  09 2e 76 61 6c 6c 0d 09  |#Vocs.....vall..|
000018c0  10 3b 20 73 74 6d 69 61  20 72 31 31 21 2c 7b 72  |.; stmia r11!,{r|
000018d0  31 2d 72 38 7d 20 20 20  20 20 20 20 20 20 3b 43  |1-r8}         ;C|
000018e0  6c 65 61 72 20 61 6c 6c  20 63 68 61 6e 6e 65 6c  |lear all channel|
000018f0  20 68 65 61 64 73 2e 2e  2e 0d 09 1a 13 20 73 75  | heads....... su|
00001900  62 53 20 20 72 30 2c 72  30 2c 23 31 0d 09 24 0f  |bS  r0,r0,#1..$.|
00001910  20 62 4e 65 20 20 20 76  61 6c 6c 0d 09 2e 11 20  | bNe   vall.... |
00001920  6d 6f 76 20 20 20 70 63  2c 72 31 34 0d 09 38 04  |mov   pc,r14..8.|
00001930  0d 09 42 20 3b 2a 2a 2a  20 54 55 52 4e 20 87 20  |..B ;*** TURN . |
00001940  50 4c 41 59 45 52 20 80  20 43 4f 43 4f 2d c8 a1  |PLAYER . COCO-..|
00001950  0d 09 4c 04 0d 09 56 0a  2e 76 5f 6f 66 66 0d 09  |..L...V..v_off..|
00001960  60 35 20 6d 6f 76 20 20  20 72 30 2c 23 31 33 20  |`5 mov   r0,#13 |
00001970  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 44  |              ;D|
00001980  69 73 61 62 6c 65 20 45  76 65 6e 74 20 4e 72 2e  |isable Event Nr.|
00001990  20 72 31 0d 09 6a 32 20  6d 6f 76 20 20 20 72 31  | r1..j2 mov   r1|
000019a0  2c 23 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#4             |
000019b0  20 20 20 3b 28 34 20 3d  20 56 53 79 6e 63 20 45  |   ;(4 = VSync E|
000019c0  76 65 6e 74 29 0d 09 74  14 20 73 77 69 20 20 20  |vent)..t. swi   |
000019d0  22 4f 53 5f 42 79 74 65  22 0d 09 7e 3b 20 6d 6f  |"OS_Byte"..~; mo|
000019e0  76 20 20 20 72 30 2c 23  31 36 20 20 20 20 20 20  |v   r0,#16      |
000019f0  20 20 20 20 20 20 20 20  20 3b 46 72 65 65 20 45  |         ;Free E|
00001a00  56 45 4e 54 20 56 65 63  74 6f 72 20 28 4e 72 2e  |VENT Vector (Nr.|
00001a10  20 31 36 29 0d 09 88 14  20 61 64 72 20 20 20 72  | 16).... adr   r|
00001a20  31 2c 76 69 6e 74 65 72  0d 09 92 12 20 61 64 72  |1,vinter.... adr|
00001a30  20 20 20 72 32 2c 48 65  61 64 0d 09 9c 17 20 73  |   r2,Head.... s|
00001a40  77 69 20 20 20 22 4f 53  5f 52 65 6c 65 61 73 65  |wi   "OS_Release|
00001a50  22 0d 09 a6 04 0d 09 b0  13 20 6c 64 72 20 20 20  |"........ ldr   |
00001a60  72 31 2c 56 73 6c 6f 74  0d 09 ba 45 20 73 77 69  |r1,Vslot...E swi|
00001a70  20 20 20 22 53 6f 75 6e  64 5f 52 65 6d 6f 76 65  |   "Sound_Remove|
00001a80  56 6f 69 63 65 22 20 20  3b 4c 61 73 74 20 62 75  |Voice"  ;Last bu|
00001a90  74 20 6e 6f 74 20 6c 65  61 73 74 2e 2e 2e 20 46  |t not least... F|
00001aa0  72 65 65 20 56 6f 69 63  65 53 6c 6f 74 0d 09 c4  |ree VoiceSlot...|
00001ab0  10 20 6d 6f 76 20 20 20  72 30 2c 23 31 0d 09 ce  |. mov   r0,#1...|
00001ac0  10 20 6d 6f 76 20 20 20  72 31 2c 23 31 0d 09 d8  |. mov   r1,#1...|
00001ad0  2c 20 73 77 69 20 20 20  22 53 6f 75 6e 64 5f 41  |, swi   "Sound_A|
00001ae0  74 74 61 63 68 56 6f 69  63 65 22 20 20 3b 52 65  |ttachVoice"  ;Re|
00001af0  69 6e 69 74 20 42 65 6c  6c 0d 09 e2 11 20 6d 6f  |init Bell.... mo|
00001b00  76 20 20 20 70 63 2c 72  31 34 0d 09 ec 04 0d 09  |v   pc,r14......|
00001b10  f6 0d 2e 56 73 74 65 72  65 6f 73 0d 0a 00 32 20  |...Vstereos...2 |
00001b20  64 63 64 20 2d 35 30 20  20 20 20 20 20 3b 53 74  |dcd -50      ;St|
00001b30  65 72 65 6f 20 50 6f 73  69 74 69 6f 6e 73 20 66  |ereo Positions f|
00001b40  6f 72 20 34 20 63 68 61  6e 6e 65 6c 73 0d 0a 0a  |or 4 channels...|
00001b50  0c 20 64 63 64 20 2d 32  30 0d 0a 14 0c 20 64 63  |. dcd -20.... dc|
00001b60  64 20 20 32 30 0d 0a 1e  0c 20 64 63 64 20 20 35  |d  20.... dcd  5|
00001b70  30 0d 0a 28 04 0d 0a 32  32 20 64 63 64 2d 31 32  |0..(...22 dcd-12|
00001b80  36 20 20 20 20 20 20 3b  53 74 65 72 65 6f 20 50  |6      ;Stereo P|
00001b90  6f 73 69 74 69 6f 6e 73  20 66 6f 72 20 38 20 63  |ositions for 8 c|
00001ba0  68 61 6e 6e 65 6c 73 0d  0a 3c 0c 20 64 63 64 20  |hannels..<. dcd |
00001bb0  2d 39 30 0d 0a 46 0c 20  64 63 64 20 2d 35 34 0d  |-90..F. dcd -54.|
00001bc0  0a 50 0c 20 64 63 64 20  2d 31 38 0d 0a 5a 0c 20  |.P. dcd -18..Z. |
00001bd0  64 63 64 20 20 31 38 0d  0a 64 0c 20 64 63 64 20  |dcd  18..d. dcd |
00001be0  20 35 34 0d 0a 6e 0c 20  64 63 64 20 20 39 30 0d  | 54..n. dcd  90.|
00001bf0  0a 78 0c 20 64 63 64 20  31 32 36 0d 0a 82 04 0d  |.x. dcd 126.....|
00001c00  0a 8c 10 2e 56 73 6c 6f  74 20 64 63 64 20 30 0d  |....Vslot dcd 0.|
00001c10  0a 96 04 0d 0a a0 48 3b  3d 3d 3d 3d 20 c8 99 54  |......H;==== ..T|
00001c20  45 4d 20 d4 20 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |EM . ===========|
00001c30  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00001c50  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 0d 0a aa 04 0d  |===========.....|
00001c60  0a b4 40 3b 20 72 36 20  4e 65 67 2e 20 69 66 20  |..@; r6 Neg. if |
00001c70  6e 65 77 20 48 61 6e 64  6c 65 72 20 20 20 20 72  |new Handler    r|
00001c80  31 30 20 50 6f 69 6e 74  65 72 20 74 6f 20 65 6e  |10 Pointer to en|
00001c90  64 20 6f 66 20 44 4d 41  20 62 75 66 66 65 72 0d  |d of DMA buffer.|
00001ca0  0a be 4d 3b 20 72 37 20  43 68 61 6e 6e 65 6c 20  |..M; r7 Channel |
00001cb0  6e 75 6d 62 65 72 20 20  20 20 20 20 20 20 20 72  |number         r|
00001cc0  31 31 20 49 6e 63 72 65  6d 65 6e 74 20 28 69 6e  |11 Increment (in|
00001cd0  74 65 72 6c 65 61 66 29  20 74 6f 20 75 73 65 20  |terleaf) to use |
00001ce0  77 68 65 6e 20 77 72 69  74 69 6e 67 0d 0a c8 4d  |when writing...M|
00001cf0  3b 20 72 38 20 53 61 6d  70 6c 65 20 70 65 72 69  |; r8 Sample peri|
00001d00  6f 64 20 69 6e 20 75 73  20 20 20 20 72 31 32 20  |od in us    r12 |
00001d10  50 6f 69 6e 74 65 72 20  74 6f 20 28 73 74 61 72  |Pointer to (star|
00001d20  74 20 6f 66 20 44 4d 41  20 2b 20 69 6e 74 65 72  |t of DMA + inter|
00001d30  6c 65 61 66 20 4f 66 73  29 0d 0a d2 4d 3b 20 72  |leaf Ofs)...M; r|
00001d40  39 20 50 6f 69 6e 74 65  72 20 74 6f 20 53 43 43  |9 Pointer to SCC|
00001d50  42 20 20 20 20 20 20 20  20 46 69 6c 6c 65 72 20  |B        Filler |
00001d60  69 73 20 65 6e 74 65 72  65 64 20 69 6e 20 49 52  |is entered in IR|
00001d70  51 20 6d 6f 64 65 20 26  20 49 6e 74 73 20 65 6e  |Q mode & Ints en|
00001d80  61 62 6c 65 64 21 0d 0a  dc 04 0d 0a e6 0e 2e 56  |abled!.........V|
00001d90  6f 69 63 65 42 61 73 65  0d 0a f0 3f 20 62 20 20  |oiceBase...? b  |
00001da0  20 20 20 76 66 69 6c 6c  20 20 20 20 20 20 20 20  |   vfill        |
00001db0  20 20 20 20 20 20 20 20  3b 46 69 6c 6c 20 20 20  |        ;Fill   |
00001dc0  20 20 20 20 20 20 66 6f  72 20 73 6d 6f 6f 74 68  |      for smooth|
00001dd0  20 61 64 6a 75 73 74 0d  0a fa 3f 20 62 20 20 20  | adjust...? b   |
00001de0  20 20 76 66 69 6c 6c 20  20 20 20 20 20 20 20 20  |  vfill         |
00001df0  20 20 20 20 20 20 20 3b  55 70 64 61 74 65 20 20  |       ;Update  |
00001e00  20 20 20 20 20 66 6f 72  20 74 6f 6e 65 20 63 6f  |     for tone co|
00001e10  6e 74 69 6e 75 65 0d 0b  04 3a 20 62 20 20 20 20  |ntinue...: b    |
00001e20  20 76 66 69 6c 6c 20 20  20 20 20 20 20 20 20 20  | vfill          |
00001e30  20 20 20 20 20 20 3b 47  61 74 65 4f 6e 20 20 20  |      ;GateOn   |
00001e40  20 20 20 20 66 6f 72 20  6e 65 77 20 74 6f 6e 65  |    for new tone|
00001e50  0d 0b 0e 3f 20 6c 64 6d  66 64 20 72 31 33 21 2c  |...? ldmfd r13!,|
00001e60  7b 70 63 7d 20 20 20 20  20 20 20 20 20 20 20 20  |{pc}            |
00001e70  3b 47 61 74 65 4f 66 66  20 20 20 20 20 20 66 6f  |;GateOff      fo|
00001e80  72 20 74 6f 6e 65 20 66  6c 75 73 68 69 6e 67 0d  |r tone flushing.|
00001e90  0b 18 48 20 6c 64 6d 66  64 20 72 31 33 21 2c 7b  |..H ldmfd r13!,{|
00001ea0  70 63 7d 20 20 20 20 20  20 20 20 20 20 20 20 3b  |pc}            ;|
00001eb0  49 6e 73 74 61 6e 74 69  61 74 65 2c 20 20 20 41  |Instantiate,   A|
00001ec0  74 74 61 63 68 20 20 20  20 56 6f 69 63 65 47 65  |ttach    VoiceGe|
00001ed0  6e 65 72 61 74 6f 72 0d  0b 22 4a 20 6c 64 6d 66  |nerator.."J ldmf|
00001ee0  64 20 72 31 33 21 2c 7b  70 63 7d 20 20 20 20 20  |d r13!,{pc}     |
00001ef0  20 20 20 20 20 20 20 3b  44 65 49 6e 73 74 61 6e  |       ;DeInstan|
00001f00  74 69 61 74 65 2c 20 44  65 74 61 63 68 20 20 20  |tiate, Detach   |
00001f10  74 6f 2f 66 72 6f 6d 20  61 20 63 68 61 6e 6e 65  |to/from a channe|
00001f20  6c 0d 0b 2c 2e 20 6c 64  6d 66 64 20 72 31 33 21  |l..,. ldmfd r13!|
00001f30  2c 7b 70 63 7d 20 20 20  20 20 20 20 20 20 20 20  |,{pc}           |
00001f40  20 3b 48 65 6c 6c 6f 20  41 72 74 68 75 72 21 0d  | ;Hello Arthur!.|
00001f50  0b 36 3e 20 64 63 64 20  20 20 56 6e 61 6d 65 2d  |.6> dcd   Vname-|
00001f60  56 6f 69 63 65 42 61 73  65 20 20 20 20 20 20 3b  |VoiceBase      ;|
00001f70  4f 66 66 73 65 74 20 66  72 6f 6d 20 56 6f 69 63  |Offset from Voic|
00001f80  65 42 61 73 65 20 74 6f  20 4e 61 6d 65 0d 0b 40  |eBase to Name..@|
00001f90  1c 2e 56 6e 61 6d 65 20  64 63 62 20 22 43 6f 63  |..Vname dcb "Coc|
00001fa0  6f 70 6c 65 78 22 2b bd  30 0d 0b 4a 0a 20 61 6c  |oplex"+.0..J. al|
00001fb0  69 67 6e 0d 0b 54 04 0d  0b 5e 0a 2e 76 66 69 6c  |ign..T...^..vfil|
00001fc0  6c 0d 0b 68 43 20 74 65  71 50 20 20 70 63 2c 23  |l..hC teqP  pc,#|
00001fd0  28 31 3c 3c 32 37 29 20  84 20 25 31 30 20 20 20  |(1<<27) . %10   |
00001fe0  3b 44 69 73 61 62 6c 65  20 49 52 51 2c 20 6e 6f  |;Disable IRQ, no|
00001ff0  20 6d 6f 72 65 20 4c 6f  73 65 72 20 66 69 6c 6c  | more Loser fill|
00002000  69 6e 67 21 0d 0b 72 3d  20 61 64 72 20 20 20 72  |ing!..r= adr   r|
00002010  38 2c 48 65 61 64 20 20  20 20 20 20 20 20 20 20  |8,Head          |
00002020  20 20 20 20 3b 57 65 20  75 73 65 20 61 6e 20 6f  |    ;We use an o|
00002030  77 6e 20 43 6f 6e 74 72  6f 6c 6c 5f 42 6c 6f 63  |wn Controll_Bloc|
00002040  6b 0d 0b 7c 34 20 61 64  64 20 20 20 72 38 2c 72  |k..|4 add   r8,r|
00002050  38 2c 72 37 2c 6c 73 6c  23 35 20 20 20 20 20 20  |8,r7,lsl#5      |
00002060  20 3b 70 6f 69 6e 74 20  74 6f 20 48 65 61 64 2b  | ;point to Head+|
00002070  72 37 2a 33 32 0d 0b 86  39 20 6c 64 6d 49 61 20  |r7*32...9 ldmIa |
00002080  72 38 2c 7b 72 31 2d 72  36 7d 20 20 20 20 20 20  |r8,{r1-r6}      |
00002090  20 20 20 20 20 3b 4c 6f  61 64 20 36 20 77 6f 72  |     ;Load 6 wor|
000020a0  6b 69 6e 67 20 52 65 67  69 73 74 65 72 73 0d 0b  |king Registers..|
000020b0  90 14 20 6c 64 72 20 20  20 72 30 2c 56 6f 6c 75  |.. ldr   r0,Volu|
000020c0  6d 65 0d 0b 9a 45 20 61  64 64 20 20 20 72 35 2c  |me...E add   r5,|
000020d0  72 35 2c 72 30 20 20 20  20 20 20 20 20 20 20 20  |r5,r0           |
000020e0  20 20 3b 41 64 64 20 4f  76 65 72 61 6c 6c 5f 56  |  ;Add Overall_V|
000020f0  6f 6c 75 6d 65 20 74 6f  20 43 68 61 6e 6e 65 6c  |olume to Channel|
00002100  5f 56 6f 6c 75 6d 65 0d  0b a4 04 0d 0b ae 0d 2e  |_Volume.........|
00002110  76 66 69 6c 6c 6f 6f 70  0d 0b b8 48 5d 3a e3 20  |vfilloop...H]:. |
00002120  6e 3d 31 20 b8 20 67 61  70 3a 5b 4f 50 54 20 70  |n=1 . gap:[OPT p|
00002130  20 20 20 20 20 3b 46 69  6c 6c 20 6f 6e 65 20 62  |     ;Fill one b|
00002140  79 74 65 20 31 36 20 74  69 6d 65 73 2c 20 66 6f  |yte 16 times, fo|
00002150  72 20 32 30 38 20 2d 3e  20 31 33 20 72 75 6e 73  |r 208 -> 13 runs|
00002160  0d 0b c2 43 20 6c 64 72  42 20 20 72 30 2c 5b 72  |...C ldrB  r0,[r|
00002170  33 2c 72 31 2c 6c 73 72  23 31 36 5d 20 20 20 20  |3,r1,lsr#16]    |
00002180  3b 4c 6f 61 64 20 73 61  6d 70 6c 65 20 62 79 74  |;Load sample byt|
00002190  65 20 28 48 69 67 68 57  6f 72 64 20 6f 66 20 50  |e (HighWord of P|
000021a0  6f 73 29 0d 0b cc 48 20  73 75 62 53 20 20 72 30  |os)...H subS  r0|
000021b0  2c 72 30 2c 72 35 20 20  20 20 20 20 20 20 20 20  |,r0,r5          |
000021c0  20 20 20 3b 4d 69 6e 75  73 20 56 6f 6c 75 6d 65  |   ;Minus Volume|
000021d0  20 28 77 68 65 72 65 20  30 3d 6c 6f 75 64 20 26  | (where 0=loud &|
000021e0  20 32 35 35 3d 71 75 69  65 74 29 0d 0b d6 10 20  | 255=quiet).... |
000021f0  6d 6f 76 4d 69 20 72 30  2c 23 30 0d 0b e0 3c 20  |movMi r0,#0...< |
00002200  73 74 72 42 20 20 72 30  2c 5b 72 31 32 5d 2c 72  |strB  r0,[r12],r|
00002210  31 31 20 20 20 20 20 20  20 20 20 3b 41 6e 64 20  |11         ;And |
00002220  70 75 74 20 69 74 20 69  6e 74 6f 20 56 49 44 43  |put it into VIDC|
00002230  2d 62 75 66 66 65 72 0d  0b ea 36 20 61 64 64 20  |-buffer...6 add |
00002240  20 20 72 31 2c 72 31 2c  72 32 20 20 20 20 20 20  |  r1,r1,r2      |
00002250  20 20 20 20 20 20 20 3b  41 64 64 20 50 69 74 63  |       ;Add Pitc|
00002260  68 20 28 66 69 78 20 70  6f 69 6e 74 29 0d 0b f4  |h (fix point)...|
00002270  0e 5d 3a ed 3a 5b 4f 50  54 20 70 0d 0b fe 04 0d  |.]:.:[OPT p.....|
00002280  0c 08 48 20 63 6d 70 20  20 20 72 34 2c 72 31 2c  |..H cmp   r4,r1,|
00002290  6c 73 72 23 31 36 20 20  20 20 20 20 20 20 20 3b  |lsr#16         ;|
000022a0  4c 65 6e 67 74 68 20 65  78 63 65 65 64 65 64 3f  |Length exceeded?|
000022b0  20 28 4c 65 6e 20 3c 20  66 69 78 70 6f 69 6e 74  | (Len < fixpoint|
000022c0  65 64 20 50 6f 73 29 0d  0c 12 3a 20 6d 6f 76 4c  |ed Pos)...: movL|
000022d0  73 20 72 31 2c 72 36 20  20 20 20 20 20 20 20 20  |s r1,r6         |
000022e0  20 20 20 20 20 20 20 3b  59 65 73 2c 20 73 6f 20  |       ;Yes, so |
000022f0  52 65 70 41 74 20 69 73  20 6e 65 77 20 50 6f 73  |RepAt is new Pos|
00002300  2c 0d 0c 1c 34 20 63 6d  70 20 20 20 72 31 2c 23  |,...4 cmp   r1,#|
00002310  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00002320  20 3b 20 20 20 20 62 75  74 20 69 73 20 69 74 20  | ;    but is it |
00002330  7a 65 72 6f 3f 0d 0c 26  4c 20 6d 6f 76 45 71 20  |zero?..&L movEq |
00002340  72 32 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |r2,#0           |
00002350  20 20 20 20 20 3b 20 20  20 20 79 65 73 20 2d 3e  |     ;    yes ->|
00002360  20 4d 75 74 65 20 43 68  61 6e 6e 65 6c 20 28 69  | Mute Channel (i|
00002370  65 20 53 65 74 20 50 69  74 63 68 20 74 6f 20 30  |e Set Pitch to 0|
00002380  29 0d 0c 30 3c 20 63 6d  70 20 20 20 72 31 32 2c  |)..0< cmp   r12,|
00002390  72 31 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |r10             |
000023a0  20 3b 56 49 44 43 2d 42  75 66 66 65 72 20 66 69  | ;VIDC-Buffer fi|
000023b0  6c 6c 65 64 20 61 6c 72  65 61 64 79 3f 0d 0c 3a  |lled already?..:|
000023c0  28 20 62 4c 6f 20 20 20  76 66 69 6c 6c 6f 6f 70  |( bLo   vfilloop|
000023d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 4e 6f  |             ;No|
000023e0  6f 6f 2e 2e 2e 0d 0c 44  46 20 73 74 6d 49 61 20  |oo.....DF stmIa |
000023f0  72 38 2c 7b 72 31 2d 72  32 7d 20 20 20 20 20 20  |r8,{r1-r2}      |
00002400  20 20 20 20 20 3b 53 61  76 65 20 74 68 65 20 74  |     ;Save the t|
00002410  77 6f 20 28 70 72 6f 62  61 62 6c 79 29 20 6d 6f  |wo (probably) mo|
00002420  64 69 66 69 65 64 20 72  65 67 73 0d 0c 4e 04 0d  |dified regs..N..|
00002430  0c 58 42 20 6d 6f 76 20  20 20 72 30 2c 23 25 30  |.XB mov   r0,#%0|
00002440  30 30 30 31 30 30 30 20  20 20 20 20 20 20 20 3b  |0001000        ;|
00002450  41 6e 64 20 72 65 74 75  72 6e 20 77 69 74 68 20  |And return with |
00002460  56 6f 69 63 65 5f 41 63  74 69 76 65 5f 46 6c 61  |Voice_Active_Fla|
00002470  67 0d 0c 62 31 20 74 65  71 50 20 20 70 63 2c 23  |g..b1 teqP  pc,#|
00002480  28 30 3c 3c 32 37 29 20  84 20 25 31 30 20 20 20  |(0<<27) . %10   |
00002490  3b 45 6e 61 62 6c 65 20  49 52 51 20 61 67 61 69  |;Enable IRQ agai|
000024a0  6e 21 0d 0c 6c 14 20 6c  64 6d 66 64 20 72 31 33  |n!..l. ldmfd r13|
000024b0  21 2c 7b 70 63 7d 0d 0c  76 04 0d 0c 80 09 2e 48  |!,{pc}..v......H|
000024c0  65 61 64 0d 0c 8a 4b 20  64 63 64 20 30 20 20 20  |ead...K dcd 0   |
000024d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000024e0  20 20 20 3b 72 31 20 50  6f 73 20 69 6e 20 74 68  |   ;r1 Pos in th|
000024f0  65 20 73 61 6d 70 6c 65  20 28 4f 66 66 73 65 74  |e sample (Offset|
00002500  20 69 6e 20 66 69 78 20  70 6f 69 6e 74 29 0d 0c  | in fix point)..|
00002510  94 4a 20 64 63 64 20 30  20 20 20 20 20 20 20 20  |.J dcd 0        |
00002520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 72  |              ;r|
00002530  32 20 49 6e 63 72 65 6d  65 6e 74 2f 50 69 74 63  |2 Increment/Pitc|
00002540  68 20 28 4c 6f 77 57 6f  72 64 20 66 6f 72 20 66  |h (LowWord for f|
00002550  69 78 70 6f 69 6e 74 29  0d 0c 9e 31 20 64 63 64  |ixpoint)...1 dcd|
00002560  20 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 0              |
00002570  20 20 20 20 20 20 20 20  3b 72 33 20 53 61 6d 70  |        ;r3 Samp|
00002580  6c 65 20 41 64 72 65 73  73 0d 0c a8 2a 20 64 63  |le Adress...* dc|
00002590  64 20 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |d 0             |
000025a0  20 20 20 20 20 20 20 20  20 3b 72 34 20 4c 65 6e  |         ;r4 Len|
000025b0  67 74 68 0d 0c b2 41 20  64 63 64 20 30 20 20 20  |gth...A dcd 0   |
000025c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000025d0  20 20 20 3b 72 35 20 56  6f 6c 75 6d 65 20 28 30  |   ;r5 Volume (0|
000025e0  3d 4c 6f 75 64 20 2e 2e  2e 20 32 35 35 3d 51 75  |=Loud ... 255=Qu|
000025f0  69 65 74 29 0d 0c bc 4d  20 64 63 64 20 30 20 20  |iet)...M dcd 0  |
00002600  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002610  20 20 20 20 3b 72 36 20  52 65 70 41 74 20 28 4e  |    ;r6 RepAt (N|
00002620  65 77 20 66 69 78 70 6f  69 6e 74 20 50 6f 73 29  |ew fixpoint Pos)|
00002630  2c 20 6f 72 20 30 20 66  6f 72 20 4e 4f 20 52 45  |, or 0 for NO RE|
00002640  50 0d 0c c6 42 20 64 63  64 20 30 20 20 20 20 20  |P...B dcd 0     |
00002650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002660  20 3b 42 79 74 65 20 2b  32 34 20 56 61 6c 75 65  | ;Byte +24 Value|
00002670  20 66 6f 72 20 41 75 74  6f 20 56 6f 6c 75 6d 65  | for Auto Volume|
00002680  20 75 70 0d 0c d0 44 20  20 20 20 20 20 20 20 20  | up...D         |
00002690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000026a0  20 20 20 3b 20 20 20 20  20 20 32 35 20 20 20 22  |   ;      25   "|
000026b0  20 20 20 20 22 20 20 20  22 20 20 20 56 6f 6c 75  |    "   "   Volu|
000026c0  6d 65 20 64 6f 77 6e 0d  0c da 41 20 20 20 20 20  |me down...A     |
000026d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000026e0  20 20 20 20 20 20 20 3b  20 20 20 20 20 20 32 36  |       ;      26|
000026f0  20 20 20 22 20 20 20 20  22 20 20 20 22 20 20 20  |   "    "   "   |
00002700  50 69 74 63 68 20 75 70  0d 0c e4 43 20 20 20 20  |Pitch up...C    |
00002710  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002720  20 20 20 20 20 20 20 20  3b 20 20 20 20 20 20 32  |        ;      2|
00002730  37 20 20 20 22 20 20 20  20 22 20 20 20 22 20 20  |7   "    "   "  |
00002740  20 50 69 74 63 68 20 64  6f 77 6e 0d 0c ee 3a 20  | Pitch down...: |
00002750  64 63 64 20 30 20 20 20  20 20 20 20 20 20 20 20  |dcd 0           |
00002760  20 20 20 20 20 20 20 20  20 20 20 3b 42 79 74 65  |           ;Byte|
00002770  20 2b 32 38 20 41 63 74  75 61 6c 20 49 6e 66 6f  | +28 Actual Info|
00002780  20 42 79 74 65 0d 0c f8  3a 20 20 20 20 20 20 20  | Byte...:       |
00002790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000027a0  20 20 20 20 20 3b 20 20  20 20 20 20 32 39 20 41  |     ;      29 A|
000027b0  63 74 75 61 6c 20 43 6f  6d 6d 20 42 79 74 65 0d  |ctual Comm Byte.|
000027c0  0d 02 39 20 20 20 20 20  20 20 20 20 20 20 20 20  |..9             |
000027d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000027e0  20 20 20 20 20 20 33 30  20 28 53 6f 75 6e 64 20  |      30 (Sound |
000027f0  46 58 20 46 6c 61 67 29  0d 0d 0c 3e 20 20 20 20  |FX Flag)...>    |
00002800  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002810  20 20 20 20 20 20 20 20  3b 20 20 20 20 20 20 33  |        ;      3|
00002820  31 20 4c 61 73 74 20 6c  65 67 61 6c 20 74 6f 6e  |1 Last legal ton|
00002830  65 2f 6e 6f 74 65 0d 0d  16 04 0d 0d 20 35 20 64  |e/note...... 5 d|
00002840  63 62 20 c4 33 2a 33 32  2d 34 2a 33 32 2a 28 56  |cb .3*32-4*32*(V|
00002850  6f 63 73 3d 38 29 2c bd  30 29 20 20 20 20 3b 41  |ocs=8),.0)    ;A|
00002860  64 64 20 33 20 6f 72 20  37 20 48 65 61 64 73 0d  |dd 3 or 7 Heads.|
00002870  0d 2a 04 0d 0d 34 35 2e  56 6f 6c 75 6d 65 20 20  |.*...45.Volume  |
00002880  20 20 20 20 20 64 63 64  20 30 20 20 20 20 20 20  |     dcd 0      |
00002890  20 20 20 3b 4f 76 65 72  61 6c 6c 5f 53 6f 75 6e  |   ;Overall_Soun|
000028a0  64 5f 56 6f 6c 75 6d 65  0d 0d 3e 04 0d 0d 48 4d  |d_Volume..>...HM|
000028b0  3b 3d 3d 3d 3d 20 50 4c  41 59 20 45 56 45 4e 54  |;==== PLAY EVENT|
000028c0  20 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  | ===============|
000028d0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000028f0  3d 3d 3d 3d 3d 3d 3d 3d  3d 0d 0d 52 05 20 0d 0d  |=========..R. ..|
00002900  5c 3d 3b 2a 2a 2a 20 44  4f 20 45 56 45 52 59 20  |\=;*** DO EVERY |
00002910  56 53 59 4e 43 20 45 46  46 45 43 54 53 20 28 23  |VSYNC EFFECTS (#|
00002920  72 30 3d 54 69 6d 65 72  20 2e 2e 2e 20 24 72 30  |r0=Timer ... $r0|
00002930  3d 70 72 65 73 65 72 76  65 64 29 0d 0d 66 04 0d  |=preserved)..f..|
00002940  0d 70 0d 2e 76 65 66 66  65 63 74 73 0d 0d 7a 33  |.p..veffects..z3|
00002950  20 6c 64 72 20 20 20 72  34 2c 5b 72 31 32 2c 23  | ldr   r4,[r12,#|
00002960  34 5d 20 20 20 20 20 20  20 20 20 20 3b 4c 6f 61  |4]          ;Loa|
00002970  64 20 63 75 72 72 65 6e  74 20 50 69 74 63 68 0d  |d current Pitch.|
00002980  0d 84 4a 20 63 6d 70 20  20 20 72 34 2c 23 30 20  |..J cmp   r4,#0 |
00002990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000029a0  4e 6f 20 61 63 74 69 76  65 20 74 6f 6e 65 20 2d  |No active tone -|
000029b0  3e 20 73 6f 72 72 79 2c  20 65 66 66 65 63 74 20  |> sorry, effect |
000029c0  64 69 73 61 62 6c 65 64  21 0d 0d 8e 11 20 6d 6f  |disabled!.... mo|
000029d0  76 45 71 20 70 63 2c 72  31 34 0d 0d 98 32 20 6c  |vEq pc,r14...2 l|
000029e0  64 72 20 20 20 72 33 2c  5b 72 31 32 2c 23 32 34  |dr   r3,[r12,#24|
000029f0  5d 20 20 20 20 20 20 20  20 20 3b 4c 6f 61 64 20  |]         ;Load |
00002a00  41 75 74 6f 2d 45 66 66  65 63 74 73 0d 0d a2 29  |Auto-Effects...)|
00002a10  20 6d 6f 76 20 20 20 72  31 30 2c 72 31 34 20 20  | mov   r10,r14  |
00002a20  20 20 20 20 20 20 20 20  20 20 20 20 3b 50 75 73  |            ;Pus|
00002a30  68 20 72 31 34 0d 0d ac  39 20 61 6e 64 53 20 20  |h r14...9 andS  |
00002a40  72 32 2c 72 33 2c 23 26  66 66 20 20 20 20 20 20  |r2,r3,#&ff      |
00002a50  20 20 20 20 20 3b 49 73  20 74 68 65 72 65 20 41  |     ;Is there A|
00002a60  75 74 6f 20 56 6f 6c 75  6d 65 20 75 70 3f 0d 0d  |uto Volume up?..|
00002a70  b6 12 20 62 6c 4e 65 20  20 76 5f 76 6f 6c 75 70  |.. blNe  v_volup|
00002a80  0d 0d c0 3b 20 61 6e 64  53 20 20 72 32 2c 72 33  |...; andS  r2,r3|
00002a90  2c 23 26 66 66 20 3c 3c  38 20 20 20 20 20 20 20  |,#&ff <<8       |
00002aa0  3b 49 73 20 74 68 65 72  65 20 41 75 74 6f 20 56  |;Is there Auto V|
00002ab0  6f 6c 75 6d 65 20 64 6f  77 6e 3f 0d 0d ca 16 20  |olume down?.... |
00002ac0  6d 6f 76 4e 65 20 72 32  2c 72 32 2c 6c 73 72 23  |movNe r2,r2,lsr#|
00002ad0  38 0d 0d d4 14 20 62 6c  4e 65 20 20 76 5f 76 6f  |8.... blNe  v_vo|
00002ae0  6c 64 6f 77 6e 0d 0d de  38 20 61 6e 64 53 20 20  |ldown...8 andS  |
00002af0  72 32 2c 72 33 2c 23 26  66 66 20 3c 3c 31 36 20  |r2,r3,#&ff <<16 |
00002b00  20 20 20 20 20 3b 49 73  20 74 68 65 72 65 20 41  |     ;Is there A|
00002b10  75 74 6f 20 50 69 74 63  68 20 75 70 3f 0d 0d e8  |uto Pitch up?...|
00002b20  17 20 6d 6f 76 4e 65 20  72 32 2c 72 32 2c 6c 73  |. movNe r2,r2,ls|
00002b30  72 23 31 36 0d 0d f2 12  20 62 6c 4e 65 20 20 76  |r#16.... blNe  v|
00002b40  5f 61 72 63 75 70 0d 0d  fc 3a 20 61 6e 64 53 20  |_arcup...: andS |
00002b50  20 72 32 2c 72 33 2c 23  26 66 66 20 3c 3c 32 34  | r2,r3,#&ff <<24|
00002b60  20 20 20 20 20 20 3b 49  73 20 74 68 65 72 65 20  |      ;Is there |
00002b70  41 75 74 6f 20 50 69 74  63 68 20 64 6f 77 6e 3f  |Auto Pitch down?|
00002b80  0d 0e 06 17 20 6d 6f 76  4e 65 20 72 32 2c 72 32  |.... movNe r2,r2|
00002b90  2c 6c 73 72 23 32 34 0d  0e 10 14 20 62 6c 4e 65  |,lsr#24.... blNe|
00002ba0  20 20 76 5f 61 72 63 64  6f 77 6e 0d 0e 1a 29 20  |  v_arcdown...) |
00002bb0  6d 6f 76 20 20 20 72 31  34 2c 72 31 30 20 20 20  |mov   r14,r10   |
00002bc0  20 20 20 20 20 20 20 20  20 20 20 3b 50 6f 70 20  |           ;Pop |
00002bd0  20 72 31 34 0d 0e 24 04  0d 0e 2e 4b 20 6c 64 72  | r14..$....K ldr|
00002be0  20 20 20 72 31 2c 5b 72  31 32 2c 23 32 38 5d 20  |   r1,[r12,#28] |
00002bf0  20 20 20 20 20 20 20 20  3b 45 66 66 65 63 74 20  |        ;Effect |
00002c00  4c 57 6f 72 64 20 26 20  4c 61 73 74 20 54 6f 6e  |LWord & Last Ton|
00002c10  65 20 61 72 65 20 69 6e  20 74 68 65 20 48 65 61  |e are in the Hea|
00002c20  64 65 72 0d 0e 38 31 20  61 6e 64 53 20 20 72 32  |der..81 andS  r2|
00002c30  2c 72 31 2c 23 26 66 66  20 20 20 20 20 20 20 20  |,r1,#&ff        |
00002c40  20 20 20 3b 49 73 6f 6c  61 74 65 20 49 6e 66 6f  |   ;Isolate Info|
00002c50  42 79 74 65 0d 0e 42 45  20 6d 6f 76 45 71 20 70  |Byte..BE movEq p|
00002c60  63 2c 72 31 34 20 20 20  20 20 20 20 20 20 20 20  |c,r14           |
00002c70  20 20 20 20 3b 69 66 20  30 2c 20 74 68 65 6e 20  |    ;if 0, then |
00002c80  74 68 65 72 65 27 73 20  6e 6f 20 65 66 66 65 63  |there's no effec|
00002c90  74 20 61 74 20 61 6c 6c  21 0d 0e 4c 36 20 61 6e  |t at all!..L6 an|
00002ca0  64 20 20 20 72 33 2c 72  31 2c 23 26 66 66 30 30  |d   r3,r1,#&ff00|
00002cb0  20 20 20 20 20 20 20 20  20 3b 49 73 6f 6c 61 74  |         ;Isolat|
00002cc0  65 20 45 66 66 65 63 74  20 6e 75 6d 62 65 72 0d  |e Effect number.|
00002cd0  0e 56 4d 20 6c 64 72 20  20 20 72 33 2c 5b 70 63  |.VM ldr   r3,[pc|
00002ce0  2c 72 33 2c 6c 73 72 23  36 5d 20 20 20 20 20 3b  |,r3,lsr#6]     ;|
00002cf0  6c 73 72 23 38 20 66 6f  72 20 65 66 66 65 63 74  |lsr#8 for effect|
00002d00  20 69 6e 74 6f 20 6c 6f  77 62 79 74 65 20 26 20  | into lowbyte & |
00002d10  6c 73 6c 23 32 20 66 6f  72 20 2a 34 0d 0e 60 13  |lsl#2 for *4..`.|
00002d20  20 61 64 64 20 20 20 70  63 2c 70 63 2c 72 33 0d  | add   pc,pc,r3.|
00002d30  0e 6a 04 0d 0e 74 2e 20  64 63 64 20 20 20 76 5f  |.j...t. dcd   v_|
00002d40  61 72 70 65 67 67 69 6f  2d 76 6f 66 31 20 20 20  |arpeggio-vof1   |
00002d50  20 20 20 3b 20 30 20 3d  20 41 72 70 65 67 67 69  |   ; 0 = Arpeggi|
00002d60  6f 0d 0e 7e 09 2e 76 6f  66 31 0d 0e 88 46 20 64  |o..~..vof1...F d|
00002d70  63 64 20 20 20 76 5f 73  6c 69 64 65 75 70 2d 76  |cd   v_slideup-v|
00002d80  6f 66 31 20 20 20 20 20  20 20 3b 20 31 20 3d 20  |of1       ; 1 = |
00002d90  53 6c 69 64 65 20 50 69  74 63 68 20 75 70 20 20  |Slide Pitch up  |
00002da0  20 28 74 69 6c 6c 20 41  6d 69 73 20 4d 61 78 29  | (till Amis Max)|
00002db0  0d 0e 92 46 20 64 63 64  20 20 20 76 5f 73 6c 69  |...F dcd   v_sli|
00002dc0  64 65 64 6f 77 6e 2d 76  6f 66 31 20 20 20 20 20  |dedown-vof1     |
00002dd0  3b 20 32 20 3d 20 53 6c  69 64 65 20 50 69 74 63  |; 2 = Slide Pitc|
00002de0  68 20 64 6f 77 6e 20 28  74 69 6c 6c 20 41 6d 69  |h down (till Ami|
00002df0  73 20 4d 69 6e 29 0d 0e  9c 2f 20 64 63 64 20 20  |s Min).../ dcd  |
00002e00  20 76 5f 76 6f 6c 75 70  2d 76 6f 66 31 20 20 20  | v_volup-vof1   |
00002e10  20 20 20 20 20 20 3b 20  33 20 3d 20 56 6f 6c 75  |      ; 3 = Volu|
00002e20  6d 65 20 75 70 0d 0e a6  31 20 64 63 64 20 20 20  |me up...1 dcd   |
00002e30  76 5f 76 6f 6c 64 6f 77  6e 2d 76 6f 66 31 20 20  |v_voldown-vof1  |
00002e40  20 20 20 20 20 3b 20 34  20 3d 20 56 6f 6c 75 6d  |     ; 4 = Volum|
00002e50  65 20 64 6f 77 6e 0d 0e  b0 38 20 64 63 64 20 20  |e down...8 dcd  |
00002e60  20 76 5f 61 72 63 75 70  2d 76 6f 66 31 20 20 20  | v_arcup-vof1   |
00002e70  20 20 20 20 20 20 3b 20  35 20 3d 20 53 6c 69 64  |      ; 5 = Slid|
00002e80  65 20 41 72 63 20 50 69  74 63 68 20 75 70 0d 0e  |e Arc Pitch up..|
00002e90  ba 3a 20 64 63 64 20 20  20 76 5f 61 72 63 64 6f  |.: dcd   v_arcdo|
00002ea0  77 6e 2d 76 6f 66 31 20  20 20 20 20 20 20 3b 20  |wn-vof1       ; |
00002eb0  36 20 3d 20 53 6c 69 64  65 20 41 72 63 20 50 69  |6 = Slide Arc Pi|
00002ec0  74 63 68 20 64 6f 77 6e  0d 0e c4 04 0d 0e ce 0f  |tch down........|
00002ed0  2e 76 5f 61 72 70 65 67  67 69 6f 0d 0e d8 42 20  |.v_arpeggio...B |
00002ee0  6d 6f 76 20 20 20 72 31  2c 72 31 2c 6c 73 72 23  |mov   r1,r1,lsr#|
00002ef0  32 34 20 20 20 20 20 20  20 20 20 3b 47 65 74 20  |24         ;Get |
00002f00  6c 61 73 74 20 73 74 6f  72 65 64 20 54 6f 6e 65  |last stored Tone|
00002f10  20 69 6e 74 6f 20 6c 6f  77 62 79 74 65 0d 0e e2  | into lowbyte...|
00002f20  2a 20 63 6d 70 20 20 20  72 30 2c 23 31 20 20 20  |* cmp   r0,#1   |
00002f30  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 69  |             ;Ti|
00002f40  6d 65 3d 31 20 6f 72 0d  0e ec 27 20 63 6d 70 4e  |me=1 or...' cmpN|
00002f50  65 20 72 30 2c 23 34 20  20 20 20 20 20 20 20 20  |e r0,#4         |
00002f60  20 20 20 20 20 20 20 3b  54 69 6d 65 3d 34 0d 0e  |       ;Time=4..|
00002f70  f6 46 20 61 64 64 45 71  20 72 31 2c 72 31 2c 72  |.F addEq r1,r1,r|
00002f80  32 2c 6c 73 72 23 34 20  20 20 20 20 20 20 3b 20  |2,lsr#4       ; |
00002f90  2e 2e 2e 74 68 65 6e 20  61 64 64 20 20 6c 65 66  |...then add  lef|
00002fa0  74 20 49 6e 66 6f 4e 69  62 62 6c 65 20 74 6f 20  |t InfoNibble to |
00002fb0  4e 6f 74 65 0d 0f 00 2a  20 63 6d 70 20 20 20 72  |Note...* cmp   r|
00002fc0  30 2c 23 32 20 20 20 20  20 20 20 20 20 20 20 20  |0,#2            |
00002fd0  20 20 20 20 3b 54 69 6d  65 3d 32 20 6f 72 0d 0f  |    ;Time=2 or..|
00002fe0  0a 27 20 63 6d 70 4e 65  20 72 30 2c 23 35 20 20  |.' cmpNe r0,#5  |
00002ff0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
00003000  69 6d 65 3d 35 0d 0f 14  46 20 61 6e 64 45 71 20  |ime=5...F andEq |
00003010  72 32 2c 72 32 2c 23 26  30 66 20 20 20 20 20 20  |r2,r2,#&0f      |
00003020  20 20 20 20 20 3b 20 2e  2e 2e 74 68 65 6e 20 61  |     ; ...then a|
00003030  64 64 20 72 69 67 68 74  20 49 6e 66 6f 4e 69 62  |dd right InfoNib|
00003040  62 6c 65 20 74 6f 20 4e  6f 74 65 0d 0f 1e 13 20  |ble to Note.... |
00003050  61 64 64 45 71 20 72 31  2c 72 31 2c 72 32 0d 0f  |addEq r1,r1,r2..|
00003060  28 49 20 6c 64 72 20 20  20 72 31 2c 5b 72 31 31  |(I ldr   r1,[r11|
00003070  2c 72 31 2c 6c 73 6c 23  32 5d 20 20 20 20 3b 47  |,r1,lsl#2]    ;G|
00003080  65 74 20 65 71 75 69 76  61 6c 65 6e 74 20 46 72  |et equivalent Fr|
00003090  65 71 75 65 6e 63 79 20  66 72 6f 6d 20 72 31 31  |equency from r11|
000030a0  3d 66 54 61 62 6c 65 0d  0f 32 2c 20 73 74 72 20  |=fTable..2, str |
000030b0  20 20 72 31 2c 5b 72 31  32 2c 23 34 5d 20 20 20  |  r1,[r12,#4]   |
000030c0  20 20 20 20 20 20 20 3b  45 6e 74 65 72 20 50 69  |       ;Enter Pi|
000030d0  74 63 68 0d 0f 3c 11 20  6d 6f 76 20 20 20 70 63  |tch..<. mov   pc|
000030e0  2c 72 31 34 0d 0f 46 04  0d 0f 50 0e 2e 76 5f 73  |,r14..F...P..v_s|
000030f0  6c 69 64 65 75 70 0d 0f  5a 32 20 61 64 64 20 20  |lideup..Z2 add  |
00003100  20 72 31 2c 72 34 2c 72  32 2c 6c 73 6c 23 36 20  | r1,r4,r2,lsl#6 |
00003110  20 20 20 20 20 20 3b 20  46 72 65 71 2b 49 6e 66  |      ; Freq+Inf|
00003120  6f 42 79 74 65 2a 36 34  0d 0f 64 44 20 63 6d 70  |oByte*64..dD cmp|
00003130  20 20 20 72 31 2c 23 26  31 38 38 30 30 20 20 20  |   r1,#&18800   |
00003140  20 20 20 20 20 20 20 20  3b 4d 69 6e 20 50 65 72  |        ;Min Per|
00003150  20 3d 20 26 30 37 31 2c  20 69 65 20 4f 75 74 50  | = &071, ie OutP|
00003160  75 74 46 20 3c 20 26 31  38 34 44 41 0d 0f 6e 16  |utF < &184DA..n.|
00003170  20 73 74 72 4c 74 20 72  31 2c 5b 72 31 32 2c 23  | strLt r1,[r12,#|
00003180  34 5d 0d 0f 78 11 20 6d  6f 76 20 20 20 70 63 2c  |4]..x. mov   pc,|
00003190  72 31 34 0d 0f 82 10 2e  76 5f 73 6c 69 64 65 64  |r14.....v_slided|
000031a0  6f 77 6e 0d 0f 8c 32 20  73 75 62 20 20 20 72 31  |own...2 sub   r1|
000031b0  2c 72 34 2c 72 32 2c 6c  73 6c 23 36 20 20 20 20  |,r4,r2,lsl#6    |
000031c0  20 20 20 3b 20 46 72 65  71 2d 49 6e 66 6f 42 79  |   ; Freq-InfoBy|
000031d0  74 65 2a 36 34 0d 0f 96  44 20 63 6d 70 20 20 20  |te*64...D cmp   |
000031e0  72 31 2c 23 26 33 33 34  30 20 20 20 20 20 20 20  |r1,#&3340       |
000031f0  20 20 20 20 20 3b 4d 61  78 20 50 65 72 20 3d 20  |     ;Max Per = |
00003200  26 33 35 38 2c 20 69 65  20 4f 75 74 50 75 74 46  |&358, ie OutPutF|
00003210  20 3e 20 26 20 33 33 35  35 0d 0f a0 16 20 73 74  | > & 3355.... st|
00003220  72 47 74 20 72 31 2c 5b  72 31 32 2c 23 34 5d 0d  |rGt r1,[r12,#4].|
00003230  0f aa 11 20 6d 6f 76 20  20 20 70 63 2c 72 31 34  |... mov   pc,r14|
00003240  0d 0f b4 04 0d 0f be 0c  2e 76 5f 76 6f 6c 75 70  |.........v_volup|
00003250  0d 0f c8 4a 20 63 6d 70  20 20 20 72 30 2c 23 31  |...J cmp   r0,#1|
00003260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003270  3b 4f 6e 6c 79 20 65 61  63 68 20 66 69 72 73 74  |;Only each first|
00003280  20 76 5f 69 6e 74 65 72  72 75 70 74 20 66 6f 72  | v_interrupt for|
00003290  20 73 6c 6f 77 20 64 6f  77 6e 0d 0f d2 11 20 6d  | slow down.... m|
000032a0  6f 76 4e 65 20 70 63 2c  72 31 34 0d 0f dc 38 20  |ovNe pc,r14...8 |
000032b0  6c 64 72 20 20 20 72 31  2c 5b 72 31 32 2c 23 31  |ldr   r1,[r12,#1|
000032c0  36 5d 20 20 20 20 20 20  20 20 20 3b 54 68 65 72  |6]         ;Ther|
000032d0  65 20 69 73 20 63 75 72  72 65 6e 74 20 56 6f 6c  |e is current Vol|
000032e0  75 6d 65 0d 0f e6 13 20  73 75 62 53 20 20 72 31  |ume.... subS  r1|
000032f0  2c 72 31 2c 72 32 0d 0f  f0 4a 20 73 74 72 50 6c  |,r1,r2...J strPl|
00003300  20 72 31 2c 5b 72 31 32  2c 23 31 36 5d 20 20 20  | r1,[r12,#16]   |
00003310  20 20 20 20 20 20 3b 49  66 20 6e 6f 74 20 3e 20  |      ;If not > |
00003320  30 20 20 28 4d 61 78 20  56 6f 6c 29 2c 20 74 68  |0  (Max Vol), th|
00003330  65 6e 20 77 72 69 74 65  20 69 74 20 62 61 63 6b  |en write it back|
00003340  0d 0f fa 11 20 6d 6f 76  20 20 20 70 63 2c 72 31  |.... mov   pc,r1|
00003350  34 0d 10 04 0e 2e 76 5f  76 6f 6c 64 6f 77 6e 0d  |4.....v_voldown.|
00003360  10 0e 10 20 63 6d 70 20  20 20 72 30 2c 23 31 0d  |... cmp   r0,#1.|
00003370  10 18 11 20 6d 6f 76 4e  65 20 70 63 2c 72 31 34  |... movNe pc,r14|
00003380  0d 10 22 17 20 6c 64 72  20 20 20 72 31 2c 5b 72  |..". ldr   r1,[r|
00003390  31 32 2c 23 31 36 5d 0d  10 2c 13 20 61 64 64 20  |12,#16]..,. add |
000033a0  20 20 72 31 2c 72 31 2c  72 32 0d 10 36 12 20 63  |  r1,r1,r2..6. c|
000033b0  6d 70 20 20 20 72 31 2c  23 32 35 35 0d 10 40 4a  |mp   r1,#255..@J|
000033c0  20 73 74 72 4c 73 20 72  31 2c 5b 72 31 32 2c 23  | strLs r1,[r12,#|
000033d0  31 36 5d 20 20 20 20 20  20 20 20 20 3b 49 66 20  |16]         ;If |
000033e0  6e 6f 74 20 3c 32 35 35  20 28 4d 69 6e 20 56 6f  |not <255 (Min Vo|
000033f0  6c 29 2c 20 74 68 65 6e  20 77 72 69 74 65 20 69  |l), then write i|
00003400  74 20 62 61 63 6b 0d 10  4a 11 20 6d 6f 76 20 20  |t back..J. mov  |
00003410  20 70 63 2c 72 31 34 0d  10 54 04 0d 10 5e 0c 2e  | pc,r14..T...^..|
00003420  76 5f 61 72 63 75 70 0d  10 68 45 20 61 64 64 53  |v_arcup..hE addS|
00003430  20 20 72 31 2c 72 34 2c  72 32 2c 6c 73 6c 23 34  |  r1,r4,r2,lsl#4|
00003440  20 20 20 20 20 20 20 3b  50 69 74 63 68 2b 49 6e  |       ;Pitch+In|
00003450  66 6f 42 79 74 65 2a 31  36 20 28 66 6f 72 20 73  |foByte*16 (for s|
00003460  6c 6f 77 20 73 6c 69 64  69 6e 67 29 0d 10 72 16  |low sliding)..r.|
00003470  20 73 74 72 50 6c 20 72  31 2c 5b 72 31 32 2c 23  | strPl r1,[r12,#|
00003480  34 5d 0d 10 7c 11 20 6d  6f 76 20 20 20 70 63 2c  |4]..|. mov   pc,|
00003490  72 31 34 0d 10 86 0e 2e  76 5f 61 72 63 64 6f 77  |r14.....v_arcdow|
000034a0  6e 0d 10 90 45 20 73 75  62 53 20 20 72 31 2c 72  |n...E subS  r1,r|
000034b0  34 2c 72 32 2c 6c 73 6c  23 34 20 20 20 20 20 20  |4,r2,lsl#4      |
000034c0  20 3b 50 69 74 63 68 2d  49 6e 66 6f 42 79 74 65  | ;Pitch-InfoByte|
000034d0  2a 31 36 20 28 66 6f 72  20 73 6c 6f 77 20 73 6c  |*16 (for slow sl|
000034e0  69 64 69 6e 67 29 0d 10  9a 16 20 73 74 72 50 6c  |iding).... strPl|
000034f0  20 72 31 2c 5b 72 31 32  2c 23 34 5d 0d 10 a4 11  | r1,[r12,#4]....|
00003500  20 6d 6f 76 20 20 20 70  63 2c 72 31 34 0d 10 ae  | mov   pc,r14...|
00003510  04 0d 10 b8 1e 3b 2a 2a  2a 20 45 4e 54 52 59 20  |.....;*** ENTRY |
00003520  c8 92 53 20 e3 20 47 41  4d 45 20 d4 20 46 58 0d  |..S . GAME . FX.|
00003530  10 c2 04 0d 10 cc 08 2e  66 78 31 0d 10 d6 18 20  |........fx1.... |
00003540  61 64 72 20 20 20 72 31  32 2c 48 65 61 64 2b 30  |adr   r12,Head+0|
00003550  2a 33 32 0d 10 e0 10 20  62 20 20 20 20 20 66 78  |*32.... b     fx|
00003560  34 2b 34 0d 10 ea 08 2e  66 78 32 0d 10 f4 18 20  |4+4.....fx2.... |
00003570  61 64 72 20 20 20 72 31  32 2c 48 65 61 64 2b 31  |adr   r12,Head+1|
00003580  2a 33 32 0d 10 fe 10 20  62 20 20 20 20 20 66 78  |*32.... b     fx|
00003590  34 2b 34 0d 11 08 08 2e  66 78 33 0d 11 12 18 20  |4+4.....fx3.... |
000035a0  61 64 72 20 20 20 72 31  32 2c 48 65 61 64 2b 32  |adr   r12,Head+2|
000035b0  2a 33 32 0d 11 1c 10 20  62 20 20 20 20 20 66 78  |*32.... b     fx|
000035c0  34 2b 34 0d 11 26 08 2e  66 78 34 0d 11 30 18 20  |4+4..&..fx4..0. |
000035d0  61 64 72 20 20 20 72 31  32 2c 48 65 61 64 2b 33  |adr   r12,Head+3|
000035e0  2a 33 32 0d 11 3a 10 20  6d 6f 76 20 20 20 72 30  |*32..:. mov   r0|
000035f0  2c 23 31 0d 11 44 31 20  73 74 72 42 20 20 72 30  |,#1..D1 strB  r0|
00003600  2c 5b 72 31 32 2c 23 33  30 5d 20 20 20 20 20 20  |,[r12,#30]      |
00003610  20 20 20 3b 53 65 74 20  53 6f 75 6e 64 46 58 20  |   ;Set SoundFX |
00003620  66 6c 61 67 0d 11 4e 14  20 61 64 72 20 20 20 72  |flag..N. adr   r|
00003630  31 30 2c 54 72 61 63 6b  0d 11 58 15 20 61 64 72  |10,Track..X. adr|
00003640  20 20 20 72 31 31 2c 46  74 61 62 6c 65 0d 11 62  |   r11,Ftable..b|
00003650  10 20 62 20 20 20 20 20  76 72 75 6c 65 0d 11 6c  |. b     vrule..l|
00003660  04 0d 11 76 46 3b 2a 2a  2a 20 a8 45 52 52 55 50  |...vF;*** .ERRUP|
00003670  54 20 45 4e 54 52 59 20  c8 92 20 28 23 72 30 3d  |T ENTRY .. (#r0=|
00003680  45 76 65 6e 74 20 4e 6f  2c 20 72 31 32 3d 57 6f  |Event No, r12=Wo|
00003690  72 6b 73 70 61 63 65 20  5b 68 65 72 65 20 48 65  |rkspace [here He|
000036a0  61 64 41 64 72 5d 29 0d  11 80 04 0d 11 8a 0b 2e  |adAdr]).........|
000036b0  76 69 6e 74 65 72 0d 11  94 4c 20 73 74 6d 66 64  |vinter...L stmfd|
000036c0  20 72 31 33 21 2c 7b 72  31 2d 72 31 31 7d 20 20  | r13!,{r1-r11}  |
000036d0  20 20 20 20 20 20 3b 46  6f 72 20 6e 6f 74 20 69  |      ;For not i|
000036e0  6e 74 65 72 63 65 70 74  69 6e 67 20 76 65 63 74  |ntercepting vect|
000036f0  6f 72 20 2d 3e 20 70 75  73 68 20 72 31 34 20 74  |or -> push r14 t|
00003700  6f 6f 0d 11 9e 04 0d 11  a8 4c 20 61 64 72 20 20  |oo.......L adr  |
00003710  20 72 31 31 2c 46 74 61  62 6c 65 20 20 20 20 20  | r11,Ftable     |
00003720  20 20 20 20 20 20 3b 72  31 31 20 26 20 72 31 32  |      ;r11 & r12|
00003730  20 70 6f 69 6e 74 65 72  73 20 61 72 65 20 6e 65  | pointers are ne|
00003740  65 64 65 64 20 69 6e 20  62 6f 74 68 20 63 61 73  |eded in both cas|
00003750  65 73 0d 11 b2 04 0d 11  bc 35 20 6c 64 6d 44 62  |es.......5 ldmDb|
00003760  20 72 31 31 2c 7b 72 30  2c 72 31 7d 20 20 20 20  | r11,{r0,r1}    |
00003770  20 20 20 20 20 20 3b 4c  6f 61 64 20 43 6f 75 6e  |      ;Load Coun|
00003780  74 65 72 20 26 20 53 70  65 65 64 0d 11 c6 29 20  |ter & Speed...) |
00003790  61 64 64 20 20 20 72 30  2c 72 30 2c 23 31 20 20  |add   r0,r0,#1  |
000037a0  20 20 20 20 20 20 20 20  20 20 20 3b 43 6f 75 6e  |           ;Coun|
000037b0  74 65 72 2b 0d 11 d0 35  20 63 6d 70 20 20 20 72  |ter+...5 cmp   r|
000037c0  30 2c 72 31 20 20 20 20  20 20 20 20 20 20 20 20  |0,r1            |
000037d0  20 20 20 20 3b 49 66 20  3e 3d 20 53 70 65 65 64  |    ;If >= Speed|
000037e0  2c 20 74 68 65 6e 2e 2e  2e 0d 11 da 4d 20 6d 6f  |, then......M mo|
000037f0  76 48 73 20 72 30 2c 23  30 20 20 20 20 20 20 20  |vHs r0,#0       |
00003800  20 20 20 20 20 20 20 20  20 3b 20 20 20 20 20 20  |         ;      |
00003810  72 65 73 65 74 20 43 6f  75 6e 74 65 72 20 20 20  |reset Counter   |
00003820  20 7c 20 48 53 2c 20 63  61 75 73 65 20 53 65 74  | | HS, cause Set|
00003830  5f 53 70 65 65 64 0d 11  e4 43 20 73 74 72 20 20  |_Speed...C str  |
00003840  20 72 30 2c 5b 72 31 31  2c 23 2d 38 5d 20 20 20  | r0,[r11,#-8]   |
00003850  20 20 20 20 20 20 3b 20  20 20 20 20 20 20 20 20  |      ;         |
00003860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 7c 20  |              | |
00003870  63 6f 75 6c 64 20 73 65  74 0d 11 ee 4c 20 62 48  |could set...L bH|
00003880  73 20 20 20 76 70 6c 61  79 20 20 20 20 20 20 20  |s   vplay       |
00003890  20 20 20 20 20 20 20 20  20 3b 20 20 20 20 26 20  |         ;    & |
000038a0  50 6c 61 79 20 6f 6e 65  20 72 6f 77 21 20 20 20  |Play one row!   |
000038b0  20 7c 20 53 70 65 65 64  20 3c 20 43 6f 75 6e 74  | | Speed < Count|
000038c0  65 72 2e 2e 2e 0d 11 f8  04 0d 12 02 3f 20 62 6c  |er..........? bl|
000038d0  20 20 20 20 76 65 66 66  65 63 74 73 20 20 20 20  |    veffects    |
000038e0  20 20 20 20 20 20 20 20  20 3b 57 65 6c 6c 2c 20  |         ;Well, |
000038f0  65 6c 73 65 20 73 75 70  70 6f 72 74 20 74 68 65  |else support the|
00003900  20 65 66 66 65 63 74 73  0d 12 0c 16 20 61 64 64  | effects.... add|
00003910  20 20 20 72 31 32 2c 72  31 32 2c 23 33 32 0d 12  |   r12,r12,#32..|
00003920  16 23 20 62 6c 20 20 20  20 76 65 66 66 65 63 74  |.# bl    veffect|
00003930  73 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 32  |s             ;2|
00003940  2e 0d 12 20 16 20 61 64  64 20 20 20 72 31 32 2c  |... . add   r12,|
00003950  72 31 32 2c 23 33 32 0d  12 2a 23 20 62 6c 20 20  |r12,#32..*# bl  |
00003960  20 20 76 65 66 66 65 63  74 73 20 20 20 20 20 20  |  veffects      |
00003970  20 20 20 20 20 20 20 3b  33 2e 0d 12 34 16 20 61  |       ;3...4. a|
00003980  64 64 20 20 20 72 31 32  2c 72 31 32 2c 23 33 32  |dd   r12,r12,#32|
00003990  0d 12 3e 23 20 62 6c 20  20 20 20 76 65 66 66 65  |..># bl    veffe|
000039a0  63 74 73 20 20 20 20 20  20 20 20 20 20 20 20 20  |cts             |
000039b0  3b 34 2e 0d 12 48 05 5d  0d 12 52 0e e7 20 56 6f  |;4...H.]..R.. Vo|
000039c0  63 73 3d 38 20 8c 0d 12  5c 0a 5b 4f 50 54 20 70  |cs=8 ...\.[OPT p|
000039d0  0d 12 66 16 20 61 64 64  20 20 20 72 31 32 2c 72  |..f. add   r12,r|
000039e0  31 32 2c 23 33 32 0d 12  70 23 20 62 6c 20 20 20  |12,#32..p# bl   |
000039f0  20 76 65 66 66 65 63 74  73 20 20 20 20 20 20 20  | veffects       |
00003a00  20 20 20 20 20 20 3b 35  2e 0d 12 7a 16 20 61 64  |      ;5...z. ad|
00003a10  64 20 20 20 72 31 32 2c  72 31 32 2c 23 33 32 0d  |d   r12,r12,#32.|
00003a20  12 84 23 20 62 6c 20 20  20 20 76 65 66 66 65 63  |..# bl    veffec|
00003a30  74 73 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |ts             ;|
00003a40  36 2e 0d 12 8e 16 20 61  64 64 20 20 20 72 31 32  |6..... add   r12|
00003a50  2c 72 31 32 2c 23 33 32  0d 12 98 23 20 62 6c 20  |,r12,#32...# bl |
00003a60  20 20 20 76 65 66 66 65  63 74 73 20 20 20 20 20  |   veffects     |
00003a70  20 20 20 20 20 20 20 20  3b 37 2e 0d 12 a2 16 20  |        ;7..... |
00003a80  61 64 64 20 20 20 72 31  32 2c 72 31 32 2c 23 33  |add   r12,r12,#3|
00003a90  32 0d 12 ac 23 20 62 6c  20 20 20 20 76 65 66 66  |2...# bl    veff|
00003aa0  65 63 74 73 20 20 20 20  20 20 20 20 20 20 20 20  |ects            |
00003ab0  20 3b 38 2e 0d 12 b6 05  5d 0d 12 c0 05 cd 0d 12  | ;8.....].......|
00003ac0  ca 0a 5b 4f 50 54 20 70  0d 12 d4 27 20 6c 64 6d  |..[OPT p...' ldm|
00003ad0  66 64 20 72 31 33 21 2c  7b 72 31 2d 72 31 31 2c  |fd r13!,{r1-r11,|
00003ae0  70 63 7d 20 20 20 20 20  3b 52 65 74 75 72 6e 0d  |pc}     ;Return.|
00003af0  12 de 05 20 0d 12 e8 34  3b 2a 2a 2a 20 50 4c 41  |... ...4;*** PLA|
00003b00  59 20 ee 45 20 50 41 54  54 45 52 4e 2d 50 4f 53  |Y .E PATTERN-POS|
00003b10  49 54 49 4f 4e 20 28 41  4c 4c 20 34 2f 38 20 43  |ITION (ALL 4/8 C|
00003b20  48 41 4e 4e 45 4c 53 29  0d 12 f2 04 0d 12 fc 0a  |HANNELS)........|
00003b30  2e 76 70 6c 61 79 0d 13  06 17 20 61 64 72 20 20  |.vplay.... adr  |
00003b40  20 72 36 2c 52 65 67 69  73 74 65 72 73 0d 13 10  | r6,Registers...|
00003b50  39 20 6c 64 6d 49 61 20  72 36 2c 7b 72 37 2d 72  |9 ldmIa r6,{r7-r|
00003b60  39 7d 20 20 20 20 20 20  20 20 20 20 20 3b 4c 6f  |9}           ;Lo|
00003b70  61 64 20 33 20 77 6f 72  6b 69 6e 67 20 72 65 67  |ad 3 working reg|
00003b80  69 73 74 65 72 73 0d 13  1a 14 20 61 64 72 20 20  |isters.... adr  |
00003b90  20 72 31 30 2c 54 72 61  63 6b 0d 13 24 04 0d 13  | r10,Track..$...|
00003ba0  2e 23 20 62 6c 20 20 20  20 76 63 68 61 6e 6e 65  |.# bl    vchanne|
00003bb0  6c 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 31  |l             ;1|
00003bc0  2e 0d 13 38 16 20 61 64  64 20 20 20 72 31 32 2c  |...8. add   r12,|
00003bd0  72 31 32 2c 23 33 32 0d  13 42 23 20 62 6c 20 20  |r12,#32..B# bl  |
00003be0  20 20 76 63 68 61 6e 6e  65 6c 20 20 20 20 20 20  |  vchannel      |
00003bf0  20 20 20 20 20 20 20 3b  32 2e 0d 13 4c 16 20 61  |       ;2...L. a|
00003c00  64 64 20 20 20 72 31 32  2c 72 31 32 2c 23 33 32  |dd   r12,r12,#32|
00003c10  0d 13 56 23 20 62 6c 20  20 20 20 76 63 68 61 6e  |..V# bl    vchan|
00003c20  6e 65 6c 20 20 20 20 20  20 20 20 20 20 20 20 20  |nel             |
00003c30  3b 33 2e 0d 13 60 16 20  61 64 64 20 20 20 72 31  |;3...`. add   r1|
00003c40  32 2c 72 31 32 2c 23 33  32 0d 13 6a 23 20 62 6c  |2,r12,#32..j# bl|
00003c50  20 20 20 20 76 63 68 61  6e 6e 65 6c 20 20 20 20  |    vchannel    |
00003c60  20 20 20 20 20 20 20 20  20 3b 34 2e 0d 13 74 05  |         ;4...t.|
00003c70  5d 0d 13 7e 0e e7 20 56  6f 63 73 3d 38 20 8c 0d  |]..~.. Vocs=8 ..|
00003c80  13 88 0a 5b 4f 50 54 20  70 0d 13 92 16 20 61 64  |...[OPT p.... ad|
00003c90  64 20 20 20 72 31 32 2c  72 31 32 2c 23 33 32 0d  |d   r12,r12,#32.|
00003ca0  13 9c 23 20 62 6c 20 20  20 20 76 63 68 61 6e 6e  |..# bl    vchann|
00003cb0  65 6c 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |el             ;|
00003cc0  35 2e 0d 13 a6 16 20 61  64 64 20 20 20 72 31 32  |5..... add   r12|
00003cd0  2c 72 31 32 2c 23 33 32  0d 13 b0 23 20 62 6c 20  |,r12,#32...# bl |
00003ce0  20 20 20 76 63 68 61 6e  6e 65 6c 20 20 20 20 20  |   vchannel     |
00003cf0  20 20 20 20 20 20 20 20  3b 36 2e 0d 13 ba 16 20  |        ;6..... |
00003d00  61 64 64 20 20 20 72 31  32 2c 72 31 32 2c 23 33  |add   r12,r12,#3|
00003d10  32 0d 13 c4 23 20 62 6c  20 20 20 20 76 63 68 61  |2...# bl    vcha|
00003d20  6e 6e 65 6c 20 20 20 20  20 20 20 20 20 20 20 20  |nnel            |
00003d30  20 3b 37 2e 0d 13 ce 16  20 61 64 64 20 20 20 72  | ;7..... add   r|
00003d40  31 32 2c 72 31 32 2c 23  33 32 0d 13 d8 23 20 62  |12,r12,#32...# b|
00003d50  6c 20 20 20 20 76 63 68  61 6e 6e 65 6c 20 20 20  |l    vchannel   |
00003d60  20 20 20 20 20 20 20 20  20 20 3b 38 2e 0d 13 e2  |          ;8....|
00003d70  05 5d 0d 13 ec 05 cd 0d  13 f6 0a 5b 4f 50 54 20  |.].........[OPT |
00003d80  70 0d 14 00 04 0d 14 0a  41 20 73 75 62 53 20 20  |p.......A subS  |
00003d90  72 37 2c 72 37 2c 23 31  20 20 20 20 20 20 20 20  |r7,r7,#1        |
00003da0  20 20 20 20 20 3b 50 61  74 74 65 72 6e 5f 43 6f  |     ;Pattern_Co|
00003db0  75 6e 74 65 72 20 2d 20  31 2c 20 69 73 20 69 74  |unter - 1, is it|
00003dc0  20 7a 65 72 6f 3f 0d 14  14 31 20 73 74 6d 4e 65  | zero?...1 stmNe|
00003dd0  49 61 20 72 36 2c 7b 72  37 2d 72 38 7d 20 20 20  |Ia r6,{r7-r8}   |
00003de0  20 20 20 20 20 20 3b 4e  6f 74 20 7a 65 72 6f 20  |      ;Not zero |
00003df0  79 65 74 2c 20 73 6f 0d  14 1e 48 20 6c 64 6d 4e  |yet, so...H ldmN|
00003e00  65 46 64 20 72 31 33 21  2c 7b 72 31 2d 72 31 31  |eFd r13!,{r1-r11|
00003e10  2c 70 63 7d 20 20 20 3b  20 64 6f 6e 27 74 20 70  |,pc}   ; don't p|
00003e20  6c 61 79 20 6e 65 77 20  50 61 74 74 65 72 6e 2c  |lay new Pattern,|
00003e30  20 52 65 74 75 72 6e 20  69 6e 73 74 65 61 64 0d  | Return instead.|
00003e40  14 28 04 0d 14 32 48 20  6d 6f 76 20 20 20 72 37  |.(...2H mov   r7|
00003e50  2c 23 36 34 20 20 20 20  20 20 20 20 20 20 20 20  |,#64            |
00003e60  20 20 20 3b 57 65 6c 6c  2c 20 6e 65 77 20 50 61  |   ;Well, new Pa|
00003e70  74 74 65 72 6e 20 62 65  67 69 6e 73 2c 20 77 69  |ttern begins, wi|
00003e80  74 68 20 43 6f 75 6e 74  3d 36 34 0d 14 3c 39 20  |th Count=64..<9 |
00003e90  6c 64 72 42 20 20 72 30  2c 5b 72 39 2c 23 31 5d  |ldrB  r0,[r9,#1]|
00003ea0  21 20 20 20 20 20 20 20  20 20 20 3b 41 6e 64 20  |!          ;And |
00003eb0  67 65 74 20 6e 65 78 74  20 50 61 74 74 65 72 6e  |get next Pattern|
00003ec0  20 4e 72 2e 0d 14 46 31  20 63 6d 70 20 20 20 72  | Nr...F1 cmp   r|
00003ed0  30 2c 23 26 66 66 20 20  20 20 20 20 20 20 20 20  |0,#&ff          |
00003ee0  20 20 20 20 3b 45 6e 64  20 6f 66 20 53 65 71 75  |    ;End of Sequ|
00003ef0  65 6e 63 65 3f 0d 14 50  41 20 6c 64 72 45 71 20  |ence?..PA ldrEq |
00003f00  72 39 2c 5b 72 31 30 2c  23 32 34 5d 20 20 20 20  |r9,[r10,#24]    |
00003f10  20 20 20 20 20 3b 20 59  65 61 68 20 2d 3e 20 52  |     ; Yeah -> R|
00003f20  65 73 65 74 20 53 65 71  75 65 6e 63 65 20 50 6f  |eset Sequence Po|
00003f30  69 6e 74 65 72 2c 0d 14  5a 42 20 6c 64 72 45 71  |inter,..ZB ldrEq|
00003f40  42 20 30 2c 5b 72 39 5d  20 20 20 20 20 20 20 20  |B 0,[r9]        |
00003f50  20 20 20 20 20 20 3b 20  20 20 20 20 20 20 20 20  |      ;         |
00003f60  74 68 61 74 20 6d 65 61  6e 73 20 72 65 73 74 61  |that means resta|
00003f70  72 74 20 53 6f 6e 67 21  0d 14 64 35 20 6c 64 72  |rt Song!..d5 ldr|
00003f80  20 20 20 72 38 2c 5b 72  31 30 2c 23 32 38 5d 20  |   r8,[r10,#28] |
00003f90  20 20 20 20 20 20 20 20  3b 41 64 64 72 65 73 73  |        ;Address|
00003fa0  20 50 61 74 74 65 72 6e  73 74 61 72 74 0d 14 6e  | Patternstart..n|
00003fb0  3e 20 61 64 64 20 20 20  72 38 2c 72 38 2c 72 30  |> add   r8,r8,r0|
00003fc0  2c 6c 73 6c 23 31 30 2d  28 56 6f 63 73 3d 38 29  |,lsl#10-(Vocs=8)|
00003fd0  20 20 20 20 3b 2b 20 4e  72 2a 31 30 32 34 20 28  |    ;+ Nr*1024 (|
00003fe0  6f 72 20 4e 72 2a 32 30  34 38 29 0d 14 78 15 20  |or Nr*2048)..x. |
00003ff0  73 74 6d 49 61 20 72 36  2c 7b 72 37 2d 72 39 7d  |stmIa r6,{r7-r9}|
00004000  0d 14 82 27 20 6c 64 6d  66 64 20 72 31 33 21 2c  |...' ldmfd r13!,|
00004010  7b 72 31 2d 72 31 31 2c  70 63 7d 20 20 20 20 20  |{r1-r11,pc}     |
00004020  3b 52 65 74 75 72 6e 0d  14 8c 04 0d 14 96 2f 3b  |;Return......./;|
00004030  2a 2a 2a 20 53 55 50 50  4c 59 20 ee 45 20 43 48  |*** SUPPLY .E CH|
00004040  41 4e 4e 45 4c 20 57 49  54 48 20 c7 96 20 49 4e  |ANNEL WITH .. IN|
00004050  46 4f 52 4d 41 54 49 4f  4e 53 0d 14 a0 04 0d 14  |FORMATIONS......|
00004060  aa 0d 2e 76 63 68 61 6e  6e 65 6c 0d 14 b4 48 20  |...vchannel...H |
00004070  6c 64 72 20 20 20 72 31  2c 5b 72 38 5d 2c 23 34  |ldr   r1,[r8],#4|
00004080  20 20 20 20 20 20 20 20  20 20 20 3b 50 61 74 74  |           ;Patt|
00004090  65 72 6e 20 4c 57 6f 72  64 20 6f 66 20 63 75 72  |ern LWord of cur|
000040a0  72 65 6e 74 20 50 61 74  74 5f 50 6f 73 20 26 20  |rent Patt_Pos & |
000040b0  49 4e 43 0d 14 be 04 0d  14 c8 2f 20 6c 64 72 42  |INC......./ ldrB|
000040c0  20 20 72 32 2c 5b 72 31  32 2c 23 33 30 5d 20 20  |  r2,[r12,#30]  |
000040d0  20 20 20 20 20 20 20 3b  49 73 20 53 6f 75 6e 64  |       ;Is Sound|
000040e0  46 58 20 6f 6e 3f 0d 14  d2 10 20 63 6d 70 20 20  |FX on?.... cmp  |
000040f0  20 72 32 2c 23 30 0d 14  dc 26 20 62 45 71 20 20  | r2,#0...& bEq  |
00004100  20 76 72 75 6c 65 20 20  20 20 20 20 20 20 20 20  | vrule          |
00004110  20 20 20 20 20 20 3b 4e  6f 2e 2e 2e 0d 14 e6 16  |      ;No.......|
00004120  20 6c 64 72 20 20 20 72  32 2c 5b 72 31 32 2c 23  | ldr   r2,[r12,#|
00004130  34 5d 0d 14 f0 41 20 63  6d 70 20 20 20 72 32 2c  |4]...A cmp   r2,|
00004140  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
00004150  20 20 3b 59 65 73 2c 20  62 75 74 20 69 73 20 73  |  ;Yes, but is s|
00004160  61 6d 70 6c 65 20 73 74  69 6c 6c 20 61 63 74 69  |ample still acti|
00004170  76 65 3f 0d 14 fa 31 20  73 74 72 45 71 42 20 32  |ve?...1 strEqB 2|
00004180  2c 5b 72 31 32 2c 23 33  30 5d 20 20 20 20 20 20  |,[r12,#30]      |
00004190  20 20 20 3b 4e 6f 2c 20  73 6f 20 63 61 6e 63 65  |   ;No, so cance|
000041a0  6c 20 46 58 0d 15 04 11  20 6d 6f 76 20 20 20 70  |l FX.... mov   p|
000041b0  63 2c 72 31 34 0d 15 0e  04 0d 15 18 0a 2e 76 72  |c,r14.........vr|
000041c0  75 6c 65 0d 15 22 3b 20  6d 6f 76 53 20 20 72 30  |ule.."; movS  r0|
000041d0  2c 72 31 2c 6c 73 72 23  32 34 20 20 20 20 20 20  |,r1,lsr#24      |
000041e0  20 20 20 3b 49 73 6f 6c  61 74 65 20 54 6f 6e 65  |   ;Isolate Tone|
000041f0  20 26 20 49 73 20 69 74  20 7a 65 72 6f 3f 0d 15  | & Is it zero?..|
00004200  2c 46 20 62 45 71 20 20  20 76 63 6f 6d 6d 73 20  |,F bEq   vcomms |
00004210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4e  |              ;N|
00004220  6f 20 54 6f 6e 65 20 2d  3e 20 50 65 72 68 61 70  |o Tone -> Perhap|
00004230  73 20 73 74 69 6c 6c 20  61 20 43 6f 6d 6d 61 6e  |s still a Comman|
00004240  64 2e 2e 2e 0d 15 36 04  0d 15 40 4b 20 73 74 72  |d.....6...@K str|
00004250  42 20 20 72 30 2c 5b 72  31 32 2c 23 33 31 5d 20  |B  r0,[r12,#31] |
00004260  20 20 20 20 20 20 20 20  3b 53 74 6f 72 65 20 6c  |        ;Store l|
00004270  65 67 61 6c 20 54 6f 6e  65 20 66 6f 72 20 70 6f  |egal Tone for po|
00004280  73 73 2e 20 41 72 70 65  67 67 69 6f 20 65 66 66  |ss. Arpeggio eff|
00004290  65 63 74 0d 15 4a 49 20  6c 64 72 20 20 20 72 30  |ect..JI ldr   r0|
000042a0  2c 5b 72 31 31 2c 72 30  2c 6c 73 6c 23 32 5d 20  |,[r11,r0,lsl#2] |
000042b0  20 20 20 3b 47 65 74 20  65 71 75 69 76 61 6c 65  |   ;Get equivale|
000042c0  6e 74 20 46 72 65 71 75  65 6e 63 79 20 66 72 6f  |nt Frequency fro|
000042d0  6d 20 72 31 31 3d 66 54  61 62 6c 65 0d 15 54 2c  |m r11=fTable..T,|
000042e0  20 73 74 72 20 20 20 72  30 2c 5b 72 31 32 2c 23  | str   r0,[r12,#|
000042f0  34 5d 20 20 20 20 20 20  20 20 20 20 3b 45 6e 74  |4]          ;Ent|
00004300  65 72 20 50 69 74 63 68  0d 15 5e 3f 20 61 6e 64  |er Pitch..^? and|
00004310  53 20 20 72 30 2c 72 31  2c 23 26 66 66 20 3c 3c  |S  r0,r1,#&ff <<|
00004320  31 36 20 20 20 20 20 20  3b 49 73 6f 6c 61 74 65  |16      ;Isolate|
00004330  20 49 6e 73 74 72 75 6d  65 6e 74 2d 42 79 74 65  | Instrument-Byte|
00004340  2c 20 7a 65 72 6f 3f 0d  15 68 49 20 6c 64 72 45  |, zero?..hI ldrE|
00004350  71 20 72 30 2c 5b 72 31  32 2c 23 32 30 5d 20 20  |q r0,[r12,#20]  |
00004360  20 20 20 20 20 20 20 3b  20 59 20 2d 3e 20 47 65  |       ; Y -> Ge|
00004370  74 20 6f 6c 64 20 52 65  70 41 74 20 28 70 65 72  |t old RepAt (per|
00004380  68 61 70 73 20 61 20 52  65 70 54 6f 6e 65 21 29  |haps a RepTone!)|
00004390  0d 15 72 4c 20 73 74 72  45 71 20 72 30 2c 5b 72  |..rL strEq r0,[r|
000043a0  31 32 2c 23 30 30 5d 20  20 20 20 20 20 20 20 20  |12,#00]         |
000043b0  3b 20 20 20 20 26 20 53  65 74 20 61 73 20 6e 65  |;    & Set as ne|
000043c0  77 20 50 6f 73 20 28 73  61 6d 65 20 49 6e 73 74  |w Pos (same Inst|
000043d0  20 6f 6e 63 65 20 61 67  61 69 6e 29 0d 15 7c 11  | once again)..|.|
000043e0  20 62 45 71 20 20 20 76  63 6f 6d 6d 73 0d 15 86  | bEq   vcomms...|
000043f0  47 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |G               |
00004400  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 45 6c  |             ;El|
00004410  73 65 20 70 6f 69 6e 74  20 74 6f 20 49 6e 73 74  |se point to Inst|
00004420  50 6f 6f 6c 20 3d 20 54  72 61 63 6b 2b 49 6e 73  |Pool = Track+Ins|
00004430  74 2a 33 32 0d 15 90 4d  20 61 64 64 20 20 20 72  |t*32...M add   r|
00004440  32 2c 72 31 30 2c 72 30  2c 6c 73 72 23 31 31 20  |2,r10,r0,lsr#11 |
00004450  20 20 20 20 3b 6c 73 72  23 31 36 20 66 6f 72 20  |    ;lsr#16 for |
00004460  6c 6f 77 62 79 74 65 20  26 20 20 26 20 20 66 6f  |lowbyte &  &  fo|
00004470  72 20 2a 33 32 20 3d 3e  20 6c 73 72 23 31 31 0d  |r *32 => lsr#11.|
00004480  15 9a 42 20 6c 64 6d 49  61 20 72 32 2c 7b 72 30  |..B ldmIa r2,{r0|
00004490  2c 72 32 2d 72 35 7d 20  20 20 20 20 20 20 20 3b  |,r2-r5}        ;|
000044a0  52 65 61 64 20 61 6c 6c  20 35 20 49 6e 73 74 50  |Read all 5 InstP|
000044b0  6f 6f 6c 20 57 6f 72 64  73 20 61 74 20 6f 6e 63  |ool Words at onc|
000044c0  65 0d 15 a4 35 20 73 74  72 20 20 20 72 30 2c 5b  |e...5 str   r0,[|
000044d0  72 31 32 2c 23 20 38 5d  20 20 20 20 20 20 20 20  |r12,# 8]        |
000044e0  20 3b 45 6e 74 65 72 20  53 61 6d 70 6c 65 20 41  | ;Enter Sample A|
000044f0  64 64 72 65 73 73 0d 15  ae 2d 20 73 74 72 20 20  |ddress...- str  |
00004500  20 72 33 2c 5b 72 31 32  2c 23 31 36 5d 20 20 20  | r3,[r12,#16]   |
00004510  20 20 20 20 20 20 3b 45  6e 74 65 72 20 56 6f 6c  |      ;Enter Vol|
00004520  75 6d 65 0d 15 b8 4c 20  6d 6f 76 53 20 20 72 30  |ume...L movS  r0|
00004530  2c 72 34 2c 6c 73 6c 23  31 36 20 20 20 20 20 20  |,r4,lsl#16      |
00004540  20 20 20 3b 50 6f 73 3d  52 65 70 41 74 20 28 69  |   ;Pos=RepAt (i|
00004550  6e 20 31 36 2d 66 69 78  70 6f 69 6e 74 29 2c 20  |n 16-fixpoint), |
00004560  62 75 74 20 69 73 20 69  74 20 7a 65 72 6f 3f 0d  |but is it zero?.|
00004570  15 c2 4c 20 61 64 64 4e  65 20 72 32 2c 72 34 2c  |..L addNe r2,r4,|
00004580  72 35 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |r5             ;|
00004590  20 4e 6f 20 2d 3e 20 4c  65 6e 20 28 61 62 73 6f  | No -> Len (abso|
000045a0  6c 75 74 65 20 66 72 6f  6d 20 30 29 20 3d 20 52  |lute from 0) = R|
000045b0  65 70 41 74 2b 52 65 70  4c 65 6e 0d 15 cc 4a 20  |epAt+RepLen...J |
000045c0  6d 6f 76 4e 65 20 72 34  2c 72 30 20 20 20 20 20  |movNe r4,r0     |
000045d0  20 20 20 20 20 20 20 20  20 20 20 3b 20 20 20 20  |           ;    |
000045e0  2d 3e 20 48 65 61 64 20  4f 66 66 73 65 74 20 52  |-> Head Offset R|
000045f0  65 70 41 74 20 3d 20 66  69 78 70 6f 69 6e 74 20  |epAt = fixpoint |
00004600  52 65 70 41 74 0d 15 d6  2a 20 73 74 72 20 20 20  |RepAt...* str   |
00004610  72 30 2c 5b 72 31 32 2c  23 20 30 5d 20 20 20 20  |r0,[r12,# 0]    |
00004620  20 20 20 20 20 3b 45 6e  74 65 72 20 50 6f 73 0d  |     ;Enter Pos.|
00004630  15 e0 2d 20 73 74 72 20  20 20 72 32 2c 5b 72 31  |..- str   r2,[r1|
00004640  32 2c 23 31 32 5d 20 20  20 20 20 20 20 20 20 3b  |2,#12]         ;|
00004650  45 6e 74 65 72 20 4c 65  6e 67 74 68 0d 15 ea 2c  |Enter Length...,|
00004660  20 73 74 72 20 20 20 72  34 2c 5b 72 31 32 2c 23  | str   r4,[r12,#|
00004670  32 30 5d 20 20 20 20 20  20 20 20 20 3b 45 6e 74  |20]         ;Ent|
00004680  65 72 20 52 65 70 41 74  0d 15 f4 04 0d 15 fe 0b  |er RepAt........|
00004690  2e 76 63 6f 6d 6d 73 0d  16 08 43 20 61 6e 64 20  |.vcomms...C and |
000046a0  20 20 72 30 2c 72 31 2c  23 26 30 66 20 3c 3c 38  |  r0,r1,#&0f <<8|
000046b0  20 20 20 20 20 20 20 3b  49 73 6f 6c 61 74 65 20  |       ;Isolate |
000046c0  43 6f 6d 6d 61 6e 64 2d  4e 69 62 62 6c 65 20 66  |Command-Nibble f|
000046d0  72 6f 6d 20 44 61 74 61  4c 57 0d 16 12 31 20 61  |rom DataLW...1 a|
000046e0  6e 64 20 20 20 72 32 2c  72 31 2c 23 26 66 66 20  |nd   r2,r1,#&ff |
000046f0  20 20 20 20 20 20 20 20  20 20 3b 49 73 6f 6c 61  |          ;Isola|
00004700  74 65 20 49 6e 66 6f 42  79 74 65 0d 16 1c 4d 20  |te InfoByte...M |
00004710  6c 64 72 20 20 20 72 33  2c 5b 70 63 2c 72 30 2c  |ldr   r3,[pc,r0,|
00004720  6c 73 72 23 36 5d 20 20  20 20 20 3b 6c 73 72 23  |lsr#6]     ;lsr#|
00004730  38 20 66 6f 72 20 4e 69  62 62 6c 65 20 69 6e 74  |8 for Nibble int|
00004740  6f 20 6c 6f 77 62 79 74  65 20 26 20 6c 73 6c 23  |o lowbyte & lsl#|
00004750  32 20 66 6f 72 20 2a 34  0d 16 26 13 20 61 64 64  |2 for *4..&. add|
00004760  20 20 20 70 63 2c 70 63  2c 72 33 0d 16 30 04 0d  |   pc,pc,r3..0..|
00004770  16 3a 2c 20 64 63 64 20  20 20 76 65 66 2d 76 6f  |.:, dcd   vef-vo|
00004780  66 32 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |f2             ;|
00004790  45 66 66 65 63 74 73 20  30 2e 2e 0d 16 44 09 2e  |Effects 0....D..|
000047a0  76 6f 66 32 0d 16 4e 22  20 64 63 64 20 20 20 76  |vof2..N" dcd   v|
000047b0  65 66 2d 76 6f 66 32 20  20 20 20 20 20 20 20 20  |ef-vof2         |
000047c0  20 20 20 20 3b 31 0d 16  58 22 20 64 63 64 20 20  |    ;1..X" dcd  |
000047d0  20 76 65 66 2d 76 6f 66  32 20 20 20 20 20 20 20  | vef-vof2       |
000047e0  20 20 20 20 20 20 3b 32  0d 16 62 22 20 64 63 64  |      ;2..b" dcd|
000047f0  20 20 20 76 65 66 2d 76  6f 66 32 20 20 20 20 20  |   vef-vof2     |
00004800  20 20 20 20 20 20 20 20  3b 33 0d 16 6c 22 20 64  |        ;3..l" d|
00004810  63 64 20 20 20 76 65 66  2d 76 6f 66 32 20 20 20  |cd   vef-vof2   |
00004820  20 20 20 20 20 20 20 20  20 20 3b 34 0d 16 76 22  |          ;4..v"|
00004830  20 64 63 64 20 20 20 76  65 66 2d 76 6f 66 32 20  | dcd   vef-vof2 |
00004840  20 20 20 20 20 20 20 20  20 20 20 20 3b 35 0d 16  |            ;5..|
00004850  80 22 20 64 63 64 20 20  20 76 65 66 2d 76 6f 66  |." dcd   vef-vof|
00004860  32 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 36  |2             ;6|
00004870  0d 16 8a 34 20 64 63 64  20 20 20 76 73 74 65 72  |...4 dcd   vster|
00004880  65 6f 70 6f 73 2d 76 6f  66 32 20 20 20 20 20 20  |eopos-vof2      |
00004890  3b 20 37 20 3d 20 53 65  74 20 53 74 65 72 65 6f  |; 7 = Set Stereo|
000048a0  20 50 6f 73 0d 16 94 34  20 64 63 64 20 20 20 76  | Pos...4 dcd   v|
000048b0  61 75 74 6f 76 6f 6c 75  70 2d 76 6f 66 32 20 20  |autovolup-vof2  |
000048c0  20 20 20 20 3b 20 38 20  3d 20 41 75 74 6f 20 56  |    ; 8 = Auto V|
000048d0  6f 6c 75 6d 65 20 75 70  0d 16 9e 36 20 64 63 64  |olume up...6 dcd|
000048e0  20 20 20 76 61 75 74 6f  76 6f 6c 64 6f 77 6e 2d  |   vautovoldown-|
000048f0  76 6f 66 32 20 20 20 20  3b 20 39 20 3d 20 41 75  |vof2    ; 9 = Au|
00004900  74 6f 20 56 6f 6c 75 6d  65 20 64 6f 77 6e 0d 16  |to Volume down..|
00004910  a8 33 20 64 63 64 20 20  20 76 61 75 74 6f 61 72  |.3 dcd   vautoar|
00004920  63 75 70 2d 76 6f 66 32  20 20 20 20 20 20 3b 20  |cup-vof2      ; |
00004930  41 20 3d 20 41 75 74 6f  20 50 69 74 63 68 20 75  |A = Auto Pitch u|
00004940  70 0d 16 b2 35 20 64 63  64 20 20 20 76 61 75 74  |p...5 dcd   vaut|
00004950  6f 61 72 63 64 6f 77 6e  2d 76 6f 66 32 20 20 20  |oarcdown-vof2   |
00004960  20 3b 20 42 20 3d 20 41  75 74 6f 20 50 69 74 63  | ; B = Auto Pitc|
00004970  68 20 64 6f 77 6e 0d 16  bc 30 20 64 63 64 20 20  |h down...0 dcd  |
00004980  20 76 73 65 74 76 6f 6c  2d 76 6f 66 32 20 20 20  | vsetvol-vof2   |
00004990  20 20 20 20 20 20 3b 20  43 20 3d 20 53 65 74 20  |      ; C = Set |
000049a0  56 6f 6c 75 6d 65 0d 16  c6 33 20 64 63 64 20 20  |Volume...3 dcd  |
000049b0  20 76 70 61 74 74 62 72  65 61 6b 2d 76 6f 66 32  | vpattbreak-vof2|
000049c0  20 20 20 20 20 20 3b 20  44 20 3d 20 50 61 74 74  |      ; D = Patt|
000049d0  65 72 6e 20 42 72 65 61  6b 0d 16 d0 34 20 64 63  |ern Break...4 dc|
000049e0  64 20 20 20 76 6e 6f 70  2d 76 6f 66 32 20 20 20  |d   vnop-vof2   |
000049f0  20 20 20 20 20 20 20 20  20 3b 20 45 20 3d 20 28  |         ; E = (|
00004a00  4e 6f 74 20 75 73 65 64  20 79 65 74 29 0d 16 da  |Not used yet)...|
00004a10  2f 20 64 63 64 20 20 20  76 73 65 74 73 70 65 65  |/ dcd   vsetspee|
00004a20  64 2d 76 6f 66 32 20 20  20 20 20 20 20 3b 20 46  |d-vof2       ; F|
00004a30  20 3d 20 53 65 74 20 53  70 65 65 64 0d 16 e4 04  | = Set Speed....|
00004a40  0d 16 ee 4d 2e 76 65 66  20 20 20 20 20 20 20 20  |...M.vef        |
00004a50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004a60  3b 45 66 66 65 63 74 73  2c 20 6e 65 65 64 6e 27  |;Effects, needn'|
00004a70  74 20 74 6f 20 62 65 20  64 6f 6e 65 20 68 65 72  |t to be done her|
00004a80  65 2c 20 62 75 74 20 6c  61 74 65 72 21 0d 16 f8  |e, but later!...|
00004a90  3c 20 73 74 72 42 20 20  72 32 2c 5b 72 31 32 2c  |< strB  r2,[r12,|
00004aa0  23 32 38 5d 20 20 20 20  20 20 20 20 20 3b 53 74  |#28]         ;St|
00004ab0  6f 72 65 20 49 6e 66 6f  42 79 74 65 2c 20 66 6f  |ore InfoByte, fo|
00004ac0  72 20 45 66 66 65 63 74  73 0d 17 02 16 20 6d 6f  |r Effects.... mo|
00004ad0  76 20 20 20 72 30 2c 72  30 2c 6c 73 72 23 38 0d  |v   r0,r0,lsr#8.|
00004ae0  17 0c 3c 20 73 74 72 42  20 20 72 30 2c 5b 72 31  |..< strB  r0,[r1|
00004af0  32 2c 23 32 39 5d 20 20  20 20 20 20 20 20 20 3b  |2,#29]         ;|
00004b00  53 74 6f 72 65 20 43 6f  6d 6d 42 79 74 65 2c 20  |Store CommByte, |
00004b10  66 6f 72 20 45 66 66 65  63 74 73 0d 17 16 09 2e  |for Effects.....|
00004b20  76 6e 6f 70 0d 17 20 2b  20 6d 6f 76 20 20 20 70  |vnop.. + mov   p|
00004b30  63 2c 72 31 34 20 20 20  20 20 20 20 20 20 20 20  |c,r14           |
00004b40  20 20 20 20 3b 61 6e 64  20 72 65 74 75 72 6e 0d  |    ;and return.|
00004b50  17 2a 04 0d 17 34 0f 2e  76 73 74 65 72 65 6f 70  |.*...4..vstereop|
00004b60  6f 73 0d 17 3e 4d 20 61  64 72 20 20 20 72 30 2c  |os..>M adr   r0,|
00004b70  48 65 61 64 20 20 20 20  20 20 20 20 20 20 20 20  |Head            |
00004b80  20 20 3b 47 65 74 20 63  75 72 72 65 6e 74 20 63  |  ;Get current c|
00004b90  68 61 6e 6e 65 6c 20 6e  75 6d 62 65 72 20 28 6c  |hannel number (l|
00004ba0  69 74 74 6c 65 20 4f 76  65 72 68 65 61 64 29 0d  |ittle Overhead).|
00004bb0  17 48 14 20 73 75 62 20  20 20 72 30 2c 72 31 32  |.H. sub   r0,r12|
00004bc0  2c 72 30 0d 17 52 35 20  6d 6f 76 20 20 20 72 30  |,r0..R5 mov   r0|
00004bd0  2c 72 30 2c 6c 73 72 23  33 20 20 20 20 20 20 20  |,r0,lsr#3       |
00004be0  20 20 20 3b 81 20 38 3b  20 3d 3e 20 30 2c 34 2c  |   ;. 8; => 0,4,|
00004bf0  38 2c 31 32 2c 2e 2e 2e  0d 17 5c 12 20 63 6d 70  |8,12,.....\. cmp|
00004c00  20 20 20 72 30 2c 23 37  2a 34 0d 17 66 45 20 6d  |   r0,#7*4..fE m|
00004c10  6f 76 45 71 20 72 31 2c  20 20 20 23 26 36 30 20  |ovEq r1,   #&60 |
00004c20  20 20 20 20 20 20 20 20  20 20 3b 53 74 65 72 65  |          ;Stere|
00004c30  6f 20 49 6d 61 67 65 20  52 65 67 69 73 74 65 72  |o Image Register|
00004c40  20 20 20 37 20 20 3d 20  41 64 72 20 26 36 30 0d  |   7  = Adr &60.|
00004c50  17 70 4d 20 61 64 64 4e  65 20 72 31 2c 72 30 2c  |.pM addNe r1,r0,|
00004c60  23 26 36 34 20 20 20 20  20 20 20 20 20 20 20 3b  |#&64           ;|
00004c70  53 74 65 72 65 6f 20 49  6d 61 67 65 20 52 65 67  |Stereo Image Reg|
00004c80  69 73 74 65 72 73 20 30  2d 36 20 3d 20 41 64 72  |isters 0-6 = Adr|
00004c90  20 26 36 34 20 75 70 77  61 72 64 73 0d 17 7a 17  | &64 upwards..z.|
00004ca0  20 6d 6f 76 20 20 20 72  31 2c 72 31 2c 6c 73 6c  | mov   r1,r1,lsl|
00004cb0  23 32 34 0d 17 84 13 20  6f 72 72 20 20 20 72 31  |#24.... orr   r1|
00004cc0  2c 72 31 2c 72 32 0d 17  8e 17 20 6d 6f 76 20 20  |,r1,r2.... mov  |
00004cd0  20 72 32 2c 23 26 33 34  30 30 30 30 30 0d 17 98  | r2,#&3400000...|
00004ce0  12 20 73 74 72 20 20 20  72 31 2c 5b 72 32 5d 0d  |. str   r1,[r2].|
00004cf0  17 a2 05 5d 0d 17 ac 0e  e7 20 56 6f 63 73 3d 34  |...]..... Vocs=4|
00004d00  20 8c 0d 17 b6 0a 5b 4f  50 54 20 70 0d 17 c0 39  | .....[OPT p...9|
00004d10  20 63 6d 70 20 20 20 72  30 2c 23 33 2a 34 20 20  | cmp   r0,#3*4  |
00004d20  20 20 20 20 20 20 20 20  20 20 20 20 3b 45 78 74  |            ;Ext|
00004d30  72 61 20 41 64 72 20 6f  66 20 49 6d 61 67 65 20  |ra Adr of Image |
00004d40  52 65 67 20 37 0d 17 ca  19 20 73 75 62 45 71 20  |Reg 7.... subEq |
00004d50  72 31 2c 72 31 2c 23 26  31 30 3c 3c 32 34 0d 17  |r1,r1,#&10<<24..|
00004d60  d4 41 20 61 64 64 4e 65  20 72 31 2c 72 31 2c 23  |.A addNe r1,r1,#|
00004d70  26 31 30 3c 3c 32 34 20  20 20 20 20 20 20 3b 57  |&10<<24       ;W|
00004d80  65 6c 6c 2c 20 73 65 74  20 75 70 20 74 77 69 6e  |ell, set up twin|
00004d90  20 49 6d 61 67 65 20 52  65 67 20 74 6f 6f 21 0d  | Image Reg too!.|
00004da0  17 de 12 20 73 74 72 20  20 20 72 31 2c 5b 72 32  |... str   r1,[r2|
00004db0  5d 0d 17 e8 05 5d 0d 17  f2 05 cd 0d 17 fc 0a 5b  |]....].........[|
00004dc0  4f 50 54 20 70 0d 18 06  11 20 6d 6f 76 20 20 20  |OPT p.... mov   |
00004dd0  70 63 2c 72 31 34 0d 18  10 04 0d 18 1a 0f 2e 76  |pc,r14.........v|
00004de0  61 75 74 6f 76 6f 6c 75  70 0d 18 24 17 20 73 74  |autovolup..$. st|
00004df0  72 42 20 20 72 32 2c 5b  72 31 32 2c 23 32 34 5d  |rB  r2,[r12,#24]|
00004e00  0d 18 2e 11 20 6d 6f 76  20 20 20 70 63 2c 72 31  |.... mov   pc,r1|
00004e10  34 0d 18 38 11 2e 76 61  75 74 6f 76 6f 6c 64 6f  |4..8..vautovoldo|
00004e20  77 6e 0d 18 42 17 20 73  74 72 42 20 20 72 32 2c  |wn..B. strB  r2,|
00004e30  5b 72 31 32 2c 23 32 35  5d 0d 18 4c 11 20 6d 6f  |[r12,#25]..L. mo|
00004e40  76 20 20 20 70 63 2c 72  31 34 0d 18 56 0f 2e 76  |v   pc,r14..V..v|
00004e50  61 75 74 6f 61 72 63 75  70 0d 18 60 17 20 73 74  |autoarcup..`. st|
00004e60  72 42 20 20 72 32 2c 5b  72 31 32 2c 23 32 36 5d  |rB  r2,[r12,#26]|
00004e70  0d 18 6a 11 20 6d 6f 76  20 20 20 70 63 2c 72 31  |..j. mov   pc,r1|
00004e80  34 0d 18 74 11 2e 76 61  75 74 6f 61 72 63 64 6f  |4..t..vautoarcdo|
00004e90  77 6e 0d 18 7e 17 20 73  74 72 42 20 20 72 32 2c  |wn..~. strB  r2,|
00004ea0  5b 72 31 32 2c 23 32 37  5d 0d 18 88 11 20 6d 6f  |[r12,#27].... mo|
00004eb0  76 20 20 20 70 63 2c 72  31 34 0d 18 92 04 0d 18  |v   pc,r14......|
00004ec0  9c 0c 2e 76 73 65 74 76  6f 6c 0d 18 a6 3d 20 73  |...vsetvol...= s|
00004ed0  74 72 20 20 20 72 32 2c  5b 72 31 32 2c 23 31 36  |tr   r2,[r12,#16|
00004ee0  5d 20 20 20 20 20 20 20  20 20 3b 45 6e 74 65 72  |]         ;Enter|
00004ef0  20 6e 65 77 20 56 6f 6c  75 6d 65 20 69 6e 74 6f  | new Volume into|
00004f00  20 48 65 61 64 65 72 0d  18 b0 11 20 6d 6f 76 20  | Header.... mov |
00004f10  20 20 70 63 2c 72 31 34  0d 18 ba 04 0d 18 c4 0f  |  pc,r14........|
00004f20  2e 76 70 61 74 74 62 72  65 61 6b 0d 18 ce 48 20  |.vpattbreak...H |
00004f30  6d 6f 76 20 20 20 72 37  2c 23 31 20 20 20 20 20  |mov   r7,#1     |
00004f40  20 20 20 20 20 20 20 20  20 20 20 3b 4a 75 6d 70  |           ;Jump|
00004f50  20 74 6f 20 65 6e 64 20  6f 66 20 50 61 74 74 65  | to end of Patte|
00004f60  72 6e 2c 20 69 65 20 50  61 74 74 5f 43 6f 75 6e  |rn, ie Patt_Coun|
00004f70  74 3d 31 0d 18 d8 11 20  6d 6f 76 20 20 20 70 63  |t=1.... mov   pc|
00004f80  2c 72 31 34 0d 18 e2 04  0d 18 ec 0e 2e 76 73 65  |,r14.........vse|
00004f90  74 73 70 65 65 64 0d 18  f6 2e 20 73 74 72 20 20  |tspeed.... str  |
00004fa0  20 72 32 2c 56 73 70 65  65 64 20 20 20 20 20 20  | r2,Vspeed      |
00004fb0  20 20 20 20 20 20 3b 53  65 74 20 6e 65 77 20 53  |      ;Set new S|
00004fc0  70 65 65 64 0d 19 00 11  20 6d 6f 76 20 20 20 70  |peed.... mov   p|
00004fd0  63 2c 72 31 34 0d 19 0a  04 0d 19 14 13 3b 3d 3d  |c,r14........;==|
00004fe0  3d 3d 20 dc 42 41 59 20  3d 3d 3d 3d 0d 19 1e 04  |== .BAY ====....|
00004ff0  0d 19 28 3e 2e 52 65 67  69 73 74 65 72 73 20 20  |..(>.Registers  |
00005000  20 20 64 63 64 20 36 34  20 20 20 20 20 20 20 20  |  dcd 64        |
00005010  3b 20 72 37 20 50 61 74  74 65 72 6e 5f 43 6f 75  |; r7 Pattern_Cou|
00005020  6e 74 65 72 20 28 36 34  20 2d 3e 20 31 29 0d 19  |nter (64 -> 1)..|
00005030  32 43 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2C              |
00005040  64 63 64 20 30 30 20 20  20 20 20 20 20 20 3b 20  |dcd 00        ; |
00005050  72 38 20 43 75 72 72 65  6e 74 20 50 6f 69 6e 74  |r8 Current Point|
00005060  65 72 20 69 6e 20 74 68  65 20 50 61 74 74 65 72  |er in the Patter|
00005070  6e 0d 19 3c 44 20 20 20  20 20 20 20 20 20 20 20  |n..<D           |
00005080  20 20 20 64 63 64 20 30  30 20 20 20 20 20 20 20  |   dcd 00       |
00005090  20 3b 20 72 39 20 43 75  72 72 65 6e 74 20 50 6f  | ; r9 Current Po|
000050a0  69 6e 74 65 72 20 69 6e  20 74 68 65 20 53 65 71  |inter in the Seq|
000050b0  75 65 6e 63 65 0d 19 46  05 20 0d 19 50 4d 2e 56  |uence..F. ..PM.V|
000050c0  63 6f 75 6e 74 20 20 20  20 20 20 20 64 63 64 20  |count       dcd |
000050d0  30 20 20 20 20 20 20 20  20 20 3b 56 53 79 6e 63  |0         ;VSync|
000050e0  20 43 6f 75 6e 74 65 72  20 20 20 20 20 20 20 20  | Counter        |
000050f0  20 20 20 20 20 20 20 20  7c 4b 65 65 70 20 74 68  |        |Keep th|
00005100  65 73 65 20 74 77 6f 0d  19 5a 4a 2e 56 73 70 65  |ese two..ZJ.Vspe|
00005110  65 64 20 20 20 20 20 20  20 64 63 64 20 36 20 20  |ed       dcd 6  |
00005120  20 20 20 20 20 20 20 3b  53 70 65 65 64 20 43 6f  |       ;Speed Co|
00005130  75 6e 74 65 72 20 28 64  65 66 61 75 6c 74 3d 36  |unter (default=6|
00005140  29 20 20 20 20 7c 20 20  3c 20 2e 46 74 61 62 6c  |)    |  < .Ftabl|
00005150  65 0d 19 64 04 0d 19 6e  25 2e 46 74 61 62 6c 65  |e..d...n%.Ftable|
00005160  20 20 20 20 20 20 20 5d  3a 50 25 2b 3d 39 2a 31  |       ]:P%+=9*1|
00005170  32 2a 34 3a 5b 4f 50 54  20 70 0d 19 78 0a 2e 54  |2*4:[OPT p..x..T|
00005180  72 61 63 6b 0d 19 82 04  0d 19 8c 3b 3b 53 61 6d  |rack.......;;Sam|
00005190  70 6c 65 20 48 65 61 64  20 28 61 74 20 49 6e 73  |ple Head (at Ins|
000051a0  74 2a 33 32 29 20 20 20  23 30 30 20 41 62 73 6f  |t*32)   #00 Abso|
000051b0  6c 75 74 65 20 53 61 6d  70 6c 65 20 41 64 64 72  |lute Sample Addr|
000051c0  65 73 73 0d 19 96 2a 20  20 20 20 20 20 20 20 20  |ess...*         |
000051d0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 20 20  |            ;   |
000051e0  20 20 20 23 30 34 20 4c  65 6e 67 74 68 0d 19 a0  |   #04 Length...|
000051f0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00005200  20 20 20 20 20 20 3b 20  20 20 20 20 20 23 30 38  |      ;      #08|
00005210  20 56 6f 6c 75 6d 65 20  30 2d 26 66 66 0d 19 aa  | Volume 0-&ff...|
00005220  3a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |:               |
00005230  20 20 20 20 20 20 3b 20  20 20 20 20 20 23 31 32  |      ;      #12|
00005240  20 52 65 70 65 61 74 41  74 20 61 73 20 42 79 74  | RepeatAt as Byt|
00005250  65 4f 66 66 73 65 74 0d  19 b4 2a 20 20 20 20 20  |eOffset...*     |
00005260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005270  3b 20 20 20 20 20 20 23  31 36 20 52 65 70 4c 65  |;      #16 RepLe|
00005280  6e 0d 19 be 33 20 20 20  20 20 20 20 20 20 20 20  |n...3           |
00005290  20 20 20 20 20 20 20 20  20 20 3b 20 20 20 20 20  |          ;     |
000052a0  20 23 32 30 20 49 6e 73  74 72 75 6d 65 6e 74 20  | #20 Instrument |
000052b0  4e 61 6d 65 0d 19 c8 04  0d 19 d2 17 3b 3d 3d 3d  |Name........;===|
000052c0  3d 49 4e 49 54 53 54 4f  52 45 20 3d 3d 3d 3d 0d  |=INITSTORE ====.|
000052d0  19 dc 04 0d 19 e6 10 20  6d 6f 76 20 20 20 72 32  |....... mov   r2|
000052e0  2c 23 30 0d 19 f0 09 2e  75 61 6c 6c 0d 19 fa 15  |,#0.....uall....|
000052f0  20 73 74 72 20 20 20 72  32 2c 5b 72 30 5d 2c 23  | str   r2,[r0],#|
00005300  34 0d 1a 04 10 20 63 6d  70 20 20 20 72 30 2c 72  |4.... cmp   r0,r|
00005310  31 0d 1a 0e 0f 20 62 4c  6f 20 20 20 75 61 6c 6c  |1.... bLo   uall|
00005320  0d 1a 18 11 20 6d 6f 76  20 20 20 70 63 2c 72 31  |.... mov   pc,r1|
00005330  34 0d 1a 22 09 2e 75 66  69 6e 0d 1a 2c 04 0d 1a  |4.."..ufin..,...|
00005340  36 07 5d 3a e1 0d 1a 40  04 0d 1a 4a 1b 2d 2d 2d  |6.]:...@...J.---|
00005350  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00005360  2d 2d 2d 2d 0d 1a 54 1b  32 65 72 20 41 44 52 20  |----..T.2er ADR |
00005370  28 6f 6e 6c 79 20 66 6f  72 77 61 72 64 73 29 0d  |(only forwards).|
00005380  1a 5e 1b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.^.-------------|
00005390  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 1a 68 14 dd 20  |----------..h.. |
000053a0  a4 61 64 72 28 72 25 2c  64 65 73 74 25 29 0d 1a  |.adr(r%,dest%)..|
000053b0  72 13 64 69 73 25 3d 64  65 73 74 25 2d 50 25 2d  |r.dis%=dest%-P%-|
000053c0  38 0d 1a 7c 0f e7 20 70  3d 25 31 30 30 30 20 8c  |8..|.. p=%1000 .|
000053d0  0d 1a 86 12 20 20 64 30  25 3d 30 20 3a 64 31 25  |....  d0%=0 :d1%|
000053e0  3d 30 0d 1a 90 05 cc 0d  1a 9a 13 20 20 e7 20 64  |=0.........  . d|
000053f0  69 73 25 20 80 20 26 66  20 8c 0d 1a a4 19 20 20  |is% . &f .....  |
00005400  20 20 64 30 25 3d 64 69  73 25 20 80 20 26 30 30  |  d0%=dis% . &00|
00005410  30 46 46 0d 1a ae 19 20  20 20 20 64 31 25 3d 64  |0FF....    d1%=d|
00005420  69 73 25 20 80 20 26 46  46 46 30 30 0d 1a b8 07  |is% . &FFF00....|
00005430  20 20 cc 0d 1a c2 19 20  20 20 20 64 30 25 3d 64  |  .....    d0%=d|
00005440  69 73 25 20 80 20 26 30  30 46 46 46 0d 1a cc 19  |is% . &00FFF....|
00005450  20 20 20 20 64 31 25 3d  64 69 73 25 20 80 20 26  |    d1%=dis% . &|
00005460  46 46 30 30 30 0d 1a d6  07 20 20 cd 0d 1a e0 37  |FF000....  ....7|
00005470  20 20 e7 20 64 30 25 2b  64 31 25 3c 3e 64 69 73  |  . d0%+d1%<>dis|
00005480  25 20 8c 20 f1 20 bd 37  3b 22 46 4e 61 64 72 20  |% . . .7;"FNadr |
00005490  64 6f 65 73 6e 27 74 20  73 75 66 66 69 63 65 21  |doesn't suffice!|
000054a0  22 3a e0 0d 1a ea 38 20  20 e7 20 64 30 25 3d 30  |":....8  . d0%=0|
000054b0  20 84 20 64 31 25 3d 30  20 8c 20 f1 20 22 46 4e  | . d1%=0 . . "FN|
000054c0  61 64 72 20 3a 20 41 44  52 20 77 6f 75 6c 64 20  |adr : ADR would |
000054d0  64 6f 2e 20 22 3b 7e 64  69 73 25 0d 1a f4 05 cd  |do. ";~dis%.....|
000054e0  0d 1a fe 0a 5b 4f 50 54  20 70 0d 1b 08 13 20 61  |....[OPT p.... a|
000054f0  64 64 20 72 25 2c 70 63  2c 23 64 31 25 0d 1b 12  |dd r%,pc,#d1%...|
00005500  13 20 61 64 64 20 72 25  2c 72 25 2c 23 64 30 25  |. add r%,r%,#d0%|
00005510  0d 1b 1c 08 5d 3d 22 22  0d ff                    |....]=""..|
0000551a