Previous 199869 Revisions Next

r33050 Wednesday 29th October, 2014 at 06:13:14 UTC by Fabio Priuli
(MESS) astrocde: installing expansion handlers only if a slot card is
present avoids the appearance of gfx garbage at start. garbage
disappeared when pressing reset, but it is better in this way, of course.
nw.
[src/emu/bus/astrocde]exp.c exp.h
[src/mess/drivers]astrocde.c

trunk/src/emu/bus/astrocde/exp.c
r241561r241562
3737//-------------------------------------------------
3838astrocade_exp_device::astrocade_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
3939                  device_t(mconfig, ASTROCADE_EXP_SLOT, "Bally Astrocade expansion", tag, owner, clock, "astrocde_exp", __FILE__),
40                  device_slot_interface(mconfig, *this)
40                  device_slot_interface(mconfig, *this),
41                  m_card_mounted(false)
4142{
4243}
4344
r241561r241562
5758void astrocade_exp_device::device_start()
5859{
5960   m_card = dynamic_cast<device_astrocade_card_interface *>(get_card_device());
61   if (m_card)
62      m_card_mounted = true;
6063}
6164
6265/*-------------------------------------------------
trunk/src/emu/bus/astrocde/exp.h
r241561r241562
1313   virtual ~device_astrocade_card_interface();
1414
1515   // reading and writing
16   virtual DECLARE_READ8_MEMBER(read) { return 0; }
16   virtual DECLARE_READ8_MEMBER(read) { return 0xff; }
1717   virtual DECLARE_WRITE8_MEMBER(write) {}
1818
1919protected:
r241561r241562
3333   // device-level overrides
3434   virtual void device_start();
3535
36   bool get_card_mounted() { return m_card_mounted; }
37   
3638   // reading and writing
3739   virtual DECLARE_READ8_MEMBER(read);
3840   virtual DECLARE_WRITE8_MEMBER(write);
3941
4042protected:
41
43   bool m_card_mounted;
4244   device_astrocade_card_interface* m_card;
4345};
4446
trunk/src/mess/drivers/astrocde.c
r241561r241562
2222public:
2323   astrocde_mess_state(const machine_config &mconfig, device_type type, const char *tag)
2424      : astrocde_state(mconfig, type, tag),
25      m_cart(*this, "cartslot")
25      m_cart(*this, "cartslot"),
26      m_exp(*this, "exp")
2627      { }
2728
2829   required_device<astrocade_cart_slot_device> m_cart;
30   required_device<astrocade_exp_device> m_exp;
2931   DECLARE_MACHINE_START(astrocde);
3032};
3133
r241561r241562
4749   AM_RANGE(0x0000, 0x0fff) AM_ROM AM_WRITE(astrocade_funcgen_w)
4850   AM_RANGE(0x1000, 0x3fff) AM_ROM /* Star Fortress writes in here?? */
4951   AM_RANGE(0x4000, 0x4fff) AM_RAM AM_SHARE("videoram") /* ASG */
50   AM_RANGE(0x5000, 0xffff) AM_DEVREADWRITE("exp", astrocade_exp_device, read, write)
52   //AM_RANGE(0x5000, 0xffff) AM_DEVREADWRITE("exp", astrocade_exp_device, read, write)
5153ADDRESS_MAP_END
5254
5355
r241561r241562
252254{
253255   if (m_cart->exists())
254256      m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x3fff, read8_delegate(FUNC(astrocade_cart_slot_device::read_rom),(astrocade_cart_slot_device*)m_cart));
257
258   // if no RAM is mounted and the handlers are installed, the system starts with garbage on screen and a RESET is necessary
259   // thus, install RAM only if an expansion is mounted
260   if (m_exp->get_card_mounted())
261      m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x5000, 0xffff, read8_delegate(FUNC(astrocade_exp_device::read),(astrocade_exp_device*)m_exp), write8_delegate(FUNC(astrocade_exp_device::write),(astrocade_exp_device*)m_exp));
255262}
256263
257264/*************************************


Previous 199869 Revisions Next


© 1997-2024 The MAME Team