summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-06-07 22:28:53 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-06-07 22:28:53 -0400
commitfa258b6aa9009334ffa4c0b1638bfa511ed84a6b (patch)
treeb9578eb28d174c48b6908e7121ba603e04d47d34
parent97303de7068709ac6cf54772c4d9fa08134ae7bf (diff)
saa1099: Create standard write handler; substitute for bogus YM2413 in magicard (nw)
-rw-r--r--src/devices/bus/isa/gblaster.cpp12
-rw-r--r--src/devices/bus/isa/sblaster.cpp12
-rw-r--r--src/devices/sound/saa1099.cpp8
-rw-r--r--src/devices/sound/saa1099.h2
-rw-r--r--src/mame/drivers/bingor.cpp3
-rw-r--r--src/mame/drivers/jpmsys5.cpp3
-rw-r--r--src/mame/drivers/magicard.cpp10
-rw-r--r--src/mame/drivers/manohman.cpp3
-rw-r--r--src/mame/drivers/mastboy.cpp3
-rw-r--r--src/mame/drivers/mpu4vid.cpp12
-rw-r--r--src/mame/drivers/xorworld.cpp3
11 files changed, 27 insertions, 44 deletions
diff --git a/src/devices/bus/isa/gblaster.cpp b/src/devices/bus/isa/gblaster.cpp
index af1e830ead5..0ee1da6f5cf 100644
--- a/src/devices/bus/isa/gblaster.cpp
+++ b/src/devices/bus/isa/gblaster.cpp
@@ -37,20 +37,12 @@ READ8_MEMBER( isa8_gblaster_device::saa1099_16_r )
WRITE8_MEMBER( isa8_gblaster_device::saa1099_1_16_w )
{
- switch(offset)
- {
- case 0 : m_saa1099_1->data_w( space, offset, data ); break;
- case 1 : m_saa1099_1->control_w( space, offset, data ); break;
- }
+ m_saa1099_1->write(space, offset, data);
}
WRITE8_MEMBER( isa8_gblaster_device::saa1099_2_16_w )
{
- switch(offset)
- {
- case 0 : m_saa1099_2->data_w( space, offset, data ); break;
- case 1 : m_saa1099_2->control_w( space, offset, data ); break;
- }
+ m_saa1099_2->write(space, offset, data);
}
READ8_MEMBER( isa8_gblaster_device::detect_r )
diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp
index 4554ef5c536..24a54405685 100644
--- a/src/devices/bus/isa/sblaster.cpp
+++ b/src/devices/bus/isa/sblaster.cpp
@@ -170,20 +170,12 @@ READ8_MEMBER( isa8_sblaster1_0_device::saa1099_16_r )
WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_1_16_w )
{
- switch(offset)
- {
- case 0 : m_saa1099_1->data_w( space, offset, data ); break;
- case 1 : m_saa1099_1->control_w( space, offset, data ); break;
- }
+ m_saa1099_1->write(space, offset, data);
}
WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_2_16_w )
{
- switch(offset)
- {
- case 0 : m_saa1099_2->data_w( space, offset, data ); break;
- case 1 : m_saa1099_2->control_w( space, offset, data ); break;
- }
+ m_saa1099_2->write(space, offset, data);
}
void sb_device::queue(uint8_t data)
diff --git a/src/devices/sound/saa1099.cpp b/src/devices/sound/saa1099.cpp
index 9f58367da5b..705fab69d29 100644
--- a/src/devices/sound/saa1099.cpp
+++ b/src/devices/sound/saa1099.cpp
@@ -445,3 +445,11 @@ WRITE8_MEMBER( saa1099_device::data_w )
logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n", machine().describe_context(), tag(), reg, data);
}
}
+
+WRITE8_MEMBER(saa1099_device::write)
+{
+ if (offset & 1)
+ control_w(space, 0, data);
+ else
+ data_w(space, 0, data);
+}
diff --git a/src/devices/sound/saa1099.h b/src/devices/sound/saa1099.h
index db89f8ccbd1..061f39ecc5f 100644
--- a/src/devices/sound/saa1099.h
+++ b/src/devices/sound/saa1099.h
@@ -35,6 +35,8 @@ public:
DECLARE_WRITE8_MEMBER( control_w );
DECLARE_WRITE8_MEMBER( data_w );
+ DECLARE_WRITE8_MEMBER( write );
+
protected:
// device-level overrides
virtual void device_start() override;
diff --git a/src/mame/drivers/bingor.cpp b/src/mame/drivers/bingor.cpp
index 40b7e9d1dc1..1f3ae749023 100644
--- a/src/mame/drivers/bingor.cpp
+++ b/src/mame/drivers/bingor.cpp
@@ -604,8 +604,7 @@ static ADDRESS_MAP_START( bingor2_map, AS_PROGRAM, 16, bingor_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( bingor_io, AS_IO, 16, bingor_state )
- AM_RANGE(0x0100, 0x0101) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x0102, 0x0103) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x0100, 0x0103) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/jpmsys5.cpp b/src/mame/drivers/jpmsys5.cpp
index 07186fe79f0..67105e2c9eb 100644
--- a/src/mame/drivers/jpmsys5.cpp
+++ b/src/mame/drivers/jpmsys5.cpp
@@ -302,8 +302,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( 68000_awp_map_saa, AS_PROGRAM, 16, jpmsys5_state )
JPM_SYS5_COMMON_MAP
- AM_RANGE(0x0460a0, 0x0460a1) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x0460a2, 0x0460a3) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x0460a0, 0x0460a3) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0x04c100, 0x04c105) AM_READWRITE(jpm_upd7759_r, jpm_upd7759_w) // do the SAA boards have the UPD?
ADDRESS_MAP_END
diff --git a/src/mame/drivers/magicard.cpp b/src/mame/drivers/magicard.cpp
index 1f481203b9d..fe201e8000e 100644
--- a/src/mame/drivers/magicard.cpp
+++ b/src/mame/drivers/magicard.cpp
@@ -150,8 +150,6 @@
- Inputs;
- - Unknown sound chip (it's an ADPCM with eight channels);
-
- Many unknown memory maps;
- Proper memory map and machine driver for magicardj & magicle.
@@ -162,7 +160,7 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
-#include "sound/ym2413.h"
+#include "sound/saa1099.h"
#include "video/ramdac.h"
#include "screen.h"
#include "speaker.h"
@@ -683,7 +681,7 @@ static ADDRESS_MAP_START( magicard_mem, AS_PROGRAM, 16, magicard_state )
AM_RANGE(0x001ffd02, 0x001ffd03) AM_MIRROR(0x7fe00000) AM_DEVWRITE8("ramdac", ramdac_device, pal_w, 0x00ff)
AM_RANGE(0x001ffd04, 0x001ffd05) AM_MIRROR(0x7fe00000) AM_DEVWRITE8("ramdac", ramdac_device, mask_w, 0x00ff)
/*not the right sound chip,unknown type,it should be an ADPCM with 8 channels.*/
- AM_RANGE(0x001ffd40, 0x001ffd43) AM_MIRROR(0x7fe00000) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
+ AM_RANGE(0x001ffd40, 0x001ffd43) AM_MIRROR(0x7fe00000) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_READ(test_r)
AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_WRITENOP //?
AM_RANGE(0x001fff80, 0x001fffbf) AM_MIRROR(0x7fe00000) AM_RAM //DRAM I/O, not accessed by this game, CD buffer?
@@ -698,7 +696,7 @@ static ADDRESS_MAP_START( hotslots_mem, AS_PROGRAM, 16, magicard_state )
AM_RANGE(0x001ffc00, 0x001ffc01) AM_MIRROR(0x7fe00000) AM_READ(test_r)
AM_RANGE(0x001ffc40, 0x001ffc41) AM_MIRROR(0x7fe00000) AM_READ(test_r)
/*not the right sound chip,unknown type,it should be an ADPCM with 8 channels.*/
- AM_RANGE(0x001ffd40, 0x001ffd43) AM_MIRROR(0x7fe00000) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
+ AM_RANGE(0x001ffd40, 0x001ffd43) AM_MIRROR(0x7fe00000) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_READ(test_r)
AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_WRITENOP //?
AM_RANGE(0x001fff80, 0x001fffbf) AM_MIRROR(0x7fe00000) AM_RAM //DRAM I/O, not accessed by this game, CD buffer?
@@ -767,7 +765,7 @@ static MACHINE_CONFIG_START( magicard )
MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette")
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("ymsnd", YM2413, CLOCK_A / 12)
+ MCFG_SOUND_ADD("saa", SAA1099, CLOCK_B)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/manohman.cpp b/src/mame/drivers/manohman.cpp
index e0e42b5c6ff..77bc4978f34 100644
--- a/src/mame/drivers/manohman.cpp
+++ b/src/mame/drivers/manohman.cpp
@@ -158,8 +158,7 @@ public:
static ADDRESS_MAP_START( manohman_map, AS_PROGRAM, 16, manohman_state )
AM_RANGE(0x000000, 0x01ffff) AM_ROM
AM_RANGE(0x100000, 0x100001) AM_NOP // smell to MAX696 watchdog...
- AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x300002, 0x300003) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x300000, 0x300003) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0x500000, 0x503fff) AM_RAM
AM_RANGE(0x600006, 0x600007) AM_RAM // write bitpatterns to compare with the 500000-503ff8 RAM testing.
// AM_RANGE(0xYYYYYY, 0xYYYYYY) AM_RAM
diff --git a/src/mame/drivers/mastboy.cpp b/src/mame/drivers/mastboy.cpp
index 9f7ffc4c21e..7a89157e465 100644
--- a/src/mame/drivers/mastboy.cpp
+++ b/src/mame/drivers/mastboy.cpp
@@ -731,8 +731,7 @@ static ADDRESS_MAP_START( mastboy_map, AS_PROGRAM, 8, mastboy_state )
AM_RANGE(0xff818, 0xff81f) AM_READ_PORT("DSW2")
AM_RANGE(0xff820, 0xff827) AM_WRITE(bank_w)
- AM_RANGE(0xff828, 0xff828) AM_DEVWRITE("saa", saa1099_device, data_w)
- AM_RANGE(0xff829, 0xff829) AM_DEVWRITE("saa", saa1099_device, control_w)
+ AM_RANGE(0xff828, 0xff829) AM_DEVWRITE("saa", saa1099_device, write)
AM_RANGE(0xff830, 0xff830) AM_WRITE(msm5205_data_w)
AM_RANGE(0xff838, 0xff838) AM_WRITE(irq0_ack_w)
AM_RANGE(0xff839, 0xff839) AM_WRITE(msm5205_sambit0_w)
diff --git a/src/mame/drivers/mpu4vid.cpp b/src/mame/drivers/mpu4vid.cpp
index 75e922554a0..e89923c6e79 100644
--- a/src/mame/drivers/mpu4vid.cpp
+++ b/src/mame/drivers/mpu4vid.cpp
@@ -1174,8 +1174,7 @@ static ADDRESS_MAP_START( mpu4_68k_map, AS_PROGRAM, 16, mpu4vid_state )
AM_RANGE(0x000000, 0x7fffff) AM_ROM
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("vid_mainram")
// AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */
- AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x900000, 0x900003) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE8("ef9369", ef9369_device, data_r, data_w, 0x00ff)
AM_RANGE(0xa00002, 0xa00003) AM_DEVWRITE8("ef9369", ef9369_device, address_w, 0x00ff)
/* AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */
@@ -1192,8 +1191,7 @@ static ADDRESS_MAP_START( mpu4oki_68k_map, AS_PROGRAM, 16, mpu4vid_state )
AM_RANGE(0x600000, 0x63ffff) AM_RAM /* The Mating Game has an extra 256kB RAM on the program card */
// AM_RANGE(0x640000, 0x7fffff) AM_NOP /* Possible bug, reads and writes here */
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("vid_mainram")
- AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x900000, 0x900003) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE8("ef9369", ef9369_device, data_r, data_w, 0x00ff)
AM_RANGE(0xa00002, 0xa00003) AM_DEVWRITE8("ef9369", ef9369_device, address_w, 0x00ff)
AM_RANGE(0xb00000, 0xb0000f) AM_DEVREADWRITE8("scn2674_vid", scn2674_device, read, write,0x00ff)
@@ -1212,8 +1210,7 @@ static ADDRESS_MAP_START( bwbvid_68k_map, AS_PROGRAM, 16, mpu4vid_state )
AM_RANGE(0x000000, 0x7fffff) AM_ROM
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("vid_mainram")
AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */
- AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x900000, 0x900003) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE8("ef9369", ef9369_device, data_r, data_w, 0x00ff)
AM_RANGE(0xa00002, 0xa00003) AM_DEVWRITE8("ef9369", ef9369_device, address_w, 0x00ff)
// AM_RANGE(0xa00000, 0xa0000f) AM_READWRITE(bt471_r,bt471_w) //Some games use this
@@ -1230,8 +1227,7 @@ static ADDRESS_MAP_START( bwbvid5_68k_map, AS_PROGRAM, 16, mpu4vid_state )
AM_RANGE(0x000000, 0x7fffff) AM_ROM
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("vid_mainram")
AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */
- AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x900000, 0x900003) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE8("ef9369", ef9369_device, data_r, data_w, 0x00ff)
AM_RANGE(0xa00002, 0xa00003) AM_DEVWRITE8("ef9369", ef9369_device, address_w, 0x00ff)
//AM_RANGE(0xa00000, 0xa00003) AM_READWRITE8(bt471_r,bt471_w,0x00ff) Some games use this
diff --git a/src/mame/drivers/xorworld.cpp b/src/mame/drivers/xorworld.cpp
index 9e436c2aaab..143c2499857 100644
--- a/src/mame/drivers/xorworld.cpp
+++ b/src/mame/drivers/xorworld.cpp
@@ -83,8 +83,7 @@ static ADDRESS_MAP_START( xorworld_map, AS_PROGRAM, 16, xorworld_state )
AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P1")
AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P2")
AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW")
- AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8("saa", saa1099_device, data_w, 0x00ff)
- AM_RANGE(0x800002, 0x800003) AM_DEVWRITE8("saa", saa1099_device, control_w, 0x00ff)
+ AM_RANGE(0x800000, 0x800003) AM_DEVWRITE8("saa", saa1099_device, write, 0x00ff)
AM_RANGE(0xa00008, 0xa00009) AM_WRITE(eeprom_chip_select_w)
AM_RANGE(0xa0000a, 0xa0000b) AM_WRITE(eeprom_serial_clock_w)
AM_RANGE(0xa0000c, 0xa0000d) AM_WRITE(eeprom_data_w)