The interesting thing is that although it was synthesised speech it just acted upon the Commodore 64's SID 4 bit Volume register.

Now as we all know the C64 has a variant of the 6502 as its cpu(6510). Not much difference and certainly a 6502 core.

There also exists SID files for most of the games shown in the link. A SID is a file containing the original code and data for the games music or sound element and a common format header describing its contents.

The one below is for the game Impossible Mission which i have particular interest in.

So i took this particular SID, stripped out everything but the actual C64 code and data ( 8K ! ) and disassembled it with the intention of creating a player for the Oric.

For sound output, i disabled all chip channels and set the current AY register to Volume of channel A. This turns the location $030F into a virtual volume register which is perfect for outputting the speech onto.

But i then hit a problem. The Speech code uses two interrupt routines. On the C64 one interrupt (IRQ) is driven from a CIA chip (#1) and the other interrupt (NMI) from the second CIA chip (#2).

Both CIA chips produced regular interrupts, the first (i believe) set to 50Hz VBL and the other set to 10Khz.

The second interrupt routine redirects the NMI routine vector within it in order to perform a progression of operations on the sound. The CIA timer is also stopped and started dynamically within the code. This is difficult to perform on the Oric since the 6522 has no such hardware control over the timers.

My modification has been to use VIA's Timer 1 to replace the main IRQ and VIA's Timer 2 to replace the NMI interrupt then a common service routine to handle both interrupt sources.

Currently i disable or enable the Interrupt source for Timer2 in the IER in place of stopping and starting the CIA timer B but this doesn't seem to work. There seems to be a problem resetting the irq.

The first interrupt (IRQ) appears to dampen (delay) the playing of the sound.

all_memory.asm is the dump from the utility i used to disassemble the sid to a source file. The ASM format is not dissimilar to the xa format but the dump provided is all 64K !
BuildSpeech.bat is the batch file i use to compile Test1.s with osdk
code_only.asm is the same as all_memory.asm except all (or most) of the data has been stripped out.
test1.s is the Oric conversion which compiles on osdk using the xa 6502 source format. It has many more comments than asm files.

Twilighte wrote:[..] although it was synthesised speech it just acted upon the Commodore 64's SID 4 bit Volume register

I think they all did. Some may have used frequency modulation or PWM to generate sampled sound at a higher resolution than the volume register can do.

[..] the C64 has a variant of the 6502 as its cpu(6510). Not much difference and certainly a 6502 core.

The 6510 is a 6502 with a 8-bit I/O register added to allow it to bank switch ROMs on top of the 64K RAM actually inside the computer. Nothing more, nothing less as far as I know. No extra adressing modes or instructions except for the undocumented/illegal ones where support may vary depending on CMOS/HMOS/NMOS. The 65C02 however is slightly different.

As a side note, someone recently asked one of the C= engineers if they ever licensed the 6510 to other manufacturers but the answer seems to have been they kept this gem to themselves, forcing Apple, Atari and the others to find their own solutions to host 64K RAM if required.