mirror of
https://github.com/holub/mame
synced 2025-06-26 14:24:12 +03:00
vgmplay: Add the sn76496, no variant detection though (nw)
This commit is contained in:
parent
57767c08af
commit
1cbf71e5da
@ -13,6 +13,7 @@
|
|||||||
#include "sound/2612intf.h"
|
#include "sound/2612intf.h"
|
||||||
#include "sound/ym2151.h"
|
#include "sound/ym2151.h"
|
||||||
#include "sound/ym2413.h"
|
#include "sound/ym2413.h"
|
||||||
|
#include "sound/sn76496.h"
|
||||||
#include "sound/segapcm.h"
|
#include "sound/segapcm.h"
|
||||||
|
|
||||||
class vgmplay_device : public cpu_device
|
class vgmplay_device : public cpu_device
|
||||||
@ -23,6 +24,7 @@ public:
|
|||||||
A_YM2612 = 0x00000010,
|
A_YM2612 = 0x00000010,
|
||||||
A_YM2151 = 0x00000020,
|
A_YM2151 = 0x00000020,
|
||||||
A_YM2413 = 0x00000030,
|
A_YM2413 = 0x00000030,
|
||||||
|
A_SN76496 = 0x00000040,
|
||||||
A_SEGAPCM = 0x00001000,
|
A_SEGAPCM = 0x00001000,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,9 +98,10 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::vector<UINT8> m_file_data;
|
std::vector<UINT8> m_file_data;
|
||||||
required_device<bitbanger_device> m_file;
|
required_device<bitbanger_device> m_file;
|
||||||
required_device<ym2612_device> m_ym2612;
|
required_device<ym2612_device> m_ym2612;
|
||||||
required_device<ym2151_device> m_ym2151;
|
required_device<ym2151_device> m_ym2151;
|
||||||
required_device<ym2413_device> m_ym2413;
|
required_device<ym2413_device> m_ym2413;
|
||||||
|
required_device<sn76496_device> m_sn76496;
|
||||||
required_device<segapcm_device> m_segapcm;
|
required_device<segapcm_device> m_segapcm;
|
||||||
|
|
||||||
UINT32 r32(int offset) const;
|
UINT32 r32(int offset) const;
|
||||||
@ -216,12 +219,12 @@ void vgmplay_device::execute_run()
|
|||||||
UINT8 code = m_file->read_byte(m_pc);
|
UINT8 code = m_file->read_byte(m_pc);
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case 0x4f:
|
case 0x4f:
|
||||||
logerror("ignored psg 06\n");
|
m_io->write_byte(A_SN76496+0, m_file->read_byte(m_pc+1));
|
||||||
m_pc += 2;
|
m_pc += 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x50:
|
case 0x50:
|
||||||
logerror("ignored psg\n");
|
m_io->write_byte(A_SN76496+1, m_file->read_byte(m_pc+1));
|
||||||
m_pc += 2;
|
m_pc += 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -661,6 +664,7 @@ vgmplay_state::vgmplay_state(const machine_config &mconfig, device_type type, co
|
|||||||
m_ym2612(*this, "ym2612"),
|
m_ym2612(*this, "ym2612"),
|
||||||
m_ym2151(*this, "ym2151"),
|
m_ym2151(*this, "ym2151"),
|
||||||
m_ym2413(*this, "ym2413"),
|
m_ym2413(*this, "ym2413"),
|
||||||
|
m_sn76496(*this, "sn76496"),
|
||||||
m_segapcm(*this, "segapcm")
|
m_segapcm(*this, "segapcm")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -725,7 +729,7 @@ void vgmplay_state::machine_start()
|
|||||||
UINT32 version = r32(8);
|
UINT32 version = r32(8);
|
||||||
logerror("File version %x.%02x\n", version >> 8, version & 0xff);
|
logerror("File version %x.%02x\n", version >> 8, version & 0xff);
|
||||||
if(r32(0x0c))
|
if(r32(0x0c))
|
||||||
logerror("Warning: file requests an unsupported SN76489\n");
|
m_sn76496->set_unscaled_clock(r32(0x0c));
|
||||||
if(r32(0x10))
|
if(r32(0x10))
|
||||||
m_ym2413->set_unscaled_clock(r32(0x10));
|
m_ym2413->set_unscaled_clock(r32(0x10));
|
||||||
if(version <= 0x101 && r32(0x0c)) {
|
if(version <= 0x101 && r32(0x0c)) {
|
||||||
@ -790,11 +794,13 @@ static ADDRESS_MAP_START( file_map, AS_PROGRAM, 8, vgmplay_state )
|
|||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
static ADDRESS_MAP_START( soundchips_map, AS_IO, 8, vgmplay_state )
|
static ADDRESS_MAP_START( soundchips_map, AS_IO, 8, vgmplay_state )
|
||||||
AM_RANGE(vgmplay_device::REG_SIZE, vgmplay_device::REG_SIZE+3) AM_READ(file_size_r)
|
AM_RANGE(vgmplay_device::REG_SIZE, vgmplay_device::REG_SIZE+3) AM_READ(file_size_r)
|
||||||
AM_RANGE(vgmplay_device::A_YM2612, vgmplay_device::A_YM2612+3) AM_DEVREADWRITE("ym2612", ym2612_device, read, write)
|
AM_RANGE(vgmplay_device::A_YM2612, vgmplay_device::A_YM2612+3) AM_DEVREADWRITE("ym2612", ym2612_device, read, write)
|
||||||
AM_RANGE(vgmplay_device::A_YM2151, vgmplay_device::A_YM2151+1) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
|
AM_RANGE(vgmplay_device::A_YM2151, vgmplay_device::A_YM2151+1) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
|
||||||
AM_RANGE(vgmplay_device::A_YM2413, vgmplay_device::A_YM2413+1) AM_DEVWRITE ("ym2413", ym2413_device, write)
|
AM_RANGE(vgmplay_device::A_YM2413, vgmplay_device::A_YM2413+1) AM_DEVWRITE ("ym2413", ym2413_device, write)
|
||||||
AM_RANGE(vgmplay_device::A_SEGAPCM, vgmplay_device::A_SEGAPCM+0x7ff) AM_DEVREADWRITE("segapcm", segapcm_device, sega_pcm_r, sega_pcm_w)
|
// AM_RANGE(vgmplay_device::A_SN76496+0, vgmplay_device::A_SN76496+0) AM_DEVWRITE ("sn76496", sn76496_device, stereo_w)
|
||||||
|
AM_RANGE(vgmplay_device::A_SN76496+1, vgmplay_device::A_SN76496+1) AM_DEVWRITE ("sn76496", sn76496_device, write)
|
||||||
|
AM_RANGE(vgmplay_device::A_SEGAPCM, vgmplay_device::A_SEGAPCM+0x7ff) AM_DEVREADWRITE("segapcm", segapcm_device, sega_pcm_r, sega_pcm_w)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
static ADDRESS_MAP_START( segapcm_map, AS_0, 8, vgmplay_state )
|
static ADDRESS_MAP_START( segapcm_map, AS_0, 8, vgmplay_state )
|
||||||
@ -822,6 +828,10 @@ static MACHINE_CONFIG_START( vgmplay, vgmplay_state )
|
|||||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1)
|
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1)
|
||||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1)
|
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1)
|
||||||
|
|
||||||
|
MCFG_SOUND_ADD("sn76496", SN76496, 3579545)
|
||||||
|
MCFG_SOUND_ROUTE(0, "lspeaker", 1)
|
||||||
|
MCFG_SOUND_ROUTE(0, "rspeaker", 1)
|
||||||
|
|
||||||
MCFG_SOUND_ADD("segapcm", SEGAPCM, 4000000)
|
MCFG_SOUND_ADD("segapcm", SEGAPCM, 4000000)
|
||||||
MCFG_SEGAPCM_BANK(BANK_512) // Should be configurable for yboard...
|
MCFG_SEGAPCM_BANK(BANK_512) // Should be configurable for yboard...
|
||||||
MCFG_DEVICE_ADDRESS_MAP(AS_0, segapcm_map)
|
MCFG_DEVICE_ADDRESS_MAP(AS_0, segapcm_map)
|
||||||
|
Loading…
Reference in New Issue
Block a user