k005289.c: refactored, removed redundant state variables and unneccessary floating point math, added savestate support [Alex Jackson]

This commit is contained in:
Alex W. Jackson 2013-12-18 17:21:56 +00:00
parent 8e33098361
commit d932860d37
4 changed files with 70 additions and 120 deletions

View File

@ -28,8 +28,9 @@
#include "emu.h" #include "emu.h"
#include "k005289.h" #include "k005289.h"
#define FREQBASEBITS 16 // is this an actual hardware limit? or just an arbitrary divider
// to bring the output frequency down to a reasonable value for MAME?
#define CLOCK_DIVIDER 32
// device type definition // device type definition
const device_type K005289 = &device_creator<k005289_device>; const device_type K005289 = &device_creator<k005289_device>;
@ -48,19 +49,10 @@ k005289_device::k005289_device(const machine_config &mconfig, const char *tag, d
device_sound_interface(mconfig, *this), device_sound_interface(mconfig, *this),
m_sound_prom(NULL), m_sound_prom(NULL),
m_stream(NULL), m_stream(NULL),
m_mclock(0),
m_rate(0), m_rate(0),
m_mixer_table(NULL), m_mixer_table(NULL),
m_mixer_lookup(NULL), m_mixer_lookup(NULL),
m_mixer_buffer(NULL), m_mixer_buffer(NULL)
m_k005289_A_frequency(0),
m_k005289_B_frequency(0),
m_k005289_A_volume(0),
m_k005289_B_volume(0),
m_k005289_A_waveform(0),
m_k005289_B_waveform(0),
m_k005289_A_latch(0),
m_k005289_B_latch(0)
{ {
} }
@ -71,14 +63,9 @@ k005289_device::k005289_device(const machine_config &mconfig, const char *tag, d
void k005289_device::device_start() void k005289_device::device_start()
{ {
k005289_sound_channel *voice;
voice = m_channel_list;
/* get stream channels */ /* get stream channels */
m_rate = clock()/16; m_rate = clock() / CLOCK_DIVIDER;
m_stream = stream_alloc(0, 1, m_rate); m_stream = stream_alloc(0, 1, m_rate);
m_mclock = clock();
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
m_mixer_buffer = auto_alloc_array(machine(), short, 2 * m_rate); m_mixer_buffer = auto_alloc_array(machine(), short, 2 * m_rate);
@ -89,14 +76,20 @@ void k005289_device::device_start()
m_sound_prom = m_region->base(); m_sound_prom = m_region->base();
/* reset all the voices */ /* reset all the voices */
voice[0].frequency = 0; for (int i = 0; i < 2; i++)
voice[0].volume = 0; {
voice[0].wave = &m_sound_prom[0]; m_counter[i] = 0;
voice[0].counter = 0; m_frequency[i] = 0;
voice[1].frequency = 0; m_freq_latch[i] = 0;
voice[1].volume = 0; m_waveform[i] = i * 0x100;
voice[1].wave = &m_sound_prom[0x100]; m_volume[i] = 0;
voice[1].counter = 0; }
save_item(NAME(m_counter));
save_item(NAME(m_frequency));
save_item(NAME(m_freq_latch));
save_item(NAME(m_waveform));
save_item(NAME(m_volume));
} }
@ -106,7 +99,6 @@ void k005289_device::device_start()
void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{ {
k005289_sound_channel *voice=m_channel_list;
stream_sample_t *buffer = outputs[0]; stream_sample_t *buffer = outputs[0];
short *mix; short *mix;
int i,v,f; int i,v,f;
@ -114,12 +106,12 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/* zap the contents of the mixer buffer */ /* zap the contents of the mixer buffer */
memset(m_mixer_buffer, 0, samples * sizeof(INT16)); memset(m_mixer_buffer, 0, samples * sizeof(INT16));
v=voice[0].volume; v=m_volume[0];
f=voice[0].frequency; f=m_frequency[0];
if (v && f) if (v && f)
{ {
const unsigned char *w = voice[0].wave; const unsigned char *w = m_sound_prom + m_waveform[0];
int c = voice[0].counter; int c = m_counter[0];
mix = m_mixer_buffer; mix = m_mixer_buffer;
@ -128,21 +120,21 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t *
{ {
int offs; int offs;
c+=(long)((((float)m_mclock / (float)(f * 16))*(float)(1<<FREQBASEBITS)) / (float)(m_rate / 32)); c += CLOCK_DIVIDER;
offs = (c >> 16) & 0x1f; offs = (c / f) & 0x1f;
*mix++ += ((w[offs] & 0x0f) - 8) * v; *mix++ += ((w[offs] & 0x0f) - 8) * v;
} }
/* update the counter for this voice */ /* update the counter for this voice */
voice[0].counter = c; m_counter[0] = c % (f * 0x20);
} }
v=voice[1].volume; v=m_volume[1];
f=voice[1].frequency; f=m_frequency[1];
if (v && f) if (v && f)
{ {
const unsigned char *w = voice[1].wave; const unsigned char *w = m_sound_prom + m_waveform[1];
int c = voice[1].counter; int c = m_counter[1];
mix = m_mixer_buffer; mix = m_mixer_buffer;
@ -151,13 +143,13 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t *
{ {
int offs; int offs;
c+=(long)((((float)m_mclock / (float)(f * 16))*(float)(1<<FREQBASEBITS)) / (float)(m_rate / 32)); c += CLOCK_DIVIDER;
offs = (c >> 16) & 0x1f; offs = (c / f) & 0x1f;
*mix++ += ((w[offs] & 0x0f) - 8) * v; *mix++ += ((w[offs] & 0x0f) - 8) * v;
} }
/* update the counter for this voice */ /* update the counter for this voice */
voice[1].counter = c; m_counter[1] = c % (f * 0x20);
} }
/* mix it down */ /* mix it down */
@ -195,58 +187,47 @@ void k005289_device::make_mixer_table(int voices)
} }
void k005289_device::k005289_recompute()
{
k005289_sound_channel *voice = m_channel_list;
m_stream->update(); /* update the streams */
voice[0].frequency = m_k005289_A_frequency;
voice[1].frequency = m_k005289_B_frequency;
voice[0].volume = m_k005289_A_volume;
voice[1].volume = m_k005289_B_volume;
voice[0].wave = &m_sound_prom[32 * m_k005289_A_waveform];
voice[1].wave = &m_sound_prom[32 * m_k005289_B_waveform + 0x100];
}
WRITE8_MEMBER( k005289_device::k005289_control_A_w ) WRITE8_MEMBER( k005289_device::k005289_control_A_w )
{ {
m_k005289_A_volume=data&0xf; m_stream->update();
m_k005289_A_waveform=data>>5;
k005289_recompute(); m_volume[0] = data & 0xf;
m_waveform[0] = data & 0xe0;
} }
WRITE8_MEMBER( k005289_device::k005289_control_B_w ) WRITE8_MEMBER( k005289_device::k005289_control_B_w )
{ {
m_k005289_B_volume=data&0xf; m_stream->update();
m_k005289_B_waveform=data>>5;
k005289_recompute(); m_volume[1] = data & 0xf;
m_waveform[1] = (data & 0xe0) + 0x100;
} }
WRITE8_MEMBER( k005289_device::k005289_pitch_A_w ) WRITE8_MEMBER( k005289_device::k005289_pitch_A_w )
{ {
m_k005289_A_latch = 0x1000 - offset; m_freq_latch[0] = 0x1000 - offset;
} }
WRITE8_MEMBER( k005289_device::k005289_pitch_B_w ) WRITE8_MEMBER( k005289_device::k005289_pitch_B_w )
{ {
m_k005289_B_latch = 0x1000 - offset; m_freq_latch[1] = 0x1000 - offset;
} }
WRITE8_MEMBER( k005289_device::k005289_keylatch_A_w ) WRITE8_MEMBER( k005289_device::k005289_keylatch_A_w )
{ {
m_k005289_A_frequency = m_k005289_A_latch; m_stream->update();
k005289_recompute();
m_frequency[0] = m_freq_latch[0];
} }
WRITE8_MEMBER( k005289_device::k005289_keylatch_B_w ) WRITE8_MEMBER( k005289_device::k005289_keylatch_B_w )
{ {
m_k005289_B_frequency = m_k005289_B_latch; m_stream->update();
k005289_recompute();
m_frequency[1] = m_freq_latch[1];
} }

View File

@ -14,19 +14,6 @@
MCFG_DEVICE_REPLACE(_tag, K005289, _clock) MCFG_DEVICE_REPLACE(_tag, K005289, _clock)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
struct k005289_sound_channel
{
int frequency;
int counter;
int volume;
const unsigned char *wave;
};
// ======================> k005289_device // ======================> k005289_device
class k005289_device : public device_t, class k005289_device : public device_t,
@ -53,14 +40,9 @@ public:
private: private:
void make_mixer_table(int voices); void make_mixer_table(int voices);
void k005289_recompute();
private:
k005289_sound_channel m_channel_list[2];
const unsigned char *m_sound_prom; const unsigned char *m_sound_prom;
sound_stream *m_stream; sound_stream *m_stream;
int m_mclock;
int m_rate; int m_rate;
/* mixer tables and internal buffers */ /* mixer tables and internal buffers */
@ -68,14 +50,11 @@ private:
INT16 *m_mixer_lookup; INT16 *m_mixer_lookup;
short *m_mixer_buffer; short *m_mixer_buffer;
int m_k005289_A_frequency; UINT32 m_counter[2];
int m_k005289_B_frequency; UINT16 m_frequency[2];
int m_k005289_A_volume; UINT16 m_freq_latch[2];
int m_k005289_B_volume; UINT16 m_waveform[2];
int m_k005289_A_waveform; UINT8 m_volume[2];
int m_k005289_B_waveform;
int m_k005289_A_latch;
int m_k005289_B_latch;
}; };
extern const device_type K005289; extern const device_type K005289;

