Home » Archimedes archive » Acorn User » AU 1994-04.adf » !WriteDemo_WriteDemo » Modules/ScrollText/Source

Modules/ScrollText/Source

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 » Acorn User » AU 1994-04.adf » !WriteDemo_WriteDemo
Filename: Modules/ScrollText/Source
Read OK:
File size: 371E bytes
Load address: 0000
Exec address: 0000
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM >ScrollText
   20
   30ON ERROR OSCLI"CLOSE":SYS "Hourglass_Smash":ERROR 0,(REPORT$+" (internal error code "+STR$(ERL)+")")
   40
   50module$ = "ScrollText"
   60
   70SYS "Hourglass_On"
   80LIBRARY "<Demo$Dir>.FNconvert"
   90
  100PROCdecode_waveforms
  110
  120SYS "OS_File",13,"<Modules$Dir>."+module$+".Text" TO text_exists%,,,,text_len%
  130SYS "OS_File",13,"<Modules$Dir>."+module$+".Sprites" TO spr_exists%,,,,spr_len%
  140IF text_exists% = 0 THEN ERROR 0,(module$+": Text file not found")
  150IF spr_exists%  = 0 THEN ERROR 0,(module$+": Sprite file not found")
  160PROCassemble
  170PROCinit
  180
  190CASE FNconvert(module$,font%) OF
  200  WHEN 0
  210    OSCLI"SAVE    <Modules$Dir>."+module$+".Module "+STR$~code%+" "+STR$~P%
  220    OSCLI"SETTYPE <Modules$Dir>."+module$+".Module Data"
  230  WHEN -1
  240    ERROR 0,(module$+": Sprite file not found")
  250  OTHERWISE
  260    ERROR 0,(module$+": Sprite width not divisible by 4")
  270ENDCASE
  280
  290SYS "Hourglass_Off"
  300END
  310
  320
  330
  340DEF PROCassemble
  350  len% = (16 * 1024) + spr_len% + text_len%
  360  DIM code% len%
  370  FOR pass% = 8 TO 10 STEP 2
  380    P% = code%
  390    L% = code% + len%
  400    [OPT pass%
  410
  420
  430.init       EQUD  0
  440.frame      EQUD  scroll - code%
  450.end        EQUD  0
  460
  470
  480.scroll     STMFD R13!,{R0-R10,R14}
  490            ADR   R0,font%             ; r0=font address
  500            B     jump_1
  510
  520.font%      FNarray(spr_len%)          ; font sprite data
  530
  540.jump_1     ADR   R1,text%             ; r1=scrolltext address
  550            B     jump_2
  560
  570.text%      FNarray(text_len% + 17)    ; scrolltext data
  580
  590.jump_2     LDR   R2,table_P%          ; r2=waveform table
  600            CMP   R2,#0                ; is it zero ?
  610            ADREQ R2,tables%           ; if so, r2=table 1 address
  620            LDREQ R7,[R2,#0]
  630            ADDEQ R2,R2,R7
  640            STREQ R2,table_P%          ;   store r2
  650            ADREQ R2,max%              ;   get length of table 1
  660            LDREQ R2,[R2,#0]
  670            STREQ R2,max_P%            ;   store it
  680
  690            MOV   R2,R12               ; r2=screen address
  700            MOV   R7,#17               ; r7=number of letters
  710            LDR   R9,let_pos%          ; r9=position in scrolltext
  720
  730            LDR   R10,offset%          ; r10=letter scroll offset
  740            ADD   R10,R10,#4           ; scroll one more word
  750            SUB   R2,R2,R10            ; r2=scr_addr-scroll offset
  760            CMP   R10,#20              ; has a letter scrolled ?
  770            MOVEQ R10,#0               ; if so, scroll offset=0
  780            STR   R10,offset%          ; store offset
  790            BNE   let_start            ; if not, go to 'let_start'
  800
  810            LDR   R4,length%           ; r4=length of scrolltext
  820            LDR   R9,let_pos%          ; r9=position in scrolltext
  830            ADD   R3,R9,#1
  840            CMP   R3,R4                ; have we reached the end ?
  850            MOVGE R3,#17               ; if so, go to start again
  860            STR   R3,let_pos%          ; store pos in scrolltext
  870
  880.let_start  LDR   R4,length%           ; r4=length of scrolltext
  890            ADD   R5,R9,#17            ; r5=pos in scrolltext + 17
  900.to_start   CMP   R5,R4                ; has it exceeded the len
  910            SUBGE R5,R5,R4             ; if so, pos=pos-length
  920            ADDGE R5,R5,#17            ;        pos=pos+17
  930            BGE   to_start             ;        check again
  940            LDRB  R3,[R1,R5]           ; r3=char scrolling in
  950            CMP   R3,#ASC"a"           ; is it a trigger char ?
  960            BLT   let_start2           ; if not go to 'let_start2'
  970
  980            CMP   R3,#ASC(id$(waves%)) ; if a wave character, then
  990            BGT   not_wave
 1000            
 1010            SUB   R6,R3,#ASC"a"        ; get waveform data
 1020            ADR   R4,tables%
 1030            LDR   R5,[R4,R6,LSL#2]
 1040            ADD   R4,R4,R5
 1050            STR   R4,table_P%
 1060            ADR   R4,max%
 1070            LDR   R4,[R4,R6,LSL#2]
 1080            STR   R4,max_P%
 1090            LDR   R4,wave_pos%
 1100            MOV   R4,#0
 1110            STR   R4,wave_pos%
 1120            
 1130.not_wave   LDR   R4,flag%             ; get flag
 1140            RSB   R5,R3,#ASC"z"        ; set appropiate bit
 1150            MOV   R6,#1
 1160            ORR   R4,R4,R6,LSL R5
 1170            STR   R4,flag%             ; store flag
 1180            B     let_start2
 1190
 1200
 1210.max%       FNarray((waves%+1)*4)
 1220
 1230.flag%      EQUD  0
 1240
 1250.tables%    FNarray(wave_data%)
 1260
 1270
 1280.let_start2 CMP   R10,#4               ; is scroll offset=4
 1290            MOVEQ R3,#0                ; if so, wave_pos+=0
 1300            MOVNE R3,#4                ;  else, wave_pos+=4
 1310            LDR   R11,wave_pos%
 1320            ADD   R11,R11,R3
 1330            LDR   R4,max_P%            ; r4=length of wave table
 1340            CMP   R11,R4               ; is wave_pos > this ?
 1350            MOVGE R11,#0               ; if so, wave_pos=0
 1360            STR   R11,wave_pos%        ; store wave_pos
 1370
 1380.let        LDRB  R3,[R1,R9]           ; r3=letter to plot
 1390            ADD   R9,R9,#1             ; increment text position
 1400            LDR   R5,length%           ; is it >= the length ?
 1410            CMP   R9,R5                ; if so, go to the start
 1420            MOVGE R9,#17               ;
 1430            CMP   R3,#ASC"a"           ; is it a trigger char ?
 1440            MOVGE R3,#ASC" "           ; if so, display a space
 1450            CMP   R3,#ASC" "           ; is it invalid char ?
 1460            MOVLT R3,#ASC" "           ; if so, display a space
 1470            SUB   R3,R3,#32            ; character=character-32
 1480            ADD   R8,R0,R3,LSL#9       ; r8=font+(char*16*16*2)
 1490            LDR   R3,table_P%          ; r3=waveform table
 1500            LDR   R4,[R3,R11]          ; get waveform entry
 1510            LDR   R14,max_P%           ; r14=len of waveform table
 1520            SUBS  R11,R11,#4           ; move to next entry
 1530            ADDMI R11,R11,R14          ; if exceeded, ptr=length
 1540            STR   R2,old_scr%          ; store screen address away
 1550            ADD   R2,R2,R4             ; scr=scr+waveform entry
 1560            CMP   R7,#17               ; is this the left letter ?
 1570            BLEQ  left_let             ; if so, call 'left_let'
 1580            BEQ   skip                 ;   go to 'skip'
 1590            CMP   R7,#1                ; is this the right let ?
 1600            BLEQ  right_let            ; if so, call 'right_let'
 1610            BEQ   skip                 ;   go to 'skip'
 1620            BL    whole_let            ; else call 'whole_let'
 1630.skip       LDR   R2,old_scr%          ; r2=old screen address
 1640            ADD   R2,R2,#20            ; move to next screen pos
 1650            SUBS  R7,R7,#1             ; any more letters to do ?
 1660            BNE   let                  ; if so, go to 'let'
 1670            LDR   R11,flag%            ; r11=flag
 1680            LDMFD R13!,{R0-R10,PC}     ; exit
 1690
 1700
 1710.old_scr%   EQUD  0
 1720.wave_pos%  EQUD  0
 1730.table_P%   EQUD  0
 1740.max_P%     EQUD  0
 1750.let_pos%   EQUD  0
 1760.length%    EQUD  0
 1770.offset%    EQUD  0
 1780
 1790
 1800            ; On entry - r2=screen address
 1810            ;            r8=sprite address
 1820
 1830.whole_let  STMFD R13!,{R0-R1,R9-R10,R14}
 1840            ADD   R9,R8,#(16*16)       ; r9=mask address
 1850
 1860            ]
 1870            FOR loop% = 1 TO 16
 1880              FOR loop2% = 1 TO 2
 1890                [OPT pass%
 1900
 1910            LDMIA R8!,{R3-R4}          ; get 2 sprite words
 1920            LDMIA R9!,{R5-R6}          ; get 2 mask words
 1930            LDMIA R2 ,{R0-R1}          ; get 2 screen words
 1940            AND   R0,R0,R5             ; screen=screen AND mask
 1950            ORR   R5,R0,R3             ; mask=screen OR sprite
 1960            AND   R1,R1,R6             ; above process repeated
 1970            ORR   R6,R1,R4             ; for the other word
 1980            STMIA R2!,{R5-R6}          ; plot data
 1990
 2000                ]
 2010              NEXT
 2020              [OPT pass%
 2030
 2040            ADD   R2,R2,#(320-16)      ; move to next line
 2050
 2060              ]
 2070            NEXT
 2080            [OPT pass%
 2090
 2100            LDMFD R13!,{R0-R1,R9-R10,PC}
 2110
 2120
 2130            ; On entry - r2=screen address
 2140            ;            r8=sprite address
 2150            ;           r10=scroll offset
 2160
 2170.left_let   STMFD R13!,{R14}
 2180            CMP   R10,#16              ; is letter on screen ?
 2190            BEQ   ll_end               ; if not, go to 'll_end'
 2200            CMP   R10,#0
 2210            BEQ   ll_end
 2220            ADD   R2,R2,R10            ; screen+=scroll offset
 2230            MOV   R5,#16               ; r5=height in pixels
 2240            RSB   R6,R10,#16           ; r6=width in pixels
 2250.ll_1       MOV   R4,R6                ; copy width into r4
 2260            ADD   R8,R8,R10            ; offset sprite addr by
 2270                                       ;  scroll offset
 2280.ll_2       LDR   R3,[R8],#4           ; get sprite data
 2290            STR   R3,[R2],#4           ; plot data to screen
 2300            SUBS  R4,R4,#4             ; is there more ?
 2310            BNE   ll_2                 ; if so, go to 'll_2'
 2320            SUB   R2,R2,R6             ; correct screen position
 2330            ADD   R2,R2,#320           ; for next line
 2340            SUBS  R5,R5,#1             ; is there more rows ?
 2350            BNE   ll_1                 ; if so, go to 'll_1'
 2360.ll_end     LDMFD R13!,{PC}            ; exit
 2370
 2380
 2390.right_let  STMFD R13!,{R0,R14}
 2400            MOV   R5,#16               ; r5=height in pixels
 2410            MOV   R0,R10               ; r0=scroll offset
 2420            CMP   R0,#0                ; if r0=0, then r0=16
 2430            MOVEQ R0,#16               ; r0=width in pixels
 2440            RSB   R6,R0,#16
 2450.rl_1       MOV   R4,R0                ; copy width in r4
 2460.rl_2       LDR   R3,[R8],#4           ; get sprite data
 2470            STR   R3,[R2],#4           ; plot data to screen
 2480            SUBS  R4,R4,#4             ; is there more ?
 2490            BNE   rl_2                 ; if so, go to 'rl_2'
 2500            ADD   R8,R8,R6             ; correct sprite ptr and
 2510            SUB   R2,R2,R0             ; screen pointer for next
 2520            ADD   R2,R2,#320           ;  line
 2530            SUBS  R5,R5,#1             ; is there more rows ?
 2540            BNE   rl_1                 ; if so, go to 'rl_1'
 2550.rl_end     LDMFD R13!,{R0,PC}         ; exit
 2560
 2570
 2580
 2590    ]
 2600  NEXT
 2610ENDPROC
 2620
 2630
 2640
 2650DEF FNarray(size%)
 2660  P% += size%
 2670=0
 2680
 2690
 2700
 2710DEF PROCinit
 2720  LOCAL offset%,I%,var,J%
 2730
 2740  $text% = STRING$(17," ")
 2750  OSCLI"LOAD <Modules$Dir>."+module$+".Text "+STR$~(text%+17)
 2760  length%!0 = text_len% + 17
 2770  offset%   = (waves% + 1) * 4
 2780
 2790  FOR I% = 0 TO waves%
 2800    max%!(I%*4)    = length%(I%) * 4
 2810    tables%!(I%*4) = offset%
 2820    var            = var(I%)
 2830    FOR J% = 0 TO length%(I%) - 1
 2840      tables%!(offset% + (J% * 4)) = INT(EVAL(formula$(I%)))*320
 2850      var                         += inc(I%)
 2860    NEXT
 2870    offset% += length%(I%) * 4
 2880  NEXT
 2890
 2900ENDPROC
 2910
 2920
 2930
 2940DEF FNlower(string$,pos%)
 2950  LOCAL new$,I%,ascii%
 2960  string$ = LEFT$(string$,pos%)
 2970  new$ = ""
 2980  FOR I% = 1 TO LEN(string$)
 2990    ascii% = ASC(MID$(string$,I%,1)) OR 32
 3000    new$  += CHR$(ascii%)
 3010  NEXT
 3020=new$
 3030
 3040
 3050
 3060DEF PROCdecode_waveforms
 3070  f%     = OPENUP ("<Modules$Dir>."+module$+".Waveforms")
 3080  IF f% = 0 THEN ERROR 0,(module$+": Waveforms text script file not found")
 3090  waves% = -1
 3100  REPEAT
 3110    a$ = GET$#f%
 3120    IF FNlower(a$,3)="id:" THEN waves% += 1
 3130  UNTIL EOF#f%
 3140  CLOSE#f%
 3150
 3160  IF waves% >= 0 THEN
 3170
 3180    f% = OPENUP ("<Modules$Dir>."+module$+".Waveforms")
 3190    DIM id$(waves%),length%(waves%),var(waves%)
 3200    DIM inc(waves%),formula$(waves%)
 3210    error$ = ""
 3220    wave%  = 0
 3230    line%  = 0
 3240    REPEAT
 3250      a$     = GET$#f%
 3260      line% += 1
 3270      IF FNlower(a$,3) = "id:" THEN
 3280        pos% = INSTR(a$,"""")
 3290        IF pos% > 0 THEN
 3300          id$(wave%) = MID$(a$,pos%+1,1)
 3310          a$         = GET$#f%
 3320          line%     += 1
 3330          IF FNlower(a$,7) = "length:" THEN
 3340            pos% = INSTR(a$,"=")
 3350            IF pos% > 0 THEN
 3360              length%(wave%) = EVAL(RIGHT$(a$,LEN(a$) - pos%))
 3370              length         = length%(wave%)
 3380              a$             = GET$#f%
 3390              line%         += 1
 3400              IF FNlower(a$,4) = "var:" THEN
 3410                pos% = INSTR(a$,"=")
 3420                IF pos% > 0 THEN
 3430                  var(wave%) = EVAL(RIGHT$(a$,LEN(a$) - pos%))
 3440                  a$         = GET$#f%
 3450                  line%     += 1
 3460                  IF FNlower(a$,4) = "inc:" THEN
 3470                    pos% = INSTR(a$,"=")
 3480                    IF pos% > 0 THEN
 3490                      inc(wave%) = EVAL(RIGHT$(a$,LEN(a$) - pos%))
 3500                    ELSE
 3510                      error$ = "No evaluation for inc command"
 3520                    ENDIF
 3530                  ELSE
 3540                    error$ = "No inc command"
 3550                  ENDIF
 3560                  a$     = GET$#f%
 3570                  line% += 1
 3580                ELSE
 3590                  error$ = "No evaluation for var command"
 3600                ENDIF
 3610              ENDIF
 3620              IF FNlower(a$,2) = "y:" THEN
 3630                pos% = INSTR(a$,"=")
 3640                IF pos% > 0 THEN
 3650                  formula$(wave%) = RIGHT$(a$,LEN(a$) - pos%)
 3660                ELSE
 3670                  error$ = "No evaluation for y command"
 3680                ENDIF
 3690              ELSE
 3700                error$ = "No y command"
 3710              ENDIF
 3720            ELSE
 3730              error$ = "No evaluation for length command"
 3740            ENDIF
 3750          ELSE
 3760            error$ = "No length command"
 3770          ENDIF
 3780        ELSE
 3790          error$ = "No ID character supplied"
 3800        ENDIF
 3810        wave% += 1
 3820      ENDIF
 3830    UNTIL EOF#f% OR error$ <> ""
 3840    CLOSE#f%
 3850
 3860    IF error$ <> "" THEN
 3870      ERROR 0,(module$+": Waveform Error: "+error$+" at script line "+STR$(line%))
 3880    ENDIF
 3890
 3900  ENDIF
 3910
 3920  wave_data% = (waves% + 1) * 4
 3930  FOR I% = 0 TO waves%
 3940    wave_data% += length%(I%) * 4
 3950  NEXT
 3960
 3970ENDPROC

� >ScrollText

P� � �"CLOSE":ș "Hourglass_Smash":� 0,(�$+" (internal error code "+�(�)+")")
(
2module$ = "ScrollText"
<
Fș "Hourglass_On"
Pț "<Demo$Dir>.FNconvert"
Z
d�decode_waveforms
n
xPș "OS_File",13,"<Modules$Dir>."+module$+".Text" � text_exists%,,,,text_len%
�Qș "OS_File",13,"<Modules$Dir>."+module$+".Sprites" � spr_exists%,,,,spr_len%
�>� text_exists% = 0 � � 0,(module$+": Text file not found")
�@� spr_exists%  = 0 � � 0,(module$+": Sprite file not found")
�
�assemble
�	�init
�
� Ȏ �convert(module$,font%) �
�	  � 0
�E    �"SAVE    <Modules$Dir>."+module$+".Module "+�~code%+" "+�~P%
�8    �"SETTYPE <Modules$Dir>."+module$+".Module Data"
�
  � -1
�/    � 0,(module$+": Sprite file not found")
�  
9    � 0,(module$+": Sprite width not divisible by 4")
�

"ș "Hourglass_Off"
,�
6
@
J
T� �assemble
^/  len% = (16 * 1024) + spr_len% + text_len%
h  � code% len%
r  � pass% = 8 � 10 � 2
|    P% = code%
�    L% = code% + len%
�    [OPT pass%
�
�
�.init       EQUD  0
�$.frame      EQUD  scroll - code%
�.end        EQUD  0
�
�
�'.scroll     STMFD R13!,{R0-R10,R14}
�<            ADR   R0,font%             ; r0=font address
�            B     jump_1
�
<.font%      �array(spr_len%)          ; font sprite data

B.jump_1     ADR   R1,text%             ; r1=scrolltext address
&            B     jump_2
0
:;.text%      �array(text_len% + 17)    ; scrolltext data
D
N>.jump_2     LDR   R2,table_P%          ; r2=waveform table
X9            CMP   R2,#0                ; is it zero ?
bF            ADREQ R2,tables%           ; if so, r2=table 1 address
l             LDREQ R7,[R2,#0]
v            ADDEQ R2,R2,R7
�7            STREQ R2,table_P%          ;   store r2
�D            ADREQ R2,max%              ;   get length of table 1
�             LDREQ R2,[R2,#0]
�7            STREQ R2,max_P%            ;   store it
�
�>            MOV   R2,R12               ; r2=screen address
�A            MOV   R7,#17               ; r7=number of letters
�F            LDR   R9,let_pos%          ; r9=position in scrolltext
�
�E            LDR   R10,offset%          ; r10=letter scroll offset
�A            ADD   R10,R10,#4           ; scroll one more word
�F            SUB   R2,R2,R10            ; r2=scr_addr-scroll offset
�D            CMP   R10,#20              ; has a letter scrolled ?
@            �Q R10,#0               ; if so, scroll offset=0
9            STR   R10,offset%          ; store offset
F            BNE   let_start            ; if not, go to 'let_start'
 
*D            LDR   R4,length%           ; r4=length of scrolltext
4F            LDR   R9,let_pos%          ; r9=position in scrolltext
>            ADD   R3,R9,#1
HF            CMP   R3,R4                ; have we reached the end ?
RE            MOVGE R3,#17               ; if so, go to start again
\D            STR   R3,let_pos%          ; store pos in scrolltext
f
pD.let_start  LDR   R4,length%           ; r4=length of scrolltext
zF            ADD   R5,R9,#17            ; r5=pos in scrolltext + 17
�D.to_start   CMP   R5,R4                ; has it exceeded the len
�B            SUBGE R5,R5,R4             ; if so, pos=pos-length
�>            ADDGE R5,R5,#17            ;        pos=pos+17
�?            BGE   to_start             ;        check again
�A            LDRB  R3,[R1,R5]           ; r3=char scrolling in
�A            CMP   R3,#�"a"           ; is it a trigger char ?
�F            BLT   let_start2           ; if not go to 'let_start2'
�
�D            CMP   R3,#�(id$(waves%)) ; if a wave character, then
�            BGT   not_wave
�            
�<            SUB   R6,R3,#�"a"        ; get waveform data
�             ADR   R4,tables%
&            LDR   R5,[R4,R6,LSL#2]
            ADD   R4,R4,R5
!            STR   R4,table_P%
$            ADR   R4,max%
.&            LDR   R4,[R4,R6,LSL#2]
8            STR   R4,max_P%
B"            LDR   R4,wave_pos%
L            MOV   R4,#0
V"            STR   R4,wave_pos%
`            
j5.not_wave   LDR   R4,flag%             ; get flag
t=            RSB   R5,R3,#�"z"        ; set appropiate bit
~            MOV   R6,#1
�$            �R   R4,R4,R6,LSL R5
�7            STR   R4,flag%             ; store flag
�             B     let_start2
�
�
�$.max%       �array((waves%+1)*4)
�
�.flag%      EQUD  0
�
�".tables%    �array(wave_data%)
�
�
?.let_start2 CMP   R10,#4               ; is scroll offset=4

<            �Q R3,#0                ; if so, wave_pos+=0
?            MOVNE R3,#4                ;  else, wave_pos+=4
#            LDR   R11,wave_pos%
(             ADD   R11,R11,R3
2D            LDR   R4,max_P%            ; r4=length of wave table
<A            CMP   R11,R4               ; is wave_pos > this ?
F>            MOVGE R11,#0               ; if so, wave_pos=0
P;            STR   R11,wave_pos%        ; store wave_pos
Z
d>.let        LDRB  R3,[R1,R9]           ; r3=letter to plot
nD            ADD   R9,R9,#1             ; increment text position
xB            LDR   R5,length%           ; is it >= the length ?
�C            CMP   R9,R5                ; if so, go to the start
�,            MOVGE R9,#17               ;
�A            CMP   R3,#�"a"           ; is it a trigger char ?
�A            MOVGE R3,#�" "           ; if so, display a space
�?            CMP   R3,#�" "           ; is it invalid char ?
�A            MOVLT R3,#�" "           ; if so, display a space
�C            SUB   R3,R3,#32            ; character=character-32
�C            ADD   R8,R0,R3,LSL#9       ; r8=font+(char*16*16*2)
�>            LDR   R3,table_P%          ; r3=waveform table
�?            LDR   R4,[R3,R11]          ; get waveform entry
�F            LDR   R14,max_P%           ; r14=len of waveform table
�?            SUBS  R11,R11,#4           ; move to next entry
�D            ADDMI R11,R11,R14          ; if exceeded, ptr=length
F            STR   R2,old_scr%          ; store screen address away
C            ADD   R2,R2,R4             ; scr=scr+waveform entry
F            CMP   R7,#17               ; is this the left letter ?
"C            BLEQ  left_let             ; if so, call 'left_let'
,;            BEQ   skip                 ;   go to 'skip'
6D            CMP   R7,#1                ; is this the right let ?
@D            BLEQ  right_let            ; if so, call 'right_let'
J;            BEQ   skip                 ;   go to 'skip'
TB            BL    whole_let            ; else call 'whole_let'
^B.skip       LDR   R2,old_scr%          ; r2=old screen address
hD            ADD   R2,R2,#20            ; move to next screen pos
rE            SUBS  R7,R7,#1             ; any more letters to do ?
|?            BNE   let                  ; if so, go to 'let'
�5            LDR   R11,flag%            ; r11=flag
�1            LDMFD R13!,{R0-R10,PC}     ; exit
�
�
�.old_scr%   EQUD  0
�.wave_pos%  EQUD  0
�.table_P%   EQUD  0
�.max_P%     EQUD  0
�.let_pos%   EQUD  0
�.length%    EQUD  0
�.offset%    EQUD  0
�
�
.            ; On entry - r2=screen address
.            ;            r8=sprite address

&-.whole_let  STMFD R13!,{R0-R1,R9-R10,R14}
0<            ADD   R9,R8,#(16*16)       ; r9=mask address
:
D            ]
N             � loop% = 1 � 16
X"              � loop2% = 1 � 2
b                [OPT pass%
l
v?            LDMIA R8!,{R3-R4}          ; get 2 sprite words
�=            LDMIA R9!,{R5-R6}          ; get 2 mask words
�?            LDMIA R2 ,{R0-R1}          ; get 2 screen words
�?            �   R0,R0,R5             ; screen=screen � mask
�@            �R   R5,R0,R3             ; mask=screen � sprite
�A            �   R1,R1,R6             ; above process repeated
�>            �R   R6,R1,R4             ; for the other word
�6            STMIA R2!,{R5-R6}          ; plot data
�
�                ]
�              �
�              [OPT pass%
�
�>            ADD   R2,R2,#(320-16)      ; move to next line

              ]
            �
             [OPT pass%
*
4,            LDMFD R13!,{R0-R1,R9-R10,PC}
>
H
R.            ; On entry - r2=screen address
\.            ;            r8=sprite address
f-            ;           r10=scroll offset
p
z .left_let   STMFD R13!,{R14}
�B            CMP   R10,#16              ; is letter on screen ?
�C            BEQ   ll_end               ; if not, go to 'll_end'
�            CMP   R10,#0
�            BEQ   ll_end
�B            ADD   R2,R2,R10            ; screen+=scroll offset
�@            MOV   R5,#16               ; r5=height in pixels
�?            RSB   R6,R10,#16           ; r6=width in pixels
�?.ll_1       MOV   R4,R6                ; copy width into r4
�B            ADD   R8,R8,R10            ; offset sprite addr by
�;                                       ;  scroll offset
�<.ll_2       LDR   R3,[R8],#4           ; get sprite data
�@            STR   R3,[R2],#4           ; plot data to screen
�<            SUBS  R4,R4,#4             ; is there more ?
	@            BNE   ll_2                 ; if so, go to 'll_2'
	D            SUB   R2,R2,R6             ; correct screen position
	:            ADD   R2,R2,#320           ; for next line
	$A            SUBS  R5,R5,#1             ; is there more rows ?
	.@            BNE   ll_1                 ; if so, go to 'll_1'
	81.ll_end     LDMFD R13!,{PC}            ; exit
	B
	L
	V#.right_let  STMFD R13!,{R0,R14}
	`@            MOV   R5,#16               ; r5=height in pixels
	j=            MOV   R0,R10               ; r0=scroll offset
	t@            CMP   R0,#0                ; if r0=0, then r0=16
	~<            �Q R0,#16               ; r0=width in pixels
	�            RSB   R6,R0,#16
	�=.rl_1       MOV   R4,R0                ; copy width in r4
	�<.rl_2       LDR   R3,[R8],#4           ; get sprite data
	�@            STR   R3,[R2],#4           ; plot data to screen
	�<            SUBS  R4,R4,#4             ; is there more ?
	�@            BNE   rl_2                 ; if so, go to 'rl_2'
	�C            ADD   R8,R8,R6             ; correct sprite ptr and
	�D            SUB   R2,R2,R0             ; screen pointer for next
	�2            ADD   R2,R2,#320           ;  line
	�A            SUBS  R5,R5,#1             ; is there more rows ?
	�@            BNE   rl_1                 ; if so, go to 'rl_1'
	�1.rl_end     LDMFD R13!,{R0,PC}         ; exit




	    ]
(  �
2�
<
F
P
Z� �array(size%)
d  P% += size%
n=0
x
�
�
�� �init
�  � offset%,I%,var,J%
�
�  $text% = �17," ")
�:  �"LOAD <Modules$Dir>."+module$+".Text "+�~(text%+17)
�   length%!0 = text_len% + 17
�"  offset%   = (waves% + 1) * 4
�
�  � I% = 0 � waves%
�(    max%!(I%*4)    = length%(I%) * 4
�     tables%!(I%*4) = offset%
     var            = var(I%)
"    � J% = 0 � length%(I%) - 1
?      tables%!(offset% + (J% * 4)) = �(�(formula$(I%)))*320
"0      var                         += inc(I%)
,	    �
6"    offset% += length%(I%) * 4
@  �
J
T�
^
h
r
|� �lower(string$,pos%)
�  � new$,I%,ascii%
�  string$ = �string$,pos%)
�  new$ = ""
�  � I% = 1 � �(string$)
�'    ascii% = �(�string$,I%,1)) � 32
�    new$  += �(ascii%)
�  �
�	=new$
�
�
�
�� �decode_waveforms
�8  f%     = � ("<Modules$Dir>."+module$+".Waveforms")
G  � f% = 0 � � 0,(module$+": Waveforms text script file not found")
  waves% = -1
  �
&    a$ = �#f%
0*    � �lower(a$,3)="id:" � waves% += 1
:  � �#f%
D
  �#f%
N
X  � waves% >= 0 �
b
l6    f% = � ("<Modules$Dir>."+module$+".Waveforms")
v1    � id$(waves%),length%(waves%),var(waves%)
�&    � inc(waves%),formula$(waves%)
�    error$ = ""
�    wave%  = 0
�    line%  = 0
�	    �
�      a$     = �#f%
�      line% += 1
�"      � �lower(a$,3) = "id:" �
�        pos% = �a$,"""")
�        � pos% > 0 �
�(          id$(wave%) = �a$,pos%+1,1)
�          a$         = �#f%
�          line%     += 1

*          � �lower(a$,7) = "length:" �

            pos% = �a$,"=")

            � pos% > 0 �

 7              length%(wave%) = �(�a$,�(a$) - pos%))

*1              length         = length%(wave%)

4'              a$             = �#f%

>$              line%         += 1

H+              � �lower(a$,4) = "var:" �

R#                pos% = �a$,"=")

\                 � pos% > 0 �

f7                  var(wave%) = �(�a$,�(a$) - pos%))

p'                  a$         = �#f%

z$                  line%     += 1

�/                  � �lower(a$,4) = "inc:" �

�'                    pos% = �a$,"=")

�$                    � pos% > 0 �

�;                      inc(wave%) = �(�a$,�(a$) - pos%))

�                    �

�B                      error$ = "No evaluation for inc command"

�                    �

�                  �

�1                    error$ = "No inc command"

�                  �

�#                  a$     = �#f%

�                   line% += 1

�                �
>                  error$ = "No evaluation for var command"
                �
              �
$)              � �lower(a$,2) = "y:" �
.#                pos% = �a$,"=")
8                 � pos% > 0 �
B9                  formula$(wave%) = �a$,�(a$) - pos%)
L                �
V<                  error$ = "No evaluation for y command"
`                �
j              �
t+                error$ = "No y command"
~              �
�            �
�=              error$ = "No evaluation for length command"
�            �
�          �
�,            error$ = "No length command"
�          �
�
        �
�1          error$ = "No ID character supplied"
�
        �
�        wave% += 1
�      �
�    � �#f% � error$ <> ""
    �#f%


    � error$ <> "" �
O      � 0,(module$+": Waveform Error: "+error$+" at script line "+�(line%))
(	    �
2
<  �
F
P#  wave_data% = (waves% + 1) * 4
Z  � I% = 0 � waves%
d%    wave_data% += length%(I%) * 4
n  �
x
��
�
00000000  0d 00 0a 11 f4 20 3e 53  63 72 6f 6c 6c 54 65 78  |..... >ScrollTex|
00000010  74 0d 00 14 04 0d 00 1e  50 ee 20 85 20 ff 22 43  |t.......P. . ."C|
00000020  4c 4f 53 45 22 3a c8 99  20 22 48 6f 75 72 67 6c  |LOSE":.. "Hourgl|
00000030  61 73 73 5f 53 6d 61 73  68 22 3a 85 20 30 2c 28  |ass_Smash":. 0,(|
00000040  f6 24 2b 22 20 28 69 6e  74 65 72 6e 61 6c 20 65  |.$+" (internal e|
00000050  72 72 6f 72 20 63 6f 64  65 20 22 2b c3 28 9e 29  |rror code "+.(.)|
00000060  2b 22 29 22 29 0d 00 28  04 0d 00 32 1a 6d 6f 64  |+")")..(...2.mod|
00000070  75 6c 65 24 20 3d 20 22  53 63 72 6f 6c 6c 54 65  |ule$ = "ScrollTe|
00000080  78 74 22 0d 00 3c 04 0d  00 46 15 c8 99 20 22 48  |xt"..<...F... "H|
00000090  6f 75 72 67 6c 61 73 73  5f 4f 6e 22 0d 00 50 1d  |ourglass_On"..P.|
000000a0  c8 9b 20 22 3c 44 65 6d  6f 24 44 69 72 3e 2e 46  |.. "<Demo$Dir>.F|
000000b0  4e 63 6f 6e 76 65 72 74  22 0d 00 5a 04 0d 00 64  |Nconvert"..Z...d|
000000c0  15 f2 64 65 63 6f 64 65  5f 77 61 76 65 66 6f 72  |..decode_wavefor|
000000d0  6d 73 0d 00 6e 04 0d 00  78 50 c8 99 20 22 4f 53  |ms..n...xP.. "OS|
000000e0  5f 46 69 6c 65 22 2c 31  33 2c 22 3c 4d 6f 64 75  |_File",13,"<Modu|
000000f0  6c 65 73 24 44 69 72 3e  2e 22 2b 6d 6f 64 75 6c  |les$Dir>."+modul|
00000100  65 24 2b 22 2e 54 65 78  74 22 20 b8 20 74 65 78  |e$+".Text" . tex|
00000110  74 5f 65 78 69 73 74 73  25 2c 2c 2c 2c 74 65 78  |t_exists%,,,,tex|
00000120  74 5f 6c 65 6e 25 0d 00  82 51 c8 99 20 22 4f 53  |t_len%...Q.. "OS|
00000130  5f 46 69 6c 65 22 2c 31  33 2c 22 3c 4d 6f 64 75  |_File",13,"<Modu|
00000140  6c 65 73 24 44 69 72 3e  2e 22 2b 6d 6f 64 75 6c  |les$Dir>."+modul|
00000150  65 24 2b 22 2e 53 70 72  69 74 65 73 22 20 b8 20  |e$+".Sprites" . |
00000160  73 70 72 5f 65 78 69 73  74 73 25 2c 2c 2c 2c 73  |spr_exists%,,,,s|
00000170  70 72 5f 6c 65 6e 25 0d  00 8c 3e e7 20 74 65 78  |pr_len%...>. tex|
00000180  74 5f 65 78 69 73 74 73  25 20 3d 20 30 20 8c 20  |t_exists% = 0 . |
00000190  85 20 30 2c 28 6d 6f 64  75 6c 65 24 2b 22 3a 20  |. 0,(module$+": |
000001a0  54 65 78 74 20 66 69 6c  65 20 6e 6f 74 20 66 6f  |Text file not fo|
000001b0  75 6e 64 22 29 0d 00 96  40 e7 20 73 70 72 5f 65  |und")...@. spr_e|
000001c0  78 69 73 74 73 25 20 20  3d 20 30 20 8c 20 85 20  |xists%  = 0 . . |
000001d0  30 2c 28 6d 6f 64 75 6c  65 24 2b 22 3a 20 53 70  |0,(module$+": Sp|
000001e0  72 69 74 65 20 66 69 6c  65 20 6e 6f 74 20 66 6f  |rite file not fo|
000001f0  75 6e 64 22 29 0d 00 a0  0d f2 61 73 73 65 6d 62  |und").....assemb|
00000200  6c 65 0d 00 aa 09 f2 69  6e 69 74 0d 00 b4 04 0d  |le.....init.....|
00000210  00 be 20 c8 8e 20 a4 63  6f 6e 76 65 72 74 28 6d  |.. .. .convert(m|
00000220  6f 64 75 6c 65 24 2c 66  6f 6e 74 25 29 20 ca 0d  |odule$,font%) ..|
00000230  00 c8 09 20 20 c9 20 30  0d 00 d2 45 20 20 20 20  |...  . 0...E    |
00000240  ff 22 53 41 56 45 20 20  20 20 3c 4d 6f 64 75 6c  |."SAVE    <Modul|
00000250  65 73 24 44 69 72 3e 2e  22 2b 6d 6f 64 75 6c 65  |es$Dir>."+module|
00000260  24 2b 22 2e 4d 6f 64 75  6c 65 20 22 2b c3 7e 63  |$+".Module "+.~c|
00000270  6f 64 65 25 2b 22 20 22  2b c3 7e 50 25 0d 00 dc  |ode%+" "+.~P%...|
00000280  38 20 20 20 20 ff 22 53  45 54 54 59 50 45 20 3c  |8    ."SETTYPE <|
00000290  4d 6f 64 75 6c 65 73 24  44 69 72 3e 2e 22 2b 6d  |Modules$Dir>."+m|
000002a0  6f 64 75 6c 65 24 2b 22  2e 4d 6f 64 75 6c 65 20  |odule$+".Module |
000002b0  44 61 74 61 22 0d 00 e6  0a 20 20 c9 20 2d 31 0d  |Data"....  . -1.|
000002c0  00 f0 2f 20 20 20 20 85  20 30 2c 28 6d 6f 64 75  |../    . 0,(modu|
000002d0  6c 65 24 2b 22 3a 20 53  70 72 69 74 65 20 66 69  |le$+": Sprite fi|
000002e0  6c 65 20 6e 6f 74 20 66  6f 75 6e 64 22 29 0d 00  |le not found")..|
000002f0  fa 07 20 20 7f 0d 01 04  39 20 20 20 20 85 20 30  |..  ....9    . 0|
00000300  2c 28 6d 6f 64 75 6c 65  24 2b 22 3a 20 53 70 72  |,(module$+": Spr|
00000310  69 74 65 20 77 69 64 74  68 20 6e 6f 74 20 64 69  |ite width not di|
00000320  76 69 73 69 62 6c 65 20  62 79 20 34 22 29 0d 01  |visible by 4")..|
00000330  0e 05 cb 0d 01 18 04 0d  01 22 16 c8 99 20 22 48  |........."... "H|
00000340  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 01 2c  |ourglass_Off"..,|
00000350  05 e0 0d 01 36 04 0d 01  40 04 0d 01 4a 04 0d 01  |....6...@...J...|
00000360  54 0f dd 20 f2 61 73 73  65 6d 62 6c 65 0d 01 5e  |T.. .assemble..^|
00000370  2f 20 20 6c 65 6e 25 20  3d 20 28 31 36 20 2a 20  |/  len% = (16 * |
00000380  31 30 32 34 29 20 2b 20  73 70 72 5f 6c 65 6e 25  |1024) + spr_len%|
00000390  20 2b 20 74 65 78 74 5f  6c 65 6e 25 0d 01 68 12  | + text_len%..h.|
000003a0  20 20 de 20 63 6f 64 65  25 20 6c 65 6e 25 0d 01  |  . code% len%..|
000003b0  72 1a 20 20 e3 20 70 61  73 73 25 20 3d 20 38 20  |r.  . pass% = 8 |
000003c0  b8 20 31 30 20 88 20 32  0d 01 7c 12 20 20 20 20  |. 10 . 2..|.    |
000003d0  50 25 20 3d 20 63 6f 64  65 25 0d 01 86 19 20 20  |P% = code%....  |
000003e0  20 20 4c 25 20 3d 20 63  6f 64 65 25 20 2b 20 6c  |  L% = code% + l|
000003f0  65 6e 25 0d 01 90 12 20  20 20 20 5b 4f 50 54 20  |en%....    [OPT |
00000400  70 61 73 73 25 0d 01 9a  04 0d 01 a4 04 0d 01 ae  |pass%...........|
00000410  17 2e 69 6e 69 74 20 20  20 20 20 20 20 45 51 55  |..init       EQU|
00000420  44 20 20 30 0d 01 b8 24  2e 66 72 61 6d 65 20 20  |D  0...$.frame  |
00000430  20 20 20 20 45 51 55 44  20 20 73 63 72 6f 6c 6c  |    EQUD  scroll|
00000440  20 2d 20 63 6f 64 65 25  0d 01 c2 17 2e 65 6e 64  | - code%.....end|
00000450  20 20 20 20 20 20 20 20  45 51 55 44 20 20 30 0d  |        EQUD  0.|
00000460  01 cc 04 0d 01 d6 04 0d  01 e0 27 2e 73 63 72 6f  |..........'.scro|
00000470  6c 6c 20 20 20 20 20 53  54 4d 46 44 20 52 31 33  |ll     STMFD R13|
00000480  21 2c 7b 52 30 2d 52 31  30 2c 52 31 34 7d 0d 01  |!,{R0-R10,R14}..|
00000490  ea 3c 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |.<            AD|
000004a0  52 20 20 20 52 30 2c 66  6f 6e 74 25 20 20 20 20  |R   R0,font%    |
000004b0  20 20 20 20 20 20 20 20  20 3b 20 72 30 3d 66 6f  |         ; r0=fo|
000004c0  6e 74 20 61 64 64 72 65  73 73 0d 01 f4 1c 20 20  |nt address....  |
000004d0  20 20 20 20 20 20 20 20  20 20 42 20 20 20 20 20  |          B     |
000004e0  6a 75 6d 70 5f 31 0d 01  fe 04 0d 02 08 3c 2e 66  |jump_1.......<.f|
000004f0  6f 6e 74 25 20 20 20 20  20 20 a4 61 72 72 61 79  |ont%      .array|
00000500  28 73 70 72 5f 6c 65 6e  25 29 20 20 20 20 20 20  |(spr_len%)      |
00000510  20 20 20 20 3b 20 66 6f  6e 74 20 73 70 72 69 74  |    ; font sprit|
00000520  65 20 64 61 74 61 0d 02  12 04 0d 02 1c 42 2e 6a  |e data.......B.j|
00000530  75 6d 70 5f 31 20 20 20  20 20 41 44 52 20 20 20  |ump_1     ADR   |
00000540  52 31 2c 74 65 78 74 25  20 20 20 20 20 20 20 20  |R1,text%        |
00000550  20 20 20 20 20 3b 20 72  31 3d 73 63 72 6f 6c 6c  |     ; r1=scroll|
00000560  74 65 78 74 20 61 64 64  72 65 73 73 0d 02 26 1c  |text address..&.|
00000570  20 20 20 20 20 20 20 20  20 20 20 20 42 20 20 20  |            B   |
00000580  20 20 6a 75 6d 70 5f 32  0d 02 30 04 0d 02 3a 3b  |  jump_2..0...:;|
00000590  2e 74 65 78 74 25 20 20  20 20 20 20 a4 61 72 72  |.text%      .arr|
000005a0  61 79 28 74 65 78 74 5f  6c 65 6e 25 20 2b 20 31  |ay(text_len% + 1|
000005b0  37 29 20 20 20 20 3b 20  73 63 72 6f 6c 6c 74 65  |7)    ; scrollte|
000005c0  78 74 20 64 61 74 61 0d  02 44 04 0d 02 4e 3e 2e  |xt data..D...N>.|
000005d0  6a 75 6d 70 5f 32 20 20  20 20 20 4c 44 52 20 20  |jump_2     LDR  |
000005e0  20 52 32 2c 74 61 62 6c  65 5f 50 25 20 20 20 20  | R2,table_P%    |
000005f0  20 20 20 20 20 20 3b 20  72 32 3d 77 61 76 65 66  |      ; r2=wavef|
00000600  6f 72 6d 20 74 61 62 6c  65 0d 02 58 39 20 20 20  |orm table..X9   |
00000610  20 20 20 20 20 20 20 20  20 43 4d 50 20 20 20 52  |         CMP   R|
00000620  32 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |2,#0            |
00000630  20 20 20 20 3b 20 69 73  20 69 74 20 7a 65 72 6f  |    ; is it zero|
00000640  20 3f 0d 02 62 46 20 20  20 20 20 20 20 20 20 20  | ?..bF          |
00000650  20 20 41 44 52 45 51 20  52 32 2c 74 61 62 6c 65  |  ADREQ R2,table|
00000660  73 25 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |s%           ; i|
00000670  66 20 73 6f 2c 20 72 32  3d 74 61 62 6c 65 20 31  |f so, r2=table 1|
00000680  20 61 64 64 72 65 73 73  0d 02 6c 20 20 20 20 20  | address..l     |
00000690  20 20 20 20 20 20 20 20  4c 44 52 45 51 20 52 37  |        LDREQ R7|
000006a0  2c 5b 52 32 2c 23 30 5d  0d 02 76 1e 20 20 20 20  |,[R2,#0]..v.    |
000006b0  20 20 20 20 20 20 20 20  41 44 44 45 51 20 52 32  |        ADDEQ R2|
000006c0  2c 52 32 2c 52 37 0d 02  80 37 20 20 20 20 20 20  |,R2,R7...7      |
000006d0  20 20 20 20 20 20 53 54  52 45 51 20 52 32 2c 74  |      STREQ R2,t|
000006e0  61 62 6c 65 5f 50 25 20  20 20 20 20 20 20 20 20  |able_P%         |
000006f0  20 3b 20 20 20 73 74 6f  72 65 20 72 32 0d 02 8a  | ;   store r2...|
00000700  44 20 20 20 20 20 20 20  20 20 20 20 20 41 44 52  |D            ADR|
00000710  45 51 20 52 32 2c 6d 61  78 25 20 20 20 20 20 20  |EQ R2,max%      |
00000720  20 20 20 20 20 20 20 20  3b 20 20 20 67 65 74 20  |        ;   get |
00000730  6c 65 6e 67 74 68 20 6f  66 20 74 61 62 6c 65 20  |length of table |
00000740  31 0d 02 94 20 20 20 20  20 20 20 20 20 20 20 20  |1...            |
00000750  20 4c 44 52 45 51 20 52  32 2c 5b 52 32 2c 23 30  | LDREQ R2,[R2,#0|
00000760  5d 0d 02 9e 37 20 20 20  20 20 20 20 20 20 20 20  |]...7           |
00000770  20 53 54 52 45 51 20 52  32 2c 6d 61 78 5f 50 25  | STREQ R2,max_P%|
00000780  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 20 20  |            ;   |
00000790  73 74 6f 72 65 20 69 74  0d 02 a8 04 0d 02 b2 3e  |store it.......>|
000007a0  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
000007b0  20 20 52 32 2c 52 31 32  20 20 20 20 20 20 20 20  |  R2,R12        |
000007c0  20 20 20 20 20 20 20 3b  20 72 32 3d 73 63 72 65  |       ; r2=scre|
000007d0  65 6e 20 61 64 64 72 65  73 73 0d 02 bc 41 20 20  |en address...A  |
000007e0  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
000007f0  52 37 2c 23 31 37 20 20  20 20 20 20 20 20 20 20  |R7,#17          |
00000800  20 20 20 20 20 3b 20 72  37 3d 6e 75 6d 62 65 72  |     ; r7=number|
00000810  20 6f 66 20 6c 65 74 74  65 72 73 0d 02 c6 46 20  | of letters...F |
00000820  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
00000830  20 52 39 2c 6c 65 74 5f  70 6f 73 25 20 20 20 20  | R9,let_pos%    |
00000840  20 20 20 20 20 20 3b 20  72 39 3d 70 6f 73 69 74  |      ; r9=posit|
00000850  69 6f 6e 20 69 6e 20 73  63 72 6f 6c 6c 74 65 78  |ion in scrolltex|
00000860  74 0d 02 d0 04 0d 02 da  45 20 20 20 20 20 20 20  |t.......E       |
00000870  20 20 20 20 20 4c 44 52  20 20 20 52 31 30 2c 6f  |     LDR   R10,o|
00000880  66 66 73 65 74 25 20 20  20 20 20 20 20 20 20 20  |ffset%          |
00000890  3b 20 72 31 30 3d 6c 65  74 74 65 72 20 73 63 72  |; r10=letter scr|
000008a0  6f 6c 6c 20 6f 66 66 73  65 74 0d 02 e4 41 20 20  |oll offset...A  |
000008b0  20 20 20 20 20 20 20 20  20 20 41 44 44 20 20 20  |          ADD   |
000008c0  52 31 30 2c 52 31 30 2c  23 34 20 20 20 20 20 20  |R10,R10,#4      |
000008d0  20 20 20 20 20 3b 20 73  63 72 6f 6c 6c 20 6f 6e  |     ; scroll on|
000008e0  65 20 6d 6f 72 65 20 77  6f 72 64 0d 02 ee 46 20  |e more word...F |
000008f0  20 20 20 20 20 20 20 20  20 20 20 53 55 42 20 20  |           SUB  |
00000900  20 52 32 2c 52 32 2c 52  31 30 20 20 20 20 20 20  | R2,R2,R10      |
00000910  20 20 20 20 20 20 3b 20  72 32 3d 73 63 72 5f 61  |      ; r2=scr_a|
00000920  64 64 72 2d 73 63 72 6f  6c 6c 20 6f 66 66 73 65  |ddr-scroll offse|
00000930  74 0d 02 f8 44 20 20 20  20 20 20 20 20 20 20 20  |t...D           |
00000940  20 43 4d 50 20 20 20 52  31 30 2c 23 32 30 20 20  | CMP   R10,#20  |
00000950  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 68 61  |            ; ha|
00000960  73 20 61 20 6c 65 74 74  65 72 20 73 63 72 6f 6c  |s a letter scrol|
00000970  6c 65 64 20 3f 0d 03 02  40 20 20 20 20 20 20 20  |led ?...@       |
00000980  20 20 20 20 20 ec 51 20  52 31 30 2c 23 30 20 20  |     .Q R10,#0  |
00000990  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |             ; i|
000009a0  66 20 73 6f 2c 20 73 63  72 6f 6c 6c 20 6f 66 66  |f so, scroll off|
000009b0  73 65 74 3d 30 0d 03 0c  39 20 20 20 20 20 20 20  |set=0...9       |
000009c0  20 20 20 20 20 53 54 52  20 20 20 52 31 30 2c 6f  |     STR   R10,o|
000009d0  66 66 73 65 74 25 20 20  20 20 20 20 20 20 20 20  |ffset%          |
000009e0  3b 20 73 74 6f 72 65 20  6f 66 66 73 65 74 0d 03  |; store offset..|
000009f0  16 46 20 20 20 20 20 20  20 20 20 20 20 20 42 4e  |.F            BN|
00000a00  45 20 20 20 6c 65 74 5f  73 74 61 72 74 20 20 20  |E   let_start   |
00000a10  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 6e 6f  |         ; if no|
00000a20  74 2c 20 67 6f 20 74 6f  20 27 6c 65 74 5f 73 74  |t, go to 'let_st|
00000a30  61 72 74 27 0d 03 20 04  0d 03 2a 44 20 20 20 20  |art'.. ...*D    |
00000a40  20 20 20 20 20 20 20 20  4c 44 52 20 20 20 52 34  |        LDR   R4|
00000a50  2c 6c 65 6e 67 74 68 25  20 20 20 20 20 20 20 20  |,length%        |
00000a60  20 20 20 3b 20 72 34 3d  6c 65 6e 67 74 68 20 6f  |   ; r4=length o|
00000a70  66 20 73 63 72 6f 6c 6c  74 65 78 74 0d 03 34 46  |f scrolltext..4F|
00000a80  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |            LDR |
00000a90  20 20 52 39 2c 6c 65 74  5f 70 6f 73 25 20 20 20  |  R9,let_pos%   |
00000aa0  20 20 20 20 20 20 20 3b  20 72 39 3d 70 6f 73 69  |       ; r9=posi|
00000ab0  74 69 6f 6e 20 69 6e 20  73 63 72 6f 6c 6c 74 65  |tion in scrollte|
00000ac0  78 74 0d 03 3e 1e 20 20  20 20 20 20 20 20 20 20  |xt..>.          |
00000ad0  20 20 41 44 44 20 20 20  52 33 2c 52 39 2c 23 31  |  ADD   R3,R9,#1|
00000ae0  0d 03 48 46 20 20 20 20  20 20 20 20 20 20 20 20  |..HF            |
00000af0  43 4d 50 20 20 20 52 33  2c 52 34 20 20 20 20 20  |CMP   R3,R4     |
00000b00  20 20 20 20 20 20 20 20  20 20 20 3b 20 68 61 76  |           ; hav|
00000b10  65 20 77 65 20 72 65 61  63 68 65 64 20 74 68 65  |e we reached the|
00000b20  20 65 6e 64 20 3f 0d 03  52 45 20 20 20 20 20 20  | end ?..RE      |
00000b30  20 20 20 20 20 20 4d 4f  56 47 45 20 52 33 2c 23  |      MOVGE R3,#|
00000b40  31 37 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |17              |
00000b50  20 3b 20 69 66 20 73 6f  2c 20 67 6f 20 74 6f 20  | ; if so, go to |
00000b60  73 74 61 72 74 20 61 67  61 69 6e 0d 03 5c 44 20  |start again..\D |
00000b70  20 20 20 20 20 20 20 20  20 20 20 53 54 52 20 20  |           STR  |
00000b80  20 52 33 2c 6c 65 74 5f  70 6f 73 25 20 20 20 20  | R3,let_pos%    |
00000b90  20 20 20 20 20 20 3b 20  73 74 6f 72 65 20 70 6f  |      ; store po|
00000ba0  73 20 69 6e 20 73 63 72  6f 6c 6c 74 65 78 74 0d  |s in scrolltext.|
00000bb0  03 66 04 0d 03 70 44 2e  6c 65 74 5f 73 74 61 72  |.f...pD.let_star|
00000bc0  74 20 20 4c 44 52 20 20  20 52 34 2c 6c 65 6e 67  |t  LDR   R4,leng|
00000bd0  74 68 25 20 20 20 20 20  20 20 20 20 20 20 3b 20  |th%           ; |
00000be0  72 34 3d 6c 65 6e 67 74  68 20 6f 66 20 73 63 72  |r4=length of scr|
00000bf0  6f 6c 6c 74 65 78 74 0d  03 7a 46 20 20 20 20 20  |olltext..zF     |
00000c00  20 20 20 20 20 20 20 41  44 44 20 20 20 52 35 2c  |       ADD   R5,|
00000c10  52 39 2c 23 31 37 20 20  20 20 20 20 20 20 20 20  |R9,#17          |
00000c20  20 20 3b 20 72 35 3d 70  6f 73 20 69 6e 20 73 63  |  ; r5=pos in sc|
00000c30  72 6f 6c 6c 74 65 78 74  20 2b 20 31 37 0d 03 84  |rolltext + 17...|
00000c40  44 2e 74 6f 5f 73 74 61  72 74 20 20 20 43 4d 50  |D.to_start   CMP|
00000c50  20 20 20 52 35 2c 52 34  20 20 20 20 20 20 20 20  |   R5,R4        |
00000c60  20 20 20 20 20 20 20 20  3b 20 68 61 73 20 69 74  |        ; has it|
00000c70  20 65 78 63 65 65 64 65  64 20 74 68 65 20 6c 65  | exceeded the le|
00000c80  6e 0d 03 8e 42 20 20 20  20 20 20 20 20 20 20 20  |n...B           |
00000c90  20 53 55 42 47 45 20 52  35 2c 52 35 2c 52 34 20  | SUBGE R5,R5,R4 |
00000ca0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 66  |            ; if|
00000cb0  20 73 6f 2c 20 70 6f 73  3d 70 6f 73 2d 6c 65 6e  | so, pos=pos-len|
00000cc0  67 74 68 0d 03 98 3e 20  20 20 20 20 20 20 20 20  |gth...>         |
00000cd0  20 20 20 41 44 44 47 45  20 52 35 2c 52 35 2c 23  |   ADDGE R5,R5,#|
00000ce0  31 37 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |17            ; |
00000cf0  20 20 20 20 20 20 20 70  6f 73 3d 70 6f 73 2b 31  |       pos=pos+1|
00000d00  37 0d 03 a2 3f 20 20 20  20 20 20 20 20 20 20 20  |7...?           |
00000d10  20 42 47 45 20 20 20 74  6f 5f 73 74 61 72 74 20  | BGE   to_start |
00000d20  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 20 20  |            ;   |
00000d30  20 20 20 20 20 63 68 65  63 6b 20 61 67 61 69 6e  |     check again|
00000d40  0d 03 ac 41 20 20 20 20  20 20 20 20 20 20 20 20  |...A            |
00000d50  4c 44 52 42 20 20 52 33  2c 5b 52 31 2c 52 35 5d  |LDRB  R3,[R1,R5]|
00000d60  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 33 3d  |           ; r3=|
00000d70  63 68 61 72 20 73 63 72  6f 6c 6c 69 6e 67 20 69  |char scrolling i|
00000d80  6e 0d 03 b6 41 20 20 20  20 20 20 20 20 20 20 20  |n...A           |
00000d90  20 43 4d 50 20 20 20 52  33 2c 23 97 22 61 22 20  | CMP   R3,#."a" |
00000da0  20 20 20 20 20 20 20 20  20 20 3b 20 69 73 20 69  |          ; is i|
00000db0  74 20 61 20 74 72 69 67  67 65 72 20 63 68 61 72  |t a trigger char|
00000dc0  20 3f 0d 03 c0 46 20 20  20 20 20 20 20 20 20 20  | ?...F          |
00000dd0  20 20 42 4c 54 20 20 20  6c 65 74 5f 73 74 61 72  |  BLT   let_star|
00000de0  74 32 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |t2           ; i|
00000df0  66 20 6e 6f 74 20 67 6f  20 74 6f 20 27 6c 65 74  |f not go to 'let|
00000e00  5f 73 74 61 72 74 32 27  0d 03 ca 04 0d 03 d4 44  |_start2'.......D|
00000e10  20 20 20 20 20 20 20 20  20 20 20 20 43 4d 50 20  |            CMP |
00000e20  20 20 52 33 2c 23 97 28  69 64 24 28 77 61 76 65  |  R3,#.(id$(wave|
00000e30  73 25 29 29 20 3b 20 69  66 20 61 20 77 61 76 65  |s%)) ; if a wave|
00000e40  20 63 68 61 72 61 63 74  65 72 2c 20 74 68 65 6e  | character, then|
00000e50  0d 03 de 1e 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
00000e60  42 47 54 20 20 20 6e 6f  74 5f 77 61 76 65 0d 03  |BGT   not_wave..|
00000e70  e8 10 20 20 20 20 20 20  20 20 20 20 20 20 0d 03  |..            ..|
00000e80  f2 3c 20 20 20 20 20 20  20 20 20 20 20 20 53 55  |.<            SU|
00000e90  42 20 20 20 52 36 2c 52  33 2c 23 97 22 61 22 20  |B   R6,R3,#."a" |
00000ea0  20 20 20 20 20 20 20 3b  20 67 65 74 20 77 61 76  |       ; get wav|
00000eb0  65 66 6f 72 6d 20 64 61  74 61 0d 03 fc 20 20 20  |eform data...   |
00000ec0  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
00000ed0  52 34 2c 74 61 62 6c 65  73 25 0d 04 06 26 20 20  |R4,tables%...&  |
00000ee0  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
00000ef0  52 35 2c 5b 52 34 2c 52  36 2c 4c 53 4c 23 32 5d  |R5,[R4,R6,LSL#2]|
00000f00  0d 04 10 1e 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
00000f10  41 44 44 20 20 20 52 34  2c 52 34 2c 52 35 0d 04  |ADD   R4,R4,R5..|
00000f20  1a 21 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |.!            ST|
00000f30  52 20 20 20 52 34 2c 74  61 62 6c 65 5f 50 25 0d  |R   R4,table_P%.|
00000f40  04 24 1d 20 20 20 20 20  20 20 20 20 20 20 20 41  |.$.            A|
00000f50  44 52 20 20 20 52 34 2c  6d 61 78 25 0d 04 2e 26  |DR   R4,max%...&|
00000f60  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |            LDR |
00000f70  20 20 52 34 2c 5b 52 34  2c 52 36 2c 4c 53 4c 23  |  R4,[R4,R6,LSL#|
00000f80  32 5d 0d 04 38 1f 20 20  20 20 20 20 20 20 20 20  |2]..8.          |
00000f90  20 20 53 54 52 20 20 20  52 34 2c 6d 61 78 5f 50  |  STR   R4,max_P|
00000fa0  25 0d 04 42 22 20 20 20  20 20 20 20 20 20 20 20  |%..B"           |
00000fb0  20 4c 44 52 20 20 20 52  34 2c 77 61 76 65 5f 70  | LDR   R4,wave_p|
00000fc0  6f 73 25 0d 04 4c 1b 20  20 20 20 20 20 20 20 20  |os%..L.         |
00000fd0  20 20 20 4d 4f 56 20 20  20 52 34 2c 23 30 0d 04  |   MOV   R4,#0..|
00000fe0  56 22 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |V"            ST|
00000ff0  52 20 20 20 52 34 2c 77  61 76 65 5f 70 6f 73 25  |R   R4,wave_pos%|
00001000  0d 04 60 10 20 20 20 20  20 20 20 20 20 20 20 20  |..`.            |
00001010  0d 04 6a 35 2e 6e 6f 74  5f 77 61 76 65 20 20 20  |..j5.not_wave   |
00001020  4c 44 52 20 20 20 52 34  2c 66 6c 61 67 25 20 20  |LDR   R4,flag%  |
00001030  20 20 20 20 20 20 20 20  20 20 20 3b 20 67 65 74  |           ; get|
00001040  20 66 6c 61 67 0d 04 74  3d 20 20 20 20 20 20 20  | flag..t=       |
00001050  20 20 20 20 20 52 53 42  20 20 20 52 35 2c 52 33  |     RSB   R5,R3|
00001060  2c 23 97 22 7a 22 20 20  20 20 20 20 20 20 3b 20  |,#."z"        ; |
00001070  73 65 74 20 61 70 70 72  6f 70 69 61 74 65 20 62  |set appropiate b|
00001080  69 74 0d 04 7e 1b 20 20  20 20 20 20 20 20 20 20  |it..~.          |
00001090  20 20 4d 4f 56 20 20 20  52 36 2c 23 31 0d 04 88  |  MOV   R6,#1...|
000010a0  24 20 20 20 20 20 20 20  20 20 20 20 20 84 52 20  |$            .R |
000010b0  20 20 52 34 2c 52 34 2c  52 36 2c 4c 53 4c 20 52  |  R4,R4,R6,LSL R|
000010c0  35 0d 04 92 37 20 20 20  20 20 20 20 20 20 20 20  |5...7           |
000010d0  20 53 54 52 20 20 20 52  34 2c 66 6c 61 67 25 20  | STR   R4,flag% |
000010e0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 73 74  |            ; st|
000010f0  6f 72 65 20 66 6c 61 67  0d 04 9c 20 20 20 20 20  |ore flag...     |
00001100  20 20 20 20 20 20 20 20  42 20 20 20 20 20 6c 65  |        B     le|
00001110  74 5f 73 74 61 72 74 32  0d 04 a6 04 0d 04 b0 04  |t_start2........|
00001120  0d 04 ba 24 2e 6d 61 78  25 20 20 20 20 20 20 20  |...$.max%       |
00001130  a4 61 72 72 61 79 28 28  77 61 76 65 73 25 2b 31  |.array((waves%+1|
00001140  29 2a 34 29 0d 04 c4 04  0d 04 ce 17 2e 66 6c 61  |)*4).........fla|
00001150  67 25 20 20 20 20 20 20  45 51 55 44 20 20 30 0d  |g%      EQUD  0.|
00001160  04 d8 04 0d 04 e2 22 2e  74 61 62 6c 65 73 25 20  |......".tables% |
00001170  20 20 20 a4 61 72 72 61  79 28 77 61 76 65 5f 64  |   .array(wave_d|
00001180  61 74 61 25 29 0d 04 ec  04 0d 04 f6 04 0d 05 00  |ata%)...........|
00001190  3f 2e 6c 65 74 5f 73 74  61 72 74 32 20 43 4d 50  |?.let_start2 CMP|
000011a0  20 20 20 52 31 30 2c 23  34 20 20 20 20 20 20 20  |   R10,#4       |
000011b0  20 20 20 20 20 20 20 20  3b 20 69 73 20 73 63 72  |        ; is scr|
000011c0  6f 6c 6c 20 6f 66 66 73  65 74 3d 34 0d 05 0a 3c  |oll offset=4...<|
000011d0  20 20 20 20 20 20 20 20  20 20 20 20 ec 51 20 52  |            .Q R|
000011e0  33 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |3,#0            |
000011f0  20 20 20 20 3b 20 69 66  20 73 6f 2c 20 77 61 76  |    ; if so, wav|
00001200  65 5f 70 6f 73 2b 3d 30  0d 05 14 3f 20 20 20 20  |e_pos+=0...?    |
00001210  20 20 20 20 20 20 20 20  4d 4f 56 4e 45 20 52 33  |        MOVNE R3|
00001220  2c 23 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#4             |
00001230  20 20 20 3b 20 20 65 6c  73 65 2c 20 77 61 76 65  |   ;  else, wave|
00001240  5f 70 6f 73 2b 3d 34 0d  05 1e 23 20 20 20 20 20  |_pos+=4...#     |
00001250  20 20 20 20 20 20 20 4c  44 52 20 20 20 52 31 31  |       LDR   R11|
00001260  2c 77 61 76 65 5f 70 6f  73 25 0d 05 28 20 20 20  |,wave_pos%..(   |
00001270  20 20 20 20 20 20 20 20  20 20 41 44 44 20 20 20  |          ADD   |
00001280  52 31 31 2c 52 31 31 2c  52 33 0d 05 32 44 20 20  |R11,R11,R3..2D  |
00001290  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
000012a0  52 34 2c 6d 61 78 5f 50  25 20 20 20 20 20 20 20  |R4,max_P%       |
000012b0  20 20 20 20 20 3b 20 72  34 3d 6c 65 6e 67 74 68  |     ; r4=length|
000012c0  20 6f 66 20 77 61 76 65  20 74 61 62 6c 65 0d 05  | of wave table..|
000012d0  3c 41 20 20 20 20 20 20  20 20 20 20 20 20 43 4d  |<A            CM|
000012e0  50 20 20 20 52 31 31 2c  52 34 20 20 20 20 20 20  |P   R11,R4      |
000012f0  20 20 20 20 20 20 20 20  20 3b 20 69 73 20 77 61  |         ; is wa|
00001300  76 65 5f 70 6f 73 20 3e  20 74 68 69 73 20 3f 0d  |ve_pos > this ?.|
00001310  05 46 3e 20 20 20 20 20  20 20 20 20 20 20 20 4d  |.F>            M|
00001320  4f 56 47 45 20 52 31 31  2c 23 30 20 20 20 20 20  |OVGE R11,#0     |
00001330  20 20 20 20 20 20 20 20  20 20 3b 20 69 66 20 73  |          ; if s|
00001340  6f 2c 20 77 61 76 65 5f  70 6f 73 3d 30 0d 05 50  |o, wave_pos=0..P|
00001350  3b 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |;            STR|
00001360  20 20 20 52 31 31 2c 77  61 76 65 5f 70 6f 73 25  |   R11,wave_pos%|
00001370  20 20 20 20 20 20 20 20  3b 20 73 74 6f 72 65 20  |        ; store |
00001380  77 61 76 65 5f 70 6f 73  0d 05 5a 04 0d 05 64 3e  |wave_pos..Z...d>|
00001390  2e 6c 65 74 20 20 20 20  20 20 20 20 4c 44 52 42  |.let        LDRB|
000013a0  20 20 52 33 2c 5b 52 31  2c 52 39 5d 20 20 20 20  |  R3,[R1,R9]    |
000013b0  20 20 20 20 20 20 20 3b  20 72 33 3d 6c 65 74 74  |       ; r3=lett|
000013c0  65 72 20 74 6f 20 70 6c  6f 74 0d 05 6e 44 20 20  |er to plot..nD  |
000013d0  20 20 20 20 20 20 20 20  20 20 41 44 44 20 20 20  |          ADD   |
000013e0  52 39 2c 52 39 2c 23 31  20 20 20 20 20 20 20 20  |R9,R9,#1        |
000013f0  20 20 20 20 20 3b 20 69  6e 63 72 65 6d 65 6e 74  |     ; increment|
00001400  20 74 65 78 74 20 70 6f  73 69 74 69 6f 6e 0d 05  | text position..|
00001410  78 42 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |xB            LD|
00001420  52 20 20 20 52 35 2c 6c  65 6e 67 74 68 25 20 20  |R   R5,length%  |
00001430  20 20 20 20 20 20 20 20  20 3b 20 69 73 20 69 74  |         ; is it|
00001440  20 3e 3d 20 74 68 65 20  6c 65 6e 67 74 68 20 3f  | >= the length ?|
00001450  0d 05 82 43 20 20 20 20  20 20 20 20 20 20 20 20  |...C            |
00001460  43 4d 50 20 20 20 52 39  2c 52 35 20 20 20 20 20  |CMP   R9,R5     |
00001470  20 20 20 20 20 20 20 20  20 20 20 3b 20 69 66 20  |           ; if |
00001480  73 6f 2c 20 67 6f 20 74  6f 20 74 68 65 20 73 74  |so, go to the st|
00001490  61 72 74 0d 05 8c 2c 20  20 20 20 20 20 20 20 20  |art...,         |
000014a0  20 20 20 4d 4f 56 47 45  20 52 39 2c 23 31 37 20  |   MOVGE R9,#17 |
000014b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 0d  |              ;.|
000014c0  05 96 41 20 20 20 20 20  20 20 20 20 20 20 20 43  |..A            C|
000014d0  4d 50 20 20 20 52 33 2c  23 97 22 61 22 20 20 20  |MP   R3,#."a"   |
000014e0  20 20 20 20 20 20 20 20  3b 20 69 73 20 69 74 20  |        ; is it |
000014f0  61 20 74 72 69 67 67 65  72 20 63 68 61 72 20 3f  |a trigger char ?|
00001500  0d 05 a0 41 20 20 20 20  20 20 20 20 20 20 20 20  |...A            |
00001510  4d 4f 56 47 45 20 52 33  2c 23 97 22 20 22 20 20  |MOVGE R3,#." "  |
00001520  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 73 6f  |         ; if so|
00001530  2c 20 64 69 73 70 6c 61  79 20 61 20 73 70 61 63  |, display a spac|
00001540  65 0d 05 aa 3f 20 20 20  20 20 20 20 20 20 20 20  |e...?           |
00001550  20 43 4d 50 20 20 20 52  33 2c 23 97 22 20 22 20  | CMP   R3,#." " |
00001560  20 20 20 20 20 20 20 20  20 20 3b 20 69 73 20 69  |          ; is i|
00001570  74 20 69 6e 76 61 6c 69  64 20 63 68 61 72 20 3f  |t invalid char ?|
00001580  0d 05 b4 41 20 20 20 20  20 20 20 20 20 20 20 20  |...A            |
00001590  4d 4f 56 4c 54 20 52 33  2c 23 97 22 20 22 20 20  |MOVLT R3,#." "  |
000015a0  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 73 6f  |         ; if so|
000015b0  2c 20 64 69 73 70 6c 61  79 20 61 20 73 70 61 63  |, display a spac|
000015c0  65 0d 05 be 43 20 20 20  20 20 20 20 20 20 20 20  |e...C           |
000015d0  20 53 55 42 20 20 20 52  33 2c 52 33 2c 23 33 32  | SUB   R3,R3,#32|
000015e0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 63 68  |            ; ch|
000015f0  61 72 61 63 74 65 72 3d  63 68 61 72 61 63 74 65  |aracter=characte|
00001600  72 2d 33 32 0d 05 c8 43  20 20 20 20 20 20 20 20  |r-32...C        |
00001610  20 20 20 20 41 44 44 20  20 20 52 38 2c 52 30 2c  |    ADD   R8,R0,|
00001620  52 33 2c 4c 53 4c 23 39  20 20 20 20 20 20 20 3b  |R3,LSL#9       ;|
00001630  20 72 38 3d 66 6f 6e 74  2b 28 63 68 61 72 2a 31  | r8=font+(char*1|
00001640  36 2a 31 36 2a 32 29 0d  05 d2 3e 20 20 20 20 20  |6*16*2)...>     |
00001650  20 20 20 20 20 20 20 4c  44 52 20 20 20 52 33 2c  |       LDR   R3,|
00001660  74 61 62 6c 65 5f 50 25  20 20 20 20 20 20 20 20  |table_P%        |
00001670  20 20 3b 20 72 33 3d 77  61 76 65 66 6f 72 6d 20  |  ; r3=waveform |
00001680  74 61 62 6c 65 0d 05 dc  3f 20 20 20 20 20 20 20  |table...?       |
00001690  20 20 20 20 20 4c 44 52  20 20 20 52 34 2c 5b 52  |     LDR   R4,[R|
000016a0  33 2c 52 31 31 5d 20 20  20 20 20 20 20 20 20 20  |3,R11]          |
000016b0  3b 20 67 65 74 20 77 61  76 65 66 6f 72 6d 20 65  |; get waveform e|
000016c0  6e 74 72 79 0d 05 e6 46  20 20 20 20 20 20 20 20  |ntry...F        |
000016d0  20 20 20 20 4c 44 52 20  20 20 52 31 34 2c 6d 61  |    LDR   R14,ma|
000016e0  78 5f 50 25 20 20 20 20  20 20 20 20 20 20 20 3b  |x_P%           ;|
000016f0  20 72 31 34 3d 6c 65 6e  20 6f 66 20 77 61 76 65  | r14=len of wave|
00001700  66 6f 72 6d 20 74 61 62  6c 65 0d 05 f0 3f 20 20  |form table...?  |
00001710  20 20 20 20 20 20 20 20  20 20 53 55 42 53 20 20  |          SUBS  |
00001720  52 31 31 2c 52 31 31 2c  23 34 20 20 20 20 20 20  |R11,R11,#4      |
00001730  20 20 20 20 20 3b 20 6d  6f 76 65 20 74 6f 20 6e  |     ; move to n|
00001740  65 78 74 20 65 6e 74 72  79 0d 05 fa 44 20 20 20  |ext entry...D   |
00001750  20 20 20 20 20 20 20 20  20 41 44 44 4d 49 20 52  |         ADDMI R|
00001760  31 31 2c 52 31 31 2c 52  31 34 20 20 20 20 20 20  |11,R11,R14      |
00001770  20 20 20 20 3b 20 69 66  20 65 78 63 65 65 64 65  |    ; if exceede|
00001780  64 2c 20 70 74 72 3d 6c  65 6e 67 74 68 0d 06 04  |d, ptr=length...|
00001790  46 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |F            STR|
000017a0  20 20 20 52 32 2c 6f 6c  64 5f 73 63 72 25 20 20  |   R2,old_scr%  |
000017b0  20 20 20 20 20 20 20 20  3b 20 73 74 6f 72 65 20  |        ; store |
000017c0  73 63 72 65 65 6e 20 61  64 64 72 65 73 73 20 61  |screen address a|
000017d0  77 61 79 0d 06 0e 43 20  20 20 20 20 20 20 20 20  |way...C         |
000017e0  20 20 20 41 44 44 20 20  20 52 32 2c 52 32 2c 52  |   ADD   R2,R2,R|
000017f0  34 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |4             ; |
00001800  73 63 72 3d 73 63 72 2b  77 61 76 65 66 6f 72 6d  |scr=scr+waveform|
00001810  20 65 6e 74 72 79 0d 06  18 46 20 20 20 20 20 20  | entry...F      |
00001820  20 20 20 20 20 20 43 4d  50 20 20 20 52 37 2c 23  |      CMP   R7,#|
00001830  31 37 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |17              |
00001840  20 3b 20 69 73 20 74 68  69 73 20 74 68 65 20 6c  | ; is this the l|
00001850  65 66 74 20 6c 65 74 74  65 72 20 3f 0d 06 22 43  |eft letter ?.."C|
00001860  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 45 51  |            BLEQ|
00001870  20 20 6c 65 66 74 5f 6c  65 74 20 20 20 20 20 20  |  left_let      |
00001880  20 20 20 20 20 20 20 3b  20 69 66 20 73 6f 2c 20  |       ; if so, |
00001890  63 61 6c 6c 20 27 6c 65  66 74 5f 6c 65 74 27 0d  |call 'left_let'.|
000018a0  06 2c 3b 20 20 20 20 20  20 20 20 20 20 20 20 42  |.,;            B|
000018b0  45 51 20 20 20 73 6b 69  70 20 20 20 20 20 20 20  |EQ   skip       |
000018c0  20 20 20 20 20 20 20 20  20 20 3b 20 20 20 67 6f  |          ;   go|
000018d0  20 74 6f 20 27 73 6b 69  70 27 0d 06 36 44 20 20  | to 'skip'..6D  |
000018e0  20 20 20 20 20 20 20 20  20 20 43 4d 50 20 20 20  |          CMP   |
000018f0  52 37 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |R7,#1           |
00001900  20 20 20 20 20 3b 20 69  73 20 74 68 69 73 20 74  |     ; is this t|
00001910  68 65 20 72 69 67 68 74  20 6c 65 74 20 3f 0d 06  |he right let ?..|
00001920  40 44 20 20 20 20 20 20  20 20 20 20 20 20 42 4c  |@D            BL|
00001930  45 51 20 20 72 69 67 68  74 5f 6c 65 74 20 20 20  |EQ  right_let   |
00001940  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 73 6f  |         ; if so|
00001950  2c 20 63 61 6c 6c 20 27  72 69 67 68 74 5f 6c 65  |, call 'right_le|
00001960  74 27 0d 06 4a 3b 20 20  20 20 20 20 20 20 20 20  |t'..J;          |
00001970  20 20 42 45 51 20 20 20  73 6b 69 70 20 20 20 20  |  BEQ   skip    |
00001980  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 20  |             ;  |
00001990  20 67 6f 20 74 6f 20 27  73 6b 69 70 27 0d 06 54  | go to 'skip'..T|
000019a0  42 20 20 20 20 20 20 20  20 20 20 20 20 42 4c 20  |B            BL |
000019b0  20 20 20 77 68 6f 6c 65  5f 6c 65 74 20 20 20 20  |   whole_let    |
000019c0  20 20 20 20 20 20 20 20  3b 20 65 6c 73 65 20 63  |        ; else c|
000019d0  61 6c 6c 20 27 77 68 6f  6c 65 5f 6c 65 74 27 0d  |all 'whole_let'.|
000019e0  06 5e 42 2e 73 6b 69 70  20 20 20 20 20 20 20 4c  |.^B.skip       L|
000019f0  44 52 20 20 20 52 32 2c  6f 6c 64 5f 73 63 72 25  |DR   R2,old_scr%|
00001a00  20 20 20 20 20 20 20 20  20 20 3b 20 72 32 3d 6f  |          ; r2=o|
00001a10  6c 64 20 73 63 72 65 65  6e 20 61 64 64 72 65 73  |ld screen addres|
00001a20  73 0d 06 68 44 20 20 20  20 20 20 20 20 20 20 20  |s..hD           |
00001a30  20 41 44 44 20 20 20 52  32 2c 52 32 2c 23 32 30  | ADD   R2,R2,#20|
00001a40  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 6d 6f  |            ; mo|
00001a50  76 65 20 74 6f 20 6e 65  78 74 20 73 63 72 65 65  |ve to next scree|
00001a60  6e 20 70 6f 73 0d 06 72  45 20 20 20 20 20 20 20  |n pos..rE       |
00001a70  20 20 20 20 20 53 55 42  53 20 20 52 37 2c 52 37  |     SUBS  R7,R7|
00001a80  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
00001a90  3b 20 61 6e 79 20 6d 6f  72 65 20 6c 65 74 74 65  |; any more lette|
00001aa0  72 73 20 74 6f 20 64 6f  20 3f 0d 06 7c 3f 20 20  |rs to do ?..|?  |
00001ab0  20 20 20 20 20 20 20 20  20 20 42 4e 45 20 20 20  |          BNE   |
00001ac0  6c 65 74 20 20 20 20 20  20 20 20 20 20 20 20 20  |let             |
00001ad0  20 20 20 20 20 3b 20 69  66 20 73 6f 2c 20 67 6f  |     ; if so, go|
00001ae0  20 74 6f 20 27 6c 65 74  27 0d 06 86 35 20 20 20  | to 'let'...5   |
00001af0  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 52  |         LDR   R|
00001b00  31 31 2c 66 6c 61 67 25  20 20 20 20 20 20 20 20  |11,flag%        |
00001b10  20 20 20 20 3b 20 72 31  31 3d 66 6c 61 67 0d 06  |    ; r11=flag..|
00001b20  90 31 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |.1            LD|
00001b30  4d 46 44 20 52 31 33 21  2c 7b 52 30 2d 52 31 30  |MFD R13!,{R0-R10|
00001b40  2c 50 43 7d 20 20 20 20  20 3b 20 65 78 69 74 0d  |,PC}     ; exit.|
00001b50  06 9a 04 0d 06 a4 04 0d  06 ae 17 2e 6f 6c 64 5f  |............old_|
00001b60  73 63 72 25 20 20 20 45  51 55 44 20 20 30 0d 06  |scr%   EQUD  0..|
00001b70  b8 17 2e 77 61 76 65 5f  70 6f 73 25 20 20 45 51  |...wave_pos%  EQ|
00001b80  55 44 20 20 30 0d 06 c2  17 2e 74 61 62 6c 65 5f  |UD  0.....table_|
00001b90  50 25 20 20 20 45 51 55  44 20 20 30 0d 06 cc 17  |P%   EQUD  0....|
00001ba0  2e 6d 61 78 5f 50 25 20  20 20 20 20 45 51 55 44  |.max_P%     EQUD|
00001bb0  20 20 30 0d 06 d6 17 2e  6c 65 74 5f 70 6f 73 25  |  0.....let_pos%|
00001bc0  20 20 20 45 51 55 44 20  20 30 0d 06 e0 17 2e 6c  |   EQUD  0.....l|
00001bd0  65 6e 67 74 68 25 20 20  20 20 45 51 55 44 20 20  |ength%    EQUD  |
00001be0  30 0d 06 ea 17 2e 6f 66  66 73 65 74 25 20 20 20  |0.....offset%   |
00001bf0  20 45 51 55 44 20 20 30  0d 06 f4 04 0d 06 fe 04  | EQUD  0........|
00001c00  0d 07 08 2e 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
00001c10  3b 20 4f 6e 20 65 6e 74  72 79 20 2d 20 72 32 3d  |; On entry - r2=|
00001c20  73 63 72 65 65 6e 20 61  64 64 72 65 73 73 0d 07  |screen address..|
00001c30  12 2e 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |..            ; |
00001c40  20 20 20 20 20 20 20 20  20 20 20 72 38 3d 73 70  |           r8=sp|
00001c50  72 69 74 65 20 61 64 64  72 65 73 73 0d 07 1c 04  |rite address....|
00001c60  0d 07 26 2d 2e 77 68 6f  6c 65 5f 6c 65 74 20 20  |..&-.whole_let  |
00001c70  53 54 4d 46 44 20 52 31  33 21 2c 7b 52 30 2d 52  |STMFD R13!,{R0-R|
00001c80  31 2c 52 39 2d 52 31 30  2c 52 31 34 7d 0d 07 30  |1,R9-R10,R14}..0|
00001c90  3c 20 20 20 20 20 20 20  20 20 20 20 20 41 44 44  |<            ADD|
00001ca0  20 20 20 52 39 2c 52 38  2c 23 28 31 36 2a 31 36  |   R9,R8,#(16*16|
00001cb0  29 20 20 20 20 20 20 20  3b 20 72 39 3d 6d 61 73  |)       ; r9=mas|
00001cc0  6b 20 61 64 64 72 65 73  73 0d 07 3a 04 0d 07 44  |k address..:...D|
00001cd0  11 20 20 20 20 20 20 20  20 20 20 20 20 5d 0d 07  |.            ]..|
00001ce0  4e 20 20 20 20 20 20 20  20 20 20 20 20 20 e3 20  |N             . |
00001cf0  6c 6f 6f 70 25 20 3d 20  31 20 b8 20 31 36 0d 07  |loop% = 1 . 16..|
00001d00  58 22 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |X"              |
00001d10  e3 20 6c 6f 6f 70 32 25  20 3d 20 31 20 b8 20 32  |. loop2% = 1 . 2|
00001d20  0d 07 62 1e 20 20 20 20  20 20 20 20 20 20 20 20  |..b.            |
00001d30  20 20 20 20 5b 4f 50 54  20 70 61 73 73 25 0d 07  |    [OPT pass%..|
00001d40  6c 04 0d 07 76 3f 20 20  20 20 20 20 20 20 20 20  |l...v?          |
00001d50  20 20 4c 44 4d 49 41 20  52 38 21 2c 7b 52 33 2d  |  LDMIA R8!,{R3-|
00001d60  52 34 7d 20 20 20 20 20  20 20 20 20 20 3b 20 67  |R4}          ; g|
00001d70  65 74 20 32 20 73 70 72  69 74 65 20 77 6f 72 64  |et 2 sprite word|
00001d80  73 0d 07 80 3d 20 20 20  20 20 20 20 20 20 20 20  |s...=           |
00001d90  20 4c 44 4d 49 41 20 52  39 21 2c 7b 52 35 2d 52  | LDMIA R9!,{R5-R|
00001da0  36 7d 20 20 20 20 20 20  20 20 20 20 3b 20 67 65  |6}          ; ge|
00001db0  74 20 32 20 6d 61 73 6b  20 77 6f 72 64 73 0d 07  |t 2 mask words..|
00001dc0  8a 3f 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |.?            LD|
00001dd0  4d 49 41 20 52 32 20 2c  7b 52 30 2d 52 31 7d 20  |MIA R2 ,{R0-R1} |
00001de0  20 20 20 20 20 20 20 20  20 3b 20 67 65 74 20 32  |         ; get 2|
00001df0  20 73 63 72 65 65 6e 20  77 6f 72 64 73 0d 07 94  | screen words...|
00001e00  3f 20 20 20 20 20 20 20  20 20 20 20 20 80 20 20  |?            .  |
00001e10  20 52 30 2c 52 30 2c 52  35 20 20 20 20 20 20 20  | R0,R0,R5       |
00001e20  20 20 20 20 20 20 3b 20  73 63 72 65 65 6e 3d 73  |      ; screen=s|
00001e30  63 72 65 65 6e 20 80 20  6d 61 73 6b 0d 07 9e 40  |creen . mask...@|
00001e40  20 20 20 20 20 20 20 20  20 20 20 20 84 52 20 20  |            .R  |
00001e50  20 52 35 2c 52 30 2c 52  33 20 20 20 20 20 20 20  | R5,R0,R3       |
00001e60  20 20 20 20 20 20 3b 20  6d 61 73 6b 3d 73 63 72  |      ; mask=scr|
00001e70  65 65 6e 20 84 20 73 70  72 69 74 65 0d 07 a8 41  |een . sprite...A|
00001e80  20 20 20 20 20 20 20 20  20 20 20 20 80 20 20 20  |            .   |
00001e90  52 31 2c 52 31 2c 52 36  20 20 20 20 20 20 20 20  |R1,R1,R6        |
00001ea0  20 20 20 20 20 3b 20 61  62 6f 76 65 20 70 72 6f  |     ; above pro|
00001eb0  63 65 73 73 20 72 65 70  65 61 74 65 64 0d 07 b2  |cess repeated...|
00001ec0  3e 20 20 20 20 20 20 20  20 20 20 20 20 84 52 20  |>            .R |
00001ed0  20 20 52 36 2c 52 31 2c  52 34 20 20 20 20 20 20  |  R6,R1,R4      |
00001ee0  20 20 20 20 20 20 20 3b  20 66 6f 72 20 74 68 65  |       ; for the|
00001ef0  20 6f 74 68 65 72 20 77  6f 72 64 0d 07 bc 36 20  | other word...6 |
00001f00  20 20 20 20 20 20 20 20  20 20 20 53 54 4d 49 41  |           STMIA|
00001f10  20 52 32 21 2c 7b 52 35  2d 52 36 7d 20 20 20 20  | R2!,{R5-R6}    |
00001f20  20 20 20 20 20 20 3b 20  70 6c 6f 74 20 64 61 74  |      ; plot dat|
00001f30  61 0d 07 c6 04 0d 07 d0  15 20 20 20 20 20 20 20  |a........       |
00001f40  20 20 20 20 20 20 20 20  20 5d 0d 07 da 13 20 20  |         ]....  |
00001f50  20 20 20 20 20 20 20 20  20 20 20 20 ed 0d 07 e4  |            ....|
00001f60  1c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5b  |.              [|
00001f70  4f 50 54 20 70 61 73 73  25 0d 07 ee 04 0d 07 f8  |OPT pass%.......|
00001f80  3e 20 20 20 20 20 20 20  20 20 20 20 20 41 44 44  |>            ADD|
00001f90  20 20 20 52 32 2c 52 32  2c 23 28 33 32 30 2d 31  |   R2,R2,#(320-1|
00001fa0  36 29 20 20 20 20 20 20  3b 20 6d 6f 76 65 20 74  |6)      ; move t|
00001fb0  6f 20 6e 65 78 74 20 6c  69 6e 65 0d 08 02 04 0d  |o next line.....|
00001fc0  08 0c 13 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00001fd0  20 5d 0d 08 16 11 20 20  20 20 20 20 20 20 20 20  | ]....          |
00001fe0  20 20 ed 0d 08 20 1a 20  20 20 20 20 20 20 20 20  |  ... .         |
00001ff0  20 20 20 5b 4f 50 54 20  70 61 73 73 25 0d 08 2a  |   [OPT pass%..*|
00002000  04 0d 08 34 2c 20 20 20  20 20 20 20 20 20 20 20  |...4,           |
00002010  20 4c 44 4d 46 44 20 52  31 33 21 2c 7b 52 30 2d  | LDMFD R13!,{R0-|
00002020  52 31 2c 52 39 2d 52 31  30 2c 50 43 7d 0d 08 3e  |R1,R9-R10,PC}..>|
00002030  04 0d 08 48 04 0d 08 52  2e 20 20 20 20 20 20 20  |...H...R.       |
00002040  20 20 20 20 20 3b 20 4f  6e 20 65 6e 74 72 79 20  |     ; On entry |
00002050  2d 20 72 32 3d 73 63 72  65 65 6e 20 61 64 64 72  |- r2=screen addr|
00002060  65 73 73 0d 08 5c 2e 20  20 20 20 20 20 20 20 20  |ess..\.         |
00002070  20 20 20 3b 20 20 20 20  20 20 20 20 20 20 20 20  |   ;            |
00002080  72 38 3d 73 70 72 69 74  65 20 61 64 64 72 65 73  |r8=sprite addres|
00002090  73 0d 08 66 2d 20 20 20  20 20 20 20 20 20 20 20  |s..f-           |
000020a0  20 3b 20 20 20 20 20 20  20 20 20 20 20 72 31 30  | ;           r10|
000020b0  3d 73 63 72 6f 6c 6c 20  6f 66 66 73 65 74 0d 08  |=scroll offset..|
000020c0  70 04 0d 08 7a 20 2e 6c  65 66 74 5f 6c 65 74 20  |p...z .left_let |
000020d0  20 20 53 54 4d 46 44 20  52 31 33 21 2c 7b 52 31  |  STMFD R13!,{R1|
000020e0  34 7d 0d 08 84 42 20 20  20 20 20 20 20 20 20 20  |4}...B          |
000020f0  20 20 43 4d 50 20 20 20  52 31 30 2c 23 31 36 20  |  CMP   R10,#16 |
00002100  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |             ; i|
00002110  73 20 6c 65 74 74 65 72  20 6f 6e 20 73 63 72 65  |s letter on scre|
00002120  65 6e 20 3f 0d 08 8e 43  20 20 20 20 20 20 20 20  |en ?...C        |
00002130  20 20 20 20 42 45 51 20  20 20 6c 6c 5f 65 6e 64  |    BEQ   ll_end|
00002140  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00002150  20 69 66 20 6e 6f 74 2c  20 67 6f 20 74 6f 20 27  | if not, go to '|
00002160  6c 6c 5f 65 6e 64 27 0d  08 98 1c 20 20 20 20 20  |ll_end'....     |
00002170  20 20 20 20 20 20 20 43  4d 50 20 20 20 52 31 30  |       CMP   R10|
00002180  2c 23 30 0d 08 a2 1c 20  20 20 20 20 20 20 20 20  |,#0....         |
00002190  20 20 20 42 45 51 20 20  20 6c 6c 5f 65 6e 64 0d  |   BEQ   ll_end.|
000021a0  08 ac 42 20 20 20 20 20  20 20 20 20 20 20 20 41  |..B            A|
000021b0  44 44 20 20 20 52 32 2c  52 32 2c 52 31 30 20 20  |DD   R2,R2,R10  |
000021c0  20 20 20 20 20 20 20 20  20 20 3b 20 73 63 72 65  |          ; scre|
000021d0  65 6e 2b 3d 73 63 72 6f  6c 6c 20 6f 66 66 73 65  |en+=scroll offse|
000021e0  74 0d 08 b6 40 20 20 20  20 20 20 20 20 20 20 20  |t...@           |
000021f0  20 4d 4f 56 20 20 20 52  35 2c 23 31 36 20 20 20  | MOV   R5,#16   |
00002200  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 35  |            ; r5|
00002210  3d 68 65 69 67 68 74 20  69 6e 20 70 69 78 65 6c  |=height in pixel|
00002220  73 0d 08 c0 3f 20 20 20  20 20 20 20 20 20 20 20  |s...?           |
00002230  20 52 53 42 20 20 20 52  36 2c 52 31 30 2c 23 31  | RSB   R6,R10,#1|
00002240  36 20 20 20 20 20 20 20  20 20 20 20 3b 20 72 36  |6           ; r6|
00002250  3d 77 69 64 74 68 20 69  6e 20 70 69 78 65 6c 73  |=width in pixels|
00002260  0d 08 ca 3f 2e 6c 6c 5f  31 20 20 20 20 20 20 20  |...?.ll_1       |
00002270  4d 4f 56 20 20 20 52 34  2c 52 36 20 20 20 20 20  |MOV   R4,R6     |
00002280  20 20 20 20 20 20 20 20  20 20 20 3b 20 63 6f 70  |           ; cop|
00002290  79 20 77 69 64 74 68 20  69 6e 74 6f 20 72 34 0d  |y width into r4.|
000022a0  08 d4 42 20 20 20 20 20  20 20 20 20 20 20 20 41  |..B            A|
000022b0  44 44 20 20 20 52 38 2c  52 38 2c 52 31 30 20 20  |DD   R8,R8,R10  |
000022c0  20 20 20 20 20 20 20 20  20 20 3b 20 6f 66 66 73  |          ; offs|
000022d0  65 74 20 73 70 72 69 74  65 20 61 64 64 72 20 62  |et sprite addr b|
000022e0  79 0d 08 de 3b 20 20 20  20 20 20 20 20 20 20 20  |y...;           |
000022f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002300  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 20 73  |            ;  s|
00002310  63 72 6f 6c 6c 20 6f 66  66 73 65 74 0d 08 e8 3c  |croll offset...<|
00002320  2e 6c 6c 5f 32 20 20 20  20 20 20 20 4c 44 52 20  |.ll_2       LDR |
00002330  20 20 52 33 2c 5b 52 38  5d 2c 23 34 20 20 20 20  |  R3,[R8],#4    |
00002340  20 20 20 20 20 20 20 3b  20 67 65 74 20 73 70 72  |       ; get spr|
00002350  69 74 65 20 64 61 74 61  0d 08 f2 40 20 20 20 20  |ite data...@    |
00002360  20 20 20 20 20 20 20 20  53 54 52 20 20 20 52 33  |        STR   R3|
00002370  2c 5b 52 32 5d 2c 23 34  20 20 20 20 20 20 20 20  |,[R2],#4        |
00002380  20 20 20 3b 20 70 6c 6f  74 20 64 61 74 61 20 74  |   ; plot data t|
00002390  6f 20 73 63 72 65 65 6e  0d 08 fc 3c 20 20 20 20  |o screen...<    |
000023a0  20 20 20 20 20 20 20 20  53 55 42 53 20 20 52 34  |        SUBS  R4|
000023b0  2c 52 34 2c 23 34 20 20  20 20 20 20 20 20 20 20  |,R4,#4          |
000023c0  20 20 20 3b 20 69 73 20  74 68 65 72 65 20 6d 6f  |   ; is there mo|
000023d0  72 65 20 3f 0d 09 06 40  20 20 20 20 20 20 20 20  |re ?...@        |
000023e0  20 20 20 20 42 4e 45 20  20 20 6c 6c 5f 32 20 20  |    BNE   ll_2  |
000023f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00002400  20 69 66 20 73 6f 2c 20  67 6f 20 74 6f 20 27 6c  | if so, go to 'l|
00002410  6c 5f 32 27 0d 09 10 44  20 20 20 20 20 20 20 20  |l_2'...D        |
00002420  20 20 20 20 53 55 42 20  20 20 52 32 2c 52 32 2c  |    SUB   R2,R2,|
00002430  52 36 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |R6             ;|
00002440  20 63 6f 72 72 65 63 74  20 73 63 72 65 65 6e 20  | correct screen |
00002450  70 6f 73 69 74 69 6f 6e  0d 09 1a 3a 20 20 20 20  |position...:    |
00002460  20 20 20 20 20 20 20 20  41 44 44 20 20 20 52 32  |        ADD   R2|
00002470  2c 52 32 2c 23 33 32 30  20 20 20 20 20 20 20 20  |,R2,#320        |
00002480  20 20 20 3b 20 66 6f 72  20 6e 65 78 74 20 6c 69  |   ; for next li|
00002490  6e 65 0d 09 24 41 20 20  20 20 20 20 20 20 20 20  |ne..$A          |
000024a0  20 20 53 55 42 53 20 20  52 35 2c 52 35 2c 23 31  |  SUBS  R5,R5,#1|
000024b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |             ; i|
000024c0  73 20 74 68 65 72 65 20  6d 6f 72 65 20 72 6f 77  |s there more row|
000024d0  73 20 3f 0d 09 2e 40 20  20 20 20 20 20 20 20 20  |s ?...@         |
000024e0  20 20 20 42 4e 45 20 20  20 6c 6c 5f 31 20 20 20  |   BNE   ll_1   |
000024f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00002500  69 66 20 73 6f 2c 20 67  6f 20 74 6f 20 27 6c 6c  |if so, go to 'll|
00002510  5f 31 27 0d 09 38 31 2e  6c 6c 5f 65 6e 64 20 20  |_1'..81.ll_end  |
00002520  20 20 20 4c 44 4d 46 44  20 52 31 33 21 2c 7b 50  |   LDMFD R13!,{P|
00002530  43 7d 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |C}            ; |
00002540  65 78 69 74 0d 09 42 04  0d 09 4c 04 0d 09 56 23  |exit..B...L...V#|
00002550  2e 72 69 67 68 74 5f 6c  65 74 20 20 53 54 4d 46  |.right_let  STMF|
00002560  44 20 52 31 33 21 2c 7b  52 30 2c 52 31 34 7d 0d  |D R13!,{R0,R14}.|
00002570  09 60 40 20 20 20 20 20  20 20 20 20 20 20 20 4d  |.`@            M|
00002580  4f 56 20 20 20 52 35 2c  23 31 36 20 20 20 20 20  |OV   R5,#16     |
00002590  20 20 20 20 20 20 20 20  20 20 3b 20 72 35 3d 68  |          ; r5=h|
000025a0  65 69 67 68 74 20 69 6e  20 70 69 78 65 6c 73 0d  |eight in pixels.|
000025b0  09 6a 3d 20 20 20 20 20  20 20 20 20 20 20 20 4d  |.j=            M|
000025c0  4f 56 20 20 20 52 30 2c  52 31 30 20 20 20 20 20  |OV   R0,R10     |
000025d0  20 20 20 20 20 20 20 20  20 20 3b 20 72 30 3d 73  |          ; r0=s|
000025e0  63 72 6f 6c 6c 20 6f 66  66 73 65 74 0d 09 74 40  |croll offset..t@|
000025f0  20 20 20 20 20 20 20 20  20 20 20 20 43 4d 50 20  |            CMP |
00002600  20 20 52 30 2c 23 30 20  20 20 20 20 20 20 20 20  |  R0,#0         |
00002610  20 20 20 20 20 20 20 3b  20 69 66 20 72 30 3d 30  |       ; if r0=0|
00002620  2c 20 74 68 65 6e 20 72  30 3d 31 36 0d 09 7e 3c  |, then r0=16..~<|
00002630  20 20 20 20 20 20 20 20  20 20 20 20 ec 51 20 52  |            .Q R|
00002640  30 2c 23 31 36 20 20 20  20 20 20 20 20 20 20 20  |0,#16           |
00002650  20 20 20 20 3b 20 72 30  3d 77 69 64 74 68 20 69  |    ; r0=width i|
00002660  6e 20 70 69 78 65 6c 73  0d 09 88 1f 20 20 20 20  |n pixels....    |
00002670  20 20 20 20 20 20 20 20  52 53 42 20 20 20 52 36  |        RSB   R6|
00002680  2c 52 30 2c 23 31 36 0d  09 92 3d 2e 72 6c 5f 31  |,R0,#16...=.rl_1|
00002690  20 20 20 20 20 20 20 4d  4f 56 20 20 20 52 34 2c  |       MOV   R4,|
000026a0  52 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R0              |
000026b0  20 20 3b 20 63 6f 70 79  20 77 69 64 74 68 20 69  |  ; copy width i|
000026c0  6e 20 72 34 0d 09 9c 3c  2e 72 6c 5f 32 20 20 20  |n r4...<.rl_2   |
000026d0  20 20 20 20 4c 44 52 20  20 20 52 33 2c 5b 52 38  |    LDR   R3,[R8|
000026e0  5d 2c 23 34 20 20 20 20  20 20 20 20 20 20 20 3b  |],#4           ;|
000026f0  20 67 65 74 20 73 70 72  69 74 65 20 64 61 74 61  | get sprite data|
00002700  0d 09 a6 40 20 20 20 20  20 20 20 20 20 20 20 20  |...@            |
00002710  53 54 52 20 20 20 52 33  2c 5b 52 32 5d 2c 23 34  |STR   R3,[R2],#4|
00002720  20 20 20 20 20 20 20 20  20 20 20 3b 20 70 6c 6f  |           ; plo|
00002730  74 20 64 61 74 61 20 74  6f 20 73 63 72 65 65 6e  |t data to screen|
00002740  0d 09 b0 3c 20 20 20 20  20 20 20 20 20 20 20 20  |...<            |
00002750  53 55 42 53 20 20 52 34  2c 52 34 2c 23 34 20 20  |SUBS  R4,R4,#4  |
00002760  20 20 20 20 20 20 20 20  20 20 20 3b 20 69 73 20  |           ; is |
00002770  74 68 65 72 65 20 6d 6f  72 65 20 3f 0d 09 ba 40  |there more ?...@|
00002780  20 20 20 20 20 20 20 20  20 20 20 20 42 4e 45 20  |            BNE |
00002790  20 20 72 6c 5f 32 20 20  20 20 20 20 20 20 20 20  |  rl_2          |
000027a0  20 20 20 20 20 20 20 3b  20 69 66 20 73 6f 2c 20  |       ; if so, |
000027b0  67 6f 20 74 6f 20 27 72  6c 5f 32 27 0d 09 c4 43  |go to 'rl_2'...C|
000027c0  20 20 20 20 20 20 20 20  20 20 20 20 41 44 44 20  |            ADD |
000027d0  20 20 52 38 2c 52 38 2c  52 36 20 20 20 20 20 20  |  R8,R8,R6      |
000027e0  20 20 20 20 20 20 20 3b  20 63 6f 72 72 65 63 74  |       ; correct|
000027f0  20 73 70 72 69 74 65 20  70 74 72 20 61 6e 64 0d  | sprite ptr and.|
00002800  09 ce 44 20 20 20 20 20  20 20 20 20 20 20 20 53  |..D            S|
00002810  55 42 20 20 20 52 32 2c  52 32 2c 52 30 20 20 20  |UB   R2,R2,R0   |
00002820  20 20 20 20 20 20 20 20  20 20 3b 20 73 63 72 65  |          ; scre|
00002830  65 6e 20 70 6f 69 6e 74  65 72 20 66 6f 72 20 6e  |en pointer for n|
00002840  65 78 74 0d 09 d8 32 20  20 20 20 20 20 20 20 20  |ext...2         |
00002850  20 20 20 41 44 44 20 20  20 52 32 2c 52 32 2c 23  |   ADD   R2,R2,#|
00002860  33 32 30 20 20 20 20 20  20 20 20 20 20 20 3b 20  |320           ; |
00002870  20 6c 69 6e 65 0d 09 e2  41 20 20 20 20 20 20 20  | line...A       |
00002880  20 20 20 20 20 53 55 42  53 20 20 52 35 2c 52 35  |     SUBS  R5,R5|
00002890  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
000028a0  3b 20 69 73 20 74 68 65  72 65 20 6d 6f 72 65 20  |; is there more |
000028b0  72 6f 77 73 20 3f 0d 09  ec 40 20 20 20 20 20 20  |rows ?...@      |
000028c0  20 20 20 20 20 20 42 4e  45 20 20 20 72 6c 5f 31  |      BNE   rl_1|
000028d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000028e0  20 3b 20 69 66 20 73 6f  2c 20 67 6f 20 74 6f 20  | ; if so, go to |
000028f0  27 72 6c 5f 31 27 0d 09  f6 31 2e 72 6c 5f 65 6e  |'rl_1'...1.rl_en|
00002900  64 20 20 20 20 20 4c 44  4d 46 44 20 52 31 33 21  |d     LDMFD R13!|
00002910  2c 7b 52 30 2c 50 43 7d  20 20 20 20 20 20 20 20  |,{R0,PC}        |
00002920  20 3b 20 65 78 69 74 0d  0a 00 04 0d 0a 0a 04 0d  | ; exit.........|
00002930  0a 14 04 0d 0a 1e 09 20  20 20 20 5d 0d 0a 28 07  |.......    ]..(.|
00002940  20 20 ed 0d 0a 32 05 e1  0d 0a 3c 04 0d 0a 46 04  |  ...2....<...F.|
00002950  0d 0a 50 04 0d 0a 5a 13  dd 20 a4 61 72 72 61 79  |..P...Z.. .array|
00002960  28 73 69 7a 65 25 29 0d  0a 64 11 20 20 50 25 20  |(size%)..d.  P% |
00002970  2b 3d 20 73 69 7a 65 25  0d 0a 6e 06 3d 30 0d 0a  |+= size%..n.=0..|
00002980  78 04 0d 0a 82 04 0d 0a  8c 04 0d 0a 96 0b dd 20  |x.............. |
00002990  f2 69 6e 69 74 0d 0a a0  19 20 20 ea 20 6f 66 66  |.init....  . off|
000029a0  73 65 74 25 2c 49 25 2c  76 61 72 2c 4a 25 0d 0a  |set%,I%,var,J%..|
000029b0  aa 04 0d 0a b4 17 20 20  24 74 65 78 74 25 20 3d  |......  $text% =|
000029c0  20 c4 31 37 2c 22 20 22  29 0d 0a be 3a 20 20 ff  | .17," ")...:  .|
000029d0  22 4c 4f 41 44 20 3c 4d  6f 64 75 6c 65 73 24 44  |"LOAD <Modules$D|
000029e0  69 72 3e 2e 22 2b 6d 6f  64 75 6c 65 24 2b 22 2e  |ir>."+module$+".|
000029f0  54 65 78 74 20 22 2b c3  7e 28 74 65 78 74 25 2b  |Text "+.~(text%+|
00002a00  31 37 29 0d 0a c8 20 20  20 6c 65 6e 67 74 68 25  |17)...   length%|
00002a10  21 30 20 3d 20 74 65 78  74 5f 6c 65 6e 25 20 2b  |!0 = text_len% +|
00002a20  20 31 37 0d 0a d2 22 20  20 6f 66 66 73 65 74 25  | 17..."  offset%|
00002a30  20 20 20 3d 20 28 77 61  76 65 73 25 20 2b 20 31  |   = (waves% + 1|
00002a40  29 20 2a 20 34 0d 0a dc  04 0d 0a e6 17 20 20 e3  |) * 4........  .|
00002a50  20 49 25 20 3d 20 30 20  b8 20 77 61 76 65 73 25  | I% = 0 . waves%|
00002a60  0d 0a f0 28 20 20 20 20  6d 61 78 25 21 28 49 25  |...(    max%!(I%|
00002a70  2a 34 29 20 20 20 20 3d  20 6c 65 6e 67 74 68 25  |*4)    = length%|
00002a80  28 49 25 29 20 2a 20 34  0d 0a fa 20 20 20 20 20  |(I%) * 4...     |
00002a90  74 61 62 6c 65 73 25 21  28 49 25 2a 34 29 20 3d  |tables%!(I%*4) =|
00002aa0  20 6f 66 66 73 65 74 25  0d 0b 04 20 20 20 20 20  | offset%...     |
00002ab0  76 61 72 20 20 20 20 20  20 20 20 20 20 20 20 3d  |var            =|
00002ac0  20 76 61 72 28 49 25 29  0d 0b 0e 22 20 20 20 20  | var(I%)..."    |
00002ad0  e3 20 4a 25 20 3d 20 30  20 b8 20 6c 65 6e 67 74  |. J% = 0 . lengt|
00002ae0  68 25 28 49 25 29 20 2d  20 31 0d 0b 18 3f 20 20  |h%(I%) - 1...?  |
00002af0  20 20 20 20 74 61 62 6c  65 73 25 21 28 6f 66 66  |    tables%!(off|
00002b00  73 65 74 25 20 2b 20 28  4a 25 20 2a 20 34 29 29  |set% + (J% * 4))|
00002b10  20 3d 20 a8 28 a0 28 66  6f 72 6d 75 6c 61 24 28  | = .(.(formula$(|
00002b20  49 25 29 29 29 2a 33 32  30 0d 0b 22 30 20 20 20  |I%)))*320.."0   |
00002b30  20 20 20 76 61 72 20 20  20 20 20 20 20 20 20 20  |   var          |
00002b40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2b  |               +|
00002b50  3d 20 69 6e 63 28 49 25  29 0d 0b 2c 09 20 20 20  |= inc(I%)..,.   |
00002b60  20 ed 0d 0b 36 22 20 20  20 20 6f 66 66 73 65 74  | ...6"    offset|
00002b70  25 20 2b 3d 20 6c 65 6e  67 74 68 25 28 49 25 29  |% += length%(I%)|
00002b80  20 2a 20 34 0d 0b 40 07  20 20 ed 0d 0b 4a 04 0d  | * 4..@.  ...J..|
00002b90  0b 54 05 e1 0d 0b 5e 04  0d 0b 68 04 0d 0b 72 04  |.T....^...h...r.|
00002ba0  0d 0b 7c 1a dd 20 a4 6c  6f 77 65 72 28 73 74 72  |..|.. .lower(str|
00002bb0  69 6e 67 24 2c 70 6f 73  25 29 0d 0b 86 16 20 20  |ing$,pos%)....  |
00002bc0  ea 20 6e 65 77 24 2c 49  25 2c 61 73 63 69 69 25  |. new$,I%,ascii%|
00002bd0  0d 0b 90 1e 20 20 73 74  72 69 6e 67 24 20 3d 20  |....  string$ = |
00002be0  c0 73 74 72 69 6e 67 24  2c 70 6f 73 25 29 0d 0b  |.string$,pos%)..|
00002bf0  9a 0f 20 20 6e 65 77 24  20 3d 20 22 22 0d 0b a4  |..  new$ = ""...|
00002c00  1b 20 20 e3 20 49 25 20  3d 20 31 20 b8 20 a9 28  |.  . I% = 1 . .(|
00002c10  73 74 72 69 6e 67 24 29  0d 0b ae 27 20 20 20 20  |string$)...'    |
00002c20  61 73 63 69 69 25 20 3d  20 97 28 c1 73 74 72 69  |ascii% = .(.stri|
00002c30  6e 67 24 2c 49 25 2c 31  29 29 20 84 20 33 32 0d  |ng$,I%,1)) . 32.|
00002c40  0b b8 1a 20 20 20 20 6e  65 77 24 20 20 2b 3d 20  |...    new$  += |
00002c50  bd 28 61 73 63 69 69 25  29 0d 0b c2 07 20 20 ed  |.(ascii%)....  .|
00002c60  0d 0b cc 09 3d 6e 65 77  24 0d 0b d6 04 0d 0b e0  |....=new$.......|
00002c70  04 0d 0b ea 04 0d 0b f4  17 dd 20 f2 64 65 63 6f  |.......... .deco|
00002c80  64 65 5f 77 61 76 65 66  6f 72 6d 73 0d 0b fe 38  |de_waveforms...8|
00002c90  20 20 66 25 20 20 20 20  20 3d 20 ad 20 28 22 3c  |  f%     = . ("<|
00002ca0  4d 6f 64 75 6c 65 73 24  44 69 72 3e 2e 22 2b 6d  |Modules$Dir>."+m|
00002cb0  6f 64 75 6c 65 24 2b 22  2e 57 61 76 65 66 6f 72  |odule$+".Wavefor|
00002cc0  6d 73 22 29 0d 0c 08 47  20 20 e7 20 66 25 20 3d  |ms")...G  . f% =|
00002cd0  20 30 20 8c 20 85 20 30  2c 28 6d 6f 64 75 6c 65  | 0 . . 0,(module|
00002ce0  24 2b 22 3a 20 57 61 76  65 66 6f 72 6d 73 20 74  |$+": Waveforms t|
00002cf0  65 78 74 20 73 63 72 69  70 74 20 66 69 6c 65 20  |ext script file |
00002d00  6e 6f 74 20 66 6f 75 6e  64 22 29 0d 0c 12 11 20  |not found").... |
00002d10  20 77 61 76 65 73 25 20  3d 20 2d 31 0d 0c 1c 07  | waves% = -1....|
00002d20  20 20 f5 0d 0c 26 11 20  20 20 20 61 24 20 3d 20  |  ...&.    a$ = |
00002d30  be 23 66 25 0d 0c 30 2a  20 20 20 20 e7 20 a4 6c  |.#f%..0*    . .l|
00002d40  6f 77 65 72 28 61 24 2c  33 29 3d 22 69 64 3a 22  |ower(a$,3)="id:"|
00002d50  20 8c 20 77 61 76 65 73  25 20 2b 3d 20 31 0d 0c  | . waves% += 1..|
00002d60  3a 0c 20 20 fd 20 c5 23  66 25 0d 0c 44 0a 20 20  |:.  . .#f%..D.  |
00002d70  d9 23 66 25 0d 0c 4e 04  0d 0c 58 15 20 20 e7 20  |.#f%..N...X.  . |
00002d80  77 61 76 65 73 25 20 3e  3d 20 30 20 8c 0d 0c 62  |waves% >= 0 ...b|
00002d90  04 0d 0c 6c 36 20 20 20  20 66 25 20 3d 20 ad 20  |...l6    f% = . |
00002da0  28 22 3c 4d 6f 64 75 6c  65 73 24 44 69 72 3e 2e  |("<Modules$Dir>.|
00002db0  22 2b 6d 6f 64 75 6c 65  24 2b 22 2e 57 61 76 65  |"+module$+".Wave|
00002dc0  66 6f 72 6d 73 22 29 0d  0c 76 31 20 20 20 20 de  |forms")..v1    .|
00002dd0  20 69 64 24 28 77 61 76  65 73 25 29 2c 6c 65 6e  | id$(waves%),len|
00002de0  67 74 68 25 28 77 61 76  65 73 25 29 2c 76 61 72  |gth%(waves%),var|
00002df0  28 77 61 76 65 73 25 29  0d 0c 80 26 20 20 20 20  |(waves%)...&    |
00002e00  de 20 69 6e 63 28 77 61  76 65 73 25 29 2c 66 6f  |. inc(waves%),fo|
00002e10  72 6d 75 6c 61 24 28 77  61 76 65 73 25 29 0d 0c  |rmula$(waves%)..|
00002e20  8a 13 20 20 20 20 65 72  72 6f 72 24 20 3d 20 22  |..    error$ = "|
00002e30  22 0d 0c 94 12 20 20 20  20 77 61 76 65 25 20 20  |"....    wave%  |
00002e40  3d 20 30 0d 0c 9e 12 20  20 20 20 6c 69 6e 65 25  |= 0....    line%|
00002e50  20 20 3d 20 30 0d 0c a8  09 20 20 20 20 f5 0d 0c  |  = 0....    ...|
00002e60  b2 17 20 20 20 20 20 20  61 24 20 20 20 20 20 3d  |..      a$     =|
00002e70  20 be 23 66 25 0d 0c bc  14 20 20 20 20 20 20 6c  | .#f%....      l|
00002e80  69 6e 65 25 20 2b 3d 20  31 0d 0c c6 22 20 20 20  |ine% += 1..."   |
00002e90  20 20 20 e7 20 a4 6c 6f  77 65 72 28 61 24 2c 33  |   . .lower(a$,3|
00002ea0  29 20 3d 20 22 69 64 3a  22 20 8c 0d 0c d0 1c 20  |) = "id:" ..... |
00002eb0  20 20 20 20 20 20 20 70  6f 73 25 20 3d 20 a7 61  |       pos% = .a|
00002ec0  24 2c 22 22 22 22 29 0d  0c da 18 20 20 20 20 20  |$,"""")....     |
00002ed0  20 20 20 e7 20 70 6f 73  25 20 3e 20 30 20 8c 0d  |   . pos% > 0 ..|
00002ee0  0c e4 28 20 20 20 20 20  20 20 20 20 20 69 64 24  |..(          id$|
00002ef0  28 77 61 76 65 25 29 20  3d 20 c1 61 24 2c 70 6f  |(wave%) = .a$,po|
00002f00  73 25 2b 31 2c 31 29 0d  0c ee 1f 20 20 20 20 20  |s%+1,1)....     |
00002f10  20 20 20 20 20 61 24 20  20 20 20 20 20 20 20 20  |     a$         |
00002f20  3d 20 be 23 66 25 0d 0c  f8 1c 20 20 20 20 20 20  |= .#f%....      |
00002f30  20 20 20 20 6c 69 6e 65  25 20 20 20 20 20 2b 3d  |    line%     +=|
00002f40  20 31 0d 0d 02 2a 20 20  20 20 20 20 20 20 20 20  | 1...*          |
00002f50  e7 20 a4 6c 6f 77 65 72  28 61 24 2c 37 29 20 3d  |. .lower(a$,7) =|
00002f60  20 22 6c 65 6e 67 74 68  3a 22 20 8c 0d 0d 0c 1f  | "length:" .....|
00002f70  20 20 20 20 20 20 20 20  20 20 20 20 70 6f 73 25  |            pos%|
00002f80  20 3d 20 a7 61 24 2c 22  3d 22 29 0d 0d 16 1c 20  | = .a$,"=").... |
00002f90  20 20 20 20 20 20 20 20  20 20 20 e7 20 70 6f 73  |           . pos|
00002fa0  25 20 3e 20 30 20 8c 0d  0d 20 37 20 20 20 20 20  |% > 0 ... 7     |
00002fb0  20 20 20 20 20 20 20 20  20 6c 65 6e 67 74 68 25  |         length%|
00002fc0  28 77 61 76 65 25 29 20  3d 20 a0 28 c2 61 24 2c  |(wave%) = .(.a$,|
00002fd0  a9 28 61 24 29 20 2d 20  70 6f 73 25 29 29 0d 0d  |.(a$) - pos%))..|
00002fe0  2a 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*1              |
00002ff0  6c 65 6e 67 74 68 20 20  20 20 20 20 20 20 20 3d  |length         =|
00003000  20 6c 65 6e 67 74 68 25  28 77 61 76 65 25 29 0d  | length%(wave%).|
00003010  0d 34 27 20 20 20 20 20  20 20 20 20 20 20 20 20  |.4'             |
00003020  20 61 24 20 20 20 20 20  20 20 20 20 20 20 20 20  | a$             |
00003030  3d 20 be 23 66 25 0d 0d  3e 24 20 20 20 20 20 20  |= .#f%..>$      |
00003040  20 20 20 20 20 20 20 20  6c 69 6e 65 25 20 20 20  |        line%   |
00003050  20 20 20 20 20 20 2b 3d  20 31 0d 0d 48 2b 20 20  |      += 1..H+  |
00003060  20 20 20 20 20 20 20 20  20 20 20 20 e7 20 a4 6c  |            . .l|
00003070  6f 77 65 72 28 61 24 2c  34 29 20 3d 20 22 76 61  |ower(a$,4) = "va|
00003080  72 3a 22 20 8c 0d 0d 52  23 20 20 20 20 20 20 20  |r:" ...R#       |
00003090  20 20 20 20 20 20 20 20  20 70 6f 73 25 20 3d 20  |         pos% = |
000030a0  a7 61 24 2c 22 3d 22 29  0d 0d 5c 20 20 20 20 20  |.a$,"=")..\     |
000030b0  20 20 20 20 20 20 20 20  20 20 20 20 e7 20 70 6f  |            . po|
000030c0  73 25 20 3e 20 30 20 8c  0d 0d 66 37 20 20 20 20  |s% > 0 ...f7    |
000030d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 76 61  |              va|
000030e0  72 28 77 61 76 65 25 29  20 3d 20 a0 28 c2 61 24  |r(wave%) = .(.a$|
000030f0  2c a9 28 61 24 29 20 2d  20 70 6f 73 25 29 29 0d  |,.(a$) - pos%)).|
00003100  0d 70 27 20 20 20 20 20  20 20 20 20 20 20 20 20  |.p'             |
00003110  20 20 20 20 20 61 24 20  20 20 20 20 20 20 20 20  |     a$         |
00003120  3d 20 be 23 66 25 0d 0d  7a 24 20 20 20 20 20 20  |= .#f%..z$      |
00003130  20 20 20 20 20 20 20 20  20 20 20 20 6c 69 6e 65  |            line|
00003140  25 20 20 20 20 20 2b 3d  20 31 0d 0d 84 2f 20 20  |%     += 1.../  |
00003150  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003160  e7 20 a4 6c 6f 77 65 72  28 61 24 2c 34 29 20 3d  |. .lower(a$,4) =|
00003170  20 22 69 6e 63 3a 22 20  8c 0d 0d 8e 27 20 20 20  | "inc:" ....'   |
00003180  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003190  20 70 6f 73 25 20 3d 20  a7 61 24 2c 22 3d 22 29  | pos% = .a$,"=")|
000031a0  0d 0d 98 24 20 20 20 20  20 20 20 20 20 20 20 20  |...$            |
000031b0  20 20 20 20 20 20 20 20  e7 20 70 6f 73 25 20 3e  |        . pos% >|
000031c0  20 30 20 8c 0d 0d a2 3b  20 20 20 20 20 20 20 20  | 0 ....;        |
000031d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 69 6e  |              in|
000031e0  63 28 77 61 76 65 25 29  20 3d 20 a0 28 c2 61 24  |c(wave%) = .(.a$|
000031f0  2c a9 28 61 24 29 20 2d  20 70 6f 73 25 29 29 0d  |,.(a$) - pos%)).|
00003200  0d ac 19 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00003210  20 20 20 20 20 20 20 cc  0d 0d b6 42 20 20 20 20  |       ....B    |
00003220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003230  20 20 65 72 72 6f 72 24  20 3d 20 22 4e 6f 20 65  |  error$ = "No e|
00003240  76 61 6c 75 61 74 69 6f  6e 20 66 6f 72 20 69 6e  |valuation for in|
00003250  63 20 63 6f 6d 6d 61 6e  64 22 0d 0d c0 19 20 20  |c command"....  |
00003260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003270  20 20 cd 0d 0d ca 17 20  20 20 20 20 20 20 20 20  |  .....         |
00003280  20 20 20 20 20 20 20 20  20 cc 0d 0d d4 31 20 20  |         ....1  |
00003290  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000032a0  20 20 65 72 72 6f 72 24  20 3d 20 22 4e 6f 20 69  |  error$ = "No i|
000032b0  6e 63 20 63 6f 6d 6d 61  6e 64 22 0d 0d de 17 20  |nc command".... |
000032c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000032d0  20 cd 0d 0d e8 23 20 20  20 20 20 20 20 20 20 20  | ....#          |
000032e0  20 20 20 20 20 20 20 20  61 24 20 20 20 20 20 3d  |        a$     =|
000032f0  20 be 23 66 25 0d 0d f2  20 20 20 20 20 20 20 20  | .#f%...        |
00003300  20 20 20 20 20 20 20 20  20 20 20 6c 69 6e 65 25  |           line%|
00003310  20 2b 3d 20 31 0d 0d fc  15 20 20 20 20 20 20 20  | += 1....       |
00003320  20 20 20 20 20 20 20 20  20 cc 0d 0e 06 3e 20 20  |         ....>  |
00003330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003340  65 72 72 6f 72 24 20 3d  20 22 4e 6f 20 65 76 61  |error$ = "No eva|
00003350  6c 75 61 74 69 6f 6e 20  66 6f 72 20 76 61 72 20  |luation for var |
00003360  63 6f 6d 6d 61 6e 64 22  0d 0e 10 15 20 20 20 20  |command"....    |
00003370  20 20 20 20 20 20 20 20  20 20 20 20 cd 0d 0e 1a  |            ....|
00003380  13 20 20 20 20 20 20 20  20 20 20 20 20 20 20 cd  |.              .|
00003390  0d 0e 24 29 20 20 20 20  20 20 20 20 20 20 20 20  |..$)            |
000033a0  20 20 e7 20 a4 6c 6f 77  65 72 28 61 24 2c 32 29  |  . .lower(a$,2)|
000033b0  20 3d 20 22 79 3a 22 20  8c 0d 0e 2e 23 20 20 20  | = "y:" ....#   |
000033c0  20 20 20 20 20 20 20 20  20 20 20 20 20 70 6f 73  |             pos|
000033d0  25 20 3d 20 a7 61 24 2c  22 3d 22 29 0d 0e 38 20  |% = .a$,"=")..8 |
000033e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000033f0  e7 20 70 6f 73 25 20 3e  20 30 20 8c 0d 0e 42 39  |. pos% > 0 ...B9|
00003400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003410  20 20 66 6f 72 6d 75 6c  61 24 28 77 61 76 65 25  |  formula$(wave%|
00003420  29 20 3d 20 c2 61 24 2c  a9 28 61 24 29 20 2d 20  |) = .a$,.(a$) - |
00003430  70 6f 73 25 29 0d 0e 4c  15 20 20 20 20 20 20 20  |pos%)..L.       |
00003440  20 20 20 20 20 20 20 20  20 cc 0d 0e 56 3c 20 20  |         ...V<  |
00003450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003460  65 72 72 6f 72 24 20 3d  20 22 4e 6f 20 65 76 61  |error$ = "No eva|
00003470  6c 75 61 74 69 6f 6e 20  66 6f 72 20 79 20 63 6f  |luation for y co|
00003480  6d 6d 61 6e 64 22 0d 0e  60 15 20 20 20 20 20 20  |mmand"..`.      |
00003490  20 20 20 20 20 20 20 20  20 20 cd 0d 0e 6a 13 20  |          ...j. |
000034a0  20 20 20 20 20 20 20 20  20 20 20 20 20 cc 0d 0e  |             ...|
000034b0  74 2b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |t+              |
000034c0  20 20 65 72 72 6f 72 24  20 3d 20 22 4e 6f 20 79  |  error$ = "No y|
000034d0  20 63 6f 6d 6d 61 6e 64  22 0d 0e 7e 13 20 20 20  | command"..~.   |
000034e0  20 20 20 20 20 20 20 20  20 20 20 cd 0d 0e 88 11  |           .....|
000034f0  20 20 20 20 20 20 20 20  20 20 20 20 cc 0d 0e 92  |            ....|
00003500  3d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 65  |=              e|
00003510  72 72 6f 72 24 20 3d 20  22 4e 6f 20 65 76 61 6c  |rror$ = "No eval|
00003520  75 61 74 69 6f 6e 20 66  6f 72 20 6c 65 6e 67 74  |uation for lengt|
00003530  68 20 63 6f 6d 6d 61 6e  64 22 0d 0e 9c 11 20 20  |h command"....  |
00003540  20 20 20 20 20 20 20 20  20 20 cd 0d 0e a6 0f 20  |          ..... |
00003550  20 20 20 20 20 20 20 20  20 cc 0d 0e b0 2c 20 20  |         ....,  |
00003560  20 20 20 20 20 20 20 20  20 20 65 72 72 6f 72 24  |          error$|
00003570  20 3d 20 22 4e 6f 20 6c  65 6e 67 74 68 20 63 6f  | = "No length co|
00003580  6d 6d 61 6e 64 22 0d 0e  ba 0f 20 20 20 20 20 20  |mmand"....      |
00003590  20 20 20 20 cd 0d 0e c4  0d 20 20 20 20 20 20 20  |    .....       |
000035a0  20 cc 0d 0e ce 31 20 20  20 20 20 20 20 20 20 20  | ....1          |
000035b0  65 72 72 6f 72 24 20 3d  20 22 4e 6f 20 49 44 20  |error$ = "No ID |
000035c0  63 68 61 72 61 63 74 65  72 20 73 75 70 70 6c 69  |character suppli|
000035d0  65 64 22 0d 0e d8 0d 20  20 20 20 20 20 20 20 cd  |ed"....        .|
000035e0  0d 0e e2 16 20 20 20 20  20 20 20 20 77 61 76 65  |....        wave|
000035f0  25 20 2b 3d 20 31 0d 0e  ec 0b 20 20 20 20 20 20  |% += 1....      |
00003600  cd 0d 0e f6 1d 20 20 20  20 fd 20 c5 23 66 25 20  |.....    . .#f% |
00003610  84 20 65 72 72 6f 72 24  20 3c 3e 20 22 22 0d 0f  |. error$ <> ""..|
00003620  00 0c 20 20 20 20 d9 23  66 25 0d 0f 0a 04 0d 0f  |..    .#f%......|
00003630  14 18 20 20 20 20 e7 20  65 72 72 6f 72 24 20 3c  |..    . error$ <|
00003640  3e 20 22 22 20 8c 0d 0f  1e 4f 20 20 20 20 20 20  |> "" ....O      |
00003650  85 20 30 2c 28 6d 6f 64  75 6c 65 24 2b 22 3a 20  |. 0,(module$+": |
00003660  57 61 76 65 66 6f 72 6d  20 45 72 72 6f 72 3a 20  |Waveform Error: |
00003670  22 2b 65 72 72 6f 72 24  2b 22 20 61 74 20 73 63  |"+error$+" at sc|
00003680  72 69 70 74 20 6c 69 6e  65 20 22 2b c3 28 6c 69  |ript line "+.(li|
00003690  6e 65 25 29 29 0d 0f 28  09 20 20 20 20 cd 0d 0f  |ne%))..(.    ...|
000036a0  32 04 0d 0f 3c 07 20 20  cd 0d 0f 46 04 0d 0f 50  |2...<.  ...F...P|
000036b0  23 20 20 77 61 76 65 5f  64 61 74 61 25 20 3d 20  |#  wave_data% = |
000036c0  28 77 61 76 65 73 25 20  2b 20 31 29 20 2a 20 34  |(waves% + 1) * 4|
000036d0  0d 0f 5a 17 20 20 e3 20  49 25 20 3d 20 30 20 b8  |..Z.  . I% = 0 .|
000036e0  20 77 61 76 65 73 25 0d  0f 64 25 20 20 20 20 77  | waves%..d%    w|
000036f0  61 76 65 5f 64 61 74 61  25 20 2b 3d 20 6c 65 6e  |ave_data% += len|
00003700  67 74 68 25 28 49 25 29  20 2a 20 34 0d 0f 6e 07  |gth%(I%) * 4..n.|
00003710  20 20 ed 0d 0f 78 04 0d  0f 82 05 e1 0d ff        |  ...x........|
0000371e