Home » Personal collection » Acorn ADFS disks » Electron » Utilities_2.ADF » MUSIC/Bgm

MUSIC/Bgm

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 » Personal collection » Acorn ADFS disks » Electron » Utilities_2.ADF
Filename: MUSIC/Bgm
Read OK:
File size: 07FC bytes
Load address: FFFF0E00
Exec address: FFFF8023
File contents
   10REM Background tune player
   20REM by Darren Smith
   30REM (c) The Micro User
   40REM November 1990
   50MODE 7:FOR pass=0 TO 2 STEP 2
   60FOR pass=0 TO 2 STEP 2:P%=&A00
   70P%=&A00:[OPT pass:.init LDA #0
   80STA &9F:LDA #14:LDX #0:JSR &FFF4
   90SEI:LDA &220:STA oldvector
  100LDA &221:STA oldvector+1
  110LDA #event MOD 256:STA &220
  120LDA #event DIV 256:STA &221
  130CLI:LDA #0:LDX #5:JMP event
  140.event PHA:CMP #0:BNE notevent
  150TXA:PHA:CMP #5:BNE notbuffer
  160TYA:PHA:.checknote LDX &9F
  170LDA &900,X:CMP #&FF:BNE findlength
  180LDX #0:STX &9F:.findlength
  190LDA &900,X:LSR A:BCC short
  200.long LDA speed:ASL A:STA sound+6
  210JMP mask_pitch:.short LDA speed
  220STA sound+6:.mask_pitch
  230LDA &900,X:AND #&FE:STA sound+4
  240.playnote:LDA #7:LDX #sound MOD256
  250LDY #sound DIV256:JSR &FFF1
  260.nextnote INC &9F:.endcode
  270PLA:TAY:.notbuffer PLA:TAX
  280.notevent PLA:JMP (oldvector)
  290.oldvector OPT FNw(0):.speed
  300OPT FNb(3):.sound OPT FNw(1)
  310OPT FNw(-8):OPT FNw(0):OPT FNw(4)
  320]:NEXT:loop=0:REPEAT:READ data:IF data=1000 THEN 330 ELSE ?(&900+loop)=data:loop=loop+1:UNTIL 0
  330CALL init:END
  340DEFFNb(Z%):?P%=Z%:P%=P%+1:=pass
  350DEFFNw(Z%):!P%=Z%:P%=P%+2:=pass
  360REM *** Tune data ***
  370DATA 133,116,121,108,113,96,101,80,84,72,65,0,113,64,113,65,113,1,113,109
  380DATA 104,112,128,104,112,128,104,112,128,104,112,129,120,112,104,96,100
  390DATA 120,96,100,120,96,100,120,96,100,121,112,100,84,105,100,105,100,105
  400DATA 93,88,93,88,93,84,60,64,84,100,80,84,100,112,96,100,112,133,101,104
  410DATA 112,128,104,112,128,104,112,128,104,112,129,120,112,104,96,100,120
  420DATA 96,100,120,96,100,120,96,100,121,112,100,84,120,72,88,121,112,104
  430DATA 100,92,88,92,121,112,104,92,100,64,84,101,64,93,85,113,109,104,112
  440DATA 128,104,112,128,104,112,128,104,112,129,120,112,104,96,100,120,96
  450DATA 100,120,96,100,120,96,100,121,112,100,84,105,100,105,100,105,93,88
  460DATA 93,88,93,84,60,64,84,100,80,84,100,112,96,100,112,133,101,104,112
  470DATA 128,104,112,128,104,112,128,104,112,129,120,112,104,96,100,120,96
  480DATA 100,120,96,100,120,96,100,121,112,100,84,120,72,88,121,112,104,100
  490DATA 92,88,92,121,112,104,92,100,64,84,101,64,93,85,255,1000