View File

@ -206,12 +206,6 @@ READ16_MEMBER(nemesis_state::selected_ip_word_r)
} }
WRITE16_MEMBER(nemesis_state::nemesis_soundlatch_word_w)
{
if (ACCESSING_BITS_0_7)
soundlatch_byte_w(space, offset, data & 0xff);
}
WRITE8_MEMBER(nemesis_state::gx400_speech_start_w) WRITE8_MEMBER(nemesis_state::gx400_speech_start_w)
{ {
/* the voice data is not in a rom but in sound RAM at $8000 */ /* the voice data is not in a rom but in sound RAM at $8000 */
@ -266,7 +260,7 @@ static ADDRESS_MAP_START( nemesis_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_SHARE("colorram2") AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_SHARE("colorram2")
AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram") AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram")
AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x05c000, 0x05c001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0") AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1") AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")
AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */ AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */
@ -300,7 +294,7 @@ static ADDRESS_MAP_START( gx400_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x057000, 0x057fff) AM_RAM /* needed for twinbee */ AM_RANGE(0x057000, 0x057fff) AM_RAM /* needed for twinbee */
AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram") AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram")
AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x05c000, 0x05c001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0") AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")
AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1") AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")
AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST") AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")
@ -332,7 +326,7 @@ static ADDRESS_MAP_START( konamigt_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_SHARE("colorram2") AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_SHARE("colorram2")
AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram") AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram")
AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x05c000, 0x05c001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0") AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1") AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")
AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */ AM_RANGE(0x05c800, 0x05c801) AM_WRITE(watchdog_reset16_w) /* probably */
@ -366,7 +360,7 @@ static ADDRESS_MAP_START( rf2_gx400_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_SHARE("colorram2") AM_RANGE(0x055000, 0x055fff) AM_RAM_WRITE(nemesis_colorram2_word_w) AM_SHARE("colorram2")
AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x056000, 0x056fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram") AM_RANGE(0x05a000, 0x05afff) AM_RAM_WRITE(nemesis_palette_word_w) AM_SHARE("paletteram")
AM_RANGE(0x05c000, 0x05c001) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x05c000, 0x05c001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0") AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")
AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1") AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")
AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST") AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")
@ -427,7 +421,7 @@ static ADDRESS_MAP_START( salamand_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x080000, 0x087fff) AM_RAM AM_RANGE(0x080000, 0x087fff) AM_RAM
AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_SHARE("paletteram") AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_SHARE("paletteram")
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0") AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
AM_RANGE(0x0c0004, 0x0c0005) AM_WRITE(watchdog_reset16_w) /* probably */ AM_RANGE(0x0c0004, 0x0c0005) AM_WRITE(watchdog_reset16_w) /* probably */
AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */ AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
@ -452,7 +446,7 @@ static ADDRESS_MAP_START( blkpnthr_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x080000, 0x081fff) AM_RAM_WRITE(salamander_palette_word_w) AM_SHARE("paletteram") AM_RANGE(0x080000, 0x081fff) AM_RAM_WRITE(salamander_palette_word_w) AM_SHARE("paletteram")
AM_RANGE(0x090000, 0x097fff) AM_RAM AM_RANGE(0x090000, 0x097fff) AM_RAM
AM_RANGE(0x0a0000, 0x0a0001) AM_RAM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ AM_RANGE(0x0a0000, 0x0a0001) AM_RAM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0") AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
AM_RANGE(0x0c0004, 0x0c0005) AM_WRITE(watchdog_reset16_w) /* probably */ AM_RANGE(0x0c0004, 0x0c0005) AM_WRITE(watchdog_reset16_w) /* probably */
AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */ AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
@ -481,7 +475,7 @@ static ADDRESS_MAP_START( citybomb_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x0f0004, 0x0f0005) AM_READ_PORT("IN1") AM_RANGE(0x0f0004, 0x0f0005) AM_READ_PORT("IN1")
AM_RANGE(0x0f0006, 0x0f0007) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */ AM_RANGE(0x0f0006, 0x0f0007) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW0") AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW0")
AM_RANGE(0x0f0010, 0x0f0011) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x0f0010, 0x0f0011) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0f0018, 0x0f0019) AM_WRITE(watchdog_reset16_w) /* probably */ AM_RANGE(0x0f0018, 0x0f0019) AM_WRITE(watchdog_reset16_w) /* probably */
AM_RANGE(0x0f0020, 0x0f0021) AM_READ(selected_ip_word_r) AM_WRITENOP /* WEC Le Mans 24 control? */ AM_RANGE(0x0f0020, 0x0f0021) AM_READ(selected_ip_word_r) AM_WRITENOP /* WEC Le Mans 24 control? */
AM_RANGE(0x0f8000, 0x0f8001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ AM_RANGE(0x0f8000, 0x0f8001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
@ -509,7 +503,7 @@ static ADDRESS_MAP_START( nyanpani_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x070004, 0x070005) AM_READ_PORT("IN1") AM_RANGE(0x070004, 0x070005) AM_READ_PORT("IN1")
AM_RANGE(0x070006, 0x070007) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */ AM_RANGE(0x070006, 0x070007) AM_READ_PORT("IN0") /* Coins, start buttons, test mode */
AM_RANGE(0x070008, 0x070009) AM_READ_PORT("DSW0") AM_RANGE(0x070008, 0x070009) AM_READ_PORT("DSW0")
AM_RANGE(0x070010, 0x070011) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x070010, 0x070011) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x070018, 0x070019) AM_WRITE(watchdog_reset16_w) /* probably */ AM_RANGE(0x070018, 0x070019) AM_WRITE(watchdog_reset16_w) /* probably */
AM_RANGE(0x078000, 0x078001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ AM_RANGE(0x078000, 0x078001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_SHARE("videoram1") /* VRAM */ AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(nemesis_videoram1_word_w) AM_SHARE("videoram1") /* VRAM */
@ -573,7 +567,7 @@ static ADDRESS_MAP_START( hcrash_map, AS_PROGRAM, 16, nemesis_state )
AM_RANGE(0x080000, 0x083fff) AM_RAM AM_RANGE(0x080000, 0x083fff) AM_RAM
AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_SHARE("paletteram") AM_RANGE(0x090000, 0x091fff) AM_RAM_WRITE(salamander_palette_word_w) AM_SHARE("paletteram")
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */ AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(salamand_control_port_word_w) /* irq enable, flipscreen, etc. */
AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(nemesis_soundlatch_word_w) AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0") AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("DSW1") AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("DSW1")
AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("TEST") AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("TEST")
@ -1562,7 +1556,7 @@ static MACHINE_CONFIG_START( nemesis, nemesis_state )
MCFG_SOUND_CONFIG(ay8910_interface_2) /* fixed */ MCFG_SOUND_CONFIG(ay8910_interface_2) /* fixed */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */
MCFG_K005289_ADD("k005289", 3579545/2) MCFG_K005289_ADD("k005289", 3579545)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */
MCFG_SOUND_ADD("vlm", VLM5030, 3579545) MCFG_SOUND_ADD("vlm", VLM5030, 3579545)
@ -1605,7 +1599,7 @@ static MACHINE_CONFIG_START( gx400, nemesis_state )
MCFG_SOUND_CONFIG(ay8910_interface_2) MCFG_SOUND_CONFIG(ay8910_interface_2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */
MCFG_K005289_ADD("k005289", 3579545/2) MCFG_K005289_ADD("k005289", 3579545)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */
MCFG_SOUND_ADD("vlm", VLM5030, 3579545) MCFG_SOUND_ADD("vlm", VLM5030, 3579545)
@ -1647,7 +1641,7 @@ static MACHINE_CONFIG_START( konamigt, nemesis_state )
MCFG_SOUND_CONFIG(ay8910_interface_2) MCFG_SOUND_CONFIG(ay8910_interface_2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_K005289_ADD("k005289", 3579545/2) MCFG_K005289_ADD("k005289", 3579545)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1687,7 +1681,7 @@ static MACHINE_CONFIG_START( rf2_gx400, nemesis_state )
MCFG_SOUND_CONFIG(ay8910_interface_2) MCFG_SOUND_CONFIG(ay8910_interface_2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_K005289_ADD("k005289", 3579545/2) MCFG_K005289_ADD("k005289", 3579545)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
MCFG_SOUND_ADD("vlm", VLM5030, 3579545) MCFG_SOUND_ADD("vlm", VLM5030, 3579545)
@ -2433,7 +2427,7 @@ Notes:
VLM5030 - clock 1.7897725MHz [3.579545/2] VLM5030 - clock 1.7897725MHz [3.579545/2]
AY3-8910 - clock 3.579545MHz AY3-8910 - clock 3.579545MHz
400A1.2B / 400A2.1B - Texas Instruments TBP24S10 Bipolar PROMs 400A1.2B / 400A2.1B - Texas Instruments TBP24S10 Bipolar PROMs
Connected to 0005289, maybe MCU code? Connected to 0005289 (wavetable data)
400B03.8G - 2764 EPROM 400B03.8G - 2764 EPROM
2128 - 2kx8 SRAM 2128 - 2kx8 SRAM
6264 - 8kx8 SRAM 6264 - 8kx8 SRAM
@ -2441,10 +2435,7 @@ Notes:
VSync - 60Hz VSync - 60Hz
HSync - 15.52kHz HSync - 15.52kHz
Custom Chips - 0005289 (DIP42, possibly MCU?), 0005297 (SDIP64) Custom Chips - 0005289 (DIP42, wavetable sound chip), 0005297 (SDIP64)
NOTE! Removing the 0005289 results in the music at start-up having missing notes,
as if only one of the AY3-8910's is being used. The game otherwise boots fine and
appears to play perfectly without any noticeable errors or missing graphics or sounds.
Bottom PCB Bottom PCB
@ -2656,7 +2647,7 @@ static MACHINE_CONFIG_START( bubsys, nemesis_state )
MCFG_SOUND_CONFIG(ay8910_interface_2) MCFG_SOUND_CONFIG(ay8910_interface_2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* verified with OST */
MCFG_SOUND_ADD("k005289", K005289, 3579545/2) MCFG_K005289_ADD("k005289", 3579545)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35) /* verified with OST */
MCFG_SOUND_ADD("vlm", VLM5030, 3579545) MCFG_SOUND_ADD("vlm", VLM5030, 3579545)

View File

@ -74,7 +74,6 @@ public:
DECLARE_READ16_MEMBER(konamigt_input_word_r); DECLARE_READ16_MEMBER(konamigt_input_word_r);
DECLARE_WRITE16_MEMBER(selected_ip_word_w); DECLARE_WRITE16_MEMBER(selected_ip_word_w);
DECLARE_READ16_MEMBER(selected_ip_word_r); DECLARE_READ16_MEMBER(selected_ip_word_r);
DECLARE_WRITE16_MEMBER(nemesis_soundlatch_word_w);
DECLARE_READ8_MEMBER(wd_r); DECLARE_READ8_MEMBER(wd_r);
DECLARE_WRITE16_MEMBER(nemesis_gfx_flipx_word_w); DECLARE_WRITE16_MEMBER(nemesis_gfx_flipx_word_w);
DECLARE_WRITE16_MEMBER(nemesis_gfx_flipy_word_w); DECLARE_WRITE16_MEMBER(nemesis_gfx_flipy_word_w);