From dd0ebc1d8dcce18102c63cd3ae903df5cb504169 Mon Sep 17 00:00:00 2001 From: Couriersud Date: Sat, 23 Feb 2008 17:46:52 +0000 Subject: [PATCH] Remove some deprecat.h includes from osd layer: * add machine as parameter to osd_update and osd_update_audio_stream * change Machine to machine and remove include deprecat.h --- src/emu/sound.c | 2 +- src/emu/video.c | 2 +- src/osd/osdepend.h | 4 ++-- src/osd/windows/sound.c | 11 +++++------ src/osd/windows/video.c | 17 ++++++++--------- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/emu/sound.c b/src/emu/sound.c index 2feba021055..7f59ff4dbe3 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -796,7 +796,7 @@ static TIMER_CALLBACK( sound_update ) /* play the result */ if (finalmix_offset > 0) { - osd_update_audio_stream(finalmix, finalmix_offset / 2); + osd_update_audio_stream(machine, finalmix, finalmix_offset / 2); if (wavfile != NULL) wav_add_data_16(wavfile, finalmix, finalmix_offset); } diff --git a/src/emu/video.c b/src/emu/video.c index 4d6b24ecc2f..fb5f6b48c86 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -1185,7 +1185,7 @@ void video_frame_update(running_machine *machine, int debug) /* ask the OSD to update */ profiler_mark(PROFILER_BLIT); - osd_update(!debug && skipped_it); + osd_update(machine, !debug && skipped_it); profiler_mark(PROFILER_END); /* perform tasks for this frame */ diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h index ecbab3987bc..7687ee49752 100644 --- a/src/osd/osdepend.h +++ b/src/osd/osdepend.h @@ -106,7 +106,7 @@ void osd_wait_for_debugger(void); ******************************************************************************/ -void osd_update(int skip_redraw); +void osd_update(running_machine *machine, int skip_redraw); @@ -117,7 +117,7 @@ void osd_update(int skip_redraw); ******************************************************************************/ -void osd_update_audio_stream(INT16 *buffer, int samples_this_frame); +void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame); /* control master volume. attenuation is the attenuation in dB (a negative diff --git a/src/osd/windows/sound.c b/src/osd/windows/sound.c index 97aa08c6795..69e06fbf865 100644 --- a/src/osd/windows/sound.c +++ b/src/osd/windows/sound.c @@ -20,7 +20,6 @@ #include "osdepend.h" #include "driver.h" #include "osdepend.h" -#include "deprecat.h" // MAMEOS headers #include "winmain.h" @@ -74,7 +73,7 @@ static FILE * sound_log; //============================================================ static void sound_exit(running_machine *machine); -static HRESULT dsound_init(void); +static HRESULT dsound_init(running_machine *machine); static void dsound_kill(void); static HRESULT dsound_create_buffers(void); static void dsound_destroy_buffers(void); @@ -100,7 +99,7 @@ void winsound_init(running_machine *machine) // attempt to initialize directsound // don't make it fatal if we can't -- we'll just run without sound - dsound_init(); + dsound_init(machine); } @@ -174,7 +173,7 @@ static void copy_sample_data(INT16 *data, int bytes_to_copy) // osd_update_audio_stream //============================================================ -void osd_update_audio_stream(INT16 *buffer, int samples_this_frame) +void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame) { int bytes_this_frame = samples_this_frame * stream_format.nBlockAlign; DWORD play_position, write_position; @@ -248,7 +247,7 @@ void osd_set_mastervolume(int attenuation) // dsound_init //============================================================ -static HRESULT dsound_init(void) +static HRESULT dsound_init(running_machine *machine) { HRESULT result; @@ -281,7 +280,7 @@ static HRESULT dsound_init(void) stream_format.wBitsPerSample = 16; stream_format.wFormatTag = WAVE_FORMAT_PCM; stream_format.nChannels = 2; - stream_format.nSamplesPerSec = Machine->sample_rate; + stream_format.nSamplesPerSec = machine->sample_rate; stream_format.nBlockAlign = stream_format.wBitsPerSample * stream_format.nChannels / 8; stream_format.nAvgBytesPerSec = stream_format.nSamplesPerSec * stream_format.nBlockAlign; diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c index 697ecd70b18..038a2625b99 100644 --- a/src/osd/windows/video.c +++ b/src/osd/windows/video.c @@ -30,7 +30,6 @@ #include "render.h" #include "rendutil.h" #include "ui.h" -#include "deprecat.h" // MAMEOS headers #include "winmain.h" @@ -77,8 +76,8 @@ static win_monitor_info *pick_monitor(int index); static void check_osd_inputs(void); -static void extract_video_config(void); -static void load_effect_overlay(const char *filename); +static void extract_video_config(running_machine *machine); +static void load_effect_overlay(running_machine *machine, const char *filename); static float get_aspect(const char *name, int report_error); static void get_resolution(const char *name, win_window_config *config, int report_error); @@ -96,7 +95,7 @@ void winvideo_init(running_machine *machine) add_exit_callback(machine, video_exit); // extract data from the options - extract_video_config(); + extract_video_config(machine); // set up monitors first init_monitors(); @@ -203,7 +202,7 @@ win_monitor_info *winvideo_monitor_from_handle(HMONITOR hmonitor) // osd_update //============================================================ -void osd_update(int skip_redraw) +void osd_update(running_machine *machine, int skip_redraw) { win_window_info *window; @@ -375,7 +374,7 @@ static void check_osd_inputs(void) // extract_video_config //============================================================ -static void extract_video_config(void) +static void extract_video_config(running_machine *machine) { const char *stemp; @@ -391,7 +390,7 @@ static void extract_video_config(void) #endif stemp = options_get_string(mame_options(), WINOPTION_EFFECT); if (strcmp(stemp, "none") != 0) - load_effect_overlay(stemp); + load_effect_overlay(machine, stemp); // per-window options: extract the data get_resolution(WINOPTION_RESOLUTION0, &video_config.window[0], TRUE); @@ -449,7 +448,7 @@ static void extract_video_config(void) // load_effect_overlay //============================================================ -static void load_effect_overlay(const char *filename) +static void load_effect_overlay(running_machine *machine, const char *filename) { char *tempstr = malloc_or_die(strlen(filename) + 5); int numscreens; @@ -473,7 +472,7 @@ static void load_effect_overlay(const char *filename) } // set the overlay on all screens - numscreens = video_screen_count(Machine->config); + numscreens = video_screen_count(machine->config); for (scrnum = 0; scrnum < numscreens; scrnum++) render_container_set_overlay(render_container_get_screen(scrnum), effect_bitmap);