Getting rid of DEVICE_IMAGE_START (nw)

This commit is contained in:
Wilbert Pol 2013-02-06 20:32:33 +00:00
parent 2f1f05e3e6
commit 871d4c7ac6
33 changed files with 146 additions and 225 deletions

View File

@ -111,7 +111,6 @@ struct software_part;
struct software_info; struct software_info;
// device image interface function types // device image interface function types
typedef delegate<void ()> device_image_start_delegate;
typedef delegate<int (device_image_interface &)> device_image_load_delegate; typedef delegate<int (device_image_interface &)> device_image_load_delegate;
typedef delegate<void (device_image_interface &)> device_image_func_delegate; typedef delegate<void (device_image_interface &)> device_image_func_delegate;
// legacy // legacy
@ -137,12 +136,6 @@ typedef void (*device_image_display_info_func)(device_image_interface &image);
#define DEVICE_IMAGE_DISPLAY_INFO(name) void DEVICE_IMAGE_DISPLAY_INFO_NAME(name)(device_image_interface &image) #define DEVICE_IMAGE_DISPLAY_INFO(name) void DEVICE_IMAGE_DISPLAY_INFO_NAME(name)(device_image_interface &image)
#define DEVICE_IMAGE_START_MEMBER_NAME(_name) device_image_start_##_name
#define DEVICE_IMAGE_START_NAME(_class,_name) _class::DEVICE_IMAGE_START_MEMBER_NAME(_name)
#define DECLARE_DEVICE_IMAGE_START_MEMBER(_name) void DEVICE_IMAGE_START_MEMBER_NAME(_name)()
#define DEVICE_IMAGE_START_MEMBER(_class,_name) void DEVICE_IMAGE_START_NAME(_class,_name)()
#define DEVICE_IMAGE_START_DELEGATE(_class,_name) device_image_start_delegate(&DEVICE_IMAGE_START_NAME(_class,_name),#_class "::device_image_start_" #_name,downcast<_class *>(device->owner()))
#define DEVICE_IMAGE_LOAD_MEMBER_NAME(_name) device_image_load_##_name #define DEVICE_IMAGE_LOAD_MEMBER_NAME(_name) device_image_load_##_name
#define DEVICE_IMAGE_LOAD_NAME(_class,_name) _class::DEVICE_IMAGE_LOAD_MEMBER_NAME(_name) #define DEVICE_IMAGE_LOAD_NAME(_class,_name) _class::DEVICE_IMAGE_LOAD_MEMBER_NAME(_name)
#define DECLARE_DEVICE_IMAGE_LOAD_MEMBER(_name) int DEVICE_IMAGE_LOAD_MEMBER_NAME(_name)(device_image_interface &image) #define DECLARE_DEVICE_IMAGE_LOAD_MEMBER(_name) int DEVICE_IMAGE_LOAD_MEMBER_NAME(_name)(device_image_interface &image)

View File

@ -203,11 +203,6 @@ int cartslot_image_device::process_cartridge(bool load)
void cartslot_image_device::device_start() void cartslot_image_device::device_start()
{ {
/* if this cartridge has a custom DEVICE_START, use it */
if (!m_device_image_start.isnull())
{
m_device_image_start();
}
} }

View File

@ -57,7 +57,6 @@ public:
void set_extensions(const char *_extensions) { m_extensions = _extensions; } void set_extensions(const char *_extensions) { m_extensions = _extensions; }
void set_interface(const char *_interface) { m_interface = _interface; } void set_interface(const char *_interface) { m_interface = _interface; }
void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; }
void set_device_start(device_image_start_delegate _start) { m_device_image_start = _start; }
void set_device_load(device_image_load_delegate _load) { m_device_image_load = _load; } void set_device_load(device_image_load_delegate _load) { m_device_image_load = _load; }
void set_device_unload(device_image_func_delegate _unload) { m_device_image_unload = _unload; } void set_device_unload(device_image_func_delegate _unload) { m_device_image_unload = _unload; }
void set_partialhash(device_image_partialhash_func _partialhash) { m_device_image_partialhash = _partialhash; } void set_partialhash(device_image_partialhash_func _partialhash) { m_device_image_partialhash = _partialhash; }
@ -75,7 +74,6 @@ protected:
const char * m_extensions; const char * m_extensions;
const char * m_interface; const char * m_interface;
bool m_must_be_loaded; bool m_must_be_loaded;
device_image_start_delegate m_device_image_start;
device_image_load_delegate m_device_image_load; device_image_load_delegate m_device_image_load;
device_image_func_delegate m_device_image_unload; device_image_func_delegate m_device_image_unload;
device_image_partialhash_func m_device_image_partialhash; device_image_partialhash_func m_device_image_partialhash;
@ -105,9 +103,6 @@ extern const device_type CARTSLOT;
#define MCFG_CARTSLOT_MANDATORY \ #define MCFG_CARTSLOT_MANDATORY \
static_cast<cartslot_image_device *>(device)->set_must_be_loaded(TRUE); static_cast<cartslot_image_device *>(device)->set_must_be_loaded(TRUE);
#define MCFG_CARTSLOT_START(_class,_start) \
static_cast<cartslot_image_device *>(device)->set_device_start( DEVICE_IMAGE_START_DELEGATE(_class,_start));
#define MCFG_CARTSLOT_LOAD(_class,_load) \ #define MCFG_CARTSLOT_LOAD(_class,_load) \
static_cast<cartslot_image_device *>(device)->set_device_load( DEVICE_IMAGE_LOAD_DELEGATE(_class,_load)); static_cast<cartslot_image_device *>(device)->set_device_load( DEVICE_IMAGE_LOAD_DELEGATE(_class,_load));

View File

