summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2018-08-04 17:54:43 +0100
committer smf- <smf-@users.noreply.github.com>2018-08-04 21:38:54 +0100
commitd3cb211b96ff78c3961c24280e37ea9be607b9ce (patch)
treefa5e1beb888ae7b0b7ad7770365939cfa484ab09
parentce99fccdb404808738e4da6a940acb89b3217f5c (diff)
vgmplay: Added all sound chips (including multiple instances supported by the vgm format) & all chips have been reordered into the vgm chip id order. ES5503/SAA1099/VSU now work but the other new additions are greyed out (these will require work to the sound cores themselves). [smf]
-rw-r--r--src/devices/sound/es5503.cpp20
-rw-r--r--src/devices/sound/es5503.h1
-rw-r--r--src/devices/sound/es5506.cpp11
-rw-r--r--src/devices/sound/es5506.h1
-rw-r--r--src/devices/sound/rf5c68.cpp20
-rw-r--r--src/devices/sound/rf5c68.h9
-rw-r--r--src/devices/sound/saa1099.cpp13
-rw-r--r--src/devices/sound/saa1099.h1
-rw-r--r--src/devices/sound/upd7759.cpp9
-rw-r--r--src/devices/sound/upd7759.h1
-rw-r--r--src/mame/audio/vboy.cpp39
-rw-r--r--src/mame/audio/vboy.h5
-rw-r--r--src/mame/drivers/megadriv.cpp6
-rw-r--r--src/mame/drivers/vgmplay.cpp2031
-rw-r--r--src/mame/layout/vgmplay.lay262
-rw-r--r--src/mame/machine/mega32x.cpp20
16 files changed, 1639 insertions, 810 deletions
diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp
index f3127b69261..2344a7c695b 100644
--- a/src/devices/sound/es5503.cpp
+++ b/src/devices/sound/es5503.cpp
@@ -228,11 +228,21 @@ void es5503_device::device_start()
save_item(NAME(oscillators[osc].irqpend), osc);
}
- output_rate = (clock()/8)/34; // (input clock / 8) / # of oscs. enabled + 2
+ output_rate = (clock() / 8) / (2 + oscsenabled);
m_stream = machine().sound().stream_alloc(*this, 0, output_channels, output_rate);
m_timer = timer_alloc(0, nullptr);
- m_timer->adjust(attotime::from_hz(output_rate), 0, attotime::from_hz(output_rate));
+ attotime update_rate = output_rate ? attotime::from_hz(output_rate) : attotime::never;
+ m_timer->adjust(update_rate, 0, update_rate);
+}
+
+void es5503_device::device_clock_changed()
+{
+ output_rate = (clock() / 8) / (2 + oscsenabled);
+ m_stream->set_sample_rate(output_rate);
+
+ attotime update_rate = output_rate ? attotime::from_hz(output_rate) : attotime::never;
+ m_timer->adjust(update_rate, 0, update_rate);
}
void es5503_device::device_reset()
@@ -416,12 +426,16 @@ WRITE8_MEMBER( es5503_device::write )
break;
case 0xe1: // oscillator enable
+ {
oscsenabled = (data>>1) & 0x1f;
output_rate = (clock()/8)/(2+oscsenabled);
m_stream->set_sample_rate(output_rate);
- m_timer->adjust(attotime::from_hz(output_rate), 0, attotime::from_hz(output_rate));
+
+ attotime update_rate = output_rate ? attotime::from_hz(output_rate) : attotime::never;
+ m_timer->adjust(update_rate, 0, update_rate);
break;
+ }
case 0xe2: // A/D converter
break;
diff --git a/src/devices/sound/es5503.h b/src/devices/sound/es5503.h
index 8bf49b6e3ba..640ecc400cf 100644
--- a/src/devices/sound/es5503.h
+++ b/src/devices/sound/es5503.h
@@ -42,6 +42,7 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
+ virtual void device_clock_changed() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) override;
diff --git a/src/devices/sound/es5506.cpp b/src/devices/sound/es5506.cpp
index 01ef0f580eb..f243f0c06e7 100644
--- a/src/devices/sound/es5506.cpp
+++ b/src/devices/sound/es5506.cpp
@@ -301,6 +301,17 @@ void es5506_device::device_start()
}
//-------------------------------------------------
+// device_clock_changed
+//-------------------------------------------------
+
+void es550x_device::device_clock_changed()
+{
+ m_master_clock = clock();
+ m_sample_rate = m_master_clock / (16 * (m_active_voices + 1));
+ m_stream->set_sample_rate(m_sample_rate);
+}
+
+//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
diff --git a/src/devices/sound/es5506.h b/src/devices/sound/es5506.h
index d8d87408402..9022042f33d 100644
--- a/src/devices/sound/es5506.h
+++ b/src/devices/sound/es5506.h
@@ -102,6 +102,7 @@ protected:
// device-level overrides
virtual void device_start() override;
+ virtual void device_clock_changed() override;
virtual void device_stop() override;
virtual void device_reset() override;
diff --git a/src/devices/sound/rf5c68.cpp b/src/devices/sound/rf5c68.cpp
index a00bd45d522..2af393c884b 100644
--- a/src/devices/sound/rf5c68.cpp
+++ b/src/devices/sound/rf5c68.cpp
@@ -13,6 +13,7 @@
// device type definition
DEFINE_DEVICE_TYPE(RF5C68, rf5c68_device, "rf5c68", "Ricoh RF5C68")
+DEFINE_DEVICE_TYPE(RF5C164, rf5c164_device, "rf5c164", "Ricoh RF5C164")
//**************************************************************************
@@ -23,8 +24,8 @@ DEFINE_DEVICE_TYPE(RF5C68, rf5c68_device, "rf5c68", "Ricoh RF5C68")
// rf5c68_device - constructor
//-------------------------------------------------
-rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, RF5C68, tag, owner, clock)
+rf5c68_device::rf5c68_device(const machine_config & mconfig, device_type type, const char * tag, device_t * owner, u32 clock)
+ : device_t(mconfig, type, tag, owner, clock)
, device_sound_interface(mconfig, *this)
, device_memory_interface(mconfig, *this)
, m_data_config("data", ENDIANNESS_LITTLE, 8, 16) // 15 bit Address + 2 Memory select outputs(total 64KB), PSRAM/SRAM/ROM
@@ -35,6 +36,21 @@ rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, dev
{
}
+rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : rf5c68_device(mconfig, RF5C68, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// rf5c68_device - constructor
+//-------------------------------------------------
+
+rf5c164_device::rf5c164_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : rf5c68_device(mconfig, RF5C164, tag, owner, clock)
+{
+}
+
//-------------------------------------------------
// device_start - device-specific startup
diff --git a/src/devices/sound/rf5c68.h b/src/devices/sound/rf5c68.h
index 7d3fc2ba600..5594e32f3e8 100644
--- a/src/devices/sound/rf5c68.h
+++ b/src/devices/sound/rf5c68.h
@@ -44,6 +44,8 @@ public:
DECLARE_WRITE8_MEMBER( rf5c68_mem_w );
protected:
+ rf5c68_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
+
// device-level overrides
virtual void device_start() override;
virtual void device_clock_changed() override;
@@ -82,6 +84,13 @@ private:
sample_end_cb_delegate m_sample_end_cb;
};
+class rf5c164_device : public rf5c68_device
+{
+public:
+ rf5c164_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
DECLARE_DEVICE_TYPE(RF5C68, rf5c68_device)
+DECLARE_DEVICE_TYPE(RF5C164, rf5c164_device)
#endif // MAME_SOUND_RF5C68_H
diff --git a/src/devices/sound/saa1099.cpp b/src/devices/sound/saa1099.cpp
index c8c6c527221..ca1232e13f4 100644
--- a/src/devices/sound/saa1099.cpp
+++ b/src/devices/sound/saa1099.cpp
@@ -201,6 +201,19 @@ void saa1099_device::device_start()
//-------------------------------------------------
+// device_clock_changed
+//-------------------------------------------------
+
+void saa1099_device::device_clock_changed()
+{
+ m_master_clock = clock();
+ m_sample_rate = clock() / 256;
+
+ m_stream->set_sample_rate(m_sample_rate);
+}
+
+
+//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
diff --git a/src/devices/sound/saa1099.h b/src/devices/sound/saa1099.h
index 061f39ecc5f..30df65988df 100644
--- a/src/devices/sound/saa1099.h
+++ b/src/devices/sound/saa1099.h
@@ -40,6 +40,7 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
+ virtual void device_clock_changed() override;
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp
index 5c20e7c13da..8788abe78d8 100644
--- a/src/devices/sound/upd7759.cpp
+++ b/src/devices/sound/upd7759.cpp
@@ -221,7 +221,7 @@ void upd775x_device::device_start()
m_step = 4 * FRAC_ONE;
// compute the clock period
- m_clock_period = attotime::from_hz(clock());
+ m_clock_period = clock() ? attotime::from_hz(clock()) : attotime::zero;
// set the intial state
m_state = STATE_IDLE;
@@ -275,6 +275,13 @@ void upd775x_device::device_start()
save_item(NAME(m_romoffset));
}
+void upd775x_device::device_clock_changed()
+{
+ m_clock_period = clock() ? attotime::from_hz(clock()) : attotime::zero;
+
+ m_channel->set_sample_rate(clock() / 4);
+}
+
void upd7759_device::device_start()
{
upd775x_device::device_start();
diff --git a/src/devices/sound/upd7759.h b/src/devices/sound/upd7759.h
index ab128998f8e..f3b2d9e8e2f 100644
--- a/src/devices/sound/upd7759.h
+++ b/src/devices/sound/upd7759.h
@@ -47,6 +47,7 @@ protected:
// device-level overrides
virtual void device_start() override;
+ virtual void device_clock_changed() override;
virtual void device_reset() override;
virtual void device_post_load() override;
diff --git a/src/mame/audio/vboy.cpp b/src/mame/audio/vboy.cpp
index 4b6d7d73fa0..6dca938d66f 100644
--- a/src/mame/audio/vboy.cpp
+++ b/src/mame/audio/vboy.cpp
@@ -191,9 +191,6 @@ static inline void mputb(uint8_t *ptr, int8_t data) { *ptr = data; }
// LIVE DEVICE
//**************************************************************************
-constexpr unsigned vboysnd_device::AUDIO_FREQ;
-
-
//-------------------------------------------------
// vboysnd_device - constructor
//-------------------------------------------------
@@ -210,25 +207,37 @@ vboysnd_device::vboysnd_device(const machine_config &mconfig, const char *tag, d
void vboysnd_device::device_start()
{
- int i;
-
+ uint32_t rate = clock() / 120;
// create the stream
- m_stream = machine().sound().stream_alloc(*this, 0, 2, AUDIO_FREQ);
+ m_stream = machine().sound().stream_alloc(*this, 0, 2, rate);
- for (i=0; i<2048; i++)
- waveFreq2LenTbl[i] = AUDIO_FREQ / (5000000.0f/(float)((2048-i) * 32));
- for (i=0; i<32; i++)
- waveTimer2LenTbl[i] = ((0.00384f*(float)(i+1)) * (float)AUDIO_FREQ);
- for (i=0; i<8; i++)
- waveEnv2LenTbl[i] = ((0.01536f*(float)(i+1)) * (float)AUDIO_FREQ);
+ m_timer = timer_alloc(0, nullptr);
+ m_timer->adjust(attotime::zero, 0, rate ? attotime::from_hz(rate / 4) : attotime::never);
+
+ for (int i=0; i<2048; i++)
+ waveFreq2LenTbl[i] = ((2048 - i) * 32) / 120;
+ for (int i=0; i<32; i++)
+ waveTimer2LenTbl[i] = (i+1) * 120;
+ for (int i=0; i<8; i++)
+ waveEnv2LenTbl[i] = (i + 1) * 4 * 120;
- for (i = 0; i < 5; i++)
+ for (int i = 0; i < 5; i++)
memset(&snd_channel[i], 0, sizeof(s_snd_channel));
memset(m_aram, 0, 0x600);
+}
- m_timer = timer_alloc(0, nullptr);
- m_timer->adjust(attotime::zero, 0, attotime::from_hz(AUDIO_FREQ/4));
+
+//-------------------------------------------------
+// device_clock_changed
+//-------------------------------------------------
+
+void vboysnd_device::device_clock_changed()
+{
+ uint32_t rate = clock() / 120;
+ m_stream->set_sample_rate(rate);
+
+ m_timer->adjust(attotime::zero, 0, rate ? attotime::from_hz(rate / 4) : attotime::never);
}
diff --git a/src/mame/audio/vboy.h b/src/mame/audio/vboy.h
index 0414370bf77..5ba9bbff8c9 100644
--- a/src/mame/audio/vboy.h
+++ b/src/mame/audio/vboy.h
@@ -21,10 +21,8 @@
class vboysnd_device : public device_t, public device_sound_interface
{
public:
- static constexpr unsigned AUDIO_FREQ = 44100;
-
// construction/destruction
- vboysnd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = AUDIO_FREQ);
+ vboysnd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 5'000'000);
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
@@ -70,6 +68,7 @@ protected:
// device-level overrides
virtual void device_start() override;
+ virtual void device_clock_changed() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp
index f901d6aa070..7469144511c 100644
--- a/src/mame/drivers/megadriv.cpp
+++ b/src/mame/drivers/megadriv.cpp
@@ -612,7 +612,7 @@ MACHINE_CONFIG_START(md_cons_state::genesis_32x)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", (0.25)/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", (0.25)/2)
- MCFG_DEVICE_ADD("sega32x", SEGA_32X_NTSC, 0, m_maincpu, m_scan_timer)
+ MCFG_DEVICE_ADD("sega32x", SEGA_32X_NTSC, (MASTER_CLOCK_NTSC * 3) / 7, m_maincpu, m_scan_timer)
MCFG_SEGA_32X_PALETTE("gen_vdp:palette")
MCFG_SCREEN_MODIFY("megadriv")
@@ -650,7 +650,7 @@ MACHINE_CONFIG_START(md_cons_state::mdj_32x)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", (0.25)/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", (0.25)/2)
- MCFG_DEVICE_ADD("sega32x", SEGA_32X_NTSC, 0, m_maincpu, m_scan_timer)
+ MCFG_DEVICE_ADD("sega32x", SEGA_32X_NTSC, (MASTER_CLOCK_NTSC * 3) / 7, m_maincpu, m_scan_timer)
MCFG_SEGA_32X_PALETTE("gen_vdp:palette")
MCFG_SCREEN_MODIFY("megadriv")
@@ -688,7 +688,7 @@ MACHINE_CONFIG_START(md_cons_state::md_32x)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", (0.25)/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", (0.25)/2)
- MCFG_DEVICE_ADD("sega32x", SEGA_32X_PAL, 0, m_maincpu, m_scan_timer)
+ MCFG_DEVICE_ADD("sega32x", SEGA_32X_PAL, (MASTER_CLOCK_PAL * 3) / 7, m_maincpu, m_scan_timer)
MCFG_SEGA_32X_PALETTE("gen_vdp:palette")
MCFG_SCREEN_MODIFY("megadriv")
diff --git a/src/mame/drivers/vgmplay.cpp b/src/mame/drivers/vgmplay.cpp
index caffaaf5dbe..8b288034d25 100644
--- a/src/mame/drivers/vgmplay.cpp
+++ b/src/mame/drivers/vgmplay.cpp
@@ -12,6 +12,8 @@
#include "cpu/h6280/h6280.h"
#include "cpu/m6502/n2a03.h"
+#include "cpu/m68000/m68000.h"
+#include "cpu/sh/sh2.h"
#include "sound/2203intf.h"
#include "sound/2608intf.h"
#include "sound/2610intf.h"
@@ -21,26 +23,36 @@
#include "sound/3812intf.h"
#include "sound/ay8910.h"
#include "sound/8950intf.h"
+#include "sound/c140.h"
#include "sound/c352.h"
#include "sound/c6280.h"
+#include "sound/es5503.h"
+#include "sound/es5506.h"
#include "sound/gb.h"
#include "sound/iremga20.h"
#include "sound/k051649.h"
#include "sound/k053260.h"
#include "sound/k054539.h"
#include "sound/multipcm.h"
+#include "sound/okim6258.h"
#include "sound/okim6295.h"
#include "sound/pokey.h"
#include "sound/qsound.h"
#include "sound/rf5c68.h"
+#include "sound/saa1099.h"
+#include "sound/scsp.h"
#include "sound/segapcm.h"
#include "sound/sn76496.h"
+#include "sound/upd7759.h"
#include "sound/x1_010.h"
#include "sound/ym2151.h"
#include "sound/ym2413.h"
#include "sound/ymf271.h"
#include "sound/ymf278b.h"
#include "sound/ymz280b.h"
+#include "audio/vboy.h"
+#include "audio/wswan.h"
+#include "machine/mega32x.h"
#include "vgmplay.lh"
#include "debugger.h"
@@ -54,7 +66,6 @@
#include <vector>
#define AS_IO16 1
-#define MCFG_CPU_IO16_MAP MCFG_DEVICE_DATA_MAP
class vgmplay_disassembler : public util::disasm_interface
{
@@ -71,64 +82,91 @@ class vgmplay_device : public cpu_device
public:
enum io8_t
{
- REG_SIZE = 0x00000000,
- A_YM2612_0 = 0x00000010,
- A_YM2612_1 = 0x00000018,
- A_YM2151_0 = 0x00000020,
- A_YM2151_1 = 0x00000028,
- A_YM2413_0 = 0x00000030,
- A_YM2413_1 = 0x00000038,
- A_YM2203_0 = 0x00000040,
- A_YM2203_1 = 0x00000050,
- A_YM3526_0 = 0x00000060,
- A_YM3526_1 = 0x00000068,
- A_YM3812_0 = 0x00000070,
- A_YM3812_1 = 0x00000078,
- A_AY8910A = 0x00000080,
- A_AY8910B = 0x00000090,
- A_SN76496_0 = 0x000000a0,
- A_SN76496_1 = 0x000000a8,
- A_K053260 = 0x000000b0,
- A_C6280 = 0x000000e0,
- A_OKIM6295A = 0x000000f0,
- A_OKIM6295B = 0x00000110,
- A_SEGAPCM = 0x00001000,
- A_GAMEBOY = 0x00002000,
- A_NESAPU = 0x00002030,
- A_NESRAM = 0x00003000,
- A_MULTIPCMA = 0x00013000,
- A_MULTIPCMB = 0x00013010,
- A_POKEYA = 0x00013020,
- A_POKEYB = 0x00013030,
- A_YM2608_0 = 0x00013060,
- A_YM2608_1 = 0x00013068,
- A_YM2610_0 = 0x00013070,
- A_YM2610_1 = 0x00013078,
- A_Y8950_0 = 0x00013080,
- A_Y8950_1 = 0x00013088,
- A_YMF262_0 = 0x00013090,
- A_YMF262_1 = 0x00013098,
- A_YMF278B_0 = 0x000130a0,
- A_YMF278B_1 = 0x000130b0,
- A_YMF271_0 = 0x000130c0,
- A_YMF271_1 = 0x000130d0,
- A_YMZ280B_0 = 0x000130e0,
- A_YMZ280B_1 = 0x000130f0,
- A_K054539A = 0x00013400,
- A_K054539B = 0x00013800,
- A_QSOUND = 0x00013c00,
- A_K051649 = 0x00013c10,
- A_GA20 = 0x00013c20,
- A_RF5C68 = 0x00013c40,
- A_RF5C164 = 0x00013c50,
- A_RF5C68RAM = 0x00014000,
- A_RF5C164RAM = 0x00024000,
- A_X1_010 = 0x00034000
- };
-
- enum io16_t
- {
- A_C352 = 0x00000000
+ REG_SIZE = 0xff000000,
+ A_SN76496_0 = 0x00000000,
+ A_SN76496_1 = 0x80000000,
+ A_YM2413_0 = 0x01000000,
+ A_YM2413_1 = 0x81000000,
+ A_YM2612_0 = 0x02000000,
+ A_YM2612_1 = 0x82000000,
+ A_YM2151_0 = 0x03000000,
+ A_YM2151_1 = 0x83000000,
+ A_SEGAPCM_0 = 0x04000000,
+ A_SEGAPCM_1 = 0x84000000,
+ A_RF5C68 = 0x05000000,
+ A_RF5C68_RAM = 0x85000000,
+ A_YM2203_0 = 0x06000000,
+ A_YM2203_1 = 0x86000000,
+ A_YM2608_0 = 0x07000000,
+ A_YM2608_1 = 0x87000000,
+ A_YM2610_0 = 0x08000000,
+ A_YM2610_1 = 0x88000000,
+ A_YM3812_0 = 0x09000000,
+ A_YM3812_1 = 0x89000000,
+ A_YM3526_0 = 0x0a000000,
+ A_YM3526_1 = 0x8a000000,
+ A_Y8950_0 = 0x0b000000,
+ A_Y8950_1 = 0x8b000000,
+ A_YMF262_0 = 0x0c000000,
+ A_YMF262_1 = 0x8c000000,
+ A_YMF278B_0 = 0x0d000000,
+ A_YMF278B_1 = 0x8d000000,
+ A_YMF271_0 = 0x0e000000,
+ A_YMF271_1 = 0x8e000000,
+ A_YMZ280B_0 = 0x0f000000,
+ A_YMZ280B_1 = 0x8f000000,
+ A_RF5C164 = 0x10000000,
+ A_RF5C164_RAM = 0x90000000,
+ A_32X_PWM = 0x11000000,
+ A_AY8910_0 = 0x12000000,
+ A_AY8910_1 = 0x92000000,
+ A_GAMEBOY_0 = 0x13000000,
+ A_GAMEBOY_1 = 0x93000000,
+ A_NESAPU_0 = 0x14000000,
+ A_NES_RAM_0 = 0x14010000,
+ A_NESAPU_1 = 0x94000000,
+ A_NES_RAM_1 = 0x94010000,
+ A_MULTIPCM_0 = 0x15000000,
+ A_MULTIPCM_1 = 0x95000000,
+ A_UPD7759_0 = 0x16000000,
+ A_UPD7759_1 = 0x96000000,
+ A_OKIM6258_0 = 0x17000000,
+ A_OKIM6258_1 = 0x97000000,
+ A_OKIM6295_0 = 0x18000000,
+ A_OKIM6295_1 = 0x98000000,
+ A_K051649_0 = 0x19000000,
+ A_K051649_1 = 0x99000000,
+ A_K054539_0 = 0x1a000000,
+ A_K054539_1 = 0x9a000000,
+ A_C6280_0 = 0x1b000000,
+ A_C6280_1 = 0x9b000000,
+ A_C140_0 = 0x1c000000,
+ A_C140_1 = 0x9c000000,
+ A_K053260_0 = 0x1d000000,
+ A_K053260_1 = 0x9d000000,
+ A_POKEY_0 = 0x1e000000,
+ A_POKEY_1 = 0x9e000000,
+ A_QSOUND = 0x1f000000,
+ A_SCSP_0 = 0x20000000,
+ A_SCSP_1 = 0xa0000000,
+ A_WSWAN_0 = 0x21000000,
+ A_WSWAN_1 = 0xa1000000,
+ A_VSU_VUE_0 = 0x22000000,
+ A_VSU_VUE_1 = 0xa2000000,
+ A_SAA1099_0 = 0x23000000,
+ A_SAA1099_1 = 0xa3000000,
+ A_ES5503_0 = 0x24000000,
+ A_ES5503_RAM_0 = 0x24000100,
+ A_ES5503_1 = 0xa4000000,
+ A_ES5503_RAM_1 = 0xa4000100,
+ A_ES5505_0 = 0x25000000,
+ A_ES5505_1 = 0xa5000000,
+ A_X1_010_0 = 0x26000000,
+ A_X1_010_1 = 0xa6000000,
+ A_C352_0 = 0x27000000,
+ A_C352_1 = 0xa7000000,
+ A_GA20_0 = 0x28000000,
+ A_GA20_1 = 0xa8000000,
};
vgmplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -157,6 +195,7 @@ public:
template<int Chip> DECLARE_READ8_MEMBER(k054539_rom_r);
template<int Chip> DECLARE_READ8_MEMBER(c352_rom_r);
template<int Chip> DECLARE_READ8_MEMBER(qsound_rom_r);
+ template<int Chip> DECLARE_READ8_MEMBER(es5505_rom_r);
template<int Chip> DECLARE_READ8_MEMBER(ga20_rom_r);
template<int Chip> DECLARE_READ8_MEMBER(x1_010_rom_r);
@@ -180,51 +219,49 @@ protected:
private:
enum { ACT_LED_PERSIST_MS = 100 };
- enum act_led {
- LED_AY8910 = 0,
-
- LED_SN76496,
-
- LED_OKIM6295,
-
+ enum act_led
+ {
+ LED_SN76496 = 0,
+ LED_YM2413,
+ LED_YM2612,
LED_YM2151,
+ LED_SEGAPCM,
+ LED_RF5C68,
LED_YM2203,
- LED_YM2413,
LED_YM2608,
- LED_YM2612,
- LED_YM3526,
+ LED_YM2610,
LED_YM3812,
+ LED_YM3526,
+ LED_Y8950,
+ LED_YMF262,
+ LED_YMF278B,
LED_YMF271,
LED_YMZ280B,
-
- LED_MULTIPCM,
- LED_SEGAPCM,
-
- LED_QSOUND,
-
- LED_POKEY,
-
- LED_NESAPU,
+ LED_RF5C164,
+ LED_32X_PWM,
+ LED_AY8910,
LED_GAMEBOY,
-
- LED_C352,
-
- LED_C6280,
-
+ LED_NESAPU,
+ LED_MULTIPCM,
+ LED_UPD7759,
+ LED_OKIM6258,
+ LED_OKIM6295,
LED_K051649,
- LED_K053260,
LED_K054539,
-
- LED_GA20,
-
- LED_RF5C68,
- LED_RF5C164,
-
+ LED_C6280,
+ LED_C140,
+ LED_K053260,
+ LED_POKEY,
+ LED_QSOUND,
+ LED_SCSP,
+ LED_WSWAN,
+ LED_VSU_VUE,
+ LED_SAA1099,
+ LED_ES5503,
+ LED_ES5505,
LED_X1_010,
- LED_YM2610,
- LED_Y8950,
- LED_YMF262,
- LED_YMF278B,
+ LED_C352,
+ LED_GA20,
LED_COUNT
};
@@ -235,7 +272,8 @@ private:
using led_expiry_list = std::list<led_expiry>;
using led_expiry_iterator = led_expiry_list::iterator;
- struct rom_block {
+ struct rom_block
+ {
offs_t start_address;
offs_t end_address;
std::unique_ptr<uint8_t[]> data;
@@ -244,6 +282,31 @@ private:
rom_block(offs_t start, offs_t end, std::unique_ptr<uint8_t[]> &&d) : start_address(start), end_address(end), data(std::move(d)) {}
};
+ struct stream
+ {
+ // stream control
+ uint8_t type;
+ uint8_t port;
+ uint8_t reg;
+ // stream data
+ uint8_t bank;
+ uint8_t step_size;
+ uint8_t step_base;
+ // frequency
+ uint32_t frequency;
+ // start stream
+ uint32_t offset;
+ uint32_t length;
+ uint8_t length_mode;
+ bool loop;
+ bool reverse;
+ };
+
+ TIMER_CALLBACK_MEMBER(stream_timer_expired);
+
+ stream m_streams[0xff];
+ emu_timer *m_stream_timers[0xff];
+
void pulse_act_led(act_led led);
TIMER_CALLBACK_MEMBER(act_led_expired);
@@ -254,7 +317,7 @@ private:
output_finder<LED_COUNT> m_act_leds;
led_expiry_list m_act_led_expiries;
- std::unique_ptr<led_expiry_iterator []> m_act_led_index;
+ std::unique_ptr<led_expiry_iterator[]> m_act_led_index;
led_expiry_iterator m_act_led_off;
emu_timer *m_act_led_timer = nullptr;
@@ -308,29 +371,29 @@ public:
template<int Chip> DECLARE_WRITE8_MEMBER(okim6295_clock_w);
template<int Chip> DECLARE_WRITE8_MEMBER(okim6295_pin7_w);
- DECLARE_WRITE8_MEMBER(scc_w);
+ template<int Chip> DECLARE_WRITE8_MEMBER(scc_w);
void vgmplay(machine_config &config);
void file_map(address_map &map);
- void soundchips16_map(address_map &map);
void soundchips_map(address_map &map);
+ void soundchips16_map(address_map &map);
template<int Chip> void segapcm_map(address_map &map);
+ template<int Chip> void rf5c68_map(address_map &map);
template<int Chip> void ymf278b_map(address_map &map);
template<int Chip> void ymf271_map(address_map &map);
template<int Chip> void ymz280b_map(address_map &map);
- template<int Chip> void c352_map(address_map &map);
- template<int Chip> void ga20_map(address_map &map);
- template<int Chip> void h6280_io_map(address_map &map);
- template<int Chip> void h6280_map(address_map &map);
- template<int Chip> void k053260_map(address_map &map);
- template<int Chip> void k054539_map(address_map &map);
- template<int Chip> void multipcm_map(address_map &map);
+ template<int Chip> void rf5c164_map(address_map &map);
template<int Chip> void nescpu_map(address_map &map);
+ template<int Chip> void multipcm_map(address_map &map);
template<int Chip> void okim6295_map(address_map &map);
+ template<int Chip> void k054539_map(address_map &map);
+ template<int Chip> void k053260_map(address_map &map);
template<int Chip> void qsound_map(address_map &map);
- template<int Chip> void rf5c68_map(address_map &map);
- template<int Chip> void rf5c164_map(address_map &map);
+ template<int Chip> void es5503_map(address_map &map);
+ template<int Chip> void es5505_map(address_map &map);
template<int Chip> void x1_010_map(address_map &map);
+ template<int Chip> void c352_map(address_map &map);
+ template<int Chip> void ga20_map(address_map &map);
private:
std::vector<uint8_t> m_file_data;
@@ -341,9 +404,8 @@ private:
required_device_array<ym2413_device, 2> m_ym2413;
required_device_array<ym2612_device, 2> m_ym2612;
required_device_array<ym2151_device, 2> m_ym2151;
- required_device<segapcm_device> m_segapcm;
+ required_device_array<segapcm_device, 2> m_segapcm;
required_device<rf5c68_device> m_rf5c68;
- required_shared_ptr<uint8_t> m_rf5c68_ram;
required_device_array<ym2203_device, 2> m_ym2203;
required_device_array<ym2608_device, 2> m_ym2608;
required_device_array<ym2610_device, 2> m_ym2610;
@@ -354,28 +416,36 @@ private:
required_device_array<ymf278b_device, 2> m_ymf278b;
required_device_array<ymf271_device, 2> m_ymf271;
required_device_array<ymz280b_device, 2> m_ymz280b;
+ required_device<rf5c164_device> m_rf5c164;
+ required_device<sega_32x_ntsc_device> m_sega32x;
required_device_array<ay8910_device, 2> m_ay8910;
+ required_device_array<gameboy_sound_device, 2> m_dmg;
+ required_device_array<n2a03_device, 2> m_nescpu;
required_device_array<multipcm_device, 2> m_multipcm;
- required_device<gameboy_sound_device> m_dmg;
- required_device<n2a03_device> m_nescpu;
- required_shared_ptr<uint8_t> m_nesram;
- required_device<k053260_device> m_k053260;
+ required_device_array<upd7759_device, 2> m_upd7759;
+ required_device_array<okim6258_device, 2> m_okim6258;
+ required_device_array<okim6295_device, 2> m_okim6295;
+ required_device_array<k051649_device, 2> m_k051649;
required_device_array<k054539_device, 2> m_k054539;
- required_device<c6280_device> m_c6280;
- required_device<h6280_device> m_h6280;
+ required_device_array<c6280_device, 2> m_c6280;
+ required_device_array<h6280_device, 2> m_h6280;
+ required_device_array<c140_device, 2> m_c140;
+ required_device_array<k053260_device, 2> m_k053260;
required_device_array<pokey_device, 2> m_pokey;
- required_device<c352_device> m_c352;
- required_device_array<okim6295_device, 2> m_okim6295;
required_device<qsound_device> m_qsound;
- required_device<k051649_device> m_k051649;
- required_device<iremga20_device> m_ga20;
- required_device<rf5c68_device> m_rf5c164; // TODO : !!RF5C164!!
- required_shared_ptr<uint8_t> m_rf5c164_ram;
- required_device<x1_010_device> m_x1_010;
+ required_device_array<scsp_device, 2> m_scsp;
+ required_device_array<wswan_sound_device, 2> m_wswan;
+ required_device_array<vboysnd_device, 2> m_vsu_vue;
+ required_device_array<saa1099_device, 2> m_saa1099;
+ required_device_array<es5503_device, 2> m_es5503;
+ required_device_array<es5505_device, 2> m_es5505;
+ required_device_array<x1_010_device, 2> m_x1_010;
+ required_device_array<c352_device, 2> m_c352;
+ required_device_array<iremga20_device, 2> m_ga20;
uint32_t m_okim6295_clock[2];
uint32_t m_okim6295_pin7[2];
- uint8_t m_scc_reg;
+ uint8_t m_scc_reg[2];
uint32_t r32(int offset) const;
uint8_t r8(int offset) const;
@@ -394,30 +464,39 @@ void vgmplay_device::device_start()
{
set_icountptr(m_icount);
m_file = &space(AS_PROGRAM);
- m_io = &space(AS_IO);
- m_io16 = &space(AS_IO16);
+ m_io = &space(AS_IO);
+ m_io16 = &space(AS_IO16);
m_act_leds.resolve();
- m_act_led_index = std::make_unique<led_expiry_iterator []>(LED_COUNT);
+ m_act_led_index = std::make_unique<led_expiry_iterator[]>(LED_COUNT);
for (act_led led = act_led(0); LED_COUNT != led; led = act_led(led + 1))
m_act_led_index[led] = m_act_led_expiries.emplace(m_act_led_expiries.end(), led, attotime::never);
m_act_led_off = m_act_led_expiries.begin();
m_act_led_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vgmplay_device::act_led_expired), this));
+ for (int i = 0; i < 0xff; i++)
+ m_stream_timers[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vgmplay_device::stream_timer_expired), this));
+
save_item(NAME(m_pc));
+ //save_item(NAME(m_streams));
- state_add(STATE_GENPC, "GENPC", m_pc).noshow();
- state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow();
+ state_add(STATE_GENPC, "GENPC", m_pc).noshow();
+ state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow();
}
void vgmplay_device::device_reset()
{
- m_pc = 0;
m_state = RESET;
m_paused = false;
m_ym2612_stream_offset = 0;
blocks_clear();
+
+ for (int i = 0; i < 0xff; i++)
+ {
+ m_streams[i].type = 0xff;
+ m_stream_timers[i]->adjust(attotime::never);
+ }
}
void vgmplay_device::pulse_act_led(act_led led)
@@ -495,7 +574,8 @@ uint32_t vgmplay_device::execute_input_lines() const
void vgmplay_device::blocks_clear()
{
- for(int i = 0; i < 0x40; i++) {
+ for (int i = 0; i < 0x40; i++)
+ {
m_rom_blocks[0][i].clear();
m_rom_blocks[1][i].clear();
m_data_streams[i].clear();
@@ -505,81 +585,121 @@ void vgmplay_device::blocks_clear()
uint32_t vgmplay_device::handle_data_block(uint32_t address)
{
- uint32_t size = m_file->read_dword(m_pc+3);
+ uint32_t size = m_file->read_dword(m_pc + 3);
int second = (size & 0x80000000) ? 1 : 0;
size &= 0x7fffffff;
- uint8_t type = m_file->read_byte(m_pc+2);
- if(type < 0x40) {
+ uint8_t type = m_file->read_byte(m_pc + 2);
+ if (type < 0x40)
+ {
uint32_t start = m_data_streams[type].size();
m_data_stream_starts[type].push_back(start);
m_data_streams[type].resize(start + size);
- for(uint32_t i=0; i<size; i++)
- m_data_streams[type][start+i] = m_file->read_byte(m_pc+7+i);
-
- } else if(type < 0x7f)
+ for (uint32_t i = 0; i<size; i++)
+ m_data_streams[type][start + i] = m_file->read_byte(m_pc + 7 + i);
+ }
+ else if (type < 0x7f)
logerror("ignored compressed stream size %x type %02x\n", size, type);
else if (type < 0x80)
logerror("ignored compression table size %x\n", size);
- else if (type < 0xc0) {
+ else if (type < 0xc0)
+ {
//uint32_t rs = m_file->read_dword(m_pc+7);
- uint32_t start = m_file->read_dword(m_pc+11);
+ uint32_t start = m_file->read_dword(m_pc + 11);
std::unique_ptr<uint8_t[]> block = std::make_unique<uint8_t[]>(size - 8);
- for(uint32_t i=0; i<size-8; i++)
- block[i] = m_file->read_byte(m_pc+15+i);
- m_rom_blocks[second][type - 0x80].emplace_front(start, start+size-9, std::move(block));
- } else if(type <= 0xc2) {
- uint16_t start = m_file->read_word(m_pc+7);
+ for (uint32_t i = 0; i<size - 8; i++)
+ block[i] = m_file->read_byte(m_pc + 15 + i);
+ m_rom_blocks[second][type - 0x80].emplace_front(start, start + size - 9, std::move(block));
+ }
+ else if (type <= 0xc2)
+ {
+ uint16_t start = m_file->read_word(m_pc + 7);
uint32_t data_size = size - 2;
- if (type == 0xc0) {
+ if (type == 0xc0)
for (int i = 0; i < data_size; i++)
- m_io->write_byte(A_RF5C68RAM + start + i, m_file->read_byte(m_pc + 9 + i));
- } else if (type == 0xc1) {
+ m_io->write_byte(A_RF5C68_RAM + start + i, m_file->read_byte(m_pc + 9 + i));
+ else if (type == 0xc1)
for (int i = 0; i < data_size; i++)
- m_io->write_byte(A_RF5C164RAM + start + i, m_file->read_byte(m_pc + 9 + i));
- } else if (type == 0xc2) {
+ m_io->write_byte(A_RF5C164_RAM + start + i, m_file->read_byte(m_pc + 9 + i));
+ else if (type == 0xc2)
for (int i = 0; i < data_size; i++)
- m_io->write_byte(A_NESRAM + start + i, m_file->read_byte(m_pc + 9 + i));
- }
- } else {
+ m_io->write_byte((second ? A_NES_RAM_1 : A_NES_RAM_0) + start + i, m_file->read_byte(m_pc + 9 + i));
+ }
+ else if (type >= 0xe0 && type <= 0xe1)
+ {
+ uint16_t start = m_file->read_dword(m_pc + 7);
+ uint32_t data_size = size - 4;
+ if (type == 0xe0)
+ ; // TODO: SCSP
+ else if (type == 0xe1)
+ for (int i = 0; i < data_size; i++)
+ m_io->write_byte((second ? A_ES5503_RAM_1 : A_ES5503_RAM_0) + start + i, m_file->read_byte(m_pc + 0xb + i));
+ }
+ else
+ {
logerror("ignored ram block size %x type %02x\n", size, type);
}
- return 7+size;
+ return 7 + size;
}
uint32_t vgmplay_device::handle_pcm_write(uint32_t address)
{
- uint8_t type = m_file->read_byte(m_pc+2);
- uint32_t src = m_file->read_dword(m_pc+3) & 0xffffff;
- uint32_t dst = m_file->read_dword(m_pc+6) & 0xffffff;
- uint32_t size = m_file->read_dword(m_pc+9) & 0xffffff;
+ uint8_t type = m_file->read_byte(m_pc + 2);
+ uint32_t src = m_file->read_dword(m_pc + 3) & 0xffffff;
+ uint32_t dst = m_file->read_dword(m_pc + 6) & 0xffffff;
+ uint32_t size = m_file->read_dword(m_pc + 9) & 0xffffff;
+
+ int second = (type & 0x80) ? 1 : 0;
+ type &= 0x7f;
if (m_data_streams->size() <= type || m_data_streams[type].size() <= src + size)
logerror("ignored pcm ram writes src %x dst %x size %x type %02x\n", src, dst, size, type);
- else if (type == 0x01) {
+ else if (type == 0x01 && !second)
+ {
for (int i = 0; i < size; i++)
- m_io->write_byte(A_RF5C68RAM + dst + i, m_data_streams[type][src + i]);
- } else if (type == 0x02) {
+ m_io->write_byte(A_RF5C68_RAM + dst + i, m_data_streams[type][src + i]);
+ }
+ else if (type == 0x02 && !second)
+ {
for (int i = 0; i < size; i++)
- m_io->write_byte(A_RF5C164RAM + dst + i, m_data_streams[type][src + i]);
- } else if (type == 0x07) {
+ m_io->write_byte(A_RF5C164_RAM + dst + i, m_data_streams[type][src + i]);
+ }
+ else if (type == 0x06)
+ {
+ // TODO: SCSP
+ //for (int i = 0; i < size; i++)
+ //m_io->write_byte((second ? A_SCSP_RAM_1 : A_SCSP_RAM_0) + dst + i, m_data_streams[type][src + i]);
+ }
+ else if (type == 0x07)
+ {
for (int i = 0; i < size; i++)
- m_io->write_byte(A_NESRAM + dst + i, m_data_streams[type][src + i]);
- } else {
+ m_io->write_byte((second ? A_NES_RAM_1 : A_NES_RAM_0) + dst + i, m_data_streams[type][src + i]);
+ }
+ else
+ {
logerror("ignored pcm ram writes src %x dst %x size %x type %02x\n", src, dst, size, type);
}
return 12;
}
+TIMER_CALLBACK_MEMBER(vgmplay_device::stream_timer_expired)
+{
+ // TODO: stream audio to chip
+}
+
void vgmplay_device::execute_run()
{
- while(m_icount > 0) {
- switch(m_state) {
- case RESET: {
+ while (m_icount > 0)
+ {
+ switch (m_state)
+ {
+ case RESET:
+ {
uint32_t size = m_io->read_dword(REG_SIZE);
- if(!size) {
+ if (!size)
+ {
m_pc = 0;
m_state = DONE;
break;
@@ -589,7 +709,8 @@ void vgmplay_device::execute_run()
m_state = RUN;
break;
}
- case RUN: {
+ case RUN:
+ {
if (m_paused)
{
machine().sound().system_mute(1);
@@ -600,10 +721,13 @@ void vgmplay_device::execute_run()
{
machine().sound().system_mute(0);
}
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+
+ if (machine().debug_flags & DEBUG_FLAG_ENABLED)
debugger_instruction_hook(m_pc);
+
uint8_t code = m_file->read_byte(m_pc);
- switch(code) {
+ switch (code)
+ {
case 0x30:
pulse_act_led(LED_SN76496);
m_io->write_byte(A_SN76496_1 + 0, m_file->read_byte(m_pc + 1));
@@ -709,8 +833,9 @@ void vgmplay_device::execute_run()
m_pc += 3;
break;
- case 0x61: {
- uint32_t duration = m_file->read_word(m_pc+1);
+ case 0x61:
+ {
+ uint32_t duration = m_file->read_word(m_pc + 1);
m_icount -= duration;
m_pc += 3;
break;
@@ -749,34 +874,121 @@ void vgmplay_device::execute_run()
case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
- m_icount -= 1+(code & 0xf);
+ m_icount -= 1 + (code & 0xf);
m_pc += 1;
break;
case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
pulse_act_led(LED_YM2612);
- if(!m_data_streams[0].empty()) {
- if(m_ym2612_stream_offset >= int(m_data_streams[0].size()))
+ if (!m_data_streams[0].empty())
+ {
+ if (m_ym2612_stream_offset >= int(m_data_streams[0].size()))
m_ym2612_stream_offset = 0;
- m_io->write_byte(A_YM2612_0+0, 0x2a);
- m_io->write_byte(A_YM2612_0+1, m_data_streams[0][m_ym2612_stream_offset]);
+ m_io->write_byte(A_YM2612_0 + 0, 0x2a);
+ m_io->write_byte(A_YM2612_0 + 1, m_data_streams[0][m_ym2612_stream_offset]);
m_ym2612_stream_offset++;
}
m_pc += 1;
m_icount -= code & 0xf;
break;
- case 0xa0: {
+ case 0x90:
+ {
+ uint8_t id = m_file->read_byte(m_pc + 1);
+ if (id < 0xff)
+ {
+ m_streams[id].type = m_file->read_byte(m_pc + 2);
+ m_streams[id].port = m_file->read_byte(m_pc + 3);
+ m_streams[id].reg = m_file->read_byte(m_pc + 4);
+ }
+ m_pc += 5;
+ break;
+ }
+
+ case 0x91:
+ {
+ uint8_t id = m_file->read_byte(m_pc + 1);
+ if (id < 0xff)
+ {
+ m_streams[id].bank = m_file->read_byte(m_pc + 2);
+ m_streams[id].step_size = m_file->read_byte(m_pc + 3);
+ m_streams[id].step_base = m_file->read_byte(m_pc + 4);
+ }
+ m_pc += 5;
+ break;
+ }
+
+ case 0x92:
+ {
+ uint8_t id = m_file->read_byte(m_pc + 1);
+ if (id < 0xff)
+ m_streams[id].frequency = m_file->read_dword(m_pc + 2);
+ m_pc += 6;
+ break;
+ }
+
+ case 0x93:
+ {
+ uint8_t id = m_file->read_byte(m_pc + 1);
+ if (id < 0xff)
+ {
+ uint8_t flags = m_file->read_byte(m_pc + 3);
+ m_streams[id].length_mode = flags & 3;
+ m_streams[id].reverse = BIT(flags, 4);
+ m_streams[id].loop = BIT(flags, 7);
+ m_streams[id].offset = m_file->read_dword(m_pc + 2);
+ m_streams[id].length = m_file->read_dword(m_pc + 7);
+ m_stream_timers[id]->adjust(attotime::zero, id, m_streams[id].frequency ? attotime::from_double(m_streams[id].frequency) : attotime::never);
+ }
+ m_pc += 11;
+ break;
+ }
+
+ case 0x94:
+ {
+ uint8_t id = m_file->read_byte(m_pc + 1);
+ if (id < 0xff)
+ m_stream_timers[id]->adjust(attotime::never, 0);
+ else
+ for (int i = 0; i < 0xff; i++)
+ m_stream_timers[i]->adjust(attotime::never, 0);
+ m_pc += 2;
+ break;
+ }
+
+ case 0x95:
+ {
+ uint8_t id = m_file->read_byte(m_pc + 1);
+ if (id < 0xff && m_streams[id].type < 0xff && m_data_streams[m_streams[id].bank].size() != 0)
+ {
+ uint8_t flags = m_file->read_byte(m_pc + 3);
+ m_streams[id].loop = BIT(flags, 0);
+ m_streams[id].reverse = BIT(flags, 4);
+ /// TODO: get offset & length from????
+ m_streams[id].offset = 0;
+ m_streams[id].length = 0;
+ m_streams[id].length_mode = 0;
+ m_stream_timers[id]->adjust(attotime::zero, id, m_streams[id].frequency ? attotime::from_double(m_streams[id].frequency) : attotime::never);
+ }
+ m_pc += 5;
+ break;
+ }
+
+ case 0xa0:
+ {
pulse_act_led(LED_AY8910);
- uint8_t reg = m_file->read_byte(m_pc+1);
- if(reg & 0x80) {
- m_io->write_byte(A_AY8910B+1, reg & 0x7f);
- m_io->write_byte(A_AY8910B+0, m_file->read_byte(m_pc+2));
- } else {
- m_io->write_byte(A_AY8910A+1, reg & 0x7f);
- m_io->write_byte(A_AY8910A+0, m_file->read_byte(m_pc+2));
+ uint8_t reg = m_file->read_byte(m_pc + 1);
+ if (reg & 0x80)
+ {
+ m_io->write_byte(A_AY8910_1 + 1, reg & 0x7f);
+ m_io->write_byte(A_AY8910_1 + 0, m_file->read_byte(m_pc + 2));
+ }
+ else
+ {
+ m_io->write_byte(A_AY8910_0 + 1, reg & 0x7f);
+ m_io->write_byte(A_AY8910_0 + 0, m_file->read_byte(m_pc + 2));
}
m_pc += 3;
break;
@@ -865,107 +1077,214 @@ void vgmplay_device::execute_run()
case 0xb0:
pulse_act_led(LED_RF5C68);
- m_io->write_byte(A_RF5C68 + m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2));
+ m_io->write_byte(A_RF5C68 + m_file->read_byte(m_pc + 1), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
case 0xb1:
pulse_act_led(LED_RF5C164);
- m_io->write_byte(A_RF5C164 + m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2));
+ m_io->write_byte(A_RF5C164 + m_file->read_byte(m_pc + 1), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
+ case 0xb2:
+ {
+ pulse_act_led(LED_32X_PWM);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ m_io16->write_word(A_32X_PWM + (offset >> 4), ((offset & 0xf) << 8) | m_file->read_byte(m_pc + 2));
+ m_pc += 3;
+ break;
+ }
+
case 0xb3:
+ {
pulse_act_led(LED_GAMEBOY);
- m_io->write_byte(A_GAMEBOY + m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2));
+ uint8_t reg = m_file->read_byte(m_pc + 1);
+ if (reg & 0x80)
+ m_io->write_byte(A_GAMEBOY_1 + (reg & 0x7f), m_file->read_byte(m_pc + 2));
+ else
+ m_io->write_byte(A_GAMEBOY_0 + (reg & 0x7f), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
+ }
case 0xb4:
+ {
pulse_act_led(LED_NESAPU);
- m_io->write_byte(A_NESAPU + m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_NESAPU_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ else
+ m_io->write_byte(A_NESAPU_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
+ }
- case 0xb5: {
+ case 0xb5:
+ {
pulse_act_led(LED_MULTIPCM);
- uint8_t offset = m_file->read_byte(m_pc+1);
- if(offset & 0x80)
- m_io->write_byte(A_MULTIPCMB + (offset & 0x7f), m_file->read_byte(m_pc+2));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_MULTIPCM_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
else
- m_io->write_byte(A_MULTIPCMA + (offset & 0x7f), m_file->read_byte(m_pc+2));
+ m_io->write_byte(A_MULTIPCM_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
}
- case 0xb8: {
+ case 0xb6:
+ {
+ pulse_act_led(LED_UPD7759);
+ // TODO: upd7759
+ break;
+ }
+
+ case 0xb7:
+ {
+ pulse_act_led(LED_OKIM6258);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_OKIM6258_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ else
+ m_io->write_byte(A_OKIM6258_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ m_pc += 3;
+ break;
+ }
+
+ case 0xb8:
+ {
pulse_act_led(LED_OKIM6295);
- uint8_t offset = m_file->read_byte(m_pc+1);
- if(offset & 0x80)
- m_io->write_byte(A_OKIM6295B + (offset & 0x7f), m_file->read_byte(m_pc+2));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_OKIM6295_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
else
- m_io->write_byte(A_OKIM6295A + (offset & 0x7f), m_file->read_byte(m_pc+2));
+ m_io->write_byte(A_OKIM6295_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
}
case 0xb9:
+ {
pulse_act_led(LED_C6280);
- m_io->write_byte(A_C6280 + m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_C6280_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ else
+ m_io->write_byte(A_C6280_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
+ }
case 0xba:
+ {
pulse_act_led(LED_K053260);
- m_io->write_byte(A_K053260 + m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_K053260_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ else
+ m_io->write_byte(A_K053260_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
+ }
- case 0xbb: {
+ case 0xbb:
+ {
pulse_act_led(LED_POKEY);
- uint8_t offset = m_file->read_byte(m_pc+1);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_POKEY_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ else
+ m_io->write_byte(A_POKEY_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ m_pc += 3;
+ break;
+ }
+
+ case 0xbc:
+ {
+ pulse_act_led(LED_WSWAN);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
if (offset & 0x80)
- m_io->write_byte(A_POKEYB + (offset & 0x7f), m_file->read_byte(m_pc+2));
+ m_io->write_byte(A_WSWAN_1 + (offset & 0x7f) + 0x80, m_file->read_byte(m_pc + 2));
else
- m_io->write_byte(A_POKEYA + (offset & 0x7f), m_file->read_byte(m_pc+2));
+ m_io->write_byte(A_WSWAN_0 + (offset & 0x7f) + 0x80, m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
}
- case 0xbf: {
+ case 0xbd:
+ {
+ pulse_act_led(LED_SAA1099);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ {
+ m_io->write_byte(A_SAA1099_1 + 1, offset & 0x7f);
+ m_io->write_byte(A_SAA1099_1 + 0, m_file->read_byte(m_pc + 2));
+ }
+ else
+ {
+ m_io->write_byte(A_SAA1099_0 + 1, offset & 0x7f);
+ m_io->write_byte(A_SAA1099_0 + 0, m_file->read_byte(m_pc + 2));
+ }
+ m_pc += 3;
+ break;
+ }
+
+ case 0xbe:
+ {
+ pulse_act_led(LED_ES5505);
+ // TODO: es5505
+ break;
+ }
+
+ case 0xbf:
+ {
pulse_act_led(LED_GA20);
- m_io->write_byte(A_GA20 + m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_GA20_1 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ else
+ m_io->write_byte(A_GA20_0 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
m_pc += 3;
break;
}
case 0xc0:
+ {
pulse_act_led(LED_SEGAPCM);
- m_io->write_byte(A_SEGAPCM + (m_file->read_word(m_pc+1) & 0x7ff), m_file->read_byte(m_pc+3));
+ uint16_t offset = m_file->read_word(m_pc + 1);
+ if (offset & 0x8000)
+ m_io->write_byte(A_SEGAPCM_1 + (offset & 0x7fff), m_file->read_byte(m_pc + 3));
+ else
+ m_io->write_byte(A_SEGAPCM_0 + (offset & 0x7fff), m_file->read_byte(m_pc + 3));
m_pc += 4;
break;
+ }
case 0xc1:
pulse_act_led(LED_RF5C68);
- m_io->write_byte(A_RF5C68RAM + m_file->read_word(m_pc+1), m_file->read_byte(m_pc+3));
+ m_io->write_byte(A_RF5C68_RAM + m_file->read_word(m_pc + 1), m_file->read_byte(m_pc + 3));
m_pc += 4;
break;
case 0xc2:
pulse_act_led(LED_RF5C164);
- m_io->write_byte(A_RF5C164RAM + m_file->read_word(m_pc+1), m_file->read_byte(m_pc+3));
+ m_io->write_byte(A_RF5C164_RAM + m_file->read_word(m_pc + 1), m_file->read_byte(m_pc + 3));
m_pc += 4;
break;
- case 0xc3: {
+ case 0xc3:
+ {
pulse_act_led(LED_MULTIPCM);
- uint8_t offset = m_file->read_byte(m_pc+1);
- if (offset & 0x80) {
- m_io->write_byte(A_MULTIPCMB + 4 + (offset & 0x7f), m_file->read_byte(m_pc+3));
- m_io->write_byte(A_MULTIPCMB + 8 + (offset & 0x7f), m_file->read_byte(m_pc+2));
- } else {
- m_io->write_byte(A_MULTIPCMA + 4 + (offset & 0x7f), m_file->read_byte(m_pc+3));
- m_io->write_byte(A_MULTIPCMA + 8 + (offset & 0x7f), m_file->read_byte(m_pc+2));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ {
+ m_io->write_byte(A_MULTIPCM_1 + 4 + (offset & 0x7f), m_file->read_byte(m_pc + 3));
+ m_io->write_byte(A_MULTIPCM_1 + 8 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
+ }
+ else
+ {
+ m_io->write_byte(A_MULTIPCM_0 + 4 + (offset & 0x7f), m_file->read_byte(m_pc + 3));
+ m_io->write_byte(A_MULTIPCM_0 + 8 + (offset & 0x7f), m_file->read_byte(m_pc + 2));
}
m_pc += 4;
break;
@@ -973,15 +1292,46 @@ void vgmplay_device::execute_run()
case 0xc4:
pulse_act_led(LED_QSOUND);
- m_io->write_byte(A_QSOUND + 0, m_file->read_byte(m_pc+1));
- m_io->write_byte(A_QSOUND + 1, m_file->read_byte(m_pc+2));
- m_io->write_byte(A_QSOUND + 2, m_file->read_byte(m_pc+3));
+ m_io->write_byte(A_QSOUND + 0, m_file->read_byte(m_pc + 1));
+ m_io->write_byte(A_QSOUND + 1, m_file->read_byte(m_pc + 2));
+ m_io->write_byte(A_QSOUND + 2, m_file->read_byte(m_pc + 3));
m_pc += 4;
break;
- case 0xc8: {
+ case 0xc5:
+ {
+ pulse_act_led(LED_SCSP);
+ // TODO: SCSP memory
+ break;
+ }
+
+ case 0xc6:
+ {
+ pulse_act_led(LED_WSWAN);
+ // TODO: Wonderswan memory
+ break;
+ }
+
+ case 0xc7:
+ {
+ pulse_act_led(LED_VSU_VUE);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_VSU_VUE_1 + ((offset & 0x7f) << 10) + (m_file->read_byte(m_pc + 2) << 2), m_file->read_byte(m_pc + 3));
+ else
+ m_io->write_byte(A_VSU_VUE_0 + ((offset & 0x7f) << 10) + (m_file->read_byte(m_pc + 2) << 2), m_file->read_byte(m_pc + 3));
+ m_pc += 4;
+ break;
+ }
+
+ case 0xc8:
+ {
pulse_act_led(LED_X1_010);
- m_io->write_byte(A_X1_010 + ((m_file->read_byte(m_pc+1) << 8) | m_file->read_byte(m_pc+2)), m_file->read_byte(m_pc+3));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_X1_010_1 + ((offset & 0x7f) << 8) + m_file->read_byte(m_pc + 2), m_file->read_byte(m_pc + 3));
+ else
+ m_io->write_byte(A_X1_010_0 + ((offset & 0x7f) << 8) + m_file->read_byte(m_pc + 2), m_file->read_byte(m_pc + 3));
m_pc += 4;
break;
}
@@ -992,72 +1342,114 @@ void vgmplay_device::execute_run()
uint8_t offset = m_file->read_byte(m_pc + 1);
if (offset & 0x80)
{
- m_io->write_byte(A_YMF278B_1 + (offset & 7) * 2, m_file->read_byte(m_pc + 2));
- m_io->write_byte(A_YMF278B_1 + (offset & 7) * 2 + 1, m_file->read_byte(m_pc + 3));
+ m_io->write_byte(A_YMF278B_1 + ((offset & 0x7f) << 1) + 0, m_file->read_byte(m_pc + 2));
+ m_io->write_byte(A_YMF278B_1 + ((offset & 0x7f) << 1) + 1, m_file->read_byte(m_pc + 3));
}
else
{
- m_io->write_byte(A_YMF278B_0 + (offset & 7) * 2, m_file->read_byte(m_pc + 2));
- m_io->write_byte(A_YMF278B_0 + (offset & 7) * 2 + 1, m_file->read_byte(m_pc + 3));
+ m_io->write_byte(A_YMF278B_0 + ((offset & 0x7f) << 1) + 0, m_file->read_byte(m_pc + 2));
+ m_io->write_byte(A_YMF278B_0 + ((offset & 0x7f) << 1) + 1, m_file->read_byte(m_pc + 3));
}
m_pc += 4;
break;
}
- case 0xd1: {
+ case 0xd1:
+ {
pulse_act_led(LED_YMF271);
- uint8_t offset = m_file->read_byte(m_pc+1);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
if (offset & 0x80)
{
- m_io->write_byte(A_YMF271_1 + (offset & 7) * 2, m_file->read_byte(m_pc + 2));
- m_io->write_byte(A_YMF271_1 + (offset & 7) * 2 + 1, m_file->read_byte(m_pc + 3));
+ m_io->write_byte(A_YMF271_1 + ((offset & 0x7f) << 1) + 0, m_file->read_byte(m_pc + 2));
+ m_io->write_byte(A_YMF271_1 + ((offset & 0x7f) << 1) + 1, m_file->read_byte(m_pc + 3));
}
else
{
- m_io->write_byte(A_YMF271_0 + (offset & 7) * 2, m_file->read_byte(m_pc + 2));
- m_io->write_byte(A_YMF271_0 + (offset & 7) * 2 + 1, m_file->read_byte(m_pc + 3));
+ m_io->write_byte(A_YMF271_0 + ((offset & 0x7f) << 1) + 0, m_file->read_byte(m_pc + 2));
+ m_io->write_byte(A_YMF271_0 + ((offset & 0x7f) << 1) + 1, m_file->read_byte(m_pc + 3));
}
m_pc += 4;
break;
}
- case 0xd2: {
+ case 0xd2:
+ {
pulse_act_led(LED_K051649);
- uint32_t offset = m_file->read_byte(m_pc+1) << 1;
- m_io->write_byte(A_K051649 + (offset | 0), m_file->read_byte(m_pc+2));
- m_io->write_byte(A_K051649 + (offset | 1), m_file->read_byte(m_pc+3));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ {
+ m_io->write_byte(A_K051649_1 + ((offset & 0x7f) << 1) + 0, m_file->read_byte(m_pc + 2));
+ m_io->write_byte(A_K051649_1 + ((offset & 0x7f) << 1) + 1, m_file->read_byte(m_pc + 3));
+ }
+ else
+ {
+ m_io->write_byte(A_K051649_0 + ((offset & 0x7f) << 1) + 0, m_file->read_byte(m_pc + 2));
+ m_io->write_byte(A_K051649_0 + ((offset & 0x7f) << 1) + 1, m_file->read_byte(m_pc + 3));
+ }
m_pc += 4;
break;
}
- case 0xd3: {
+ case 0xd3:
+ {
pulse_act_led(LED_K054539);
- uint16_t offset = m_file->read_byte(m_pc+1) << 8 | m_file->read_byte(m_pc+2);
- if (offset & 0x8000)
- m_io->write_byte(A_K054539B + (offset & 0x3ff), m_file->read_byte(m_pc+3));
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_K054539_1 + ((offset & 0x7f) << 8) + m_file->read_byte(m_pc + 2), m_file->read_byte(m_pc + 3));
else
- m_io->write_byte(A_K054539A + (offset & 0x3ff), m_file->read_byte(m_pc+3));
+ m_io->write_byte(A_K054539_0 + ((offset & 0x7f) << 8) + m_file->read_byte(m_pc + 2), m_file->read_byte(m_pc + 3));
m_pc += 4;
break;
}
+ case 0xd4:
+ {
+ pulse_act_led(LED_C140);
+ // TODO: c140
+ break;
+ }
+
+ case 0xd5:
+ {
+ pulse_act_led(LED_ES5503);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ if (offset & 0x80)
+ m_io->write_byte(A_ES5503_1 + ((offset & 0x7f) << 8) + m_file->read_byte(m_pc + 2), m_file->read_byte(m_pc + 3));
+ else
+ m_io->write_byte(A_ES5503_0 + ((offset & 0x7f) << 8) + m_file->read_byte(m_pc + 2), m_file->read_byte(m_pc + 3));
+ m_pc += 4;
+ break;
+ }
+
+ case 0xd6:
+ {
+ pulse_act_led(LED_ES5505);
+ // TODO: es5505
+ break;
+ }
+
case 0xe0:
pulse_act_led(LED_YM2612);
- m_ym2612_stream_offset = m_file->read_dword(m_pc+1);
+ m_ym2612_stream_offset = m_file->read_dword(m_pc + 1);
m_pc += 5;
break;
- case 0xe1: {
+ case 0xe1:
+ {
pulse_act_led(LED_C352);
- uint32_t addr = (m_file->read_byte(m_pc+1) << 8) | m_file->read_byte(m_pc+2);
- uint16_t data = (m_file->read_byte(m_pc+3) << 8) | m_file->read_byte(m_pc+4);
- m_io16->write_word(A_C352 + (addr << 1), data);
+ uint8_t offset = m_file->read_byte(m_pc + 1);
+ uint32_t addr = ((offset & 0x7f) << 8) + m_file->read_byte(m_pc + 2);
+ uint16_t data = (m_file->read_byte(m_pc + 3) << 8) + m_file->read_byte(m_pc + 4);
+ if (offset & 0x80)
+ m_io16->write_word(A_C352_1 + (addr << 1), data);
+ else
+ m_io16->write_word(A_C352_0 + (addr << 1), data);
m_pc += 5;
break;
}
default:
- logerror("unhandled code %02x (%02x %02x %02x %02x)\n", code, m_file->read_byte(m_pc+1), m_file->read_byte(m_pc+2), m_file->read_byte(m_pc+3), m_file->read_byte(m_pc+4));
+ logerror("unhandled code %02x (%02x %02x %02x %02x)\n", code, m_file->read_byte(m_pc + 1), m_file->read_byte(m_pc + 2), m_file->read_byte(m_pc + 3), m_file->read_byte(m_pc + 4));
m_state = DONE;
m_icount = 0;
break;
@@ -1067,7 +1459,7 @@ void vgmplay_device::execute_run()
case DONE:
{
static bool done = false;
- if(!done && !m_loop)
+ if (!done && !m_loop)
{
logerror("done\n");
done = true;
@@ -1078,7 +1470,7 @@ void vgmplay_device::execute_run()
}
else
{
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
+ if (machine().debug_flags & DEBUG_FLAG_ENABLED)
debugger_instruction_hook(m_pc);
}
m_icount = 0;
@@ -1094,10 +1486,11 @@ void vgmplay_device::execute_set_input(int inputnum, int state)
device_memory_interface::space_config_vector vgmplay_device::memory_space_config() const
{
- return space_config_vector {
+ return space_config_vector
+ {
std::make_pair(AS_PROGRAM, &m_file_config),
std::make_pair(AS_IO, &m_io_config),
- std::make_pair(AS_IO16, &m_io16_config)
+ std::make_pair(AS_IO16, &m_io16_config),
};
}
@@ -1125,7 +1518,8 @@ uint32_t vgmplay_disassembler::opcode_alignment() const
offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params)
{
- switch(opcodes.r8(pc)) {
+ switch (opcodes.r8(pc))
+ {
case 0x30:
util::stream_format(stream, "psg.1 write %02x", opcodes.r8(pc + 1));
return 2 | SUPPORTED;
@@ -1174,15 +1568,15 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
return 3 | SUPPORTED;
case 0x5b:
- util::stream_format(stream, "ym3526.0 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "ym3526.0 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0x5c:
- util::stream_format(stream, "y8950.0 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "y8950.0 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0x5d:
- util::stream_format(stream, "ymz280b.0 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "ymz280b.0 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0x5e:
@@ -1190,8 +1584,9 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
util::stream_format(stream, "ymf262.0 %d r%02x = %02x", opcodes.r8(pc) & 1, opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
- case 0x61: {
- uint32_t duration = opcodes.r8(pc+1) | (opcodes.r8(pc+2) << 8);
+ case 0x61:
+ {
+ uint32_t duration = opcodes.r8(pc + 1) | (opcodes.r8(pc + 2) << 8);
util::stream_format(stream, "wait %d", duration);
return 3 | SUPPORTED;
}
@@ -1208,8 +1603,10 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
util::stream_format(stream, "end");
return 1 | SUPPORTED;
- case 0x67: {
- static const char *const basic_types[8] = {
+ case 0x67:
+ {
+ static const char *const basic_types[8] =
+ {
"ym2612 pcm",
"rf5c68 pcm",
"rf5c164 pcm",
@@ -1220,7 +1617,8 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
"nes apu dpcm"
};
- static const char *const rom_types[20] = {
+ static const char *const rom_types[20] =
+ {
"sega pcm rom",
"ym2608 delta-t rom",
"ym2610 adpcm rom",
@@ -1243,47 +1641,49 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
"ga20 rom"
};
- static const char *const ram_types[3] = {
+ static const char *const ram_types[3] =
+ {
"rf5c68 ram",
"rf5c164 ram",
"nes apu ram"
};
- static const char *const ram2_types[2] = {
+ static const char *const ram2_types[2] =
+ {
"scsp ram",
"es5503 ram"
};
- uint8_t type = opcodes.r8(pc+2);
- uint32_t size = opcodes.r8(pc+3) | (opcodes.r8(pc+4) << 8) | (opcodes.r8(pc+5) << 16) | (opcodes.r8(pc+6) << 24);
- if(type < 0x8)
+ uint8_t type = opcodes.r8(pc + 2);
+ uint32_t size = opcodes.r8(pc + 3) | (opcodes.r8(pc + 4) << 8) | (opcodes.r8(pc + 5) << 16) | (opcodes.r8(pc + 6) << 24);
+ if (type < 0x8)
util::stream_format(stream, "data-block %x, %s", size, basic_types[type]);
- else if(type < 0x40)
+ else if (type < 0x40)
util::stream_format(stream, "data-block %x, %02x", size, type);
- else if(type < 0x48)
+ else if (type < 0x48)
util::stream_format(stream, "data-block %x comp., %s", size, basic_types[type & 0x3f]);
- else if(type < 0x7f)
+ else if (type < 0x7f)
util::stream_format(stream, "data-block %x comp., %02x", size, type & 0x3f);
- else if(type < 0x80)
- util::stream_format(stream, "decomp-table %x, %02x/%02x", size, opcodes.r8(pc+7), opcodes.r8(pc+8));
- else if(type < 0x94)
+ else if (type < 0x80)
+ util::stream_format(stream, "decomp-table %x, %02x/%02x", size, opcodes.r8(pc + 7), opcodes.r8(pc + 8));
+ else if (type < 0x94)
util::stream_format(stream, "data-block %x, %s", size, rom_types[type & 0x7f]);
- else if(type < 0xc0)
+ else if (type < 0xc0)
util::stream_format(stream, "data-block %x, rom %02x", size, type);
- else if(type < 0xc3)
+ else if (type < 0xc3)
util::stream_format(stream, "data-block %x, %s", size, ram_types[type & 0x1f]);
- else if(type < 0xe0)
+ else if (type < 0xe0)
util::stream_format(stream, "data-block %x, ram %02x", size, type);
- else if(type < 0xe2)
+ else if (type < 0xe2)
util::stream_format(stream, "data-block %x, %s", size, ram2_types[type & 0x1f]);
else
util::stream_format(stream, "data-block %x, ram %02x", size, type);
- return (7+size) | SUPPORTED;
+ return (7 + size) | SUPPORTED;
}
case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
- util::stream_format(stream, "wait %d", 1+(opcodes.r8(pc) & 0x0f));
+ util::stream_format(stream, "wait %d", 1 + (opcodes.r8(pc) & 0x0f));
return 1 | SUPPORTED;
case 0x80:
@@ -1295,25 +1695,49 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
util::stream_format(stream, "ym2612.0 r2a = rom++; wait %d", opcodes.r8(pc) & 0xf);
return 1 | SUPPORTED;
+ case 0x90:
+ util::stream_format(stream, "stream control %02x %02x %02x %02x\n", opcodes.r8(pc + 1), opcodes.r8(pc + 2), opcodes.r8(pc + 3), opcodes.r8(pc + 4));
+ return 5 | SUPPORTED;
+
+ case 0x91:
+ util::stream_format(stream, "stream data %02x %02x %02x %02x\n", opcodes.r8(pc + 1), opcodes.r8(pc + 2), opcodes.r8(pc + 3), opcodes.r8(pc + 4));
+ return 5 | SUPPORTED;
+
+ case 0x92:
+ util::stream_format(stream, "stream frequency %02x %d\n", opcodes.r8(pc + 1), opcodes.r32(pc + 2));
+ return 6 | SUPPORTED;
+
+ case 0x93:
+ util::stream_format(stream, "stream start %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", opcodes.r8(pc + 1), opcodes.r8(pc + 2), opcodes.r8(pc + 3), opcodes.r8(pc + 4), opcodes.r8(pc + 5), opcodes.r8(pc + 6), opcodes.r8(pc + 7), opcodes.r8(pc + 8), opcodes.r8(pc + 9), opcodes.r8(pc + 10));
+ return 11 | SUPPORTED;
+
+ case 0x94:
+ util::stream_format(stream, "stream stop %02x\n", opcodes.r8(pc + 1));
+ return 2 | SUPPORTED;
+
+ case 0x95:
+ util::stream_format(stream, "stream start (fast) %02x %02x %02x %02x\n", opcodes.r8(pc + 1), opcodes.r8(pc + 2), opcodes.r8(pc + 3), opcodes.r8(pc + 4));
+ return 5 | SUPPORTED;
+
case 0xa0:
- util::stream_format(stream, "ay8910 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "ay8910.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xa1:
- util::stream_format(stream, "ym2413.1 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "ym2413.1 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xa2:
case 0xa3:
- util::stream_format(stream, "ym2612.1 %d r%02x = %02x", opcodes.r8(pc) & 1, opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "ym2612.1 %d r%02x = %02x", opcodes.r8(pc) & 1, opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xa4:
- util::stream_format(stream, "ym2151.1 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "ym2151.1 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xa5:
- util::stream_format(stream, "ym2203.1 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "ym2203.1 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xa6:
@@ -1321,6 +1745,11 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
util::stream_format(stream, "ym2608.1 %d r%02x = %02x", opcodes.r8(pc) & 1, opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
+ case 0xa8:
+ case 0xa9:
+ util::stream_format(stream, "ym2610.1 %d r%02x = %02x", opcodes.r8(pc) & 1, opcodes.r8(pc + 1), opcodes.r8(pc + 2));
+ return 3 | SUPPORTED;
+
case 0xaa:
util::stream_format(stream, "ym3812.1 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
@@ -1343,106 +1772,144 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
return 3 | SUPPORTED;
case 0xb0:
- util::stream_format(stream, "rf5c68 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "rf5c68 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb1:
- util::stream_format(stream, "rf5c164 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "rf5c164 r%02x = %02x", opcodes.r8(pc + 1), opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb2:
- util::stream_format(stream, "pwm r%x = %03x", opcodes.r8(pc+1) >> 4, opcodes.r8(pc+2) | ((opcodes.r8(pc+1) & 0xf) << 8));
+ util::stream_format(stream, "32x_pwm r%x = %03x", opcodes.r8(pc + 1) >> 4, opcodes.r8(pc + 2) | ((opcodes.r8(pc + 1) & 0xf) << 8));
return 3 | SUPPORTED;
case 0xb3:
- util::stream_format(stream, "dmg r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "dmg.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb4:
- util::stream_format(stream, "nesapu r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "nesapu.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb5:
- util::stream_format(stream, "multipcm r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "multipcm.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb6:
- util::stream_format(stream, "upd7759 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "upd7759.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb7:
- util::stream_format(stream, "okim6258 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "okim6258.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb8:
- util::stream_format(stream, "okim6295 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "okim6295.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xb9:
- util::stream_format(stream, "huc6280 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "huc6280.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xba:
- util::stream_format(stream, "k053260 r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "k053260.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xbb:
- util::stream_format(stream, "pokey r%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2));
+ util::stream_format(stream, "pokey.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
+ return 3 | SUPPORTED;
+
+ case 0xbc:
+ util::stream_format(stream, "wonderswan.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
+ return 3 | SUPPORTED;
+
+ case 0xbd:
+ util::stream_format(stream, "saa1099.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
+ return 3 | SUPPORTED;
+
+ case 0xbe:
+ util::stream_format(stream, "es5505.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
+ return 3 | SUPPORTED;
+
+ case 0xbf:
+ util::stream_format(stream, "ga20.%d r%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2));
return 3 | SUPPORTED;
case 0xc0:
- util::stream_format(stream, "segapcm %04x = %02x", opcodes.r8(pc+1) | (opcodes.r8(pc+2) << 8), opcodes.r8(pc+3));
+ util::stream_format(stream, "segapcm.%d %04x = %02x", BIT(opcodes.r8(pc + 2), 7), opcodes.r8(pc + 1) | ((opcodes.r8(pc + 2) & 0x7f) << 8), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xc1:
- util::stream_format(stream, "rf5c68 %04x = %02x", opcodes.r8(pc+1) | (opcodes.r8(pc+2) << 8), opcodes.r8(pc+3));
+ util::stream_format(stream, "rf5c68 %04x = %02x", opcodes.r8(pc + 1) | (opcodes.r8(pc + 2) << 8), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xc2:
- util::stream_format(stream, "rf5c164 %04x = %02x", opcodes.r8(pc+1) | (opcodes.r8(pc+2) << 8), opcodes.r8(pc+3));
+ util::stream_format(stream, "rf5c164 %04x = %02x", opcodes.r8(pc + 1) | (opcodes.r8(pc + 2) << 8), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xc3:
- util::stream_format(stream, "multipcm c%02x.off = %04x", opcodes.r8(pc+1), opcodes.r8(pc+2) | (opcodes.r8(pc+3) << 8));
+ util::stream_format(stream, "multipcm.%d c%02x.off = %04x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2) | (opcodes.r8(pc + 3) << 8));
return 4 | SUPPORTED;
case 0xc4:
- util::stream_format(stream, "qsound %02x = %04x", opcodes.r8(pc+3), opcodes.r8(pc+2) | (opcodes.r8(pc+1) << 8));
+ util::stream_format(stream, "qsound %02x = %04x", opcodes.r8(pc + 3), opcodes.r8(pc + 2) | (opcodes.r8(pc + 1) << 8));
+ return 4 | SUPPORTED;
+
+ case 0xc5:
+ util::stream_format(stream, "scsp.%d %04x = %02x", BIT(opcodes.r8(pc + 1), 7), ((opcodes.r8(pc + 1) & 0x7f) << 8) | opcodes.r8(pc + 2), opcodes.r8(pc + 3));
+ return 4 | SUPPORTED;
+
+ case 0xc6:
+ util::stream_format(stream, "wswan.%d %04x = %02x", BIT(opcodes.r8(pc + 1), 7), ((opcodes.r8(pc + 1) & 0x7f) << 8) | opcodes.r8(pc + 2), opcodes.r8(pc + 3));
+ return 4 | SUPPORTED;
+
+ case 0xc7:
+ util::stream_format(stream, "vsu-vue.%d %04x = %02x", BIT(opcodes.r8(pc + 1), 7), ((opcodes.r8(pc + 1) & 0x7f) << 8) | opcodes.r8(pc + 2), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xc8:
- util::stream_format(stream, "x1-010 %04x = %02x", opcodes.r8(pc+2) | (opcodes.r8(pc+1) << 8), opcodes.r8(pc+3));
+ util::stream_format(stream, "x1-010.%d %04x = %02x", BIT(opcodes.r8(pc + 1), 7), ((opcodes.r8(pc + 1) & 0x7f) << 8) | opcodes.r8(pc + 2), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xd0:
- util::stream_format(stream, "ymf278b.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc+1) & 0x7f, opcodes.r8(pc+2), opcodes.r8(pc+3));
+ util::stream_format(stream, "ymf278b.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xd1:
- util::stream_format(stream, "ymf271.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc+1), opcodes.r8(pc+2), opcodes.r8(pc+3));
+ util::stream_format(stream, "ymf271.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1), opcodes.r8(pc + 2), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xd2:
- util::stream_format(stream, "scc1 r%02x.%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2), opcodes.r8(pc+3));
+ util::stream_format(stream, "scc1.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xd3:
- util::stream_format(stream, "k054539 r%02x.%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2), opcodes.r8(pc+3));
+ util::stream_format(stream, "k054539.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
case 0xd4:
- util::stream_format(stream, "c140 r%02x.%02x = %02x", opcodes.r8(pc+1), opcodes.r8(pc+2), opcodes.r8(pc+3));
+ util::stream_format(stream, "c140.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2), opcodes.r8(pc + 3));
return 4 | SUPPORTED;
- case 0xe0: {
- uint32_t off = opcodes.r8(pc+1) | (opcodes.r8(pc+2) << 8) | (opcodes.r8(pc+3) << 16) | (opcodes.r8(pc+4) << 24);
+ case 0xd5:
+ util::stream_format(stream, "ess5503.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2), opcodes.r8(pc + 3));
+ return 4 | SUPPORTED;
+
+ case 0xd6:
+ util::stream_format(stream, "ess5505.%d r%02x.%02x = %02x", BIT(opcodes.r8(pc + 1), 7), opcodes.r8(pc + 1) & 0x7f, opcodes.r8(pc + 2), opcodes.r8(pc + 3));
+ return 4 | SUPPORTED;
+
+ case 0xe0:
+ {
+ uint32_t off = opcodes.r8(pc + 1) | (opcodes.r8(pc + 2) << 8) | (opcodes.r8(pc + 3) << 16) | (opcodes.r8(pc + 4) << 24);
util::stream_format(stream, "ym2612 offset = %x", off);
return 5 | SUPPORTED;
}
- case 0xe1: {
- uint16_t addr = (opcodes.r8(pc+1) << 8) | opcodes.r8(pc+2);
- uint16_t data = (opcodes.r8(pc+3) << 8) | opcodes.r8(pc+4);
+ case 0xe1:
+ {
+ uint16_t addr = (opcodes.r8(pc + 1) << 8) | opcodes.r8(pc + 2);
+ uint16_t data = (opcodes.r8(pc + 3) << 8) | opcodes.r8(pc + 4);
util::stream_format(stream, "c352 r%04x = %04x", addr, data);
return 5 | SUPPORTED;
}
@@ -1455,9 +1922,9 @@ offs_t vgmplay_disassembler::disassemble(std::ostream &stream, offs_t pc, const
uint8_t vgmplay_device::rom_r(int chip, uint8_t type, offs_t offset)
{
- for(const auto &b : m_rom_blocks[chip][type - 0x80])
+ for (const auto &b : m_rom_blocks[chip][type - 0x80])
{
- if(offset >= b.start_address && offset <= b.end_address)
+ if (offset >= b.start_address && offset <= b.end_address)
{
return b.data[offset - b.start_address];
}
@@ -1557,6 +2024,12 @@ READ8_MEMBER(vgmplay_device::qsound_rom_r)
}
template<int Chip>
+READ8_MEMBER(vgmplay_device::es5505_rom_r)
+{
+ return rom_r(Chip, 0x90, offset);
+}
+
+template<int Chip>
READ8_MEMBER(vgmplay_device::x1_010_rom_r)
{
return rom_r(Chip, 0x91, offset);
@@ -1583,9 +2056,8 @@ vgmplay_state::vgmplay_state(const machine_config &mconfig, device_type type, co
, m_ym2413(*this, "ym2413.%d", 0)
, m_ym2612(*this, "ym2612.%d", 0)
, m_ym2151(*this, "ym2151.%d", 0)
- , m_segapcm(*this, "segapcm")
+ , m_segapcm(*this, "segapcm.%d", 0)
, m_rf5c68(*this, "rf5c68")
- , m_rf5c68_ram(*this, "rf5c68_ram")
, m_ym2203(*this, "ym2203.%d", 0)
, m_ym2608(*this, "ym2608.%d", 0)
, m_ym2610(*this, "ym2610.%d", 0)
@@ -1596,37 +2068,45 @@ vgmplay_state::vgmplay_state(const machine_config &mconfig, device_type type, co
, m_ymf278b(*this, "ymf278b.%d", 0)
, m_ymf271(*this, "ymf271.%d", 0)
, m_ymz280b(*this, "ymz280b.%d", 0)
- , m_ay8910(*this, "ay8910%c", 'a')
- , m_multipcm(*this, "multipcm%c", 'a')
- , m_dmg(*this, "dmg")
- , m_nescpu(*this, "nescpu")
- , m_nesram(*this, "nesapu_ram")
- , m_k053260(*this, "k053260")
- , m_k054539(*this, "k054539%c", 'a')
- , m_c6280(*this, "c6280")
- , m_h6280(*this, "h6280")
- , m_pokey(*this, "pokey%c", 'a')
- , m_c352(*this, "c352")
- , m_okim6295(*this, "okim6295%c", 'a')
- , m_qsound(*this, "qsound")
- , m_k051649(*this, "k051649")
- , m_ga20(*this, "ga20")
, m_rf5c164(*this, "rf5c164")
- , m_rf5c164_ram(*this, "rf5c164_ram")
- , m_x1_010(*this, "x1_010")
+ , m_sega32x(*this, "sega32x")
+ , m_ay8910(*this, "ay8910.%d", 0)
+ , m_dmg(*this, "dmg.%d", 0)
+ , m_nescpu(*this, "nescpu.%d", 0)
+ , m_multipcm(*this, "multipcm.%d", 0)
+ , m_upd7759(*this, "upd7759.%d", 0)
+ , m_okim6258(*this, "okim6258.%d", 0)
+ , m_okim6295(*this, "okim6295.%d", 0)
+ , m_k051649(*this, "k051649.%d", 0)
+ , m_k054539(*this, "k054539.%d", 0)
+ , m_c6280(*this, "c6280.%d", 0)
+ , m_h6280(*this, "h6280.%d", 0)
+ , m_c140(*this, "c140.%d", 0)
+ , m_k053260(*this, "k053260.%d", 0)
+ , m_pokey(*this, "pokey.%d", 0)
+ , m_qsound(*this, "qsound")
+ , m_scsp(*this, "scsp.%d", 0)
+ , m_wswan(*this, "wswan.%d", 0)
+ , m_vsu_vue(*this, "vsu_vue.%d", 0)
+ , m_saa1099(*this, "saa1099.%d", 0)
+ , m_es5503(*this, "es5503.%d", 0)
+ , m_es5505(*this, "es5505.%d", 0)
+ , m_x1_010(*this, "x1_010.%d", 0)
+ , m_c352(*this, "c352.%d", 0)
+ , m_ga20(*this, "ga20.%d", 0)
{
}
uint32_t vgmplay_state::r32(int off) const
{
- if(off + 3 < int(m_file_data.size()))
- return m_file_data[off] | (m_file_data[off+1] << 8) | (m_file_data[off+2] << 16) | (m_file_data[off+3] << 24);
+ if (off + 3 < int(m_file_data.size()))
+ return m_file_data[off] | (m_file_data[off + 1] << 8) | (m_file_data[off + 2] << 16) | (m_file_data[off + 3] << 24);
return 0;
}
uint8_t vgmplay_state::r8(int off) const
{
- if(off < int(m_file_data.size()))
+ if (off < int(m_file_data.size()))
return m_file_data[off];
return 0;
}
@@ -1645,13 +2125,28 @@ static const uint8_t vgm_ay8910_flags(uint8_t vgm_flags)
return flags;
}
+static const c140_device::C140_TYPE c140_bank_type(uint8_t vgm_type)
+{
+ switch (vgm_type)
+ {
+ case 0:
+ default:
+ return c140_device::C140_TYPE::SYSTEM2;
+ case 1:
+ return c140_device::C140_TYPE::SYSTEM21;
+ case 2:
+ return c140_device::C140_TYPE::ASIC219;
+ }
+}
+
QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
{
m_vgmplay->stop();
m_file_data.resize(quickload_size);
- if (image.fread(&m_file_data[0], quickload_size) != quickload_size)
+ if (!quickload_size ||
+ image.fread(&m_file_data[0], quickload_size) != quickload_size)
{
m_file_data.clear();
return image_init_result::FAIL;
@@ -1659,7 +2154,8 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
else
{
// Decompress gzip-compressed files (aka vgz)
- if(m_file_data[0] == 0x1f && m_file_data[1] == 0x8b) {
+ if(m_file_data[0] == 0x1f && m_file_data[1] == 0x8b)
+ {
std::vector<uint8_t> decomp;
int bs = m_file_data.size();
decomp.resize(2*bs);
@@ -1673,19 +2169,23 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
str.total_in = 0;
str.total_out = 0;
int err = inflateInit2(&str, 31);
- if(err != Z_OK) {
+ if(err != Z_OK)
+ {
logerror("gzip header but not a gzip file\n");
m_file_data.clear();
return image_init_result::FAIL;
}
- do {
+ do
+ {
if(str.total_out >= decomp.size())
decomp.resize(decomp.size() + bs);
str.next_out = &decomp[str.total_out];
str.avail_out = decomp.size() - str.total_out;
err = inflate(&str, Z_SYNC_FLUSH);
} while(err == Z_OK);
- if(err != Z_STREAM_END) {
+
+ if(err != Z_STREAM_END)
+ {
logerror("broken gzip file\n");
m_file_data.clear();
return image_init_result::FAIL;
@@ -1694,7 +2194,8 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
memcpy(&m_file_data[0], &decomp[0], str.total_out);
}
- if(m_file_data.size() < 0x40 || r32(0) != 0x206d6756) {
+ if(m_file_data.size() < 0x40 || r32(0) != 0x206d6756)
+ {
logerror("Not a vgm/vgz file\n");
m_file_data.clear();
return image_init_result::FAIL;
@@ -1704,169 +2205,190 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
logerror("File version %x.%02x\n", version >> 8, version & 0xff);
uint32_t data_start = version >= 0x150 ? r32(0x34) + 0x34 : 0x40;
+ uint32_t extra_header_start = version >= 0x170 && data_start >= 0xc0 && r32(0xbc) ? r32(0xbc) + 0xbc : 0;
+ uint32_t header_size = extra_header_start ? extra_header_start : data_start;
// Parse clocks
m_sn76496[0]->set_unscaled_clock(r32(0x0c) & ~0xc0000000);
- m_sn76496[1]->set_unscaled_clock(r32(0x0c) & 0x40000000 ? r32(0x0c) & ~0xc0000000 : 0);
+ m_sn76496[1]->set_unscaled_clock((r32(0x0c) & 0x40000000) ? r32(0x0c) & ~0xc0000000 : 0);
+
if (r32(0x0c) & 0x80000000)
logerror("Warning: file requests an unsupported T6W28");
m_ym2413[0]->set_unscaled_clock(r32(0x10) & ~0x40000000);
- m_ym2413[1]->set_unscaled_clock(r32(0x10) & 0x40000000 ? r32(0x10) & ~0x40000000 : 0);
+ m_ym2413[1]->set_unscaled_clock((r32(0x10) & 0x40000000) ? r32(0x10) & ~0x40000000 : 0);
m_ym2612[0]->set_unscaled_clock((version >= 0x110 ? r32(0x2c) : r32(0x10)) & ~0xc0000000);
- m_ym2612[1]->set_unscaled_clock((version >= 0x110 ? r32(0x2c) : r32(0x10)) & 0x40000000 ? (version >= 0x110 ? r32(0x2c) : r32(0x10)) & ~0xc0000000 : 0);
+ m_ym2612[1]->set_unscaled_clock(((version >= 0x110 ? r32(0x2c) : r32(0x10)) & 0x40000000) ? (version >= 0x110 ? r32(0x2c) : r32(0x10)) & ~0xc0000000 : 0);
if (version >= 0x110 && (r32(0x2c) & 0x80000000))
logerror("Warning: file requests an unsupported YM3438\n");
m_ym2151[0]->set_unscaled_clock((version >= 0x110 ? r32(0x30) : r32(0x10)) & ~0x40000000);
- m_ym2151[1]->set_unscaled_clock((version >= 0x110 ? r32(0x30) : r32(0x10)) & 0x40000000 ? (version >= 0x110 ? r32(0x30) : r32(0x10)) & ~0x40000000 : 0);
-
- m_segapcm->set_unscaled_clock(version >= 0x151 && data_start >= 0x3c ? r32(0x38) : 0);
- m_segapcm->set_bank(version >= 0x151 && data_start >= 0x40 ? r32(0x3c) : 0);
-
- m_rf5c68->set_unscaled_clock(version >= 0x151 && data_start >= 0x44 ? r32(0x40) : 0);
- m_ym2203[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x48 ? r32(0x44) & ~0x40000000 : 0);
- m_ym2203[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x48 && (r32(0x44) & 0x40000000) ? r32(0x44) & ~0x40000000 : 0);
- m_ym2608[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x4c ? r32(0x48) & ~0x40000000 : 0);
- m_ym2608[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x4c && r32(0x48) & 0x40000000 ? r32(0x48) & ~0x40000000 : 0);
-
- m_ym2610[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x50 ? r32(0x4c) & ~0xc0000000 : 0);
- m_ym2610[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x50 && r32(0x4c) & 0x40000000 ? r32(0x4c) & ~0xc0000000 : 0);
- if (version >= 0x151 && data_start >= 0x50 && (r32(0x4c) & 0x80000000))
+ m_ym2151[1]->set_unscaled_clock(((version >= 0x110 ? r32(0x30) : r32(0x10)) & 0x40000000) ? (version >= 0x110 ? r32(0x30) : r32(0x10)) & ~0x40000000 : 0);
+
+ m_segapcm[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x3c ? r32(0x38) & ~0x40000000 : 0);
+ m_segapcm[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x3c && (r32(0x38) & 0x40000000) ? r32(0x38) & ~0x40000000 : 0);
+ m_segapcm[0]->set_bank(version >= 0x151 && header_size >= 0x40 ? r32(0x3c) : 0);
+ m_segapcm[1]->set_bank(version >= 0x151 && header_size >= 0x40 ? r32(0x3c) : 0);
+
+ m_rf5c68->set_unscaled_clock(version >= 0x151 && header_size >= 0x44 ? r32(0x40) : 0);
+ m_ym2203[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x48 ? r32(0x44) & ~0x40000000 : 0);
+ m_ym2203[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x48 && (r32(0x44) & 0x40000000) ? r32(0x44) & ~0x40000000 : 0);
+ m_ym2608[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x4c ? r32(0x48) & ~0x40000000 : 0);
+ m_ym2608[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x4c && (r32(0x48) & 0x40000000) ? r32(0x48) & ~0x40000000 : 0);
+
+ m_ym2610[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x50 ? r32(0x4c) & ~0xc0000000 : 0);
+ m_ym2610[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x50 && (r32(0x4c) & 0x40000000) ? r32(0x4c) & ~0xc0000000 : 0);
+ if (version >= 0x151 && header_size >= 0x50 && (r32(0x4c) & 0x80000000))
logerror("Warning: file requests an unsupported YM2610B\n");
- m_ym3812[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x54 ? r32(0x50) & ~0xc0000000 : 0);
- m_ym3812[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x54 && r32(0x50) & 0x40000000 ? r32(0x50) & ~0xc0000000 : 0);
- if (version >= 0x151 && data_start >= 0x54 && (r32(0x50) & 0x80000000))
+ m_ym3812[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x54 ? r32(0x50) & ~0xc0000000 : 0);
+ m_ym3812[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x54 && (r32(0x50) & 0x40000000) ? r32(0x50) & ~0xc0000000 : 0);
+ if (version >= 0x151 && header_size >= 0x54 && (r32(0x50) & 0x80000000))
logerror("Warning: file requests an unsupported SoundBlaster Pro\n");
- m_ym3526[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x58 ? r32(0x54) & ~0x40000000 : 0);
- m_ym3526[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x58 && r32(0x54) & 0x40000000 ? r32(0x54) & ~0x40000000 : 0);
- m_y8950[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x5c ? r32(0x58) & ~0x40000000 : 0);
- m_y8950[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x5c && r32(0x58) & 0x40000000 ? r32(0x58) & ~0x40000000 : 0);
- m_ymf262[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x60 ? r32(0x5c) & ~0x40000000 : 0);
- m_ymf262[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x60 && r32(0x5c) & 0x40000000 ? r32(0x5c) & ~0x40000000 : 0);
- m_ymf278b[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x64 ? r32(0x60) & ~0x40000000 : 0);
- m_ymf278b[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x64 && r32(0x60) & 0x40000000 ? r32(0x60) & ~0x40000000 : 0);
- m_ymf271[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x68 ? r32(0x64) & ~0x40000000 : 0);
- m_ymf271[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x68 && r32(0x64) & 0x40000000 ? r32(0x64) & ~0x40000000 : 0);
- m_ymz280b[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x6c ? r32(0x68) & ~0x40000000 : 0);
- m_ymz280b[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x6c && r32(0x68) & 0x40000000 ? r32(0x68) & ~0x40000000 : 0);
-
- m_rf5c164->set_unscaled_clock(version >= 0x151 && data_start >= 0x70 ? r32(0x6c) : 0);
-
- if(version >= 0x151 && data_start >= 0x74 && r32(0x70))
- logerror("Warning: file requests an unsupported PWM\n");
-
- m_ay8910[0]->set_unscaled_clock(version >= 0x151 && data_start >= 0x78 ? r32(0x74) & ~0x40000000 : 0);
- m_ay8910[1]->set_unscaled_clock(version >= 0x151 && data_start >= 0x78 && (r32(0x74) & 0x40000000) ? r32(0x74) & ~0x40000000 : 0);
- m_ay8910[0]->set_psg_type(vgm_ay8910_type(version >= 0x151 && data_start >= 0x7c ? r8(0x78) : 0));
- m_ay8910[1]->set_psg_type(vgm_ay8910_type(version >= 0x151 && data_start >= 0x7c ? r8(0x78) : 0));
- m_ay8910[0]->set_flags(vgm_ay8910_flags(version >= 0x151 && data_start >= 0x7a ? r8(0x79) : 0));
- m_ay8910[1]->set_flags(vgm_ay8910_flags(version >= 0x151 && data_start >= 0x7a ? r8(0x79) : 0));
- m_ym2203[0]->set_flags(vgm_ay8910_flags(version >= 0x151 && data_start >= 0x7b ? r8(0x7a) : 0));
- m_ym2203[1]->set_flags(vgm_ay8910_flags(version >= 0x151 && data_start >= 0x7b ? r8(0x7a) : 0));
- m_ym2608[0]->set_flags(vgm_ay8910_flags(version >= 0x151 && data_start >= 0x7c ? r8(0x7b) : 0));
- m_ym2608[1]->set_flags(vgm_ay8910_flags(version >= 0x151 && data_start >= 0x7c ? r8(0x7b) : 0));
-
- m_dmg->set_unscaled_clock(version >= 0x161 && data_start >= 0x84 ? r32(0x80) & ~0x40000000 : 0);
- if (version >= 0x161 && data_start >= 0x84 && (r32(0x80) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd DMG\n");
-
- m_nescpu->set_unscaled_clock(version >= 0x161 && data_start >= 0x88 ? r32(0x84) & ~0xc0000000 : 0);
- if (version >= 0x161 && data_start >= 0x88 && (r32(0x84) & 0x80000000))
+ m_ym3526[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x58 ? r32(0x54) & ~0x40000000 : 0);
+ m_ym3526[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x58 && (r32(0x54) & 0x40000000) ? r32(0x54) & ~0x40000000 : 0);
+ m_y8950[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x5c ? r32(0x58) & ~0x40000000 : 0);
+ m_y8950[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x5c && (r32(0x58) & 0x40000000) ? r32(0x58) & ~0x40000000 : 0);
+ m_ymf262[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x60 ? r32(0x5c) & ~0x40000000 : 0);
+ m_ymf262[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x60 && (r32(0x5c) & 0x40000000) ? r32(0x5c) & ~0x40000000 : 0);
+ m_ymf278b[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x64 ? r32(0x60) & ~0x40000000 : 0);
+ m_ymf278b[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x64 && r32(0x60) & 0x40000000 ? r32(0x60) & ~0x40000000 : 0);
+ m_ymf271[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x68 ? r32(0x64) & ~0x40000000 : 0);
+ m_ymf271[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x68 && r32(0x64) & 0x40000000 ? r32(0x64) & ~0x40000000 : 0);
+ m_ymz280b[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x6c ? r32(0x68) & ~0x40000000 : 0);
+ m_ymz280b[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x6c && r32(0x68) & 0x40000000 ? r32(0x68) & ~0x40000000 : 0);
+
+ m_rf5c164->set_unscaled_clock(version >= 0x151 && header_size >= 0x70 ? r32(0x6c) : 0);
+
+ m_sega32x->set_unscaled_clock(version >= 0x151 && header_size >= 0x74 && r32(0x70) ? r32(0x70) : 0);
+
+ m_ay8910[0]->set_unscaled_clock(version >= 0x151 && header_size >= 0x78 ? r32(0x74) & ~0x40000000 : 0);
+ m_ay8910[1]->set_unscaled_clock(version >= 0x151 && header_size >= 0x78 && (r32(0x74) & 0x40000000) ? r32(0x74) & ~0x40000000 : 0);
+ m_ay8910[0]->set_psg_type(vgm_ay8910_type(version >= 0x151 && header_size >= 0x7c ? r8(0x78) : 0));
+ m_ay8910[1]->set_psg_type(vgm_ay8910_type(version >= 0x151 && header_size >= 0x7c ? r8(0x78) : 0));
+ m_ay8910[0]->set_flags(vgm_ay8910_flags(version >= 0x151 && header_size >= 0x7a ? r8(0x79) : 0));
+ m_ay8910[1]->set_flags(vgm_ay8910_flags(version >= 0x151 && header_size >= 0x7a ? r8(0x79) : 0));
+ m_ym2203[0]->set_flags(vgm_ay8910_flags(version >= 0x151 && header_size >= 0x7b ? r8(0x7a) : 0));
+ m_ym2203[1]->set_flags(vgm_ay8910_flags(version >= 0x151 && header_size >= 0x7b ? r8(0x7a) : 0));
+ m_ym2608[0]->set_flags(vgm_ay8910_flags(version >= 0x151 && header_size >= 0x7c ? r8(0x7b) : 0));
+ m_ym2608[1]->set_flags(vgm_ay8910_flags(version >= 0x151 && header_size >= 0x7c ? r8(0x7b) : 0));
+
+ m_dmg[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0x84 ? r32(0x80) & ~0x40000000 : 0);
+ m_dmg[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0x84 && (r32(0x80) & 0x40000000) ? r32(0x80) & ~0x40000000 : 0);
+ m_nescpu[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0x88 ? r32(0x84) & ~0xc0000000 : 0);
+ m_nescpu[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0x88 && (r32(0x84) & 0x40000000) ? r32(0x84) & ~0xc0000000 : 0);
+ if (version >= 0x161 && header_size >= 0x88 && (r32(0x84) & 0x80000000))
logerror("Warning: file requests an unsupported FDS sound addon\n");
- if (version >= 0x161 && data_start >= 0x88 && (r32(0x84) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd NES APU\n");
-
- m_multipcm[0]->set_unscaled_clock(version >= 0x161 && data_start >= 0x8c ? r32(0x88) & ~0x40000000 : 0);
- m_multipcm[1]->set_unscaled_clock(version >= 0x161 && data_start >= 0x8c && (r32(0x88) & 0x40000000) ? r32(0x88) & ~0x40000000 : 0);
-
- if (version >= 0x161 && data_start >= 0x90 && r32(0x8c))
- logerror("Warning: file requests an unsupported uPD7759\n");
- if (version >= 0x161 && data_start >= 0x94 && r32(0x90))
- logerror("Warning: file requests an unsupported OKIM6258\n");
-
- m_k054539[0]->init_flags(version >= 0x161 && data_start >= 0x96 ? r8(0x95) : 0);
- m_k054539[1]->init_flags(version >= 0x161 && data_start >= 0x96 ? r8(0x95) : 0);
- m_okim6295_clock[0] = version >= 0x161 && data_start >= 0x9c ? r32(0x98) & ~0xc0000000 : 0;
- m_okim6295_clock[1] = version >= 0x161 && data_start >= 0x9c && (r32(0x98) & 0x40000000) ? r32(0x98) & ~0xc0000000 : 0;
+ m_multipcm[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0x8c ? r32(0x88) & ~0x40000000 : 0);
+ m_multipcm[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0x8c && (r32(0x88) & 0x40000000) ? r32(0x88) & ~0x40000000 : 0);
+ m_upd7759[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0x90 ? r32(0x8c) & ~0x40000000 : 0);
+ m_upd7759[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0x90 && (r32(0x8c) & 0x40000000) ? r32(0x8c) & ~0x40000000 : 0);
+ m_okim6258[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0x94 ? r32(0x90) & ~0x40000000 : 0);
+ m_okim6258[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0x94 && (r32(0x90) & 0x40000000) ? r32(0x90) & ~0x40000000 : 0);
+
+ uint8_t oki6258_flags = version >= 0x161 && header_size >= 0x95 ? r8(0x94) : 0;
+ m_okim6258[0]->set_divider(oki6258_flags & 3);
+ m_okim6258[0]->set_outbits(BIT(oki6258_flags, 3) ? 12 : 10);
+ m_okim6258[0]->set_type(BIT(oki6258_flags, 2));
+ m_okim6258[1]->set_divider(oki6258_flags & 3);
+ m_okim6258[1]->set_outbits(BIT(oki6258_flags, 3) ? 12 : 10);
+ m_okim6258[1]->set_type(BIT(oki6258_flags, 2));
+
+ m_k054539[0]->init_flags(version >= 0x161 && header_size >= 0x96 ? r8(0x95) : 0);
+ m_k054539[1]->init_flags(version >= 0x161 && header_size >= 0x96 ? r8(0x95) : 0);
+
+ m_c140[0]->set_bank_type(c140_bank_type(version >= 0x161 && header_size >= 0x96 ? r8(0x96) : 0));
+ m_c140[1]->set_bank_type(c140_bank_type(version >= 0x161 && header_size >= 0x96 ? r8(0x96) : 0));
+
+ m_okim6295_clock[0] = version >= 0x161 && header_size >= 0x9c ? r32(0x98) & ~0xc0000000 : 0;
+ m_okim6295_clock[1] = version >= 0x161 && header_size >= 0x9c && (r32(0x98) & 0x40000000) ? r32(0x98) & ~0xc0000000 : 0;
m_okim6295[0]->set_unscaled_clock(m_okim6295_clock[0]);
m_okim6295[1]->set_unscaled_clock(m_okim6295_clock[1]);
- m_okim6295_pin7[0] = version >= 0x161 && data_start >= 0x9c && (r32(0x98) & 0x80000000) ? 1 : 0;
- m_okim6295_pin7[1] = version >= 0x161 && data_start >= 0x9c && (r32(0x98) & 0x40000000) && (r32(0x98) & 0x80000000) ? 1 : 0;
+ m_okim6295_pin7[0] = version >= 0x161 && header_size >= 0x9c && (r32(0x98) & 0x80000000) ? 1 : 0;
+ m_okim6295_pin7[1] = version >= 0x161 && header_size >= 0x9c && (r32(0x98) & 0x40000000) && (r32(0x98) & 0x80000000) ? 1 : 0;
m_okim6295[0]->set_pin7(m_okim6295_pin7[0] ? okim6295_device::PIN7_HIGH : okim6295_device::PIN7_LOW);
m_okim6295[1]->set_pin7(m_okim6295_pin7[1] ? okim6295_device::PIN7_HIGH : okim6295_device::PIN7_LOW);
- m_k051649->set_unscaled_clock(version >= 0x161 && data_start >= 0xa0 ? r32(0x9c) & ~0xc0000000 : 0);
- if (version >= 0x161 && data_start >= 0xa0 && (r32(0x9c) & 0x80000000))
+ m_k051649[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xa0 ? r32(0x9c) & ~0xc0000000 : 0);
+ m_k051649[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xa0 && (r32(0x9c) & 0x40000000) ? r32(0x9c) & ~0xc0000000 : 0);
+ if (version >= 0x161 && header_size >= 0xa0 && (r32(0x9c) & 0x80000000))
logerror("Warning: file requests an unsupported Konami SCC\n");
- if (version >= 0x161 && data_start >= 0xa0 && (r32(0x9c) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd K051649\n");
// HACK: Some VGMs contain 48,000 instead of 18,432,000
- if (version >= 0x161 && data_start >= 0xa4 && (r32(0xa0) & ~0x40000000) == 48000)
+ if (version >= 0x161 && header_size >= 0xa4 && (r32(0xa0) & ~0x40000000) == 48000)
{
m_k054539[0]->set_clock_scale(384);
m_k054539[1]->set_clock_scale(384);
}
- m_k054539[0]->set_unscaled_clock(version >= 0x161 && data_start >= 0xa4 ? r32(0xa0) & ~0x40000000 : 0);
- m_k054539[1]->set_unscaled_clock(version >= 0x161 && data_start >= 0xa4 && (r32(0xa0) & 0x40000000) ? r32(0xa0) & ~0x40000000 : 0);
+ m_k054539[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xa4 ? r32(0xa0) & ~0x40000000 : 0);
+ m_k054539[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xa4 && (r32(0xa0) & 0x40000000) ? r32(0xa0) & ~0x40000000 : 0);
- m_c6280->set_unscaled_clock(version >= 0x161 && data_start >= 0xa8 ? r32(0xa4) & ~0x40000000 : 0);
- if (version >= 0x161 && data_start >= 0xa8 && (r32(0xa4) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd C6280\n");
+ m_c6280[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xa8 ? r32(0xa4) & ~0x40000000 : 0);
+ m_c6280[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xa8 && (r32(0xa4) & 0x40000000) ? r32(0xa4) & ~0x40000000 : 0);
- if (version >= 0x161 && data_start >= 0xac && r32(0xa8))
- logerror("Warning: file requests an unsupported C140\n");
+ m_c140[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xac ? r32(0xa8) & ~0x40000000 : 0);
+ m_c140[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xac && (r32(0xa8) & 0x40000000) ? r32(0xa8) & ~0x40000000 : 0);
- m_k053260->set_unscaled_clock(version >= 0x161 && data_start >= 0xb0 ? r32(0xac) & ~0x40000000 : 0);
- if (version >= 0x161 && data_start >= 0xb0 && (r32(0xac) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd K053260\n");
+ m_k053260[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xb0 ? r32(0xac) & ~0x40000000 : 0);
+ m_k053260[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xb0 && (r32(0xac) & 0x40000000) ? r32(0xac) & ~0x40000000 : 0);
- m_pokey[0]->set_unscaled_clock(version >= 0x161 && data_start >= 0xb4 ? r32(0xb0) & ~0x40000000 : 0);
- m_pokey[1]->set_unscaled_clock(version >= 0x161 && data_start >= 0xb4 && (r32(0xb0) & 0x40000000) ? r32(0xb0) & ~0x40000000 : 0);
+ m_pokey[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xb4 ? r32(0xb0) & ~0x40000000 : 0);
+ m_pokey[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xb4 && (r32(0xb0) & 0x40000000) ? r32(0xb0) & ~0x40000000 : 0);
// HACK: VGMs contain 4,000,000 instead of 60,000,000
- if (version >= 0x161 && data_start >= 0xb8 && r32(0xb4) == 4000000)
+ if (version >= 0x161 && header_size >= 0xb8 && r32(0xb4) == 4000000)
m_qsound->set_clock_scale(15);
- m_qsound->set_unscaled_clock(version >= 0x161 && data_start >= 0xb8 ? r32(0xb4) : 0);
+ m_qsound->set_unscaled_clock(version >= 0x161 && header_size >= 0xb8 ? r32(0xb4) : 0);
+ m_scsp[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xbc ? r32(0xb8) & ~0x40000000 : 0);
+ m_scsp[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xbc && (r32(0xb8) & 0x40000000) ? r32(0xb8) & ~0x40000000 : 0);
- if (version >= 0x171 && data_start >= 0xbc && r32(0xb8))
- logerror("Warning: file requests an unsupported SCSP\n");
-
- if (version >= 0x170 && data_start >= 0xc0 && r32(0xbc))
+ if (version >= 0x170 && header_size >= 0xc0 && r32(0xbc))
logerror("Warning: file requests an unsupported Extra Header\n");
- if (version >= 0x171 && data_start >= 0xc4 && r32(0xc0))
+ if (version >= 0x171 && header_size >= 0xc4 && r32(0xc0))
logerror("Warning: file requests an unsupported WonderSwan\n");
- if (version >= 0x171 && data_start >= 0xc8 && r32(0xc4))
- logerror("Warning: file requests an unsupported VSU\n");
- if (version >= 0x171 && data_start >= 0xcc && r32(0xc8))
- logerror("Warning: file requests an unsupported SAA1099\n");
- if (version >= 0x171 && data_start >= 0xd0 && r32(0xcc))
- logerror("Warning: file requests an unsupported ES5503\n");
- if (version >= 0x171 && data_start >= 0xd4 && r32(0xd0))
- logerror("Warning: file requests an unsupported %s\n", r32(0xd0) & 0x80000000 ? "ES5506" : "ES5505");
- m_c352->set_divider(version >= 0x171 && data_start >= 0xd7 && r8(0xd6) ? r8(0xd6) * 4 : 1);
+ m_vsu_vue[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xc8 ? r32(0xc4) & ~0x40000000 : 0);
+ m_vsu_vue[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xc8 && (r32(0xc4) & 0x40000000) ? r32(0xc4) & ~0x40000000 : 0);
+
+ m_saa1099[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xcc ? r32(0xc8) & ~0x40000000 : 0);
+ m_saa1099[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xcc && (r32(0xc8) & 0x40000000) ? r32(0xc8) & ~0x40000000 : 0);
+
+ m_es5503[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xd0 ? r32(0xcc) & ~0x40000000 : 0);
+ m_es5503[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xd0 && (r32(0xcc) & 0x40000000) ? r32(0xcc) & ~0x40000000 : 0);
+
+ m_es5505[0]->set_unscaled_clock(version >= 0x161 && header_size >= 0xd4 ? r32(0xd0) & ~0x40000000 : 0);
+ m_es5505[1]->set_unscaled_clock(version >= 0x161 && header_size >= 0xd4 && (r32(0xd0) & 0x40000000) ? r32(0xd0) & ~0x40000000 : 0);
+ if (version >= 0x171 && header_size >= 0xd4 && r32(0xd0) & 0x80000000)
+ logerror("Warning: file requests an unsupported ES5506\n");
- m_x1_010->set_unscaled_clock(version >= 0x171 && data_start >= 0xdc ? r32(0xd8) & ~0x40000000 : 0);
- if (version >= 0x171 && data_start >= 0xdc && (r32(0xd8) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd X1-010\n");
+ // TODO: dynamically remap es5503/es5505 channels?
+ //m_es5503[0]->set_channels(version >= 0x171 && header_size >= 0xd5 ? r8(0xd4) : 0);
+ //m_es5503[1]->set_channels(version >= 0x171 && header_size >= 0xd5 ? r8(0xd4) : 0);
+ //m_es5505[0]->set_channels(version >= 0x171 && header_size >= 0xd6 ? r8(0xd5) : 0);
+ //m_es5505[1]->set_channels(version >= 0x171 && header_size >= 0xd6 ? r8(0xd5) : 0);
- m_c352->set_unscaled_clock(version >= 0x171 && data_start >= 0xe0 ? r32(0xdc) & ~0x40000000 : 0);
- if (version >= 0x171 && data_start >= 0xe0 && (r32(0xdc) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd C352\n");
+ m_c352[0]->set_divider(version >= 0x171 && header_size >= 0xd7 && r8(0xd6) ? r8(0xd6) * 4 : 1);
+ m_c352[1]->set_divider(version >= 0x171 && header_size >= 0xd7 && r8(0xd6) ? r8(0xd6) * 4 : 1);
- m_ga20->set_unscaled_clock(version >= 0x171 && data_start >= 0xe4 ? r32(0xe0) & ~0x40000000 : 0);
- if (version >= 0x171 && data_start >= 0xe4 && (r32(0xe0) & 0x40000000))
- logerror("Warning: file requests an unsupported 2nd GA20\n");
+ m_x1_010[0]->set_unscaled_clock(version >= 0x171 && header_size >= 0xdc ? r32(0xd8) & ~0x40000000 : 0);
+ m_x1_010[1]->set_unscaled_clock(version >= 0x171 && header_size >= 0xdc && (r32(0xd8) & 0x40000000) ? r32(0xd8) & ~0x40000000 : 0);
+
+ m_c352[0]->set_unscaled_clock(version >= 0x171 && header_size >= 0xe0 ? r32(0xdc) & ~0x40000000 : 0);
+ m_c352[1]->set_unscaled_clock(version >= 0x171 && header_size >= 0xe0 && (r32(0xdc) & 0x40000000) ? r32(0xdc) & ~0x40000000 : 0);
+
+ m_ga20[0]->set_unscaled_clock(version >= 0x171 && header_size >= 0xe4 ? r32(0xe0) & ~0x40000000 : 0);
+ m_ga20[1]->set_unscaled_clock(version >= 0x171 && header_size >= 0xe4 && (r32(0xe0) & 0x40000000) ? r32(0xe0) & ~0x40000000 : 0);
+
+ for (device_t &child : subdevices())
+ if (child.clock() != 0)
+ logerror("%s %d\n", child.tag(), child.clock());
machine().schedule_soft_reset();
@@ -1876,7 +2398,7 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
READ8_MEMBER(vgmplay_state::file_r)
{
- if(offset < m_file_data.size())
+ if (offset < m_file_data.size())
return m_file_data[offset];
return 0;
}
@@ -1884,7 +2406,7 @@ READ8_MEMBER(vgmplay_state::file_r)
READ8_MEMBER(vgmplay_state::file_size_r)
{
uint32_t size = m_file_data.size();
- return size >> (8*offset);
+ return size >> (8 * offset);
}
template<int Chip>
@@ -1953,33 +2475,34 @@ WRITE8_MEMBER(vgmplay_device::okim6295_nmk112_bank_w)
}
}
+template<int Chip>
WRITE8_MEMBER(vgmplay_state::scc_w)
{
- switch(offset & 1)
+ switch (offset & 1)
{
case 0x00:
- m_scc_reg = data;
+ m_scc_reg[Chip] = data;
break;
case 0x01:
- switch(offset >> 1)
+ switch (offset >> 1)
{
case 0x00:
- m_k051649->k051649_waveform_w(space, m_scc_reg, data);
+ m_k051649[Chip]->k051649_waveform_w(space, m_scc_reg[Chip], data);
break;
case 0x01:
- m_k051649->k051649_frequency_w(space, m_scc_reg, data);
+ m_k051649[Chip]->k051649_frequency_w(space, m_scc_reg[Chip], data);
break;
case 0x02:
- m_k051649->k051649_volume_w(space, m_scc_reg, data);
+ m_k051649[Chip]->k051649_volume_w(space, m_scc_reg[Chip], data);
break;
case 0x03:
- m_k051649->k051649_keyonoff_w(space, m_scc_reg, data);
+ m_k051649[Chip]->k051649_keyonoff_w(space, m_scc_reg[Chip], data);
break;
case 0x04:
- m_k051649->k052539_waveform_w(space, m_scc_reg, data);
+ m_k051649[Chip]->k052539_waveform_w(space, m_scc_reg[Chip], data);
break;
case 0x05:
- m_k051649->k051649_test_w(space, m_scc_reg, data);
+ m_k051649[Chip]->k051649_test_w(space, m_scc_reg[Chip], data);
break;
}
break;
@@ -1994,21 +2517,21 @@ INPUT_CHANGED_MEMBER(vgmplay_state::key_pressed)
int val = (uint8_t)(uintptr_t)param;
switch (val)
{
- case VGMPLAY_STOP:
- m_vgmplay->stop();
- break;
- case VGMPLAY_PAUSE:
- m_vgmplay->pause();
- break;
- case VGMPLAY_PLAY:
- m_vgmplay->play();
- break;
- case VGMPLAY_RESTART:
- m_vgmplay->reset();
- break;
- case VGMPLAY_LOOP:
- m_vgmplay->toggle_loop();
- break;
+ case VGMPLAY_STOP:
+ m_vgmplay->stop();
+ break;
+ case VGMPLAY_PAUSE:
+ m_vgmplay->pause();
+ break;
+ case VGMPLAY_PLAY:
+ m_vgmplay->play();
+ break;
+ case VGMPLAY_RESTART:
+ m_vgmplay->reset();
+ break;
+ case VGMPLAY_LOOP:
+ m_vgmplay->toggle_loop();
+ break;
}
}
@@ -2026,27 +2549,23 @@ void vgmplay_state::file_map(address_map &map)
map(0x00000000, 0xffffffff).r(FUNC(vgmplay_state::file_r));
}
-void vgmplay_state::soundchips16_map(address_map &map)
-{
- map(vgmplay_device::A_C352, vgmplay_device::A_C352+0x7fff).w(m_c352, FUNC(c352_device::write));
-}
-
void vgmplay_state::soundchips_map(address_map &map)
{
map(vgmplay_device::REG_SIZE, vgmplay_device::REG_SIZE + 3).r(FUNC(vgmplay_state::file_size_r));
map(vgmplay_device::A_SN76496_0 + 0, vgmplay_device::A_SN76496_0 + 0).w(m_sn76496[0], FUNC(sn76496_device::command_w));
-// map(vgmplay_device::A_SN76496_0 + 1, vgmplay_device::A_SN76496_0 + 1).w(m_sn76496[0], FUNC(sn76496_device::stereo_w)); // TODO: GG stereo
+ //map(vgmplay_device::A_SN76496_0 + 1, vgmplay_device::A_SN76496_0 + 1).w(m_sn76496[0], FUNC(sn76496_device::stereo_w)); // TODO: GG stereo
map(vgmplay_device::A_SN76496_1 + 0, vgmplay_device::A_SN76496_1 + 0).w(m_sn76496[1], FUNC(sn76496_device::command_w));
-// map(vgmplay_device::A_SN76496_1 + 1, vgmplay_device::A_SN76496_1 + 1).w(m_sn76496[1], FUNC(sn76496_device::stereo_w)); // TODO: GG stereo
+ //map(vgmplay_device::A_SN76496_1 + 1, vgmplay_device::A_SN76496_1 + 1).w(m_sn76496[1], FUNC(sn76496_device::stereo_w)); // TODO: GG stereo
map(vgmplay_device::A_YM2413_0, vgmplay_device::A_YM2413_0 + 1).w(m_ym2413[0], FUNC(ym2413_device::write));
map(vgmplay_device::A_YM2413_1, vgmplay_device::A_YM2413_1 + 1).w(m_ym2413[1], FUNC(ym2413_device::write));
map(vgmplay_device::A_YM2612_0, vgmplay_device::A_YM2612_0 + 3).w(m_ym2612[0], FUNC(ym2612_device::write));
map(vgmplay_device::A_YM2612_1, vgmplay_device::A_YM2612_1 + 3).w(m_ym2612[1], FUNC(ym2612_device::write));
map(vgmplay_device::A_YM2151_0, vgmplay_device::A_YM2151_0 + 1).w(m_ym2151[0], FUNC(ym2151_device::write));
map(vgmplay_device::A_YM2151_1, vgmplay_device::A_YM2151_1 + 1).w(m_ym2151[1], FUNC(ym2151_device::write));
- map(vgmplay_device::A_SEGAPCM, vgmplay_device::A_SEGAPCM + 0x7ff).w(m_segapcm, FUNC(segapcm_device::sega_pcm_w));
+ map(vgmplay_device::A_SEGAPCM_0, vgmplay_device::A_SEGAPCM_0 + 0x7ff).w(m_segapcm[0], FUNC(segapcm_device::sega_pcm_w));
+ map(vgmplay_device::A_SEGAPCM_1, vgmplay_device::A_SEGAPCM_1 + 0x7ff).w(m_segapcm[1], FUNC(segapcm_device::sega_pcm_w));
map(vgmplay_device::A_RF5C68, vgmplay_device::A_RF5C68 + 0xf).w(m_rf5c68, FUNC(rf5c68_device::rf5c68_w));
- map(vgmplay_device::A_RF5C68RAM, vgmplay_device::A_RF5C68RAM + 0xffff).w(m_rf5c68, FUNC(rf5c68_device::rf5c68_mem_w));
+ map(vgmplay_device::A_RF5C68_RAM, vgmplay_device::A_RF5C68_RAM + 0xffff).w(m_rf5c68, FUNC(rf5c68_device::rf5c68_mem_w));
map(vgmplay_device::A_YM2203_0, vgmplay_device::A_YM2203_0 + 1).w(m_ym2203[0], FUNC(ym2203_device::write));
map(vgmplay_device::A_YM2203_1, vgmplay_device::A_YM2203_1 + 1).w(m_ym2203[1], FUNC(ym2203_device::write));
map(vgmplay_device::A_YM2608_0, vgmplay_device::A_YM2608_0 + 0x3).w(m_ym2608[0], FUNC(ym2608_device::write));
@@ -2067,44 +2586,78 @@ void vgmplay_state::soundchips_map(address_map &map)
map(vgmplay_device::A_YMF271_1, vgmplay_device::A_YMF271_1 + 0xf).w(m_ymf271[1], FUNC(ymf271_device::write));
map(vgmplay_device::A_YMZ280B_0, vgmplay_device::A_YMZ280B_0 + 0x1).w(m_ymz280b[0], FUNC(ymz280b_device::write));
map(vgmplay_device::A_YMZ280B_1, vgmplay_device::A_YMZ280B_1 + 0x1).w(m_ymz280b[1], FUNC(ymz280b_device::write));
- map(vgmplay_device::A_AY8910A, vgmplay_device::A_AY8910A).w("ay8910a", FUNC(ay8910_device::data_w));
- map(vgmplay_device::A_AY8910A+1, vgmplay_device::A_AY8910A+1).w("ay8910a", FUNC(ay8910_device::address_w));
- map(vgmplay_device::A_AY8910B, vgmplay_device::A_AY8910B).w("ay8910b", FUNC(ay8910_device::data_w));
- map(vgmplay_device::A_AY8910B+1, vgmplay_device::A_AY8910B+1).w("ay8910b", FUNC(ay8910_device::address_w));
- map(vgmplay_device::A_K053260, vgmplay_device::A_K053260+0x2f).w(m_k053260, FUNC(k053260_device::write));
- map(vgmplay_device::A_C6280, vgmplay_device::A_C6280+0xf).w(m_c6280, FUNC(c6280_device::c6280_w));
- map(vgmplay_device::A_OKIM6295A, vgmplay_device::A_OKIM6295A).w("okim6295a", FUNC(okim6295_device::write));
- map(vgmplay_device::A_OKIM6295A+0x8, vgmplay_device::A_OKIM6295A+0xb).w(FUNC(vgmplay_state::okim6295_clock_w<0>));
- map(vgmplay_device::A_OKIM6295A+0xc, vgmplay_device::A_OKIM6295A+0xc).w(FUNC(vgmplay_state::okim6295_pin7_w<0>));
- map(vgmplay_device::A_OKIM6295A+0xe, vgmplay_device::A_OKIM6295A+0xe).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_enable_w<0>));
- map(vgmplay_device::A_OKIM6295A+0xf, vgmplay_device::A_OKIM6295A+0xf).w("vgmplay", FUNC(vgmplay_device::okim6295_bank_w<0>));
- map(vgmplay_device::A_OKIM6295A+0x10, vgmplay_device::A_OKIM6295A+0x13).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_bank_w<0>));
- map(vgmplay_device::A_OKIM6295B, vgmplay_device::A_OKIM6295B).w("okim6295b", FUNC(okim6295_device::write));
- map(vgmplay_device::A_OKIM6295B+0x8, vgmplay_device::A_OKIM6295B+0xb).w(FUNC(vgmplay_state::okim6295_clock_w<1>));
- map(vgmplay_device::A_OKIM6295B+0xc, vgmplay_device::A_OKIM6295B+0xc).w(FUNC(vgmplay_state::okim6295_pin7_w<1>));
- map(vgmplay_device::A_OKIM6295B+0xe, vgmplay_device::A_OKIM6295B+0xe).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_enable_w<1>));
- map(vgmplay_device::A_OKIM6295B+0xf, vgmplay_device::A_OKIM6295B+0xf).w("vgmplay", FUNC(vgmplay_device::okim6295_bank_w<1>));
- map(vgmplay_device::A_OKIM6295B+0x10, vgmplay_device::A_OKIM6295B+0x13).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_bank_w<1>));
- map(vgmplay_device::A_GAMEBOY, vgmplay_device::A_GAMEBOY+0x16).w(m_dmg, FUNC(gameboy_sound_device::sound_w));
- map(vgmplay_device::A_GAMEBOY+0x20, vgmplay_device::A_GAMEBOY+0x2f).w(m_dmg, FUNC(gameboy_sound_device::wave_w));
- map(vgmplay_device::A_NESAPU, vgmplay_device::A_NESAPU+0x1f).w("nescpu:nesapu", FUNC(nesapu_device::write));
- map(vgmplay_device::A_NESRAM, vgmplay_device::A_NESRAM+0xffff).ram().share("nesapu_ram");
- map(vgmplay_device::A_MULTIPCMA, vgmplay_device::A_MULTIPCMA+3).w("multipcma", FUNC(multipcm_device::write));
- map(vgmplay_device::A_MULTIPCMA+4, vgmplay_device::A_MULTIPCMA+7).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_hi_w<0>));
- map(vgmplay_device::A_MULTIPCMA+8, vgmplay_device::A_MULTIPCMA+11).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_lo_w<0>));
- map(vgmplay_device::A_MULTIPCMB, vgmplay_device::A_MULTIPCMB+3).w("multipcmb", FUNC(multipcm_device::write));
- map(vgmplay_device::A_MULTIPCMB+4, vgmplay_device::A_MULTIPCMB+7).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_hi_w<1>));
- map(vgmplay_device::A_MULTIPCMB+8, vgmplay_device::A_MULTIPCMB+11).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_lo_w<1>));
- map(vgmplay_device::A_POKEYA, vgmplay_device::A_POKEYA+0xf).w("pokeya", FUNC(pokey_device::write));
- map(vgmplay_device::A_POKEYB, vgmplay_device::A_POKEYB+0xf).w("pokeyb", FUNC(pokey_device::write));
- map(vgmplay_device::A_K054539A, vgmplay_device::A_K054539A+0x22f).w("k054539a", FUNC(k054539_device::write));
- map(vgmplay_device::A_K054539B, vgmplay_device::A_K054539B+0x22f).w("k054539b", FUNC(k054539_device::write));
- map(vgmplay_device::A_QSOUND, vgmplay_device::A_QSOUND+0x2).w(m_qsound, FUNC(qsound_device::qsound_w));
- map(vgmplay_device::A_K051649, vgmplay_device::A_K051649+0xf).w(FUNC(vgmplay_state::scc_w));
- map(vgmplay_device::A_GA20, vgmplay_device::A_GA20+0x1f).w(m_ga20, FUNC(iremga20_device::irem_ga20_w));
- map(vgmplay_device::A_RF5C164, vgmplay_device::A_RF5C164+0xf).w(m_rf5c164, FUNC(rf5c68_device::rf5c68_w));
- map(vgmplay_device::A_RF5C164RAM, vgmplay_device::A_RF5C164RAM+0xffff).w(m_rf5c164, FUNC(rf5c68_device::rf5c68_mem_w));
- map(vgmplay_device::A_X1_010, vgmplay_device::A_X1_010+0x1fff).w(m_x1_010, FUNC(x1_010_device::write));
+ map(vgmplay_device::A_RF5C164, vgmplay_device::A_RF5C164 + 0xf).w(m_rf5c164, FUNC(rf5c68_device::rf5c68_w));
+ map(vgmplay_device::A_RF5C164_RAM, vgmplay_device::A_RF5C164_RAM + 0xffff).w(m_rf5c164, FUNC(rf5c68_device::rf5c68_mem_w));
+ map(vgmplay_device::A_AY8910_0, vgmplay_device::A_AY8910_0).w(m_ay8910[0], FUNC(ay8910_device::data_w));
+ map(vgmplay_device::A_AY8910_0 + 1, vgmplay_device::A_AY8910_0 + 1).w(m_ay8910[0], FUNC(ay8910_device::address_w));
+ map(vgmplay_device::A_AY8910_1, vgmplay_device::A_AY8910_1).w(m_ay8910[1], FUNC(ay8910_device::data_w));
+ map(vgmplay_device::A_AY8910_1 + 1, vgmplay_device::A_AY8910_1 + 1).w(m_ay8910[1], FUNC(ay8910_device::address_w));
+ map(vgmplay_device::A_GAMEBOY_0, vgmplay_device::A_GAMEBOY_0 + 0x16).w(m_dmg[0], FUNC(gameboy_sound_device::sound_w));
+ map(vgmplay_device::A_GAMEBOY_0 + 0x20, vgmplay_device::A_GAMEBOY_0 + 0x2f).w(m_dmg[0], FUNC(gameboy_sound_device::wave_w));
+ map(vgmplay_device::A_GAMEBOY_1, vgmplay_device::A_GAMEBOY_1 + 0x16).w(m_dmg[1], FUNC(gameboy_sound_device::sound_w));
+ map(vgmplay_device::A_GAMEBOY_1 + 0x20, vgmplay_device::A_GAMEBOY_1 + 0x2f).w(m_dmg[1], FUNC(gameboy_sound_device::wave_w));
+ map(vgmplay_device::A_NESAPU_0, vgmplay_device::A_NESAPU_0 + 0x1f).w("nescpu.0:nesapu", FUNC(nesapu_device::write));
+ map(vgmplay_device::A_NES_RAM_0, vgmplay_device::A_NES_RAM_0 + 0xffff).ram().share("nesapu_ram.0");
+ map(vgmplay_device::A_NESAPU_1, vgmplay_device::A_NESAPU_1 + 0x1f).w("nescpu.1:nesapu", FUNC(nesapu_device::write));
+ map(vgmplay_device::A_NES_RAM_1, vgmplay_device::A_NES_RAM_1 + 0xffff).ram().share("nesapu_ram.1");
+ map(vgmplay_device::A_MULTIPCM_0, vgmplay_device::A_MULTIPCM_0 + 3).w(m_multipcm[0], FUNC(multipcm_device::write));
+ map(vgmplay_device::A_MULTIPCM_0 + 4, vgmplay_device::A_MULTIPCM_0 + 7).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_hi_w<0>));
+ map(vgmplay_device::A_MULTIPCM_0 + 8, vgmplay_device::A_MULTIPCM_0 + 11).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_lo_w<0>));
+ map(vgmplay_device::A_MULTIPCM_1, vgmplay_device::A_MULTIPCM_1 + 3).w(m_multipcm[1], FUNC(multipcm_device::write));
+ map(vgmplay_device::A_MULTIPCM_1 + 4, vgmplay_device::A_MULTIPCM_1 + 7).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_hi_w<1>));
+ map(vgmplay_device::A_MULTIPCM_1 + 8, vgmplay_device::A_MULTIPCM_1 + 11).w("vgmplay", FUNC(vgmplay_device::multipcm_bank_lo_w<1>));
+ // TODO: upd7759
+ map(vgmplay_device::A_OKIM6258_0 + 0, vgmplay_device::A_OKIM6295_0 + 0).w(m_okim6258[0], FUNC(okim6258_device::ctrl_w));
+ map(vgmplay_device::A_OKIM6258_0 + 1, vgmplay_device::A_OKIM6295_0 + 1).w(m_okim6258[0], FUNC(okim6258_device::data_w));
+ map(vgmplay_device::A_OKIM6258_1 + 0, vgmplay_device::A_OKIM6295_1 + 0).w(m_okim6258[1], FUNC(okim6258_device::ctrl_w));
+ map(vgmplay_device::A_OKIM6258_1 + 1, vgmplay_device::A_OKIM6295_1 + 1).w(m_okim6258[1], FUNC(okim6258_device::data_w));
+ map(vgmplay_device::A_OKIM6295_0, vgmplay_device::A_OKIM6295_0).w(m_okim6295[0], FUNC(okim6295_device::write));
+ map(vgmplay_device::A_OKIM6295_0 + 0x8, vgmplay_device::A_OKIM6295_0 + 0xb).w(FUNC(vgmplay_state::okim6295_clock_w<0>));
+ map(vgmplay_device::A_OKIM6295_0 + 0xc, vgmplay_device::A_OKIM6295_0 + 0xc).w(FUNC(vgmplay_state::okim6295_pin7_w<0>));
+ map(vgmplay_device::A_OKIM6295_0 + 0xe, vgmplay_device::A_OKIM6295_0 + 0xe).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_enable_w<0>));
+ map(vgmplay_device::A_OKIM6295_0 + 0xf, vgmplay_device::A_OKIM6295_0 + 0xf).w("vgmplay", FUNC(vgmplay_device::okim6295_bank_w<0>));
+ map(vgmplay_device::A_OKIM6295_0 + 0x10, vgmplay_device::A_OKIM6295_0 + 0x13).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_bank_w<0>));
+ map(vgmplay_device::A_OKIM6295_1, vgmplay_device::A_OKIM6295_1).w(m_okim6295[1], FUNC(okim6295_device::write));
+ map(vgmplay_device::A_OKIM6295_1 + 0x8, vgmplay_device::A_OKIM6295_1 + 0xb).w(FUNC(vgmplay_state::okim6295_clock_w<1>));
+ map(vgmplay_device::A_OKIM6295_1 + 0xc, vgmplay_device::A_OKIM6295_1 + 0xc).w(FUNC(vgmplay_state::okim6295_pin7_w<1>));
+ map(vgmplay_device::A_OKIM6295_1 + 0xe, vgmplay_device::A_OKIM6295_1 + 0xe).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_enable_w<1>));
+ map(vgmplay_device::A_OKIM6295_1 + 0xf, vgmplay_device::A_OKIM6295_1 + 0xf).w("vgmplay", FUNC(vgmplay_device::okim6295_bank_w<1>));
+ map(vgmplay_device::A_OKIM6295_1 + 0x10, vgmplay_device::A_OKIM6295_1 + 0x13).w("vgmplay", FUNC(vgmplay_device::okim6295_nmk112_bank_w<1>));
+ map(vgmplay_device::A_K051649_0, vgmplay_device::A_K051649_0 + 0xf).w(FUNC(vgmplay_state::scc_w<0>));
+ map(vgmplay_device::A_K051649_1, vgmplay_device::A_K051649_1 + 0xf).w(FUNC(vgmplay_state::scc_w<1>));
+ map(vgmplay_device::A_K054539_0, vgmplay_device::A_K054539_0 + 0x22f).w(m_k054539[0], FUNC(k054539_device::write));
+ map(vgmplay_device::A_K054539_1, vgmplay_device::A_K054539_1 + 0x22f).w(m_k054539[1], FUNC(k054539_device::write));
+ map(vgmplay_device::A_C6280_0, vgmplay_device::A_C6280_0 + 0xf).w(m_c6280[0], FUNC(c6280_device::c6280_w));
+ map(vgmplay_device::A_C6280_1, vgmplay_device::A_C6280_1 + 0xf).w(m_c6280[1], FUNC(c6280_device::c6280_w));
+ // TODO: c140
+ map(vgmplay_device::A_K053260_0, vgmplay_device::A_K053260_0 + 0x2f).w(m_k053260[0], FUNC(k053260_device::write));
+ map(vgmplay_device::A_K053260_1, vgmplay_device::A_K053260_1 + 0x2f).w(m_k053260[1], FUNC(k053260_device::write));
+ map(vgmplay_device::A_POKEY_0, vgmplay_device::A_POKEY_0 + 0xf).w(m_pokey[0], FUNC(pokey_device::write));
+ map(vgmplay_device::A_POKEY_1, vgmplay_device::A_POKEY_1 + 0xf).w(m_pokey[1], FUNC(pokey_device::write));
+ map(vgmplay_device::A_QSOUND, vgmplay_device::A_QSOUND + 0x2).w(m_qsound, FUNC(qsound_device::qsound_w));
+ // TODO: scsp
+ map(vgmplay_device::A_WSWAN_0, vgmplay_device::A_WSWAN_0 + 0xff).w(m_wswan[0], FUNC(wswan_sound_device::port_w));
+ map(vgmplay_device::A_WSWAN_1, vgmplay_device::A_WSWAN_1 + 0xff).w(m_wswan[1], FUNC(wswan_sound_device::port_w));
+ map(vgmplay_device::A_VSU_VUE_0, vgmplay_device::A_VSU_VUE_0 + 0x5ff).w(m_vsu_vue[0], FUNC(vboysnd_device::write));
+ map(vgmplay_device::A_VSU_VUE_1, vgmplay_device::A_VSU_VUE_1 + 0x5ff).w(m_vsu_vue[1], FUNC(vboysnd_device::write));
+ map(vgmplay_device::A_SAA1099_0, vgmplay_device::A_SAA1099_0 + 1).w(m_saa1099[0], FUNC(saa1099_device::write));
+ map(vgmplay_device::A_SAA1099_1, vgmplay_device::A_SAA1099_1 + 1).w(m_saa1099[1], FUNC(saa1099_device::write));
+ map(vgmplay_device::A_ES5503_0, vgmplay_device::A_ES5503_0 + 0xe2).w(m_es5503[0], FUNC(es5503_device::write));
+ map(vgmplay_device::A_ES5503_RAM_0, vgmplay_device::A_ES5503_0 + 0x1ffff).ram().share("es5503_ram.0");
+ map(vgmplay_device::A_ES5503_1, vgmplay_device::A_ES5503_1 + 0xe2).w(m_es5503[1], FUNC(es5503_device::write));
+ map(vgmplay_device::A_ES5503_RAM_1, vgmplay_device::A_ES5503_1 + 0x1ffff).ram().share("es5503_ram.1");
+ // TODO: es5505
+ map(vgmplay_device::A_X1_010_0, vgmplay_device::A_X1_010_0 + 0x1fff).w(m_x1_010[0], FUNC(x1_010_device::write));
+ map(vgmplay_device::A_X1_010_1, vgmplay_device::A_X1_010_1 + 0x1fff).w(m_x1_010[1], FUNC(x1_010_device::write));
+ map(vgmplay_device::A_GA20_0, vgmplay_device::A_GA20_0 + 0x1f).w(m_ga20[0], FUNC(iremga20_device::irem_ga20_w));
+ map(vgmplay_device::A_GA20_1, vgmplay_device::A_GA20_1 + 0x1f).w(m_ga20[1], FUNC(iremga20_device::irem_ga20_w));
+}
+
+void vgmplay_state::soundchips16_map(address_map &map)
+{
+ map(vgmplay_device::A_C352_0, vgmplay_device::A_C352_0 + 0x7fff).w(m_c352[0], FUNC(c352_device::write));
+ map(vgmplay_device::A_C352_1, vgmplay_device::A_C352_1 + 0x7fff).w(m_c352[1], FUNC(c352_device::write));
+ map(vgmplay_device::A_32X_PWM, vgmplay_device::A_32X_PWM + 0xf).w(m_sega32x, FUNC(sega_32x_device::_32x_pwm_w));
}
template<int Chip>
@@ -2114,6 +2667,12 @@ void vgmplay_state::segapcm_map(address_map &map)
}
template<int Chip>
+void vgmplay_state::rf5c68_map(address_map &map)
+{
+ map(0, 0xffff).ram().share(Chip ? "rf5c68_ram.1" : "rf5c68_ram.0");
+}
+
+template<int Chip>
void vgmplay_state::ymf278b_map(address_map &map)
{
map(0, 0x3fffff).r("vgmplay", FUNC(vgmplay_device::ymf278b_rom_r<Chip>));
@@ -2132,15 +2691,15 @@ void vgmplay_state::ymz280b_map(address_map &map)
}
template<int Chip>
-void vgmplay_state::multipcm_map(address_map &map)
+void vgmplay_state::nescpu_map(address_map &map)
{
- map(0, 0x3fffff).r("vgmplay", FUNC(vgmplay_device::multipcm_rom_r<Chip>));
+ map(0, 0xffff).ram().share(Chip ? "nesapu_ram.1" : "nesapu_ram.0");
}
template<int Chip>
-void vgmplay_state::k053260_map(address_map &map)
+void vgmplay_state::multipcm_map(address_map &map)
{
- map(0, 0x1fffff).r("vgmplay", FUNC(vgmplay_device::k053260_rom_r<Chip>));
+ map(0, 0x3fffff).r("vgmplay", FUNC(vgmplay_device::multipcm_rom_r<Chip>));
}
template<int Chip>
@@ -2156,9 +2715,9 @@ void vgmplay_state::k054539_map(address_map &map)
}
template<int Chip>
-void vgmplay_state::c352_map(address_map &map)
+void vgmplay_state::k053260_map(address_map &map)
{
- map(0, 0xffffff).r("vgmplay", FUNC(vgmplay_device::c352_rom_r<Chip>));
+ map(0, 0x1fffff).r("vgmplay", FUNC(vgmplay_device::k053260_rom_r<Chip>));
}
template<int Chip>
@@ -2168,52 +2727,46 @@ void vgmplay_state::qsound_map(address_map &map)
}
template<int Chip>
-void vgmplay_state::ga20_map(address_map &map)
+void vgmplay_state::es5503_map(address_map &map)
{
- map(0, 0xfffff).r("vgmplay", FUNC(vgmplay_device::ga20_rom_r<Chip>));
+ map(0, 0x1ffff).ram().share(Chip ? "es5503_ram.1" : "es5503_ram.0");
}
template<int Chip>
-void vgmplay_state::x1_010_map(address_map &map)
+void vgmplay_state::es5505_map(address_map &map)
{
- map(0, 0xfffff).r("vgmplay", FUNC(vgmplay_device::x1_010_rom_r<Chip>));
+ map(0, 0xffffff).r("vgmplay", FUNC(vgmplay_device::es5505_rom_r<Chip>));
}
template<int Chip>
-void vgmplay_state::nescpu_map(address_map &map)
-{
- map(0, 0xffff).ram().share("nesapu_ram");
-}
-
-template<int Chip>
-void vgmplay_state::rf5c68_map(address_map &map)
+void vgmplay_state::x1_010_map(address_map &map)
{
- map(0, 0xffff).ram().share("rf5c68_ram");
+ map(0, 0xfffff).r("vgmplay", FUNC(vgmplay_device::x1_010_rom_r<Chip>));
}
template<int Chip>
-void vgmplay_state::rf5c164_map(address_map &map)
+void vgmplay_state::c352_map(address_map &map)
{
- map(0, 0xffff).ram().share("rf5c164_ram");
+ map(0, 0xffffff).r("vgmplay", FUNC(vgmplay_device::c352_rom_r<Chip>));
}
template<int Chip>
-void vgmplay_state::h6280_map(address_map &map)
+void vgmplay_state::ga20_map(address_map &map)
{
- map(0, 0xffff).noprw();
+ map(0, 0xfffff).r("vgmplay", FUNC(vgmplay_device::ga20_rom_r<Chip>));
}
template<int Chip>
-void vgmplay_state::h6280_io_map(address_map &map)
+void vgmplay_state::rf5c164_map(address_map &map)
{
- map(0, 3).noprw();
+ map(0, 0xffff).ram().share("rf5c164_ram");
}
MACHINE_CONFIG_START(vgmplay_state::vgmplay)
- MCFG_DEVICE_ADD("vgmplay", VGMPLAY, 44100)
- MCFG_DEVICE_PROGRAM_MAP( file_map )
- MCFG_DEVICE_IO_MAP( soundchips_map )
- MCFG_CPU_IO16_MAP( soundchips16_map )
+ VGMPLAY(config, m_vgmplay, 44100);
+ m_vgmplay->set_addrmap(AS_PROGRAM, &vgmplay_state::file_map);
+ m_vgmplay->set_addrmap(AS_IO, &vgmplay_state::soundchips_map);
+ m_vgmplay->set_addrmap(AS_IO16, &vgmplay_state::soundchips16_map);
MCFG_QUICKLOAD_ADD("quickload", vgmplay_state, load_file, "vgm,vgz", 0)
MCFG_QUICKLOAD_INTERFACE("vgm_quik")
@@ -2257,17 +2810,22 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_ym2151[1]->add_route(0, "lspeaker", 1);
m_ym2151[1]->add_route(1, "rspeaker", 1);
- MCFG_DEVICE_ADD("segapcm", SEGAPCM, 0)
- MCFG_SEGAPCM_BANK(BANK_512) // Should be configurable for yboard...
- MCFG_DEVICE_ADDRESS_MAP(0, segapcm_map<0>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
+ SEGAPCM(config, m_segapcm[0], 0);
+ m_segapcm[0]->set_addrmap(0, &vgmplay_state::segapcm_map<0>);
+ m_segapcm[0]->add_route(0, "lspeaker", 1);
+ m_segapcm[0]->add_route(1, "rspeaker", 1);
+
+ SEGAPCM(config, m_segapcm[1], 0);
+ m_segapcm[1]->set_addrmap(0, &vgmplay_state::segapcm_map<1>);
+ m_segapcm[1]->add_route(0, "lspeaker", 1);
+ m_segapcm[1]->add_route(1, "rspeaker", 1);
RF5C68(config, m_rf5c68, 0);
m_rf5c68->set_addrmap(0, &vgmplay_state::rf5c68_map<0>);
m_rf5c68->add_route(0, "lspeaker", 1);
m_rf5c68->add_route(1, "rspeaker", 1);
+ // TODO: prevent error.log spew
YM2203(config, m_ym2203[0], 0);
m_ym2203[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
m_ym2203[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
@@ -2276,6 +2834,7 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_ym2203[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
m_ym2203[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
+ // TODO: prevent error.log spew
YM2608(config, m_ym2608[0], 0);
m_ym2608[0]->add_route(ALL_OUTPUTS, "lspeaker", 1);
m_ym2608[0]->add_route(ALL_OUTPUTS, "rspeaker", 1);
@@ -2284,6 +2843,7 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_ym2608[1]->add_route(ALL_OUTPUTS, "lspeaker", 1);
m_ym2608[1]->add_route(ALL_OUTPUTS, "rspeaker", 1);
+ // TODO: prevent error.log spew
YM2610(config, m_ym2610[0], 0);
m_ym2610[0]->add_route(0, "lspeaker", 0.25);
m_ym2610[0]->add_route(0, "rspeaker", 0.25);
@@ -2328,6 +2888,7 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_ymf262[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.00);
m_ymf262[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.00);
+ // TODO: prevent error.log spew
YMF278B(config, m_ymf278b[0], 0);
m_ymf278b[0]->set_addrmap(0, &vgmplay_state::ymf278b_map<0>);
m_ymf278b[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
@@ -2348,6 +2909,7 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_ymf271[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
m_ymf271[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
+ // TODO: prevent error.log spew
YMZ280B(config, m_ymz280b[0], 0);
m_ymz280b[0]->set_addrmap(0, &vgmplay_state::ymz280b_map<0>);
m_ymz280b[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
@@ -2358,117 +2920,266 @@ MACHINE_CONFIG_START(vgmplay_state::vgmplay)
m_ymz280b[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
m_ymz280b[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
- MCFG_DEVICE_ADD("multipcma", MULTIPCM, 0)
- MCFG_DEVICE_ADDRESS_MAP(0, multipcm_map<0>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_DEVICE_ADD("multipcmb", MULTIPCM, 0)
- MCFG_DEVICE_ADDRESS_MAP(0, multipcm_map<1>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_DEVICE_ADD("dmg", DMG_APU, 0)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_DEVICE_ADD("ay8910a", AY8910, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33)
-
- MCFG_DEVICE_ADD("ay8910b", AY8910, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33)
-
- MCFG_DEVICE_ADD("nescpu", N2A03, 0)
- MCFG_DEVICE_PROGRAM_MAP(nescpu_map<0>)
- MCFG_DEVICE_DISABLE()
-
- MCFG_DEVICE_MODIFY("nescpu:nesapu")
- MCFG_SOUND_ROUTES_RESET()
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":rspeaker", 0.50)
-
- MCFG_DEVICE_ADD("h6280", H6280, 1000000)
- MCFG_DEVICE_PROGRAM_MAP(h6280_map<0>)
- MCFG_DEVICE_IO_MAP(h6280_io_map<0>)
- MCFG_DEVICE_DISABLE()
-
- MCFG_DEVICE_ADD("c6280", C6280, 0)
- MCFG_C6280_CPU("h6280")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_K053260_ADD("k053260", 0)
- MCFG_DEVICE_ADDRESS_MAP(0, k053260_map<0>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_DEVICE_ADD("pokeya", POKEY, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5)
-
- MCFG_DEVICE_ADD("pokeyb", POKEY, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5)
-
- MCFG_DEVICE_ADD("c352", C352, 0, 1)
- MCFG_DEVICE_ADDRESS_MAP(0, c352_map<0>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_DEVICE_ADD("okim6295a", OKIM6295, 0, okim6295_device::PIN7_HIGH)
- MCFG_DEVICE_ADDRESS_MAP(0, okim6295_map<0>)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25)
-
- MCFG_DEVICE_ADD("okim6295b", OKIM6295, 0, okim6295_device::PIN7_HIGH)
- MCFG_DEVICE_ADDRESS_MAP(0, okim6295_map<1>)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25)
-
- MCFG_DEVICE_ADD("k054539a", K054539, 0)
- MCFG_DEVICE_ADDRESS_MAP(0, k054539_map<0>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_DEVICE_ADD("k054539b", K054539, 0)
- MCFG_DEVICE_ADDRESS_MAP(0, k054539_map<0>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_DEVICE_ADD("qsound", QSOUND, 0)
- MCFG_DEVICE_ADDRESS_MAP(0, qsound_map<0>)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1)
-
- MCFG_K051649_ADD("k051649", 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33)
-
- IREMGA20(config, m_ga20, 0);
- m_ga20->set_addrmap(0, &vgmplay_state::ga20_map<0>);
- m_ga20->add_route(0, "lspeaker", 1);
- m_ga20->add_route(1, "rspeaker", 1);
-
- RF5C68(config, m_rf5c164, 0); // TODO : !!RF5C164!!
+ RF5C164(config, m_rf5c164, 0);
m_rf5c164->set_addrmap(0, &vgmplay_state::rf5c164_map<0>);
m_rf5c164->add_route(0, "lspeaker", 1);
m_rf5c164->add_route(1, "rspeaker", 1);
- X1_010(config, m_x1_010, 0);
- m_x1_010->set_addrmap(0, &vgmplay_state::x1_010_map<0>);
- m_x1_010->add_route(0, "lspeaker", 1);
- m_x1_010->add_route(1, "rspeaker", 1);
+ /// TODO: rewrite to generate audio without using DAC devices
+ SEGA_32X_NTSC(config, m_sega32x, 0, "sega32x_maincpu", "sega32x_scanline_timer");
+ m_sega32x->set_palette_tag("sega32x_palette");
+
+ auto& sega32x_maincpu(M68000(config, "sega32x_maincpu", 0));
+ sega32x_maincpu.set_disable();
+
+ TIMER(config, "sega32x_scanline_timer", 0);
+
+ PALETTE(config, "sega32x_palette", 0xc0 * 2);
+
+ dynamic_cast<cpu_device *>(config.device_find(m_sega32x, "32x_master_sh2"))->set_disable();
+ dynamic_cast<cpu_device *>(config.device_find(m_sega32x, "32x_slave_sh2"))->set_disable();
+
+ // TODO: prevent error.log spew
+ AY8910(config, m_ay8910[0], 0);
+ m_ay8910[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.33);
+ m_ay8910[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.33);
+
+ AY8910(config, m_ay8910[1], 0);
+ m_ay8910[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.33);
+ m_ay8910[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.33);
+
+ DMG_APU(config, m_dmg[0], 0);
+ m_dmg[0]->add_route(0, "lspeaker", 1);
+ m_dmg[0]->add_route(0, "rspeaker", 1);
+
+ DMG_APU(config, m_dmg[1], 0);
+ m_dmg[1]->add_route(0, "lspeaker", 1);
+ m_dmg[1]->add_route(0, "rspeaker", 1);
+
+ N2A03(config, m_nescpu[0], 0);
+ m_nescpu[0]->set_addrmap(AS_PROGRAM, &vgmplay_state::nescpu_map<0>);
+ m_nescpu[0]->set_disable();
+
+ auto *nesapu_0(dynamic_cast<device_sound_interface *>(config.device_find(m_nescpu[0], "nesapu")));
+ nesapu_0->reset_routes();
+ nesapu_0->add_route(ALL_OUTPUTS, ":lspeaker", 0.50);
+ nesapu_0->add_route(ALL_OUTPUTS, ":rspeaker", 0.50);
+
+ N2A03(config, m_nescpu[1], 0);
+ m_nescpu[1]->set_addrmap(AS_PROGRAM, &vgmplay_state::nescpu_map<1>);
+ m_nescpu[1]->set_disable();
+
+ auto *nesapu_1(dynamic_cast<device_sound_interface *>(config.device_find(m_nescpu[1], "nesapu")));
+ nesapu_1->reset_routes();
+ nesapu_1->add_route(ALL_OUTPUTS, ":lspeaker", 0.50);
+ nesapu_1->add_route(ALL_OUTPUTS, ":rspeaker", 0.50);
+
+ MULTIPCM(config, m_multipcm[0], 0);
+ m_multipcm[0]->set_addrmap(0, &vgmplay_state::multipcm_map<0>);
+ m_multipcm[0]->add_route(0, "lspeaker", 1);
+ m_multipcm[0]->add_route(1, "rspeaker", 1);
+
+ MULTIPCM(config, m_multipcm[1], 0);
+ m_multipcm[1]->set_addrmap(0, &vgmplay_state::multipcm_map<1>);
+ m_multipcm[1]->add_route(0, "lspeaker", 1);
+ m_multipcm[1]->add_route(1, "rspeaker", 1);
+
+ UPD7759(config, m_upd7759[0], 0);
+ m_upd7759[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ m_upd7759[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+
+ UPD7759(config, m_upd7759[1], 0);
+ m_upd7759[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
+ m_upd7759[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
+
+ OKIM6258(config, m_okim6258[0], 0);
+ m_okim6258[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_okim6258[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ OKIM6258(config, m_okim6258[1], 0);
+ m_okim6258[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_okim6258[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ OKIM6295(config, m_okim6295[0], 0, okim6295_device::PIN7_HIGH);
+ m_okim6295[0]->set_addrmap(0, &vgmplay_state::okim6295_map<0>);
+ m_okim6295[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
+ m_okim6295[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
+
+ OKIM6295(config, m_okim6295[1], 0, okim6295_device::PIN7_HIGH);
+ m_okim6295[1]->set_addrmap(0, &vgmplay_state::okim6295_map<1>);
+ m_okim6295[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.25);
+ m_okim6295[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.25);
+
+ K051649(config, m_k051649[0], 0);
+ m_k051649[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.33);
+ m_k051649[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.33);
+
+ K051649(config, m_k051649[1], 0);
+ m_k051649[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.33);
+ m_k051649[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.33);
+
+ K054539(config, m_k054539[0], 0);
+ m_k054539[0]->set_addrmap(0, &vgmplay_state::k054539_map<0>);
+ m_k054539[0]->add_route(0, "lspeaker", 1);
+ m_k054539[0]->add_route(1, "rspeaker", 1);
+
+ K054539(config, m_k054539[1], 0);
+ m_k054539[1]->set_addrmap(0, &vgmplay_state::k054539_map<1>);
+ m_k054539[1]->add_route(0, "lspeaker", 1);
+ m_k054539[1]->add_route(1, "rspeaker", 1);
+
+ // TODO: prevent error.log spew
+ H6280(config, m_h6280[0], 0);
+ m_h6280[0]->set_disable();
+
+ C6280(config, m_c6280[0], 0);
+ m_c6280[0]->set_devicecpu_tag("h6280.0");
+ m_c6280[0]->add_route(0, "lspeaker", 1);
+ m_c6280[0]->add_route(1, "rspeaker", 1);
+
+ H6280(config, m_h6280[1], 0);
+ m_h6280[1]->set_disable();
+
+ C6280(config, m_c6280[1], 0);
+ m_c6280[1]->set_devicecpu_tag("h6280.1");
+ m_c6280[1]->add_route(0, "lspeaker", 1);
+ m_c6280[1]->add_route(1, "rspeaker", 1);
+
+ C140(config, m_c140[0], 0);
+ m_c140[0]->add_route(0, "lspeaker", 0.50);
+ m_c140[0]->add_route(1, "rspeaker", 0.50);
+
+ C140(config, m_c140[1], 0);
+ m_c140[1]->add_route(0, "lspeaker", 0.50);
+ m_c140[1]->add_route(1, "rspeaker", 0.50);
+
+ K053260(config, m_k053260[0], 0);
+ m_k053260[0]->set_addrmap(0, &vgmplay_state::k053260_map<0>);
+ m_k053260[0]->add_route(0, "lspeaker", 1);
+ m_k053260[0]->add_route(1, "rspeaker", 1);
+
+ K053260(config, m_k053260[1], 0);
+ m_k053260[1]->set_addrmap(0, &vgmplay_state::k053260_map<1>);
+ m_k053260[1]->add_route(0, "lspeaker", 1);
+ m_k053260[1]->add_route(1, "rspeaker", 1);
+
+ POKEY(config, m_pokey[0], 0);
+ m_pokey[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_pokey[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ POKEY(config, m_pokey[1], 0);
+ m_pokey[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_pokey[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ QSOUND(config, m_qsound, 0);
+ m_qsound->set_addrmap(0, &vgmplay_state::qsound_map<0>);
+ m_qsound->add_route(0, "lspeaker", 1);
+ m_qsound->add_route(1, "rspeaker", 1);
+
+ SCSP(config, m_scsp[0], 0);
+ m_scsp[0]->add_route(0, "lspeaker", 1);
+ m_scsp[0]->add_route(1, "rspeaker", 1);
+
+ SCSP(config, m_scsp[1], 0);
+ m_scsp[1]->add_route(0, "lspeaker", 1);
+ m_scsp[1]->add_route(1, "rspeaker", 1);
+
+ // TODO: stop wonderswan using machine().sample_rate()
+ WSWAN_SND(config, m_wswan[0], 0);
+ m_wswan[0]->add_route(0, "lspeaker", 0.50);
+ m_wswan[0]->add_route(1, "rspeaker", 0.50);
+
+ WSWAN_SND(config, m_wswan[1], 0);
+ m_wswan[1]->add_route(0, "lspeaker", 0.50);
+ m_wswan[1]->add_route(1, "rspeaker", 0.50);
+
+ VBOYSND(config, m_vsu_vue[0], 0);
+ m_vsu_vue[0]->add_route(0, "lspeaker", 1.0);
+ m_vsu_vue[0]->add_route(1, "rspeaker", 1.0);
+
+ VBOYSND(config, m_vsu_vue[1], 0);
+ m_vsu_vue[1]->add_route(0, "lspeaker", 1.0);
+ m_vsu_vue[1]->add_route(1, "rspeaker", 1.0);
+
+ SAA1099(config, m_saa1099[0], 0);
+ m_saa1099[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_saa1099[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ SAA1099(config, m_saa1099[1], 0);
+ m_saa1099[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_saa1099[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ ES5503(config, m_es5503[0], 0);
+ m_es5503[0]->set_channels(2);
+ m_es5503[0]->set_addrmap(0, &vgmplay_state::es5503_map<0>);
+ m_es5503[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_es5503[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ ES5503(config, m_es5503[1], 0);
+ m_es5503[1]->set_channels(2);
+ m_es5503[1]->set_addrmap(0, &vgmplay_state::es5503_map<1>);
+ m_es5503[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_es5503[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ ES5505(config, m_es5505[0], 0);
+ // TODO m_es5505[0]->set_addrmap(0, &vgmplay_state::es5505_map<0>);
+ m_es5505[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_es5505[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ ES5505(config, m_es5505[1], 0);
+ // TODO m_es5505[1]->set_addrmap(0, &vgmplay_state::es5505_map<1>);
+ m_es5505[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_es5505[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+
+ X1_010(config, m_x1_010[0], 0);
+ m_x1_010[0]->set_addrmap(0, &vgmplay_state::x1_010_map<0>);
+ m_x1_010[0]->add_route(0, "lspeaker", 1);
+ m_x1_010[0]->add_route(1, "rspeaker", 1);
+
+ X1_010(config, m_x1_010[1], 0);
+ m_x1_010[1]->set_addrmap(0, &vgmplay_state::x1_010_map<1>);
+ m_x1_010[1]->add_route(0, "lspeaker", 1);
+ m_x1_010[1]->add_route(1, "rspeaker", 1);
+
+ C352(config, m_c352[0], 0, 1);
+ m_c352[0]->set_addrmap(0, &vgmplay_state::c352_map<0>);
+ m_c352[0]->add_route(0, "lspeaker", 1);
+ m_c352[0]->add_route(1, "rspeaker", 1);
+
+ C352(config, m_c352[1], 0, 1);
+ m_c352[1]->set_addrmap(0, &vgmplay_state::c352_map<1>);
+ m_c352[1]->add_route(0, "lspeaker", 1);
+ m_c352[1]->add_route(1, "rspeaker", 1);
+
+ IREMGA20(config, m_ga20[0], 0);
+ m_ga20[0]->set_addrmap(0, &vgmplay_state::ga20_map<0>);
+ m_ga20[0]->add_route(0, "lspeaker", 1);
+ m_ga20[0]->add_route(1, "rspeaker", 1);
+
+ IREMGA20(config, m_ga20[1], 0);
+ m_ga20[1]->set_addrmap(0, &vgmplay_state::ga20_map<1>);
+ m_ga20[1]->add_route(0, "lspeaker", 1);
+ m_ga20[1]->add_route(1, "rspeaker", 1);
MACHINE_CONFIG_END
ROM_START( vgmplay )
+ // TODO: change sound cores to device_rom_interface
ROM_REGION( 0x80000, "ym2608.0", ROMREGION_ERASE00 )
ROM_REGION( 0x80000, "ym2608.1", ROMREGION_ERASE00 )
ROM_REGION( 0x80000, "ym2610.0", ROMREGION_ERASE00 )
ROM_REGION( 0x80000, "ym2610.1", ROMREGION_ERASE00 )
ROM_REGION( 0x80000, "y8950.0", ROMREGION_ERASE00 )
ROM_REGION( 0x80000, "y8950.1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x80000, "upd7759.0", ROMREGION_ERASE00 )
+ ROM_REGION( 0x80000, "upd7759.1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x80000, "c140.0", ROMREGION_ERASE00 )
+ ROM_REGION( 0x80000, "c141.1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x80000, "scsp", ROMREGION_ERASE00 )
+ // TODO: split up 32x to remove dependencies
+ ROM_REGION( 0x4000, "master", ROMREGION_ERASE00 )
+ ROM_REGION( 0x4000, "slave", ROMREGION_ERASE00 )
+ ROM_REGION( 0x400000, "gamecart", ROMREGION_ERASE00 )
+ ROM_REGION( 0x400000, "gamecart_sh2", ROMREGION_ERASE00 )
ROM_END
CONS( 2016, vgmplay, 0, 0, vgmplay, vgmplay, vgmplay_state, empty_init, "MAME", "VGM player", MACHINE_CLICKABLE_ARTWORK )
diff --git a/src/mame/layout/vgmplay.lay b/src/mame/layout/vgmplay.lay
index ffeb7b2ee46..4b8831a61bc 100644
--- a/src/mame/layout/vgmplay.lay
+++ b/src/mame/layout/vgmplay.lay
@@ -2,37 +2,47 @@
<mamelayout version="2">
<!--
Activity LEDs:
- 0: AY-3-8910
- 1: SN76496
- 2: Oki M6295
+ 0: SN76496
+ 1: YM2413
+ 2: YM2612
3: YM2151
- 4: YM2203
- 5: YM2413
- 6: YM2608
- 7: YM2612
- 8: YM3526
+ 4: Sega PCM
+ 5: RF5C68
+ 6: YM2203
+ 7: YM2608
+ 8: YM2610
9: YM3812
- 10: YMF271
- 11: YMZ280B
- 12: YMW-258-F (MultiPCM)
- 13: Sega PCM
- 14: QSound
- 15: POKEY
- 16: NES APU
- 17: Game Boy APU
- 18: C352
- 19: HuC6280
- 20: K051649
- 21: K053260
- 22: K054539
- 23: GA20
- 24: RF5C68
- 25: RF5C164
- 26: X1-010
- 27: YM2610
- 28: Y8950
- 29: YMF262
- 30: YMF278B
+ 10: YM3526
+ 11: Y8950
+ 12: YMF262
+ 13: YMF278B
+ 14: YMF271
+ 15: YMZ280B
+ 16: RF5C164
+ 17: Sega 32X PWM
+ 18: AY-3-8910
+ 19: Game Boy APU
+ 20: NES APU
+ 21: YMW-258-F (MultiPCM)
+ 22: uPD7759
+ 23: Oki M6258
+ 24: Oki M6295
+ 25: K051649
+ 26: K054539
+ 27: HuC6280
+ 28: C-140
+ 29: K053260
+ 30: POKEY
+ 31: QSound
+ 32: SCSP
+ 33: WonderSwan
+ 34: VSU-VUE
+ 35: SAA1099
+ 36: ES5503
+ 37: ES5505
+ 38: X1-010
+ 39: C352
+ 40: GA20
-->
<element name="backdrop"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
@@ -42,37 +52,47 @@
<disk state="0"><color red="0.15" green="0.0" blue="0.0" /></disk>
</element>
- <element name="act_label_ay8910"><text string="AY-3-8910" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_sn76496"><text string="SN76496" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_okim6295"><text string="M6295" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_ym2413"><text string="YM2413" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_ym2612"><text string="YM2612" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_ym2151"><text string="YM2151" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_segapcm"><text string="Sega PCM" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_rf5c68"><text string="RF5C68" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_ym2203"><text string="YM2203" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_ym2413"><text string="YM2413" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_ym2608"><text string="YM2608" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_ym2612"><text string="YM2612" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_ym3526"><text string="YM3526" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_ym2610"><text string="YM2610" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_ym3812"><text string="YM3812" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_ym3526"><text string="YM3526" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_y8950"><text string="Y8950" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_ymf262"><text string="YMF262" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_ymf278b"><text string="YMF278B" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_ymf271"><text string="YMF271" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_ymz280b"><text string="YMZ280B" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_multipcm"><text string="YMW-258-F" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_segapcm"><text string="Sega PCM" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_qsound"><text string="QSound™" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_pokey"><text string="POKEY" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_nesapu"><text string="NES™ APU" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_rf5c164"><text string="RF5C164" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_pwm"><text string="32X PWM" align="1"><color red="0.5" green="0.5" blue="0.5" /></text></element>
+ <element name="act_label_ay8910"><text string="AY-3-8910" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_gameboy"><text string="Game Boy™" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_c352"><text string="C352" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_c6280"><text string="HuC6280" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_nesapu"><text string="NES™ APU" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_multipcm"><text string="YMW-258-F" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_upd7759"><text string="uPD7759" align="1"><color red="0.5" green="0.5" blue="0.5" /></text></element>
+ <element name="act_label_okim6258"><text string="M6258" align="1"><color red="0.5" green="0.5" blue="0.5" /></text></element>
+ <element name="act_label_okim6295"><text string="M6295" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_k051649"><text string="K051649" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_k053260"><text string="K053260" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="act_label_k054539"><text string="K054539" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_ga20"><text string="GA20" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_rf5c68"><text string="RF5C68" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_rf5c164"><text string="RF5C164" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_c6280"><text string="HuC6280" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_c140"><text string="C140" align="1"><color red="0.5" green="0.5" blue="0.5" /></text></element>
+ <element name="act_label_k053260"><text string="K053260" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_pokey"><text string="POKEY" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_qsound"><text string="QSound™" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_scsp"><text string="SCSP" align="1"><color red="0.5" green="0.5" blue="0.5" /></text></element>
+ <element name="act_label_wswan"><text string="WonderSwan" align="1"><color red="0.5" green="0.5" blue="0.5" /></text></element>
+ <element name="act_label_vsu_vue"><text string="VSU-VUE" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_saa1099"><text string="SAA1099" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_es5503"><text string="ES5503" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_es5505"><text string="ES5505" align="1"><color red="0.5" green="0.5" blue="0.5" /></text></element>
<element name="act_label_x1_010"><text string="X1-010" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_ym2610"><text string="YM2610" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_y8950"><text string="Y8950" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_ymf262"><text string="YMF262" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="act_label_ymf278b"><text string="YMF278B" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_c352"><text string="C352" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="act_label_ga20"><text string="GA20" align="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="static_black2"><rect><color red="0.2" green="0.21" blue="0.23" /></rect></element>
@@ -102,7 +122,7 @@
</element>
<group name="activity">
- <cpanel element="backdrop"><bounds x="0" y="0" width="60" height="25" /></cpanel>
+ <cpanel element="backdrop"><bounds x="0" y="0" width="60" height="34" /></cpanel>
<cpanel name="led_act_0" element="act_led"><bounds x="1" y="1" width="2" height="2" /></cpanel>
<cpanel name="led_act_1" element="act_led"><bounds x="1" y="4" width="2" height="2" /></cpanel>
@@ -112,67 +132,87 @@
<cpanel name="led_act_5" element="act_led"><bounds x="1" y="16" width="2" height="2" /></cpanel>
<cpanel name="led_act_6" element="act_led"><bounds x="1" y="19" width="2" height="2" /></cpanel>
<cpanel name="led_act_7" element="act_led"><bounds x="1" y="22" width="2" height="2" /></cpanel>
-
- <cpanel name="led_act_8" element="act_led"><bounds x="16" y="1" width="2" height="2" /></cpanel>
- <cpanel name="led_act_9" element="act_led"><bounds x="16" y="4" width="2" height="2" /></cpanel>
- <cpanel name="led_act_10" element="act_led"><bounds x="16" y="7" width="2" height="2" /></cpanel>
- <cpanel name="led_act_11" element="act_led"><bounds x="16" y="10" width="2" height="2" /></cpanel>
- <cpanel name="led_act_12" element="act_led"><bounds x="16" y="13" width="2" height="2" /></cpanel>
- <cpanel name="led_act_13" element="act_led"><bounds x="16" y="16" width="2" height="2" /></cpanel>
- <cpanel name="led_act_14" element="act_led"><bounds x="16" y="19" width="2" height="2" /></cpanel>
- <cpanel name="led_act_15" element="act_led"><bounds x="16" y="22" width="2" height="2" /></cpanel>
-
- <cpanel name="led_act_16" element="act_led"><bounds x="31" y="1" width="2" height="2" /></cpanel>
- <cpanel name="led_act_17" element="act_led"><bounds x="31" y="4" width="2" height="2" /></cpanel>
- <cpanel name="led_act_18" element="act_led"><bounds x="31" y="7" width="2" height="2" /></cpanel>
- <cpanel name="led_act_19" element="act_led"><bounds x="31" y="10" width="2" height="2" /></cpanel>
- <cpanel name="led_act_20" element="act_led"><bounds x="31" y="13" width="2" height="2" /></cpanel>
- <cpanel name="led_act_21" element="act_led"><bounds x="31" y="16" width="2" height="2" /></cpanel>
- <cpanel name="led_act_22" element="act_led"><bounds x="31" y="19" width="2" height="2" /></cpanel>
- <cpanel name="led_act_23" element="act_led"><bounds x="31" y="22" width="2" height="2" /></cpanel>
-
- <cpanel name="led_act_24" element="act_led"><bounds x="46" y="1" width="2" height="2" /></cpanel>
- <cpanel name="led_act_25" element="act_led"><bounds x="46" y="4" width="2" height="2" /></cpanel>
- <cpanel name="led_act_26" element="act_led"><bounds x="46" y="7" width="2" height="2" /></cpanel>
- <cpanel name="led_act_27" element="act_led"><bounds x="46" y="10" width="2" height="2" /></cpanel>
- <cpanel name="led_act_28" element="act_led"><bounds x="46" y="13" width="2" height="2" /></cpanel>
- <cpanel name="led_act_29" element="act_led"><bounds x="46" y="16" width="2" height="2" /></cpanel>
- <cpanel name="led_act_30" element="act_led"><bounds x="46" y="19" width="2" height="2" /></cpanel>
-
- <cpanel element="act_label_ay8910"><bounds x="4" y="1.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_sn76496"><bounds x="4" y="4.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_okim6295"><bounds x="4" y="7.2" width="10" height="1.6" /></cpanel>
+ <cpanel name="led_act_8" element="act_led"><bounds x="1" y="25" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_9" element="act_led"><bounds x="1" y="28" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_10" element="act_led"><bounds x="1" y="31" width="2" height="2" /></cpanel>
+
+ <cpanel name="led_act_11" element="act_led"><bounds x="16" y="1" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_12" element="act_led"><bounds x="16" y="4" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_13" element="act_led"><bounds x="16" y="7" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_14" element="act_led"><bounds x="16" y="10" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_15" element="act_led"><bounds x="16" y="13" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_16" element="act_led"><bounds x="16" y="16" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_17" element="act_led"><bounds x="16" y="19" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_18" element="act_led"><bounds x="16" y="22" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_19" element="act_led"><bounds x="16" y="25" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_20" element="act_led"><bounds x="16" y="28" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_21" element="act_led"><bounds x="16" y="31" width="2" height="2" /></cpanel>
+
+ <cpanel name="led_act_22" element="act_led"><bounds x="31" y="1" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_23" element="act_led"><bounds x="31" y="4" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_24" element="act_led"><bounds x="31" y="7" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_25" element="act_led"><bounds x="31" y="10" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_26" element="act_led"><bounds x="31" y="13" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_27" element="act_led"><bounds x="31" y="16" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_28" element="act_led"><bounds x="31" y="19" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_29" element="act_led"><bounds x="31" y="22" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_30" element="act_led"><bounds x="31" y="25" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_31" element="act_led"><bounds x="31" y="28" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_32" element="act_led"><bounds x="31" y="31" width="2" height="2" /></cpanel>
+
+ <cpanel name="led_act_33" element="act_led"><bounds x="46" y="1" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_34" element="act_led"><bounds x="46" y="4" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_35" element="act_led"><bounds x="46" y="7" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_36" element="act_led"><bounds x="46" y="10" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_37" element="act_led"><bounds x="46" y="13" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_38" element="act_led"><bounds x="46" y="16" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_39" element="act_led"><bounds x="46" y="19" width="2" height="2" /></cpanel>
+ <cpanel name="led_act_40" element="act_led"><bounds x="46" y="22" width="2" height="2" /></cpanel>
+
+ <cpanel element="act_label_sn76496"><bounds x="4" y="1.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ym2413"><bounds x="4" y="4.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ym2612"><bounds x="4" y="7.2" width="10" height="1.6" /></cpanel>
<cpanel element="act_label_ym2151"><bounds x="4" y="10.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ym2203"><bounds x="4" y="13.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ym2413"><bounds x="4" y="16.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ym2608"><bounds x="4" y="19.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ym2612"><bounds x="4" y="22.2" width="10" height="1.6" /></cpanel>
-
- <cpanel element="act_label_ym3526"><bounds x="19" y="1.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ym3812"><bounds x="19" y="4.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ymf271"><bounds x="19" y="7.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ymz280b"><bounds x="19" y="10.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_multipcm"><bounds x="19" y="13.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_segapcm"><bounds x="19" y="16.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_qsound"><bounds x="19" y="19.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_pokey"><bounds x="19" y="22.2" width="10" height="1.6" /></cpanel>
-
- <cpanel element="act_label_nesapu"><bounds x="34" y="1.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_gameboy"><bounds x="34" y="4.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_c352"><bounds x="34" y="7.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_c6280"><bounds x="34" y="10.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_k051649"><bounds x="34" y="13.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_k053260"><bounds x="34" y="16.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_k054539"><bounds x="34" y="19.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ga20"><bounds x="34" y="22.2" width="10" height="1.6" /></cpanel>
-
- <cpanel element="act_label_rf5c68"><bounds x="49" y="1.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_rf5c164"><bounds x="49" y="4.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_x1_010"><bounds x="49" y="7.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ym2610"><bounds x="49" y="10.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_y8950"><bounds x="49" y="13.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ymf262"><bounds x="49" y="16.2" width="10" height="1.6" /></cpanel>
- <cpanel element="act_label_ymf278b"><bounds x="49" y="19.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_segapcm"><bounds x="4" y="13.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_rf5c68"><bounds x="4" y="16.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ym2203"><bounds x="4" y="19.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ym2608"><bounds x="4" y="22.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ym2610"><bounds x="4" y="25.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ym3812"><bounds x="4" y="28.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ym3526"><bounds x="4" y="31.2" width="10" height="1.6" /></cpanel>
+
+ <cpanel element="act_label_y8950"><bounds x="19" y="1.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ymf262"><bounds x="19" y="4.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ymf278b"><bounds x="19" y="7.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ymf271"><bounds x="19" y="10.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ymz280b"><bounds x="19" y="13.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_rf5c164"><bounds x="19" y="16.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_pwm"><bounds x="19" y="19.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ay8910"><bounds x="19" y="22.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_gameboy"><bounds x="19" y="25.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_nesapu"><bounds x="19" y="28.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_multipcm"><bounds x="19" y="31.2" width="10" height="1.6" /></cpanel>
+
+ <cpanel element="act_label_upd7759"><bounds x="34" y="1.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_okim6258"><bounds x="34" y="4.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_okim6295"><bounds x="34" y="7.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_k051649"><bounds x="34" y="10.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_k054539"><bounds x="34" y="13.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_c6280"><bounds x="34" y="16.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_c140"><bounds x="34" y="19.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_k053260"><bounds x="34" y="22.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_pokey"><bounds x="34" y="25.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_qsound"><bounds x="34" y="28.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_scsp"><bounds x="34" y="31.2" width="10" height="1.6" /></cpanel>
+
+ <cpanel element="act_label_wswan"><bounds x="49" y="1.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_vsu_vue"><bounds x="49" y="4.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_saa1099"><bounds x="49" y="7.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_es5503"><bounds x="49" y="10.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_es5505"><bounds x="49" y="13.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_x1_010"><bounds x="49" y="16.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_c352"><bounds x="49" y="19.2" width="10" height="1.6" /></cpanel>
+ <cpanel element="act_label_ga20"><bounds x="49" y="22.2" width="10" height="1.6" /></cpanel>
</group>
<view name="Internal Layout">
@@ -196,6 +236,6 @@
<cpanel element="hl1" inputtag="CONTROLS" inputmask="0x0008"><bounds x="36" y="4" width="11" height="5" /><color alpha="0.15" /></cpanel>
<cpanel element="hl1" inputtag="CONTROLS" inputmask="0x0010"><bounds x="48" y="4" width="11" height="5" /><color alpha="0.15" /></cpanel>
- <group ref="activity"><bounds x="0" y="30" width="60" height="25" /></group>
+ <group ref="activity"><bounds x="0" y="21" width="60" height="34" /></group>
</view>
</mamelayout>
diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp
index 23d18de3ce4..2fd29141d75 100644
--- a/src/mame/machine/mega32x.cpp
+++ b/src/mame/machine/mega32x.cpp
@@ -211,7 +211,6 @@ GFX check (these don't explicitly fails):
#define MAX_HPOSITION 480
/* need to make some pwm stuff part of device */
#define PWM_FIFO_SIZE m_pwm_tm_reg // guess, Marsch calls this register as FIFO width
-#define PWM_CLOCK m_32x_pal ? ((MASTER_CLOCK_PAL*3) / 7) : ((MASTER_CLOCK_NTSC*3) / 7)
@@ -221,9 +220,6 @@ GFX check (these don't explicitly fails):
#define SH2_CINT_IRQ_LEVEL 8
#define SH2_PINT_IRQ_LEVEL 6
-#define MASTER_CLOCK_NTSC 53693175
-#define MASTER_CLOCK_PAL 53203424
-
DEFINE_DEVICE_TYPE(SEGA_32X_NTSC, sega_32x_ntsc_device, "sega_32x_ntsc", "Sega 32X (NTSC)")
DEFINE_DEVICE_TYPE(SEGA_32X_PAL, sega_32x_pal_device, "sega_32x_pal", "Sega 32X (PAL)")
@@ -824,7 +820,7 @@ void sega_32x_device::calculate_pwm_timer()
m_lch_fifo_state = m_rch_fifo_state = 0x4000;
m_lch_index_r = m_rch_index_r = 0;
m_lch_index_w = m_rch_index_w = 0;
- m_32x_pwm_timer->adjust(attotime::from_hz((PWM_CLOCK) / (m_pwm_cycle - 1)));
+ m_32x_pwm_timer->adjust(attotime::from_hz(clock() / (m_pwm_cycle - 1)));
}
}
@@ -870,7 +866,7 @@ TIMER_CALLBACK_MEMBER(sega_32x_device::handle_pwm_callback)
if(sh2_slave_pwmint_enable) { m_slave_cpu->set_input_line(SH2_PINT_IRQ_LEVEL,ASSERT_LINE); }
}
- m_32x_pwm_timer->adjust(attotime::from_hz((PWM_CLOCK) / (m_pwm_cycle - 1)));
+ m_32x_pwm_timer->adjust(attotime::from_hz(clock() / (m_pwm_cycle - 1)));
}
READ16_MEMBER( sega_32x_device::_32x_pwm_r )
@@ -1768,19 +1764,19 @@ const rom_entry *sega_32x_device::device_rom_region() const
MACHINE_CONFIG_START(sega_32x_ntsc_device::device_add_mconfig)
#ifndef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, (MASTER_CLOCK_NTSC*3)/7 )
+ MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
MCFG_SH2_IS_SLAVE(0)
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
#endif
- MCFG_DEVICE_ADD("32x_slave_sh2", SH2, (MASTER_CLOCK_NTSC*3)/7 )
+ MCFG_DEVICE_ADD("32x_slave_sh2", SH2, DERIVED_CLOCK(1, 1) )
MCFG_DEVICE_PROGRAM_MAP(sh2_slave_map)
MCFG_SH2_IS_SLAVE(1)
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
#ifdef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, (MASTER_CLOCK_NTSC*3)/7 )
+ MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
MCFG_SH2_IS_SLAVE(0)
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
@@ -1798,19 +1794,19 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(sega_32x_pal_device::device_add_mconfig)
#ifndef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, (MASTER_CLOCK_PAL*3)/7 )
+ MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
MCFG_SH2_IS_SLAVE(0)
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
#endif
- MCFG_DEVICE_ADD("32x_slave_sh2", SH2, (MASTER_CLOCK_PAL*3)/7 )
+ MCFG_DEVICE_ADD("32x_slave_sh2", SH2, DERIVED_CLOCK(1, 1) )
MCFG_DEVICE_PROGRAM_MAP(sh2_slave_map)
MCFG_SH2_IS_SLAVE(1)
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)
#ifdef _32X_SWAP_MASTER_SLAVE_HACK
- MCFG_DEVICE_ADD("32x_master_sh2", SH2, (MASTER_CLOCK_PAL*3)/7 )
+ MCFG_DEVICE_ADD("32x_master_sh2", SH2, DERIVED_CLOCK(1, 1) )
MCFG_DEVICE_PROGRAM_MAP(sh2_main_map)
MCFG_SH2_IS_SLAVE(0)
MCFG_SH2_FIFO_DATA_AVAIL_CB(sega_32x_device, _32x_fifo_available_callback)