mirror of
https://github.com/holub/mame
synced 2025-06-30 07:58:56 +03:00
converted coleco carts to use Curt's slot device (+ changed the
tag to avoid clash between the media switch and the slot device). nw.
This commit is contained in:
parent
6ce39d0260
commit
a4166cb413
@ -41,7 +41,7 @@
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define COLECOVISION_CARTRIDGE_SLOT_TAG "cart"
|
||||
#define COLECOVISION_CARTRIDGE_SLOT_TAG "cartslot"
|
||||
|
||||
|
||||
|
||||
|
@ -222,6 +222,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(coleco_state::paddle_update_callback)
|
||||
}
|
||||
}
|
||||
|
||||
READ8_MEMBER( coleco_state::cart_r )
|
||||
{
|
||||
return m_cart->bd_r(space, offset & 0x7fff, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void coleco_state::machine_start()
|
||||
{
|
||||
memset(m_ram, 0xff, m_ram.bytes()); // initialize RAM
|
||||
@ -238,6 +243,9 @@ void coleco_state::machine_start()
|
||||
m_joy_analog_state[port] = 0;
|
||||
}
|
||||
|
||||
if (m_cart->exists())
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xffff, read8_delegate(FUNC(coleco_state::cart_r),this));
|
||||
|
||||
save_item(NAME(m_joy_mode));
|
||||
save_item(NAME(m_last_nmi_state));
|
||||
save_item(NAME(m_joy_irq_state));
|
||||
@ -264,25 +272,6 @@ void coleco_state::machine_reset()
|
||||
// return retval;
|
||||
//}
|
||||
|
||||
DEVICE_IMAGE_LOAD_MEMBER( coleco_state,czz50_cart )
|
||||
{
|
||||
UINT8 *ptr = memregion("maincpu")->base() + 0x8000;
|
||||
UINT32 size;
|
||||
|
||||
if (image.software_entry() == NULL)
|
||||
{
|
||||
size = image.length();
|
||||
if (image.fread(ptr, size) != size)
|
||||
return IMAGE_INIT_FAIL;
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(ptr, image.get_software_region("rom"), image.get_software_region_length("rom"));
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Machine Drivers */
|
||||
|
||||
@ -306,10 +295,7 @@ static MACHINE_CONFIG_START( coleco, coleco_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
/* cartridge */
|
||||
MCFG_CARTSLOT_ADD("cart")
|
||||
MCFG_CARTSLOT_EXTENSION_LIST("rom,col,bin")
|
||||
MCFG_CARTSLOT_NOT_MANDATORY
|
||||
MCFG_CARTSLOT_INTERFACE("coleco_cart")
|
||||
MCFG_COLECOVISION_CARTRIDGE_SLOT_ADD(COLECOVISION_CARTRIDGE_SLOT_TAG, colecovision_cartridges, NULL)
|
||||
|
||||
/* software lists */
|
||||
MCFG_SOFTWARE_LIST_ADD("cart_list","coleco")
|
||||
@ -335,10 +321,6 @@ static MACHINE_CONFIG_DERIVED( czz50, coleco )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_MODIFY("maincpu") // note: cpu speed unverified, assume it's the same as ColecoVision
|
||||
MCFG_CPU_PROGRAM_MAP(czz50_map)
|
||||
|
||||
/* cartridge */
|
||||
MCFG_CARTSLOT_MODIFY("cart")
|
||||
MCFG_CARTSLOT_LOAD(coleco_state, czz50_cart)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( dina, czz50 )
|
||||
@ -364,7 +346,6 @@ ROM_START (coleco)
|
||||
ROM_SYSTEM_BIOS( 1, "thick", "Thick characters" )
|
||||
// differences to 0x3aa93ef3 modified characters, added a pad 2 related fix
|
||||
ROMX_LOAD( "colecoa.rom", 0x0000, 0x2000, CRC(39bb16fc) SHA1(99ba9be24ada3e86e5c17aeecb7a2d68c5edfe59), ROM_BIOS(2) )
|
||||
ROM_CART_LOAD("cart", 0x8000, 0x8000, ROM_NOMIRROR | ROM_OPTIONAL)
|
||||
ROM_END
|
||||
|
||||
/* PAL Colecovision BIOS
|
||||
@ -384,13 +365,11 @@ R72114A
|
||||
ROM_START (colecop)
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "r72114a_8317.u2", 0x0000, 0x2000, CRC(d393c0cc) SHA1(160077afb139943725c634d6539898db59f33657) )
|
||||
ROM_CART_LOAD("cart", 0x8000, 0x8000, ROM_NOMIRROR | ROM_OPTIONAL)
|
||||
ROM_END
|
||||
|
||||
ROM_START (svi603)
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "svi603.rom", 0x0000, 0x2000, CRC(19e91b82) SHA1(8a30abe5ffef810b0f99b86db38b1b3c9d259b78) )
|
||||
ROM_CART_LOAD("cart", 0x8000, 0x8000, ROM_NOMIRROR | ROM_OPTIONAL)
|
||||
ROM_END
|
||||
|
||||
ROM_START( czz50 )
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "sound/sn76496.h"
|
||||
#include "video/tms9928a.h"
|
||||
#include "machine/coleco.h"
|
||||
#include "imagedev/cartslot.h"
|
||||
#include "bus/coleco/exp.h"
|
||||
|
||||
class coleco_state : public driver_device
|
||||
{
|
||||
@ -17,15 +17,18 @@ public:
|
||||
coleco_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_cart(*this, COLECOVISION_CARTRIDGE_SLOT_TAG),
|
||||
m_ram(*this, "ram")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<colecovision_cartridge_slot_device> m_cart;
|
||||
required_shared_ptr<UINT8> m_ram;
|
||||
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
|
||||
DECLARE_READ8_MEMBER( cart_r );
|
||||
DECLARE_READ8_MEMBER( paddle_1_r );
|
||||
DECLARE_READ8_MEMBER( paddle_2_r );
|
||||
DECLARE_WRITE8_MEMBER( paddle_off_w );
|
||||
|
Loading…
Reference in New Issue
Block a user