@ -1641,7 +1641,6 @@ static MACHINE_CONFIG_START( jaguar, jaguar_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("j64,rom") MCFG_CARTSLOT_EXTENSION_LIST("j64,rom")
MCFG_CARTSLOT_INTERFACE("jaguar_cart") MCFG_CARTSLOT_INTERFACE("jaguar_cart")
MCFG_CARTSLOT_START(jaguar_state,jaguar_cart)
MCFG_CARTSLOT_LOAD(jaguar_state,jaguar_cart) MCFG_CARTSLOT_LOAD(jaguar_state,jaguar_cart)
/* software lists */ /* software lists */
@ -1681,7 +1680,7 @@ DRIVER_INIT_MEMBER(jaguar_state,jaguar)
{ {
m_hacks_enabled = false; m_hacks_enabled = false;
save_item(NAME(m_joystick_data)); save_item(NAME(m_joystick_data));
m_using_cart = false; cart_start();
for (int i=0;i<0x20000/4;i++) // the cd bios is bigger.. check for (int i=0;i<0x20000/4;i++) // the cd bios is bigger.. check
{ {
@ -1767,11 +1766,6 @@ int jaguar_state::quickload(device_image_interface &image, const char *file_type
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
DEVICE_IMAGE_START_MEMBER( jaguar_state, jaguar_cart )
{
cart_start();
}
void jaguar_state::cart_start() void jaguar_state::cart_start()
{ {
/* Initialize for no cartridge present */ /* Initialize for no cartridge present */

View File

@ -215,7 +215,6 @@ public:
void cart_start(); void cart_start();
int cart_load(device_image_interface &image); int cart_load(device_image_interface &image);
IRQ_CALLBACK_MEMBER(jaguar_irq_callback); IRQ_CALLBACK_MEMBER(jaguar_irq_callback);
DECLARE_DEVICE_IMAGE_START_MEMBER( jaguar_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( jaguar_cart ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( jaguar_cart );
protected: protected:
// timer IDs // timer IDs

View File

@ -51,6 +51,7 @@ public:
a2600_state(const machine_config &mconfig, device_type type, const char *tag) a2600_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_riot_ram(*this, "riot_ram") , m_riot_ram(*this, "riot_ram")
, m_banking_mode(0xff)
, m_joy1(*this, CONTROL1_TAG) , m_joy1(*this, CONTROL1_TAG)
, m_joy2(*this, CONTROL2_TAG) , m_joy2(*this, CONTROL2_TAG)
{ } { }
@ -128,7 +129,6 @@ public:
DECLARE_WRITE8_MEMBER(switch_B_w); DECLARE_WRITE8_MEMBER(switch_B_w);
DECLARE_WRITE_LINE_MEMBER(irq_callback); DECLARE_WRITE_LINE_MEMBER(irq_callback);
DECLARE_READ8_MEMBER(riot_input_port_8_r); DECLARE_READ8_MEMBER(riot_input_port_8_r);
DECLARE_DEVICE_IMAGE_START_MEMBER( a2600_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a2600_cart ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a2600_cart );
protected: protected:
@ -544,12 +544,6 @@ static int detect_super_chip(running_machine &machine)
} }
DEVICE_IMAGE_START_MEMBER( a2600_state, a2600_cart )
{
m_banking_mode = 0xff;
}
DEVICE_IMAGE_LOAD_MEMBER( a2600_state, a2600_cart ) DEVICE_IMAGE_LOAD_MEMBER( a2600_state, a2600_cart )
{ {
UINT8 *cart = memregion("user1")->base(); UINT8 *cart = memregion("user1")->base();
@ -1921,7 +1915,6 @@ static MACHINE_CONFIG_FRAGMENT(a2600_cartslot)
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,a26") MCFG_CARTSLOT_EXTENSION_LIST("bin,a26")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_START(a2600_state,a2600_cart)
MCFG_CARTSLOT_LOAD(a2600_state,a2600_cart) MCFG_CARTSLOT_LOAD(a2600_state,a2600_cart)
MCFG_CARTSLOT_INTERFACE("a2600_cart") MCFG_CARTSLOT_INTERFACE("a2600_cart")

View File

@ -302,7 +302,6 @@ static MACHINE_CONFIG_START( a7800_ntsc, a7800_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,a78") MCFG_CARTSLOT_EXTENSION_LIST("bin,a78")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_START(a7800_state,a7800_cart)
MCFG_CARTSLOT_LOAD(a7800_state,a7800_cart) MCFG_CARTSLOT_LOAD(a7800_state,a7800_cart)
MCFG_CARTSLOT_PARTIALHASH(a7800_partialhash) MCFG_CARTSLOT_PARTIALHASH(a7800_partialhash)
MCFG_CARTSLOT_INTERFACE("a7800_cart") MCFG_CARTSLOT_INTERFACE("a7800_cart")

View File

@ -30,7 +30,6 @@ public:
virtual void machine_reset(); virtual void machine_reset();
DECLARE_WRITE_LINE_MEMBER(tms_interrupt); DECLARE_WRITE_LINE_MEMBER(tms_interrupt);
DECLARE_DEVICE_IMAGE_START_MEMBER( bbcbc_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbcbc_cart ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbcbc_cart );
}; };
@ -133,14 +132,6 @@ static const z80_daisy_config bbcbc_daisy_chain[] =
}; };
DEVICE_IMAGE_START_MEMBER( bbcbc_state, bbcbc_cart )
{
UINT8 *cart = machine().root_device().memregion("maincpu" )->base() + 0x4000;
memset( cart, 0xFF, 0x8000 );
}
DEVICE_IMAGE_LOAD_MEMBER( bbcbc_state, bbcbc_cart ) DEVICE_IMAGE_LOAD_MEMBER( bbcbc_state, bbcbc_cart )
{ {
UINT8 *cart = machine().root_device().memregion("maincpu" )->base() + 0x4000; UINT8 *cart = machine().root_device().memregion("maincpu" )->base() + 0x4000;
@ -190,7 +181,6 @@ static MACHINE_CONFIG_START( bbcbc, bbcbc_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("bbcbc_cart") MCFG_CARTSLOT_INTERFACE("bbcbc_cart")
MCFG_CARTSLOT_START( bbcbc_state, bbcbc_cart )
MCFG_CARTSLOT_LOAD( bbcbc_state, bbcbc_cart ) MCFG_CARTSLOT_LOAD( bbcbc_state, bbcbc_cart )
/* Software lists */ /* Software lists */
@ -199,7 +189,7 @@ MACHINE_CONFIG_END
ROM_START( bbcbc ) ROM_START( bbcbc )
ROM_REGION( 0x10000, "maincpu", 0 ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD("br_4_1.ic3", 0x0000, 0x2000, CRC(7c880d75) SHA1(954db096bd9e8edfef72946637a12f1083841fb0)) ROM_LOAD("br_4_1.ic3", 0x0000, 0x2000, CRC(7c880d75) SHA1(954db096bd9e8edfef72946637a12f1083841fb0))
ROM_LOAD("br_4_2.ic4", 0x2000, 0x2000, CRC(16a33aef) SHA1(9529f9f792718a3715af2063b91a5fb18f741226)) ROM_LOAD("br_4_2.ic4", 0x2000, 0x2000, CRC(16a33aef) SHA1(9529f9f792718a3715af2063b91a5fb18f741226))
ROM_END ROM_END

View File

@ -12,7 +12,7 @@ static ADDRESS_MAP_START(gamepock_mem, AS_PROGRAM, 8, gamepock_state)
ADDRESS_MAP_UNMAP_HIGH ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000,0x0fff) AM_ROM AM_RANGE(0x0000,0x0fff) AM_ROM
AM_RANGE(0x1000,0x3fff) AM_NOP AM_RANGE(0x1000,0x3fff) AM_NOP
AM_RANGE(0x4000,0xBfff) AM_ROMBANK("bank1") AM_RANGE(0x4000,0xBfff) AM_ROM AM_REGION("user1", 0)
AM_RANGE(0xC000,0xC7ff) AM_MIRROR(0x0800) AM_RAM AM_RANGE(0xC000,0xC7ff) AM_MIRROR(0x0800) AM_RAM
AM_RANGE(0xff80,0xffff) AM_RAM /* 128 bytes microcontroller RAM */ AM_RANGE(0xff80,0xffff) AM_RAM /* 128 bytes microcontroller RAM */
ADDRESS_MAP_END ADDRESS_MAP_END
@ -45,12 +45,6 @@ INPUT_PORTS_END
static const UPD7810_CONFIG gamepock_cpu_config = { TYPE_78C06, gamepock_io_callback }; static const UPD7810_CONFIG gamepock_cpu_config = { TYPE_78C06, gamepock_io_callback };
DEVICE_IMAGE_START_MEMBER(gamepock_state,gamepock_cart)
{
membank( "bank1" )->set_base( memregion("user1" )->base() );
}
DEVICE_IMAGE_LOAD_MEMBER(gamepock_state,gamepock_cart) { DEVICE_IMAGE_LOAD_MEMBER(gamepock_state,gamepock_cart) {
UINT8 *cart = memregion("user1" )->base(); UINT8 *cart = memregion("user1" )->base();
@ -64,11 +58,9 @@ DEVICE_IMAGE_LOAD_MEMBER(gamepock_state,gamepock_cart) {
} }
else else
{ {
cart = image.get_software_region( "rom" ); memcpy( cart, image.get_software_region( "rom" ), image.get_software_region_length("rom") );
} }
membank( "bank1" )->set_base( cart );
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
@ -100,7 +92,6 @@ static MACHINE_CONFIG_START( gamepock, gamepock_state )
MCFG_CARTSLOT_INTERFACE("gamepock_cart") MCFG_CARTSLOT_INTERFACE("gamepock_cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_START(gamepock_state,gamepock_cart)
MCFG_CARTSLOT_LOAD(gamepock_state,gamepock_cart) MCFG_CARTSLOT_LOAD(gamepock_state,gamepock_cart)
/* Software lists */ /* Software lists */

View File

@ -590,7 +590,6 @@ static MACHINE_CONFIG_DERIVED( gameboy, gb_common )
MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin") MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("gameboy_cart") MCFG_CARTSLOT_INTERFACE("gameboy_cart")
MCFG_CARTSLOT_START(gb_state,gb_cart)
MCFG_CARTSLOT_LOAD(gb_state,gb_cart) MCFG_CARTSLOT_LOAD(gb_state,gb_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","gameboy") MCFG_SOFTWARE_LIST_ADD("cart_list","gameboy")
MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gbc_list","gbcolor") MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gbc_list","gbcolor")
@ -648,7 +647,6 @@ static MACHINE_CONFIG_DERIVED( gbcolor, gb_common )
MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin") MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("gameboy_cart") MCFG_CARTSLOT_INTERFACE("gameboy_cart")
MCFG_CARTSLOT_START(gb_state,gb_cart)
MCFG_CARTSLOT_LOAD(gb_state,gb_cart) MCFG_CARTSLOT_LOAD(gb_state,gb_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","gbcolor") MCFG_SOFTWARE_LIST_ADD("cart_list","gbcolor")
MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gb_list","gameboy") MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gb_list","gameboy")
@ -731,13 +729,13 @@ ROM_START( megaduck )
ROM_END ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
CONS( 1990, gameboy, 0, 0, gameboy, gameboy, driver_device, 0, "Nintendo", "Game Boy", 0) CONS( 1990, gameboy, 0, 0, gameboy, gameboy, gb_state, gb, "Nintendo", "Game Boy", 0)
CONS( 1994, supergb, gameboy, 0, supergb, gameboy, driver_device, 0, "Nintendo", "Super Game Boy", 0) CONS( 1994, supergb, gameboy, 0, supergb, gameboy, gb_state, gb, "Nintendo", "Super Game Boy", 0)
CONS( 1996, gbpocket, gameboy, 0, gbpocket, gameboy, driver_device, 0, "Nintendo", "Game Boy Pocket", 0) CONS( 1996, gbpocket, gameboy, 0, gbpocket, gameboy, gb_state, gb, "Nintendo", "Game Boy Pocket", 0)
CONS( 1997, gblight, gameboy, 0, gbpocket, gameboy, driver_device, 0, "Nintendo", "Game Boy Light", 0) CONS( 1997, gblight, gameboy, 0, gbpocket, gameboy, gb_state, gb, "Nintendo", "Game Boy Light", 0)
CONS( 1998, gbcolor, gameboy, 0, gbcolor, gameboy, driver_device, 0, "Nintendo", "Game Boy Color", GAME_IMPERFECT_GRAPHICS) CONS( 1998, gbcolor, gameboy, 0, gbcolor, gameboy, gb_state, gb, "Nintendo", "Game Boy Color", GAME_IMPERFECT_GRAPHICS)
/* Sound is not 100% yet, it generates some sounds which could be ok. Since we're lacking a real /* Sound is not 100% yet, it generates some sounds which could be ok. Since we're lacking a real
system there's no way to verify. Same goes for the colors of the LCD. We are no using the default system there's no way to verify. Same goes for the colors of the LCD. We are no using the default
Game Boy green colors */ Game Boy green colors */
CONS( 1993, megaduck, 0, 0, megaduck, gameboy, driver_device, 0, "Creatronic/Videojet/Timlex/Cougar", "MegaDuck/Cougar Boy" , 0) CONS( 1993, megaduck, 0, 0, megaduck, gameboy, gb_state, gb, "Creatronic/Videojet/Timlex/Cougar", "MegaDuck/Cougar Boy" , 0)

View File

@ -1609,7 +1609,6 @@ static MACHINE_CONFIG_START( nc100, nc_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("crd,card") MCFG_CARTSLOT_EXTENSION_LIST("crd,card")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_START(nc_state,nc_pcmcia_card)
MCFG_CARTSLOT_LOAD(nc_state,nc_pcmcia_card) MCFG_CARTSLOT_LOAD(nc_state,nc_pcmcia_card)
MCFG_CARTSLOT_UNLOAD(nc_state,nc_pcmcia_card) MCFG_CARTSLOT_UNLOAD(nc_state,nc_pcmcia_card)
@ -1703,6 +1702,6 @@ ROM_START(nc200)
ROM_END ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
COMP( 1992, nc100, 0, 0, nc100, nc100, driver_device, 0, "Amstrad plc", "NC100", 0 ) COMP( 1992, nc100, 0, 0, nc100, nc100, nc_state, nc, "Amstrad plc", "NC100", 0 )
COMP( 1992, nc150, nc100, 0, nc100, nc100, driver_device, 0, "Amstrad plc", "NC150", 0 ) COMP( 1992, nc150, nc100, 0, nc100, nc100, nc_state, nc, "Amstrad plc", "NC150", 0 )
COMP( 1993, nc200, 0, 0, nc200, nc200, driver_device, 0, "Amstrad plc", "NC200", GAME_NOT_WORKING ) // boot hangs while checking the MC146818 UIP (update in progress) bit COMP( 1993, nc200, 0, 0, nc200, nc200, nc_state, nc, "Amstrad plc", "NC200", GAME_NOT_WORKING ) // boot hangs while checking the MC146818 UIP (update in progress) bit

View File

@ -128,7 +128,15 @@ public:
, m_t6w28( *this, "t6w28" ) , m_t6w28( *this, "t6w28" )
, m_dac_l( *this, "dac_l" ) , m_dac_l( *this, "dac_l" )
, m_dac_r( *this, "dac_r" ) , m_dac_r( *this, "dac_r" )
{ } {
m_flash_chip[0].present = 0;
m_flash_chip[0].state = F_READ;
m_flash_chip[0].data = NULL;
m_flash_chip[1].present = 0;
m_flash_chip[1].state = F_READ;
m_flash_chip[1].data = NULL;
}
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
@ -174,7 +182,6 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(power_callback); DECLARE_INPUT_CHANGED_MEMBER(power_callback);
TIMER_CALLBACK_MEMBER(ngp_seconds_callback); TIMER_CALLBACK_MEMBER(ngp_seconds_callback);
DECLARE_DEVICE_IMAGE_START_MEMBER( ngp_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( ngp_cart); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( ngp_cart);
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( ngp_cart ); DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( ngp_cart );
}; };
@ -612,6 +619,44 @@ WRITE8_MEMBER( ngp_state::ngp_tlcs900_to3 )
void ngp_state::machine_start() void ngp_state::machine_start()
{ {
UINT8 *cart = memregion("cart")->base();
m_flash_chip[0].data = cart;
m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0];
m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1];
m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2];
m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3];
m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000];
m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001];
m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002];
m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003];
m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000];
m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001];
m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002];
m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003];
m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000];
m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001];
m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002];
m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003];
m_flash_chip[1].data = cart + 0x200000;
m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0];
m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1];
m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2];
m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3];
m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000];
m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001];
m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002];
m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003];
m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000];
m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001];
m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002];
m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003];
m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000];
m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001];
m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002];
m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003];
m_seconds_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ngp_state::ngp_seconds_callback),this)); m_seconds_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ngp_state::ngp_seconds_callback),this));
m_seconds_timer->adjust( attotime::from_seconds(1), 0, attotime::from_seconds(1) ); m_seconds_timer->adjust( attotime::from_seconds(1), 0, attotime::from_seconds(1) );
} }
@ -634,22 +679,9 @@ UINT32 ngp_state::screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap,
} }
DEVICE_IMAGE_START_MEMBER( ngp_state, ngp_cart )
{
UINT8 *cart = memregion("cart")->base();
m_flash_chip[0].present = 0;
m_flash_chip[0].state = F_READ;
m_flash_chip[0].data = cart;
m_flash_chip[1].present = 0;
m_flash_chip[1].state = F_READ;
m_flash_chip[1].data = cart + 0x200000;
}
DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart ) DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart )
{ {
UINT8 *cart = memregion("cart")->base();
UINT32 filesize; UINT32 filesize;
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
@ -662,7 +694,7 @@ DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart )
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
} }
if (image.fread( machine().root_device().memregion("cart")->base(), filesize) != filesize) if (image.fread( cart, filesize) != filesize)
{ {
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file"); image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file");
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
@ -671,7 +703,7 @@ DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart )
else else
{ {
filesize = image.get_software_region_length("rom"); filesize = image.get_software_region_length("rom");
memcpy(machine().root_device().memregion("cart")->base(), image.get_software_region("rom"), filesize); memcpy(cart, image.get_software_region("rom"), filesize);
} }
//printf("%2x%2x - %x - %x\n", (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x20), (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x21), //printf("%2x%2x - %x - %x\n", (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x20), (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x21),
@ -698,40 +730,6 @@ DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart )
break; break;
} }
m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0];
m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1];
m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2];
m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3];
m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000];
m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001];
m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002];
m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003];
m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000];
m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001];
m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002];
m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003];
m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000];
m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001];
m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002];
m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003];
m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0];
m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1];
m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2];
m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3];
m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000];
m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001];
m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002];
m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003];
m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000];
m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001];
m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002];
m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003];
m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000];
m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001];
m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002];
m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003];
m_flash_chip[0].present = 1; m_flash_chip[0].present = 1;
m_flash_chip[0].state = F_READ; m_flash_chip[0].state = F_READ;
@ -805,7 +803,6 @@ static MACHINE_CONFIG_DERIVED( ngp, ngp_common )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_START(ngp_state, ngp_cart)
MCFG_CARTSLOT_LOAD(ngp_state, ngp_cart) MCFG_CARTSLOT_LOAD(ngp_state, ngp_cart)
MCFG_CARTSLOT_INTERFACE("ngp_cart") MCFG_CARTSLOT_INTERFACE("ngp_cart")
MCFG_CARTSLOT_UNLOAD(ngp_state, ngp_cart) MCFG_CARTSLOT_UNLOAD(ngp_state, ngp_cart)
@ -826,7 +823,6 @@ static MACHINE_CONFIG_DERIVED( ngpc, ngp_common )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_START(ngp_state,ngp_cart)
MCFG_CARTSLOT_LOAD(ngp_state,ngp_cart) MCFG_CARTSLOT_LOAD(ngp_state,ngp_cart)
MCFG_CARTSLOT_INTERFACE("ngp_cart") MCFG_CARTSLOT_INTERFACE("ngp_cart")
MCFG_CARTSLOT_UNLOAD(ngp_state,ngp_cart) MCFG_CARTSLOT_UNLOAD(ngp_state,ngp_cart)

