Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: ratsflif on May 22, 2008, 11:27:33 am
-
Hey,
Im trying to compile the cabmame 0124_soundsync.diff to mame 125u2 and it fails. So, something that it modifies must have changed recently. I can compile the highscore diff but thats about the extent of my compiling skills.
The cabmame soundsync is the only way Ive found to allow me to use tripplebuffer without the sound skipping. Im using an arcade vga and an arcade monitor.
Here is the code in the diff, thanks for any help.
diff -ruN ../mame/src/osd/windows/sound.c ./src/osd/windows/sound.c
--- ../mame/src/osd/windows/sound.c 2008-02-29 20:31:45.000000000 +0100
+++ ./src/osd/windows/sound.c 2008-02-29 20:27:07.000000000 +0100
@@ -183,6 +183,13 @@
if (stream_buffer == NULL)
return;
+ /* if we are active, update the sampling frequency */
+ if (machine->speed_percent > 0.0f)
+ {
+ IDirectSoundBuffer_SetFrequency(stream_buffer, machine->sample_rate * machine->speed_percent);
+ }
+
+
// determine the current play position
result = IDirectSoundBuffer_GetCurrentPosition(stream_buffer, &play_position, &write_position);
if (result == DS_OK)
@@ -373,7 +380,7 @@
// create a buffer desc for the stream buffer
memset(&stream_desc, 0, sizeof(stream_desc));
stream_desc.dwSize = sizeof(stream_desc);
- stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;
+ stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLFREQUENCY;
stream_desc.dwBufferBytes = stream_buffer_size;
stream_desc.lpwfxFormat = &stream_format;
-
Here is the error when compiling:
src/osd/windows/sound.c: In function 'osd_update_audio_stream':
src/osd/windows/sound.c:187: error: 'running_machine' has no member named 'speed
_percent'
src/osd/windows/sound.c:189: error: 'running_machine' has no member named 'speed
_percent'
mingw32-make: *** [obj/windows/mame/osd/windows/sound.o] Error 1
-
Without looking at code yet, looks like the variable structure of the machine variable has changed. One moment...
Okay, skimmed the code. The machine variable is the struct running_machine, which does not include a member speed_percent, in neither 0.125u2 or 0.124a. Does the patch work in 0.124? I don't see how it could. However there where quite a few changes between the versions, so I might be missing something.
Check you are using the 0.124 version of the diff file. If it's older, we might be able to see the changes and figure how to fix it. If it works in 0.124, I don't know why it is, so I can't help.
-
Ive only used the precompiled version of cabmame and it was .124 and this was the diff that was posted with it. Ill try a compile of my own on .124 and see.
The precompiled one works great, no sound skipping at all
-
u_rebelscum is right. There is no way this would work since speed_percent isn't in the struct.
Try replacing the 2 instances of:
machine->speed_percent
with:
video_get_speed_percent(machine)
That will get it to compile.
-
Thanks dude,
I compiled it with your change and it works perfectly.