summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/firebeat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/firebeat.cpp')
-rw-r--r--src/mame/drivers/firebeat.cpp172
1 files changed, 25 insertions, 147 deletions
diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp
index 47d80763f18..95a421d715a 100644
--- a/src/mame/drivers/firebeat.cpp
+++ b/src/mame/drivers/firebeat.cpp
@@ -181,32 +181,22 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_work_ram(*this, "work_ram"),
- m_flash_main(*this, "flash_main"),
- m_flash_snd1(*this, "flash_snd1"),
- m_flash_snd2(*this, "flash_snd2"),
m_duart_midi(*this, "duart_midi"),
m_duart_com(*this, "duart_com"),
- m_kbd0(*this, "kbd0"),
- m_kbd1(*this, "kbd1"),
+ m_kbd(*this, "kbd%u", 0),
m_ata(*this, "ata"),
- m_gcu0(*this, "gcu0"),
- m_gcu1(*this, "gcu1"),
+ m_gcu(*this, "gcu%u", 0),
m_spuata(*this, "spu_ata")
{ }
required_device<ppc4xx_device> m_maincpu;
optional_device<m68000_device> m_audiocpu;
required_shared_ptr<uint32_t> m_work_ram;
- required_device<fujitsu_29f016a_device> m_flash_main;
- required_device<fujitsu_29f016a_device> m_flash_snd1;
- required_device<fujitsu_29f016a_device> m_flash_snd2;
optional_device<pc16552_device> m_duart_midi;
required_device<pc16552_device> m_duart_com;
- optional_device<midi_keyboard_device> m_kbd0;
- optional_device<midi_keyboard_device> m_kbd1;
+ optional_device_array<midi_keyboard_device, 2> m_kbd;
required_device<ata_interface_device> m_ata;
- required_device<k057714_device> m_gcu0;
- required_device<k057714_device> m_gcu1;
+ optional_device_array<k057714_device, 2> m_gcu;
optional_device<ata_interface_device> m_spuata;
uint8_t m_extend_board_irq_enable;
@@ -223,7 +213,6 @@ public:
int m_ibutton_read_subkey_ptr;
uint8_t m_ibutton_subkey_data[0x40];
- DECLARE_READ8_MEMBER(soundram_r);
DECLARE_DRIVER_INIT(ppd);
DECLARE_DRIVER_INIT(kbm);
DECLARE_DRIVER_INIT(ppp);
@@ -235,10 +224,6 @@ public:
INTERRUPT_GEN_MEMBER(firebeat_interrupt);
DECLARE_READ32_MEMBER(input_r);
DECLARE_READ32_MEMBER(sensor_r );
- DECLARE_READ32_MEMBER(flashram_r);
- DECLARE_WRITE32_MEMBER(flashram_w);
- DECLARE_READ32_MEMBER(soundflash_r);
- DECLARE_WRITE32_MEMBER(soundflash_w);
DECLARE_WRITE_LINE_MEMBER(ata_interrupt);
DECLARE_READ32_MEMBER(ata_command_r);
DECLARE_WRITE32_MEMBER(ata_command_w);
@@ -286,7 +271,9 @@ public:
void firebeat(machine_config &config);
void firebeat_spu(machine_config &config);
void firebeat_map(address_map &map);
+ void firebeat2_map(address_map &map);
void spu_map(address_map &map);
+ void ymz280b_map(address_map &map);
};
@@ -298,8 +285,8 @@ VIDEO_START_MEMBER(firebeat_state,firebeat)
{
}
-uint32_t firebeat_state::screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu0->draw(screen, bitmap, cliprect); }
-uint32_t firebeat_state::screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu1->draw(screen, bitmap, cliprect); }
+uint32_t firebeat_state::screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu[0]->draw(screen, bitmap, cliprect); }
+uint32_t firebeat_state::screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu[1]->draw(screen, bitmap, cliprect); }
/*****************************************************************************/
@@ -335,114 +322,6 @@ READ32_MEMBER(firebeat_state::sensor_r )
}
}
-READ32_MEMBER(firebeat_state::flashram_r)
-{
- uint32_t r = 0;
- if (ACCESSING_BITS_24_31)
- {
- r |= (m_flash_main->read((offset*4)+0) & 0xff) << 24;
- }
- if (ACCESSING_BITS_16_23)
- {
- r |= (m_flash_main->read((offset*4)+1) & 0xff) << 16;
- }
- if (ACCESSING_BITS_8_15)
- {
- r |= (m_flash_main->read((offset*4)+2) & 0xff) << 8;
- }
- if (ACCESSING_BITS_0_7)
- {
- r |= (m_flash_main->read((offset*4)+3) & 0xff) << 0;
- }
- return r;
-}
-
-WRITE32_MEMBER(firebeat_state::flashram_w)
-{
- if (ACCESSING_BITS_24_31)
- {
- m_flash_main->write((offset*4)+0, (data >> 24) & 0xff);
- }
- if (ACCESSING_BITS_16_23)
- {
- m_flash_main->write((offset*4)+1, (data >> 16) & 0xff);
- }
- if (ACCESSING_BITS_8_15)
- {
- m_flash_main->write((offset*4)+2, (data >> 8) & 0xff);
- }
- if (ACCESSING_BITS_0_7)
- {
- m_flash_main->write((offset*4)+3, (data >> 0) & 0xff);
- }
-}
-
-READ32_MEMBER(firebeat_state::soundflash_r)
-{
- uint32_t r = 0;
- fujitsu_29f016a_device *chip;
- if (offset < 0x200000/4)
- {
- chip = m_flash_snd1;
- }
- else
- {
- chip = m_flash_snd2;
- }
-
- offset &= 0x7ffff;
-
- if (ACCESSING_BITS_24_31)
- {
- r |= (chip->read((offset*4)+0) & 0xff) << 24;
- }
- if (ACCESSING_BITS_16_23)
- {
- r |= (chip->read((offset*4)+1) & 0xff) << 16;
- }
- if (ACCESSING_BITS_8_15)
- {
- r |= (chip->read((offset*4)+2) & 0xff) << 8;
- }
- if (ACCESSING_BITS_0_7)
- {
- r |= (chip->read((offset*4)+3) & 0xff) << 0;
- }
- return r;
-}
-
-WRITE32_MEMBER(firebeat_state::soundflash_w)
-{
- fujitsu_29f016a_device *chip;
- if (offset < 0x200000/4)
- {
- chip = m_flash_snd1;
- }
- else
- {
- chip = m_flash_snd2;
- }
-
- offset &= 0x7ffff;
-
- if (ACCESSING_BITS_24_31)
- {
- chip->write((offset*4)+0, (data >> 24) & 0xff);
- }
- if (ACCESSING_BITS_16_23)
- {
- chip->write((offset*4)+1, (data >> 16) & 0xff);
- }
- if (ACCESSING_BITS_8_15)
- {
- chip->write((offset*4)+2, (data >> 8) & 0xff);
- }
- if (ACCESSING_BITS_0_7)
- {
- chip->write((offset*4)+3, (data >> 0) & 0xff);
- }
-}
-
/*****************************************************************************/
/* ATA Interface */
@@ -1065,18 +944,23 @@ ADDRESS_MAP_START(firebeat_state::firebeat_map)
AM_RANGE(0x7d000340, 0x7d000347) AM_READ(sensor_r)
AM_RANGE(0x7d000400, 0x7d000403) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0xffff0000)
AM_RANGE(0x7d000800, 0x7d000803) AM_READ(input_r)
- AM_RANGE(0x7d400000, 0x7d5fffff) AM_READWRITE(flashram_r, flashram_w)
- AM_RANGE(0x7d800000, 0x7dbfffff) AM_READWRITE(soundflash_r, soundflash_w)
+ AM_RANGE(0x7d400000, 0x7d5fffff) AM_DEVREADWRITE8("flash_main", fujitsu_29f016a_device, read, write, 0xffffffff)
+ AM_RANGE(0x7d800000, 0x7d9fffff) AM_DEVREADWRITE8("flash_snd1", fujitsu_29f016a_device, read, write, 0xffffffff)
+ AM_RANGE(0x7da00000, 0x7dbfffff) AM_DEVREADWRITE8("flash_snd2", fujitsu_29f016a_device, read, write, 0xffffffff)
AM_RANGE(0x7dc00000, 0x7dc0000f) AM_DEVREADWRITE8("duart_com", pc16552_device, read, write, 0xffffffff)
AM_RANGE(0x7e000000, 0x7e00003f) AM_DEVREADWRITE8("rtc", rtc65271_device, rtc_r, rtc_w, 0xffffffff)
AM_RANGE(0x7e000100, 0x7e00013f) AM_DEVREADWRITE8("rtc", rtc65271_device, xram_r, xram_w, 0xffffffff)
AM_RANGE(0x7e800000, 0x7e8000ff) AM_DEVREADWRITE("gcu0", k057714_device, read, write)
- AM_RANGE(0x7e800100, 0x7e8001ff) AM_DEVREADWRITE("gcu1", k057714_device, read, write)
AM_RANGE(0x7fe00000, 0x7fe0000f) AM_READWRITE(ata_command_r, ata_command_w)
AM_RANGE(0x7fe80000, 0x7fe8000f) AM_READWRITE(ata_control_r, ata_control_w)
AM_RANGE(0x7ff80000, 0x7fffffff) AM_ROM AM_REGION("user1", 0) /* System BIOS */
ADDRESS_MAP_END
+ADDRESS_MAP_START(firebeat_state::firebeat2_map)
+ AM_IMPORT_FROM(firebeat_map)
+ AM_RANGE(0x7e800100, 0x7e8001ff) AM_DEVREADWRITE("gcu1", k057714_device, read, write)
+ADDRESS_MAP_END
+
ADDRESS_MAP_START(firebeat_state::spu_map)
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x100000, 0x13ffff) AM_RAM
@@ -1092,16 +976,13 @@ ADDRESS_MAP_START(firebeat_state::spu_map)
AM_RANGE(0xfc0000, 0xffffff) AM_RAM // SDRAM
ADDRESS_MAP_END
-/*****************************************************************************/
+ADDRESS_MAP_START(firebeat_state::ymz280b_map)
+ ADDRESS_MAP_GLOBAL_MASK(0x3fffff)
+ AM_RANGE(0x000000, 0x1fffff) AM_DEVREAD("flash_snd1", fujitsu_29f016a_device, read)
+ AM_RANGE(0x200000, 0x3fffff) AM_DEVREAD("flash_snd2", fujitsu_29f016a_device, read)
+ADDRESS_MAP_END
-READ8_MEMBER(firebeat_state::soundram_r)
-{
- offset &= 0x3fffff;
- if (offset < 0x200000)
- return m_flash_snd1->read(offset);
- else
- return m_flash_snd2->read(offset & 0x1fffff);
-}
+/*****************************************************************************/
WRITE_LINE_MEMBER(firebeat_state::sound_irq_callback)
{
@@ -1314,9 +1195,6 @@ MACHINE_CONFIG_START(firebeat_state::firebeat)
MCFG_DEVICE_ADD("gcu0", K057714, 0)
MCFG_K057714_IRQ_CALLBACK(WRITELINE(firebeat_state, gcu0_interrupt))
- MCFG_DEVICE_ADD("gcu1", K057714, 0)
- MCFG_K057714_IRQ_CALLBACK(WRITELINE(firebeat_state, gcu1_interrupt))
-
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
@@ -1332,7 +1210,7 @@ MACHINE_CONFIG_START(firebeat_state::firebeat)
MCFG_SOUND_ADD("ymz", YMZ280B, 16934400)
MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(firebeat_state, sound_irq_callback))
- MCFG_YMZ280B_EXT_READ_HANDLER(READ8(firebeat_state, soundram_r))
+ MCFG_DEVICE_ADDRESS_MAP(0, ymz280b_map)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
@@ -1350,7 +1228,7 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2)
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", PPC403GCX, XTAL(64'000'000))
- MCFG_CPU_PROGRAM_MAP(firebeat_map)
+ MCFG_CPU_PROGRAM_MAP(firebeat2_map)
MCFG_CPU_VBLANK_INT_DRIVER("lscreen", firebeat_state, firebeat_interrupt)
MCFG_MACHINE_START_OVERRIDE(firebeat_state,firebeat)
@@ -1400,7 +1278,7 @@ MACHINE_CONFIG_START(firebeat_state::firebeat2)
MCFG_SOUND_ADD("ymz", YMZ280B, 16934400)
MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(firebeat_state, sound_irq_callback))
- MCFG_YMZ280B_EXT_READ_HANDLER(READ8(firebeat_state, soundram_r))
+ MCFG_DEVICE_ADDRESS_MAP(0, ymz280b_map)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)