View File

@ -17,6 +17,9 @@ public:
scv_state(const machine_config &mconfig, device_type type, const char *tag) scv_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_videoram(*this,"videoram") , m_videoram(*this,"videoram")
, m_cart_rom_size(0)
, m_cart_ram(NULL)
, m_cart_ram_size(0)
, m_maincpu(*this, "maincpu") , m_maincpu(*this, "maincpu")
, m_upd1771c(*this, "upd1771c") , m_upd1771c(*this, "upd1771c")
, m_pa0(*this, "PA0") , m_pa0(*this, "PA0")
@ -57,7 +60,6 @@ public:
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(scv_vb_callback); TIMER_CALLBACK_MEMBER(scv_vb_callback);
DECLARE_DEVICE_IMAGE_START_MEMBER( scv_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( scv_cart ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( scv_cart );
protected: protected:
@ -360,20 +362,12 @@ WRITE8_MEMBER( scv_state::scv_portc_w )
} }
DEVICE_IMAGE_START_MEMBER( scv_state, scv_cart )
{
m_cart_rom = memregion( "cart" )->base();
m_cart_rom_size = 0;
m_cart_ram = NULL;
m_cart_ram_size = 0;
}
DEVICE_IMAGE_LOAD_MEMBER( scv_state, scv_cart ) DEVICE_IMAGE_LOAD_MEMBER( scv_state, scv_cart )
{ {
UINT8 *cart = memregion( "cart" )->base();
if ( image.software_entry() == NULL ) if ( image.software_entry() == NULL )
{ {
UINT8 *cart = image.device().machine().root_device().memregion( "cart" )->base();
int size = image.length(); int size = image.length();
if ( size > memregion( "cart" )->bytes() ) if ( size > memregion( "cart" )->bytes() )
@ -388,17 +382,17 @@ DEVICE_IMAGE_LOAD_MEMBER( scv_state, scv_cart )
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
} }
m_cart_rom = cart;
m_cart_rom_size = size; m_cart_rom_size = size;
m_cart_ram = NULL;
m_cart_ram_size = 0;
} }
else else
{ {
m_cart_rom = image.get_software_region( "rom" );
m_cart_rom_size = image.get_software_region_length( "rom" ); m_cart_rom_size = image.get_software_region_length( "rom" );
m_cart_ram = image.get_software_region( "ram" ); memcpy( cart, image.get_software_region( "rom" ), m_cart_rom_size );
m_cart_ram_size = image.get_software_region_length( "ram" ); m_cart_ram_size = image.get_software_region_length( "ram" );
if ( m_cart_ram_size > 0 )
{
m_cart_ram = auto_alloc_array_clear( machine(), UINT8, m_cart_ram_size );
}
} }
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
@ -799,6 +793,7 @@ WRITE_LINE_MEMBER( scv_state::scv_upd1771_ack_w )
void scv_state::machine_start() void scv_state::machine_start()
{ {
m_cart_rom = memregion( "cart" )->base();
m_vb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scv_state::scv_vb_callback),this)); m_vb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scv_state::scv_vb_callback),this));
} }
@ -859,7 +854,6 @@ static MACHINE_CONFIG_START( scv, scv_state )
MCFG_CARTSLOT_EXTENSION_LIST( "bin" ) MCFG_CARTSLOT_EXTENSION_LIST( "bin" )
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("scv_cart") MCFG_CARTSLOT_INTERFACE("scv_cart")
MCFG_CARTSLOT_START( scv_state, scv_cart )
MCFG_CARTSLOT_LOAD( scv_state, scv_cart ) MCFG_CARTSLOT_LOAD( scv_state, scv_cart )
/* Software lists */ /* Software lists */

