Opened 12 months ago

Last modified 3 months ago

#15043 new defect

FREESCAPE: CPC sounds are not implemented

Reported by: neuromancer Owned by: neuromancer
Priority: normal Component: Engine: Freescape
Version: Keywords:
Cc: Game:

Description

CPC sounds in all the freescape are not implemented. A workaround, available only for Driller, is the use of DOS prerecorded sounds (which can be very different in some cases). Implementing CPC sounds for all the games will require to use have ay-3891x emulation, since the pc speaker is not enough.

A possible code to use is here: https://github.com/floooh/chips/blob/master/chips/ay38910.h (header only, no dependencies)

To correctly call the ay3891x emulated functions from the CPC registers, we can see an example here:

https://github.com/floooh/chips/blob/master/systems/cpc.h#L471-L491

Change History (2)

comment:1 by sev-, 5 months ago

Priority: highnormal

This is not a release blocker

comment:2 by neuromancer, 3 months ago

Adding support using ay3891x emulated functions is too hard. There are two options to do it, none of them are actually good:

  • We could try to reverse engineer each sound and reimplement it directly on ScummVM (similar to other freescape releases). This is too hard and time consuming.
  • We could try to emulate the specific sound routine adding a more general Z80 emulation. While this could work and the sound routine are already identified, it will require to add a large amount of code for the emulation of sounds. It is not feasible.

The best solution is to record each sound for each CPC game as a small wav file, and reproduce it directly from the code. It is feasible to do it since the freescape engine allows to use set of fixed sounds (usually around 30 or less per game). This is easy to implement (it's already there) and it does not require to add a lot of code (just some small mono-channel wav files). While is a bit of pain to record, cut and save each one, it is a much better solution.

I already started working on recording the Dark Side CPC sounds and some sounds are already working. The emulator used for recording is caprice32 (https://github.com/ColinPitrat/caprice32).

Note: See TracTickets for help on using tickets.