Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Cabmame diff on newest mame  (Read 2369 times)

0 Members and 1 Guest are viewing this topic.

ratsflif

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 85
  • Last login:January 29, 2024, 06:08:07 pm
Cabmame diff on newest mame
« 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;
 

ratsflif

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 85
  • Last login:January 29, 2024, 06:08:07 pm
Re: Cabmame diff on newest mame
« Reply #1 on: May 23, 2008, 04:34:11 pm »
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

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: Cabmame diff on newest mame
« Reply #2 on: May 23, 2008, 05:42:19 pm »
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.
Robin
Knowledge is Power

ratsflif

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 85
  • Last login:January 29, 2024, 06:08:07 pm
Re: Cabmame diff on newest mame
« Reply #3 on: May 23, 2008, 07:51:34 pm »
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

MKChamp

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 502
  • Last login:February 07, 2024, 02:45:53 pm
  • Stil around.
Re: Cabmame diff on newest mame
« Reply #4 on: May 24, 2008, 01:35:37 am »
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.

ratsflif

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 85
  • Last login:January 29, 2024, 06:08:07 pm
Re: Cabmame diff on newest mame
« Reply #5 on: May 24, 2008, 06:44:26 pm »
Thanks dude,

I compiled it with your change and it works perfectly.