� Background tune player
� by Darren Smith
� (c) The Micro User
(� November 1990
2� 7:� pass=0 � 2 � 2
<� pass=0 � 2 � 2:P%=&A00
F"P%=&A00:[OPT pass:.init LDA #0
P$STA &9F:LDA #14:LDX #0:JSR &FFF4
ZSEI:LDA &220:STA oldvector
dLDA &221:STA oldvector+1
nLDA #event � 256:STA &220
xLDA #event � 256:STA &221
�CLI:LDA #0:LDX #5:JMP event
�".event PHA:CMP #0:BNE notevent
� TXA:PHA:CMP #5:BNE notbuffer
�TYA:PHA:.checknote LDX &9F
�&LDA &900,X:CMP #&FF:BNE findlength
�LDX #0:STX &9F:.findlength
�LDA &900,X:LSR A:BCC short
�%.long LDA speed:ASL A:STA sound+6
�#JMP mask_pitch:.short LDA speed
�STA sound+6:.mask_pitch
�!LDA &900,X:� #&FE:STA sound+4
�$.playnote:LDA #7:LDX #sound �256
�LDY #sound �256:JSR &FFF1
.nextnote INC &9F:.endcode
PLA:TAY:.notbuffer PLA:TAX
!.notevent PLA:JMP (oldvector)
".oldvector OPT �w(0):.speed
,OPT �b(3):.sound OPT �w(1)
6"OPT �w(-8):OPT �w(0):OPT �w(4)
@N]:�:loop=0:�:� data:� data=1000 � �DJA � ?(&900+loop)=data:loop=loop+1:� 0
J� init:�
T ݤb(Z%):?P%=Z%:P%=P%+1:=pass
^ ݤw(Z%):!P%=Z%:P%=P%+2:=pass
h� *** Tune data ***
rJ� 133,116,121,108,113,96,101,80,84,72,65,0,113,64,113,65,113,1,113,109
|H� 104,112,128,104,112,128,104,112,128,104,112,129,120,112,104,96,100
�I� 120,96,100,120,96,100,120,96,100,121,112,100,84,105,100,105,100,105
�I� 93,88,93,88,93,84,60,64,84,100,80,84,100,112,96,100,112,133,101,104
�H� 112,128,104,112,128,104,112,128,104,112,129,120,112,104,96,100,120
�G� 96,100,120,96,100,120,96,100,121,112,100,84,120,72,88,121,112,104
�H� 100,92,88,92,121,112,104,92,100,64,84,101,64,93,85,113,109,104,112
�G� 128,104,112,128,104,112,128,104,112,129,120,112,104,96,100,120,96
�H� 100,120,96,100,120,96,100,121,112,100,84,105,100,105,100,105,93,88
�G� 93,88,93,84,60,64,84,100,80,84,100,112,96,100,112,133,101,104,112
�G� 128,104,112,128,104,112,128,104,112,129,120,112,104,96,100,120,96
�H� 100,120,96,100,120,96,100,121,112,100,84,120,72,88,121,112,104,100
�=� 92,88,92,121,112,104,92,100,64,84,101,64,93,85,255,1000
�
00000000  0d 00 0a 1c f4 20 42 61  63 6b 67 72 6f 75 6e 64  |..... Background|
00000010  20 74 75 6e 65 20 70 6c  61 79 65 72 0d 00 14 15  | tune player....|
00000020  f4 20 62 79 20 44 61 72  72 65 6e 20 53 6d 69 74  |. by Darren Smit|
00000030  68 0d 00 1e 18 f4 20 28  63 29 20 54 68 65 20 4d  |h..... (c) The M|
00000040  69 63 72 6f 20 55 73 65  72 0d 00 28 13 f4 20 4e  |icro User..(.. N|
00000050  6f 76 65 6d 62 65 72 20  31 39 39 30 0d 00 32 18  |ovember 1990..2.|
00000060  eb 20 37 3a e3 20 70 61  73 73 3d 30 20 b8 20 32  |. 7:. pass=0 . 2|
00000070  20 88 20 32 0d 00 3c 1c  e3 20 70 61 73 73 3d 30  | . 2..<.. pass=0|
00000080  20 b8 20 32 20 88 20 32  3a 50 25 3d 26 41 30 30  | . 2 . 2:P%=&A00|
00000090  0d 00 46 22 50 25 3d 26  41 30 30 3a 5b 4f 50 54  |..F"P%=&A00:[OPT|
000000a0  20 70 61 73 73 3a 2e 69  6e 69 74 20 4c 44 41 20  | pass:.init LDA |
000000b0  23 30 0d 00 50 24 53 54  41 20 26 39 46 3a 4c 44  |#0..P$STA &9F:LD|
000000c0  41 20 23 31 34 3a 4c 44  58 20 23 30 3a 4a 53 52  |A #14:LDX #0:JSR|
000000d0  20 26 46 46 46 34 0d 00  5a 1e 53 45 49 3a 4c 44  | &FFF4..Z.SEI:LD|
000000e0  41 20 26 32 32 30 3a 53  54 41 20 6f 6c 64 76 65  |A &220:STA oldve|
000000f0  63 74 6f 72 0d 00 64 1c  4c 44 41 20 26 32 32 31  |ctor..d.LDA &221|
00000100  3a 53 54 41 20 6f 6c 64  76 65 63 74 6f 72 2b 31  |:STA oldvector+1|
00000110  0d 00 6e 1d 4c 44 41 20  23 65 76 65 6e 74 20 83  |..n.LDA #event .|
00000120  20 32 35 36 3a 53 54 41  20 26 32 32 30 0d 00 78  | 256:STA &220..x|
00000130  1d 4c 44 41 20 23 65 76  65 6e 74 20 81 20 32 35  |.LDA #event . 25|
00000140  36 3a 53 54 41 20 26 32  32 31 0d 00 82 1f 43 4c  |6:STA &221....CL|
00000150  49 3a 4c 44 41 20 23 30  3a 4c 44 58 20 23 35 3a  |I:LDA #0:LDX #5:|
00000160  4a 4d 50 20 65 76 65 6e  74 0d 00 8c 22 2e 65 76  |JMP event...".ev|
00000170  65 6e 74 20 50 48 41 3a  43 4d 50 20 23 30 3a 42  |ent PHA:CMP #0:B|
00000180  4e 45 20 6e 6f 74 65 76  65 6e 74 0d 00 96 20 54  |NE notevent... T|
00000190  58 41 3a 50 48 41 3a 43  4d 50 20 23 35 3a 42 4e  |XA:PHA:CMP #5:BN|
000001a0  45 20 6e 6f 74 62 75 66  66 65 72 0d 00 a0 1e 54  |E notbuffer....T|
000001b0  59 41 3a 50 48 41 3a 2e  63 68 65 63 6b 6e 6f 74  |YA:PHA:.checknot|
000001c0  65 20 4c 44 58 20 26 39  46 0d 00 aa 26 4c 44 41  |e LDX &9F...&LDA|
000001d0  20 26 39 30 30 2c 58 3a  43 4d 50 20 23 26 46 46  | &900,X:CMP #&FF|
000001e0  3a 42 4e 45 20 66 69 6e  64 6c 65 6e 67 74 68 0d  |:BNE findlength.|
000001f0  00 b4 1e 4c 44 58 20 23  30 3a 53 54 58 20 26 39  |...LDX #0:STX &9|
00000200  46 3a 2e 66 69 6e 64 6c  65 6e 67 74 68 0d 00 be  |F:.findlength...|
00000210  1e 4c 44 41 20 26 39 30  30 2c 58 3a 4c 53 52 20  |.LDA &900,X:LSR |
00000220  41 3a 42 43 43 20 73 68  6f 72 74 0d 00 c8 25 2e  |A:BCC short...%.|
00000230  6c 6f 6e 67 20 4c 44 41  20 73 70 65 65 64 3a 41  |long LDA speed:A|
00000240  53 4c 20 41 3a 53 54 41  20 73 6f 75 6e 64 2b 36  |SL A:STA sound+6|
00000250  0d 00 d2 23 4a 4d 50 20  6d 61 73 6b 5f 70 69 74  |...#JMP mask_pit|
00000260  63 68 3a 2e 73 68 6f 72  74 20 4c 44 41 20 73 70  |ch:.short LDA sp|
00000270  65 65 64 0d 00 dc 1b 53  54 41 20 73 6f 75 6e 64  |eed....STA sound|
00000280  2b 36 3a 2e 6d 61 73 6b  5f 70 69 74 63 68 0d 00  |+6:.mask_pitch..|
00000290  e6 21 4c 44 41 20 26 39  30 30 2c 58 3a 80 20 23  |.!LDA &900,X:. #|
000002a0  26 46 45 3a 53 54 41 20  73 6f 75 6e 64 2b 34 0d  |&FE:STA sound+4.|
000002b0  00 f0 24 2e 70 6c 61 79  6e 6f 74 65 3a 4c 44 41  |..$.playnote:LDA|
000002c0  20 23 37 3a 4c 44 58 20  23 73 6f 75 6e 64 20 83  | #7:LDX #sound .|
000002d0  32 35 36 0d 00 fa 1d 4c  44 59 20 23 73 6f 75 6e  |256....LDY #soun|
000002e0  64 20 81 32 35 36 3a 4a  53 52 20 26 46 46 46 31  |d .256:JSR &FFF1|
000002f0  0d 01 04 1e 2e 6e 65 78  74 6e 6f 74 65 20 49 4e  |.....nextnote IN|
00000300  43 20 26 39 46 3a 2e 65  6e 64 63 6f 64 65 0d 01  |C &9F:.endcode..|
00000310  0e 1e 50 4c 41 3a 54 41  59 3a 2e 6e 6f 74 62 75  |..PLA:TAY:.notbu|
00000320  66 66 65 72 20 50 4c 41  3a 54 41 58 0d 01 18 21  |ffer PLA:TAX...!|
00000330  2e 6e 6f 74 65 76 65 6e  74 20 50 4c 41 3a 4a 4d  |.notevent PLA:JM|
00000340  50 20 28 6f 6c 64 76 65  63 74 6f 72 29 0d 01 22  |P (oldvector).."|
00000350  1f 2e 6f 6c 64 76 65 63  74 6f 72 20 4f 50 54 20  |..oldvector OPT |
00000360  a4 77 28 30 29 3a 2e 73  70 65 65 64 0d 01 2c 1e  |.w(0):.speed..,.|
00000370  4f 50 54 20 a4 62 28 33  29 3a 2e 73 6f 75 6e 64  |OPT .b(3):.sound|
00000380  20 4f 50 54 20 a4 77 28  31 29 0d 01 36 22 4f 50  | OPT .w(1)..6"OP|
00000390  54 20 a4 77 28 2d 38 29  3a 4f 50 54 20 a4 77 28  |T .w(-8):OPT .w(|
000003a0  30 29 3a 4f 50 54 20 a4  77 28 34 29 0d 01 40 4e  |0):OPT .w(4)..@N|
000003b0  5d 3a ed 3a 6c 6f 6f 70  3d 30 3a f5 3a f3 20 64  |]:.:loop=0:.:. d|
000003c0  61 74 61 3a e7 20 64 61  74 61 3d 31 30 30 30 20  |ata:. data=1000 |
000003d0  8c 20 8d 44 4a 41 20 8b  20 3f 28 26 39 30 30 2b  |. .DJA . ?(&900+|
000003e0  6c 6f 6f 70 29 3d 64 61  74 61 3a 6c 6f 6f 70 3d  |loop)=data:loop=|
000003f0  6c 6f 6f 70 2b 31 3a fd  20 30 0d 01 4a 0c d6 20  |loop+1:. 0..J.. |
00000400  69 6e 69 74 3a e0 0d 01  54 20 dd a4 62 28 5a 25  |init:...T ..b(Z%|
00000410  29 3a 3f 50 25 3d 5a 25  3a 50 25 3d 50 25 2b 31  |):?P%=Z%:P%=P%+1|
00000420  3a 3d 70 61 73 73 0d 01  5e 20 dd a4 77 28 5a 25  |:=pass..^ ..w(Z%|
00000430  29 3a 21 50 25 3d 5a 25  3a 50 25 3d 50 25 2b 32  |):!P%=Z%:P%=P%+2|
00000440  3a 3d 70 61 73 73 0d 01  68 17 f4 20 2a 2a 2a 20  |:=pass..h.. *** |
00000450  54 75 6e 65 20 64 61 74  61 20 2a 2a 2a 0d 01 72  |Tune data ***..r|
00000460  4a dc 20 31 33 33 2c 31  31 36 2c 31 32 31 2c 31  |J. 133,116,121,1|
00000470  30 38 2c 31 31 33 2c 39  36 2c 31 30 31 2c 38 30  |08,113,96,101,80|
00000480  2c 38 34 2c 37 32 2c 36  35 2c 30 2c 31 31 33 2c  |,84,72,65,0,113,|
00000490  36 34 2c 31 31 33 2c 36  35 2c 31 31 33 2c 31 2c  |64,113,65,113,1,|
000004a0  31 31 33 2c 31 30 39 0d  01 7c 48 dc 20 31 30 34  |113,109..|H. 104|
000004b0  2c 31 31 32 2c 31 32 38  2c 31 30 34 2c 31 31 32  |,112,128,104,112|
000004c0  2c 31 32 38 2c 31 30 34  2c 31 31 32 2c 31 32 38  |,128,104,112,128|
000004d0  2c 31 30 34 2c 31 31 32  2c 31 32 39 2c 31 32 30  |,104,112,129,120|
000004e0  2c 31 31 32 2c 31 30 34  2c 39 36 2c 31 30 30 0d  |,112,104,96,100.|
000004f0  01 86 49 dc 20 31 32 30  2c 39 36 2c 31 30 30 2c  |..I. 120,96,100,|
00000500  31 32 30 2c 39 36 2c 31  30 30 2c 31 32 30 2c 39  |120,96,100,120,9|
00000510  36 2c 31 30 30 2c 31 32  31 2c 31 31 32 2c 31 30  |6,100,121,112,10|
00000520  30 2c 38 34 2c 31 30 35  2c 31 30 30 2c 31 30 35  |0,84,105,100,105|
00000530  2c 31 30 30 2c 31 30 35  0d 01 90 49 dc 20 39 33  |,100,105...I. 93|
00000540  2c 38 38 2c 39 33 2c 38  38 2c 39 33 2c 38 34 2c  |,88,93,88,93,84,|
00000550  36 30 2c 36 34 2c 38 34  2c 31 30 30 2c 38 30 2c  |60,64,84,100,80,|
00000560  38 34 2c 31 30 30 2c 31  31 32 2c 39 36 2c 31 30  |84,100,112,96,10|
00000570  30 2c 31 31 32 2c 31 33  33 2c 31 30 31 2c 31 30  |0,112,133,101,10|
00000580  34 0d 01 9a 48 dc 20 31  31 32 2c 31 32 38 2c 31  |4...H. 112,128,1|
00000590  30 34 2c 31 31 32 2c 31  32 38 2c 31 30 34 2c 31  |04,112,128,104,1|
000005a0  31 32 2c 31 32 38 2c 31  30 34 2c 31 31 32 2c 31  |12,128,104,112,1|
000005b0  32 39 2c 31 32 30 2c 31  31 32 2c 31 30 34 2c 39  |29,120,112,104,9|
000005c0  36 2c 31 30 30 2c 31 32  30 0d 01 a4 47 dc 20 39  |6,100,120...G. 9|
000005d0  36 2c 31 30 30 2c 31 32  30 2c 39 36 2c 31 30 30  |6,100,120,96,100|
000005e0  2c 31 32 30 2c 39 36 2c  31 30 30 2c 31 32 31 2c  |,120,96,100,121,|
000005f0  31 31 32 2c 31 30 30 2c  38 34 2c 31 32 30 2c 37  |112,100,84,120,7|
00000600  32 2c 38 38 2c 31 32 31  2c 31 31 32 2c 31 30 34  |2,88,121,112,104|
00000610  0d 01 ae 48 dc 20 31 30  30 2c 39 32 2c 38 38 2c  |...H. 100,92,88,|
00000620  39 32 2c 31 32 31 2c 31  31 32 2c 31 30 34 2c 39  |92,121,112,104,9|
00000630  32 2c 31 30 30 2c 36 34  2c 38 34 2c 31 30 31 2c  |2,100,64,84,101,|
00000640  36 34 2c 39 33 2c 38 35  2c 31 31 33 2c 31 30 39  |64,93,85,113,109|
00000650  2c 31 30 34 2c 31 31 32  0d 01 b8 47 dc 20 31 32  |,104,112...G. 12|
00000660  38 2c 31 30 34 2c 31 31  32 2c 31 32 38 2c 31 30  |8,104,112,128,10|
00000670  34 2c 31 31 32 2c 31 32  38 2c 31 30 34 2c 31 31  |4,112,128,104,11|
00000680  32 2c 31 32 39 2c 31 32  30 2c 31 31 32 2c 31 30  |2,129,120,112,10|
00000690  34 2c 39 36 2c 31 30 30  2c 31 32 30 2c 39 36 0d  |4,96,100,120,96.|
000006a0  01 c2 48 dc 20 31 30 30  2c 31 32 30 2c 39 36 2c  |..H. 100,120,96,|
000006b0  31 30 30 2c 31 32 30 2c  39 36 2c 31 30 30 2c 31  |100,120,96,100,1|
000006c0  32 31 2c 31 31 32 2c 31  30 30 2c 38 34 2c 31 30  |21,112,100,84,10|
000006d0  35 2c 31 30 30 2c 31 30  35 2c 31 30 30 2c 31 30  |5,100,105,100,10|
000006e0  35 2c 39 33 2c 38 38 0d  01 cc 47 dc 20 39 33 2c  |5,93,88...G. 93,|
000006f0  38 38 2c 39 33 2c 38 34  2c 36 30 2c 36 34 2c 38  |88,93,84,60,64,8|
00000700  34 2c 31 30 30 2c 38 30  2c 38 34 2c 31 30 30 2c  |4,100,80,84,100,|
00000710  31 31 32 2c 39 36 2c 31  30 30 2c 31 31 32 2c 31  |112,96,100,112,1|
00000720  33 33 2c 31 30 31 2c 31  30 34 2c 31 31 32 0d 01  |33,101,104,112..|
00000730  d6 47 dc 20 31 32 38 2c  31 30 34 2c 31 31 32 2c  |.G. 128,104,112,|
00000740  31 32 38 2c 31 30 34 2c  31 31 32 2c 31 32 38 2c  |128,104,112,128,|
00000750  31 30 34 2c 31 31 32 2c  31 32 39 2c 31 32 30 2c  |104,112,129,120,|
00000760  31 31 32 2c 31 30 34 2c  39 36 2c 31 30 30 2c 31  |112,104,96,100,1|
00000770  32 30 2c 39 36 0d 01 e0  48 dc 20 31 30 30 2c 31  |20,96...H. 100,1|
00000780  32 30 2c 39 36 2c 31 30  30 2c 31 32 30 2c 39 36  |20,96,100,120,96|
00000790  2c 31 30 30 2c 31 32 31  2c 31 31 32 2c 31 30 30  |,100,121,112,100|
000007a0  2c 38 34 2c 31 32 30 2c  37 32 2c 38 38 2c 31 32  |,84,120,72,88,12|
000007b0  31 2c 31 31 32 2c 31 30  34 2c 31 30 30 0d 01 ea  |1,112,104,100...|
000007c0  3d dc 20 39 32 2c 38 38  2c 39 32 2c 31 32 31 2c  |=. 92,88,92,121,|
000007d0  31 31 32 2c 31 30 34 2c  39 32 2c 31 30 30 2c 36  |112,104,92,100,6|
000007e0  34 2c 38 34 2c 31 30 31  2c 36 34 2c 39 33 2c 38  |4,84,101,64,93,8|
000007f0  35 2c 32 35 35 2c 31 30  30 30 0d ff              |5,255,1000..|
000007fc
MUSIC/Bgm.m0
MUSIC/Bgm.m1
MUSIC/Bgm.m2
MUSIC/Bgm.m4
MUSIC/Bgm.m5