View File

@ -402,7 +402,6 @@ static MACHINE_CONFIG_FRAGMENT( sms_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") MCFG_CARTSLOT_EXTENSION_LIST("sms,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("sms_cart") MCFG_CARTSLOT_INTERFACE("sms_cart")
MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_state,sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","sms") MCFG_SOFTWARE_LIST_ADD("cart_list","sms")
@ -413,7 +412,6 @@ static MACHINE_CONFIG_FRAGMENT( gg_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("gg,bin") MCFG_CARTSLOT_EXTENSION_LIST("gg,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("gamegear_cart") MCFG_CARTSLOT_INTERFACE("gamegear_cart")
MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_state,sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","gamegear") MCFG_SOFTWARE_LIST_ADD("cart_list","gamegear")
@ -495,7 +493,6 @@ MACHINE_CONFIG_END
MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") \ MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") \
MCFG_CARTSLOT_NOT_MANDATORY \ MCFG_CARTSLOT_NOT_MANDATORY \
MCFG_CARTSLOT_INTERFACE("sms_cart") \ MCFG_CARTSLOT_INTERFACE("sms_cart") \
MCFG_CARTSLOT_START(sms_state,sms_cart) \
MCFG_CARTSLOT_LOAD(sms_state,sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
static MACHINE_CONFIG_DERIVED( sms_sdisp, sms2_ntsc ) static MACHINE_CONFIG_DERIVED( sms_sdisp, sms2_ntsc )
@ -512,7 +509,6 @@ static MACHINE_CONFIG_DERIVED( sms_sdisp, sms2_ntsc )
MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") MCFG_CARTSLOT_EXTENSION_LIST("sms,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("sms_cart") MCFG_CARTSLOT_INTERFACE("sms_cart")
MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_state,sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MCFG_SMSSDISP_CARTSLOT_ADD("cart2") MCFG_SMSSDISP_CARTSLOT_ADD("cart2")
@ -617,7 +613,6 @@ static MACHINE_CONFIG_DERIVED( sg1000m3, sms_fm )
MCFG_CARTSLOT_MODIFY("cart1") MCFG_CARTSLOT_MODIFY("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("sms,bin,sg") MCFG_CARTSLOT_EXTENSION_LIST("sms,bin,sg")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_state,sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -299,7 +299,6 @@ static MACHINE_CONFIG_FRAGMENT( svi318_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("svi318_cart") MCFG_CARTSLOT_INTERFACE("svi318_cart")
MCFG_CARTSLOT_START(svi318_state,svi318_cart)
MCFG_CARTSLOT_LOAD(svi318_state,svi318_cart) MCFG_CARTSLOT_LOAD(svi318_state,svi318_cart)
MCFG_CARTSLOT_UNLOAD(svi318_state,svi318_cart) MCFG_CARTSLOT_UNLOAD(svi318_state,svi318_cart)

View File

@ -155,7 +155,6 @@ static MACHINE_CONFIG_START( wswan, wswan_state )
MCFG_CARTSLOT_EXTENSION_LIST("ws,wsc,bin") MCFG_CARTSLOT_EXTENSION_LIST("ws,wsc,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("wswan_cart") MCFG_CARTSLOT_INTERFACE("wswan_cart")
MCFG_CARTSLOT_START(wswan_state,wswan_cart)
MCFG_CARTSLOT_LOAD(wswan_state,wswan_cart) MCFG_CARTSLOT_LOAD(wswan_state,wswan_cart)
/* software lists */ /* software lists */
@ -195,5 +194,5 @@ ROM_START( wscolor )
ROM_END ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME*/ /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME*/
CONS( 1999, wswan, 0, 0, wswan, wswan, driver_device, 0, "Bandai", "WonderSwan", GAME_IMPERFECT_SOUND ) CONS( 1999, wswan, 0, 0, wswan, wswan, wswan_state, wswan, "Bandai", "WonderSwan", GAME_IMPERFECT_SOUND )
CONS( 2000, wscolor, wswan, 0, wscolor, wswan, driver_device, 0, "Bandai", "WonderSwan Color", GAME_IMPERFECT_SOUND ) CONS( 2000, wscolor, wswan, 0, wscolor, wswan, wswan_state, wswan, "Bandai", "WonderSwan Color", GAME_IMPERFECT_SOUND )

View File

@ -59,6 +59,7 @@ public:
DECLARE_WRITE8_MEMBER(a7800_TIA_w); DECLARE_WRITE8_MEMBER(a7800_TIA_w);
DECLARE_READ8_MEMBER(a7800_MARIA_r); DECLARE_READ8_MEMBER(a7800_MARIA_r);
DECLARE_WRITE8_MEMBER(a7800_MARIA_w); DECLARE_WRITE8_MEMBER(a7800_MARIA_w);
void a7800_driver_init(int ispal, int lines);
DECLARE_DRIVER_INIT(a7800_pal); DECLARE_DRIVER_INIT(a7800_pal);
DECLARE_DRIVER_INIT(a7800_ntsc); DECLARE_DRIVER_INIT(a7800_ntsc);
virtual void machine_reset(); virtual void machine_reset();
@ -71,7 +72,6 @@ public:
DECLARE_READ8_MEMBER(riot_console_button_r); DECLARE_READ8_MEMBER(riot_console_button_r);
DECLARE_WRITE8_MEMBER(riot_button_pullup_w); DECLARE_WRITE8_MEMBER(riot_button_pullup_w);
DECLARE_DEVICE_IMAGE_START_MEMBER( a7800_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a7800_cart ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a7800_cart );
}; };

View File

@ -89,7 +89,7 @@ public:
UINT8 *m_io_ram_r_ptr; UINT8 *m_io_ram_r_ptr;
c64_cart_t m_cart; c64_cart_t m_cart;
int m_nmilevel; int m_nmilevel;
DECLARE_DEVICE_IMAGE_START_MEMBER( c64_cart ); void c64_legacy_driver_init();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( c64_cart ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( c64_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( c64_cart ); DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( c64_cart );
}; };

View File

@ -13,7 +13,8 @@ class gamepock_state : public driver_device
{ {
public: public:
gamepock_state(const machine_config &mconfig, device_type type, const char *tag) gamepock_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag)
{ }
virtual void machine_reset(); virtual void machine_reset();
@ -30,7 +31,6 @@ public:
DECLARE_WRITE8_MEMBER( port_b_w ); DECLARE_WRITE8_MEMBER( port_b_w );
DECLARE_READ8_MEMBER( port_c_r ); DECLARE_READ8_MEMBER( port_c_r );
UINT32 screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_DEVICE_IMAGE_START_MEMBER(gamepock_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gamepock_cart); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gamepock_cart);
}; };

View File

@ -267,7 +267,7 @@ public:
TIMER_CALLBACK_MEMBER(gb_lcd_timer_proc); TIMER_CALLBACK_MEMBER(gb_lcd_timer_proc);
TIMER_CALLBACK_MEMBER(gbc_lcd_timer_proc); TIMER_CALLBACK_MEMBER(gbc_lcd_timer_proc);
DECLARE_WRITE8_MEMBER(gb_timer_callback); DECLARE_WRITE8_MEMBER(gb_timer_callback);
DECLARE_DEVICE_IMAGE_START_MEMBER(gb_cart); DECLARE_DRIVER_INIT(gb);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gb_cart); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gb_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(megaduck_cart); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(megaduck_cart);

