diff options
author | Aaron Giles <aaron@aarongiles.com> | 2008-07-24 06:26:47 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2008-07-24 06:26:47 +0000 |
commit | 0b77a69691d6c7ef7117f9c141bd1301d083011c (patch) | |
tree | 44a4d7c1042bd2941364ccad406c9e72bfabc3ff /src/emu/sound/gaelco.c | |
parent | 9b63c422030b302154ad57541ccc5375cdc7e215 (diff) |
From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Conditional code cleanup resubmit
Hi mamedev,
This is a resubmit of a previous patch. The earlier version would not
compile with 32-bit MSVC, due to the fact that its linker required
external dependencies in dead code to be met before dead code
elimination was done, causing linker errors. The proper fix for this
would be to add the necessary dependencies, so I instead simply left
the conditional code in place in winalloc.c and chd.c.
~aa
Original submission email below:
----
Conditionally compiled code tends to bitrot, so MAME should try to
avoid it as much as possible. I sent a patch six months ago to
eliminate conditional code associated with logging, here's another
patch that does more of this. Some notes:
1. drc_ops.c: I couldn't find a LOG_CODE anywhere, so I used if (0).
2. romload.c: I converted all the users of debugload to use
LOG((...)) instead, following the traditional conditional logging
pattern.
3. windows/sound.c: I eliminated the separate sound log and directed
the few outputs to the error log.
~aa
Diffstat (limited to 'src/emu/sound/gaelco.c')
-rw-r--r-- | src/emu/sound/gaelco.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index 010ad23cc25..c5fcc78dabf 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -45,7 +45,7 @@ Registers per channel: #define LOG_SOUND(x) do { if (VERBOSE_SOUND) logerror x; } while (0) #define LOG_READ_WRITES(x) do { if (VERBOSE_READ_WRITES) logerror x; } while (0) -//#define LOG_WAVE 1 +#define LOG_WAVE 0 //#define ALT_MIX #define GAELCO_NUM_CHANNELS 0x07 @@ -76,9 +76,7 @@ struct GAELCOSND INT16 volume_table[VOLUME_LEVELS][256]; }; -#ifdef LOG_WAVE -void * wavraw; /* raw waveform */ -#endif +static void * wavraw; /* raw waveform */ /*============================================================================ CG-1V/GAE1 Sound Update @@ -182,9 +180,8 @@ static void gaelco_update(void *param, stream_sample_t **inputs, stream_sample_t buffer[1][j] = output_r; } -#ifdef LOG_WAVE - wav_add_data_16lr(wavraw, buffer[0], buffer[1], length); -#endif + if (wavraw) + wav_add_data_32lr(wavraw, buffer[0], buffer[1], length, 0); } /*============================================================================ @@ -271,9 +268,8 @@ static void *gaelcosnd_start(sound_type sndtype, int sndindex, int clock, const } } -#ifdef LOG_WAVE - wavraw = wav_open("gae1_snd.wav", 8000, 2); -#endif + if (LOG_WAVE) + wavraw = wav_open("gae1_snd.wav", 8000, 2); return info; } @@ -291,9 +287,9 @@ static void *gaelco_cg1v_start(int sndindex, int clock, const void *config) static void gaelco_stop(void *chip) { -#ifdef LOG_WAVE - wav_close(wavraw); -#endif + if (wavraw) + wav_close(wavraw); + wavraw = NULL; } |