Home » CEEFAX disks » telesoftware14.adl » 18-03-89/Info
18-03-89/Info
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 » CEEFAX disks » telesoftware14.adl |
Filename: | 18-03-89/Info |
Read OK: | ✔ |
File size: | 0B04 bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
File contents
The program on this disc uses EVENTS to play a tune. It has been tested on the model B, B+ and Master 128 and will work with any version of BASIC. Some notes, particularly those high in the scale may seem to be slightly out of tune. This is an unfortunate result of frequency errors within the sound chip itself. The assembled code can either be run directly by pressing f0, or it can be *SAVED as shown, and at a later date *RUN from tape or disc. With the tune playing it is possible to run almost any other program, provided it is prevented from corrupting the memory area used by the EVENT routine. The noise channel and all three tone channels are used in the tune which is an arrangement of 'The Old Rugged Cross'. Also four sound envelopes are used selectively. Whilst the tune is playing the noise channel is used to give a soft brush effect The tune data is in the form: Note1, Byte1 : Note1, Byte0 : Note0, Byte1 : Note0, Byte0 For each note Byte1 is built up from: (ENVELOPE AND 7)+(TIME to next note AND &F0)+(8 [for brush]) Byte0 is: (CHANNEL AND 3)+(PITCH AND &FC) An unusual feature of the assembled code is that 'address' is directly adjusted to point to the next item of data. This removes the need for indirect addressing through zero page locations and results in a faster piece of code, which is highly desirable in event routines. The equivalent assembly is LDA &XXXX. Where XXXX is the actual address. Freedom from zero page usage also ensures that there is far less likelihood of the routine clashing with any foreground process. The base address of the code I have set at &7000. This is a convenient place generally, but simply alter line 80 if you want it assembled elsewhere. The program will sort it all out! The following is a detailed breakdown of the assembly section 220 - 1110 set up for parameter blocks 1130 - 1160 flush all buffers 1170 - 1290 set envelopes 1300 - 1380 intercept EVNTV and enable event No 4 1400 - 1450 set tune pointer to first note 1470 event entry point 1480 - 1550 save registers and check event 1560 - 1570 check timing for tune 1590 - 1700 get next note 1710 - 1720 check for tune restart 1730 - 1830 decode tune bytes, set sound parameter block 1840 - 1870 perform 'SOUND' 1870 - 1910 set pointer to next note 1930 - 1950 loop immediately if no time delay 1970 - 2050 set brush accent 2070 - 2100 check brush timing 2110 - 2130 check brush flag 2140 - 2150 set channel 0 pitch and amplitude 2160 - 2190 perform 'SOUND 0' 2210 - 2300 tidy up and exit The data could have been compressed further but I left them in this form deliberately to encourage experimentation. Like this it is fairly easy to write a simple program to modify the data, or even write a completely new tune using this format.
00000000 0d 54 68 65 20 70 72 6f 67 72 61 6d 20 6f 6e 20 |.The program on | 00000010 74 68 69 73 20 64 69 73 63 20 75 73 65 73 20 45 |this disc uses E| 00000020 56 45 4e 54 53 20 74 6f 20 70 6c 61 79 20 61 20 |VENTS to play a | 00000030 74 75 6e 65 2e 20 20 49 74 20 68 61 73 20 62 65 |tune. It has be| 00000040 65 6e 20 74 65 73 74 65 64 0d 6f 6e 20 74 68 65 |en tested.on the| 00000050 20 6d 6f 64 65 6c 20 42 2c 20 42 2b 20 61 6e 64 | model B, B+ and| 00000060 20 4d 61 73 74 65 72 20 31 32 38 20 61 6e 64 20 | Master 128 and | 00000070 77 69 6c 6c 20 77 6f 72 6b 20 77 69 74 68 20 61 |will work with a| 00000080 6e 79 20 76 65 72 73 69 6f 6e 20 6f 66 0d 42 41 |ny version of.BA| 00000090 53 49 43 2e 20 20 53 6f 6d 65 20 6e 6f 74 65 73 |SIC. Some notes| 000000a0 2c 20 70 61 72 74 69 63 75 6c 61 72 6c 79 20 74 |, particularly t| 000000b0 68 6f 73 65 20 68 69 67 68 20 69 6e 20 74 68 65 |hose high in the| 000000c0 20 73 63 61 6c 65 20 6d 61 79 20 73 65 65 6d 20 | scale may seem | 000000d0 74 6f 20 62 65 0d 73 6c 69 67 68 74 6c 79 20 6f |to be.slightly o| 000000e0 75 74 20 6f 66 20 74 75 6e 65 2e 20 20 54 68 69 |ut of tune. Thi| 000000f0 73 20 69 73 20 61 6e 20 75 6e 66 6f 72 74 75 6e |s is an unfortun| 00000100 61 74 65 20 72 65 73 75 6c 74 20 6f 66 20 66 72 |ate result of fr| 00000110 65 71 75 65 6e 63 79 20 65 72 72 6f 72 73 0d 77 |equency errors.w| 00000120 69 74 68 69 6e 20 74 68 65 20 73 6f 75 6e 64 20 |ithin the sound | 00000130 63 68 69 70 20 69 74 73 65 6c 66 2e 0d 0d 54 68 |chip itself...Th| 00000140 65 20 61 73 73 65 6d 62 6c 65 64 20 63 6f 64 65 |e assembled code| 00000150 20 63 61 6e 20 65 69 74 68 65 72 20 62 65 20 72 | can either be r| 00000160 75 6e 20 64 69 72 65 63 74 6c 79 20 62 79 20 70 |un directly by p| 00000170 72 65 73 73 69 6e 67 20 66 30 2c 20 6f 72 20 69 |ressing f0, or i| 00000180 74 20 63 61 6e 20 62 65 0d 2a 53 41 56 45 44 20 |t can be.*SAVED | 00000190 61 73 20 73 68 6f 77 6e 2c 20 61 6e 64 20 61 74 |as shown, and at| 000001a0 20 61 20 6c 61 74 65 72 20 64 61 74 65 20 2a 52 | a later date *R| 000001b0 55 4e 20 66 72 6f 6d 20 74 61 70 65 20 6f 72 20 |UN from tape or | 000001c0 64 69 73 63 2e 20 20 57 69 74 68 20 74 68 65 0d |disc. With the.| 000001d0 74 75 6e 65 20 70 6c 61 79 69 6e 67 20 69 74 20 |tune playing it | 000001e0 69 73 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 72 |is possible to r| 000001f0 75 6e 20 61 6c 6d 6f 73 74 20 61 6e 79 20 6f 74 |un almost any ot| 00000200 68 65 72 20 70 72 6f 67 72 61 6d 2c 20 70 72 6f |her program, pro| 00000210 76 69 64 65 64 20 69 74 0d 69 73 20 70 72 65 76 |vided it.is prev| 00000220 65 6e 74 65 64 20 66 72 6f 6d 20 63 6f 72 72 75 |ented from corru| 00000230 70 74 69 6e 67 20 74 68 65 20 6d 65 6d 6f 72 79 |pting the memory| 00000240 20 61 72 65 61 20 20 75 73 65 64 20 62 79 20 74 | area used by t| 00000250 68 65 20 45 56 45 4e 54 20 72 6f 75 74 69 6e 65 |he EVENT routine| 00000260 2e 0d 0d 54 68 65 20 6e 6f 69 73 65 20 63 68 61 |...The noise cha| 00000270 6e 6e 65 6c 20 61 6e 64 20 61 6c 6c 20 74 68 72 |nnel and all thr| 00000280 65 65 20 74 6f 6e 65 20 63 68 61 6e 6e 65 6c 73 |ee tone channels| 00000290 20 61 72 65 20 75 73 65 64 20 69 6e 20 74 68 65 | are used in the| 000002a0 20 74 75 6e 65 20 77 68 69 63 68 0d 69 73 20 61 | tune which.is a| 000002b0 6e 20 61 72 72 61 6e 67 65 6d 65 6e 74 20 6f 66 |n arrangement of| 000002c0 20 27 54 68 65 20 4f 6c 64 20 52 75 67 67 65 64 | 'The Old Rugged| 000002d0 20 43 72 6f 73 73 27 2e 20 20 41 6c 73 6f 20 66 | Cross'. Also f| 000002e0 6f 75 72 20 73 6f 75 6e 64 20 65 6e 76 65 6c 6f |our sound envelo| 000002f0 70 65 73 0d 61 72 65 20 75 73 65 64 20 73 65 6c |pes.are used sel| 00000300 65 63 74 69 76 65 6c 79 2e 20 20 57 68 69 6c 73 |ectively. Whils| 00000310 74 20 74 68 65 20 74 75 6e 65 20 69 73 20 70 6c |t the tune is pl| 00000320 61 79 69 6e 67 20 74 68 65 20 6e 6f 69 73 65 20 |aying the noise | 00000330 63 68 61 6e 6e 65 6c 20 69 73 0d 75 73 65 64 20 |channel is.used | 00000340 74 6f 20 67 69 76 65 20 61 20 73 6f 66 74 20 62 |to give a soft b| 00000350 72 75 73 68 20 65 66 66 65 63 74 20 0d 0d 54 68 |rush effect ..Th| 00000360 65 20 74 75 6e 65 20 64 61 74 61 20 69 73 20 69 |e tune data is i| 00000370 6e 20 74 68 65 20 66 6f 72 6d 3a 0d 20 20 20 4e |n the form:. N| 00000380 6f 74 65 31 2c 20 42 79 74 65 31 20 3a 20 4e 6f |ote1, Byte1 : No| 00000390 74 65 31 2c 20 42 79 74 65 30 20 3a 20 4e 6f 74 |te1, Byte0 : Not| 000003a0 65 30 2c 20 42 79 74 65 31 20 3a 20 4e 6f 74 65 |e0, Byte1 : Note| 000003b0 30 2c 20 42 79 74 65 30 0d 0d 46 6f 72 20 65 61 |0, Byte0..For ea| 000003c0 63 68 20 6e 6f 74 65 20 42 79 74 65 31 20 69 73 |ch note Byte1 is| 000003d0 20 62 75 69 6c 74 20 75 70 20 66 72 6f 6d 3a 0d | built up from:.| 000003e0 0d 28 45 4e 56 45 4c 4f 50 45 20 41 4e 44 20 37 |.(ENVELOPE AND 7| 000003f0 29 2b 28 54 49 4d 45 20 74 6f 20 6e 65 78 74 20 |)+(TIME to next | 00000400 6e 6f 74 65 20 41 4e 44 20 26 46 30 29 2b 28 38 |note AND &F0)+(8| 00000410 20 5b 66 6f 72 20 62 72 75 73 68 5d 29 0d 0d 42 | [for brush])..B| 00000420 79 74 65 30 20 69 73 3a 20 20 28 43 48 41 4e 4e |yte0 is: (CHANN| 00000430 45 4c 20 41 4e 44 20 33 29 2b 28 50 49 54 43 48 |EL AND 3)+(PITCH| 00000440 20 41 4e 44 20 26 46 43 29 0d 0d 41 6e 20 75 6e | AND &FC)..An un| 00000450 75 73 75 61 6c 20 66 65 61 74 75 72 65 20 6f 66 |usual feature of| 00000460 20 74 68 65 20 61 73 73 65 6d 62 6c 65 64 20 63 | the assembled c| 00000470 6f 64 65 20 69 73 20 74 68 61 74 20 27 61 64 64 |ode is that 'add| 00000480 72 65 73 73 27 20 69 73 20 64 69 72 65 63 74 6c |ress' is directl| 00000490 79 0d 61 64 6a 75 73 74 65 64 20 74 6f 20 70 6f |y.adjusted to po| 000004a0 69 6e 74 20 74 6f 20 74 68 65 20 6e 65 78 74 20 |int to the next | 000004b0 69 74 65 6d 20 6f 66 20 64 61 74 61 2e 20 20 54 |item of data. T| 000004c0 68 69 73 20 72 65 6d 6f 76 65 73 20 74 68 65 20 |his removes the | 000004d0 6e 65 65 64 20 66 6f 72 0d 69 6e 64 69 72 65 63 |need for.indirec| 000004e0 74 20 61 64 64 72 65 73 73 69 6e 67 20 74 68 72 |t addressing thr| 000004f0 6f 75 67 68 20 7a 65 72 6f 20 70 61 67 65 20 6c |ough zero page l| 00000500 6f 63 61 74 69 6f 6e 73 20 61 6e 64 20 72 65 73 |ocations and res| 00000510 75 6c 74 73 20 69 6e 20 61 20 66 61 73 74 65 72 |ults in a faster| 00000520 0d 70 69 65 63 65 20 6f 66 20 63 6f 64 65 2c 20 |.piece of code, | 00000530 77 68 69 63 68 20 69 73 20 68 69 67 68 6c 79 20 |which is highly | 00000540 64 65 73 69 72 61 62 6c 65 20 69 6e 20 65 76 65 |desirable in eve| 00000550 6e 74 20 20 72 6f 75 74 69 6e 65 73 2e 20 20 54 |nt routines. T| 00000560 68 65 0d 65 71 75 69 76 61 6c 65 6e 74 20 61 73 |he.equivalent as| 00000570 73 65 6d 62 6c 79 20 69 73 20 20 4c 44 41 20 26 |sembly is LDA &| 00000580 58 58 58 58 2e 20 20 57 68 65 72 65 20 58 58 58 |XXXX. Where XXX| 00000590 58 20 69 73 20 74 68 65 20 61 63 74 75 61 6c 20 |X is the actual | 000005a0 61 64 64 72 65 73 73 2e 20 0d 46 72 65 65 64 6f |address. .Freedo| 000005b0 6d 20 66 72 6f 6d 20 7a 65 72 6f 20 70 61 67 65 |m from zero page| 000005c0 20 75 73 61 67 65 20 61 6c 73 6f 20 65 6e 73 75 | usage also ensu| 000005d0 72 65 73 20 74 68 61 74 20 74 68 65 72 65 20 69 |res that there i| 000005e0 73 20 66 61 72 20 6c 65 73 73 0d 6c 69 6b 65 6c |s far less.likel| 000005f0 69 68 6f 6f 64 20 6f 66 20 74 68 65 20 72 6f 75 |ihood of the rou| 00000600 74 69 6e 65 20 63 6c 61 73 68 69 6e 67 20 77 69 |tine clashing wi| 00000610 74 68 20 61 6e 79 20 66 6f 72 65 67 72 6f 75 6e |th any foregroun| 00000620 64 20 70 72 6f 63 65 73 73 2e 0d 0d 54 68 65 20 |d process...The | 00000630 62 61 73 65 20 61 64 64 72 65 73 73 20 6f 66 20 |base address of | 00000640 74 68 65 20 63 6f 64 65 20 49 20 68 61 76 65 20 |the code I have | 00000650 73 65 74 20 61 74 20 26 37 30 30 30 2e 20 20 54 |set at &7000. T| 00000660 68 69 73 20 69 73 20 61 20 63 6f 6e 76 65 6e 69 |his is a conveni| 00000670 65 6e 74 0d 70 6c 61 63 65 20 67 65 6e 65 72 61 |ent.place genera| 00000680 6c 6c 79 2c 20 62 75 74 20 73 69 6d 70 6c 79 20 |lly, but simply | 00000690 61 6c 74 65 72 20 6c 69 6e 65 20 38 30 20 69 66 |alter line 80 if| 000006a0 20 79 6f 75 20 77 61 6e 74 20 69 74 20 61 73 73 | you want it ass| 000006b0 65 6d 62 6c 65 64 0d 65 6c 73 65 77 68 65 72 65 |embled.elsewhere| 000006c0 2e 20 20 54 68 65 20 70 72 6f 67 72 61 6d 20 77 |. The program w| 000006d0 69 6c 6c 20 73 6f 72 74 20 69 74 20 61 6c 6c 20 |ill sort it all | 000006e0 6f 75 74 21 0d 0d 0d 54 68 65 20 66 6f 6c 6c 6f |out!...The follo| 000006f0 77 69 6e 67 20 69 73 20 61 20 64 65 74 61 69 6c |wing is a detail| 00000700 65 64 20 62 72 65 61 6b 64 6f 77 6e 20 6f 66 20 |ed breakdown of | 00000710 74 68 65 20 61 73 73 65 6d 62 6c 79 20 73 65 63 |the assembly sec| 00000720 74 69 6f 6e 0d 0d 20 32 32 30 20 2d 20 31 31 31 |tion.. 220 - 111| 00000730 30 20 20 73 65 74 20 75 70 20 66 6f 72 20 70 61 |0 set up for pa| 00000740 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b 73 0d 31 |rameter blocks.1| 00000750 31 33 30 20 2d 20 31 31 36 30 20 20 66 6c 75 73 |130 - 1160 flus| 00000760 68 20 61 6c 6c 20 62 75 66 66 65 72 73 0d 31 31 |h all buffers.11| 00000770 37 30 20 2d 20 31 32 39 30 20 20 73 65 74 20 65 |70 - 1290 set e| 00000780 6e 76 65 6c 6f 70 65 73 0d 31 33 30 30 20 2d 20 |nvelopes.1300 - | 00000790 31 33 38 30 20 20 69 6e 74 65 72 63 65 70 74 20 |1380 intercept | 000007a0 45 56 4e 54 56 20 61 6e 64 20 65 6e 61 62 6c 65 |EVNTV and enable| 000007b0 20 65 76 65 6e 74 20 4e 6f 20 34 0d 31 34 30 30 | event No 4.1400| 000007c0 20 2d 20 31 34 35 30 20 20 73 65 74 20 74 75 6e | - 1450 set tun| 000007d0 65 20 70 6f 69 6e 74 65 72 20 74 6f 20 66 69 72 |e pointer to fir| 000007e0 73 74 20 6e 6f 74 65 0d 0d 31 34 37 30 20 20 20 |st note..1470 | 000007f0 20 20 20 20 20 20 65 76 65 6e 74 20 65 6e 74 72 | event entr| 00000800 79 20 70 6f 69 6e 74 0d 0d 31 34 38 30 20 2d 20 |y point..1480 - | 00000810 31 35 35 30 20 20 73 61 76 65 20 72 65 67 69 73 |1550 save regis| 00000820 74 65 72 73 20 61 6e 64 20 63 68 65 63 6b 20 65 |ters and check e| 00000830 76 65 6e 74 0d 31 35 36 30 20 2d 20 31 35 37 30 |vent.1560 - 1570| 00000840 20 20 63 68 65 63 6b 20 74 69 6d 69 6e 67 20 66 | check timing f| 00000850 6f 72 20 74 75 6e 65 0d 31 35 39 30 20 2d 20 31 |or tune.1590 - 1| 00000860 37 30 30 20 20 67 65 74 20 6e 65 78 74 20 6e 6f |700 get next no| 00000870 74 65 0d 31 37 31 30 20 2d 20 31 37 32 30 20 20 |te.1710 - 1720 | 00000880 63 68 65 63 6b 20 66 6f 72 20 74 75 6e 65 20 72 |check for tune r| 00000890 65 73 74 61 72 74 0d 31 37 33 30 20 2d 20 31 38 |estart.1730 - 18| 000008a0 33 30 20 20 64 65 63 6f 64 65 20 74 75 6e 65 20 |30 decode tune | 000008b0 62 79 74 65 73 2c 20 73 65 74 20 73 6f 75 6e 64 |bytes, set sound| 000008c0 20 70 61 72 61 6d 65 74 65 72 20 62 6c 6f 63 6b | parameter block| 000008d0 0d 31 38 34 30 20 2d 20 31 38 37 30 20 20 70 65 |.1840 - 1870 pe| 000008e0 72 66 6f 72 6d 20 27 53 4f 55 4e 44 27 0d 31 38 |rform 'SOUND'.18| 000008f0 37 30 20 2d 20 31 39 31 30 20 20 73 65 74 20 70 |70 - 1910 set p| 00000900 6f 69 6e 74 65 72 20 74 6f 20 6e 65 78 74 20 6e |ointer to next n| 00000910 6f 74 65 0d 31 39 33 30 20 2d 20 31 39 35 30 20 |ote.1930 - 1950 | 00000920 20 6c 6f 6f 70 20 69 6d 6d 65 64 69 61 74 65 6c | loop immediatel| 00000930 79 20 69 66 20 6e 6f 20 74 69 6d 65 20 64 65 6c |y if no time del| 00000940 61 79 0d 31 39 37 30 20 2d 20 32 30 35 30 20 20 |ay.1970 - 2050 | 00000950 73 65 74 20 62 72 75 73 68 20 61 63 63 65 6e 74 |set brush accent| 00000960 20 0d 32 30 37 30 20 2d 20 32 31 30 30 20 20 63 | .2070 - 2100 c| 00000970 68 65 63 6b 20 62 72 75 73 68 20 74 69 6d 69 6e |heck brush timin| 00000980 67 0d 32 31 31 30 20 2d 20 32 31 33 30 20 20 63 |g.2110 - 2130 c| 00000990 68 65 63 6b 20 62 72 75 73 68 20 66 6c 61 67 0d |heck brush flag.| 000009a0 32 31 34 30 20 2d 20 32 31 35 30 20 20 73 65 74 |2140 - 2150 set| 000009b0 20 63 68 61 6e 6e 65 6c 20 30 20 70 69 74 63 68 | channel 0 pitch| 000009c0 20 61 6e 64 20 61 6d 70 6c 69 74 75 64 65 0d 32 | and amplitude.2| 000009d0 31 36 30 20 2d 20 32 31 39 30 20 20 70 65 72 66 |160 - 2190 perf| 000009e0 6f 72 6d 20 27 53 4f 55 4e 44 20 30 27 0d 32 32 |orm 'SOUND 0'.22| 000009f0 31 30 20 2d 20 32 33 30 30 20 20 74 69 64 79 20 |10 - 2300 tidy | 00000a00 75 70 20 61 6e 64 20 65 78 69 74 0d 0d 0d 54 68 |up and exit...Th| 00000a10 65 20 64 61 74 61 20 63 6f 75 6c 64 20 68 61 76 |e data could hav| 00000a20 65 20 62 65 65 6e 20 63 6f 6d 70 72 65 73 73 65 |e been compresse| 00000a30 64 20 66 75 72 74 68 65 72 20 62 75 74 20 49 20 |d further but I | 00000a40 6c 65 66 74 20 74 68 65 6d 20 69 6e 20 74 68 69 |left them in thi| 00000a50 73 20 66 6f 72 6d 0d 64 65 6c 69 62 65 72 61 74 |s form.deliberat| 00000a60 65 6c 79 20 74 6f 20 65 6e 63 6f 75 72 61 67 65 |ely to encourage| 00000a70 20 65 78 70 65 72 69 6d 65 6e 74 61 74 69 6f 6e | experimentation| 00000a80 2e 20 20 4c 69 6b 65 20 74 68 69 73 20 69 74 20 |. Like this it | 00000a90 69 73 20 66 61 69 72 6c 79 20 65 61 73 79 20 74 |is fairly easy t| 00000aa0 6f 0d 77 72 69 74 65 20 61 20 73 69 6d 70 6c 65 |o.write a simple| 00000ab0 20 70 72 6f 67 72 61 6d 20 74 6f 20 6d 6f 64 69 | program to modi| 00000ac0 66 79 20 74 68 65 20 64 61 74 61 2c 20 6f 72 20 |fy the data, or | 00000ad0 65 76 65 6e 20 77 72 69 74 65 20 61 20 63 6f 6d |even write a com| 00000ae0 70 6c 65 74 65 6c 79 20 6e 65 77 0d 74 75 6e 65 |pletely new.tune| 00000af0 20 75 73 69 6e 67 20 74 68 69 73 20 66 6f 72 6d | using this form| 00000b00 61 74 2e 0d |at..| 00000b04