diff options
author | 2008-07-24 06:18:01 +0000 | |
---|---|---|
committer | 2008-07-24 06:18:01 +0000 | |
commit | 9b63c422030b302154ad57541ccc5375cdc7e215 (patch) | |
tree | 6b044748b88c9a24c916e7c8042462ece99f5f96 /src/emu/sound | |
parent | 0865f72a9a1a0150c1320dad2c5940fd736bc640 (diff) |
From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] .data removals to fix reset/multisession bugs
Hi mamedev,
One nice artifact of properly constifying data structures in MAME is
that it makes it relatively easy to spot a class of reset/multisession
bugs, namely that almost any object in .data is probably in error.
Unless the value is properly initialized in a reset routine the
initial non-zero value can't be relied upon, so there's no need to
have a non-zero value to begin with.
With that in mind, here's a patch to move more items out of .data by
either applying const, removing the non-zero initializer (if its
overwritten by init/reset) or by adding appropriate initialization
code. In most cases I tried to add initialization code to a reset
routine, but in some cases I chose an init routine, possibly leaving a
reset bug intact.
Some interesting bits:
1. tms9900 core. The use of .data to initialize the irq_level wasn't
correct in some cases as the layout of the structure was core
dependent.
2. bfcobra.c. By introducing a VIDEO_START routine a hack in
VIDEO_UPDATE could be removed.
~aa
Diffstat (limited to 'src/emu/sound')
-rw-r--r-- | src/emu/sound/sn76477.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c index 28a7c2256ad..08c89678e21 100644 --- a/src/emu/sound/sn76477.c +++ b/src/emu/sound/sn76477.c @@ -650,7 +650,7 @@ static void log_enable_line(struct SN76477 *sn) static void log_mixer_mode(struct SN76477 *sn) { - const char *desc[] = + static const char *const desc[] = { "VCO", "SLF", "Noise", "VCO/Noise", "SLF/Noise", "SLF/VCO/Noise", "SLF/VCO", "Inhibit" @@ -662,7 +662,7 @@ static void log_mixer_mode(struct SN76477 *sn) static void log_envelope_mode(struct SN76477 *sn) { - const char *desc[] = + static const char *const desc[] = { "VCO", "One-Shot", "Mixer Only", "VCO with Alternating Polarity" }; @@ -673,7 +673,7 @@ static void log_envelope_mode(struct SN76477 *sn) static void log_vco_mode(struct SN76477 *sn) { - const char *desc[] = + static const char *const desc[] = { "External (Pin 16)", "Internal (SLF)" }; |