summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/sound/rf5c68.cpp4
-rw-r--r--src/mame/drivers/segas32.cpp97
-rw-r--r--src/mame/includes/segas32.h71
-rw-r--r--src/mame/video/segas32.cpp21
4 files changed, 73 insertions, 120 deletions
diff --git a/src/devices/sound/rf5c68.cpp b/src/devices/sound/rf5c68.cpp
index 2567adfe004..9ec522b7d92 100644
--- a/src/devices/sound/rf5c68.cpp
+++ b/src/devices/sound/rf5c68.cpp
@@ -63,10 +63,6 @@ void rf5c68_device::device_start()
m_cache = space().cache<0, 0, ENDIANNESS_LITTLE>();
m_sample_end_cb.bind_relative_to(*owner());
- // needs to be initialized to 0xff, otherwise f1en has bad sound (MT04531)
- for (int i = 0; i < 0x10000; i++)
- m_data->write_byte(i, 0xff);
-
/* allocate the stream */
m_stream = stream_alloc(0, 2, clock() / 384);
diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp
index f47903b19b7..02c01df774b 100644
--- a/src/mame/drivers/segas32.cpp
+++ b/src/mame/drivers/segas32.cpp
@@ -558,16 +558,17 @@ orunners: Interleaved with the dj and << >> buttons is the data the drives the
DEFINE_DEVICE_TYPE(SEGA_S32_PCB, segas32_state, "segas32_pcb", "Sega System 32 PCB")
segas32_state::segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : segas32_state(mconfig, SEGA_S32_PCB, tag, owner, clock)
+ : segas32_state(mconfig, SEGA_S32_PCB, tag, owner, clock, false)
{
}
-segas32_state::segas32_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+segas32_state::segas32_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool is_multi32)
: device_t(mconfig, type, tag, owner, clock)
, m_z80_shared_ram(*this,"z80_shared_ram")
, m_system32_workram(*this,"workram")
, m_videoram(*this,"videoram", 0)
, m_spriteram(*this,"spriteram", 0)
+ , m_soundram(*this, "soundram")
, m_paletteram(*this,"paletteram.%u", 0, uint8_t(0))
, m_maincpu(*this, "maincpu")
, m_soundcpu(*this, "soundcpu")
@@ -583,6 +584,7 @@ segas32_state::segas32_state(const machine_config &mconfig, device_type type, co
, m_soundrom_bank(*this, "soundbank")
, m_multipcm_bank_hi(*this, "multipcmbankhi")
, m_multipcm_bank_lo(*this, "multipcmbanklo")
+ , m_is_multi32(is_multi32)
{
}
@@ -618,49 +620,24 @@ segas32_state::segas32_state(const machine_config &mconfig, device_type type, co
*
*************************************/
-void segas32_state::device_start()
-{
- common_start(0);
-}
-
-void segas32_trackball_state::device_start()
-{
- common_start(0);
-}
-
void segas32_v25_state::device_start()
{
- common_start(0);
+ segas32_4player_state::device_start();
decrypt_protrom();
}
-void segas32_upd7725_state::device_start()
-{
- common_start(0);
-}
-
void segas32_cd_state::device_start()
{
- common_start(0);
+ segas32_state::device_start();
m_lamps.resolve();
}
-void sega_multi32_state::device_start()
-{
- common_start(1);
-}
-
void sega_multi32_analog_state::device_start()
{
- common_start(1);
+ sega_multi32_state::device_start();
m_analog_bank = 0;
}
-void sega_multi32_6player_state::device_start()
-{
- common_start(1);
-}
-
void segas32_state::device_reset()
{
/* initialize the interrupt controller */
@@ -1242,7 +1219,7 @@ void segas32_state::system32_sound_portmap(address_map &map)
void segas32_state::rf5c68_map(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0xffff).ram();
+ map(0x0000, 0xffff).ram().share("soundram");
}
@@ -2371,7 +2348,7 @@ void segas32_state::device_add_mconfig(machine_config &config)
DEFINE_DEVICE_TYPE(SEGA_S32_REGULAR_DEVICE, segas32_regular_state, "segas32_pcb_regular", "Sega System 32 regular PCB")
segas32_regular_state::segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : segas32_state(mconfig, SEGA_S32_REGULAR_DEVICE, tag, owner, clock)
+ : segas32_state(mconfig, SEGA_S32_REGULAR_DEVICE, tag, owner, clock, false)
{
}
@@ -2407,7 +2384,7 @@ segas32_analog_state::segas32_analog_state(const machine_config &mconfig, const
}
segas32_analog_state::segas32_analog_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : segas32_state(mconfig, type, tag, owner, clock)
+ : segas32_state(mconfig, type, tag, owner, clock, false)
{
}
@@ -2449,7 +2426,7 @@ void segas32_trackball_state::device_add_mconfig(machine_config &config)
DEFINE_DEVICE_TYPE(SEGA_S32_TRACKBALL_DEVICE, segas32_trackball_state, "segas32_pcb_trackball", "Sega System 32 trackball PCB")
segas32_trackball_state::segas32_trackball_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : segas32_state(mconfig, SEGA_S32_TRACKBALL_DEVICE, tag, owner, clock)
+ : segas32_state(mconfig, SEGA_S32_TRACKBALL_DEVICE, tag, owner, clock, false)
{
}
@@ -2484,7 +2461,7 @@ segas32_4player_state::segas32_4player_state(const machine_config &mconfig, cons
}
segas32_4player_state::segas32_4player_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : segas32_state(mconfig, type, tag, owner, clock)
+ : segas32_state(mconfig, type, tag, owner, clock, false)
{
}
@@ -2614,7 +2591,7 @@ void segas32_cd_state::device_add_mconfig(machine_config &config)
DEFINE_DEVICE_TYPE(SEGA_S32_CD_DEVICE, segas32_cd_state, "segas32_pcb_cd", "Sega System 32 CD PCB")
segas32_cd_state::segas32_cd_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : segas32_state(mconfig, SEGA_S32_CD_DEVICE, tag, owner, clock)
+ : segas32_state(mconfig, SEGA_S32_CD_DEVICE, tag, owner, clock, false)
, m_lamps(*this, "lamp%u", 0U)
{
}
@@ -2705,7 +2682,7 @@ sega_multi32_state::sega_multi32_state(const machine_config &mconfig, const char
}
sega_multi32_state::sega_multi32_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : segas32_state(mconfig, type, tag, owner, clock)
+ : segas32_state(mconfig, type, tag, owner, clock, true)
{
}
@@ -5703,7 +5680,7 @@ void segas32_new_state::init_f1lapt()
m_mainpcb->init_f1lapt();
}
-void segas32_state::init_alien3(void)
+void segas32_state::init_alien3()
{
segas32_common_init();
m_sw1_output = &segas32_state::alien3_sw1_output;
@@ -5741,13 +5718,13 @@ void segas32_state::init_arescue(int m_hasdsp)
}
-void segas32_state::init_arabfgt(void)
+void segas32_state::init_arabfgt()
{
segas32_common_init();
}
-void segas32_state::init_brival(void)
+void segas32_state::init_brival()
{
segas32_common_init();
@@ -5758,7 +5735,7 @@ void segas32_state::init_brival(void)
}
-void segas32_state::init_darkedge(void)
+void segas32_state::init_darkedge()
{
segas32_common_init();
@@ -5768,7 +5745,7 @@ void segas32_state::init_darkedge(void)
}
-void segas32_state::init_dbzvrvs(void)
+void segas32_state::init_dbzvrvs()
{
segas32_common_init();
@@ -5778,7 +5755,7 @@ void segas32_state::init_dbzvrvs(void)
}
-void segas32_state::init_f1en(void)
+void segas32_state::init_f1en()
{
segas32_common_init();
@@ -5787,7 +5764,7 @@ void segas32_state::init_f1en(void)
}
-void segas32_state::init_f1lap(void)
+void segas32_state::init_f1lap()
{
segas32_common_init();
m_system32_prot_vblank = &segas32_state::f1lap_fd1149_vblank;
@@ -5798,7 +5775,7 @@ void segas32_state::init_f1lap(void)
}
-void segas32_state::init_f1lapt(void)
+void segas32_state::init_f1lapt()
{
segas32_common_init();
@@ -5808,13 +5785,13 @@ void segas32_state::init_f1lapt(void)
}
-void segas32_state::init_ga2(void)
+void segas32_state::init_ga2()
{
segas32_common_init();
}
-void segas32_state::init_harddunk(void)
+void segas32_state::init_harddunk()
{
segas32_common_init();
m_sw1_output = &segas32_state::harddunk_sw1_output;
@@ -5823,13 +5800,13 @@ void segas32_state::init_harddunk(void)
}
-void segas32_state::init_holo(void)
+void segas32_state::init_holo()
{
segas32_common_init();
}
-void segas32_state::init_jpark(void)
+void segas32_state::init_jpark()
{
/* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */
uint16_t *pROM = (uint16_t *)m_maincpu_region->base();
@@ -5843,7 +5820,7 @@ void segas32_state::init_jpark(void)
}
-void segas32_state::init_orunners(void)
+void segas32_state::init_orunners()
{
segas32_common_init();
m_sw1_output = &segas32_state::orunners_sw1_output;
@@ -5853,7 +5830,7 @@ void segas32_state::init_orunners(void)
}
-void segas32_state::init_radm(void)
+void segas32_state::init_radm()
{
segas32_common_init();
m_sw1_output = &segas32_state::radm_sw1_output;
@@ -5861,7 +5838,7 @@ void segas32_state::init_radm(void)
}
-void segas32_state::init_radr(void)
+void segas32_state::init_radr()
{
segas32_common_init();
m_sw1_output = &segas32_state::radm_sw1_output;
@@ -5871,7 +5848,7 @@ void segas32_state::init_radr(void)
}
-void segas32_state::init_scross(void)
+void segas32_state::init_scross()
{
segas32_common_init();
m_soundcpu->space(AS_PROGRAM).install_write_handler(0xb0, 0xbf, write8_delegate(FUNC(segas32_state::scross_bank_w),this));
@@ -5883,13 +5860,13 @@ void segas32_state::init_scross(void)
}
-void segas32_state::init_slipstrm(void)
+void segas32_state::init_slipstrm()
{
segas32_common_init();
}
-void segas32_state::init_sonic(void)
+void segas32_state::init_sonic()
{
segas32_common_init();
@@ -5898,32 +5875,32 @@ void segas32_state::init_sonic(void)
}
-void segas32_state::init_sonicp(void)
+void segas32_state::init_sonicp()
{
segas32_common_init();
}
-void segas32_state::init_spidman(void)
+void segas32_state::init_spidman()
{
segas32_common_init();
}
-void segas32_state::init_svf(void)
+void segas32_state::init_svf()
{
segas32_common_init();
}
-void segas32_state::init_jleague(void)
+void segas32_state::init_jleague()
{
segas32_common_init();
m_maincpu->space(AS_PROGRAM).install_write_handler(0x20F700, 0x20F705, write16_delegate(FUNC(segas32_state::jleague_protection_w),this));
}
-void segas32_state::init_titlef(void)
+void segas32_state::init_titlef()
{
segas32_common_init();
m_sw1_output = &segas32_state::titlef_sw1_output;
diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h
index a37e2f47414..ae4f90b1e68 100644
--- a/src/mame/includes/segas32.h
+++ b/src/mame/includes/segas32.h
@@ -25,30 +25,30 @@ class segas32_state : public device_t
public:
segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void init_alien3(void);
+ void init_alien3();
void init_arescue(int m_hasdsp);
- void init_arabfgt(void);
- void init_brival(void);
- void init_darkedge(void);
- void init_dbzvrvs(void);
- void init_f1en(void);
- void init_f1lap(void);
- void init_f1lapt(void);
- void init_ga2(void);
- void init_harddunk(void);
- void init_holo(void);
- void init_jpark(void);
- void init_orunners(void);
- void init_radm(void);
- void init_radr(void);
- void init_scross(void);
- void init_slipstrm(void);
- void init_sonic(void);
- void init_sonicp(void);
- void init_spidman(void);
- void init_svf(void);
- void init_jleague(void);
- void init_titlef(void);
+ void init_arabfgt();
+ void init_brival();
+ void init_darkedge();
+ void init_dbzvrvs();
+ void init_f1en();
+ void init_f1lap();
+ void init_f1lapt();
+ void init_ga2();
+ void init_harddunk();
+ void init_holo();
+ void init_jpark();
+ void init_orunners();
+ void init_radm();
+ void init_radr();
+ void init_scross();
+ void init_slipstrm();
+ void init_sonic();
+ void init_sonicp();
+ void init_spidman();
+ void init_svf();
+ void init_jleague();
+ void init_titlef();
cpu_device* maincpu() { return m_maincpu; }
@@ -68,7 +68,7 @@ public:
DECLARE_WRITE8_MEMBER(tilebank_external_w);
protected:
- segas32_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ segas32_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool is_multi32);
typedef void (segas32_state::*sys32_output_callback)(int which, uint16_t data);
@@ -135,7 +135,6 @@ protected:
TIMER_CALLBACK_MEMBER(end_of_vblank_int);
TIMER_CALLBACK_MEMBER(update_sprites);
- void common_start(int multi32);
void system32_set_vblank(int state);
inline uint16_t xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(uint16_t value);
inline uint16_t xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(uint16_t value);
@@ -211,6 +210,7 @@ protected:
optional_shared_ptr<uint16_t> m_system32_workram;
required_shared_ptr<uint16_t> m_videoram;
required_shared_ptr<uint16_t> m_spriteram;
+ required_shared_ptr<uint8_t> m_soundram;
optional_shared_ptr_array<uint16_t, 2> m_paletteram;
required_device<cpu_device> m_maincpu;
@@ -230,6 +230,8 @@ protected:
optional_memory_bank m_multipcm_bank_hi;
optional_memory_bank m_multipcm_bank_lo;
+ const bool m_is_multi32;
+
uint8_t m_v60_irq_control[0x10];
timer_device *m_v60_irq_timer[2];
uint8_t m_sound_irq_control[4];
@@ -243,7 +245,6 @@ protected:
uint16_t m_system32_displayenable[2];
uint16_t m_system32_tilebank_external;
uint16_t m_arescue_dsp_io[6];
- uint8_t m_is_multi32;
struct cache_entry *m_cache_head;
struct layer_info m_layer_data[11];
uint16_t m_mixer_control[2][0x40];
@@ -264,10 +265,6 @@ class segas32_regular_state : public segas32_state
{
public:
segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
-protected:
-// virtual void device_start() override;
-// virtual void device_reset() override;
};
class segas32_analog_state : public segas32_state
@@ -279,8 +276,6 @@ protected:
segas32_analog_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_add_mconfig(machine_config &config) override;
-// virtual void device_start() override;
-// virtual void device_reset() override;
};
class segas32_trackball_state : public segas32_state
@@ -291,7 +286,6 @@ public:
void system32_trackball_map(address_map &map);
protected:
virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
};
class segas32_4player_state : public segas32_state
@@ -303,8 +297,6 @@ protected:
segas32_4player_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_add_mconfig(machine_config &config) override;
-// virtual void device_start() override;
-// virtual void device_reset() override;
};
class segas32_v25_state : public segas32_4player_state
@@ -318,7 +310,6 @@ public:
protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
-// virtual void device_reset() override;
private:
void decrypt_protrom();
@@ -331,8 +322,6 @@ public:
protected:
virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
-// virtual void device_reset() override;
};
class segas32_cd_state : public segas32_state
@@ -349,7 +338,6 @@ public:
protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
-// virtual void device_reset() override;
private:
output_finder<16> m_lamps;
@@ -364,8 +352,6 @@ protected:
sega_multi32_state(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
-// virtual void device_reset() override;
};
class sega_multi32_analog_state : public sega_multi32_state
@@ -381,7 +367,6 @@ public:
protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
-// virtual void device_reset() override;
private:
optional_ioport_array<8> m_analog_ports;
@@ -395,8 +380,6 @@ public:
protected:
virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
-// virtual void device_reset() override;
};
DECLARE_DEVICE_TYPE(SEGA_S32_PCB, segas32_state)
diff --git a/src/mame/video/segas32.cpp b/src/mame/video/segas32.cpp
index 9df59a5677f..a95d43a14cf 100644
--- a/src/mame/video/segas32.cpp
+++ b/src/mame/video/segas32.cpp
@@ -200,25 +200,20 @@
*
*************************************/
-void segas32_state::common_start(int multi32)
+void segas32_state::device_start()
{
- if(!m_gfxdecode->started())
+ if (!m_gfxdecode->started())
throw device_missing_dependencies();
m_vblank_end_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(segas32_state::end_of_vblank_int), this));
m_update_sprites_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(segas32_state::update_sprites), this));
- int tmap;
-
- /* remember whether or not we are multi32 */
- m_is_multi32 = multi32;
-
/* allocate a copy of spriteram in 32-bit format */
m_spriteram_32bit = std::make_unique<uint32_t[]>(0x20000/4);
/* allocate the tilemap cache */
m_cache_head = nullptr;
- for (tmap = 0; tmap < TILEMAP_CACHE_SIZE; tmap++)
+ for (int tmap = 0; tmap < TILEMAP_CACHE_SIZE; tmap++)
{
struct cache_entry *entry = auto_alloc(machine(), struct cache_entry);
@@ -231,12 +226,11 @@ void segas32_state::common_start(int multi32)
m_cache_head = entry;
}
-
/* allocate the bitmaps (a few extra for multi32) */
- for (tmap = 0; tmap < 9 + 2 * multi32; tmap++)
+ for (int bmap = 0; bmap < 9 + (m_is_multi32 ? 2 : 0); bmap++)
{
- m_layer_data[tmap].bitmap = auto_alloc(machine(), bitmap_ind16(416, 224));
- m_layer_data[tmap].transparent = auto_alloc_array_clear(machine(), uint8_t, 256);
+ m_layer_data[bmap].bitmap = auto_alloc(machine(), bitmap_ind16(416, 224));
+ m_layer_data[bmap].transparent = auto_alloc_array_clear(machine(), uint8_t, 256);
}
/* allocate pre-rendered solid lines of 0's and ffff's */
@@ -249,6 +243,9 @@ void segas32_state::common_start(int multi32)
m_videoram[0x1ff00/2] = 0x8000;
memset(m_mixer_control, 0xff, sizeof(m_mixer_control[0][0]) * 0x80 );
+
+ /* needs to be initialized to 0xff, otherwise f1en has bad sound (MT04531) */
+ std::fill_n(&m_soundram[0], m_soundram.bytes() / sizeof(m_soundram[0]), 0xff);
}