I've had a Personal Computer News brainwave!

Send your hints and tips to Microwaves, PCN, 62 Oxford Street, London W1A 2HG. We pay £10 for every one printed and £50 for the Microwave of the month.

Define Those Oric Sound Commands

 10 FOR X=#400 TO #415
 20 READ R : POKE X,R : NEXT
 30 DOKE #2F5,#400
 40 DATA #A2,#8         'LDX $8 (data file - low)
 50 DATA #A0,#4         'LDY $4 (data file - high)
 60 DATA #20,#6C,#FA    'JSR $FA6C (main routine)
 70 DATA #60            'RTS
 80 REM HERE COMES THE 14 BYTE DATA FILE
 90 REM CHANGE THE VALUES IF YOU LIKE
100 DATA 206,108,231,36,137,112,70,182,170,239,83,246,12,165

While looking through the ROM of my Oric 1, I found the addresses of the machine code routines for ZAP, PING, EXPLODE and SHOOT. These four routines all work in the same way: before making a JSR to the main routine, index-x is loaded with the low order byte and index-y is loaded with the high-order byte of the start address of the 14 byte long data file which contains the parameters required by the main routine.

This main routine is the same for all four of the predefined sounds, and only the 14 parameters make the sounds sound different. The routine is located at #FA6C.

This can be used to create your own user-defined sound commands, for instance by making use of the extension command "!". By DOKEing the start address of a machine code program into location #2F5, this program will be executed whenever ! is entered as a Basic command. This program POKEs the machine code routine required into memory locations #400 and upwards.

Once the program has been run, enter "!" and press Return. Many different sounds may be generated - depending on which values have been chosen as parameters.

The addresses of the predefined sounds in the Oric ROM are:

PING: $FA85
ZAP: $FAC7
EXPLODE: $FAB1
SHOOT: $FA9B
keyclick: $FB10
ctrl key: $FAFA

Bjorn M. Ursfjord
N-4040 MADLA, Norway