View File

@ -95,7 +95,7 @@ public:
void nc200_fdc_interrupt(bool state); void nc200_fdc_interrupt(bool state);
DECLARE_DEVICE_IMAGE_START_MEMBER( nc_pcmcia_card ); DECLARE_DRIVER_INIT( nc );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( nc_pcmcia_card ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( nc_pcmcia_card );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( nc_pcmcia_card ); DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( nc_pcmcia_card );

View File

@ -127,7 +127,6 @@ public:
DECLARE_WRITE8_MEMBER(psg_4017_w); DECLARE_WRITE8_MEMBER(psg_4017_w);
void nes_banks_restore(); void nes_banks_restore();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(nes_cart); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(nes_cart);
DECLARE_DEVICE_IMAGE_START_MEMBER(nes_disk);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(nes_disk); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(nes_disk);
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(nes_disk); DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(nes_disk);

View File

@ -209,7 +209,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(sms_pause_callback); DECLARE_WRITE_LINE_MEMBER(sms_pause_callback);
DECLARE_WRITE_LINE_MEMBER(sms_store_int_callback); DECLARE_WRITE_LINE_MEMBER(sms_store_int_callback);
void sms_machine_stop(); void sms_machine_stop();
DECLARE_DEVICE_IMAGE_START_MEMBER(sms_cart); void setup_sms_cart();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(sms_cart); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(sms_cart);
protected: protected:
required_shared_ptr<UINT8> m_mainram; required_shared_ptr<UINT8> m_mainram;

View File

@ -56,6 +56,8 @@ class svi318_state : public driver_device
public: public:
svi318_state(const machine_config &mconfig, device_type type, const char *tag) svi318_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_pcart(NULL)
, m_pcart_rom_size(0)
, m_maincpu(*this, "maincpu") , m_maincpu(*this, "maincpu")
, m_cassette(*this, CASSETTE_TAG) , m_cassette(*this, CASSETTE_TAG)
, m_dac(*this, "dac") , m_dac(*this, "dac")
@ -109,7 +111,6 @@ public:
DECLARE_WRITE8_MEMBER(svi318_ppi_port_c_w); DECLARE_WRITE8_MEMBER(svi318_ppi_port_c_w);
DECLARE_WRITE_LINE_MEMBER(svi_fdc_intrq_w); DECLARE_WRITE_LINE_MEMBER(svi_fdc_intrq_w);
DECLARE_WRITE_LINE_MEMBER(svi_fdc_drq_w); DECLARE_WRITE_LINE_MEMBER(svi_fdc_drq_w);
DECLARE_DEVICE_IMAGE_START_MEMBER(svi318_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(svi318_cart); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(svi318_cart);
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(svi318_cart); DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(svi318_cart);

View File

@ -144,7 +144,7 @@ public:
TIMER_CALLBACK_MEMBER(wswan_rtc_callback); TIMER_CALLBACK_MEMBER(wswan_rtc_callback);
TIMER_CALLBACK_MEMBER(wswan_scanline_interrupt); TIMER_CALLBACK_MEMBER(wswan_scanline_interrupt);
void wswan_machine_stop(); void wswan_machine_stop();
DECLARE_DEVICE_IMAGE_START_MEMBER( wswan_cart ); DECLARE_DRIVER_INIT( wswan );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( wswan_cart ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( wswan_cart );
protected: protected:

View File

@ -68,38 +68,54 @@ const riot6532_interface a7800_r6532_interface =
DRIVER INIT DRIVER INIT
***************************************************************************/ ***************************************************************************/
static void a7800_driver_init(running_machine &machine, int ispal, int lines) void a7800_state::a7800_driver_init(int ispal, int lines)
{ {
a7800_state *state = machine.driver_data<a7800_state>(); address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); m_ROM = memregion("maincpu")->base();
state->m_ROM = state->memregion("maincpu")->base(); m_ispal = ispal;
state->m_ispal = ispal; m_lines = lines;
state->m_lines = lines; m_p1_one_button = 1;
state->m_p1_one_button = 1; m_p2_one_button = 1;
state->m_p2_one_button = 1;
/* standard banks */ /* standard banks */
state->membank("bank5")->set_base(&state->m_ROM[0x2040]); /* RAM0 */ membank("bank5")->set_base(&m_ROM[0x2040]); /* RAM0 */
state->membank("bank6")->set_base(&state->m_ROM[0x2140]); /* RAM1 */ membank("bank6")->set_base(&m_ROM[0x2140]); /* RAM1 */
state->membank("bank7")->set_base(&state->m_ROM[0x2000]); /* MAINRAM */ membank("bank7")->set_base(&m_ROM[0x2000]); /* MAINRAM */
/* Brutal hack put in as a consequence of new memory system; fix this */ /* Brutal hack put in as a consequence of new memory system; fix this */
space.install_readwrite_bank(0x0480, 0x04FF,"bank10"); space.install_readwrite_bank(0x0480, 0x04FF,"bank10");
state->membank("bank10")->set_base(state->m_ROM + 0x0480); membank("bank10")->set_base(m_ROM + 0x0480);
space.install_readwrite_bank(0x1800, 0x27FF, "bank11"); space.install_readwrite_bank(0x1800, 0x27FF, "bank11");
state->membank("bank11")->set_base(state->m_ROM + 0x1800); membank("bank11")->set_base(m_ROM + 0x1800);
m_bios_bkup = NULL;
m_cart_bkup = NULL;
/* Allocate memory for BIOS bank switching */
m_bios_bkup = auto_alloc_array_clear(machine(), UINT8, 0x4000);
m_cart_bkup = auto_alloc_array(machine(), UINT8, 0x4000);
/* save the BIOS so we can switch it in and out */
memcpy( m_bios_bkup, m_ROM + 0xC000, 0x4000 );
/* Initialize cart area to "no data" */
memset( m_cart_bkup, 0xFF, 0x4000 );
/* defaults for PAL bios without cart */
m_cart_type = 0;
m_stick_type = 1;
} }
DRIVER_INIT_MEMBER(a7800_state,a7800_ntsc) DRIVER_INIT_MEMBER(a7800_state,a7800_ntsc)
{ {
a7800_driver_init(machine(), FALSE, 262); a7800_driver_init(FALSE, 262);
} }
DRIVER_INIT_MEMBER(a7800_state,a7800_pal) DRIVER_INIT_MEMBER(a7800_state,a7800_pal)
{ {
a7800_driver_init(machine(), TRUE, 312); a7800_driver_init(TRUE, 312);
} }
@ -191,28 +207,6 @@ static int a7800_verify_cart(char header[128])
} }
DEVICE_IMAGE_START_MEMBER( a7800_state, a7800_cart )
{
UINT8 *memory = memregion("maincpu")->base();
m_bios_bkup = NULL;
m_cart_bkup = NULL;
/* Allocate memory for BIOS bank switching */
m_bios_bkup = auto_alloc_array_clear(machine(), UINT8, 0x4000);
m_cart_bkup = auto_alloc_array(machine(), UINT8, 0x4000);
/* save the BIOS so we can switch it in and out */
memcpy( m_bios_bkup, memory + 0xC000, 0x4000 );
/* Initialize cart area to "no data" */
memset( m_cart_bkup, 0xFF, 0x4000 );
/* defaults for PAL bios without cart */
m_cart_type = 0;
m_stick_type = 1;
}
struct a7800_pcb struct a7800_pcb
{ {
const char *pcb_name; const char *pcb_name;

View File

@ -519,7 +519,7 @@ DEVICE_IMAGE_UNLOAD_MEMBER( legacy_c64_state, c64_cart )
} }
DEVICE_IMAGE_START_MEMBER( legacy_c64_state, c64_cart ) void legacy_c64_state::c64_legacy_driver_init()
{ {
/* In the first slot we can load a .crt file. In this case we want /* In the first slot we can load a .crt file. In this case we want
to use game & exrom values from the header, not the default ones. */ to use game & exrom values from the header, not the default ones. */
@ -1182,14 +1182,12 @@ MACHINE_CONFIG_FRAGMENT( c64_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("crt,80") MCFG_CARTSLOT_EXTENSION_LIST("crt,80")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("c64_cart") MCFG_CARTSLOT_INTERFACE("c64_cart")
MCFG_CARTSLOT_START(legacy_c64_state,c64_cart)
MCFG_CARTSLOT_LOAD(legacy_c64_state,c64_cart) MCFG_CARTSLOT_LOAD(legacy_c64_state,c64_cart)
MCFG_CARTSLOT_UNLOAD(legacy_c64_state,c64_cart) MCFG_CARTSLOT_UNLOAD(legacy_c64_state,c64_cart)
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_EXTENSION_LIST("crt,80") MCFG_CARTSLOT_EXTENSION_LIST("crt,80")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_START(legacy_c64_state,c64_cart)
MCFG_CARTSLOT_LOAD(legacy_c64_state,c64_cart) MCFG_CARTSLOT_LOAD(legacy_c64_state,c64_cart)
MCFG_CARTSLOT_UNLOAD(legacy_c64_state,c64_cart) MCFG_CARTSLOT_UNLOAD(legacy_c64_state,c64_cart)

View File

@ -994,12 +994,14 @@ static void c65_common_driver_init( running_machine &machine )
DRIVER_INIT_MEMBER(c65_state,c65) DRIVER_INIT_MEMBER(c65_state,c65)
{ {
m_dma.version = 2; m_dma.version = 2;
c64_legacy_driver_init();
c65_common_driver_init(machine()); c65_common_driver_init(machine());
} }
DRIVER_INIT_MEMBER(c65_state,c65pal) DRIVER_INIT_MEMBER(c65_state,c65pal)
{ {
m_dma.version = 1; m_dma.version = 1;
c64_legacy_driver_init();
c65_common_driver_init(machine()); c65_common_driver_init(machine());
m_pal = 1; m_pal = 1;
} }

View File

@ -1496,7 +1496,7 @@ READ8_MEMBER(gb_state::gb_io_r)
} }
} }
DEVICE_IMAGE_START_MEMBER(gb_state,gb_cart) DRIVER_INIT_MEMBER(gb_state, gb)
{ {
int I; int I;

View File

@ -90,7 +90,7 @@ static int nc_card_load(device_image_interface &image, unsigned char **ptr)
} }
DEVICE_IMAGE_START_MEMBER( nc_state, nc_pcmcia_card ) DRIVER_INIT_MEMBER( nc_state, nc )
{ {
/* card not present */ /* card not present */
nc_set_card_present_state(machine(), 0); nc_set_card_present_state(machine(), 0);

View File

@ -1554,7 +1554,7 @@ static int detect_lphaser_xoffset( running_machine &machine, UINT8 *rom )
} }
DEVICE_IMAGE_START_MEMBER( sms_state, sms_cart ) void sms_state::setup_sms_cart()
{ {
int i; int i;
@ -2105,12 +2105,14 @@ DRIVER_INIT_MEMBER(sms_state,sg1000m3)
{ {
m_is_region_japan = 1; m_is_region_japan = 1;
m_has_fm = 1; m_has_fm = 1;
setup_sms_cart();
} }
DRIVER_INIT_MEMBER(sms_state,sms1) DRIVER_INIT_MEMBER(sms_state,sms1)
{ {
m_has_bios_full = 1; m_has_bios_full = 1;
setup_sms_cart();
} }
@ -2119,6 +2121,7 @@ DRIVER_INIT_MEMBER(sms_state,smsj)
m_is_region_japan = 1; m_is_region_japan = 1;
m_has_bios_2000 = 1; m_has_bios_2000 = 1;
m_has_fm = 1; m_has_fm = 1;
setup_sms_cart();
} }
@ -2127,11 +2130,13 @@ DRIVER_INIT_MEMBER(sms_state,sms2kr)
m_is_region_japan = 1; m_is_region_japan = 1;
m_has_bios_full = 1; m_has_bios_full = 1;
m_has_fm = 1; m_has_fm = 1;
setup_sms_cart();
} }
DRIVER_INIT_MEMBER(sms_state,smssdisp) DRIVER_INIT_MEMBER(sms_state,smssdisp)
{ {
setup_sms_cart();
} }
@ -2139,6 +2144,7 @@ DRIVER_INIT_MEMBER(sms_state,gamegear)
{ {
m_is_gamegear = 1; m_is_gamegear = 1;
m_has_bios_0400 = 1; m_has_bios_0400 = 1;
setup_sms_cart();
} }
@ -2147,6 +2153,7 @@ DRIVER_INIT_MEMBER(sms_state,gamegeaj)
m_is_region_japan = 1; m_is_region_japan = 1;
m_is_gamegear = 1; m_is_gamegear = 1;
m_has_bios_0400 = 1; m_has_bios_0400 = 1;
setup_sms_cart();
} }

