Small Oric Sound Hack

This forum is about audio tools, including samplers, sound trackers, sound chip editors, how to do sound effects, etc...
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Small Oric Sound Hack

Post by ibisum »

This has been discussed before, but for the folks I'm currently showing Oric BASIC to, for the first time here in Vienna, I present a small BASIC-based routine which allows one to use the entire address range of the Oric as a 'slot' from which to load a sound effect .. my other, OSDK-based soundToy project explores this concept, but here at least is the way to do it in a few lines of BASIC and a tiny bit of machine code ..

The ORIC has *thousands* of onboard sound presets. Not just PING/ZAP/EXPLODE/SHOOT/CLICK.


Code: Select all

NEW
0 ?"SOUNDHAK:"
1 ?"e.g. POKE#00,#LO:POKE#01,#HI:CALL#B000"
2 FORI=#B000TO#B009:READA:POKEI,A:NEXT:REM $B000-$B009
3 DATA #AE,#00,#00,#AC,#01,#00,#20,#86,#FA,#60
4 REM PING EXPLODE ZAP..
6 POKE#00,#A7:POKE#01,#FA:CALL#B000:WAIT65
8 POKE#00,#B0:POKE#01,#FA:CALL#B000:WAIT85
10 POKE#00,#C0:POKE#01,#FA:CALL#B000:WAIT75
11 REM ..AND FROM ROM: FAA7,FABD,FAD3,FB10..
12 POKE#00,#AA:POKE#01,#FA:CALL#B000:WAIT100
13 POKE#00,#BD:POKE#01,#FA:CALL#B000:WAIT20
14 POKE#00,#D3:POKE#01,#FA:CALL#B000:WAIT40
15 POKE#00,#10:POKE#01,#FB:CALL#B000:WAIT80
16 POKE#00,#BD:POKE#01,#FA:CALL#B000:WAIT10
17 POKE#00,#75:POKE#01,#FB:CALL#B000:WAIT20
18 POKE#00,#10:POKE#01,#FB:CALL#B000:WAIT24
19 CALL#B000
20 GOTO 12
RUN
.. the assembly is simple, just loads ..

Code: Select all

            .org $B000          ; Example start address in RAM

SOUNDROUTINE:
            LDX $00             ; Load low byte of sound data address from zero-page ($00)
            LDY $01             ; Load high byte of sound data address from zero-page ($01)
            JSR $FA86           ; Jump to the sound routine in ROM (#FA86)
            RTS                 ; Return to BASIC
Incidentally, Oricutrons' PASTE key is F12 and we left in the NEW/RUN just because ...
User avatar
Dbug
Site Admin
Posts: 4935
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Small Oric Sound Hack

Post by Dbug »

You could make the assembler one byte shorter by doing a JMP $FA86 instead of JSR/RTS.

Regarding B000, an alternative location could be BFE0, in the 32 bytes between the screen and the ROM which are basically never used by anyone.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Small Oric Sound Hack

Post by ibisum »

Hey, #BFE0 is a good idea, thanks for that.

I kind of want to get as far as being able to implement an "!SPLAY" command, which takes the address .. one of these days. For now, this is just enough BASIC to illustrate the technique .. now its a matter of finding all the good sounds in a freshly booted Oric. ;)
Post Reply