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

!AWMay91/Goodies/Coconizer/Tools/Modul

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/Modul
Read OK:
File size: 5CA4 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >Tools.Modul
   20
   30DIM code 256000,L%-1
   40
   50mess$=STRING$(15,CHR$31)+CHR$9+"1.20 ("+MID$(TIME$,5,11)+")"
   60FOR p=%1000 TO %1010 STEP 2
   70P%=code
   80PROC_Music
   90NEXT p
  100
  110end%=Track+pointer
  120PRINT''"Start at : &";~code,"End at  : &";~end%
  130PRINT  "Total len: ";end%-code,"Song len: ";pointer
  140
  150INPUT'"Save song module as: "a$
  160OSCLI "Save "+a$+" "+STR$~code+" "+STR$~end%
  170OSCLI "Settype "+a$+" Module"
  180END
  190
  200-------------------------------------------------------------------------
  210DEF PROC_Music
  220IF p=%1000 THEN
  230  *RMEnsure Packit 1.50 RMLoad !Coconizer.Packit
  240  maxinst=32
  250  DIM nam$(2002),byt%(2002),loc$(2002),sort%(maxinst),sort$(maxinst)
  260  sort$(2)="�"
  270  top%=0
  280  f%=OPENIN "location"
  290  IF f%=0 THEN PRINT'"PLEASE INSERT A SONG DISC":a$=GET$:GOTO 280
  300  WHILE NOT EOF#f%
  310    top%+=1:nam$(top%)=GET$#f%:INPUT#f%,byt%(top%):loc$(top%)=GET$#f%
  320  ENDWHILE
  330  CLOSE#f%
  340
  350  INPUT'"Please enter song path [SONGS]: "path$:IF path$="" path$="songs"
  360  OSCLI "Cat "+path$
  370  INPUT'"Coconizer songfile? "a$
  380  a$=path$+"."+a$
  390  f%=OPENIN a$
  400  b1=BGET#f%:b2=BGET#f%:b3=BGET#f%:b4=BGET#f%:b5=BGET#f%:b6=BGET#f%
  410  CLOSE#f%
  420  IF b4=0 AND b5>0 THEN Vocs=b6 ELSE Vocs=b1     :REM packed...?
  430
  440  PROC_MusicASM
  450  A%=code:B%=Track-1:CALL Track                  :REM Initstore
  460  A%=ufin:B%=L%-1   :CALL Track                  :REM really ALL
  470  ENDPROC
  480ELSE
  490  PROC_MusicASM
  500ENDIF
  510
  520REM *** LOAD INSTRUMENTS ***
  530
  540PRINT"Channels: ";Vocs
  550IF b4=0 AND b5>0 THEN
  560  OSCLI "PackLoad "+a$+" "+STR$~Track
  570ELSE
  580  OSCLI "Load "+a$+" "+STR$~Track
  590ENDIF
  600
  610FOR i%=0 TO 9*12-1          :REM From internat. Octave -3 to Octave 5
  620n%=i% +4*12                 :REM Correct it, as 'Steinway' +0 = Middle C
  630f%=440*(2^((n%-46)/12))     :REM Frequency formula
  640Ftable!(i%*4)=(f%/(1000000/us))*65536
  650NEXT i%
  660
  670a$=LEFT$($(Track+1),15)
  680PRINT'"NAME: ";a$;
  690WHILE RIGHT$(a$,1)=" ":a$=LEFT$(a$,LENa$-1):ENDWHILE
  700$helps=a$:helps?(LENa$)=31
  710PRINT TAB(46);"Sequencies: ";Track?22;"  Patterns: ";Track?23'
  720
  730pointer=Track!32  :REM +Track                    :REM SampleData Offset
  740FOR i%=1 TO Track?21
  750  Track!(i%*32+ 0)=pointer
  760  len=Track!(i%*32+ 4)
  770  vol=Track!(i%*32+ 8)
  780  rat=Track!(i%*32+12)
  790  ren=Track!(i%*32+16)
  800  na$=$(Track+i%*32+20)
  810  PRINT CHR$(96+i%);" : ";na$;TAB(18);vol,rat,ren,len;
  820  FOR j%=1 TO top%:IF na$<>nam$(j%) THEN NEXT:INPUT'" -> "na$:$(Track+i%*32+20)=na$:PRINT STRING$(30,CHR$8);:GOTO 820
  830  PRINT " (";byt%(j%);")";
  840  IF len>byt%(j%) THEN len=byt%(j%):Track!(i%*32+4)=len:PRINT "*";
  850  PRINT ,(ASCloc$(j%)-65) DIV 2 +1
  860  sort$(i%)=loc$(j%):sort%(i%)=i%
  870  pointer+=len+gap
  880NEXT i%
  890PRINT
  900
  910REPEAT
  920  flag%=0
  930  FOR i%=1 TO Track?21-1
  940    IF sort$(i%)>sort$(i%+1) THEN SWAP sort$(i%),sort$(i%+1):SWAP sort%(i%),sort%(i%+1):flag%=1
  950  NEXT i%
  960UNTIL flag%=0
  970
  980FOR i%=1 TO Track?21
  990  s=sort%(i%)
 1000  na$=$(Track+s*32+20):adr=Track+Track!(s*32):len=Track!(s*32+4)
 1010  fu$="Inst"+sort$(i%)+"."+na$
 1020  f=OPENIN fu$
 1030  IF f THEN
 1040    PRINT na$;", ";
 1050    $(adr+len)=STRING$(gap-1,CHR$0)
 1060    SYS "OS_GBPB",4,f,adr,len:CLOSE#f
 1070  ELSE
 1080    disc=(ASCsort$(i%)-65) DIV 2 +1
 1090    PRINT'CHR$7;"PLEASE INSERT SAMPLE DISC ";disc:a$=GET$
 1100    GOTO 1020
 1110  ENDIF
 1120NEXT i%
 1130ENDPROC
 1140
 1150DEF PROC_MusicASM
 1160gap=16
 1170us =48
 1180[OPT p
 1190
 1200;---------------------------
 1210;  COCONIZER MODULE PLAYER
 1220;---------------------------
 1230
 1240 dcd 0               ;Start code
 1250 dcd init-code       ;Initialisation code
 1260 dcd fini-code       ;Finalisation code
 1270 dcd 0               ;Service Call Handler
 1280 dcd title-code      ;Title String
 1290 dcd helps-code      ;Help String
 1300 dcd 0               ;Help and Command keyword table
 1310
 1320.title dcb "CoconizerSong"+CHR$0:align
 1330.helps dcb mess$+CHR$0:align
 1340
 1350.init
 1360 stmfd r13!,{r7-r11,r14}    ;We are called in SVC_mode!
 1370 bl    v_on
 1380 ldmfd r13!,{r7-r11,pc}^
 1390
 1400.fini
 1410 stmfd r13!,{r7-r11,r14}
 1420 bl    v_off
 1430 bl    vrelativ             ;And back to origin relative state
 1440 ldmfd r13!,{r7-r11,pc}^
 1450
 1460;-----------------------------------
 1470;
 1480; THE COCONIZER PLAYER ROUTINE v1.2
 1490;
 1500;   Needs 20% of the ARM-II speed
 1510;
 1520;         (c) Mai 1990 by
 1530;    Eduard Pfarr & Thomas Alber
 1540;           of Playfield
 1550;
 1560;   Latest revision - 10 Feb 1991
 1570;
 1580;-----------------------------------
 1590
 1600.v_on
 1610 stmfd r13!,{r14}
 1620 mov   r0,#2                ;VOICES 2
 1630 mov   r1,#208              ;BufferLen of ONE channel, total *Vocs
 1640 mov   r2,#us               ;Sample Period
 1650 mov   r3,#0                ;Default ChannelHandler
 1660 mov   r4,#0                ;Default Sheduler
 1670 swi   "Sound_Configure"
 1680 mov   r0,#Vocs             ;VOICES 8 with params doesn't work directly!
 1690 mov   r1,#0                ;Because then sample rate is set false...
 1700 mov   r2,#0
 1710 mov   r3,#0
 1720 mov   r4,#0
 1730 swi   "Sound_Configure"
 1740
 1750 adr   r0,VoiceBase
 1760 mov   r1,#0                     ;Install our Voice into next free Slot
 1770 swi   "Sound_InstallVoice"
 1780 str   r1,Vslot                  ;store used slot
 1790 adr   r2,Vstereos-4*4*(Vocs=8)
 1800
 1810 mov   r0,#1
 1820.vimage
 1830 ldr   r1,[r2],#4
 1840 swi   "Sound_Stereo"            ;*STEREO r0 r1
 1850 add   r0,r0,#1
 1860 cmp   r0,#Vocs
 1870 bLs   vimage
 1880
 1890 mov   r0,#Vocs
 1900.vset
 1910 adr   r1,Vname
 1920 swi   "Sound_AttachNamedVoice"  ;*CHANNELVOICE r0 "r1"
 1930 mov   r1,#&170
 1940 mov   r2,#50               ;Activate all channels once
 1950 mov   r3,#255
 1960 swi   "Sound_Control"      ;*SOUND r0 r1 r2 r3
 1970 subS  r0,r0,#1
 1980 bNe   vset
 1990
 2000 bl    vabsolut
 2010 bl    v_reset
 2020 mov   r0,#16               ;Claim EVENT Vector (Nr. 16)
 2030 FNadr (1,vinter)
 2040 adr   r2,Head              ;Entry WorkspacePointer r12
 2050 swi   "OS_Claim"
 2060 mov   r0,#14               ;Enable Event Nr. r1
 2070 mov   r1,#4                ;(4 = VSync Event)
 2080 swi   "OS_Byte"
 2090
 2100 mov   r0,#Vocs             ;And once more...
 2110 mov   r1,#0
 2120 mov   r2,#0
 2130 mov   r3,#0
 2140 mov   r4,#0
 2150 swi   "Sound_Configure"    ;Grrrh!
 2160
 2170 mov   r0,#0                ;Read current Volume
 2180 swi   "Sound_Volume"
 2190 mov   r0,r0,lsl#1          ;*2
 2200 rsb   r0,r0,#254
 2210 str   r0,Volume            ;and use it as overall Volume
 2220
 2230 mov   r11,#3               ;Test max 3 times !
 2240.vtest
 2250 mov   r1,#0
 2260 strB  r1,IntSync
 2270 mov   r3,#26
 2280 bl    vwait
 2290 ldrB  r1,IntSync           ;Is there a Loser-Channel ?
 2300 cmp   r1,#0
 2310 ldmEqFd r13!,{pc}
 2320 mov   r0,#1                ;Off
 2330 swi   "Sound_Enable"
 2340 mov   r3,#101
 2350 bl    vwait
 2360 mov   r0,#2                ;On
 2370 swi   "Sound_Enable"
 2380 subS  r11,r11,#1
 2390 bNe   vtest
 2400 ldmfd r13!,{pc}            ;Well, bad luck!
 2410
 2420.vwait
 2430 mov   r12,r14
 2440 mov   r0,#19               ;Wait for some frameflies
 2450 swi   "OS_Byte"
 2460 subS  r3,r3,#1
 2470 bNe   vwait+8
 2480 mov   pc,r12               ;svc_r14...
 2490
 2500;*** ABSOLUTE CODE
 2510
 2520.vabsolut
 2530 FNadr (10,Track)
 2540
 2550 ldr   r1,[r10,#24]         ;Sequence Offset
 2560 add   r1,r10,r1
 2570 str   r1,[r10,#24]
 2580 ldr   r2,[r10,#28]         ;Pattern Offset
 2590 add   r2,r10,r2
 2600 str   r2,[r10,#28]
 2610
 2620 ldrB  r1,[r10,#21]         ;Number of Insts
 2630.vall
 2640 ldr   r2,[r10,r1,lsl#5]    ;Inst Addr Offset
 2650 add   r2,r10,r2
 2660 str   r2,[r10,r1,lsl#5]    ;+i*32
 2670 subS  r1,r1,#1
 2680 bNe   vall
 2690 mov   pc,r14
 2700
 2710;*** RELATIVE CODE
 2720
 2730.vrelativ
 2740 FNadr (10,Track)
 2750
 2760 ldr   r1,[r10,#24]
 2770 sub   r1,r1,r10
 2780 str   r1,[r10,#24]
 2790 ldr   r2,[r10,#28]
 2800 sub   r2,r2,r10
 2810 str   r2,[r10,#28]
 2820
 2830 ldrB  r1,[r10,#21]
 2840.vall
 2850 ldr   r2,[r10,r1,lsl#5]
 2860 sub   r2,r2,r10
 2870 str   r2,[r10,r1,lsl#5]
 2880 subS  r1,r1,#1
 2890 bNe   vall
 2900 mov   pc,r14
 2910
 2920;*** RESTART TUNE
 2930
 2940.v_reset
 2950 FNadr (10,Track)
 2960 mov   r1,#64
 2970 str   r1,Registers+0       ;Patt Count
 2980 ldr   r2,[r10,#24]
 2990 str   r2,Registers+8       ;Current Sequence Pointer
 3000 ldrB  r2,[r2]
 3010 ldr   r3,[r10,#28]
 3020 add   r3,r3,r2,lsl#10-(Vocs=8)
 3030 str   r3,Registers+4       ;Current Pattern Pointer
 3040
 3050 adr   r11,Head
 3060 mov   r1,#0:mov r2,#0:mov r3,#0:mov r4,#0
 3070 mov   r5,#0:mov r6,#0:mov r7,#0:mov r8,#0
 3080 mov   r0,#Vocs
 3090.vall
 3100 stmia r11!,{r1-r8}         ;Clear all channel heads...
 3110 subS  r0,r0,#1
 3120 bNe   vall
 3130 mov   pc,r14
 3140
 3150;*** TURN OFF PLAYER AND COCO-VOICE
 3160
 3170.v_off
 3180 stmfd r13!,{r14}
 3190 mov   r0,#13               ;Disable Event Nr. r1
 3200 mov   r1,#4                ;(4 = VSync Event)
 3210 swi   "OS_Byte"
 3220 mov   r0,#16               ;Free EVENT Vector (Nr. 16)
 3230 adr   r1,vinter
 3240 adr   r2,Head
 3250 swi   "OS_Release"
 3260
 3270 ldr   r1,Vslot
 3280 swi   "Sound_RemoveVoice"  ;Last but not least... Free VoiceSlot
 3290 mov   r0,#1
 3300 mov   r1,#1
 3310 swi   "Sound_AttachVoice"  ;Reinit Bell
 3320 ldmfd r13!,{pc}
 3330
 3340.Vstereos
 3350 dcd -50      ;Stereo Positions for 4 channels
 3360 dcd -20
 3370 dcd  20
 3380 dcd  50
 3390
 3400 dcd-126      ;Stereo Positions for 8 channels
 3410 dcd -90
 3420 dcd -54
 3430 dcd -18
 3440 dcd  18
 3450 dcd  54
 3460 dcd  90
 3470 dcd 126
 3480
 3490.Vslot dcd 0
 3500
 3510;==== SYSTEM SOUND ======================================================
 3520
 3530; r6 Neg. if new Handler    r10 Pointer to end of DMA buffer
 3540; r7 Channel number         r11 Increment (interleaf) to use when writing
 3550; r8 Sample period in us    r12 Pointer to (start of DMA + interleaf Ofs)
 3560; r9 Pointer to SCCB        Filler is entered in IRQ mode & Ints enabled!
 3570
 3580.VoiceBase
 3590 b     vfill                ;Fill         for smooth adjust
 3600 b     vfill                ;Update       for tone continue
 3610 b     vfill                ;GateOn       for new tone
 3620 ldmfd r13!,{pc}            ;GateOff      for tone flushing
 3630 ldmfd r13!,{pc}            ;Instantiate,   Attach    VoiceGenerator
 3640 ldmfd r13!,{pc}            ;DeInstantiate, Detach   to/from a channel
 3650 ldmfd r13!,{pc}            ;Hello Arthur!
 3660 dcd   Vname-VoiceBase      ;Offset from VoiceBase to Name
 3670.Vname dcb "Cocoplex"+CHR$0
 3680 align
 3690
 3700.vfill
 3710 adr   r8,Head              ;We use an own Controll_Block
 3720 add   r8,r8,r7,lsl#5       ;point to Head+r7*32
 3730 ldmIa r8,{r1-r6}           ;Load 6 working Registers
 3740 ldr   r0,Volume
 3750 add   r5,r5,r0             ;Add Overall_Volume to Channel_Volume
 3760 mov   r0,#0
 3770 strB  r0,IntFlag           ;Clear Interrupted_Flag
 3780
 3790.vfilloop
 3800]:FOR n=1 TO gap:[OPT p     ;Fill one byte 16 times, for 208 -> 13 runs
 3810 ldrB  r0,[r3,r1,lsr#16]    ;Load sample byte (HighWord of Pos)
 3820 subS  r0,r0,r5             ;Minus Volume (where 0=loud & 255=quiet)
 3830 movMi r0,#0
 3840 strB  r0,[r12],r11         ;And put it into VIDC-buffer
 3850 add   r1,r1,r2             ;Add Pitch (fix point)
 3860]:NEXT:[OPT p
 3870
 3880 cmp   r4,r1,lsr#16         ;Length exceeded? (Len < fixpointed Pos)
 3890 movLs r1,r6                ;Yes, so RepAt is new Pos,
 3900 cmp   r1,#0                ;    but is it zero?
 3910 movEq r2,#0                ;    yes -> Mute Channel (ie Set Pitch to 0)
 3920 cmp   r12,r10              ;VIDC-Buffer filled already?
 3930 bLo   vfilloop             ;Nooo...
 3940 stmIa r8,{r1-r2}           ;Save the two (probably) modified regs
 3950
 3960 ldrB  r0,IntFlag           ;Have we been interrupted by our Play-Event?
 3970 cmp   r0,#1
 3980 strEqB 0,IntSync           ;Ah, fucky YES! (Oops)
 3990 mov   r0,#%00001000        ;And return with Voice-Active-Flag
 4000 ldmfd r13!,{pc}
 4010
 4020.Head
 4030 dcd 0                      ;r1 Pos in the sample (Offset in fix point)
 4040 dcd 0                      ;r2 Increment/Pitch (LowWord for fixpoint)
 4050 dcd 0                      ;r3 Sample Adress
 4060 dcd 0                      ;r4 Length
 4070 dcd 0                      ;r5 Volume (0=Loud ... 255=Quiet)
 4080 dcd 0                      ;r6 RepAt (New fixpoint Pos), or 0 for NO REP
 4090 dcd 0                      ;Byte +24 Value for Auto Volume up
 4100                            ;      25   "    "   "   Volume down
 4110                            ;      26   "    "   "   Pitch up
 4120                            ;      27   "    "   "   Pitch down
 4130 dcd 0                      ;Byte +28 Actual Info Byte
 4140                            ;      29 Actual Comm Byte
 4150                            ;      30 (Sound FX Flag)
 4160                            ;      31 Last legal tone/note
 4170
 4180 dcb STRING$(3*32-4*32*(Vocs=8),CHR$0)    ;Add 3 or 7 Heads
 4190
 4200.Volume       dcd 0         ;Overall_Sound_Volume
 4210.IntFlag      dcb 0         ;Set = Have been interrupted
 4220.IntSync      dcb 0         ;Set = Loser needs new sync
 4230 align
 4240
 4250;==== PLAY EVENT ========================================================
 4260 
 4270;*** DO EVERY VSYNC EFFECTS (#r0=Timer ... $r0=preserved)
 4280
 4290.veffects
 4300 ldr   r4,[r12,#4]          ;Load current Pitch
 4310 cmp   r4,#0                ;No active tone -> sorry, effect disabled!
 4320 movEq pc,r14
 4330 ldr   r3,[r12,#24]         ;Load Auto-Effects
 4340 mov   r10,r14              ;Push r14
 4350 andS  r2,r3,#&ff           ;Is there Auto Volume up?
 4360 blNe  v_volup
 4370 andS  r2,r3,#&ff <<8       ;Is there Auto Volume down?
 4380 movNe r2,r2,lsr#8
 4390 blNe  v_voldown
 4400 andS  r2,r3,#&ff <<16      ;Is there Auto Pitch up?
 4410 movNe r2,r2,lsr#16
 4420 blNe  v_arcup
 4430 andS  r2,r3,#&ff <<24      ;Is there Auto Pitch down?
 4440 movNe r2,r2,lsr#24
 4450 blNe  v_arcdown
 4460 mov   r14,r10              ;Pop  r14
 4470
 4480 ldr   r1,[r12,#28]         ;Effect LWord & Last Tone are in the Header
 4490 andS  r2,r1,#&ff           ;Isolate InfoByte
 4500 movEq pc,r14               ;if 0, then there's no effect at all!
 4510 and   r3,r1,#&ff00         ;Isolate Effect number
 4520 ldr   r3,[pc,r3,lsr#6]     ;lsr#8 for effect into lowbyte & lsl#2 for *4
 4530 add   pc,pc,r3
 4540
 4550 dcd   v_arpeggio-vof1      ; 0 = Arpeggio
 4560.vof1
 4570 dcd   v_slideup-vof1       ; 1 = Slide Pitch up   (till Amis Max)
 4580 dcd   v_slidedown-vof1     ; 2 = Slide Pitch down (till Amis Min)
 4590 dcd   v_volup-vof1         ; 3 = Volume up
 4600 dcd   v_voldown-vof1       ; 4 = Volume down
 4610 dcd   v_arcup-vof1         ; 5 = Slide Arc Pitch up
 4620 dcd   v_arcdown-vof1       ; 6 = Slide Arc Pitch down
 4630
 4640.v_arpeggio
 4650 mov   r1,r1,lsr#24         ;Get last stored Tone into lowbyte
 4660 cmp   r0,#1                ;Time=1 or
 4670 cmpNe r0,#4                ;Time=4
 4680 addEq r1,r1,r2,lsr#4       ; ...then add  left InfoNibble to Note
 4690 cmp   r0,#2                ;Time=2 or
 4700 cmpNe r0,#5                ;Time=5
 4710 andEq r2,r2,#&0f           ; ...then add right InfoNibble to Note
 4720 addEq r1,r1,r2
 4730 ldr   r1,[r11,r1,lsl#2]    ;Get equivalent Frequency from r11=fTable
 4740 str   r1,[r12,#4]          ;Enter Pitch
 4750 mov   pc,r14
 4760
 4770.v_slideup
 4780 add   r1,r4,r2,lsl#6       ; Freq+InfoByte*64
 4790 cmp   r1,#&18800           ;Min Per = &071, ie OutPutF < &184DA
 4800 strLt r1,[r12,#4]
 4810 mov   pc,r14
 4820.v_slidedown
 4830 sub   r1,r4,r2,lsl#6       ; Freq-InfoByte*64
 4840 cmp   r1,#&3340            ;Max Per = &358, ie OutPutF > & 3355
 4850 strGt r1,[r12,#4]
 4860 mov   pc,r14
 4870
 4880.v_volup
 4890 cmp   r0,#1                ;Only each first v_interrupt for slow down
 4900 movNe pc,r14
 4910 ldr   r1,[r12,#16]         ;There is current Volume
 4920 subS  r1,r1,r2
 4930 strPl r1,[r12,#16]         ;If not > 0  (Max Vol), then write it back
 4940 mov   pc,r14
 4950.v_voldown
 4960 cmp   r0,#1
 4970 movNe pc,r14
 4980 ldr   r1,[r12,#16]
 4990 add   r1,r1,r2
 5000 cmp   r1,#255
 5010 strLs r1,[r12,#16]         ;If not <255 (Min Vol), then write it back
 5020 mov   pc,r14
 5030
 5040.v_arcup
 5050 addS  r1,r4,r2,lsl#4       ;Pitch+InfoByte*16 (for slow sliding)
 5060 strPl r1,[r12,#4]
 5070 mov   pc,r14
 5080.v_arcdown
 5090 subS  r1,r4,r2,lsl#4       ;Pitch-InfoByte*16 (for slow sliding)
 5100 strPl r1,[r12,#4]
 5110 mov   pc,r14
 5120
 5130;*** ENTRY POINTS FOR GAME SOUND FX
 5140
 5150.fx1
 5160 adr   r12,Head+0*32
 5170 b     fx4+4
 5180.fx2
 5190 adr   r12,Head+1*32
 5200 b     fx4+4
 5210.fx3
 5220 adr   r12,Head+2*32
 5230 b     fx4+4
 5240.fx4
 5250 adr   r12,Head+3*32
 5260 mov   r0,#1
 5270 strB  r0,[r12,#30]         ;Set SoundFX flag
 5280 adr   r10,Track
 5290 adr   r11,Ftable
 5300 b     vrule
 5310
 5320;*** INTERRUPT ENTRY POINT (#r0=Event No, r12=Workspace [here HeadAdr])
 5330
 5340.vinter
 5350 stmfd r13!,{r1-r11}        ;For not intercepting vector -> push r14 too
 5360
 5370 adr   r11,Ftable           ;r11 & r12 pointers are needed in both cases
 5380
 5390 ldmDb r11,{r0,r1}          ;Load Counter & Speed
 5400 add   r0,r0,#1             ;Counter+
 5410 cmp   r0,r1                ;If >= Speed, then...
 5420 movHs r0,#0                ;      reset Counter    | HS, cause Set_Speed
 5430 str   r0,[r11,#-8]         ;                       | could set
 5440 bHs   vplay                ;    & Play one row!    | Speed < Counter...
 5450
 5460 bl    veffects             ;Well, else support the effects
 5470 add   r12,r12,#32
 5480 bl    veffects             ;2.
 5490 add   r12,r12,#32
 5500 bl    veffects             ;3.
 5510 add   r12,r12,#32
 5520 bl    veffects             ;4.
 5530]
 5540IF Vocs=8 THEN
 5550[OPT p
 5560 add   r12,r12,#32
 5570 bl    veffects             ;5.
 5580 add   r12,r12,#32
 5590 bl    veffects             ;6.
 5600 add   r12,r12,#32
 5610 bl    veffects             ;7.
 5620 add   r12,r12,#32
 5630 bl    veffects             ;8.
 5640]
 5650ENDIF
 5660[OPT p
 5670 ldmfd r13!,{r1-r11,pc}     ;Return
 5680 
 5690;*** PLAY ONE PATTERN-POSITION (ALL 4/8 CHANNELS)
 5700
 5710.vplay
 5720 mov   r0,#1
 5730 strB  r0,IntFlag           ;Set Filler-Interupted-Flag!
 5740 adr   r6,Registers
 5750 ldmIa r6,{r7-r9}           ;Load 3 working registers
 5760 adr   r10,Track
 5770
 5780 bl    vchannel             ;1.
 5790 add   r12,r12,#32
 5800 bl    vchannel             ;2.
 5810 add   r12,r12,#32
 5820 bl    vchannel             ;3.
 5830 add   r12,r12,#32
 5840 bl    vchannel             ;4.
 5850]
 5860IF Vocs=8 THEN
 5870[OPT p
 5880 add   r12,r12,#32
 5890 bl    vchannel             ;5.
 5900 add   r12,r12,#32
 5910 bl    vchannel             ;6.
 5920 add   r12,r12,#32
 5930 bl    vchannel             ;7.
 5940 add   r12,r12,#32
 5950 bl    vchannel             ;8.
 5960]
 5970ENDIF
 5980[OPT p
 5990
 6000 subS  r7,r7,#1             ;Pattern_Counter - 1, is it zero?
 6010 stmNeIa r6,{r7-r8}         ;Not zero yet, so
 6020 ldmNeFd r13!,{r1-r11,pc}   ; don't play new Pattern, Return instead
 6030
 6040 mov   r7,#64               ;Well, new Pattern begins, with Count=64
 6050 ldrB  r0,[r9,#1]!          ;And get next Pattern Nr.
 6060 cmp   r0,#&ff              ;End of Sequence?
 6070 ldrEq r9,[r10,#24]         ; Yeah -> Reset Sequence Pointer,
 6080 ldrEqB 0,[r9]              ;         that means restart Song!
 6090 ldr   r8,[r10,#28]         ;Address Patternstart
 6100 add   r8,r8,r0,lsl#10-(Vocs=8)    ;+ Nr*1024 (or Nr*2048)
 6110 stmIa r6,{r7-r9}
 6120 ldmfd r13!,{r1-r11,pc}     ;Return
 6130
 6140;*** SUPPLY ONE CHANNEL WITH LVAR INFORMATIONS
 6150
 6160.vchannel
 6170 ldr   r1,[r8],#4           ;Pattern LWord of current Patt_Pos & INC
 6180
 6190 ldrB  r2,[r12,#30]         ;Is SoundFX on?
 6200 cmp   r2,#0
 6210 bEq   vrule                ;No...
 6220 ldr   r2,[r12,#4]
 6230 cmp   r2,#0                ;Yes, but is sample still active?
 6240 strEqB 2,[r12,#30]         ;No, so cancel FX
 6250 mov   pc,r14
 6260
 6270.vrule
 6280 movS  r0,r1,lsr#24         ;Isolate Tone & Is it zero?
 6290 bEq   vcomms               ;No Tone -> Perhaps still a Command...
 6300
 6310 strB  r0,[r12,#31]         ;Store legal Tone for poss. Arpeggio effect
 6320 ldr   r0,[r11,r0,lsl#2]    ;Get equivalent Frequency from r11=fTable
 6330 str   r0,[r12,#4]          ;Enter Pitch
 6340 andS  r0,r1,#&ff <<16      ;Isolate Instrument-Byte, zero?
 6350 ldrEq r0,[r12,#20]         ; Y -> Get old RepAt (perhaps a RepTone!)
 6360 strEq r0,[r12,#00]         ;    & Set as new Pos (same Inst once again)
 6370 bEq   vcomms
 6380                            ;Else point to InstPool = Track+Inst*32
 6390 add   r2,r10,r0,lsr#11     ;lsr#16 for lowbyte & lsl#5 for *32 => lsr#11
 6400 ldmIa r2,{r0,r2-r5}        ;Read all 5 InstPool Words at once
 6410 str   r0,[r12,# 8]         ;Enter Sample Address
 6420 str   r3,[r12,#16]         ;Enter Volume
 6430 movS  r0,r4,lsl#16         ;Pos=RepAt (in 16-fixpoint), but is it zero?
 6440 addNe r2,r4,r5             ; No -> Len (absolute from 0) = RepAt+RepLen
 6450 movNe r4,r0                ;    -> Head Offset RepAt = fixpoint RepAt
 6460 str   r0,[r12,# 0]         ;Enter Pos
 6470 str   r2,[r12,#12]         ;Enter Length
 6480 str   r4,[r12,#20]         ;Enter RepAt
 6490
 6500.vcomms
 6510 and   r0,r1,#&0f <<8       ;Isolate Command-Nibble from DataLW
 6520 and   r2,r1,#&ff           ;Isolate InfoByte
 6530 ldr   r3,[pc,r0,lsr#6]     ;lsr#8 for Nibble into lowbyte & lsl#2 for *4
 6540 add   pc,pc,r3
 6550
 6560 dcd   vef-vof2             ;Effects 0..
 6570.vof2
 6580 dcd   vef-vof2             ;1
 6590 dcd   vef-vof2             ;2
 6600 dcd   vef-vof2             ;3
 6610 dcd   vef-vof2             ;4
 6620 dcd   vef-vof2             ;5
 6630 dcd   vef-vof2             ;6
 6640 dcd   vstereopos-vof2      ; 7 = Set Stereo Pos
 6650 dcd   vautovolup-vof2      ; 8 = Auto Volume up
 6660 dcd   vautovoldown-vof2    ; 9 = Auto Volume down
 6670 dcd   vautoarcup-vof2      ; A = Auto Pitch up
 6680 dcd   vautoarcdown-vof2    ; B = Auto Pitch down
 6690 dcd   vsetvol-vof2         ; C = Set Volume
 6700 dcd   vpattbreak-vof2      ; D = Pattern Break
 6710 dcd   vnop-vof2            ; E = (Not used yet)
 6720 dcd   vsetspeed-vof2       ; F = Set Speed
 6730
 6740.vef                        ;Effects, needn't to be done here, but later!
 6750 strB  r2,[r12,#28]         ;Store InfoByte, for Effects
 6760 mov   r0,r0,lsr#8
 6770 strB  r0,[r12,#29]         ;Store CommByte, for Effects
 6780.vnop
 6790 mov   pc,r14               ;and return
 6800
 6810.vstereopos
 6820 adr   r0,Head              ;Get current channel number (little Overhead)
 6830 sub   r0,r12,r0
 6840 mov   r0,r0,lsr#3          ;DIV 8; => 0,4,8,12,...
 6850 cmp   r0,#7*4
 6860 movEq r1,   #&60           ;Stereo Image Register   7  = Adr &60
 6870 addNe r1,r0,#&64           ;Stereo Image Registers 0-6 = Adr &64 upwards
 6880 mov   r1,r1,lsl#24
 6890 orr   r1,r1,r2
 6900 mov   r2,#&3400000
 6910 str   r1,[r2]
 6920]
 6930IF Vocs=4 THEN
 6940[OPT p
 6950 cmp   r0,#3*4              ;Extra Adr of Image Reg 7
 6960 subEq r1,r1,#&10<<24
 6970 addNe r1,r1,#&10<<24       ;Well, set up twin Image Reg too!
 6980 str   r1,[r2]
 6990]
 7000ENDIF
 7010[OPT p
 7020 mov   pc,r14
 7030
 7040.vautovolup
 7050 strB  r2,[r12,#24]
 7060 mov   pc,r14
 7070.vautovoldown
 7080 strB  r2,[r12,#25]
 7090 mov   pc,r14
 7100.vautoarcup
 7110 strB  r2,[r12,#26]
 7120 mov   pc,r14
 7130.vautoarcdown
 7140 strB  r2,[r12,#27]
 7150 mov   pc,r14
 7160
 7170.vsetvol
 7180 str   r2,[r12,#16]         ;Enter new Volume into Header
 7190 mov   pc,r14
 7200
 7210.vpattbreak
 7220 mov   r7,#1                ;Jump to end of Patt, ie Patt_Count=1
 7230 mov   pc,r14
 7240
 7250.vsetspeed
 7260 str   r2,Vspeed            ;Set new (overall-) Speed
 7270 mov   pc,r14
 7280
 7290;==== DATABAY ====
 7300
 7310.Registers    dcd 64        ; r7 Pattern_Counter (64 -> 1)
 7320              dcd 00        ; r8 Current Pointer in the Pattern
 7330              dcd 00        ; r9 Current Pointer in the Sequence
 7340 
 7350.Vcount       dcd 0         ;VSync Counter                |Keep these two
 7360.Vspeed       dcd 6         ;Speed Counter (default=6)    |  < .Ftable
 7370
 7380.Ftable       ]:P%+=9*12*4:[OPT p
 7390.Track
 7400
 7410;Sample Head (at Inst*32)   #00 Absolute Sample Address
 7420                     ;      #04 Length
 7430                     ;      #08 Volume 0-&ff
 7440                     ;      #12 RepeatAt as ByteOffset
 7450                     ;      #16 RepLen
 7460                     ;      #20 Instrument Name
 7470
 7480;====INITSTORE ====
 7490
 7500 mov   r2,#0
 7510.uall
 7520 str   r2,[r0],#4
 7530 cmp   r0,r1
 7540 bLo   uall
 7550 mov   pc,r14
 7560.ufin
 7570
 7580]:ENDPROC
 7590
 7600-----------------------
 76102er ADR (only forwards)
 7620-----------------------
 7630DEF FNadr(r%,dest%)
 7640dis%=dest%-P%-8
 7650IF p=%1000 THEN
 7660  d0%=0 :d1%=0
 7670ELSE
 7680  IF dis% AND &f THEN
 7690    d0%=dis% AND &000FF
 7700    d1%=dis% AND &FFF00
 7710  ELSE
 7720    d0%=dis% AND &00FFF
 7730    d1%=dis% AND &FF000
 7740  ENDIF
 7750  IF d0%+d1%<>dis% THEN PRINT CHR$7;"FNadr doesn't suffice!":END
 7760  IF d0%=0 OR d1%=0 THEN PRINT "FNadr : ADR would do. ";~dis%
 7770ENDIF
 7780[OPT p
 7790 add r%,pc,#d1%
 7800 add r%,r%,#d0%
 7810]=""

� >Tools.Modul

� code 256000,L%-1
(
2,mess$=�15,�31)+�9+"1.20 ("+��$,5,11)+")"
<� p=%1000 � %1010 � 2
FP%=code
P�_Music
Z� p
d
nend%=Track+pointer
x/�''"Start at : &";~code,"End at  : &";~end%
�3�  "Total len: ";end%-code,"Song len: ";pointer
�
��'"Save song module as: "a$
�&� "Save "+a$+" "+�~code+" "+�~end%
�� "Settype "+a$+" Module"
��
�
�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$=�:� �TXA
,  ȕ � �#f%
6?    top%+=1:nam$(top%)=�#f%:�#f%,byt%(top%):loc$(top%)=�#f%
@  �
J
  �#f%
T
^H  �'"Please enter song path [SONGS]: "path$:� path$="" path$="songs"
h  � "Cat "+path$
r   �'"Coconizer songfile? "a$
|  a$=path$+"."+a$
�
  f%=� a$
�5  b1=�#f%:b2=�#f%:b3=�#f%:b4=�#f%:b5=�#f%:b6=�#f%
�
  �#f%
�9  � b4=0 � b5>0 � Vocs=b6 � Vocs=b1     :� packed...?
�
�  �_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 �
0"  � "PackLoad "+a$+" "+�~Track
:�
D  � "Load "+a$+" "+�~Track
N�
X
bD� i%=0 � 9*12-1          :� From internat. Octave -3 to Octave 5
lJn%=i% +4*12                 :� Correct it, as 'Steinway' +0 = Middle C
v4f%=440*(2^((n%-46)/12))     :� Frequency formula
�)Ftable!(i%*4)=(f%/(1000000/us))*65536
�� i%
�
�a$=�$(Track+1),15)
��'"NAME: ";a$;
�!ȕ �a$,1)=" ":a$=�a$,�a$-1):�
�$helps=a$:helps?(�a$)=31
�;� �46);"Sequencies: ";Track?22;"  Patterns: ";Track?23'
�
�Ipointer=Track!32  :� +Track                    :REM 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;
4[  � j%=1 � top%:� na$<>nam$(j%) � �:�'" -> "na$:$(Track+i%*32+20)=na$:� �30,�8);:� �TtC
>  � " (";byt%(j%);")";
H>  � len>byt%(j%) � len=byt%(j%):Track!(i%*32+4)=len:� "*";
R  � ,(�loc$(j%)-65) � 2 +1
\%  sort$(i%)=loc$(j%):sort%(i%)=i%
f  pointer+=len+gap
p� i%
z�
�
��
�
  flag%=0
�  � i%=1 � Track?21-1
�[    � sort$(i%)>sort$(i%+1) � Ȕ sort$(i%),sort$(i%+1):Ȕ sort%(i%),sort%(i%+1):flag%=1
�
  � i%
�
� flag%=0
�
�� 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
.  �
8#    disc=(�sort$(i%)-65) � 2 +1
B3    �'�7;"PLEASE INSERT SAMPLE DISC ";disc:a$=�
L    � �d|C
V  �
`� i%
j�
t
~� �_MusicASM
�
gap=16
�
us =48
�
[OPT p
�
� ;---------------------------
�;  COCONIZER �ULE PLAYER
� ;---------------------------
�
�$ dcd 0               ;Start code
�- dcd init-code       ;Initialisation code
�+ dcd fini-code       ;Finalisation code
�. dcd 0               ;Service Call Handler
& dcd title-code      ;Title String

% dcd helps-code      ;Help String
8 dcd 0               ;Help and Command keyword table

('.title dcb "CoconizerSong"+�0:align
2.helps dcb mess$+�0:align
<
F	.init
P; stmfd r13!,{r7-r11,r14}    ;We are called in SVC_mode!
Z bl    v_on
d ldmfd r13!,{r7-r11,pc}^
n
x	.fini
� stmfd r13!,{r7-r11,r14}
� bl    v_off
�B bl    vrelativ             ;And back to origin relative state
� ldmfd r13!,{r7-r11,pc}^
�
�(;-----------------------------------
�;
�'; THE COCONIZER PLAYER ROUTINE v1.2
�;
�%;   Needs 20% of the ARM-II speed
�;
�;         (c) Mai 1990 by
�$;    Eduard Pfarr & Thomas Alber
;           of Playfield
;
%;   Latest revision - 10 Feb 1991
";
,(;-----------------------------------
6
@	.v_on
J stmfd r13!,{r14}
T% mov   r0,#2                ;Ƞ 2
^E mov   r1,#208              ;BufferLen of �E channel, total *Vocs
h. mov   r2,#us               ;Sample Period
r7 mov   r3,#0                ;Default ChannelHandler
|1 mov   r4,#0                ;Default Sheduler
� swi   "Sound_Configure"
�H mov   r0,#Vocs             ;Ƞ 8 with params doesn't work directly!
�I mov   r1,#0                ;Because then sample rate is set false...
� mov   r2,#0
� mov   r3,#0
� mov   r4,#0
� swi   "Sound_Configure"
�
� 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
0/ swi   "Sound_Stereo"            ;*Ȣ r0 r1
: add   r0,r0,#1
D cmp   r0,#Vocs
N bLs   vimage
X
b mov   r0,#Vocs
l	.vset
v adr   r1,Vname
�; swi   "Sound_AttachNamedVoice"  ;*CHANNELVOICE r0 "r1"
� mov   r1,#&170
�; mov   r2,#50               ;Activate all channels once
� mov   r3,#255
�/ swi   "Sound_Control"      ;*� r0 r1 r2 r3
� subS  r0,r0,#1
� bNe   vset
�
� 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"
*
41 mov   r0,#Vocs             ;And once more...
> mov   r1,#0
H mov   r2,#0
R mov   r3,#0
\ mov   r4,#0
f' swi   "Sound_Configure"    ;Grrrh!
p
z4 mov   r0,#0                ;Read current Volume
� swi   "Sound_Volume"
�# mov   r0,r0,lsl#1          ;*2
� rsb   r0,r0,#254
�= str   r0,Volume            ;and use it as overall Volume
�
�3 mov   r11,#3               ;Test max 3 times !
�
.vtest
� mov   r1,#0
� strB  r1,IntSync
� mov   r3,#26
� bl    vwait
�; ldrB  r1,IntSync           ;Is there a Loser-Channel ?
� cmp   r1,#0
	 ldmEqFd r13!,{pc}
	$ mov   r0,#1                ;Off
	 swi   "Sound_Enable"
	$ mov   r3,#101
	. bl    vwait
	8# mov   r0,#2                ;On
	B swi   "Sound_Enable"
	L subS  r11,r11,#1
	V bNe   vtest
	`0 ldmfd r13!,{pc}            ;Well, bad luck!
	j
	t
.vwait
	~ mov   r12,r14
	�9 mov   r0,#19               ;Wait for some frameflies
	� swi   "OS_Byte"
	� subS  r3,r3,#1
	� bNe   vwait+8
	�+ mov   pc,r12               ;svc_r14...
	�
	�;*** �OLUTE CODE
	�
	�
.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]
2
<0 ldrB  r1,[r10,#21]         ;Number of Insts
F	.vall
P1 ldr   r2,[r10,r1,lsl#5]    ;Inst Addr Offset
Z add   r2,r10,r2
d& str   r2,[r10,r1,lsl#5]    ;+i*32
n subS  r1,r1,#1
x bNe   vall
� mov   pc,r14
�
�;*** RELATIVE CODE
�
�
.vrelativ
� �adr (10,Track)
�
� ldr   r1,[r10,#24]
� sub   r1,r1,r10
� str   r1,[r10,#24]
� ldr   r2,[r10,#28]
� sub   r2,r2,r10
� str   r2,[r10,#28]

 ldrB  r1,[r10,#21]
	.vall
" ldr   r2,[r10,r1,lsl#5]
, sub   r2,r2,r10
6 str   r2,[r10,r1,lsl#5]
@ subS  r1,r1,#1
J bNe   vall
T mov   pc,r14
^
h;*** RESTART TUNE
r
|.v_reset
� �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
0 bNe   vall
: mov   pc,r14
D
N ;*** TURN � PLAYER � COCO-ȡ
X
b
.v_off
l stmfd r13!,{r14}
v5 mov   r0,#13               ;Disable Event Nr. r1
�2 mov   r1,#4                ;(4 = VSync Event)
� 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
� ldmfd r13!,{pc}




.Vstereos

2 dcd -50      ;Stereo Positions for 4 channels

  dcd -20

* dcd  20

4 dcd  50

>

H2 dcd-126      ;Stereo Positions for 8 channels

R dcd -90

\ dcd -54

f dcd -18

p dcd  18

z dcd  54

� dcd  90

� 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
8J ldmfd r13!,{pc}            ;DeInstantiate, Detach   to/from a channel
B. ldmfd r13!,{pc}            ;Hello Arthur!
L> dcd   Vname-VoiceBase      ;Offset from VoiceBase to Name
V.Vname dcb "Cocoplex"+�0
`
 align
j
t
.vfill
~= 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
� mov   r0,#0
�7 strB  r0,IntFlag           ;Clear Interrupted_Flag
�
�
.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)
2: movLs r1,r6                ;Yes, so RepAt is new Pos,
<4 cmp   r1,#0                ;    but is it zero?
FL movEq r2,#0                ;    yes -> Mute Channel (ie Set Pitch to 0)
P< cmp   r12,r10              ;VIDC-Buffer filled already?
Z( bLo   vfilloop             ;Nooo...
dF stmIa r8,{r1-r2}           ;Save the two (probably) modified regs
n
xL ldrB  r0,IntFlag           ;Have we been interrupted by our Play-Event?
� cmp   r0,#1
�6 strEqB 0,IntSync           ;Ah, fucky YES! (Oops)
�B mov   r0,#%00001000        ;And return with Voice-Active-Flag
� ldmfd r13!,{pc}
�
�	.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
69                            ;      30 (Sound FX Flag)
@>                            ;      31 Last legal tone/note
J
T5 dcb �3*32-4*32*(Vocs=8),�0)    ;Add 3 or 7 Heads
^
h5.Volume       dcd 0         ;Overall_Sound_Volume
r<.IntFlag      dcb 0         ;Set = Have been interrupted
|;.IntSync      dcb 0         ;Set = Loser needs new sync
�
 align
�
�M;==== PLAY EVENT ========================================================
� 
�=;*** DO EVERY VSYNC EFFECTS (#r0=Timer ... $r0=preserved)
�
�
.veffects
�3 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
08 andS  r2,r3,#&ff <<16      ;Is there Auto Pitch up?
: movNe r2,r2,lsr#16
D blNe  v_arcup
N: andS  r2,r3,#&ff <<24      ;Is there Auto Pitch down?
X movNe r2,r2,lsr#24
b blNe  v_arcdown
l) mov   r14,r10              ;Pop  r14
v
�K ldr   r1,[r12,#28]         ;Effect LWord & Last Tone are in the Header
�1 andS  r2,r1,#&ff           ;Isolate InfoByte
�E movEq pc,r14               ;if 0, then there's no effect at all!
�6 and   r3,r1,#&ff00         ;Isolate Effect number
�M ldr   r3,[pc,r3,lsr#6]     ;lsr#8 for effect into lowbyte & lsl#2 for *4
� add   pc,pc,r3
�
�. 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
4* cmp   r0,#1                ;Time=1 or
>' cmpNe r0,#4                ;Time=4
HF addEq r1,r1,r2,lsr#4       ; ...then add  left InfoNibble to Note
R* cmp   r0,#2                ;Time=2 or
\' cmpNe r0,#5                ;Time=5
fF andEq r2,r2,#&0f           ; ...then add right InfoNibble to Note
p addEq r1,r1,r2
zI ldr   r1,[r11,r1,lsl#2]    ;Get equivalent Frequency from r11=fTable
�, str   r1,[r12,#4]          ;Enter Pitch
� mov   pc,r14
�
�.v_slideup
�2 add   r1,r4,r2,lsl#6       ; Freq+InfoByte*64
�D cmp   r1,#&18800           ;Min Per = &071, ie OutPutF < &184DA
� strLt r1,[r12,#4]
� 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
8 subS  r1,r1,r2
BJ strPl r1,[r12,#16]         ;If not > 0  (Max Vol), then write it back
L mov   pc,r14
V.v_voldown
` cmp   r0,#1
j movNe pc,r14
t ldr   r1,[r12,#16]
~ add   r1,r1,r2
� cmp   r1,#255
�J strLs r1,[r12,#16]         ;If not <255 (Min Vol), then write it back
� mov   pc,r14
�
�.v_arcup
�E addS  r1,r4,r2,lsl#4       ;Pitch+InfoByte*16 (for slow sliding)
� 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
2 b     fx4+4
<.fx2
F adr   r12,Head+1*32
P b     fx4+4
Z.fx3
d adr   r12,Head+2*32
n b     fx4+4
x.fx4
� adr   r12,Head+3*32
� mov   r0,#1
�1 strB  r0,[r12,#30]         ;Set SoundFX flag
� adr   r10,Track
� adr   r11,Ftable
� b     vrule
�
�F;*** �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
6C str   r0,[r11,#-8]         ;                       | could set
@L bHs   vplay                ;    & Play one row!    | Speed < Counter...
J
T? bl    veffects             ;Well, else support the effects
^ add   r12,r12,#32
h# bl    veffects             ;2.
r add   r12,r12,#32
|# bl    veffects             ;3.
� add   r12,r12,#32
�# bl    veffects             ;4.
�]
�� Vocs=8 �
�
[OPT p
� add   r12,r12,#32
�# bl    veffects             ;5.
� 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
0 
:4;*** PLAY �E PATTERN-POSITION (ALL 4/8 CHANNELS)
D
N
.vplay
X mov   r0,#1
b< strB  r0,IntFlag           ;Set Filler-Interupted-Flag!
l adr   r6,Registers
v9 ldmIa r6,{r7-r9}           ;Load 3 working registers
� adr   r10,Track
�
�# bl    vchannel             ;1.
� add   r12,r12,#32
�# bl    vchannel             ;2.
� add   r12,r12,#32
�# bl    vchannel             ;3.
� add   r12,r12,#32
�# bl    vchannel             ;4.
�]
�� 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.
4 add   r12,r12,#32
># bl    vchannel             ;8.
H]
R�
\
[OPT p
f
pA subS  r7,r7,#1             ;Pattern_Counter - 1, is it zero?
z1 stmNeIa r6,{r7-r8}         ;Not zero yet, so
�H ldmNeFd r13!,{r1-r11,pc}   ; don't play new Pattern, Return instead
�
�H mov   r7,#64               ;Well, new Pattern begins, with Count=64
�9 ldrB  r0,[r9,#1]!          ;And get next Pattern Nr.
�1 cmp   r0,#&ff              ;End of Sequence?
�A ldrEq r9,[r10,#24]         ; Yeah -> Reset Sequence Pointer,
�B ldrEqB 0,[r9]              ;         that means restart Song!
�5 ldr   r8,[r10,#28]         ;Address Patternstart
�> add   r8,r8,r0,lsl#10-(Vocs=8)    ;+ Nr*1024 (or Nr*2048)
� 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?
8 cmp   r2,#0
B& bEq   vrule                ;No...
L ldr   r2,[r12,#4]
VA cmp   r2,#0                ;Yes, but is sample still active?
`1 strEqB 2,[r12,#30]         ;No, so cancel FX
j mov   pc,r14
t
~
.vrule
�; movS  r0,r1,lsr#24         ;Isolate Tone & Is it zero?
�F bEq   vcomms               ;No Tone -> Perhaps still a Command...
�
�K strB  r0,[r12,#31]         ;Store legal Tone for poss. Arpeggio effect
�I ldr   r0,[r11,r0,lsl#2]    ;Get equivalent Frequency from r11=fTable
�, str   r0,[r12,#4]          ;Enter Pitch
�? andS  r0,r1,#&ff <<16      ;Isolate Instrument-Byte, zero?
�I ldrEq r0,[r12,#20]         ; Y -> Get old RepAt (perhaps a RepTone!)
�L 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 & lsl#5 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
2J movNe r4,r0                ;    -> Head Offset RepAt = fixpoint RepAt
<* str   r0,[r12,# 0]         ;Enter Pos
F- str   r2,[r12,#12]         ;Enter Length
P, str   r4,[r12,#20]         ;Enter RepAt
Z
d.vcomms
nC and   r0,r1,#&0f <<8       ;Isolate Command-Nibble from DataLW
x1 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
�
�, dcd   vef-vof2             ;Effects 0..
�	.vof2
�" dcd   vef-vof2             ;1
�" dcd   vef-vof2             ;2
�" dcd   vef-vof2             ;3
�" dcd   vef-vof2             ;4
�" 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
64 dcd   vnop-vof2            ; E = (Not used yet)
@/ dcd   vsetspeed-vof2       ; F = Set Speed
J
TM.vef                        ;Effects, needn't to be done here, but later!
^< strB  r2,[r12,#28]         ;Store InfoByte, for Effects
h mov   r0,r0,lsr#8
r< strB  r0,[r12,#29]         ;Store CommByte, for Effects
|	.vnop
�+ mov   pc,r14               ;and return
�
�.vstereopos
�M adr   r0,Head              ;Get current channel number (little Overhead)
� sub   r0,r12,r0
�5 mov   r0,r0,lsr#3          ;� 8; => 0,4,8,12,...
� cmp   r0,#7*4
�E movEq r1,   #&60           ;Stereo Image Register   7  = Adr &60
�M addNe r1,r0,#&64           ;Stereo Image Registers 0-6 = Adr &64 upwards
� 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
0 subEq r1,r1,#&10<<24
:A addNe r1,r1,#&10<<24       ;Well, set up twin Image Reg too!
D str   r1,[r2]
N]
X�
b
[OPT p
l mov   pc,r14
v
�.vautovolup
� strB  r2,[r12,#24]
� mov   pc,r14
�.vautovoldown
� strB  r2,[r12,#25]
� mov   pc,r14
�.vautoarcup
� strB  r2,[r12,#26]
� mov   pc,r14
�.vautoarcdown
� strB  r2,[r12,#27]
� mov   pc,r14
�
.vsetvol
= str   r2,[r12,#16]         ;Enter new Volume into Header
 mov   pc,r14
 
*.vpattbreak
4E mov   r7,#1                ;Jump to end of Patt, ie Patt_Count=1
> mov   pc,r14
H
R.vsetspeed
\9 str   r2,Vspeed            ;Set new (overall-) Speed
f mov   pc,r14
p
z;==== �BAY ====
�
�>.Registers    dcd 64        ; r7 Pattern_Counter (64 -> 1)
�C              dcd 00        ; r8 Current Pointer in the Pattern
�D              dcd 00        ; r9 Current Pointer in the Sequence
� 
�M.Vcount       dcd 0         ;VSync Counter                |Keep these two
�J.Vspeed       dcd 6         ;Speed Counter (default=6)    |  < .Ftable
�
�%.Ftable       ]:P%+=9*12*4:[OPT p
�
.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
.
8;====INITSTORE ====
B
L mov   r2,#0
V	.uall
` str   r2,[r0],#4
j cmp   r0,r1
t bLo   uall
~ mov   pc,r14
�	.ufin
�
�]:�
�
�-----------------------
�2er ADR (only forwards)
�-----------------------
�� �adr(r%,dest%)
�dis%=dest%-P%-8
�� p=%1000 �
�  d0%=0 :d1%=0
��
  � dis% � &f �

    d0%=dis% � &000FF
    d1%=dis% � &FFF00
  �
(    d0%=dis% � &00FFF
2    d1%=dis% � &FF000
<  �
F7  � d0%+d1%<>dis% � � �7;"FNadr doesn't suffice!":�
P8  � d0%=0 � d1%=0 � � "FNadr : ADR would do. ";~dis%
Z�
d
[OPT p
n add r%,pc,#d1%
x add r%,r%,#d0%
�]=""
�
00000000  0d 00 0a 12 f4 20 3e 54  6f 6f 6c 73 2e 4d 6f 64  |..... >Tools.Mod|
00000010  75 6c 0d 00 14 04 0d 00  1e 16 de 20 63 6f 64 65  |ul......... code|
00000020  20 32 35 36 30 30 30 2c  4c 25 2d 31 0d 00 28 04  | 256000,L%-1..(.|
00000030  0d 00 32 2c 6d 65 73 73  24 3d c4 31 35 2c bd 33  |..2,mess$=.15,.3|
00000040  31 29 2b bd 39 2b 22 31  2e 32 30 20 28 22 2b c1  |1)+.9+"1.20 ("+.|
00000050  91 24 2c 35 2c 31 31 29  2b 22 29 22 0d 00 3c 19  |.$,5,11)+")"..<.|
00000060  e3 20 70 3d 25 31 30 30  30 20 b8 20 25 31 30 31  |. p=%1000 . %101|
00000070  30 20 88 20 32 0d 00 46  0b 50 25 3d 63 6f 64 65  |0 . 2..F.P%=code|
00000080  0d 00 50 0b f2 5f 4d 75  73 69 63 0d 00 5a 07 ed  |..P.._Music..Z..|
00000090  20 70 0d 00 64 04 0d 00  6e 16 65 6e 64 25 3d 54  | p..d...n.end%=T|
000000a0  72 61 63 6b 2b 70 6f 69  6e 74 65 72 0d 00 78 2f  |rack+pointer..x/|
000000b0  f1 27 27 22 53 74 61 72  74 20 61 74 20 3a 20 26  |.''"Start at : &|
000000c0  22 3b 7e 63 6f 64 65 2c  22 45 6e 64 20 61 74 20  |";~code,"End at |
000000d0  20 3a 20 26 22 3b 7e 65  6e 64 25 0d 00 82 33 f1  | : &";~end%...3.|
000000e0  20 20 22 54 6f 74 61 6c  20 6c 65 6e 3a 20 22 3b  |  "Total len: ";|
000000f0  65 6e 64 25 2d 63 6f 64  65 2c 22 53 6f 6e 67 20  |end%-code,"Song |
00000100  6c 65 6e 3a 20 22 3b 70  6f 69 6e 74 65 72 0d 00  |len: ";pointer..|
00000110  8c 04 0d 00 96 1f e8 27  22 53 61 76 65 20 73 6f  |.......'"Save so|
00000120  6e 67 20 6d 6f 64 75 6c  65 20 61 73 3a 20 22 61  |ng module as: "a|
00000130  24 0d 00 a0 26 ff 20 22  53 61 76 65 20 22 2b 61  |$...&. "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 aa 1d ff 20 22 53 65  |+.~end%..... "Se|
00000160  74 74 79 70 65 20 22 2b  61 24 2b 22 20 4d 6f 64  |ttype "+a$+" Mod|
00000170  75 6c 65 22 0d 00 b4 05  e0 0d 00 be 04 0d 00 c8  |ule"............|
00000180  4d 2d 2d 2d 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 0d 00 d2 0d dd 20  |----------..... |
000001d0  f2 5f 4d 75 73 69 63 0d  00 dc 0f e7 20 70 3d 25  |._Music..... p=%|
000001e0  31 30 30 30 20 8c 0d 00  e6 34 20 20 2a 52 4d 45  |1000 ....4  *RME|
000001f0  6e 73 75 72 65 20 50 61  63 6b 69 74 20 31 2e 35  |nsure Packit 1.5|
00000200  30 20 52 4d 4c 6f 61 64  20 21 43 6f 63 6f 6e 69  |0 RMLoad !Coconi|
00000210  7a 65 72 2e 50 61 63 6b  69 74 0d 00 f0 10 20 20  |zer.Packit....  |
00000220  6d 61 78 69 6e 73 74 3d  33 32 0d 00 fa 46 20 20  |maxinst=32...F  |
00000230  de 20 6e 61 6d 24 28 32  30 30 32 29 2c 62 79 74  |. nam$(2002),byt|
00000240  25 28 32 30 30 32 29 2c  6c 6f 63 24 28 32 30 30  |%(2002),loc$(200|
00000250  32 29 2c 73 6f 72 74 25  28 6d 61 78 69 6e 73 74  |2),sort%(maxinst|
00000260  29 2c 73 6f 72 74 24 28  6d 61 78 69 6e 73 74 29  |),sort$(maxinst)|
00000270  0d 01 04 12 20 20 73 6f  72 74 24 28 32 29 3d 22  |....  sort$(2)="|
00000280  b1 22 0d 01 0e 0c 20 20  74 6f 70 25 3d 30 0d 01  |."....  top%=0..|
00000290  18 15 20 20 66 25 3d 8e  20 22 6c 6f 63 61 74 69  |..  f%=. "locati|
000002a0  6f 6e 22 0d 01 22 38 20  20 e7 20 66 25 3d 30 20  |on".."8  . f%=0 |
000002b0  8c 20 f1 27 22 50 4c 45  41 53 45 20 49 4e 53 45  |. .'"PLEASE INSE|
000002c0  52 54 20 41 20 53 4f 4e  47 20 44 49 53 43 22 3a  |RT A SONG DISC":|
000002d0  61 24 3d be 3a e5 20 8d  54 58 41 0d 01 2c 0f 20  |a$=.:. .TXA..,. |
000002e0  20 c8 95 20 ac 20 c5 23  66 25 0d 01 36 3f 20 20  | .. . .#f%..6?  |
000002f0  20 20 74 6f 70 25 2b 3d  31 3a 6e 61 6d 24 28 74  |  top%+=1:nam$(t|
00000300  6f 70 25 29 3d be 23 66  25 3a e8 23 66 25 2c 62  |op%)=.#f%:.#f%,b|
00000310  79 74 25 28 74 6f 70 25  29 3a 6c 6f 63 24 28 74  |yt%(top%):loc$(t|
00000320  6f 70 25 29 3d be 23 66  25 0d 01 40 07 20 20 ce  |op%)=.#f%..@.  .|
00000330  0d 01 4a 0a 20 20 d9 23  66 25 0d 01 54 04 0d 01  |..J.  .#f%..T...|
00000340  5e 48 20 20 e8 27 22 50  6c 65 61 73 65 20 65 6e  |^H  .'"Please en|
00000350  74 65 72 20 73 6f 6e 67  20 70 61 74 68 20 5b 53  |ter song path [S|
00000360  4f 4e 47 53 5d 3a 20 22  70 61 74 68 24 3a e7 20  |ONGS]: "path$:. |
00000370  70 61 74 68 24 3d 22 22  20 70 61 74 68 24 3d 22  |path$="" path$="|
00000380  73 6f 6e 67 73 22 0d 01  68 14 20 20 ff 20 22 43  |songs"..h.  . "C|
00000390  61 74 20 22 2b 70 61 74  68 24 0d 01 72 20 20 20  |at "+path$..r   |
000003a0  e8 27 22 43 6f 63 6f 6e  69 7a 65 72 20 73 6f 6e  |.'"Coconizer son|
000003b0  67 66 69 6c 65 3f 20 22  61 24 0d 01 7c 15 20 20  |gfile? "a$..|.  |
000003c0  61 24 3d 70 61 74 68 24  2b 22 2e 22 2b 61 24 0d  |a$=path$+"."+a$.|
000003d0  01 86 0d 20 20 66 25 3d  8e 20 61 24 0d 01 90 35  |...  f%=. a$...5|
000003e0  20 20 62 31 3d 9a 23 66  25 3a 62 32 3d 9a 23 66  |  b1=.#f%:b2=.#f|
000003f0  25 3a 62 33 3d 9a 23 66  25 3a 62 34 3d 9a 23 66  |%:b3=.#f%:b4=.#f|
00000400  25 3a 62 35 3d 9a 23 66  25 3a 62 36 3d 9a 23 66  |%:b5=.#f%:b6=.#f|
00000410  25 0d 01 9a 0a 20 20 d9  23 66 25 0d 01 a4 39 20  |%....  .#f%...9 |
00000420  20 e7 20 62 34 3d 30 20  80 20 62 35 3e 30 20 8c  | . b4=0 . b5>0 .|
00000430  20 56 6f 63 73 3d 62 36  20 8b 20 56 6f 63 73 3d  | Vocs=b6 . Vocs=|
00000440  62 31 20 20 20 20 20 3a  f4 20 70 61 63 6b 65 64  |b1     :. packed|
00000450  2e 2e 2e 3f 0d 01 ae 04  0d 01 b8 10 20 20 f2 5f  |...?........  ._|
00000460  4d 75 73 69 63 41 53 4d  0d 01 c2 3e 20 20 41 25  |MusicASM...>  A%|
00000470  3d 63 6f 64 65 3a 42 25  3d 54 72 61 63 6b 2d 31  |=code:B%=Track-1|
00000480  3a d6 20 54 72 61 63 6b  20 20 20 20 20 20 20 20  |:. Track        |
00000490  20 20 20 20 20 20 20 20  20 20 3a f4 20 49 6e 69  |          :. Ini|
000004a0  74 73 74 6f 72 65 0d 01  cc 3f 20 20 41 25 3d 75  |tstore...?  A%=u|
000004b0  66 69 6e 3a 42 25 3d 4c  25 2d 31 20 20 20 3a d6  |fin:B%=L%-1   :.|
000004c0  20 54 72 61 63 6b 20 20  20 20 20 20 20 20 20 20  | Track          |
000004d0  20 20 20 20 20 20 20 20  3a f4 20 72 65 61 6c 6c  |        :. reall|
000004e0  79 20 41 4c 4c 0d 01 d6  07 20 20 e1 0d 01 e0 05  |y ALL....  .....|
000004f0  cc 0d 01 ea 10 20 20 f2  5f 4d 75 73 69 63 41 53  |.....  ._MusicAS|
00000500  4d 0d 01 f4 05 cd 0d 01  fe 04 0d 02 08 1e f4 20  |M.............. |
00000510  2a 2a 2a 20 4c 4f 41 44  20 49 4e 53 54 52 55 4d  |*** LOAD INSTRUM|
00000520  45 4e 54 53 20 2a 2a 2a  0d 02 12 04 0d 02 1c 16  |ENTS ***........|
00000530  f1 22 43 68 61 6e 6e 65  6c 73 3a 20 22 3b 56 6f  |."Channels: ";Vo|
00000540  63 73 0d 02 26 13 e7 20  62 34 3d 30 20 80 20 62  |cs..&.. b4=0 . b|
00000550  35 3e 30 20 8c 0d 02 30  22 20 20 ff 20 22 50 61  |5>0 ...0"  . "Pa|
00000560  63 6b 4c 6f 61 64 20 22  2b 61 24 2b 22 20 22 2b  |ckLoad "+a$+" "+|
00000570  c3 7e 54 72 61 63 6b 0d  02 3a 05 cc 0d 02 44 1e  |.~Track..:....D.|
00000580  20 20 ff 20 22 4c 6f 61  64 20 22 2b 61 24 2b 22  |  . "Load "+a$+"|
00000590  20 22 2b c3 7e 54 72 61  63 6b 0d 02 4e 05 cd 0d  | "+.~Track..N...|
000005a0  02 58 04 0d 02 62 44 e3  20 69 25 3d 30 20 b8 20  |.X...bD. i%=0 . |
000005b0  39 2a 31 32 2d 31 20 20  20 20 20 20 20 20 20 20  |9*12-1          |
000005c0  3a f4 20 46 72 6f 6d 20  69 6e 74 65 72 6e 61 74  |:. From internat|
000005d0  2e 20 4f 63 74 61 76 65  20 2d 33 20 74 6f 20 4f  |. Octave -3 to O|
000005e0  63 74 61 76 65 20 35 0d  02 6c 4a 6e 25 3d 69 25  |ctave 5..lJn%=i%|
000005f0  20 2b 34 2a 31 32 20 20  20 20 20 20 20 20 20 20  | +4*12          |
00000600  20 20 20 20 20 20 20 3a  f4 20 43 6f 72 72 65 63  |       :. Correc|
00000610  74 20 69 74 2c 20 61 73  20 27 53 74 65 69 6e 77  |t it, as 'Steinw|
00000620  61 79 27 20 2b 30 20 3d  20 4d 69 64 64 6c 65 20  |ay' +0 = Middle |
00000630  43 0d 02 76 34 66 25 3d  34 34 30 2a 28 32 5e 28  |C..v4f%=440*(2^(|
00000640  28 6e 25 2d 34 36 29 2f  31 32 29 29 20 20 20 20  |(n%-46)/12))    |
00000650  20 3a f4 20 46 72 65 71  75 65 6e 63 79 20 66 6f  | :. Frequency fo|
00000660  72 6d 75 6c 61 0d 02 80  29 46 74 61 62 6c 65 21  |rmula...)Ftable!|
00000670  28 69 25 2a 34 29 3d 28  66 25 2f 28 31 30 30 30  |(i%*4)=(f%/(1000|
00000680  30 30 30 2f 75 73 29 29  2a 36 35 35 33 36 0d 02  |000/us))*65536..|
00000690  8a 08 ed 20 69 25 0d 02  94 04 0d 02 9e 16 61 24  |... i%........a$|
000006a0  3d c0 24 28 54 72 61 63  6b 2b 31 29 2c 31 35 29  |=.$(Track+1),15)|
000006b0  0d 02 a8 12 f1 27 22 4e  41 4d 45 3a 20 22 3b 61  |.....'"NAME: ";a|
000006c0  24 3b 0d 02 b2 21 c8 95  20 c2 61 24 2c 31 29 3d  |$;...!.. .a$,1)=|
000006d0  22 20 22 3a 61 24 3d c0  61 24 2c a9 61 24 2d 31  |" ":a$=.a$,.a$-1|
000006e0  29 3a ce 0d 02 bc 1c 24  68 65 6c 70 73 3d 61 24  |):.....$helps=a$|
000006f0  3a 68 65 6c 70 73 3f 28  a9 61 24 29 3d 33 31 0d  |:helps?(.a$)=31.|
00000700  02 c6 3b f1 20 8a 34 36  29 3b 22 53 65 71 75 65  |..;. .46);"Seque|
00000710  6e 63 69 65 73 3a 20 22  3b 54 72 61 63 6b 3f 32  |ncies: ";Track?2|
00000720  32 3b 22 20 20 50 61 74  74 65 72 6e 73 3a 20 22  |2;"  Patterns: "|
00000730  3b 54 72 61 63 6b 3f 32  33 27 0d 02 d0 04 0d 02  |;Track?23'......|
00000740  da 49 70 6f 69 6e 74 65  72 3d 54 72 61 63 6b 21  |.Ipointer=Track!|
00000750  33 32 20 20 3a f4 20 2b  54 72 61 63 6b 20 20 20  |32  :. +Track   |
00000760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000770  20 3a 52 45 4d 20 53 61  6d 70 6c 65 44 61 74 61  | :REM SampleData|
00000780  20 4f 66 66 73 65 74 0d  02 e4 15 e3 20 69 25 3d  | Offset..... i%=|
00000790  31 20 b8 20 54 72 61 63  6b 3f 32 31 0d 02 ee 1e  |1 . Track?21....|
000007a0  20 20 54 72 61 63 6b 21  28 69 25 2a 33 32 2b 20  |  Track!(i%*32+ |
000007b0  30 29 3d 70 6f 69 6e 74  65 72 0d 02 f8 1a 20 20  |0)=pointer....  |
000007c0  6c 65 6e 3d 54 72 61 63  6b 21 28 69 25 2a 33 32  |len=Track!(i%*32|
000007d0  2b 20 34 29 0d 03 02 1a  20 20 76 6f 6c 3d 54 72  |+ 4)....  vol=Tr|
000007e0  61 63 6b 21 28 69 25 2a  33 32 2b 20 38 29 0d 03  |ack!(i%*32+ 8)..|
000007f0  0c 1a 20 20 72 61 74 3d  54 72 61 63 6b 21 28 69  |..  rat=Track!(i|
00000800  25 2a 33 32 2b 31 32 29  0d 03 16 1a 20 20 72 65  |%*32+12)....  re|
00000810  6e 3d 54 72 61 63 6b 21  28 69 25 2a 33 32 2b 31  |n=Track!(i%*32+1|
00000820  36 29 0d 03 20 1b 20 20  6e 61 24 3d 24 28 54 72  |6).. .  na$=$(Tr|
00000830  61 63 6b 2b 69 25 2a 33  32 2b 32 30 29 0d 03 2a  |ack+i%*32+20)..*|
00000840  30 20 20 f1 20 bd 28 39  36 2b 69 25 29 3b 22 20  |0  . .(96+i%);" |
00000850  3a 20 22 3b 6e 61 24 3b  8a 31 38 29 3b 76 6f 6c  |: ";na$;.18);vol|
00000860  2c 72 61 74 2c 72 65 6e  2c 6c 65 6e 3b 0d 03 34  |,rat,ren,len;..4|
00000870  5b 20 20 e3 20 6a 25 3d  31 20 b8 20 74 6f 70 25  |[  . j%=1 . top%|
00000880  3a e7 20 6e 61 24 3c 3e  6e 61 6d 24 28 6a 25 29  |:. na$<>nam$(j%)|
00000890  20 8c 20 ed 3a e8 27 22  20 2d 3e 20 22 6e 61 24  | . .:.'" -> "na$|
000008a0  3a 24 28 54 72 61 63 6b  2b 69 25 2a 33 32 2b 32  |:$(Track+i%*32+2|
000008b0  30 29 3d 6e 61 24 3a f1  20 c4 33 30 2c bd 38 29  |0)=na$:. .30,.8)|
000008c0  3b 3a e5 20 8d 54 74 43  0d 03 3e 1a 20 20 f1 20  |;:. .TtC..>.  . |
000008d0  22 20 28 22 3b 62 79 74  25 28 6a 25 29 3b 22 29  |" (";byt%(j%);")|
000008e0  22 3b 0d 03 48 3e 20 20  e7 20 6c 65 6e 3e 62 79  |";..H>  . len>by|
000008f0  74 25 28 6a 25 29 20 8c  20 6c 65 6e 3d 62 79 74  |t%(j%) . len=byt|
00000900  25 28 6a 25 29 3a 54 72  61 63 6b 21 28 69 25 2a  |%(j%):Track!(i%*|
00000910  33 32 2b 34 29 3d 6c 65  6e 3a f1 20 22 2a 22 3b  |32+4)=len:. "*";|
00000920  0d 03 52 1e 20 20 f1 20  2c 28 97 6c 6f 63 24 28  |..R.  . ,(.loc$(|
00000930  6a 25 29 2d 36 35 29 20  81 20 32 20 2b 31 0d 03  |j%)-65) . 2 +1..|
00000940  5c 25 20 20 73 6f 72 74  24 28 69 25 29 3d 6c 6f  |\%  sort$(i%)=lo|
00000950  63 24 28 6a 25 29 3a 73  6f 72 74 25 28 69 25 29  |c$(j%):sort%(i%)|
00000960  3d 69 25 0d 03 66 16 20  20 70 6f 69 6e 74 65 72  |=i%..f.  pointer|
00000970  2b 3d 6c 65 6e 2b 67 61  70 0d 03 70 08 ed 20 69  |+=len+gap..p.. i|
00000980  25 0d 03 7a 05 f1 0d 03  84 04 0d 03 8e 05 f5 0d  |%..z............|
00000990  03 98 0d 20 20 66 6c 61  67 25 3d 30 0d 03 a2 19  |...  flag%=0....|
000009a0  20 20 e3 20 69 25 3d 31  20 b8 20 54 72 61 63 6b  |  . i%=1 . Track|
000009b0  3f 32 31 2d 31 0d 03 ac  5b 20 20 20 20 e7 20 73  |?21-1...[    . s|
000009c0  6f 72 74 24 28 69 25 29  3e 73 6f 72 74 24 28 69  |ort$(i%)>sort$(i|
000009d0  25 2b 31 29 20 8c 20 c8  94 20 73 6f 72 74 24 28  |%+1) . .. sort$(|
000009e0  69 25 29 2c 73 6f 72 74  24 28 69 25 2b 31 29 3a  |i%),sort$(i%+1):|
000009f0  c8 94 20 73 6f 72 74 25  28 69 25 29 2c 73 6f 72  |.. sort%(i%),sor|
00000a00  74 25 28 69 25 2b 31 29  3a 66 6c 61 67 25 3d 31  |t%(i%+1):flag%=1|
00000a10  0d 03 b6 0a 20 20 ed 20  69 25 0d 03 c0 0d fd 20  |....  . i%..... |
00000a20  66 6c 61 67 25 3d 30 0d  03 ca 04 0d 03 d4 15 e3  |flag%=0.........|
00000a30  20 69 25 3d 31 20 b8 20  54 72 61 63 6b 3f 32 31  | i%=1 . Track?21|
00000a40  0d 03 de 11 20 20 73 3d  73 6f 72 74 25 28 69 25  |....  s=sort%(i%|
00000a50  29 0d 03 e8 44 20 20 6e  61 24 3d 24 28 54 72 61  |)...D  na$=$(Tra|
00000a60  63 6b 2b 73 2a 33 32 2b  32 30 29 3a 61 64 72 3d  |ck+s*32+20):adr=|
00000a70  54 72 61 63 6b 2b 54 72  61 63 6b 21 28 73 2a 33  |Track+Track!(s*3|
00000a80  32 29 3a 6c 65 6e 3d 54  72 61 63 6b 21 28 73 2a  |2):len=Track!(s*|
00000a90  33 32 2b 34 29 0d 03 f2  22 20 20 66 75 24 3d 22  |32+4)..."  fu$="|
00000aa0  49 6e 73 74 22 2b 73 6f  72 74 24 28 69 25 29 2b  |Inst"+sort$(i%)+|
00000ab0  22 2e 22 2b 6e 61 24 0d  03 fc 0d 20 20 66 3d 8e  |"."+na$....  f=.|
00000ac0  20 66 75 24 0d 04 06 0b  20 20 e7 20 66 20 8c 0d  | fu$....  . f ..|
00000ad0  04 10 13 20 20 20 20 f1  20 6e 61 24 3b 22 2c 20  |...    . na$;", |
00000ae0  22 3b 0d 04 1a 1d 20 20  20 20 24 28 61 64 72 2b  |";....    $(adr+|
00000af0  6c 65 6e 29 3d c4 67 61  70 2d 31 2c bd 30 29 0d  |len)=.gap-1,.0).|
00000b00  04 24 24 20 20 20 20 c8  99 20 22 4f 53 5f 47 42  |.$$    .. "OS_GB|
00000b10  50 42 22 2c 34 2c 66 2c  61 64 72 2c 6c 65 6e 3a  |PB",4,f,adr,len:|
00000b20  d9 23 66 0d 04 2e 07 20  20 cc 0d 04 38 23 20 20  |.#f....  ...8#  |
00000b30  20 20 64 69 73 63 3d 28  97 73 6f 72 74 24 28 69  |  disc=(.sort$(i|
00000b40  25 29 2d 36 35 29 20 81  20 32 20 2b 31 0d 04 42  |%)-65) . 2 +1..B|
00000b50  33 20 20 20 20 f1 27 bd  37 3b 22 50 4c 45 41 53  |3    .'.7;"PLEAS|
00000b60  45 20 49 4e 53 45 52 54  20 53 41 4d 50 4c 45 20  |E INSERT SAMPLE |
00000b70  44 49 53 43 20 22 3b 64  69 73 63 3a 61 24 3d be  |DISC ";disc:a$=.|
00000b80  0d 04 4c 0e 20 20 20 20  e5 20 8d 64 7c 43 0d 04  |..L.    . .d|C..|
00000b90  56 07 20 20 cd 0d 04 60  08 ed 20 69 25 0d 04 6a  |V.  ...`.. i%..j|
00000ba0  05 e1 0d 04 74 04 0d 04  7e 10 dd 20 f2 5f 4d 75  |....t...~.. ._Mu|
00000bb0  73 69 63 41 53 4d 0d 04  88 0a 67 61 70 3d 31 36  |sicASM....gap=16|
00000bc0  0d 04 92 0a 75 73 20 3d  34 38 0d 04 9c 0a 5b 4f  |....us =48....[O|
00000bd0  50 54 20 70 0d 04 a6 04  0d 04 b0 20 3b 2d 2d 2d  |PT p....... ;---|
00000be0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000bf0  2d 2d 2d 2d 2d 2d 2d 2d  0d 04 ba 1c 3b 20 20 43  |--------....;  C|
00000c00  4f 43 4f 4e 49 5a 45 52  20 83 55 4c 45 20 50 4c  |OCONIZER .ULE PL|
00000c10  41 59 45 52 0d 04 c4 20  3b 2d 2d 2d 2d 2d 2d 2d  |AYER... ;-------|
00000c20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000c30  2d 2d 2d 2d 0d 04 ce 04  0d 04 d8 24 20 64 63 64  |----.......$ dcd|
00000c40  20 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 0              |
00000c50  20 3b 53 74 61 72 74 20  63 6f 64 65 0d 04 e2 2d  | ;Start code...-|
00000c60  20 64 63 64 20 69 6e 69  74 2d 63 6f 64 65 20 20  | dcd init-code  |
00000c70  20 20 20 20 20 3b 49 6e  69 74 69 61 6c 69 73 61  |     ;Initialisa|
00000c80  74 69 6f 6e 20 63 6f 64  65 0d 04 ec 2b 20 64 63  |tion code...+ dc|
00000c90  64 20 66 69 6e 69 2d 63  6f 64 65 20 20 20 20 20  |d fini-code     |
00000ca0  20 20 3b 46 69 6e 61 6c  69 73 61 74 69 6f 6e 20  |  ;Finalisation |
00000cb0  63 6f 64 65 0d 04 f6 2e  20 64 63 64 20 30 20 20  |code.... dcd 0  |
00000cc0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 53 65  |             ;Se|
00000cd0  72 76 69 63 65 20 43 61  6c 6c 20 48 61 6e 64 6c  |rvice Call Handl|
00000ce0  65 72 0d 05 00 26 20 64  63 64 20 74 69 74 6c 65  |er...& dcd title|
00000cf0  2d 63 6f 64 65 20 20 20  20 20 20 3b 54 69 74 6c  |-code      ;Titl|
00000d00  65 20 53 74 72 69 6e 67  0d 05 0a 25 20 64 63 64  |e String...% dcd|
00000d10  20 68 65 6c 70 73 2d 63  6f 64 65 20 20 20 20 20  | helps-code     |
00000d20  20 3b 48 65 6c 70 20 53  74 72 69 6e 67 0d 05 14  | ;Help String...|
00000d30  38 20 64 63 64 20 30 20  20 20 20 20 20 20 20 20  |8 dcd 0         |
00000d40  20 20 20 20 20 20 3b 48  65 6c 70 20 61 6e 64 20  |      ;Help and |
00000d50  43 6f 6d 6d 61 6e 64 20  6b 65 79 77 6f 72 64 20  |Command keyword |
00000d60  74 61 62 6c 65 0d 05 1e  04 0d 05 28 27 2e 74 69  |table......('.ti|
00000d70  74 6c 65 20 64 63 62 20  22 43 6f 63 6f 6e 69 7a  |tle dcb "Coconiz|
00000d80  65 72 53 6f 6e 67 22 2b  bd 30 3a 61 6c 69 67 6e  |erSong"+.0:align|
00000d90  0d 05 32 1d 2e 68 65 6c  70 73 20 64 63 62 20 6d  |..2..helps dcb m|
00000da0  65 73 73 24 2b bd 30 3a  61 6c 69 67 6e 0d 05 3c  |ess$+.0:align..<|
00000db0  04 0d 05 46 09 2e 69 6e  69 74 0d 05 50 3b 20 73  |...F..init..P; s|
00000dc0  74 6d 66 64 20 72 31 33  21 2c 7b 72 37 2d 72 31  |tmfd r13!,{r7-r1|
00000dd0  31 2c 72 31 34 7d 20 20  20 20 3b 57 65 20 61 72  |1,r14}    ;We ar|
00000de0  65 20 63 61 6c 6c 65 64  20 69 6e 20 53 56 43 5f  |e called in SVC_|
00000df0  6d 6f 64 65 21 0d 05 5a  0f 20 62 6c 20 20 20 20  |mode!..Z. bl    |
00000e00  76 5f 6f 6e 0d 05 64 1c  20 6c 64 6d 66 64 20 72  |v_on..d. ldmfd r|
00000e10  31 33 21 2c 7b 72 37 2d  72 31 31 2c 70 63 7d 5e  |13!,{r7-r11,pc}^|
00000e20  0d 05 6e 04 0d 05 78 09  2e 66 69 6e 69 0d 05 82  |..n...x..fini...|
00000e30  1c 20 73 74 6d 66 64 20  72 31 33 21 2c 7b 72 37  |. stmfd r13!,{r7|
00000e40  2d 72 31 31 2c 72 31 34  7d 0d 05 8c 10 20 62 6c  |-r11,r14}.... bl|
00000e50  20 20 20 20 76 5f 6f 66  66 0d 05 96 42 20 62 6c  |    v_off...B bl|
00000e60  20 20 20 20 76 72 65 6c  61 74 69 76 20 20 20 20  |    vrelativ    |
00000e70  20 20 20 20 20 20 20 20  20 3b 41 6e 64 20 62 61  |         ;And ba|
00000e80  63 6b 20 74 6f 20 6f 72  69 67 69 6e 20 72 65 6c  |ck to origin rel|
00000e90  61 74 69 76 65 20 73 74  61 74 65 0d 05 a0 1c 20  |ative state.... |
00000ea0  6c 64 6d 66 64 20 72 31  33 21 2c 7b 72 37 2d 72  |ldmfd r13!,{r7-r|
00000eb0  31 31 2c 70 63 7d 5e 0d  05 aa 04 0d 05 b4 28 3b  |11,pc}^.......(;|
00000ec0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000ee0  2d 2d 2d 0d 05 be 05 3b  0d 05 c8 27 3b 20 54 48  |---....;...'; TH|
00000ef0  45 20 43 4f 43 4f 4e 49  5a 45 52 20 50 4c 41 59  |E COCONIZER PLAY|
00000f00  45 52 20 52 4f 55 54 49  4e 45 20 76 31 2e 32 0d  |ER ROUTINE v1.2.|
00000f10  05 d2 05 3b 0d 05 dc 25  3b 20 20 20 4e 65 65 64  |...;...%;   Need|
00000f20  73 20 32 30 25 20 6f 66  20 74 68 65 20 41 52 4d  |s 20% of the ARM|
00000f30  2d 49 49 20 73 70 65 65  64 0d 05 e6 05 3b 0d 05  |-II speed....;..|
00000f40  f0 1d 3b 20 20 20 20 20  20 20 20 20 28 63 29 20  |..;         (c) |
00000f50  4d 61 69 20 31 39 39 30  20 62 79 0d 05 fa 24 3b  |Mai 1990 by...$;|
00000f60  20 20 20 20 45 64 75 61  72 64 20 50 66 61 72 72  |    Eduard Pfarr|
00000f70  20 26 20 54 68 6f 6d 61  73 20 41 6c 62 65 72 0d  | & Thomas Alber.|
00000f80  06 04 1c 3b 20 20 20 20  20 20 20 20 20 20 20 6f  |...;           o|
00000f90  66 20 50 6c 61 79 66 69  65 6c 64 0d 06 0e 05 3b  |f Playfield....;|
00000fa0  0d 06 18 25 3b 20 20 20  4c 61 74 65 73 74 20 72  |...%;   Latest r|
00000fb0  65 76 69 73 69 6f 6e 20  2d 20 31 30 20 46 65 62  |evision - 10 Feb|
00000fc0  20 31 39 39 31 0d 06 22  05 3b 0d 06 2c 28 3b 2d  | 1991..".;..,(;-|
00000fd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000ff0  2d 2d 0d 06 36 04 0d 06  40 09 2e 76 5f 6f 6e 0d  |--..6...@..v_on.|
00001000  06 4a 15 20 73 74 6d 66  64 20 72 31 33 21 2c 7b  |.J. stmfd r13!,{|
00001010  72 31 34 7d 0d 06 54 25  20 6d 6f 76 20 20 20 72  |r14}..T% mov   r|
00001020  30 2c 23 32 20 20 20 20  20 20 20 20 20 20 20 20  |0,#2            |
00001030  20 20 20 20 3b c8 a0 20  32 0d 06 5e 45 20 6d 6f  |    ;.. 2..^E mo|
00001040  76 20 20 20 72 31 2c 23  32 30 38 20 20 20 20 20  |v   r1,#208     |
00001050  20 20 20 20 20 20 20 20  20 3b 42 75 66 66 65 72  |         ;Buffer|
00001060  4c 65 6e 20 6f 66 20 ee  45 20 63 68 61 6e 6e 65  |Len of .E channe|
00001070  6c 2c 20 74 6f 74 61 6c  20 2a 56 6f 63 73 0d 06  |l, total *Vocs..|
00001080  68 2e 20 6d 6f 76 20 20  20 72 32 2c 23 75 73 20  |h. mov   r2,#us |
00001090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 53  |              ;S|
000010a0  61 6d 70 6c 65 20 50 65  72 69 6f 64 0d 06 72 37  |ample Period..r7|
000010b0  20 6d 6f 76 20 20 20 72  33 2c 23 30 20 20 20 20  | mov   r3,#0    |
000010c0  20 20 20 20 20 20 20 20  20 20 20 20 3b 44 65 66  |            ;Def|
000010d0  61 75 6c 74 20 43 68 61  6e 6e 65 6c 48 61 6e 64  |ault ChannelHand|
000010e0  6c 65 72 0d 06 7c 31 20  6d 6f 76 20 20 20 72 34  |ler..|1 mov   r4|
000010f0  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00001100  20 20 20 3b 44 65 66 61  75 6c 74 20 53 68 65 64  |   ;Default Shed|
00001110  75 6c 65 72 0d 06 86 1c  20 73 77 69 20 20 20 22  |uler.... swi   "|
00001120  53 6f 75 6e 64 5f 43 6f  6e 66 69 67 75 72 65 22  |Sound_Configure"|
00001130  0d 06 90 48 20 6d 6f 76  20 20 20 72 30 2c 23 56  |...H mov   r0,#V|
00001140  6f 63 73 20 20 20 20 20  20 20 20 20 20 20 20 20  |ocs             |
00001150  3b c8 a0 20 38 20 77 69  74 68 20 70 61 72 61 6d  |;.. 8 with param|
00001160  73 20 64 6f 65 73 6e 27  74 20 77 6f 72 6b 20 64  |s doesn't work d|
00001170  69 72 65 63 74 6c 79 21  0d 06 9a 49 20 6d 6f 76  |irectly!...I mov|
00001180  20 20 20 72 31 2c 23 30  20 20 20 20 20 20 20 20  |   r1,#0        |
00001190  20 20 20 20 20 20 20 20  3b 42 65 63 61 75 73 65  |        ;Because|
000011a0  20 74 68 65 6e 20 73 61  6d 70 6c 65 20 72 61 74  | then sample rat|
000011b0  65 20 69 73 20 73 65 74  20 66 61 6c 73 65 2e 2e  |e is set false..|
000011c0  2e 0d 06 a4 10 20 6d 6f  76 20 20 20 72 32 2c 23  |..... mov   r2,#|
000011d0  30 0d 06 ae 10 20 6d 6f  76 20 20 20 72 33 2c 23  |0.... mov   r3,#|
000011e0  30 0d 06 b8 10 20 6d 6f  76 20 20 20 72 34 2c 23  |0.... mov   r4,#|
000011f0  30 0d 06 c2 1c 20 73 77  69 20 20 20 22 53 6f 75  |0.... swi   "Sou|
00001200  6e 64 5f 43 6f 6e 66 69  67 75 72 65 22 0d 06 cc  |nd_Configure"...|
00001210  04 0d 06 d6 17 20 61 64  72 20 20 20 72 30 2c 56  |..... adr   r0,V|
00001220  6f 69 63 65 42 61 73 65  0d 06 e0 4b 20 6d 6f 76  |oiceBase...K mov|
00001230  20 20 20 72 31 2c 23 30  20 20 20 20 20 20 20 20  |   r1,#0        |
00001240  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 49 6e  |             ;In|
00001250  73 74 61 6c 6c 20 6f 75  72 20 56 6f 69 63 65 20  |stall our Voice |
00001260  69 6e 74 6f 20 6e 65 78  74 20 66 72 65 65 20 53  |into next free S|
00001270  6c 6f 74 0d 06 ea 1f 20  73 77 69 20 20 20 22 53  |lot.... swi   "S|
00001280  6f 75 6e 64 5f 49 6e 73  74 61 6c 6c 56 6f 69 63  |ound_InstallVoic|
00001290  65 22 0d 06 f4 35 20 73  74 72 20 20 20 72 31 2c  |e"...5 str   r1,|
000012a0  56 73 6c 6f 74 20 20 20  20 20 20 20 20 20 20 20  |Vslot           |
000012b0  20 20 20 20 20 20 20 3b  73 74 6f 72 65 20 75 73  |       ;store us|
000012c0  65 64 20 73 6c 6f 74 0d  06 fe 23 20 61 64 72 20  |ed slot...# adr |
000012d0  20 20 72 32 2c 56 73 74  65 72 65 6f 73 2d 34 2a  |  r2,Vstereos-4*|
000012e0  34 2a 28 56 6f 63 73 3d  38 29 0d 07 08 04 0d 07  |4*(Vocs=8)......|
000012f0  12 10 20 6d 6f 76 20 20  20 72 30 2c 23 31 0d 07  |.. mov   r0,#1..|
00001300  1c 0b 2e 76 69 6d 61 67  65 0d 07 26 15 20 6c 64  |...vimage..&. ld|
00001310  72 20 20 20 72 31 2c 5b  72 32 5d 2c 23 34 0d 07  |r   r1,[r2],#4..|
00001320  30 2f 20 73 77 69 20 20  20 22 53 6f 75 6e 64 5f  |0/ swi   "Sound_|
00001330  53 74 65 72 65 6f 22 20  20 20 20 20 20 20 20 20  |Stereo"         |
00001340  20 20 20 3b 2a c8 a2 20  72 30 20 72 31 0d 07 3a  |   ;*.. r0 r1..:|
00001350  13 20 61 64 64 20 20 20  72 30 2c 72 30 2c 23 31  |. add   r0,r0,#1|
00001360  0d 07 44 13 20 63 6d 70  20 20 20 72 30 2c 23 56  |..D. cmp   r0,#V|
00001370  6f 63 73 0d 07 4e 11 20  62 4c 73 20 20 20 76 69  |ocs..N. bLs   vi|
00001380  6d 61 67 65 0d 07 58 04  0d 07 62 13 20 6d 6f 76  |mage..X...b. mov|
00001390  20 20 20 72 30 2c 23 56  6f 63 73 0d 07 6c 09 2e  |   r0,#Vocs..l..|
000013a0  76 73 65 74 0d 07 76 13  20 61 64 72 20 20 20 72  |vset..v. adr   r|
000013b0  31 2c 56 6e 61 6d 65 0d  07 80 3b 20 73 77 69 20  |1,Vname...; swi |
000013c0  20 20 22 53 6f 75 6e 64  5f 41 74 74 61 63 68 4e  |  "Sound_AttachN|
000013d0  61 6d 65 64 56 6f 69 63  65 22 20 20 3b 2a 43 48  |amedVoice"  ;*CH|
000013e0  41 4e 4e 45 4c 56 4f 49  43 45 20 72 30 20 22 72  |ANNELVOICE r0 "r|
000013f0  31 22 0d 07 8a 13 20 6d  6f 76 20 20 20 72 31 2c  |1".... mov   r1,|
00001400  23 26 31 37 30 0d 07 94  3b 20 6d 6f 76 20 20 20  |#&170...; mov   |
00001410  72 32 2c 23 35 30 20 20  20 20 20 20 20 20 20 20  |r2,#50          |
00001420  20 20 20 20 20 3b 41 63  74 69 76 61 74 65 20 61  |     ;Activate a|
00001430  6c 6c 20 63 68 61 6e 6e  65 6c 73 20 6f 6e 63 65  |ll channels once|
00001440  0d 07 9e 12 20 6d 6f 76  20 20 20 72 33 2c 23 32  |.... mov   r3,#2|
00001450  35 35 0d 07 a8 2f 20 73  77 69 20 20 20 22 53 6f  |55.../ swi   "So|
00001460  75 6e 64 5f 43 6f 6e 74  72 6f 6c 22 20 20 20 20  |und_Control"    |
00001470  20 20 3b 2a d4 20 72 30  20 72 31 20 72 32 20 72  |  ;*. r0 r1 r2 r|
00001480  33 0d 07 b2 13 20 73 75  62 53 20 20 72 30 2c 72  |3.... subS  r0,r|
00001490  30 2c 23 31 0d 07 bc 0f  20 62 4e 65 20 20 20 76  |0,#1.... bNe   v|
000014a0  73 65 74 0d 07 c6 04 0d  07 d0 13 20 62 6c 20 20  |set........ bl  |
000014b0  20 20 76 61 62 73 6f 6c  75 74 0d 07 da 12 20 62  |  vabsolut.... b|
000014c0  6c 20 20 20 20 76 5f 72  65 73 65 74 0d 07 e4 3c  |l    v_reset...<|
000014d0  20 6d 6f 76 20 20 20 72  30 2c 23 31 36 20 20 20  | mov   r0,#16   |
000014e0  20 20 20 20 20 20 20 20  20 20 20 20 3b 43 6c 61  |            ;Cla|
000014f0  69 6d 20 45 56 45 4e 54  20 56 65 63 74 6f 72 20  |im EVENT Vector |
00001500  28 4e 72 2e 20 31 36 29  0d 07 ee 14 20 a4 61 64  |(Nr. 16).... .ad|
00001510  72 20 28 31 2c 76 69 6e  74 65 72 29 0d 07 f8 3b  |r (1,vinter)...;|
00001520  20 61 64 72 20 20 20 72  32 2c 48 65 61 64 20 20  | adr   r2,Head  |
00001530  20 20 20 20 20 20 20 20  20 20 20 20 3b 45 6e 74  |            ;Ent|
00001540  72 79 20 57 6f 72 6b 73  70 61 63 65 50 6f 69 6e  |ry WorkspacePoin|
00001550  74 65 72 20 72 31 32 0d  08 02 15 20 73 77 69 20  |ter r12.... swi |
00001560  20 20 22 4f 53 5f 43 6c  61 69 6d 22 0d 08 0c 34  |  "OS_Claim"...4|
00001570  20 6d 6f 76 20 20 20 72  30 2c 23 31 34 20 20 20  | mov   r0,#14   |
00001580  20 20 20 20 20 20 20 20  20 20 20 20 3b 45 6e 61  |            ;Ena|
00001590  62 6c 65 20 45 76 65 6e  74 20 4e 72 2e 20 72 31  |ble Event Nr. r1|
000015a0  0d 08 16 32 20 6d 6f 76  20 20 20 72 31 2c 23 34  |...2 mov   r1,#4|
000015b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000015c0  3b 28 34 20 3d 20 56 53  79 6e 63 20 45 76 65 6e  |;(4 = VSync Even|
000015d0  74 29 0d 08 20 14 20 73  77 69 20 20 20 22 4f 53  |t).. . swi   "OS|
000015e0  5f 42 79 74 65 22 0d 08  2a 04 0d 08 34 31 20 6d  |_Byte"..*...41 m|
000015f0  6f 76 20 20 20 72 30 2c  23 56 6f 63 73 20 20 20  |ov   r0,#Vocs   |
00001600  20 20 20 20 20 20 20 20  20 20 3b 41 6e 64 20 6f  |          ;And o|
00001610  6e 63 65 20 6d 6f 72 65  2e 2e 2e 0d 08 3e 10 20  |nce more.....>. |
00001620  6d 6f 76 20 20 20 72 31  2c 23 30 0d 08 48 10 20  |mov   r1,#0..H. |
00001630  6d 6f 76 20 20 20 72 32  2c 23 30 0d 08 52 10 20  |mov   r2,#0..R. |
00001640  6d 6f 76 20 20 20 72 33  2c 23 30 0d 08 5c 10 20  |mov   r3,#0..\. |
00001650  6d 6f 76 20 20 20 72 34  2c 23 30 0d 08 66 27 20  |mov   r4,#0..f' |
00001660  73 77 69 20 20 20 22 53  6f 75 6e 64 5f 43 6f 6e  |swi   "Sound_Con|
00001670  66 69 67 75 72 65 22 20  20 20 20 3b 47 72 72 72  |figure"    ;Grrr|
00001680  68 21 0d 08 70 04 0d 08  7a 34 20 6d 6f 76 20 20  |h!..p...z4 mov  |
00001690  20 72 30 2c 23 30 20 20  20 20 20 20 20 20 20 20  | r0,#0          |
000016a0  20 20 20 20 20 20 3b 52  65 61 64 20 63 75 72 72  |      ;Read curr|
000016b0  65 6e 74 20 56 6f 6c 75  6d 65 0d 08 84 19 20 73  |ent Volume.... s|
000016c0  77 69 20 20 20 22 53 6f  75 6e 64 5f 56 6f 6c 75  |wi   "Sound_Volu|
000016d0  6d 65 22 0d 08 8e 23 20  6d 6f 76 20 20 20 72 30  |me"...# mov   r0|
000016e0  2c 72 30 2c 6c 73 6c 23  31 20 20 20 20 20 20 20  |,r0,lsl#1       |
000016f0  20 20 20 3b 2a 32 0d 08  98 15 20 72 73 62 20 20  |   ;*2.... rsb  |
00001700  20 72 30 2c 72 30 2c 23  32 35 34 0d 08 a2 3d 20  | r0,r0,#254...= |
00001710  73 74 72 20 20 20 72 30  2c 56 6f 6c 75 6d 65 20  |str   r0,Volume |
00001720  20 20 20 20 20 20 20 20  20 20 20 3b 61 6e 64 20  |           ;and |
00001730  75 73 65 20 69 74 20 61  73 20 6f 76 65 72 61 6c  |use it as overal|
00001740  6c 20 56 6f 6c 75 6d 65  0d 08 ac 04 0d 08 b6 33  |l Volume.......3|
00001750  20 6d 6f 76 20 20 20 72  31 31 2c 23 33 20 20 20  | mov   r11,#3   |
00001760  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 65 73  |            ;Tes|
00001770  74 20 6d 61 78 20 33 20  74 69 6d 65 73 20 21 0d  |t max 3 times !.|
00001780  08 c0 0a 2e 76 74 65 73  74 0d 08 ca 10 20 6d 6f  |....vtest.... mo|
00001790  76 20 20 20 72 31 2c 23  30 0d 08 d4 15 20 73 74  |v   r1,#0.... st|
000017a0  72 42 20 20 72 31 2c 49  6e 74 53 79 6e 63 0d 08  |rB  r1,IntSync..|
000017b0  de 11 20 6d 6f 76 20 20  20 72 33 2c 23 32 36 0d  |.. mov   r3,#26.|
000017c0  08 e8 10 20 62 6c 20 20  20 20 76 77 61 69 74 0d  |... bl    vwait.|
000017d0  08 f2 3b 20 6c 64 72 42  20 20 72 31 2c 49 6e 74  |..; ldrB  r1,Int|
000017e0  53 79 6e 63 20 20 20 20  20 20 20 20 20 20 20 3b  |Sync           ;|
000017f0  49 73 20 74 68 65 72 65  20 61 20 4c 6f 73 65 72  |Is there a Loser|
00001800  2d 43 68 61 6e 6e 65 6c  20 3f 0d 08 fc 10 20 63  |-Channel ?.... c|
00001810  6d 70 20 20 20 72 31 2c  23 30 0d 09 06 16 20 6c  |mp   r1,#0.... l|
00001820  64 6d 45 71 46 64 20 72  31 33 21 2c 7b 70 63 7d  |dmEqFd r13!,{pc}|
00001830  0d 09 10 24 20 6d 6f 76  20 20 20 72 30 2c 23 31  |...$ mov   r0,#1|
00001840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001850  3b 4f 66 66 0d 09 1a 19  20 73 77 69 20 20 20 22  |;Off.... swi   "|
00001860  53 6f 75 6e 64 5f 45 6e  61 62 6c 65 22 0d 09 24  |Sound_Enable"..$|
00001870  12 20 6d 6f 76 20 20 20  72 33 2c 23 31 30 31 0d  |. mov   r3,#101.|
00001880  09 2e 10 20 62 6c 20 20  20 20 76 77 61 69 74 0d  |... bl    vwait.|
00001890  09 38 23 20 6d 6f 76 20  20 20 72 30 2c 23 32 20  |.8# mov   r0,#2 |
000018a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000018b0  4f 6e 0d 09 42 19 20 73  77 69 20 20 20 22 53 6f  |On..B. swi   "So|
000018c0  75 6e 64 5f 45 6e 61 62  6c 65 22 0d 09 4c 15 20  |und_Enable"..L. |
000018d0  73 75 62 53 20 20 72 31  31 2c 72 31 31 2c 23 31  |subS  r11,r11,#1|
000018e0  0d 09 56 10 20 62 4e 65  20 20 20 76 74 65 73 74  |..V. bNe   vtest|
000018f0  0d 09 60 30 20 6c 64 6d  66 64 20 72 31 33 21 2c  |..`0 ldmfd r13!,|
00001900  7b 70 63 7d 20 20 20 20  20 20 20 20 20 20 20 20  |{pc}            |
00001910  3b 57 65 6c 6c 2c 20 62  61 64 20 6c 75 63 6b 21  |;Well, bad luck!|
00001920  0d 09 6a 04 0d 09 74 0a  2e 76 77 61 69 74 0d 09  |..j...t..vwait..|
00001930  7e 12 20 6d 6f 76 20 20  20 72 31 32 2c 72 31 34  |~. mov   r12,r14|
00001940  0d 09 88 39 20 6d 6f 76  20 20 20 72 30 2c 23 31  |...9 mov   r0,#1|
00001950  39 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |9               |
00001960  3b 57 61 69 74 20 66 6f  72 20 73 6f 6d 65 20 66  |;Wait for some f|
00001970  72 61 6d 65 66 6c 69 65  73 0d 09 92 14 20 73 77  |rameflies.... sw|
00001980  69 20 20 20 22 4f 53 5f  42 79 74 65 22 0d 09 9c  |i   "OS_Byte"...|
00001990  13 20 73 75 62 53 20 20  72 33 2c 72 33 2c 23 31  |. subS  r3,r3,#1|
000019a0  0d 09 a6 12 20 62 4e 65  20 20 20 76 77 61 69 74  |.... bNe   vwait|
000019b0  2b 38 0d 09 b0 2b 20 6d  6f 76 20 20 20 70 63 2c  |+8...+ mov   pc,|
000019c0  72 31 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |r12             |
000019d0  20 20 3b 73 76 63 5f 72  31 34 2e 2e 2e 0d 09 ba  |  ;svc_r14......|
000019e0  04 0d 09 c4 14 3b 2a 2a  2a 20 94 4f 4c 55 54 45  |.....;*** .OLUTE|
000019f0  20 43 4f 44 45 0d 09 ce  04 0d 09 d8 0d 2e 76 61  | CODE.........va|
00001a00  62 73 6f 6c 75 74 0d 09  e2 14 20 a4 61 64 72 20  |bsolut.... .adr |
00001a10  28 31 30 2c 54 72 61 63  6b 29 0d 09 ec 04 0d 09  |(10,Track)......|
00001a20  f6 30 20 6c 64 72 20 20  20 72 31 2c 5b 72 31 30  |.0 ldr   r1,[r10|
00001a30  2c 23 32 34 5d 20 20 20  20 20 20 20 20 20 3b 53  |,#24]         ;S|
00001a40  65 71 75 65 6e 63 65 20  4f 66 66 73 65 74 0d 0a  |equence Offset..|
00001a50  00 14 20 61 64 64 20 20  20 72 31 2c 72 31 30 2c  |.. add   r1,r10,|
00001a60  72 31 0d 0a 0a 17 20 73  74 72 20 20 20 72 31 2c  |r1.... str   r1,|
00001a70  5b 72 31 30 2c 23 32 34  5d 0d 0a 14 2f 20 6c 64  |[r10,#24].../ ld|
00001a80  72 20 20 20 72 32 2c 5b  72 31 30 2c 23 32 38 5d  |r   r2,[r10,#28]|
00001a90  20 20 20 20 20 20 20 20  20 3b 50 61 74 74 65 72  |         ;Patter|
00001aa0  6e 20 4f 66 66 73 65 74  0d 0a 1e 14 20 61 64 64  |n Offset.... add|
00001ab0  20 20 20 72 32 2c 72 31  30 2c 72 32 0d 0a 28 17  |   r2,r10,r2..(.|
00001ac0  20 73 74 72 20 20 20 72  32 2c 5b 72 31 30 2c 23  | str   r2,[r10,#|
00001ad0  32 38 5d 0d 0a 32 04 0d  0a 3c 30 20 6c 64 72 42  |28]..2...<0 ldrB|
00001ae0  20 20 72 31 2c 5b 72 31  30 2c 23 32 31 5d 20 20  |  r1,[r10,#21]  |
00001af0  20 20 20 20 20 20 20 3b  4e 75 6d 62 65 72 20 6f  |       ;Number o|
00001b00  66 20 49 6e 73 74 73 0d  0a 46 09 2e 76 61 6c 6c  |f Insts..F..vall|
00001b10  0d 0a 50 31 20 6c 64 72  20 20 20 72 32 2c 5b 72  |..P1 ldr   r2,[r|
00001b20  31 30 2c 72 31 2c 6c 73  6c 23 35 5d 20 20 20 20  |10,r1,lsl#5]    |
00001b30  3b 49 6e 73 74 20 41 64  64 72 20 4f 66 66 73 65  |;Inst Addr Offse|
00001b40  74 0d 0a 5a 14 20 61 64  64 20 20 20 72 32 2c 72  |t..Z. add   r2,r|
00001b50  31 30 2c 72 32 0d 0a 64  26 20 73 74 72 20 20 20  |10,r2..d& str   |
00001b60  72 32 2c 5b 72 31 30 2c  72 31 2c 6c 73 6c 23 35  |r2,[r10,r1,lsl#5|
00001b70  5d 20 20 20 20 3b 2b 69  2a 33 32 0d 0a 6e 13 20  |]    ;+i*32..n. |
00001b80  73 75 62 53 20 20 72 31  2c 72 31 2c 23 31 0d 0a  |subS  r1,r1,#1..|
00001b90  78 0f 20 62 4e 65 20 20  20 76 61 6c 6c 0d 0a 82  |x. bNe   vall...|
00001ba0  11 20 6d 6f 76 20 20 20  70 63 2c 72 31 34 0d 0a  |. mov   pc,r14..|
00001bb0  8c 04 0d 0a 96 16 3b 2a  2a 2a 20 52 45 4c 41 54  |......;*** RELAT|
00001bc0  49 56 45 20 43 4f 44 45  0d 0a a0 04 0d 0a aa 0d  |IVE CODE........|
00001bd0  2e 76 72 65 6c 61 74 69  76 0d 0a b4 14 20 a4 61  |.vrelativ.... .a|
00001be0  64 72 20 28 31 30 2c 54  72 61 63 6b 29 0d 0a be  |dr (10,Track)...|
00001bf0  04 0d 0a c8 17 20 6c 64  72 20 20 20 72 31 2c 5b  |..... ldr   r1,[|
00001c00  72 31 30 2c 23 32 34 5d  0d 0a d2 14 20 73 75 62  |r10,#24].... sub|
00001c10  20 20 20 72 31 2c 72 31  2c 72 31 30 0d 0a dc 17  |   r1,r1,r10....|
00001c20  20 73 74 72 20 20 20 72  31 2c 5b 72 31 30 2c 23  | str   r1,[r10,#|
00001c30  32 34 5d 0d 0a e6 17 20  6c 64 72 20 20 20 72 32  |24].... ldr   r2|
00001c40  2c 5b 72 31 30 2c 23 32  38 5d 0d 0a f0 14 20 73  |,[r10,#28].... s|
00001c50  75 62 20 20 20 72 32 2c  72 32 2c 72 31 30 0d 0a  |ub   r2,r2,r10..|
00001c60  fa 17 20 73 74 72 20 20  20 72 32 2c 5b 72 31 30  |.. str   r2,[r10|
00001c70  2c 23 32 38 5d 0d 0b 04  04 0d 0b 0e 17 20 6c 64  |,#28]........ ld|
00001c80  72 42 20 20 72 31 2c 5b  72 31 30 2c 23 32 31 5d  |rB  r1,[r10,#21]|
00001c90  0d 0b 18 09 2e 76 61 6c  6c 0d 0b 22 1c 20 6c 64  |.....vall..". ld|
00001ca0  72 20 20 20 72 32 2c 5b  72 31 30 2c 72 31 2c 6c  |r   r2,[r10,r1,l|
00001cb0  73 6c 23 35 5d 0d 0b 2c  14 20 73 75 62 20 20 20  |sl#5]..,. sub   |
00001cc0  72 32 2c 72 32 2c 72 31  30 0d 0b 36 1c 20 73 74  |r2,r2,r10..6. st|
00001cd0  72 20 20 20 72 32 2c 5b  72 31 30 2c 72 31 2c 6c  |r   r2,[r10,r1,l|
00001ce0  73 6c 23 35 5d 0d 0b 40  13 20 73 75 62 53 20 20  |sl#5]..@. subS  |
00001cf0  72 31 2c 72 31 2c 23 31  0d 0b 4a 0f 20 62 4e 65  |r1,r1,#1..J. bNe|
00001d00  20 20 20 76 61 6c 6c 0d  0b 54 11 20 6d 6f 76 20  |   vall..T. mov |
00001d10  20 20 70 63 2c 72 31 34  0d 0b 5e 04 0d 0b 68 15  |  pc,r14..^...h.|
00001d20  3b 2a 2a 2a 20 52 45 53  54 41 52 54 20 54 55 4e  |;*** RESTART TUN|
00001d30  45 0d 0b 72 04 0d 0b 7c  0c 2e 76 5f 72 65 73 65  |E..r...|..v_rese|
00001d40  74 0d 0b 86 14 20 a4 61  64 72 20 28 31 30 2c 54  |t.... .adr (10,T|
00001d50  72 61 63 6b 29 0d 0b 90  11 20 6d 6f 76 20 20 20  |rack).... mov   |
00001d60  72 31 2c 23 36 34 0d 0b  9a 2b 20 73 74 72 20 20  |r1,#64...+ str  |
00001d70  20 72 31 2c 52 65 67 69  73 74 65 72 73 2b 30 20  | r1,Registers+0 |
00001d80  20 20 20 20 20 20 3b 50  61 74 74 20 43 6f 75 6e  |      ;Patt Coun|
00001d90  74 0d 0b a4 17 20 6c 64  72 20 20 20 72 32 2c 5b  |t.... ldr   r2,[|
00001da0  72 31 30 2c 23 32 34 5d  0d 0b ae 39 20 73 74 72  |r10,#24]...9 str|
00001db0  20 20 20 72 32 2c 52 65  67 69 73 74 65 72 73 2b  |   r2,Registers+|
00001dc0  38 20 20 20 20 20 20 20  3b 43 75 72 72 65 6e 74  |8       ;Current|
00001dd0  20 53 65 71 75 65 6e 63  65 20 50 6f 69 6e 74 65  | Sequence Pointe|
00001de0  72 0d 0b b8 12 20 6c 64  72 42 20 20 72 32 2c 5b  |r.... ldrB  r2,[|
00001df0  72 32 5d 0d 0b c2 17 20  6c 64 72 20 20 20 72 33  |r2].... ldr   r3|
00001e00  2c 5b 72 31 30 2c 23 32  38 5d 0d 0b cc 23 20 61  |,[r10,#28]...# a|
00001e10  64 64 20 20 20 72 33 2c  72 33 2c 72 32 2c 6c 73  |dd   r3,r3,r2,ls|
00001e20  6c 23 31 30 2d 28 56 6f  63 73 3d 38 29 0d 0b d6  |l#10-(Vocs=8)...|
00001e30  38 20 73 74 72 20 20 20  72 33 2c 52 65 67 69 73  |8 str   r3,Regis|
00001e40  74 65 72 73 2b 34 20 20  20 20 20 20 20 3b 43 75  |ters+4       ;Cu|
00001e50  72 72 65 6e 74 20 50 61  74 74 65 72 6e 20 50 6f  |rrent Pattern Po|
00001e60  69 6e 74 65 72 0d 0b e0  04 0d 0b ea 13 20 61 64  |inter........ ad|
00001e70  72 20 20 20 72 31 31 2c  48 65 61 64 0d 0b f4 2e  |r   r11,Head....|
00001e80  20 6d 6f 76 20 20 20 72  31 2c 23 30 3a 6d 6f 76  | mov   r1,#0:mov|
00001e90  20 72 32 2c 23 30 3a 6d  6f 76 20 72 33 2c 23 30  | r2,#0:mov r3,#0|
00001ea0  3a 6d 6f 76 20 72 34 2c  23 30 0d 0b fe 2e 20 6d  |:mov r4,#0.... m|
00001eb0  6f 76 20 20 20 72 35 2c  23 30 3a 6d 6f 76 20 72  |ov   r5,#0:mov r|
00001ec0  36 2c 23 30 3a 6d 6f 76  20 72 37 2c 23 30 3a 6d  |6,#0:mov r7,#0:m|
00001ed0  6f 76 20 72 38 2c 23 30  0d 0c 08 13 20 6d 6f 76  |ov r8,#0.... mov|
00001ee0  20 20 20 72 30 2c 23 56  6f 63 73 0d 0c 12 09 2e  |   r0,#Vocs.....|
00001ef0  76 61 6c 6c 0d 0c 1c 3b  20 73 74 6d 69 61 20 72  |vall...; stmia r|
00001f00  31 31 21 2c 7b 72 31 2d  72 38 7d 20 20 20 20 20  |11!,{r1-r8}     |
00001f10  20 20 20 20 3b 43 6c 65  61 72 20 61 6c 6c 20 63  |    ;Clear all c|
00001f20  68 61 6e 6e 65 6c 20 68  65 61 64 73 2e 2e 2e 0d  |hannel heads....|
00001f30  0c 26 13 20 73 75 62 53  20 20 72 30 2c 72 30 2c  |.&. subS  r0,r0,|
00001f40  23 31 0d 0c 30 0f 20 62  4e 65 20 20 20 76 61 6c  |#1..0. bNe   val|
00001f50  6c 0d 0c 3a 11 20 6d 6f  76 20 20 20 70 63 2c 72  |l..:. mov   pc,r|
00001f60  31 34 0d 0c 44 04 0d 0c  4e 20 3b 2a 2a 2a 20 54  |14..D...N ;*** T|
00001f70  55 52 4e 20 87 20 50 4c  41 59 45 52 20 80 20 43  |URN . PLAYER . C|
00001f80  4f 43 4f 2d c8 a1 0d 0c  58 04 0d 0c 62 0a 2e 76  |OCO-....X...b..v|
00001f90  5f 6f 66 66 0d 0c 6c 15  20 73 74 6d 66 64 20 72  |_off..l. stmfd r|
00001fa0  31 33 21 2c 7b 72 31 34  7d 0d 0c 76 35 20 6d 6f  |13!,{r14}..v5 mo|
00001fb0  76 20 20 20 72 30 2c 23  31 33 20 20 20 20 20 20  |v   r0,#13      |
00001fc0  20 20 20 20 20 20 20 20  20 3b 44 69 73 61 62 6c  |         ;Disabl|
00001fd0  65 20 45 76 65 6e 74 20  4e 72 2e 20 72 31 0d 0c  |e Event Nr. r1..|
00001fe0  80 32 20 6d 6f 76 20 20  20 72 31 2c 23 34 20 20  |.2 mov   r1,#4  |
00001ff0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 28  |              ;(|
00002000  34 20 3d 20 56 53 79 6e  63 20 45 76 65 6e 74 29  |4 = VSync Event)|
00002010  0d 0c 8a 14 20 73 77 69  20 20 20 22 4f 53 5f 42  |.... swi   "OS_B|
00002020  79 74 65 22 0d 0c 94 3b  20 6d 6f 76 20 20 20 72  |yte"...; mov   r|
00002030  30 2c 23 31 36 20 20 20  20 20 20 20 20 20 20 20  |0,#16           |
00002040  20 20 20 20 3b 46 72 65  65 20 45 56 45 4e 54 20  |    ;Free EVENT |
00002050  56 65 63 74 6f 72 20 28  4e 72 2e 20 31 36 29 0d  |Vector (Nr. 16).|
00002060  0c 9e 14 20 61 64 72 20  20 20 72 31 2c 76 69 6e  |... adr   r1,vin|
00002070  74 65 72 0d 0c a8 12 20  61 64 72 20 20 20 72 32  |ter.... adr   r2|
00002080  2c 48 65 61 64 0d 0c b2  17 20 73 77 69 20 20 20  |,Head.... swi   |
00002090  22 4f 53 5f 52 65 6c 65  61 73 65 22 0d 0c bc 04  |"OS_Release"....|
000020a0  0d 0c c6 13 20 6c 64 72  20 20 20 72 31 2c 56 73  |.... ldr   r1,Vs|
000020b0  6c 6f 74 0d 0c d0 45 20  73 77 69 20 20 20 22 53  |lot...E swi   "S|
000020c0  6f 75 6e 64 5f 52 65 6d  6f 76 65 56 6f 69 63 65  |ound_RemoveVoice|
000020d0  22 20 20 3b 4c 61 73 74  20 62 75 74 20 6e 6f 74  |"  ;Last but not|
000020e0  20 6c 65 61 73 74 2e 2e  2e 20 46 72 65 65 20 56  | least... Free V|
000020f0  6f 69 63 65 53 6c 6f 74  0d 0c da 10 20 6d 6f 76  |oiceSlot.... mov|
00002100  20 20 20 72 30 2c 23 31  0d 0c e4 10 20 6d 6f 76  |   r0,#1.... mov|
00002110  20 20 20 72 31 2c 23 31  0d 0c ee 2c 20 73 77 69  |   r1,#1..., swi|
00002120  20 20 20 22 53 6f 75 6e  64 5f 41 74 74 61 63 68  |   "Sound_Attach|
00002130  56 6f 69 63 65 22 20 20  3b 52 65 69 6e 69 74 20  |Voice"  ;Reinit |
00002140  42 65 6c 6c 0d 0c f8 14  20 6c 64 6d 66 64 20 72  |Bell.... ldmfd r|
00002150  31 33 21 2c 7b 70 63 7d  0d 0d 02 04 0d 0d 0c 0d  |13!,{pc}........|
00002160  2e 56 73 74 65 72 65 6f  73 0d 0d 16 32 20 64 63  |.Vstereos...2 dc|
00002170  64 20 2d 35 30 20 20 20  20 20 20 3b 53 74 65 72  |d -50      ;Ster|
00002180  65 6f 20 50 6f 73 69 74  69 6f 6e 73 20 66 6f 72  |eo Positions for|
00002190  20 34 20 63 68 61 6e 6e  65 6c 73 0d 0d 20 0c 20  | 4 channels.. . |
000021a0  64 63 64 20 2d 32 30 0d  0d 2a 0c 20 64 63 64 20  |dcd -20..*. dcd |
000021b0  20 32 30 0d 0d 34 0c 20  64 63 64 20 20 35 30 0d  | 20..4. dcd  50.|
000021c0  0d 3e 04 0d 0d 48 32 20  64 63 64 2d 31 32 36 20  |.>...H2 dcd-126 |
000021d0  20 20 20 20 20 3b 53 74  65 72 65 6f 20 50 6f 73  |     ;Stereo Pos|
000021e0  69 74 69 6f 6e 73 20 66  6f 72 20 38 20 63 68 61  |itions for 8 cha|
000021f0  6e 6e 65 6c 73 0d 0d 52  0c 20 64 63 64 20 2d 39  |nnels..R. dcd -9|
00002200  30 0d 0d 5c 0c 20 64 63  64 20 2d 35 34 0d 0d 66  |0..\. dcd -54..f|
00002210  0c 20 64 63 64 20 2d 31  38 0d 0d 70 0c 20 64 63  |. dcd -18..p. dc|
00002220  64 20 20 31 38 0d 0d 7a  0c 20 64 63 64 20 20 35  |d  18..z. dcd  5|
00002230  34 0d 0d 84 0c 20 64 63  64 20 20 39 30 0d 0d 8e  |4.... dcd  90...|
00002240  0c 20 64 63 64 20 31 32  36 0d 0d 98 04 0d 0d a2  |. dcd 126.......|
00002250  10 2e 56 73 6c 6f 74 20  64 63 64 20 30 0d 0d ac  |..Vslot dcd 0...|
00002260  04 0d 0d b6 48 3b 3d 3d  3d 3d 20 c8 99 54 45 4d  |....H;==== ..TEM|
00002270  20 d4 20 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  | . =============|
00002280  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000022a0  3d 3d 3d 3d 3d 3d 3d 3d  3d 0d 0d c0 04 0d 0d ca  |=========.......|
000022b0  40 3b 20 72 36 20 4e 65  67 2e 20 69 66 20 6e 65  |@; r6 Neg. if ne|
000022c0  77 20 48 61 6e 64 6c 65  72 20 20 20 20 72 31 30  |w Handler    r10|
000022d0  20 50 6f 69 6e 74 65 72  20 74 6f 20 65 6e 64 20  | Pointer to end |
000022e0  6f 66 20 44 4d 41 20 62  75 66 66 65 72 0d 0d d4  |of DMA buffer...|
000022f0  4d 3b 20 72 37 20 43 68  61 6e 6e 65 6c 20 6e 75  |M; r7 Channel nu|
00002300  6d 62 65 72 20 20 20 20  20 20 20 20 20 72 31 31  |mber         r11|
00002310  20 49 6e 63 72 65 6d 65  6e 74 20 28 69 6e 74 65  | Increment (inte|
00002320  72 6c 65 61 66 29 20 74  6f 20 75 73 65 20 77 68  |rleaf) to use wh|
00002330  65 6e 20 77 72 69 74 69  6e 67 0d 0d de 4d 3b 20  |en writing...M; |
00002340  72 38 20 53 61 6d 70 6c  65 20 70 65 72 69 6f 64  |r8 Sample period|
00002350  20 69 6e 20 75 73 20 20  20 20 72 31 32 20 50 6f  | in us    r12 Po|
00002360  69 6e 74 65 72 20 74 6f  20 28 73 74 61 72 74 20  |inter to (start |
00002370  6f 66 20 44 4d 41 20 2b  20 69 6e 74 65 72 6c 65  |of DMA + interle|
00002380  61 66 20 4f 66 73 29 0d  0d e8 4d 3b 20 72 39 20  |af Ofs)...M; r9 |
00002390  50 6f 69 6e 74 65 72 20  74 6f 20 53 43 43 42 20  |Pointer to SCCB |
000023a0  20 20 20 20 20 20 20 46  69 6c 6c 65 72 20 69 73  |       Filler is|
000023b0  20 65 6e 74 65 72 65 64  20 69 6e 20 49 52 51 20  | entered in IRQ |
000023c0  6d 6f 64 65 20 26 20 49  6e 74 73 20 65 6e 61 62  |mode & Ints enab|
000023d0  6c 65 64 21 0d 0d f2 04  0d 0d fc 0e 2e 56 6f 69  |led!.........Voi|
000023e0  63 65 42 61 73 65 0d 0e  06 3f 20 62 20 20 20 20  |ceBase...? b    |
000023f0  20 76 66 69 6c 6c 20 20  20 20 20 20 20 20 20 20  | vfill          |
00002400  20 20 20 20 20 20 3b 46  69 6c 6c 20 20 20 20 20  |      ;Fill     |
00002410  20 20 20 20 66 6f 72 20  73 6d 6f 6f 74 68 20 61  |    for smooth a|
00002420  64 6a 75 73 74 0d 0e 10  3f 20 62 20 20 20 20 20  |djust...? b     |
00002430  76 66 69 6c 6c 20 20 20  20 20 20 20 20 20 20 20  |vfill           |
00002440  20 20 20 20 20 3b 55 70  64 61 74 65 20 20 20 20  |     ;Update    |
00002450  20 20 20 66 6f 72 20 74  6f 6e 65 20 63 6f 6e 74  |   for tone cont|
00002460  69 6e 75 65 0d 0e 1a 3a  20 62 20 20 20 20 20 76  |inue...: b     v|
00002470  66 69 6c 6c 20 20 20 20  20 20 20 20 20 20 20 20  |fill            |
00002480  20 20 20 20 3b 47 61 74  65 4f 6e 20 20 20 20 20  |    ;GateOn     |
00002490  20 20 66 6f 72 20 6e 65  77 20 74 6f 6e 65 0d 0e  |  for new tone..|
000024a0  24 3f 20 6c 64 6d 66 64  20 72 31 33 21 2c 7b 70  |$? ldmfd r13!,{p|
000024b0  63 7d 20 20 20 20 20 20  20 20 20 20 20 20 3b 47  |c}            ;G|
000024c0  61 74 65 4f 66 66 20 20  20 20 20 20 66 6f 72 20  |ateOff      for |
000024d0  74 6f 6e 65 20 66 6c 75  73 68 69 6e 67 0d 0e 2e  |tone flushing...|
000024e0  48 20 6c 64 6d 66 64 20  72 31 33 21 2c 7b 70 63  |H ldmfd r13!,{pc|
000024f0  7d 20 20 20 20 20 20 20  20 20 20 20 20 3b 49 6e  |}            ;In|
00002500  73 74 61 6e 74 69 61 74  65 2c 20 20 20 41 74 74  |stantiate,   Att|
00002510  61 63 68 20 20 20 20 56  6f 69 63 65 47 65 6e 65  |ach    VoiceGene|
00002520  72 61 74 6f 72 0d 0e 38  4a 20 6c 64 6d 66 64 20  |rator..8J ldmfd |
00002530  72 31 33 21 2c 7b 70 63  7d 20 20 20 20 20 20 20  |r13!,{pc}       |
00002540  20 20 20 20 20 3b 44 65  49 6e 73 74 61 6e 74 69  |     ;DeInstanti|
00002550  61 74 65 2c 20 44 65 74  61 63 68 20 20 20 74 6f  |ate, Detach   to|
00002560  2f 66 72 6f 6d 20 61 20  63 68 61 6e 6e 65 6c 0d  |/from a channel.|
00002570  0e 42 2e 20 6c 64 6d 66  64 20 72 31 33 21 2c 7b  |.B. ldmfd r13!,{|
00002580  70 63 7d 20 20 20 20 20  20 20 20 20 20 20 20 3b  |pc}            ;|
00002590  48 65 6c 6c 6f 20 41 72  74 68 75 72 21 0d 0e 4c  |Hello Arthur!..L|
000025a0  3e 20 64 63 64 20 20 20  56 6e 61 6d 65 2d 56 6f  |> dcd   Vname-Vo|
000025b0  69 63 65 42 61 73 65 20  20 20 20 20 20 3b 4f 66  |iceBase      ;Of|
000025c0  66 73 65 74 20 66 72 6f  6d 20 56 6f 69 63 65 42  |fset from VoiceB|
000025d0  61 73 65 20 74 6f 20 4e  61 6d 65 0d 0e 56 1c 2e  |ase to Name..V..|
000025e0  56 6e 61 6d 65 20 64 63  62 20 22 43 6f 63 6f 70  |Vname dcb "Cocop|
000025f0  6c 65 78 22 2b bd 30 0d  0e 60 0a 20 61 6c 69 67  |lex"+.0..`. alig|
00002600  6e 0d 0e 6a 04 0d 0e 74  0a 2e 76 66 69 6c 6c 0d  |n..j...t..vfill.|
00002610  0e 7e 3d 20 61 64 72 20  20 20 72 38 2c 48 65 61  |.~= adr   r8,Hea|
00002620  64 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |d              ;|
00002630  57 65 20 75 73 65 20 61  6e 20 6f 77 6e 20 43 6f  |We use an own Co|
00002640  6e 74 72 6f 6c 6c 5f 42  6c 6f 63 6b 0d 0e 88 34  |ntroll_Block...4|
00002650  20 61 64 64 20 20 20 72  38 2c 72 38 2c 72 37 2c  | add   r8,r8,r7,|
00002660  6c 73 6c 23 35 20 20 20  20 20 20 20 3b 70 6f 69  |lsl#5       ;poi|
00002670  6e 74 20 74 6f 20 48 65  61 64 2b 72 37 2a 33 32  |nt to Head+r7*32|
00002680  0d 0e 92 39 20 6c 64 6d  49 61 20 72 38 2c 7b 72  |...9 ldmIa r8,{r|
00002690  31 2d 72 36 7d 20 20 20  20 20 20 20 20 20 20 20  |1-r6}           |
000026a0  3b 4c 6f 61 64 20 36 20  77 6f 72 6b 69 6e 67 20  |;Load 6 working |
000026b0  52 65 67 69 73 74 65 72  73 0d 0e 9c 14 20 6c 64  |Registers.... ld|
000026c0  72 20 20 20 72 30 2c 56  6f 6c 75 6d 65 0d 0e a6  |r   r0,Volume...|
000026d0  45 20 61 64 64 20 20 20  72 35 2c 72 35 2c 72 30  |E add   r5,r5,r0|
000026e0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 41 64  |             ;Ad|
000026f0  64 20 4f 76 65 72 61 6c  6c 5f 56 6f 6c 75 6d 65  |d Overall_Volume|
00002700  20 74 6f 20 43 68 61 6e  6e 65 6c 5f 56 6f 6c 75  | to Channel_Volu|
00002710  6d 65 0d 0e b0 10 20 6d  6f 76 20 20 20 72 30 2c  |me.... mov   r0,|
00002720  23 30 0d 0e ba 37 20 73  74 72 42 20 20 72 30 2c  |#0...7 strB  r0,|
00002730  49 6e 74 46 6c 61 67 20  20 20 20 20 20 20 20 20  |IntFlag         |
00002740  20 20 3b 43 6c 65 61 72  20 49 6e 74 65 72 72 75  |  ;Clear Interru|
00002750  70 74 65 64 5f 46 6c 61  67 0d 0e c4 04 0d 0e ce  |pted_Flag.......|
00002760  0d 2e 76 66 69 6c 6c 6f  6f 70 0d 0e d8 48 5d 3a  |..vfilloop...H]:|
00002770  e3 20 6e 3d 31 20 b8 20  67 61 70 3a 5b 4f 50 54  |. n=1 . gap:[OPT|
00002780  20 70 20 20 20 20 20 3b  46 69 6c 6c 20 6f 6e 65  | p     ;Fill one|
00002790  20 62 79 74 65 20 31 36  20 74 69 6d 65 73 2c 20  | byte 16 times, |
000027a0  66 6f 72 20 32 30 38 20  2d 3e 20 31 33 20 72 75  |for 208 -> 13 ru|
000027b0  6e 73 0d 0e e2 43 20 6c  64 72 42 20 20 72 30 2c  |ns...C ldrB  r0,|
000027c0  5b 72 33 2c 72 31 2c 6c  73 72 23 31 36 5d 20 20  |[r3,r1,lsr#16]  |
000027d0  20 20 3b 4c 6f 61 64 20  73 61 6d 70 6c 65 20 62  |  ;Load sample b|
000027e0  79 74 65 20 28 48 69 67  68 57 6f 72 64 20 6f 66  |yte (HighWord of|
000027f0  20 50 6f 73 29 0d 0e ec  48 20 73 75 62 53 20 20  | Pos)...H subS  |
00002800  72 30 2c 72 30 2c 72 35  20 20 20 20 20 20 20 20  |r0,r0,r5        |
00002810  20 20 20 20 20 3b 4d 69  6e 75 73 20 56 6f 6c 75  |     ;Minus Volu|
00002820  6d 65 20 28 77 68 65 72  65 20 30 3d 6c 6f 75 64  |me (where 0=loud|
00002830  20 26 20 32 35 35 3d 71  75 69 65 74 29 0d 0e f6  | & 255=quiet)...|
00002840  10 20 6d 6f 76 4d 69 20  72 30 2c 23 30 0d 0f 00  |. movMi r0,#0...|
00002850  3c 20 73 74 72 42 20 20  72 30 2c 5b 72 31 32 5d  |< strB  r0,[r12]|
00002860  2c 72 31 31 20 20 20 20  20 20 20 20 20 3b 41 6e  |,r11         ;An|
00002870  64 20 70 75 74 20 69 74  20 69 6e 74 6f 20 56 49  |d put it into VI|
00002880  44 43 2d 62 75 66 66 65  72 0d 0f 0a 36 20 61 64  |DC-buffer...6 ad|
00002890  64 20 20 20 72 31 2c 72  31 2c 72 32 20 20 20 20  |d   r1,r1,r2    |
000028a0  20 20 20 20 20 20 20 20  20 3b 41 64 64 20 50 69  |         ;Add Pi|
000028b0  74 63 68 20 28 66 69 78  20 70 6f 69 6e 74 29 0d  |tch (fix point).|
000028c0  0f 14 0e 5d 3a ed 3a 5b  4f 50 54 20 70 0d 0f 1e  |...]:.:[OPT p...|
000028d0  04 0d 0f 28 48 20 63 6d  70 20 20 20 72 34 2c 72  |...(H cmp   r4,r|
000028e0  31 2c 6c 73 72 23 31 36  20 20 20 20 20 20 20 20  |1,lsr#16        |
000028f0  20 3b 4c 65 6e 67 74 68  20 65 78 63 65 65 64 65  | ;Length exceede|
00002900  64 3f 20 28 4c 65 6e 20  3c 20 66 69 78 70 6f 69  |d? (Len < fixpoi|
00002910  6e 74 65 64 20 50 6f 73  29 0d 0f 32 3a 20 6d 6f  |nted Pos)..2: mo|
00002920  76 4c 73 20 72 31 2c 72  36 20 20 20 20 20 20 20  |vLs r1,r6       |
00002930  20 20 20 20 20 20 20 20  20 3b 59 65 73 2c 20 73  |         ;Yes, s|
00002940  6f 20 52 65 70 41 74 20  69 73 20 6e 65 77 20 50  |o RepAt is new P|
00002950  6f 73 2c 0d 0f 3c 34 20  63 6d 70 20 20 20 72 31  |os,..<4 cmp   r1|
00002960  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00002970  20 20 20 3b 20 20 20 20  62 75 74 20 69 73 20 69  |   ;    but is i|
00002980  74 20 7a 65 72 6f 3f 0d  0f 46 4c 20 6d 6f 76 45  |t zero?..FL movE|
00002990  71 20 72 32 2c 23 30 20  20 20 20 20 20 20 20 20  |q r2,#0         |
000029a0  20 20 20 20 20 20 20 3b  20 20 20 20 79 65 73 20  |       ;    yes |
000029b0  2d 3e 20 4d 75 74 65 20  43 68 61 6e 6e 65 6c 20  |-> Mute Channel |
000029c0  28 69 65 20 53 65 74 20  50 69 74 63 68 20 74 6f  |(ie Set Pitch to|
000029d0  20 30 29 0d 0f 50 3c 20  63 6d 70 20 20 20 72 31  | 0)..P< cmp   r1|
000029e0  32 2c 72 31 30 20 20 20  20 20 20 20 20 20 20 20  |2,r10           |
000029f0  20 20 20 3b 56 49 44 43  2d 42 75 66 66 65 72 20  |   ;VIDC-Buffer |
00002a00  66 69 6c 6c 65 64 20 61  6c 72 65 61 64 79 3f 0d  |filled already?.|
00002a10  0f 5a 28 20 62 4c 6f 20  20 20 76 66 69 6c 6c 6f  |.Z( bLo   vfillo|
00002a20  6f 70 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |op             ;|
00002a30  4e 6f 6f 6f 2e 2e 2e 0d  0f 64 46 20 73 74 6d 49  |Nooo.....dF stmI|
00002a40  61 20 72 38 2c 7b 72 31  2d 72 32 7d 20 20 20 20  |a r8,{r1-r2}    |
00002a50  20 20 20 20 20 20 20 3b  53 61 76 65 20 74 68 65  |       ;Save the|
00002a60  20 74 77 6f 20 28 70 72  6f 62 61 62 6c 79 29 20  | two (probably) |
00002a70  6d 6f 64 69 66 69 65 64  20 72 65 67 73 0d 0f 6e  |modified regs..n|
00002a80  04 0d 0f 78 4c 20 6c 64  72 42 20 20 72 30 2c 49  |...xL ldrB  r0,I|
00002a90  6e 74 46 6c 61 67 20 20  20 20 20 20 20 20 20 20  |ntFlag          |
00002aa0  20 3b 48 61 76 65 20 77  65 20 62 65 65 6e 20 69  | ;Have we been i|
00002ab0  6e 74 65 72 72 75 70 74  65 64 20 62 79 20 6f 75  |nterrupted by ou|
00002ac0  72 20 50 6c 61 79 2d 45  76 65 6e 74 3f 0d 0f 82  |r Play-Event?...|
00002ad0  10 20 63 6d 70 20 20 20  72 30 2c 23 31 0d 0f 8c  |. cmp   r0,#1...|
00002ae0  36 20 73 74 72 45 71 42  20 30 2c 49 6e 74 53 79  |6 strEqB 0,IntSy|
00002af0  6e 63 20 20 20 20 20 20  20 20 20 20 20 3b 41 68  |nc           ;Ah|
00002b00  2c 20 66 75 63 6b 79 20  59 45 53 21 20 28 4f 6f  |, fucky YES! (Oo|
00002b10  70 73 29 0d 0f 96 42 20  6d 6f 76 20 20 20 72 30  |ps)...B mov   r0|
00002b20  2c 23 25 30 30 30 30 31  30 30 30 20 20 20 20 20  |,#%00001000     |
00002b30  20 20 20 3b 41 6e 64 20  72 65 74 75 72 6e 20 77  |   ;And return w|
00002b40  69 74 68 20 56 6f 69 63  65 2d 41 63 74 69 76 65  |ith Voice-Active|
00002b50  2d 46 6c 61 67 0d 0f a0  14 20 6c 64 6d 66 64 20  |-Flag.... ldmfd |
00002b60  72 31 33 21 2c 7b 70 63  7d 0d 0f aa 04 0d 0f b4  |r13!,{pc}.......|
00002b70  09 2e 48 65 61 64 0d 0f  be 4b 20 64 63 64 20 30  |..Head...K dcd 0|
00002b80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002b90  20 20 20 20 20 20 3b 72  31 20 50 6f 73 20 69 6e  |      ;r1 Pos in|
00002ba0  20 74 68 65 20 73 61 6d  70 6c 65 20 28 4f 66 66  | the sample (Off|
00002bb0  73 65 74 20 69 6e 20 66  69 78 20 70 6f 69 6e 74  |set in fix point|
00002bc0  29 0d 0f c8 4a 20 64 63  64 20 30 20 20 20 20 20  |)...J dcd 0     |
00002bd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002be0  20 3b 72 32 20 49 6e 63  72 65 6d 65 6e 74 2f 50  | ;r2 Increment/P|
00002bf0  69 74 63 68 20 28 4c 6f  77 57 6f 72 64 20 66 6f  |itch (LowWord fo|
00002c00  72 20 66 69 78 70 6f 69  6e 74 29 0d 0f d2 31 20  |r fixpoint)...1 |
00002c10  64 63 64 20 30 20 20 20  20 20 20 20 20 20 20 20  |dcd 0           |
00002c20  20 20 20 20 20 20 20 20  20 20 20 3b 72 33 20 53  |           ;r3 S|
00002c30  61 6d 70 6c 65 20 41 64  72 65 73 73 0d 0f dc 2a  |ample Adress...*|
00002c40  20 64 63 64 20 30 20 20  20 20 20 20 20 20 20 20  | dcd 0          |
00002c50  20 20 20 20 20 20 20 20  20 20 20 20 3b 72 34 20  |            ;r4 |
00002c60  4c 65 6e 67 74 68 0d 0f  e6 41 20 64 63 64 20 30  |Length...A dcd 0|
00002c70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002c80  20 20 20 20 20 20 3b 72  35 20 56 6f 6c 75 6d 65  |      ;r5 Volume|
00002c90  20 28 30 3d 4c 6f 75 64  20 2e 2e 2e 20 32 35 35  | (0=Loud ... 255|
00002ca0  3d 51 75 69 65 74 29 0d  0f f0 4d 20 64 63 64 20  |=Quiet)...M dcd |
00002cb0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00002cc0  20 20 20 20 20 20 20 3b  72 36 20 52 65 70 41 74  |       ;r6 RepAt|
00002cd0  20 28 4e 65 77 20 66 69  78 70 6f 69 6e 74 20 50  | (New fixpoint P|
00002ce0  6f 73 29 2c 20 6f 72 20  30 20 66 6f 72 20 4e 4f  |os), or 0 for NO|
00002cf0  20 52 45 50 0d 0f fa 42  20 64 63 64 20 30 20 20  | REP...B dcd 0  |
00002d00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002d10  20 20 20 20 3b 42 79 74  65 20 2b 32 34 20 56 61  |    ;Byte +24 Va|
00002d20  6c 75 65 20 66 6f 72 20  41 75 74 6f 20 56 6f 6c  |lue for Auto Vol|
00002d30  75 6d 65 20 75 70 0d 10  04 44 20 20 20 20 20 20  |ume up...D      |
00002d40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002d50  20 20 20 20 20 20 3b 20  20 20 20 20 20 32 35 20  |      ;      25 |
00002d60  20 20 22 20 20 20 20 22  20 20 20 22 20 20 20 56  |  "    "   "   V|
00002d70  6f 6c 75 6d 65 20 64 6f  77 6e 0d 10 0e 41 20 20  |olume down...A  |
00002d80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002d90  20 20 20 20 20 20 20 20  20 20 3b 20 20 20 20 20  |          ;     |
00002da0  20 32 36 20 20 20 22 20  20 20 20 22 20 20 20 22  | 26   "    "   "|
00002db0  20 20 20 50 69 74 63 68  20 75 70 0d 10 18 43 20  |   Pitch up...C |
00002dc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002dd0  20 20 20 20 20 20 20 20  20 20 20 3b 20 20 20 20  |           ;    |
00002de0  20 20 32 37 20 20 20 22  20 20 20 20 22 20 20 20  |  27   "    "   |
00002df0  22 20 20 20 50 69 74 63  68 20 64 6f 77 6e 0d 10  |"   Pitch down..|
00002e00  22 3a 20 64 63 64 20 30  20 20 20 20 20 20 20 20  |": dcd 0        |
00002e10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 42  |              ;B|
00002e20  79 74 65 20 2b 32 38 20  41 63 74 75 61 6c 20 49  |yte +28 Actual I|
00002e30  6e 66 6f 20 42 79 74 65  0d 10 2c 3a 20 20 20 20  |nfo Byte..,:    |
00002e40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002e50  20 20 20 20 20 20 20 20  3b 20 20 20 20 20 20 32  |        ;      2|
00002e60  39 20 41 63 74 75 61 6c  20 43 6f 6d 6d 20 42 79  |9 Actual Comm By|
00002e70  74 65 0d 10 36 39 20 20  20 20 20 20 20 20 20 20  |te..69          |
00002e80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002e90  20 20 3b 20 20 20 20 20  20 33 30 20 28 53 6f 75  |  ;      30 (Sou|
00002ea0  6e 64 20 46 58 20 46 6c  61 67 29 0d 10 40 3e 20  |nd FX Flag)..@> |
00002eb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002ec0  20 20 20 20 20 20 20 20  20 20 20 3b 20 20 20 20  |           ;    |
00002ed0  20 20 33 31 20 4c 61 73  74 20 6c 65 67 61 6c 20  |  31 Last legal |
00002ee0  74 6f 6e 65 2f 6e 6f 74  65 0d 10 4a 04 0d 10 54  |tone/note..J...T|
00002ef0  35 20 64 63 62 20 c4 33  2a 33 32 2d 34 2a 33 32  |5 dcb .3*32-4*32|
00002f00  2a 28 56 6f 63 73 3d 38  29 2c bd 30 29 20 20 20  |*(Vocs=8),.0)   |
00002f10  20 3b 41 64 64 20 33 20  6f 72 20 37 20 48 65 61  | ;Add 3 or 7 Hea|
00002f20  64 73 0d 10 5e 04 0d 10  68 35 2e 56 6f 6c 75 6d  |ds..^...h5.Volum|
00002f30  65 20 20 20 20 20 20 20  64 63 64 20 30 20 20 20  |e       dcd 0   |
00002f40  20 20 20 20 20 20 3b 4f  76 65 72 61 6c 6c 5f 53  |      ;Overall_S|
00002f50  6f 75 6e 64 5f 56 6f 6c  75 6d 65 0d 10 72 3c 2e  |ound_Volume..r<.|
00002f60  49 6e 74 46 6c 61 67 20  20 20 20 20 20 64 63 62  |IntFlag      dcb|
00002f70  20 30 20 20 20 20 20 20  20 20 20 3b 53 65 74 20  | 0         ;Set |
00002f80  3d 20 48 61 76 65 20 62  65 65 6e 20 69 6e 74 65  |= Have been inte|
00002f90  72 72 75 70 74 65 64 0d  10 7c 3b 2e 49 6e 74 53  |rrupted..|;.IntS|
00002fa0  79 6e 63 20 20 20 20 20  20 64 63 62 20 30 20 20  |ync      dcb 0  |
00002fb0  20 20 20 20 20 20 20 3b  53 65 74 20 3d 20 4c 6f  |       ;Set = Lo|
00002fc0  73 65 72 20 6e 65 65 64  73 20 6e 65 77 20 73 79  |ser needs new sy|
00002fd0  6e 63 0d 10 86 0a 20 61  6c 69 67 6e 0d 10 90 04  |nc.... align....|
00002fe0  0d 10 9a 4d 3b 3d 3d 3d  3d 20 50 4c 41 59 20 45  |...M;==== PLAY E|
00002ff0  56 45 4e 54 20 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |VENT ===========|
00003000  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00003020  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 0d 10 a4  |=============...|
00003030  05 20 0d 10 ae 3d 3b 2a  2a 2a 20 44 4f 20 45 56  |. ...=;*** DO EV|
00003040  45 52 59 20 56 53 59 4e  43 20 45 46 46 45 43 54  |ERY VSYNC EFFECT|
00003050  53 20 28 23 72 30 3d 54  69 6d 65 72 20 2e 2e 2e  |S (#r0=Timer ...|
00003060  20 24 72 30 3d 70 72 65  73 65 72 76 65 64 29 0d  | $r0=preserved).|
00003070  10 b8 04 0d 10 c2 0d 2e  76 65 66 66 65 63 74 73  |........veffects|
00003080  0d 10 cc 33 20 6c 64 72  20 20 20 72 34 2c 5b 72  |...3 ldr   r4,[r|
00003090  31 32 2c 23 34 5d 20 20  20 20 20 20 20 20 20 20  |12,#4]          |
000030a0  3b 4c 6f 61 64 20 63 75  72 72 65 6e 74 20 50 69  |;Load current Pi|
000030b0  74 63 68 0d 10 d6 4a 20  63 6d 70 20 20 20 72 34  |tch...J cmp   r4|
000030c0  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
000030d0  20 20 20 3b 4e 6f 20 61  63 74 69 76 65 20 74 6f  |   ;No active to|
000030e0  6e 65 20 2d 3e 20 73 6f  72 72 79 2c 20 65 66 66  |ne -> sorry, eff|
000030f0  65 63 74 20 64 69 73 61  62 6c 65 64 21 0d 10 e0  |ect disabled!...|
00003100  11 20 6d 6f 76 45 71 20  70 63 2c 72 31 34 0d 10  |. movEq pc,r14..|
00003110  ea 32 20 6c 64 72 20 20  20 72 33 2c 5b 72 31 32  |.2 ldr   r3,[r12|
00003120  2c 23 32 34 5d 20 20 20  20 20 20 20 20 20 3b 4c  |,#24]         ;L|
00003130  6f 61 64 20 41 75 74 6f  2d 45 66 66 65 63 74 73  |oad Auto-Effects|
00003140  0d 10 f4 29 20 6d 6f 76  20 20 20 72 31 30 2c 72  |...) mov   r10,r|
00003150  31 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |14              |
00003160  3b 50 75 73 68 20 72 31  34 0d 10 fe 39 20 61 6e  |;Push r14...9 an|
00003170  64 53 20 20 72 32 2c 72  33 2c 23 26 66 66 20 20  |dS  r2,r3,#&ff  |
00003180  20 20 20 20 20 20 20 20  20 3b 49 73 20 74 68 65  |         ;Is the|
00003190  72 65 20 41 75 74 6f 20  56 6f 6c 75 6d 65 20 75  |re Auto Volume u|
000031a0  70 3f 0d 11 08 12 20 62  6c 4e 65 20 20 76 5f 76  |p?.... blNe  v_v|
000031b0  6f 6c 75 70 0d 11 12 3b  20 61 6e 64 53 20 20 72  |olup...; andS  r|
000031c0  32 2c 72 33 2c 23 26 66  66 20 3c 3c 38 20 20 20  |2,r3,#&ff <<8   |
000031d0  20 20 20 20 3b 49 73 20  74 68 65 72 65 20 41 75  |    ;Is there Au|
000031e0  74 6f 20 56 6f 6c 75 6d  65 20 64 6f 77 6e 3f 0d  |to Volume down?.|
000031f0  11 1c 16 20 6d 6f 76 4e  65 20 72 32 2c 72 32 2c  |... movNe r2,r2,|
00003200  6c 73 72 23 38 0d 11 26  14 20 62 6c 4e 65 20 20  |lsr#8..&. blNe  |
00003210  76 5f 76 6f 6c 64 6f 77  6e 0d 11 30 38 20 61 6e  |v_voldown..08 an|
00003220  64 53 20 20 72 32 2c 72  33 2c 23 26 66 66 20 3c  |dS  r2,r3,#&ff <|
00003230  3c 31 36 20 20 20 20 20  20 3b 49 73 20 74 68 65  |<16      ;Is the|
00003240  72 65 20 41 75 74 6f 20  50 69 74 63 68 20 75 70  |re Auto Pitch up|
00003250  3f 0d 11 3a 17 20 6d 6f  76 4e 65 20 72 32 2c 72  |?..:. movNe r2,r|
00003260  32 2c 6c 73 72 23 31 36  0d 11 44 12 20 62 6c 4e  |2,lsr#16..D. blN|
00003270  65 20 20 76 5f 61 72 63  75 70 0d 11 4e 3a 20 61  |e  v_arcup..N: a|
00003280  6e 64 53 20 20 72 32 2c  72 33 2c 23 26 66 66 20  |ndS  r2,r3,#&ff |
00003290  3c 3c 32 34 20 20 20 20  20 20 3b 49 73 20 74 68  |<<24      ;Is th|
000032a0  65 72 65 20 41 75 74 6f  20 50 69 74 63 68 20 64  |ere Auto Pitch d|
000032b0  6f 77 6e 3f 0d 11 58 17  20 6d 6f 76 4e 65 20 72  |own?..X. movNe r|
000032c0  32 2c 72 32 2c 6c 73 72  23 32 34 0d 11 62 14 20  |2,r2,lsr#24..b. |
000032d0  62 6c 4e 65 20 20 76 5f  61 72 63 64 6f 77 6e 0d  |blNe  v_arcdown.|
000032e0  11 6c 29 20 6d 6f 76 20  20 20 72 31 34 2c 72 31  |.l) mov   r14,r1|
000032f0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |0              ;|
00003300  50 6f 70 20 20 72 31 34  0d 11 76 04 0d 11 80 4b  |Pop  r14..v....K|
00003310  20 6c 64 72 20 20 20 72  31 2c 5b 72 31 32 2c 23  | ldr   r1,[r12,#|
00003320  32 38 5d 20 20 20 20 20  20 20 20 20 3b 45 66 66  |28]         ;Eff|
00003330  65 63 74 20 4c 57 6f 72  64 20 26 20 4c 61 73 74  |ect LWord & Last|
00003340  20 54 6f 6e 65 20 61 72  65 20 69 6e 20 74 68 65  | Tone are in the|
00003350  20 48 65 61 64 65 72 0d  11 8a 31 20 61 6e 64 53  | Header...1 andS|
00003360  20 20 72 32 2c 72 31 2c  23 26 66 66 20 20 20 20  |  r2,r1,#&ff    |
00003370  20 20 20 20 20 20 20 3b  49 73 6f 6c 61 74 65 20  |       ;Isolate |
00003380  49 6e 66 6f 42 79 74 65  0d 11 94 45 20 6d 6f 76  |InfoByte...E mov|
00003390  45 71 20 70 63 2c 72 31  34 20 20 20 20 20 20 20  |Eq pc,r14       |
000033a0  20 20 20 20 20 20 20 20  3b 69 66 20 30 2c 20 74  |        ;if 0, t|
000033b0  68 65 6e 20 74 68 65 72  65 27 73 20 6e 6f 20 65  |hen there's no e|
000033c0  66 66 65 63 74 20 61 74  20 61 6c 6c 21 0d 11 9e  |ffect at all!...|
000033d0  36 20 61 6e 64 20 20 20  72 33 2c 72 31 2c 23 26  |6 and   r3,r1,#&|
000033e0  66 66 30 30 20 20 20 20  20 20 20 20 20 3b 49 73  |ff00         ;Is|
000033f0  6f 6c 61 74 65 20 45 66  66 65 63 74 20 6e 75 6d  |olate Effect num|
00003400  62 65 72 0d 11 a8 4d 20  6c 64 72 20 20 20 72 33  |ber...M ldr   r3|
00003410  2c 5b 70 63 2c 72 33 2c  6c 73 72 23 36 5d 20 20  |,[pc,r3,lsr#6]  |
00003420  20 20 20 3b 6c 73 72 23  38 20 66 6f 72 20 65 66  |   ;lsr#8 for ef|
00003430  66 65 63 74 20 69 6e 74  6f 20 6c 6f 77 62 79 74  |fect into lowbyt|
00003440  65 20 26 20 6c 73 6c 23  32 20 66 6f 72 20 2a 34  |e & lsl#2 for *4|
00003450  0d 11 b2 13 20 61 64 64  20 20 20 70 63 2c 70 63  |.... add   pc,pc|
00003460  2c 72 33 0d 11 bc 04 0d  11 c6 2e 20 64 63 64 20  |,r3........ dcd |
00003470  20 20 76 5f 61 72 70 65  67 67 69 6f 2d 76 6f 66  |  v_arpeggio-vof|
00003480  31 20 20 20 20 20 20 3b  20 30 20 3d 20 41 72 70  |1      ; 0 = Arp|
00003490  65 67 67 69 6f 0d 11 d0  09 2e 76 6f 66 31 0d 11  |eggio.....vof1..|
000034a0  da 46 20 64 63 64 20 20  20 76 5f 73 6c 69 64 65  |.F dcd   v_slide|
000034b0  75 70 2d 76 6f 66 31 20  20 20 20 20 20 20 3b 20  |up-vof1       ; |
000034c0  31 20 3d 20 53 6c 69 64  65 20 50 69 74 63 68 20  |1 = Slide Pitch |
000034d0  75 70 20 20 20 28 74 69  6c 6c 20 41 6d 69 73 20  |up   (till Amis |
000034e0  4d 61 78 29 0d 11 e4 46  20 64 63 64 20 20 20 76  |Max)...F dcd   v|
000034f0  5f 73 6c 69 64 65 64 6f  77 6e 2d 76 6f 66 31 20  |_slidedown-vof1 |
00003500  20 20 20 20 3b 20 32 20  3d 20 53 6c 69 64 65 20  |    ; 2 = Slide |
00003510  50 69 74 63 68 20 64 6f  77 6e 20 28 74 69 6c 6c  |Pitch down (till|
00003520  20 41 6d 69 73 20 4d 69  6e 29 0d 11 ee 2f 20 64  | Amis Min).../ d|
00003530  63 64 20 20 20 76 5f 76  6f 6c 75 70 2d 76 6f 66  |cd   v_volup-vof|
00003540  31 20 20 20 20 20 20 20  20 20 3b 20 33 20 3d 20  |1         ; 3 = |
00003550  56 6f 6c 75 6d 65 20 75  70 0d 11 f8 31 20 64 63  |Volume up...1 dc|
00003560  64 20 20 20 76 5f 76 6f  6c 64 6f 77 6e 2d 76 6f  |d   v_voldown-vo|
00003570  66 31 20 20 20 20 20 20  20 3b 20 34 20 3d 20 56  |f1       ; 4 = V|
00003580  6f 6c 75 6d 65 20 64 6f  77 6e 0d 12 02 38 20 64  |olume down...8 d|
00003590  63 64 20 20 20 76 5f 61  72 63 75 70 2d 76 6f 66  |cd   v_arcup-vof|
000035a0  31 20 20 20 20 20 20 20  20 20 3b 20 35 20 3d 20  |1         ; 5 = |
000035b0  53 6c 69 64 65 20 41 72  63 20 50 69 74 63 68 20  |Slide Arc Pitch |
000035c0  75 70 0d 12 0c 3a 20 64  63 64 20 20 20 76 5f 61  |up...: dcd   v_a|
000035d0  72 63 64 6f 77 6e 2d 76  6f 66 31 20 20 20 20 20  |rcdown-vof1     |
000035e0  20 20 3b 20 36 20 3d 20  53 6c 69 64 65 20 41 72  |  ; 6 = Slide Ar|
000035f0  63 20 50 69 74 63 68 20  64 6f 77 6e 0d 12 16 04  |c Pitch down....|
00003600  0d 12 20 0f 2e 76 5f 61  72 70 65 67 67 69 6f 0d  |.. ..v_arpeggio.|
00003610  12 2a 42 20 6d 6f 76 20  20 20 72 31 2c 72 31 2c  |.*B mov   r1,r1,|
00003620  6c 73 72 23 32 34 20 20  20 20 20 20 20 20 20 3b  |lsr#24         ;|
00003630  47 65 74 20 6c 61 73 74  20 73 74 6f 72 65 64 20  |Get last stored |
00003640  54 6f 6e 65 20 69 6e 74  6f 20 6c 6f 77 62 79 74  |Tone into lowbyt|
00003650  65 0d 12 34 2a 20 63 6d  70 20 20 20 72 30 2c 23  |e..4* cmp   r0,#|
00003660  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
00003670  20 3b 54 69 6d 65 3d 31  20 6f 72 0d 12 3e 27 20  | ;Time=1 or..>' |
00003680  63 6d 70 4e 65 20 72 30  2c 23 34 20 20 20 20 20  |cmpNe r0,#4     |
00003690  20 20 20 20 20 20 20 20  20 20 20 3b 54 69 6d 65  |           ;Time|
000036a0  3d 34 0d 12 48 46 20 61  64 64 45 71 20 72 31 2c  |=4..HF addEq r1,|
000036b0  72 31 2c 72 32 2c 6c 73  72 23 34 20 20 20 20 20  |r1,r2,lsr#4     |
000036c0  20 20 3b 20 2e 2e 2e 74  68 65 6e 20 61 64 64 20  |  ; ...then add |
000036d0  20 6c 65 66 74 20 49 6e  66 6f 4e 69 62 62 6c 65  | left InfoNibble|
000036e0  20 74 6f 20 4e 6f 74 65  0d 12 52 2a 20 63 6d 70  | to Note..R* cmp|
000036f0  20 20 20 72 30 2c 23 32  20 20 20 20 20 20 20 20  |   r0,#2        |
00003700  20 20 20 20 20 20 20 20  3b 54 69 6d 65 3d 32 20  |        ;Time=2 |
00003710  6f 72 0d 12 5c 27 20 63  6d 70 4e 65 20 72 30 2c  |or..\' cmpNe r0,|
00003720  23 35 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#5              |
00003730  20 20 3b 54 69 6d 65 3d  35 0d 12 66 46 20 61 6e  |  ;Time=5..fF an|
00003740  64 45 71 20 72 32 2c 72  32 2c 23 26 30 66 20 20  |dEq r2,r2,#&0f  |
00003750  20 20 20 20 20 20 20 20  20 3b 20 2e 2e 2e 74 68  |         ; ...th|
00003760  65 6e 20 61 64 64 20 72  69 67 68 74 20 49 6e 66  |en add right Inf|
00003770  6f 4e 69 62 62 6c 65 20  74 6f 20 4e 6f 74 65 0d  |oNibble to Note.|
00003780  12 70 13 20 61 64 64 45  71 20 72 31 2c 72 31 2c  |.p. addEq r1,r1,|
00003790  72 32 0d 12 7a 49 20 6c  64 72 20 20 20 72 31 2c  |r2..zI ldr   r1,|
000037a0  5b 72 31 31 2c 72 31 2c  6c 73 6c 23 32 5d 20 20  |[r11,r1,lsl#2]  |
000037b0  20 20 3b 47 65 74 20 65  71 75 69 76 61 6c 65 6e  |  ;Get equivalen|
000037c0  74 20 46 72 65 71 75 65  6e 63 79 20 66 72 6f 6d  |t Frequency from|
000037d0  20 72 31 31 3d 66 54 61  62 6c 65 0d 12 84 2c 20  | r11=fTable..., |
000037e0  73 74 72 20 20 20 72 31  2c 5b 72 31 32 2c 23 34  |str   r1,[r12,#4|
000037f0  5d 20 20 20 20 20 20 20  20 20 20 3b 45 6e 74 65  |]          ;Ente|
00003800  72 20 50 69 74 63 68 0d  12 8e 11 20 6d 6f 76 20  |r Pitch.... mov |
00003810  20 20 70 63 2c 72 31 34  0d 12 98 04 0d 12 a2 0e  |  pc,r14........|
00003820  2e 76 5f 73 6c 69 64 65  75 70 0d 12 ac 32 20 61  |.v_slideup...2 a|
00003830  64 64 20 20 20 72 31 2c  72 34 2c 72 32 2c 6c 73  |dd   r1,r4,r2,ls|
00003840  6c 23 36 20 20 20 20 20  20 20 3b 20 46 72 65 71  |l#6       ; Freq|
00003850  2b 49 6e 66 6f 42 79 74  65 2a 36 34 0d 12 b6 44  |+InfoByte*64...D|
00003860  20 63 6d 70 20 20 20 72  31 2c 23 26 31 38 38 30  | cmp   r1,#&1880|
00003870  30 20 20 20 20 20 20 20  20 20 20 20 3b 4d 69 6e  |0           ;Min|
00003880  20 50 65 72 20 3d 20 26  30 37 31 2c 20 69 65 20  | Per = &071, ie |
00003890  4f 75 74 50 75 74 46 20  3c 20 26 31 38 34 44 41  |OutPutF < &184DA|
000038a0  0d 12 c0 16 20 73 74 72  4c 74 20 72 31 2c 5b 72  |.... strLt r1,[r|
000038b0  31 32 2c 23 34 5d 0d 12  ca 11 20 6d 6f 76 20 20  |12,#4].... mov  |
000038c0  20 70 63 2c 72 31 34 0d  12 d4 10 2e 76 5f 73 6c  | pc,r14.....v_sl|
000038d0  69 64 65 64 6f 77 6e 0d  12 de 32 20 73 75 62 20  |idedown...2 sub |
000038e0  20 20 72 31 2c 72 34 2c  72 32 2c 6c 73 6c 23 36  |  r1,r4,r2,lsl#6|
000038f0  20 20 20 20 20 20 20 3b  20 46 72 65 71 2d 49 6e  |       ; Freq-In|
00003900  66 6f 42 79 74 65 2a 36  34 0d 12 e8 44 20 63 6d  |foByte*64...D cm|
00003910  70 20 20 20 72 31 2c 23  26 33 33 34 30 20 20 20  |p   r1,#&3340   |
00003920  20 20 20 20 20 20 20 20  20 3b 4d 61 78 20 50 65  |         ;Max Pe|
00003930  72 20 3d 20 26 33 35 38  2c 20 69 65 20 4f 75 74  |r = &358, ie Out|
00003940  50 75 74 46 20 3e 20 26  20 33 33 35 35 0d 12 f2  |PutF > & 3355...|
00003950  16 20 73 74 72 47 74 20  72 31 2c 5b 72 31 32 2c  |. strGt r1,[r12,|
00003960  23 34 5d 0d 12 fc 11 20  6d 6f 76 20 20 20 70 63  |#4].... mov   pc|
00003970  2c 72 31 34 0d 13 06 04  0d 13 10 0c 2e 76 5f 76  |,r14.........v_v|
00003980  6f 6c 75 70 0d 13 1a 4a  20 63 6d 70 20 20 20 72  |olup...J cmp   r|
00003990  30 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 20  |0,#1            |
000039a0  20 20 20 20 3b 4f 6e 6c  79 20 65 61 63 68 20 66  |    ;Only each f|
000039b0  69 72 73 74 20 76 5f 69  6e 74 65 72 72 75 70 74  |irst v_interrupt|
000039c0  20 66 6f 72 20 73 6c 6f  77 20 64 6f 77 6e 0d 13  | for slow down..|
000039d0  24 11 20 6d 6f 76 4e 65  20 70 63 2c 72 31 34 0d  |$. movNe pc,r14.|
000039e0  13 2e 38 20 6c 64 72 20  20 20 72 31 2c 5b 72 31  |..8 ldr   r1,[r1|
000039f0  32 2c 23 31 36 5d 20 20  20 20 20 20 20 20 20 3b  |2,#16]         ;|
00003a00  54 68 65 72 65 20 69 73  20 63 75 72 72 65 6e 74  |There is current|
00003a10  20 56 6f 6c 75 6d 65 0d  13 38 13 20 73 75 62 53  | Volume..8. subS|
00003a20  20 20 72 31 2c 72 31 2c  72 32 0d 13 42 4a 20 73  |  r1,r1,r2..BJ s|
00003a30  74 72 50 6c 20 72 31 2c  5b 72 31 32 2c 23 31 36  |trPl r1,[r12,#16|
00003a40  5d 20 20 20 20 20 20 20  20 20 3b 49 66 20 6e 6f  |]         ;If no|
00003a50  74 20 3e 20 30 20 20 28  4d 61 78 20 56 6f 6c 29  |t > 0  (Max Vol)|
00003a60  2c 20 74 68 65 6e 20 77  72 69 74 65 20 69 74 20  |, then write it |
00003a70  62 61 63 6b 0d 13 4c 11  20 6d 6f 76 20 20 20 70  |back..L. mov   p|
00003a80  63 2c 72 31 34 0d 13 56  0e 2e 76 5f 76 6f 6c 64  |c,r14..V..v_vold|
00003a90  6f 77 6e 0d 13 60 10 20  63 6d 70 20 20 20 72 30  |own..`. cmp   r0|
00003aa0  2c 23 31 0d 13 6a 11 20  6d 6f 76 4e 65 20 70 63  |,#1..j. movNe pc|
00003ab0  2c 72 31 34 0d 13 74 17  20 6c 64 72 20 20 20 72  |,r14..t. ldr   r|
00003ac0  31 2c 5b 72 31 32 2c 23  31 36 5d 0d 13 7e 13 20  |1,[r12,#16]..~. |
00003ad0  61 64 64 20 20 20 72 31  2c 72 31 2c 72 32 0d 13  |add   r1,r1,r2..|
00003ae0  88 12 20 63 6d 70 20 20  20 72 31 2c 23 32 35 35  |.. cmp   r1,#255|
00003af0  0d 13 92 4a 20 73 74 72  4c 73 20 72 31 2c 5b 72  |...J strLs r1,[r|
00003b00  31 32 2c 23 31 36 5d 20  20 20 20 20 20 20 20 20  |12,#16]         |
00003b10  3b 49 66 20 6e 6f 74 20  3c 32 35 35 20 28 4d 69  |;If not <255 (Mi|
00003b20  6e 20 56 6f 6c 29 2c 20  74 68 65 6e 20 77 72 69  |n Vol), then wri|
00003b30  74 65 20 69 74 20 62 61  63 6b 0d 13 9c 11 20 6d  |te it back.... m|
00003b40  6f 76 20 20 20 70 63 2c  72 31 34 0d 13 a6 04 0d  |ov   pc,r14.....|
00003b50  13 b0 0c 2e 76 5f 61 72  63 75 70 0d 13 ba 45 20  |....v_arcup...E |
00003b60  61 64 64 53 20 20 72 31  2c 72 34 2c 72 32 2c 6c  |addS  r1,r4,r2,l|
00003b70  73 6c 23 34 20 20 20 20  20 20 20 3b 50 69 74 63  |sl#4       ;Pitc|
00003b80  68 2b 49 6e 66 6f 42 79  74 65 2a 31 36 20 28 66  |h+InfoByte*16 (f|
00003b90  6f 72 20 73 6c 6f 77 20  73 6c 69 64 69 6e 67 29  |or slow sliding)|
00003ba0  0d 13 c4 16 20 73 74 72  50 6c 20 72 31 2c 5b 72  |.... strPl r1,[r|
00003bb0  31 32 2c 23 34 5d 0d 13  ce 11 20 6d 6f 76 20 20  |12,#4].... mov  |
00003bc0  20 70 63 2c 72 31 34 0d  13 d8 0e 2e 76 5f 61 72  | pc,r14.....v_ar|
00003bd0  63 64 6f 77 6e 0d 13 e2  45 20 73 75 62 53 20 20  |cdown...E subS  |
00003be0  72 31 2c 72 34 2c 72 32  2c 6c 73 6c 23 34 20 20  |r1,r4,r2,lsl#4  |
00003bf0  20 20 20 20 20 3b 50 69  74 63 68 2d 49 6e 66 6f  |     ;Pitch-Info|
00003c00  42 79 74 65 2a 31 36 20  28 66 6f 72 20 73 6c 6f  |Byte*16 (for slo|
00003c10  77 20 73 6c 69 64 69 6e  67 29 0d 13 ec 16 20 73  |w sliding).... s|
00003c20  74 72 50 6c 20 72 31 2c  5b 72 31 32 2c 23 34 5d  |trPl r1,[r12,#4]|
00003c30  0d 13 f6 11 20 6d 6f 76  20 20 20 70 63 2c 72 31  |.... mov   pc,r1|
00003c40  34 0d 14 00 04 0d 14 0a  1e 3b 2a 2a 2a 20 45 4e  |4........;*** EN|
00003c50  54 52 59 20 c8 92 53 20  e3 20 47 41 4d 45 20 d4  |TRY ..S . GAME .|
00003c60  20 46 58 0d 14 14 04 0d  14 1e 08 2e 66 78 31 0d  | FX.........fx1.|
00003c70  14 28 18 20 61 64 72 20  20 20 72 31 32 2c 48 65  |.(. adr   r12,He|
00003c80  61 64 2b 30 2a 33 32 0d  14 32 10 20 62 20 20 20  |ad+0*32..2. b   |
00003c90  20 20 66 78 34 2b 34 0d  14 3c 08 2e 66 78 32 0d  |  fx4+4..<..fx2.|
00003ca0  14 46 18 20 61 64 72 20  20 20 72 31 32 2c 48 65  |.F. adr   r12,He|
00003cb0  61 64 2b 31 2a 33 32 0d  14 50 10 20 62 20 20 20  |ad+1*32..P. b   |
00003cc0  20 20 66 78 34 2b 34 0d  14 5a 08 2e 66 78 33 0d  |  fx4+4..Z..fx3.|
00003cd0  14 64 18 20 61 64 72 20  20 20 72 31 32 2c 48 65  |.d. adr   r12,He|
00003ce0  61 64 2b 32 2a 33 32 0d  14 6e 10 20 62 20 20 20  |ad+2*32..n. b   |
00003cf0  20 20 66 78 34 2b 34 0d  14 78 08 2e 66 78 34 0d  |  fx4+4..x..fx4.|
00003d00  14 82 18 20 61 64 72 20  20 20 72 31 32 2c 48 65  |... adr   r12,He|
00003d10  61 64 2b 33 2a 33 32 0d  14 8c 10 20 6d 6f 76 20  |ad+3*32.... mov |
00003d20  20 20 72 30 2c 23 31 0d  14 96 31 20 73 74 72 42  |  r0,#1...1 strB|
00003d30  20 20 72 30 2c 5b 72 31  32 2c 23 33 30 5d 20 20  |  r0,[r12,#30]  |
00003d40  20 20 20 20 20 20 20 3b  53 65 74 20 53 6f 75 6e  |       ;Set Soun|
00003d50  64 46 58 20 66 6c 61 67  0d 14 a0 14 20 61 64 72  |dFX flag.... adr|
00003d60  20 20 20 72 31 30 2c 54  72 61 63 6b 0d 14 aa 15  |   r10,Track....|
00003d70  20 61 64 72 20 20 20 72  31 31 2c 46 74 61 62 6c  | adr   r11,Ftabl|
00003d80  65 0d 14 b4 10 20 62 20  20 20 20 20 76 72 75 6c  |e.... b     vrul|
00003d90  65 0d 14 be 04 0d 14 c8  46 3b 2a 2a 2a 20 a8 45  |e.......F;*** .E|
00003da0  52 52 55 50 54 20 45 4e  54 52 59 20 c8 92 20 28  |RRUPT ENTRY .. (|
00003db0  23 72 30 3d 45 76 65 6e  74 20 4e 6f 2c 20 72 31  |#r0=Event No, r1|
00003dc0  32 3d 57 6f 72 6b 73 70  61 63 65 20 5b 68 65 72  |2=Workspace [her|
00003dd0  65 20 48 65 61 64 41 64  72 5d 29 0d 14 d2 04 0d  |e HeadAdr]).....|
00003de0  14 dc 0b 2e 76 69 6e 74  65 72 0d 14 e6 4c 20 73  |....vinter...L s|
00003df0  74 6d 66 64 20 72 31 33  21 2c 7b 72 31 2d 72 31  |tmfd r13!,{r1-r1|
00003e00  31 7d 20 20 20 20 20 20  20 20 3b 46 6f 72 20 6e  |1}        ;For n|
00003e10  6f 74 20 69 6e 74 65 72  63 65 70 74 69 6e 67 20  |ot intercepting |
00003e20  76 65 63 74 6f 72 20 2d  3e 20 70 75 73 68 20 72  |vector -> push r|
00003e30  31 34 20 74 6f 6f 0d 14  f0 04 0d 14 fa 4c 20 61  |14 too.......L a|
00003e40  64 72 20 20 20 72 31 31  2c 46 74 61 62 6c 65 20  |dr   r11,Ftable |
00003e50  20 20 20 20 20 20 20 20  20 20 3b 72 31 31 20 26  |          ;r11 &|
00003e60  20 72 31 32 20 70 6f 69  6e 74 65 72 73 20 61 72  | r12 pointers ar|
00003e70  65 20 6e 65 65 64 65 64  20 69 6e 20 62 6f 74 68  |e needed in both|
00003e80  20 63 61 73 65 73 0d 15  04 04 0d 15 0e 35 20 6c  | cases.......5 l|
00003e90  64 6d 44 62 20 72 31 31  2c 7b 72 30 2c 72 31 7d  |dmDb r11,{r0,r1}|
00003ea0  20 20 20 20 20 20 20 20  20 20 3b 4c 6f 61 64 20  |          ;Load |
00003eb0  43 6f 75 6e 74 65 72 20  26 20 53 70 65 65 64 0d  |Counter & Speed.|
00003ec0  15 18 29 20 61 64 64 20  20 20 72 30 2c 72 30 2c  |..) add   r0,r0,|
00003ed0  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |#1             ;|
00003ee0  43 6f 75 6e 74 65 72 2b  0d 15 22 35 20 63 6d 70  |Counter+.."5 cmp|
00003ef0  20 20 20 72 30 2c 72 31  20 20 20 20 20 20 20 20  |   r0,r1        |
00003f00  20 20 20 20 20 20 20 20  3b 49 66 20 3e 3d 20 53  |        ;If >= S|
00003f10  70 65 65 64 2c 20 74 68  65 6e 2e 2e 2e 0d 15 2c  |peed, then.....,|
00003f20  4d 20 6d 6f 76 48 73 20  72 30 2c 23 30 20 20 20  |M movHs r0,#0   |
00003f30  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 20  |             ;  |
00003f40  20 20 20 20 72 65 73 65  74 20 43 6f 75 6e 74 65  |    reset Counte|
00003f50  72 20 20 20 20 7c 20 48  53 2c 20 63 61 75 73 65  |r    | HS, cause|
00003f60  20 53 65 74 5f 53 70 65  65 64 0d 15 36 43 20 73  | Set_Speed..6C s|
00003f70  74 72 20 20 20 72 30 2c  5b 72 31 31 2c 23 2d 38  |tr   r0,[r11,#-8|
00003f80  5d 20 20 20 20 20 20 20  20 20 3b 20 20 20 20 20  |]         ;     |
00003f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003fa0  20 20 7c 20 63 6f 75 6c  64 20 73 65 74 0d 15 40  |  | could set..@|
00003fb0  4c 20 62 48 73 20 20 20  76 70 6c 61 79 20 20 20  |L bHs   vplay   |
00003fc0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 20  |             ;  |
00003fd0  20 20 26 20 50 6c 61 79  20 6f 6e 65 20 72 6f 77  |  & Play one row|
00003fe0  21 20 20 20 20 7c 20 53  70 65 65 64 20 3c 20 43  |!    | Speed < C|
00003ff0  6f 75 6e 74 65 72 2e 2e  2e 0d 15 4a 04 0d 15 54  |ounter.....J...T|
00004000  3f 20 62 6c 20 20 20 20  76 65 66 66 65 63 74 73  |? bl    veffects|
00004010  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 57 65  |             ;We|
00004020  6c 6c 2c 20 65 6c 73 65  20 73 75 70 70 6f 72 74  |ll, else support|
00004030  20 74 68 65 20 65 66 66  65 63 74 73 0d 15 5e 16  | the effects..^.|
00004040  20 61 64 64 20 20 20 72  31 32 2c 72 31 32 2c 23  | add   r12,r12,#|
00004050  33 32 0d 15 68 23 20 62  6c 20 20 20 20 76 65 66  |32..h# bl    vef|
00004060  66 65 63 74 73 20 20 20  20 20 20 20 20 20 20 20  |fects           |
00004070  20 20 3b 32 2e 0d 15 72  16 20 61 64 64 20 20 20  |  ;2...r. add   |
00004080  72 31 32 2c 72 31 32 2c  23 33 32 0d 15 7c 23 20  |r12,r12,#32..|# |
00004090  62 6c 20 20 20 20 76 65  66 66 65 63 74 73 20 20  |bl    veffects  |
000040a0  20 20 20 20 20 20 20 20  20 20 20 3b 33 2e 0d 15  |           ;3...|
000040b0  86 16 20 61 64 64 20 20  20 72 31 32 2c 72 31 32  |.. add   r12,r12|
000040c0  2c 23 33 32 0d 15 90 23  20 62 6c 20 20 20 20 76  |,#32...# bl    v|
000040d0  65 66 66 65 63 74 73 20  20 20 20 20 20 20 20 20  |effects         |
000040e0  20 20 20 20 3b 34 2e 0d  15 9a 05 5d 0d 15 a4 0e  |    ;4.....]....|
000040f0  e7 20 56 6f 63 73 3d 38  20 8c 0d 15 ae 0a 5b 4f  |. Vocs=8 .....[O|
00004100  50 54 20 70 0d 15 b8 16  20 61 64 64 20 20 20 72  |PT p.... add   r|
00004110  31 32 2c 72 31 32 2c 23  33 32 0d 15 c2 23 20 62  |12,r12,#32...# b|
00004120  6c 20 20 20 20 76 65 66  66 65 63 74 73 20 20 20  |l    veffects   |
00004130  20 20 20 20 20 20 20 20  20 20 3b 35 2e 0d 15 cc  |          ;5....|
00004140  16 20 61 64 64 20 20 20  72 31 32 2c 72 31 32 2c  |. add   r12,r12,|
00004150  23 33 32 0d 15 d6 23 20  62 6c 20 20 20 20 76 65  |#32...# bl    ve|
00004160  66 66 65 63 74 73 20 20  20 20 20 20 20 20 20 20  |ffects          |
00004170  20 20 20 3b 36 2e 0d 15  e0 16 20 61 64 64 20 20  |   ;6..... add  |
00004180  20 72 31 32 2c 72 31 32  2c 23 33 32 0d 15 ea 23  | r12,r12,#32...#|
00004190  20 62 6c 20 20 20 20 76  65 66 66 65 63 74 73 20  | bl    veffects |
000041a0  20 20 20 20 20 20 20 20  20 20 20 20 3b 37 2e 0d  |            ;7..|
000041b0  15 f4 16 20 61 64 64 20  20 20 72 31 32 2c 72 31  |... add   r12,r1|
000041c0  32 2c 23 33 32 0d 15 fe  23 20 62 6c 20 20 20 20  |2,#32...# bl    |
000041d0  76 65 66 66 65 63 74 73  20 20 20 20 20 20 20 20  |veffects        |
000041e0  20 20 20 20 20 3b 38 2e  0d 16 08 05 5d 0d 16 12  |     ;8.....]...|
000041f0  05 cd 0d 16 1c 0a 5b 4f  50 54 20 70 0d 16 26 27  |......[OPT p..&'|
00004200  20 6c 64 6d 66 64 20 72  31 33 21 2c 7b 72 31 2d  | ldmfd r13!,{r1-|
00004210  72 31 31 2c 70 63 7d 20  20 20 20 20 3b 52 65 74  |r11,pc}     ;Ret|
00004220  75 72 6e 0d 16 30 05 20  0d 16 3a 34 3b 2a 2a 2a  |urn..0. ..:4;***|
00004230  20 50 4c 41 59 20 ee 45  20 50 41 54 54 45 52 4e  | PLAY .E PATTERN|
00004240  2d 50 4f 53 49 54 49 4f  4e 20 28 41 4c 4c 20 34  |-POSITION (ALL 4|
00004250  2f 38 20 43 48 41 4e 4e  45 4c 53 29 0d 16 44 04  |/8 CHANNELS)..D.|
00004260  0d 16 4e 0a 2e 76 70 6c  61 79 0d 16 58 10 20 6d  |..N..vplay..X. m|
00004270  6f 76 20 20 20 72 30 2c  23 31 0d 16 62 3c 20 73  |ov   r0,#1..b< s|
00004280  74 72 42 20 20 72 30 2c  49 6e 74 46 6c 61 67 20  |trB  r0,IntFlag |
00004290  20 20 20 20 20 20 20 20  20 20 3b 53 65 74 20 46  |          ;Set F|
000042a0  69 6c 6c 65 72 2d 49 6e  74 65 72 75 70 74 65 64  |iller-Interupted|
000042b0  2d 46 6c 61 67 21 0d 16  6c 17 20 61 64 72 20 20  |-Flag!..l. adr  |
000042c0  20 72 36 2c 52 65 67 69  73 74 65 72 73 0d 16 76  | r6,Registers..v|
000042d0  39 20 6c 64 6d 49 61 20  72 36 2c 7b 72 37 2d 72  |9 ldmIa r6,{r7-r|
000042e0  39 7d 20 20 20 20 20 20  20 20 20 20 20 3b 4c 6f  |9}           ;Lo|
000042f0  61 64 20 33 20 77 6f 72  6b 69 6e 67 20 72 65 67  |ad 3 working reg|
00004300  69 73 74 65 72 73 0d 16  80 14 20 61 64 72 20 20  |isters.... adr  |
00004310  20 72 31 30 2c 54 72 61  63 6b 0d 16 8a 04 0d 16  | r10,Track......|
00004320  94 23 20 62 6c 20 20 20  20 76 63 68 61 6e 6e 65  |.# bl    vchanne|
00004330  6c 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 31  |l             ;1|
00004340  2e 0d 16 9e 16 20 61 64  64 20 20 20 72 31 32 2c  |..... add   r12,|
00004350  72 31 32 2c 23 33 32 0d  16 a8 23 20 62 6c 20 20  |r12,#32...# bl  |
00004360  20 20 76 63 68 61 6e 6e  65 6c 20 20 20 20 20 20  |  vchannel      |
00004370  20 20 20 20 20 20 20 3b  32 2e 0d 16 b2 16 20 61  |       ;2..... a|
00004380  64 64 20 20 20 72 31 32  2c 72 31 32 2c 23 33 32  |dd   r12,r12,#32|
00004390  0d 16 bc 23 20 62 6c 20  20 20 20 76 63 68 61 6e  |...# bl    vchan|
000043a0  6e 65 6c 20 20 20 20 20  20 20 20 20 20 20 20 20  |nel             |
000043b0  3b 33 2e 0d 16 c6 16 20  61 64 64 20 20 20 72 31  |;3..... add   r1|
000043c0  32 2c 72 31 32 2c 23 33  32 0d 16 d0 23 20 62 6c  |2,r12,#32...# bl|
000043d0  20 20 20 20 76 63 68 61  6e 6e 65 6c 20 20 20 20  |    vchannel    |
000043e0  20 20 20 20 20 20 20 20  20 3b 34 2e 0d 16 da 05  |         ;4.....|
000043f0  5d 0d 16 e4 0e e7 20 56  6f 63 73 3d 38 20 8c 0d  |]..... Vocs=8 ..|
00004400  16 ee 0a 5b 4f 50 54 20  70 0d 16 f8 16 20 61 64  |...[OPT p.... ad|
00004410  64 20 20 20 72 31 32 2c  72 31 32 2c 23 33 32 0d  |d   r12,r12,#32.|
00004420  17 02 23 20 62 6c 20 20  20 20 76 63 68 61 6e 6e  |..# bl    vchann|
00004430  65 6c 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |el             ;|
00004440  35 2e 0d 17 0c 16 20 61  64 64 20 20 20 72 31 32  |5..... add   r12|
00004450  2c 72 31 32 2c 23 33 32  0d 17 16 23 20 62 6c 20  |,r12,#32...# bl |
00004460  20 20 20 76 63 68 61 6e  6e 65 6c 20 20 20 20 20  |   vchannel     |
00004470  20 20 20 20 20 20 20 20  3b 36 2e 0d 17 20 16 20  |        ;6... . |
00004480  61 64 64 20 20 20 72 31  32 2c 72 31 32 2c 23 33  |add   r12,r12,#3|
00004490  32 0d 17 2a 23 20 62 6c  20 20 20 20 76 63 68 61  |2..*# bl    vcha|
000044a0  6e 6e 65 6c 20 20 20 20  20 20 20 20 20 20 20 20  |nnel            |
000044b0  20 3b 37 2e 0d 17 34 16  20 61 64 64 20 20 20 72  | ;7...4. add   r|
000044c0  31 32 2c 72 31 32 2c 23  33 32 0d 17 3e 23 20 62  |12,r12,#32..># b|
000044d0  6c 20 20 20 20 76 63 68  61 6e 6e 65 6c 20 20 20  |l    vchannel   |
000044e0  20 20 20 20 20 20 20 20  20 20 3b 38 2e 0d 17 48  |          ;8...H|
000044f0  05 5d 0d 17 52 05 cd 0d  17 5c 0a 5b 4f 50 54 20  |.]..R....\.[OPT |
00004500  70 0d 17 66 04 0d 17 70  41 20 73 75 62 53 20 20  |p..f...pA subS  |
00004510  72 37 2c 72 37 2c 23 31  20 20 20 20 20 20 20 20  |r7,r7,#1        |
00004520  20 20 20 20 20 3b 50 61  74 74 65 72 6e 5f 43 6f  |     ;Pattern_Co|
00004530  75 6e 74 65 72 20 2d 20  31 2c 20 69 73 20 69 74  |unter - 1, is it|
00004540  20 7a 65 72 6f 3f 0d 17  7a 31 20 73 74 6d 4e 65  | zero?..z1 stmNe|
00004550  49 61 20 72 36 2c 7b 72  37 2d 72 38 7d 20 20 20  |Ia r6,{r7-r8}   |
00004560  20 20 20 20 20 20 3b 4e  6f 74 20 7a 65 72 6f 20  |      ;Not zero |
00004570  79 65 74 2c 20 73 6f 0d  17 84 48 20 6c 64 6d 4e  |yet, so...H ldmN|
00004580  65 46 64 20 72 31 33 21  2c 7b 72 31 2d 72 31 31  |eFd r13!,{r1-r11|
00004590  2c 70 63 7d 20 20 20 3b  20 64 6f 6e 27 74 20 70  |,pc}   ; don't p|
000045a0  6c 61 79 20 6e 65 77 20  50 61 74 74 65 72 6e 2c  |lay new Pattern,|
000045b0  20 52 65 74 75 72 6e 20  69 6e 73 74 65 61 64 0d  | Return instead.|
000045c0  17 8e 04 0d 17 98 48 20  6d 6f 76 20 20 20 72 37  |......H mov   r7|
000045d0  2c 23 36 34 20 20 20 20  20 20 20 20 20 20 20 20  |,#64            |
000045e0  20 20 20 3b 57 65 6c 6c  2c 20 6e 65 77 20 50 61  |   ;Well, new Pa|
000045f0  74 74 65 72 6e 20 62 65  67 69 6e 73 2c 20 77 69  |ttern begins, wi|
00004600  74 68 20 43 6f 75 6e 74  3d 36 34 0d 17 a2 39 20  |th Count=64...9 |
00004610  6c 64 72 42 20 20 72 30  2c 5b 72 39 2c 23 31 5d  |ldrB  r0,[r9,#1]|
00004620  21 20 20 20 20 20 20 20  20 20 20 3b 41 6e 64 20  |!          ;And |
00004630  67 65 74 20 6e 65 78 74  20 50 61 74 74 65 72 6e  |get next Pattern|
00004640  20 4e 72 2e 0d 17 ac 31  20 63 6d 70 20 20 20 72  | Nr....1 cmp   r|
00004650  30 2c 23 26 66 66 20 20  20 20 20 20 20 20 20 20  |0,#&ff          |
00004660  20 20 20 20 3b 45 6e 64  20 6f 66 20 53 65 71 75  |    ;End of Sequ|
00004670  65 6e 63 65 3f 0d 17 b6  41 20 6c 64 72 45 71 20  |ence?...A ldrEq |
00004680  72 39 2c 5b 72 31 30 2c  23 32 34 5d 20 20 20 20  |r9,[r10,#24]    |
00004690  20 20 20 20 20 3b 20 59  65 61 68 20 2d 3e 20 52  |     ; Yeah -> R|
000046a0  65 73 65 74 20 53 65 71  75 65 6e 63 65 20 50 6f  |eset Sequence Po|
000046b0  69 6e 74 65 72 2c 0d 17  c0 42 20 6c 64 72 45 71  |inter,...B ldrEq|
000046c0  42 20 30 2c 5b 72 39 5d  20 20 20 20 20 20 20 20  |B 0,[r9]        |
000046d0  20 20 20 20 20 20 3b 20  20 20 20 20 20 20 20 20  |      ;         |
000046e0  74 68 61 74 20 6d 65 61  6e 73 20 72 65 73 74 61  |that means resta|
000046f0  72 74 20 53 6f 6e 67 21  0d 17 ca 35 20 6c 64 72  |rt Song!...5 ldr|
00004700  20 20 20 72 38 2c 5b 72  31 30 2c 23 32 38 5d 20  |   r8,[r10,#28] |
00004710  20 20 20 20 20 20 20 20  3b 41 64 64 72 65 73 73  |        ;Address|
00004720  20 50 61 74 74 65 72 6e  73 74 61 72 74 0d 17 d4  | Patternstart...|
00004730  3e 20 61 64 64 20 20 20  72 38 2c 72 38 2c 72 30  |> add   r8,r8,r0|
00004740  2c 6c 73 6c 23 31 30 2d  28 56 6f 63 73 3d 38 29  |,lsl#10-(Vocs=8)|
00004750  20 20 20 20 3b 2b 20 4e  72 2a 31 30 32 34 20 28  |    ;+ Nr*1024 (|
00004760  6f 72 20 4e 72 2a 32 30  34 38 29 0d 17 de 15 20  |or Nr*2048).... |
00004770  73 74 6d 49 61 20 72 36  2c 7b 72 37 2d 72 39 7d  |stmIa r6,{r7-r9}|
00004780  0d 17 e8 27 20 6c 64 6d  66 64 20 72 31 33 21 2c  |...' ldmfd r13!,|
00004790  7b 72 31 2d 72 31 31 2c  70 63 7d 20 20 20 20 20  |{r1-r11,pc}     |
000047a0  3b 52 65 74 75 72 6e 0d  17 f2 04 0d 17 fc 2f 3b  |;Return......./;|
000047b0  2a 2a 2a 20 53 55 50 50  4c 59 20 ee 45 20 43 48  |*** SUPPLY .E CH|
000047c0  41 4e 4e 45 4c 20 57 49  54 48 20 c7 96 20 49 4e  |ANNEL WITH .. IN|
000047d0  46 4f 52 4d 41 54 49 4f  4e 53 0d 18 06 04 0d 18  |FORMATIONS......|
000047e0  10 0d 2e 76 63 68 61 6e  6e 65 6c 0d 18 1a 48 20  |...vchannel...H |
000047f0  6c 64 72 20 20 20 72 31  2c 5b 72 38 5d 2c 23 34  |ldr   r1,[r8],#4|
00004800  20 20 20 20 20 20 20 20  20 20 20 3b 50 61 74 74  |           ;Patt|
00004810  65 72 6e 20 4c 57 6f 72  64 20 6f 66 20 63 75 72  |ern LWord of cur|
00004820  72 65 6e 74 20 50 61 74  74 5f 50 6f 73 20 26 20  |rent Patt_Pos & |
00004830  49 4e 43 0d 18 24 04 0d  18 2e 2f 20 6c 64 72 42  |INC..$..../ ldrB|
00004840  20 20 72 32 2c 5b 72 31  32 2c 23 33 30 5d 20 20  |  r2,[r12,#30]  |
00004850  20 20 20 20 20 20 20 3b  49 73 20 53 6f 75 6e 64  |       ;Is Sound|
00004860  46 58 20 6f 6e 3f 0d 18  38 10 20 63 6d 70 20 20  |FX on?..8. cmp  |
00004870  20 72 32 2c 23 30 0d 18  42 26 20 62 45 71 20 20  | r2,#0..B& bEq  |
00004880  20 76 72 75 6c 65 20 20  20 20 20 20 20 20 20 20  | vrule          |
00004890  20 20 20 20 20 20 3b 4e  6f 2e 2e 2e 0d 18 4c 16  |      ;No.....L.|
000048a0  20 6c 64 72 20 20 20 72  32 2c 5b 72 31 32 2c 23  | ldr   r2,[r12,#|
000048b0  34 5d 0d 18 56 41 20 63  6d 70 20 20 20 72 32 2c  |4]..VA cmp   r2,|
000048c0  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
000048d0  20 20 3b 59 65 73 2c 20  62 75 74 20 69 73 20 73  |  ;Yes, but is s|
000048e0  61 6d 70 6c 65 20 73 74  69 6c 6c 20 61 63 74 69  |ample still acti|
000048f0  76 65 3f 0d 18 60 31 20  73 74 72 45 71 42 20 32  |ve?..`1 strEqB 2|
00004900  2c 5b 72 31 32 2c 23 33  30 5d 20 20 20 20 20 20  |,[r12,#30]      |
00004910  20 20 20 3b 4e 6f 2c 20  73 6f 20 63 61 6e 63 65  |   ;No, so cance|
00004920  6c 20 46 58 0d 18 6a 11  20 6d 6f 76 20 20 20 70  |l FX..j. mov   p|
00004930  63 2c 72 31 34 0d 18 74  04 0d 18 7e 0a 2e 76 72  |c,r14..t...~..vr|
00004940  75 6c 65 0d 18 88 3b 20  6d 6f 76 53 20 20 72 30  |ule...; movS  r0|
00004950  2c 72 31 2c 6c 73 72 23  32 34 20 20 20 20 20 20  |,r1,lsr#24      |
00004960  20 20 20 3b 49 73 6f 6c  61 74 65 20 54 6f 6e 65  |   ;Isolate Tone|
00004970  20 26 20 49 73 20 69 74  20 7a 65 72 6f 3f 0d 18  | & Is it zero?..|
00004980  92 46 20 62 45 71 20 20  20 76 63 6f 6d 6d 73 20  |.F bEq   vcomms |
00004990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4e  |              ;N|
000049a0  6f 20 54 6f 6e 65 20 2d  3e 20 50 65 72 68 61 70  |o Tone -> Perhap|
000049b0  73 20 73 74 69 6c 6c 20  61 20 43 6f 6d 6d 61 6e  |s still a Comman|
000049c0  64 2e 2e 2e 0d 18 9c 04  0d 18 a6 4b 20 73 74 72  |d..........K str|
000049d0  42 20 20 72 30 2c 5b 72  31 32 2c 23 33 31 5d 20  |B  r0,[r12,#31] |
000049e0  20 20 20 20 20 20 20 20  3b 53 74 6f 72 65 20 6c  |        ;Store l|
000049f0  65 67 61 6c 20 54 6f 6e  65 20 66 6f 72 20 70 6f  |egal Tone for po|
00004a00  73 73 2e 20 41 72 70 65  67 67 69 6f 20 65 66 66  |ss. Arpeggio eff|
00004a10  65 63 74 0d 18 b0 49 20  6c 64 72 20 20 20 72 30  |ect...I ldr   r0|
00004a20  2c 5b 72 31 31 2c 72 30  2c 6c 73 6c 23 32 5d 20  |,[r11,r0,lsl#2] |
00004a30  20 20 20 3b 47 65 74 20  65 71 75 69 76 61 6c 65  |   ;Get equivale|
00004a40  6e 74 20 46 72 65 71 75  65 6e 63 79 20 66 72 6f  |nt Frequency fro|
00004a50  6d 20 72 31 31 3d 66 54  61 62 6c 65 0d 18 ba 2c  |m r11=fTable...,|
00004a60  20 73 74 72 20 20 20 72  30 2c 5b 72 31 32 2c 23  | str   r0,[r12,#|
00004a70  34 5d 20 20 20 20 20 20  20 20 20 20 3b 45 6e 74  |4]          ;Ent|
00004a80  65 72 20 50 69 74 63 68  0d 18 c4 3f 20 61 6e 64  |er Pitch...? and|
00004a90  53 20 20 72 30 2c 72 31  2c 23 26 66 66 20 3c 3c  |S  r0,r1,#&ff <<|
00004aa0  31 36 20 20 20 20 20 20  3b 49 73 6f 6c 61 74 65  |16      ;Isolate|
00004ab0  20 49 6e 73 74 72 75 6d  65 6e 74 2d 42 79 74 65  | Instrument-Byte|
00004ac0  2c 20 7a 65 72 6f 3f 0d  18 ce 49 20 6c 64 72 45  |, zero?...I ldrE|
00004ad0  71 20 72 30 2c 5b 72 31  32 2c 23 32 30 5d 20 20  |q r0,[r12,#20]  |
00004ae0  20 20 20 20 20 20 20 3b  20 59 20 2d 3e 20 47 65  |       ; Y -> Ge|
00004af0  74 20 6f 6c 64 20 52 65  70 41 74 20 28 70 65 72  |t old RepAt (per|
00004b00  68 61 70 73 20 61 20 52  65 70 54 6f 6e 65 21 29  |haps a RepTone!)|
00004b10  0d 18 d8 4c 20 73 74 72  45 71 20 72 30 2c 5b 72  |...L strEq r0,[r|
00004b20  31 32 2c 23 30 30 5d 20  20 20 20 20 20 20 20 20  |12,#00]         |
00004b30  3b 20 20 20 20 26 20 53  65 74 20 61 73 20 6e 65  |;    & Set as ne|
00004b40  77 20 50 6f 73 20 28 73  61 6d 65 20 49 6e 73 74  |w Pos (same Inst|
00004b50  20 6f 6e 63 65 20 61 67  61 69 6e 29 0d 18 e2 11  | once again)....|
00004b60  20 62 45 71 20 20 20 76  63 6f 6d 6d 73 0d 18 ec  | bEq   vcomms...|
00004b70  47 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |G               |
00004b80  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 45 6c  |             ;El|
00004b90  73 65 20 70 6f 69 6e 74  20 74 6f 20 49 6e 73 74  |se point to Inst|
00004ba0  50 6f 6f 6c 20 3d 20 54  72 61 63 6b 2b 49 6e 73  |Pool = Track+Ins|
00004bb0  74 2a 33 32 0d 18 f6 4d  20 61 64 64 20 20 20 72  |t*32...M add   r|
00004bc0  32 2c 72 31 30 2c 72 30  2c 6c 73 72 23 31 31 20  |2,r10,r0,lsr#11 |
00004bd0  20 20 20 20 3b 6c 73 72  23 31 36 20 66 6f 72 20  |    ;lsr#16 for |
00004be0  6c 6f 77 62 79 74 65 20  26 20 6c 73 6c 23 35 20  |lowbyte & lsl#5 |
00004bf0  66 6f 72 20 2a 33 32 20  3d 3e 20 6c 73 72 23 31  |for *32 => lsr#1|
00004c00  31 0d 19 00 42 20 6c 64  6d 49 61 20 72 32 2c 7b  |1...B ldmIa r2,{|
00004c10  72 30 2c 72 32 2d 72 35  7d 20 20 20 20 20 20 20  |r0,r2-r5}       |
00004c20  20 3b 52 65 61 64 20 61  6c 6c 20 35 20 49 6e 73  | ;Read all 5 Ins|
00004c30  74 50 6f 6f 6c 20 57 6f  72 64 73 20 61 74 20 6f  |tPool Words at o|
00004c40  6e 63 65 0d 19 0a 35 20  73 74 72 20 20 20 72 30  |nce...5 str   r0|
00004c50  2c 5b 72 31 32 2c 23 20  38 5d 20 20 20 20 20 20  |,[r12,# 8]      |
00004c60  20 20 20 3b 45 6e 74 65  72 20 53 61 6d 70 6c 65  |   ;Enter Sample|
00004c70  20 41 64 64 72 65 73 73  0d 19 14 2d 20 73 74 72  | Address...- str|
00004c80  20 20 20 72 33 2c 5b 72  31 32 2c 23 31 36 5d 20  |   r3,[r12,#16] |
00004c90  20 20 20 20 20 20 20 20  3b 45 6e 74 65 72 20 56  |        ;Enter V|
00004ca0  6f 6c 75 6d 65 0d 19 1e  4c 20 6d 6f 76 53 20 20  |olume...L movS  |
00004cb0  72 30 2c 72 34 2c 6c 73  6c 23 31 36 20 20 20 20  |r0,r4,lsl#16    |
00004cc0  20 20 20 20 20 3b 50 6f  73 3d 52 65 70 41 74 20  |     ;Pos=RepAt |
00004cd0  28 69 6e 20 31 36 2d 66  69 78 70 6f 69 6e 74 29  |(in 16-fixpoint)|
00004ce0  2c 20 62 75 74 20 69 73  20 69 74 20 7a 65 72 6f  |, but is it zero|
00004cf0  3f 0d 19 28 4c 20 61 64  64 4e 65 20 72 32 2c 72  |?..(L addNe r2,r|
00004d00  34 2c 72 35 20 20 20 20  20 20 20 20 20 20 20 20  |4,r5            |
00004d10  20 3b 20 4e 6f 20 2d 3e  20 4c 65 6e 20 28 61 62  | ; No -> Len (ab|
00004d20  73 6f 6c 75 74 65 20 66  72 6f 6d 20 30 29 20 3d  |solute from 0) =|
00004d30  20 52 65 70 41 74 2b 52  65 70 4c 65 6e 0d 19 32  | RepAt+RepLen..2|
00004d40  4a 20 6d 6f 76 4e 65 20  72 34 2c 72 30 20 20 20  |J movNe r4,r0   |
00004d50  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 20  |             ;  |
00004d60  20 20 2d 3e 20 48 65 61  64 20 4f 66 66 73 65 74  |  -> Head Offset|
00004d70  20 52 65 70 41 74 20 3d  20 66 69 78 70 6f 69 6e  | RepAt = fixpoin|
00004d80  74 20 52 65 70 41 74 0d  19 3c 2a 20 73 74 72 20  |t RepAt..<* str |
00004d90  20 20 72 30 2c 5b 72 31  32 2c 23 20 30 5d 20 20  |  r0,[r12,# 0]  |
00004da0  20 20 20 20 20 20 20 3b  45 6e 74 65 72 20 50 6f  |       ;Enter Po|
00004db0  73 0d 19 46 2d 20 73 74  72 20 20 20 72 32 2c 5b  |s..F- str   r2,[|
00004dc0  72 31 32 2c 23 31 32 5d  20 20 20 20 20 20 20 20  |r12,#12]        |
00004dd0  20 3b 45 6e 74 65 72 20  4c 65 6e 67 74 68 0d 19  | ;Enter Length..|
00004de0  50 2c 20 73 74 72 20 20  20 72 34 2c 5b 72 31 32  |P, str   r4,[r12|
00004df0  2c 23 32 30 5d 20 20 20  20 20 20 20 20 20 3b 45  |,#20]         ;E|
00004e00  6e 74 65 72 20 52 65 70  41 74 0d 19 5a 04 0d 19  |nter RepAt..Z...|
00004e10  64 0b 2e 76 63 6f 6d 6d  73 0d 19 6e 43 20 61 6e  |d..vcomms..nC an|
00004e20  64 20 20 20 72 30 2c 72  31 2c 23 26 30 66 20 3c  |d   r0,r1,#&0f <|
00004e30  3c 38 20 20 20 20 20 20  20 3b 49 73 6f 6c 61 74  |<8       ;Isolat|
00004e40  65 20 43 6f 6d 6d 61 6e  64 2d 4e 69 62 62 6c 65  |e Command-Nibble|
00004e50  20 66 72 6f 6d 20 44 61  74 61 4c 57 0d 19 78 31  | from DataLW..x1|
00004e60  20 61 6e 64 20 20 20 72  32 2c 72 31 2c 23 26 66  | and   r2,r1,#&f|
00004e70  66 20 20 20 20 20 20 20  20 20 20 20 3b 49 73 6f  |f           ;Iso|
00004e80  6c 61 74 65 20 49 6e 66  6f 42 79 74 65 0d 19 82  |late InfoByte...|
00004e90  4d 20 6c 64 72 20 20 20  72 33 2c 5b 70 63 2c 72  |M ldr   r3,[pc,r|
00004ea0  30 2c 6c 73 72 23 36 5d  20 20 20 20 20 3b 6c 73  |0,lsr#6]     ;ls|
00004eb0  72 23 38 20 66 6f 72 20  4e 69 62 62 6c 65 20 69  |r#8 for Nibble i|
00004ec0  6e 74 6f 20 6c 6f 77 62  79 74 65 20 26 20 6c 73  |nto lowbyte & ls|
00004ed0  6c 23 32 20 66 6f 72 20  2a 34 0d 19 8c 13 20 61  |l#2 for *4.... a|
00004ee0  64 64 20 20 20 70 63 2c  70 63 2c 72 33 0d 19 96  |dd   pc,pc,r3...|
00004ef0  04 0d 19 a0 2c 20 64 63  64 20 20 20 76 65 66 2d  |...., dcd   vef-|
00004f00  76 6f 66 32 20 20 20 20  20 20 20 20 20 20 20 20  |vof2            |
00004f10  20 3b 45 66 66 65 63 74  73 20 30 2e 2e 0d 19 aa  | ;Effects 0.....|
00004f20  09 2e 76 6f 66 32 0d 19  b4 22 20 64 63 64 20 20  |..vof2..." dcd  |
00004f30  20 76 65 66 2d 76 6f 66  32 20 20 20 20 20 20 20  | vef-vof2       |
00004f40  20 20 20 20 20 20 3b 31  0d 19 be 22 20 64 63 64  |      ;1..." dcd|
00004f50  20 20 20 76 65 66 2d 76  6f 66 32 20 20 20 20 20  |   vef-vof2     |
00004f60  20 20 20 20 20 20 20 20  3b 32 0d 19 c8 22 20 64  |        ;2..." d|
00004f70  63 64 20 20 20 76 65 66  2d 76 6f 66 32 20 20 20  |cd   vef-vof2   |
00004f80  20 20 20 20 20 20 20 20  20 20 3b 33 0d 19 d2 22  |          ;3..."|
00004f90  20 64 63 64 20 20 20 76  65 66 2d 76 6f 66 32 20  | dcd   vef-vof2 |
00004fa0  20 20 20 20 20 20 20 20  20 20 20 20 3b 34 0d 19  |            ;4..|
00004fb0  dc 22 20 64 63 64 20 20  20 76 65 66 2d 76 6f 66  |." dcd   vef-vof|
00004fc0  32 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 35  |2             ;5|
00004fd0  0d 19 e6 22 20 64 63 64  20 20 20 76 65 66 2d 76  |..." dcd   vef-v|
00004fe0  6f 66 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |of2             |
00004ff0  3b 36 0d 19 f0 34 20 64  63 64 20 20 20 76 73 74  |;6...4 dcd   vst|
00005000  65 72 65 6f 70 6f 73 2d  76 6f 66 32 20 20 20 20  |ereopos-vof2    |
00005010  20 20 3b 20 37 20 3d 20  53 65 74 20 53 74 65 72  |  ; 7 = Set Ster|
00005020  65 6f 20 50 6f 73 0d 19  fa 34 20 64 63 64 20 20  |eo Pos...4 dcd  |
00005030  20 76 61 75 74 6f 76 6f  6c 75 70 2d 76 6f 66 32  | vautovolup-vof2|
00005040  20 20 20 20 20 20 3b 20  38 20 3d 20 41 75 74 6f  |      ; 8 = Auto|
00005050  20 56 6f 6c 75 6d 65 20  75 70 0d 1a 04 36 20 64  | Volume up...6 d|
00005060  63 64 20 20 20 76 61 75  74 6f 76 6f 6c 64 6f 77  |cd   vautovoldow|
00005070  6e 2d 76 6f 66 32 20 20  20 20 3b 20 39 20 3d 20  |n-vof2    ; 9 = |
00005080  41 75 74 6f 20 56 6f 6c  75 6d 65 20 64 6f 77 6e  |Auto Volume down|
00005090  0d 1a 0e 33 20 64 63 64  20 20 20 76 61 75 74 6f  |...3 dcd   vauto|
000050a0  61 72 63 75 70 2d 76 6f  66 32 20 20 20 20 20 20  |arcup-vof2      |
000050b0  3b 20 41 20 3d 20 41 75  74 6f 20 50 69 74 63 68  |; A = Auto Pitch|
000050c0  20 75 70 0d 1a 18 35 20  64 63 64 20 20 20 76 61  | up...5 dcd   va|
000050d0  75 74 6f 61 72 63 64 6f  77 6e 2d 76 6f 66 32 20  |utoarcdown-vof2 |
000050e0  20 20 20 3b 20 42 20 3d  20 41 75 74 6f 20 50 69  |   ; B = Auto Pi|
000050f0  74 63 68 20 64 6f 77 6e  0d 1a 22 30 20 64 63 64  |tch down.."0 dcd|
00005100  20 20 20 76 73 65 74 76  6f 6c 2d 76 6f 66 32 20  |   vsetvol-vof2 |
00005110  20 20 20 20 20 20 20 20  3b 20 43 20 3d 20 53 65  |        ; C = Se|
00005120  74 20 56 6f 6c 75 6d 65  0d 1a 2c 33 20 64 63 64  |t Volume..,3 dcd|
00005130  20 20 20 76 70 61 74 74  62 72 65 61 6b 2d 76 6f  |   vpattbreak-vo|
00005140  66 32 20 20 20 20 20 20  3b 20 44 20 3d 20 50 61  |f2      ; D = Pa|
00005150  74 74 65 72 6e 20 42 72  65 61 6b 0d 1a 36 34 20  |ttern Break..64 |
00005160  64 63 64 20 20 20 76 6e  6f 70 2d 76 6f 66 32 20  |dcd   vnop-vof2 |
00005170  20 20 20 20 20 20 20 20  20 20 20 3b 20 45 20 3d  |           ; E =|
00005180  20 28 4e 6f 74 20 75 73  65 64 20 79 65 74 29 0d  | (Not used yet).|
00005190  1a 40 2f 20 64 63 64 20  20 20 76 73 65 74 73 70  |.@/ dcd   vsetsp|
000051a0  65 65 64 2d 76 6f 66 32  20 20 20 20 20 20 20 3b  |eed-vof2       ;|
000051b0  20 46 20 3d 20 53 65 74  20 53 70 65 65 64 0d 1a  | F = Set Speed..|
000051c0  4a 04 0d 1a 54 4d 2e 76  65 66 20 20 20 20 20 20  |J...TM.vef      |
000051d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000051e0  20 20 3b 45 66 66 65 63  74 73 2c 20 6e 65 65 64  |  ;Effects, need|
000051f0  6e 27 74 20 74 6f 20 62  65 20 64 6f 6e 65 20 68  |n't to be done h|
00005200  65 72 65 2c 20 62 75 74  20 6c 61 74 65 72 21 0d  |ere, but later!.|
00005210  1a 5e 3c 20 73 74 72 42  20 20 72 32 2c 5b 72 31  |.^< strB  r2,[r1|
00005220  32 2c 23 32 38 5d 20 20  20 20 20 20 20 20 20 3b  |2,#28]         ;|
00005230  53 74 6f 72 65 20 49 6e  66 6f 42 79 74 65 2c 20  |Store InfoByte, |
00005240  66 6f 72 20 45 66 66 65  63 74 73 0d 1a 68 16 20  |for Effects..h. |
00005250  6d 6f 76 20 20 20 72 30  2c 72 30 2c 6c 73 72 23  |mov   r0,r0,lsr#|
00005260  38 0d 1a 72 3c 20 73 74  72 42 20 20 72 30 2c 5b  |8..r< strB  r0,[|
00005270  72 31 32 2c 23 32 39 5d  20 20 20 20 20 20 20 20  |r12,#29]        |
00005280  20 3b 53 74 6f 72 65 20  43 6f 6d 6d 42 79 74 65  | ;Store CommByte|
00005290  2c 20 66 6f 72 20 45 66  66 65 63 74 73 0d 1a 7c  |, for Effects..||
000052a0  09 2e 76 6e 6f 70 0d 1a  86 2b 20 6d 6f 76 20 20  |..vnop...+ mov  |
000052b0  20 70 63 2c 72 31 34 20  20 20 20 20 20 20 20 20  | pc,r14         |
000052c0  20 20 20 20 20 20 3b 61  6e 64 20 72 65 74 75 72  |      ;and retur|
000052d0  6e 0d 1a 90 04 0d 1a 9a  0f 2e 76 73 74 65 72 65  |n.........vstere|
000052e0  6f 70 6f 73 0d 1a a4 4d  20 61 64 72 20 20 20 72  |opos...M adr   r|
000052f0  30 2c 48 65 61 64 20 20  20 20 20 20 20 20 20 20  |0,Head          |
00005300  20 20 20 20 3b 47 65 74  20 63 75 72 72 65 6e 74  |    ;Get current|
00005310  20 63 68 61 6e 6e 65 6c  20 6e 75 6d 62 65 72 20  | channel number |
00005320  28 6c 69 74 74 6c 65 20  4f 76 65 72 68 65 61 64  |(little Overhead|
00005330  29 0d 1a ae 14 20 73 75  62 20 20 20 72 30 2c 72  |).... sub   r0,r|
00005340  31 32 2c 72 30 0d 1a b8  35 20 6d 6f 76 20 20 20  |12,r0...5 mov   |
00005350  72 30 2c 72 30 2c 6c 73  72 23 33 20 20 20 20 20  |r0,r0,lsr#3     |
00005360  20 20 20 20 20 3b 81 20  38 3b 20 3d 3e 20 30 2c  |     ;. 8; => 0,|
00005370  34 2c 38 2c 31 32 2c 2e  2e 2e 0d 1a c2 12 20 63  |4,8,12,....... c|
00005380  6d 70 20 20 20 72 30 2c  23 37 2a 34 0d 1a cc 45  |mp   r0,#7*4...E|
00005390  20 6d 6f 76 45 71 20 72  31 2c 20 20 20 23 26 36  | movEq r1,   #&6|
000053a0  30 20 20 20 20 20 20 20  20 20 20 20 3b 53 74 65  |0           ;Ste|
000053b0  72 65 6f 20 49 6d 61 67  65 20 52 65 67 69 73 74  |reo Image Regist|
000053c0  65 72 20 20 20 37 20 20  3d 20 41 64 72 20 26 36  |er   7  = Adr &6|
000053d0  30 0d 1a d6 4d 20 61 64  64 4e 65 20 72 31 2c 72  |0...M addNe r1,r|
000053e0  30 2c 23 26 36 34 20 20  20 20 20 20 20 20 20 20  |0,#&64          |
000053f0  20 3b 53 74 65 72 65 6f  20 49 6d 61 67 65 20 52  | ;Stereo Image R|
00005400  65 67 69 73 74 65 72 73  20 30 2d 36 20 3d 20 41  |egisters 0-6 = A|
00005410  64 72 20 26 36 34 20 75  70 77 61 72 64 73 0d 1a  |dr &64 upwards..|
00005420  e0 17 20 6d 6f 76 20 20  20 72 31 2c 72 31 2c 6c  |.. mov   r1,r1,l|
00005430  73 6c 23 32 34 0d 1a ea  13 20 6f 72 72 20 20 20  |sl#24.... orr   |
00005440  72 31 2c 72 31 2c 72 32  0d 1a f4 17 20 6d 6f 76  |r1,r1,r2.... mov|
00005450  20 20 20 72 32 2c 23 26  33 34 30 30 30 30 30 0d  |   r2,#&3400000.|
00005460  1a fe 12 20 73 74 72 20  20 20 72 31 2c 5b 72 32  |... str   r1,[r2|
00005470  5d 0d 1b 08 05 5d 0d 1b  12 0e e7 20 56 6f 63 73  |]....]..... Vocs|
00005480  3d 34 20 8c 0d 1b 1c 0a  5b 4f 50 54 20 70 0d 1b  |=4 .....[OPT p..|
00005490  26 39 20 63 6d 70 20 20  20 72 30 2c 23 33 2a 34  |&9 cmp   r0,#3*4|
000054a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 45  |              ;E|
000054b0  78 74 72 61 20 41 64 72  20 6f 66 20 49 6d 61 67  |xtra Adr of Imag|
000054c0  65 20 52 65 67 20 37 0d  1b 30 19 20 73 75 62 45  |e Reg 7..0. subE|
000054d0  71 20 72 31 2c 72 31 2c  23 26 31 30 3c 3c 32 34  |q r1,r1,#&10<<24|
000054e0  0d 1b 3a 41 20 61 64 64  4e 65 20 72 31 2c 72 31  |..:A addNe r1,r1|
000054f0  2c 23 26 31 30 3c 3c 32  34 20 20 20 20 20 20 20  |,#&10<<24       |
00005500  3b 57 65 6c 6c 2c 20 73  65 74 20 75 70 20 74 77  |;Well, set up tw|
00005510  69 6e 20 49 6d 61 67 65  20 52 65 67 20 74 6f 6f  |in Image Reg too|
00005520  21 0d 1b 44 12 20 73 74  72 20 20 20 72 31 2c 5b  |!..D. str   r1,[|
00005530  72 32 5d 0d 1b 4e 05 5d  0d 1b 58 05 cd 0d 1b 62  |r2]..N.]..X....b|
00005540  0a 5b 4f 50 54 20 70 0d  1b 6c 11 20 6d 6f 76 20  |.[OPT p..l. mov |
00005550  20 20 70 63 2c 72 31 34  0d 1b 76 04 0d 1b 80 0f  |  pc,r14..v.....|
00005560  2e 76 61 75 74 6f 76 6f  6c 75 70 0d 1b 8a 17 20  |.vautovolup.... |
00005570  73 74 72 42 20 20 72 32  2c 5b 72 31 32 2c 23 32  |strB  r2,[r12,#2|
00005580  34 5d 0d 1b 94 11 20 6d  6f 76 20 20 20 70 63 2c  |4].... mov   pc,|
00005590  72 31 34 0d 1b 9e 11 2e  76 61 75 74 6f 76 6f 6c  |r14.....vautovol|
000055a0  64 6f 77 6e 0d 1b a8 17  20 73 74 72 42 20 20 72  |down.... strB  r|
000055b0  32 2c 5b 72 31 32 2c 23  32 35 5d 0d 1b b2 11 20  |2,[r12,#25].... |
000055c0  6d 6f 76 20 20 20 70 63  2c 72 31 34 0d 1b bc 0f  |mov   pc,r14....|
000055d0  2e 76 61 75 74 6f 61 72  63 75 70 0d 1b c6 17 20  |.vautoarcup.... |
000055e0  73 74 72 42 20 20 72 32  2c 5b 72 31 32 2c 23 32  |strB  r2,[r12,#2|
000055f0  36 5d 0d 1b d0 11 20 6d  6f 76 20 20 20 70 63 2c  |6].... mov   pc,|
00005600  72 31 34 0d 1b da 11 2e  76 61 75 74 6f 61 72 63  |r14.....vautoarc|
00005610  64 6f 77 6e 0d 1b e4 17  20 73 74 72 42 20 20 72  |down.... strB  r|
00005620  32 2c 5b 72 31 32 2c 23  32 37 5d 0d 1b ee 11 20  |2,[r12,#27].... |
00005630  6d 6f 76 20 20 20 70 63  2c 72 31 34 0d 1b f8 04  |mov   pc,r14....|
00005640  0d 1c 02 0c 2e 76 73 65  74 76 6f 6c 0d 1c 0c 3d  |.....vsetvol...=|
00005650  20 73 74 72 20 20 20 72  32 2c 5b 72 31 32 2c 23  | str   r2,[r12,#|
00005660  31 36 5d 20 20 20 20 20  20 20 20 20 3b 45 6e 74  |16]         ;Ent|
00005670  65 72 20 6e 65 77 20 56  6f 6c 75 6d 65 20 69 6e  |er new Volume in|
00005680  74 6f 20 48 65 61 64 65  72 0d 1c 16 11 20 6d 6f  |to Header.... mo|
00005690  76 20 20 20 70 63 2c 72  31 34 0d 1c 20 04 0d 1c  |v   pc,r14.. ...|
000056a0  2a 0f 2e 76 70 61 74 74  62 72 65 61 6b 0d 1c 34  |*..vpattbreak..4|
000056b0  45 20 6d 6f 76 20 20 20  72 37 2c 23 31 20 20 20  |E mov   r7,#1   |
000056c0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 4a 75  |             ;Ju|
000056d0  6d 70 20 74 6f 20 65 6e  64 20 6f 66 20 50 61 74  |mp to end of Pat|
000056e0  74 2c 20 69 65 20 50 61  74 74 5f 43 6f 75 6e 74  |t, ie Patt_Count|
000056f0  3d 31 0d 1c 3e 11 20 6d  6f 76 20 20 20 70 63 2c  |=1..>. mov   pc,|
00005700  72 31 34 0d 1c 48 04 0d  1c 52 0e 2e 76 73 65 74  |r14..H...R..vset|
00005710  73 70 65 65 64 0d 1c 5c  39 20 73 74 72 20 20 20  |speed..\9 str   |
00005720  72 32 2c 56 73 70 65 65  64 20 20 20 20 20 20 20  |r2,Vspeed       |
00005730  20 20 20 20 20 3b 53 65  74 20 6e 65 77 20 28 6f  |     ;Set new (o|
00005740  76 65 72 61 6c 6c 2d 29  20 53 70 65 65 64 0d 1c  |verall-) Speed..|
00005750  66 11 20 6d 6f 76 20 20  20 70 63 2c 72 31 34 0d  |f. mov   pc,r14.|
00005760  1c 70 04 0d 1c 7a 13 3b  3d 3d 3d 3d 20 dc 42 41  |.p...z.;==== .BA|
00005770  59 20 3d 3d 3d 3d 0d 1c  84 04 0d 1c 8e 3e 2e 52  |Y ====.......>.R|
00005780  65 67 69 73 74 65 72 73  20 20 20 20 64 63 64 20  |egisters    dcd |
00005790  36 34 20 20 20 20 20 20  20 20 3b 20 72 37 20 50  |64        ; r7 P|
000057a0  61 74 74 65 72 6e 5f 43  6f 75 6e 74 65 72 20 28  |attern_Counter (|
000057b0  36 34 20 2d 3e 20 31 29  0d 1c 98 43 20 20 20 20  |64 -> 1)...C    |
000057c0  20 20 20 20 20 20 20 20  20 20 64 63 64 20 30 30  |          dcd 00|
000057d0  20 20 20 20 20 20 20 20  3b 20 72 38 20 43 75 72  |        ; r8 Cur|
000057e0  72 65 6e 74 20 50 6f 69  6e 74 65 72 20 69 6e 20  |rent Pointer in |
000057f0  74 68 65 20 50 61 74 74  65 72 6e 0d 1c a2 44 20  |the Pattern...D |
00005800  20 20 20 20 20 20 20 20  20 20 20 20 20 64 63 64  |             dcd|
00005810  20 30 30 20 20 20 20 20  20 20 20 3b 20 72 39 20  | 00        ; r9 |
00005820  43 75 72 72 65 6e 74 20  50 6f 69 6e 74 65 72 20  |Current Pointer |
00005830  69 6e 20 74 68 65 20 53  65 71 75 65 6e 63 65 0d  |in the Sequence.|
00005840  1c ac 05 20 0d 1c b6 4d  2e 56 63 6f 75 6e 74 20  |... ...M.Vcount |
00005850  20 20 20 20 20 20 64 63  64 20 30 20 20 20 20 20  |      dcd 0     |
00005860  20 20 20 20 3b 56 53 79  6e 63 20 43 6f 75 6e 74  |    ;VSync Count|
00005870  65 72 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |er              |
00005880  20 20 7c 4b 65 65 70 20  74 68 65 73 65 20 74 77  |  |Keep these tw|
00005890  6f 0d 1c c0 4a 2e 56 73  70 65 65 64 20 20 20 20  |o...J.Vspeed    |
000058a0  20 20 20 64 63 64 20 36  20 20 20 20 20 20 20 20  |   dcd 6        |
000058b0  20 3b 53 70 65 65 64 20  43 6f 75 6e 74 65 72 20  | ;Speed Counter |
000058c0  28 64 65 66 61 75 6c 74  3d 36 29 20 20 20 20 7c  |(default=6)    ||
000058d0  20 20 3c 20 2e 46 74 61  62 6c 65 0d 1c ca 04 0d  |  < .Ftable.....|
000058e0  1c d4 25 2e 46 74 61 62  6c 65 20 20 20 20 20 20  |..%.Ftable      |
000058f0  20 5d 3a 50 25 2b 3d 39  2a 31 32 2a 34 3a 5b 4f  | ]:P%+=9*12*4:[O|
00005900  50 54 20 70 0d 1c de 0a  2e 54 72 61 63 6b 0d 1c  |PT p.....Track..|
00005910  e8 04 0d 1c f2 3b 3b 53  61 6d 70 6c 65 20 48 65  |.....;;Sample He|
00005920  61 64 20 28 61 74 20 49  6e 73 74 2a 33 32 29 20  |ad (at Inst*32) |
00005930  20 20 23 30 30 20 41 62  73 6f 6c 75 74 65 20 53  |  #00 Absolute S|
00005940  61 6d 70 6c 65 20 41 64  64 72 65 73 73 0d 1c fc  |ample Address...|
00005950  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00005960  20 20 20 20 20 20 3b 20  20 20 20 20 20 23 30 34  |      ;      #04|
00005970  20 4c 65 6e 67 74 68 0d  1d 06 30 20 20 20 20 20  | Length...0     |
00005980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005990  3b 20 20 20 20 20 20 23  30 38 20 56 6f 6c 75 6d  |;      #08 Volum|
000059a0  65 20 30 2d 26 66 66 0d  1d 10 3a 20 20 20 20 20  |e 0-&ff...:     |
000059b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000059c0  3b 20 20 20 20 20 20 23  31 32 20 52 65 70 65 61  |;      #12 Repea|
000059d0  74 41 74 20 61 73 20 42  79 74 65 4f 66 66 73 65  |tAt as ByteOffse|
000059e0  74 0d 1d 1a 2a 20 20 20  20 20 20 20 20 20 20 20  |t...*           |
000059f0  20 20 20 20 20 20 20 20  20 20 3b 20 20 20 20 20  |          ;     |
00005a00  20 23 31 36 20 52 65 70  4c 65 6e 0d 1d 24 33 20  | #16 RepLen..$3 |
00005a10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005a20  20 20 20 20 3b 20 20 20  20 20 20 23 32 30 20 49  |    ;      #20 I|
00005a30  6e 73 74 72 75 6d 65 6e  74 20 4e 61 6d 65 0d 1d  |nstrument Name..|
00005a40  2e 04 0d 1d 38 17 3b 3d  3d 3d 3d 49 4e 49 54 53  |....8.;====INITS|
00005a50  54 4f 52 45 20 3d 3d 3d  3d 0d 1d 42 04 0d 1d 4c  |TORE ====..B...L|
00005a60  10 20 6d 6f 76 20 20 20  72 32 2c 23 30 0d 1d 56  |. mov   r2,#0..V|
00005a70  09 2e 75 61 6c 6c 0d 1d  60 15 20 73 74 72 20 20  |..uall..`. str  |
00005a80  20 72 32 2c 5b 72 30 5d  2c 23 34 0d 1d 6a 10 20  | r2,[r0],#4..j. |
00005a90  63 6d 70 20 20 20 72 30  2c 72 31 0d 1d 74 0f 20  |cmp   r0,r1..t. |
00005aa0  62 4c 6f 20 20 20 75 61  6c 6c 0d 1d 7e 11 20 6d  |bLo   uall..~. m|
00005ab0  6f 76 20 20 20 70 63 2c  72 31 34 0d 1d 88 09 2e  |ov   pc,r14.....|
00005ac0  75 66 69 6e 0d 1d 92 04  0d 1d 9c 07 5d 3a e1 0d  |ufin........]:..|
00005ad0  1d a6 04 0d 1d b0 1b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.......---------|
00005ae0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 1d  |--------------..|
00005af0  ba 1b 32 65 72 20 41 44  52 20 28 6f 6e 6c 79 20  |..2er ADR (only |
00005b00  66 6f 72 77 61 72 64 73  29 0d 1d c4 1b 2d 2d 2d  |forwards)....---|
00005b10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00005b20  2d 2d 2d 2d 0d 1d ce 14  dd 20 a4 61 64 72 28 72  |----..... .adr(r|
00005b30  25 2c 64 65 73 74 25 29  0d 1d d8 13 64 69 73 25  |%,dest%)....dis%|
00005b40  3d 64 65 73 74 25 2d 50  25 2d 38 0d 1d e2 0f e7  |=dest%-P%-8.....|
00005b50  20 70 3d 25 31 30 30 30  20 8c 0d 1d ec 12 20 20  | p=%1000 .....  |
00005b60  64 30 25 3d 30 20 3a 64  31 25 3d 30 0d 1d f6 05  |d0%=0 :d1%=0....|
00005b70  cc 0d 1e 00 13 20 20 e7  20 64 69 73 25 20 80 20  |.....  . dis% . |
00005b80  26 66 20 8c 0d 1e 0a 19  20 20 20 20 64 30 25 3d  |&f .....    d0%=|
00005b90  64 69 73 25 20 80 20 26  30 30 30 46 46 0d 1e 14  |dis% . &000FF...|
00005ba0  19 20 20 20 20 64 31 25  3d 64 69 73 25 20 80 20  |.    d1%=dis% . |
00005bb0  26 46 46 46 30 30 0d 1e  1e 07 20 20 cc 0d 1e 28  |&FFF00....  ...(|
00005bc0  19 20 20 20 20 64 30 25  3d 64 69 73 25 20 80 20  |.    d0%=dis% . |
00005bd0  26 30 30 46 46 46 0d 1e  32 19 20 20 20 20 64 31  |&00FFF..2.    d1|
00005be0  25 3d 64 69 73 25 20 80  20 26 46 46 30 30 30 0d  |%=dis% . &FF000.|
00005bf0  1e 3c 07 20 20 cd 0d 1e  46 37 20 20 e7 20 64 30  |.<.  ...F7  . d0|
00005c00  25 2b 64 31 25 3c 3e 64  69 73 25 20 8c 20 f1 20  |%+d1%<>dis% . . |
00005c10  bd 37 3b 22 46 4e 61 64  72 20 64 6f 65 73 6e 27  |.7;"FNadr doesn'|
00005c20  74 20 73 75 66 66 69 63  65 21 22 3a e0 0d 1e 50  |t suffice!":...P|
00005c30  38 20 20 e7 20 64 30 25  3d 30 20 84 20 64 31 25  |8  . d0%=0 . d1%|
00005c40  3d 30 20 8c 20 f1 20 22  46 4e 61 64 72 20 3a 20  |=0 . . "FNadr : |
00005c50  41 44 52 20 77 6f 75 6c  64 20 64 6f 2e 20 22 3b  |ADR would do. ";|
00005c60  7e 64 69 73 25 0d 1e 5a  05 cd 0d 1e 64 0a 5b 4f  |~dis%..Z....d.[O|
00005c70  50 54 20 70 0d 1e 6e 13  20 61 64 64 20 72 25 2c  |PT p..n. add r%,|
00005c80  70 63 2c 23 64 31 25 0d  1e 78 13 20 61 64 64 20  |pc,#d1%..x. add |
00005c90  72 25 2c 72 25 2c 23 64  30 25 0d 1e 82 08 5d 3d  |r%,r%,#d0%....]=|
00005ca0  22 22 0d ff                                       |""..|
00005ca4