View File

@ -62,25 +62,9 @@ const ins8250_interface svi318_ins8250_interface[2]=
/* Cartridge */ /* Cartridge */
static int svi318_verify_cart (UINT8 magic[2])
{
/* read the first two bytes */
if ( (magic[0] == 0xf3) && (magic[1] == 0x31) )
return IMAGE_VERIFY_PASS;
else
return IMAGE_VERIFY_FAIL;
}
DEVICE_IMAGE_START_MEMBER( svi318_state, svi318_cart )
{
m_pcart = NULL;
m_pcart_rom_size = 0;
}
DEVICE_IMAGE_LOAD_MEMBER( svi318_state, svi318_cart ) DEVICE_IMAGE_LOAD_MEMBER( svi318_state, svi318_cart )
{ {
svi318_state *state = image.device().machine().driver_data<svi318_state>(); UINT8 *p = memregion("user1")->base();
UINT8 *p = state->memregion("user1")->base();
UINT32 size; UINT32 size;
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
@ -100,24 +84,29 @@ DEVICE_IMAGE_LOAD_MEMBER( svi318_state, svi318_cart )
} }
} }
else else
{
memcpy(p, image.get_software_region("rom"), size); memcpy(p, image.get_software_region("rom"), size);
}
if (svi318_verify_cart(p) == IMAGE_VERIFY_FAIL) if ( p[0] != 0xf3 || p[1] != 0x31 )
{
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
}
state->m_pcart = p; m_pcart = p;
state->m_pcart_rom_size = size; m_pcart_rom_size = size;
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
DEVICE_IMAGE_UNLOAD_MEMBER( svi318_state, svi318_cart ) DEVICE_IMAGE_UNLOAD_MEMBER( svi318_state, svi318_cart )
{ {
svi318_state *state = image.device().machine().driver_data<svi318_state>(); m_pcart = NULL;
state->m_pcart = NULL; m_pcart_rom_size = 0;
state->m_pcart_rom_size = 0;
} }
/* PPI */ /* PPI */
/* /*

View File

@ -1329,7 +1329,8 @@ static const char* wswan_determine_romsize( UINT8 data )
return wswan_romsize_str[ ROM_UNKNOWN ]; return wswan_romsize_str[ ROM_UNKNOWN ];
} }
DEVICE_IMAGE_START_MEMBER(wswan_state,wswan_cart)
DRIVER_INIT_MEMBER(wswan_state, wswan)
{ {
/* Initialize EEPROM structure */ /* Initialize EEPROM structure */
memset( &m_eeprom, 0, sizeof( m_eeprom ) ); memset( &m_eeprom, 0, sizeof( m_eeprom ) );
@ -1349,6 +1350,7 @@ DEVICE_IMAGE_START_MEMBER(wswan_state,wswan_cart)
m_rtc.setting = 0xFF; m_rtc.setting = 0xFF;
} }
DEVICE_IMAGE_LOAD_MEMBER(wswan_state,wswan_cart) DEVICE_IMAGE_LOAD_MEMBER(wswan_state,wswan_cart)
{ {
UINT32 ii, size; UINT32 ii, size;