Started moving DEVICE_IMAGE_ functions into driver_device classes. (nw)

This commit is contained in:
Wilbert Pol 2013-02-05 20:54:03 +00:00
parent 3e7883e3fc
commit 400b9bcc29
134 changed files with 1400 additions and 1349 deletions

View File

@ -104,12 +104,17 @@ struct image_device_format
astring m_optspec; astring m_optspec;
}; };
class device_image_interface; class device_image_interface;
struct feature_list; struct feature_list;
struct software_part; 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<void (device_image_interface &)> device_image_func_delegate;
// legacy
typedef int (*device_image_load_func)(device_image_interface &image); typedef int (*device_image_load_func)(device_image_interface &image);
typedef void (*device_image_unload_func)(device_image_interface &image); typedef void (*device_image_unload_func)(device_image_interface &image);
typedef void (*device_image_partialhash_func)(hash_collection &, const unsigned char *, unsigned long, const char *); typedef void (*device_image_partialhash_func)(hash_collection &, const unsigned char *, unsigned long, const char *);
@ -124,14 +129,32 @@ typedef void (*device_image_display_info_func)(device_image_interface &image);
#define IMAGE_VERIFY_PASS FALSE #define IMAGE_VERIFY_PASS FALSE
#define IMAGE_VERIFY_FAIL TRUE #define IMAGE_VERIFY_FAIL TRUE
#define DEVICE_IMAGE_LOAD_NAME(name) device_load_##name #define DEVICE_IMAGE_LOAD_NAME_LEGACY(name) device_load_##name
#define DEVICE_IMAGE_LOAD(name) int DEVICE_IMAGE_LOAD_NAME(name)(device_image_interface &image) #define DEVICE_IMAGE_LOAD_LEGACY(name) int DEVICE_IMAGE_LOAD_NAME_LEGACY(name)(device_image_interface &image)
#define DEVICE_IMAGE_UNLOAD_NAME_LEGACY(name) device_unload_##name
#define DEVICE_IMAGE_UNLOAD_LEGACY(name) void DEVICE_IMAGE_UNLOAD_NAME_LEGACY(name)(device_image_interface &image)
#define DEVICE_IMAGE_DISPLAY_INFO_NAME(name) device_image_display_info_func##name
#define DEVICE_IMAGE_DISPLAY_INFO(name) void DEVICE_IMAGE_DISPLAY_INFO_NAME(name)(device_image_interface &image)
#define DEVICE_IMAGE_UNLOAD_NAME(name) device_unload_##name
#define DEVICE_IMAGE_UNLOAD(name) void DEVICE_IMAGE_UNLOAD_NAME(name)(device_image_interface &image)
#define DEVICE_IMAGE_DISPLAY_INFO_NAME(name) device_image_display_info_func##name #define DEVICE_IMAGE_START_MEMBER_NAME(_name) device_image_start_##_name
#define DEVICE_IMAGE_DISPLAY_INFO(name) void DEVICE_IMAGE_DISPLAY_INFO_NAME(name)(device_image_interface &image) #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_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 DEVICE_IMAGE_LOAD_MEMBER(_class,_name) int DEVICE_IMAGE_LOAD_NAME(_class,_name)(device_image_interface &image)
#define DEVICE_IMAGE_LOAD_DELEGATE(_class,_name) device_image_load_delegate(&DEVICE_IMAGE_LOAD_NAME(_class,_name),#_class "::device_image_load_" #_name, downcast<_class *>(device->owner()))
#define DEVICE_IMAGE_UNLOAD_MEMBER_NAME(_name) device_image_unload_##_name
#define DEVICE_IMAGE_UNLOAD_NAME(_class,_name) _class::DEVICE_IMAGE_UNLOAD_MEMBER_NAME(_name)
#define DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(_name) void DEVICE_IMAGE_UNLOAD_MEMBER_NAME(_name)(device_image_interface &image)
#define DEVICE_IMAGE_UNLOAD_MEMBER(_class,_name) void DEVICE_IMAGE_UNLOAD_NAME(_class,_name)(device_image_interface &image)
#define DEVICE_IMAGE_UNLOAD_DELEGATE(_class,_name) device_image_func_delegate(&DEVICE_IMAGE_UNLOAD_NAME(_class,_name),#_class "::device_image_unload_" #_name, downcast<_class *>(device->owner()))
// ======================> device_image_interface // ======================> device_image_interface

View File

@ -24,11 +24,7 @@ cartslot_image_device::cartslot_image_device(const machine_config &mconfig, cons
m_extensions("bin"), m_extensions("bin"),
m_interface(NULL), m_interface(NULL),
m_must_be_loaded(0), m_must_be_loaded(0),
m_device_start(NULL), m_device_image_partialhash(NULL)
m_device_load(NULL),
m_device_unload(NULL),
m_device_partialhash(NULL),
m_device_displayinfo(NULL)
{ {
} }
@ -208,9 +204,9 @@ 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 this cartridge has a custom DEVICE_START, use it */
if (m_device_start != NULL) if (!m_device_image_start.isnull())
{ {
(*m_device_start)(this); m_device_image_start();
} }
} }
@ -222,8 +218,8 @@ void cartslot_image_device::device_start()
bool cartslot_image_device::call_load() bool cartslot_image_device::call_load()
{ {
/* if this cartridge has a custom DEVICE_IMAGE_LOAD, use it */ /* if this cartridge has a custom DEVICE_IMAGE_LOAD, use it */
if (m_device_load != NULL) if (!m_device_image_load.isnull())
return (*m_device_load)(*this); return m_device_image_load(*this);
/* otherwise try the normal route */ /* otherwise try the normal route */
return process_cartridge(true); return process_cartridge(true);
@ -236,9 +232,9 @@ bool cartslot_image_device::call_load()
void cartslot_image_device::call_unload() void cartslot_image_device::call_unload()
{ {
/* if this cartridge has a custom DEVICE_IMAGE_UNLOAD, use it */ /* if this cartridge has a custom DEVICE_IMAGE_UNLOAD, use it */
if (m_device_unload != NULL) if (!m_device_image_unload.isnull())
{ {
(*m_device_unload)(*this); m_device_image_unload(*this);
return; return;
} }
process_cartridge(false); process_cartridge(false);

View File

@ -39,9 +39,9 @@ public:
// image-level overrides // image-level overrides
virtual bool call_load(); virtual bool call_load();
virtual void call_unload(); virtual void call_unload();
virtual void call_display_info() { if (m_device_displayinfo) m_device_displayinfo(*this); } virtual void call_display_info() { if (!m_device_image_displayinfo.isnull()) m_device_image_displayinfo(*this); }
virtual bool call_softlist_load(char *swlist, char *swname, rom_entry *start_entry) { load_software_part_region( this, swlist, swname, start_entry ); return TRUE; } virtual bool call_softlist_load(char *swlist, char *swname, rom_entry *start_entry) { load_software_part_region( this, swlist, swname, start_entry ); return TRUE; }
virtual device_image_partialhash_func get_partial_hash() const { return m_device_partialhash; } virtual device_image_partialhash_func get_partial_hash() const { return m_device_image_partialhash; }
virtual iodevice_t image_type() const { return IO_CARTSLOT; } virtual iodevice_t image_type() const { return IO_CARTSLOT; }
@ -57,11 +57,11 @@ 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_start_func _start) { m_device_start = _start; } void set_device_start(device_image_start_delegate _start) { m_device_image_start = _start; }
void set_device_load(device_image_load_func _load) { m_device_load = _load; } void set_device_load(device_image_load_delegate _load) { m_device_image_load = _load; }
void set_device_unload(device_image_unload_func _unload) { m_device_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_partialhash = _partialhash; } void set_partialhash(device_image_partialhash_func _partialhash) { m_device_image_partialhash = _partialhash; }
void set_displayinfo(device_image_display_info_func _displayinfo) { m_device_displayinfo = _displayinfo; } void set_displayinfo(device_image_func_delegate _displayinfo) { m_device_image_displayinfo = _displayinfo; }
protected: protected:
// device-level overrides // device-level overrides
@ -75,11 +75,11 @@ 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_start_func m_device_start; device_image_start_delegate m_device_image_start;
device_image_load_func m_device_load; device_image_load_delegate m_device_image_load;
device_image_unload_func m_device_unload; device_image_func_delegate m_device_image_unload;
device_image_partialhash_func m_device_partialhash; device_image_partialhash_func m_device_image_partialhash;
device_image_display_info_func m_device_displayinfo; device_image_func_delegate m_device_image_displayinfo;
}; };
// device type definition // device type definition
@ -105,19 +105,19 @@ 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(_start) \ #define MCFG_CARTSLOT_START(_class,_start) \
static_cast<cartslot_image_device *>(device)->set_device_start(DEVICE_START_NAME(_start)); static_cast<cartslot_image_device *>(device)->set_device_start( DEVICE_IMAGE_START_DELEGATE(_class,_start));
#define MCFG_CARTSLOT_LOAD(_load) \ #define MCFG_CARTSLOT_LOAD(_class,_load) \
static_cast<cartslot_image_device *>(device)->set_device_load(DEVICE_IMAGE_LOAD_NAME(_load)); static_cast<cartslot_image_device *>(device)->set_device_load( DEVICE_IMAGE_LOAD_DELEGATE(_class,_load));
#define MCFG_CARTSLOT_UNLOAD(_unload) \ #define MCFG_CARTSLOT_UNLOAD(_class,_unload) \
static_cast<cartslot_image_device *>(device)->set_device_unload(DEVICE_IMAGE_UNLOAD_NAME(_unload)); static_cast<cartslot_image_device *>(device)->set_device_unload( DEVICE_IMAGE_UNLOAD_DELEGATE(_class,_unload));
#define MCFG_CARTSLOT_PARTIALHASH(_partialhash) \ #define MCFG_CARTSLOT_PARTIALHASH(_partialhash) \
static_cast<cartslot_image_device *>(device)->set_partialhash(_partialhash); static_cast<cartslot_image_device *>(device)->set_partialhash(_partialhash);
#define MCFG_CARTSLOT_DISPLAY_INFO(_displayinfo) \ #define MCFG_CARTSLOT_DISPLAY_INFO(_class,_displayinfo) \
static_cast<cartslot_image_device *>(device)->set_displayinfo(DEVICE_IMAGE_DISPLAY_INFO_NAME(_displayinfo)); static_cast<cartslot_image_device *>(device)->set_displayinfo(&DEVICE_IMAGE_DISPLAY_INFO_NAME(_class,_displayinfo));
#endif /* __CARTSLOT_H__ */ #endif /* __CARTSLOT_H__ */

View File

@ -348,9 +348,6 @@ Notes:
#define M68K_CLOCK XTAL_50MHz #define M68K_CLOCK XTAL_50MHz
static QUICKLOAD_LOAD( jaguar ); static QUICKLOAD_LOAD( jaguar );
static DEVICE_START( jaguar_cart );
static DEVICE_IMAGE_LOAD( jaguar );
/************************************* /*************************************
@ -1644,8 +1641,8 @@ 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_cart) MCFG_CARTSLOT_START(jaguar_state,jaguar_cart)
MCFG_CARTSLOT_LOAD(jaguar) MCFG_CARTSLOT_LOAD(jaguar_state,jaguar_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","jaguar") MCFG_SOFTWARE_LIST_ADD("cart_list","jaguar")
@ -1770,9 +1767,9 @@ int jaguar_state::quickload(device_image_interface &image, const char *file_type
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_START( jaguar_cart ) DEVICE_IMAGE_START_MEMBER( jaguar_state, jaguar_cart )
{ {
device->machine().driver_data<jaguar_state>()->cart_start(); cart_start();
} }
void jaguar_state::cart_start() void jaguar_state::cart_start()
@ -1782,9 +1779,9 @@ void jaguar_state::cart_start()
memset( m_cart_base, 0, memshare("cart")->bytes() ); memset( m_cart_base, 0, memshare("cart")->bytes() );
} }
static DEVICE_IMAGE_LOAD( jaguar ) DEVICE_IMAGE_LOAD_MEMBER( jaguar_state, jaguar_cart )
{ {
return image.device().machine().driver_data<jaguar_state>()->cart_load(image); return cart_load(image);
} }
int jaguar_state::cart_load(device_image_interface &image) int jaguar_state::cart_load(device_image_interface &image)

View File

@ -566,7 +566,7 @@ static const struct megatech_cart_region megatech_cart_table[] =
{ 0 } { 0 }
}; };
static DEVICE_IMAGE_LOAD( megatech_cart ) DEVICE_IMAGE_LOAD_MEMBER( mtech_state, megatech_cart )
{ {
mtech_state *state = image.device().machine().driver_data<mtech_state>(); mtech_state *state = image.device().machine().driver_data<mtech_state>();
const struct megatech_cart_region *mt_cart = &megatech_cart_table[0], *this_cart; const struct megatech_cart_region *mt_cart = &megatech_cart_table[0], *this_cart;
@ -620,7 +620,7 @@ static DEVICE_IMAGE_LOAD( megatech_cart )
#define MCFG_MEGATECH_CARTSLOT_ADD(_tag) \ #define MCFG_MEGATECH_CARTSLOT_ADD(_tag) \
MCFG_CARTSLOT_ADD(_tag) \ MCFG_CARTSLOT_ADD(_tag) \
MCFG_CARTSLOT_INTERFACE("megatech_cart") \ MCFG_CARTSLOT_INTERFACE("megatech_cart") \
MCFG_CARTSLOT_LOAD(megatech_cart) MCFG_CARTSLOT_LOAD(mtech_state, megatech_cart)
MACHINE_CONFIG_FRAGMENT( megatech_cartslot ) MACHINE_CONFIG_FRAGMENT( megatech_cartslot )
MCFG_MEGATECH_CARTSLOT_ADD("cart1") MCFG_MEGATECH_CARTSLOT_ADD("cart1")

View File

@ -1316,7 +1316,7 @@ INPUT_PORTS_END
DEVICE_IMAGE_LOAD( neo_cartridge ) DEVICE_IMAGE_LOAD_MEMBER( neogeo_state, neo_cartridge )
{ {
UINT32 size; UINT32 size;
device_t* ym = image.device().machine().device("ymsnd"); device_t* ym = image.device().machine().device("ymsnd");
@ -1440,7 +1440,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mvs, neogeo ) static MACHINE_CONFIG_DERIVED( mvs, neogeo )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_LOAD(neo_cartridge) MCFG_CARTSLOT_LOAD(neogeo_state,neo_cartridge)
MCFG_CARTSLOT_INTERFACE("neo_cart") MCFG_CARTSLOT_INTERFACE("neo_cart")
MCFG_SOFTWARE_LIST_ADD("cart_list","neogeo") MCFG_SOFTWARE_LIST_ADD("cart_list","neogeo")

View File

@ -2161,7 +2161,7 @@ struct cdrom_interface saturn_cdrom =
static DEVICE_IMAGE_LOAD( sat_cart ) DEVICE_IMAGE_LOAD_MEMBER( saturn_state, sat_cart )
{ {
UINT8 *ROM = image.device().machine().root_device().memregion("maincpu")->base()+0x080000; UINT8 *ROM = image.device().machine().root_device().memregion("maincpu")->base()+0x080000;
UINT32 length; UINT32 length;
@ -2245,7 +2245,7 @@ MACHINE_CONFIG_DERIVED( saturnus, saturn )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_INTERFACE("sat_cart") MCFG_CARTSLOT_INTERFACE("sat_cart")
MCFG_CARTSLOT_LOAD(sat_cart) MCFG_CARTSLOT_LOAD(saturn_state, sat_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart") MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -2257,7 +2257,7 @@ MACHINE_CONFIG_DERIVED( saturneu, saturn )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_INTERFACE("sat_cart") MCFG_CARTSLOT_INTERFACE("sat_cart")
MCFG_CARTSLOT_LOAD(sat_cart) MCFG_CARTSLOT_LOAD(saturn_state, sat_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart") MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -2269,7 +2269,7 @@ MACHINE_CONFIG_DERIVED( saturnjp, saturn )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_INTERFACE("sat_cart") MCFG_CARTSLOT_INTERFACE("sat_cart")
MCFG_CARTSLOT_LOAD(sat_cart) MCFG_CARTSLOT_LOAD(saturn_state, sat_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart") MCFG_SOFTWARE_LIST_ADD("cart_list","sat_cart")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -2338,7 +2338,7 @@ static const struct stv_cart_region stv_cart_table[] =
{ 0 } { 0 }
}; };
static DEVICE_IMAGE_LOAD( stv_cart ) DEVICE_IMAGE_LOAD_MEMBER( saturn_state, stv_cart )
{ {
// saturn_state *state = image.device().machine().driver_data<saturn_state>(); // saturn_state *state = image.device().machine().driver_data<saturn_state>();
const struct stv_cart_region *stv_cart = &stv_cart_table[0], *this_cart; const struct stv_cart_region *stv_cart = &stv_cart_table[0], *this_cart;
@ -2391,7 +2391,7 @@ static DEVICE_IMAGE_LOAD( stv_cart )
#define MCFG_STV_CARTSLOT_ADD(_tag) \ #define MCFG_STV_CARTSLOT_ADD(_tag) \
MCFG_CARTSLOT_ADD(_tag) \ MCFG_CARTSLOT_ADD(_tag) \
MCFG_CARTSLOT_INTERFACE("stv_cart") \ MCFG_CARTSLOT_INTERFACE("stv_cart") \
MCFG_CARTSLOT_LOAD(stv_cart) MCFG_CARTSLOT_LOAD(saturn_state,stv_cart)
MACHINE_CONFIG_FRAGMENT( stv_cartslot ) MACHINE_CONFIG_FRAGMENT( stv_cartslot )
MCFG_STV_CARTSLOT_ADD("cart1") MCFG_STV_CARTSLOT_ADD("cart1")

View File

@ -124,7 +124,7 @@ static MACHINE_CONFIG_START( vectrex, vectrex_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,gam,vec") MCFG_CARTSLOT_EXTENSION_LIST("bin,gam,vec")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(vectrex_cart) MCFG_CARTSLOT_LOAD(vectrex_state,vectrex_cart)
MCFG_CARTSLOT_INTERFACE("vectrex_cart") MCFG_CARTSLOT_INTERFACE("vectrex_cart")
/* software lists */ /* software lists */

View File

@ -215,6 +215,8 @@ 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 );
protected: protected:
// timer IDs // timer IDs
enum enum

View File

@ -111,6 +111,8 @@ public:
DECLARE_WRITE8_MEMBER(megadriv_68k_YM2612_write); DECLARE_WRITE8_MEMBER(megadriv_68k_YM2612_write);
IRQ_CALLBACK_MEMBER(genesis_int_callback); IRQ_CALLBACK_MEMBER(genesis_int_callback);
void megadriv_init_common(); void megadriv_init_common();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( _32x_cart );
}; };
class md_boot_state : public md_base_state class md_boot_state : public md_base_state
@ -335,6 +337,8 @@ public:
int m_cart_is_genesis[8]; int m_cart_is_genesis[8];
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( megatech_cart );
/* Megatech BIOS specific */ /* Megatech BIOS specific */
UINT8* m_megatech_banked_ram; UINT8* m_megatech_banked_ram;
DECLARE_DRIVER_INIT(mt_crt); DECLARE_DRIVER_INIT(mt_crt);

View File

@ -231,6 +231,7 @@ public:
TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); TIMER_CALLBACK_MEMBER(vblank_interrupt_callback);
TIMER_CALLBACK_MEMBER(auto_animation_timer_callback); TIMER_CALLBACK_MEMBER(auto_animation_timer_callback);
TIMER_CALLBACK_MEMBER(sprite_line_timer_callback); TIMER_CALLBACK_MEMBER(sprite_line_timer_callback);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(neo_cartridge);
void neogeo_postload(); void neogeo_postload();
void regenerate_pens(); void regenerate_pens();
@ -254,7 +255,6 @@ void neogeo_set_display_counter_msb(address_space &space, UINT16 data);
void neogeo_set_display_counter_lsb(address_space &space, UINT16 data); void neogeo_set_display_counter_lsb(address_space &space, UINT16 data);
void neogeo_acknowledge_interrupt(running_machine &machine, UINT16 data); void neogeo_acknowledge_interrupt(running_machine &machine, UINT16 data);
void neogeo_set_main_cpu_bank_address(address_space &space, UINT32 bank_address); void neogeo_set_main_cpu_bank_address(address_space &space, UINT32 bank_address);
DEVICE_IMAGE_LOAD( neo_cartridge );
void neogeo_audio_cpu_banking_init( running_machine &machine ); void neogeo_audio_cpu_banking_init( running_machine &machine );
void neogeo_main_cpu_banking_init( running_machine &machine ); void neogeo_main_cpu_banking_init( running_machine &machine );
void neogeo_set_main_cpu_vector_table_source( running_machine &machine, UINT8 data ); void neogeo_set_main_cpu_vector_table_source( running_machine &machine, UINT8 data );

View File

@ -552,6 +552,10 @@ public:
TIMER_CALLBACK_MEMBER(snes_scanline_tick); TIMER_CALLBACK_MEMBER(snes_scanline_tick);
TIMER_CALLBACK_MEMBER(snes_hblank_tick); TIMER_CALLBACK_MEMBER(snes_hblank_tick);
DECLARE_WRITE_LINE_MEMBER(snes_extern_irq_w); DECLARE_WRITE_LINE_MEMBER(snes_extern_irq_w);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(snes_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(sufami_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(bsx_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(bsx2slot_cart);
}; };
/* Special chips, checked at init and used in memory handlers */ /* Special chips, checked at init and used in memory handlers */

View File

@ -247,6 +247,8 @@ public:
DECLARE_READ8_MEMBER( saturn_SMPC_r ); DECLARE_READ8_MEMBER( saturn_SMPC_r );
DECLARE_WRITE8_MEMBER( saturn_SMPC_w ); DECLARE_WRITE8_MEMBER( saturn_SMPC_w );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( sat_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( stv_cart );
}; };
#define MASTER_CLOCK_352 57272720 #define MASTER_CLOCK_352 57272720

View File

@ -84,12 +84,12 @@ public:
DECLARE_WRITE8_MEMBER(v_via_pa_w); DECLARE_WRITE8_MEMBER(v_via_pa_w);
DECLARE_WRITE8_MEMBER(v_via_ca2_w); DECLARE_WRITE8_MEMBER(v_via_ca2_w);
DECLARE_WRITE8_MEMBER(v_via_cb2_w); DECLARE_WRITE8_MEMBER(v_via_cb2_w);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( vectrex_cart );
}; };
/*----------- defined in machine/vectrex.c -----------*/ /*----------- defined in machine/vectrex.c -----------*/
DEVICE_IMAGE_LOAD( vectrex_cart );
void vectrex_configuration(running_machine &machine); void vectrex_configuration(running_machine &machine);
void vectrex_via_irq (device_t *device, int level); void vectrex_via_irq (device_t *device, int level);

View File

@ -1271,7 +1271,7 @@ MACHINE_CONFIG_END
// FIXME: non-softlist loading should keep using ROM_CART_LOAD in the ROM definitions, // FIXME: non-softlist loading should keep using ROM_CART_LOAD in the ROM definitions,
// once we better integrate softlist with the old loading procedures // once we better integrate softlist with the old loading procedures
static DEVICE_IMAGE_LOAD( _32x_cart ) DEVICE_IMAGE_LOAD_MEMBER( md_base_state, _32x_cart )
{ {
UINT32 length; UINT32 length;
UINT8 *temp_copy; UINT8 *temp_copy;
@ -1317,7 +1317,7 @@ MACHINE_CONFIG_FRAGMENT( _32x_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("32x,bin") MCFG_CARTSLOT_EXTENSION_LIST("32x,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("_32x_cart") MCFG_CARTSLOT_INTERFACE("_32x_cart")
MCFG_CARTSLOT_LOAD(_32x_cart) MCFG_CARTSLOT_LOAD(md_base_state, _32x_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","32x") MCFG_SOFTWARE_LIST_ADD("cart_list","32x")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -64,7 +64,7 @@ static int vectrex_verify_cart(char *data)
*********************************************************************/ *********************************************************************/
DEVICE_IMAGE_LOAD(vectrex_cart) DEVICE_IMAGE_LOAD_MEMBER(vectrex_state,vectrex_cart)
{ {
vectrex_state *state = image.device().machine().driver_data<vectrex_state>(); vectrex_state *state = image.device().machine().driver_data<vectrex_state>();
UINT8 *mem = state->memregion("maincpu")->base(); UINT8 *mem = state->memregion("maincpu")->base();

View File

@ -128,6 +128,8 @@ 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 );
protected: protected:
required_device<vcs_control_port_device> m_joy1; required_device<vcs_control_port_device> m_joy1;
@ -542,25 +544,22 @@ static int detect_super_chip(running_machine &machine)
} }
static DEVICE_START( a2600_cart ) DEVICE_IMAGE_START_MEMBER( a2600_state, a2600_cart )
{ {
a2600_state *state = device->machine().driver_data<a2600_state>(); m_banking_mode = 0xff;
state->m_banking_mode = 0xff;
} }
static DEVICE_IMAGE_LOAD( a2600_cart ) DEVICE_IMAGE_LOAD_MEMBER( a2600_state, a2600_cart )
{ {
a2600_state *state = image.device().machine().driver_data<a2600_state>(); UINT8 *cart = memregion("user1")->base();
running_machine &machine = image.device().machine();
UINT8 *cart = CART;
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
state->m_cart_size = image.length(); m_cart_size = image.length();
else else
state->m_cart_size = image.get_software_region_length("rom"); m_cart_size = image.get_software_region_length("rom");
switch (state->m_cart_size) switch (m_cart_size)
{ {
case 0x00800: case 0x00800:
case 0x01000: case 0x01000:
@ -579,15 +578,15 @@ static DEVICE_IMAGE_LOAD( a2600_cart )
return 1; /* unsupported image format */ return 1; /* unsupported image format */
} }
state->m_current_bank = 0; m_current_bank = 0;
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
{ {
image.fread(cart, state->m_cart_size); image.fread(cart, m_cart_size);
} }
else else
{ {
memcpy(cart, image.get_software_region("rom"), state->m_cart_size); memcpy(cart, image.get_software_region("rom"), m_cart_size);
const char *mapper = software_part_get_feature((software_part*)image.part_entry(), "mapper"); const char *mapper = software_part_get_feature((software_part*)image.part_entry(), "mapper");
@ -616,21 +615,21 @@ static DEVICE_IMAGE_LOAD( a2600_cart )
{ "8in1", mode8in1 }, { "8in1", mode8in1 },
}; };
for (int i = 0; i < ARRAY_LENGTH(mapper_types) && state->m_banking_mode == 0xff; i++) for (int i = 0; i < ARRAY_LENGTH(mapper_types) && m_banking_mode == 0xff; i++)
{ {
if (!mame_stricmp(mapper, mapper_types[i].mapper_name)) if (!mame_stricmp(mapper, mapper_types[i].mapper_name))
{ {
state->m_banking_mode = mapper_types[i].mapper_type; m_banking_mode = mapper_types[i].mapper_type;
} }
} }
} }
} }
if (!(state->m_cart_size == 0x4000 && detect_modef6(image.device().machine()))) if (!(m_cart_size == 0x4000 && detect_modef6(machine())))
{ {
while (state->m_cart_size > 0x00800) while (m_cart_size > 0x00800)
{ {
if (!memcmp(cart, &cart[state->m_cart_size/2],state->m_cart_size/2)) state->m_cart_size /= 2; if (!memcmp(cart, &cart[m_cart_size/2],m_cart_size/2)) m_cart_size /= 2;
else break; else break;
} }
} }
@ -1922,8 +1921,8 @@ 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_cart) MCFG_CARTSLOT_START(a2600_state,a2600_cart)
MCFG_CARTSLOT_LOAD(a2600_cart) MCFG_CARTSLOT_LOAD(a2600_state,a2600_cart)
MCFG_CARTSLOT_INTERFACE("a2600_cart") MCFG_CARTSLOT_INTERFACE("a2600_cart")
/* software lists */ /* software lists */

View File

@ -302,8 +302,8 @@ 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_cart) MCFG_CARTSLOT_START(a7800_state,a7800_cart)
MCFG_CARTSLOT_LOAD(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

@ -828,7 +828,7 @@ static MACHINE_CONFIG_FRAGMENT( cpcplus_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("cpr,bin") MCFG_CARTSLOT_EXTENSION_LIST("cpr,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("gx4000_cart") MCFG_CARTSLOT_INTERFACE("gx4000_cart")
MCFG_CARTSLOT_LOAD(amstrad_plus_cartridge) MCFG_CARTSLOT_LOAD(amstrad_state,amstrad_plus_cartridge)
MCFG_SOFTWARE_LIST_ADD("cart_list","gx4000") MCFG_SOFTWARE_LIST_ADD("cart_list","gx4000")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -451,7 +451,7 @@ void arcadia_state::palette_init()
colortable_entry_set_value(machine().colortable, i, arcadia_palette[i]); colortable_entry_set_value(machine().colortable, i, arcadia_palette[i]);
} }
static DEVICE_IMAGE_LOAD( arcadia_cart ) DEVICE_IMAGE_LOAD_MEMBER( arcadia_state, arcadia_cart )
{ {
UINT8 *rom = image.device().machine().root_device().memregion("maincpu")->base(); UINT8 *rom = image.device().machine().root_device().memregion("maincpu")->base();
int size; int size;
@ -555,7 +555,7 @@ static MACHINE_CONFIG_START( arcadia, arcadia_state )
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("arcadia_cart") MCFG_CARTSLOT_INTERFACE("arcadia_cart")
MCFG_CARTSLOT_LOAD(arcadia_cart) MCFG_CARTSLOT_LOAD(arcadia_state,arcadia_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","arcadia") MCFG_SOFTWARE_LIST_ADD("cart_list","arcadia")

View File

@ -39,6 +39,8 @@
#include "video/gtia.h" #include "video/gtia.h"
#include "sound/dac.h" #include "sound/dac.h"
#include "machine/ram.h" #include "machine/ram.h"
#include "hashfile.h"
/****************************************************************************** /******************************************************************************
Atari 800 memory map (preliminary) Atari 800 memory map (preliminary)
@ -229,11 +231,30 @@
E000-FFFF ROM BIOS ROM E000-FFFF ROM BIOS ROM
******************************************************************************/ ******************************************************************************/
#define LEFT_CARTSLOT_MOUNTED 1
#define RIGHT_CARTSLOT_MOUNTED 2
/* PCB */
enum
{
A800_UNKNOWN = 0,
A800_4K, A800_8K, A800_12K, A800_16K,
A800_RIGHT_4K, A800_RIGHT_8K,
OSS_034M, OSS_M091, PHOENIX_8K, XEGS_32K,
BBSB, DIAMOND_64K, WILLIAMS_64K, EXPRESS_64,
SPARTADOS_X
};
class a400_state : public driver_device class a400_state : public driver_device
{ {
public: public:
a400_state(const machine_config &mconfig, device_type type, const char *tag) a400_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag)
, m_a800_cart_loaded(0)
, m_atari(0)
, m_a800_cart_type(A800_UNKNOWN)
{ }
DECLARE_DRIVER_INIT(xegs); DECLARE_DRIVER_INIT(xegs);
DECLARE_DRIVER_INIT(a800xl); DECLARE_DRIVER_INIT(a800xl);
@ -242,6 +263,29 @@ public:
DECLARE_WRITE8_MEMBER(a1200xl_pia_pb_w); DECLARE_WRITE8_MEMBER(a1200xl_pia_pb_w);
DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w); DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w);
DECLARE_WRITE8_MEMBER(xegs_pia_pb_w); DECLARE_WRITE8_MEMBER(xegs_pia_pb_w);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a800_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( a800_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a800_cart_right );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( a800_cart_right );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( a5200_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( a5200_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( xegs_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( xegs_cart );
void ms_atari_machine_start(int type, int has_cart);
void ms_atari800xl_machine_start(int type, int has_cart);
protected:
int m_a800_cart_loaded;
int m_atari;
int m_a800_cart_type;
void a800_setbank(int cart_mounted);
}; };
/************************************************************** /**************************************************************
@ -902,6 +946,656 @@ static void xegs_mmu(running_machine &machine, UINT8 new_mmu)
machine.root_device().membank("bank2")->set_base(base2); machine.root_device().membank("bank2")->set_base(base2);
} }
// Currently, the drivers have fixed 40k RAM, however the function here is ready for different sizes too
void a400_state::a800_setbank(int cart_mounted)
{
offs_t ram_top;
// take care of 0x0000-0x7fff: RAM or NOP
ram_top = MIN(machine().device<ram_device>(RAM_TAG)->size(), 0x8000) - 1;
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, ram_top, "0000");
machine().root_device().membank("0000")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
// take care of 0x8000-0x9fff: A800 -> either right slot or RAM or NOP, others -> RAM or NOP
// is there anything in the right slot?
if (cart_mounted & RIGHT_CARTSLOT_MOUNTED)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000");
machine().root_device().membank("8000")->set_base(machine().root_device().memregion("rslot")->base());
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff);
}
else if (m_a800_cart_type != BBSB)
{
ram_top = MIN(machine().device<ram_device>(RAM_TAG)->size(), 0xa000) - 1;
if (ram_top > 0x8000)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_bank(0x8000, ram_top, "8000");
machine().root_device().membank("8000")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x8000);
}
}
// take care of 0xa000-0xbfff: is there anything in the left slot?
if (cart_mounted & LEFT_CARTSLOT_MOUNTED)
{
// FIXME: this is an hack to keep XL working until we clean up its memory map as well!
if (m_atari == ATARI_800XL)
{
if (m_a800_cart_type == A800_16K)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x9fff, "8000");
machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base());
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0x9fff);
memcpy(machine().root_device().memregion("maincpu")->base() + 0x10000, machine().root_device().memregion("lslot")->base() + 0x2000, 0x2000);
}
else if (m_a800_cart_type == A800_8K)
memcpy(machine().root_device().memregion("maincpu")->base() + 0x10000, machine().root_device().memregion("lslot")->base(), 0x2000);
else
fatalerror("This type of cart is not supported yet in this driver. Please use a400 or a800.\n");
}
else if (m_a800_cart_type == A800_16K)
{
machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base());
machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base() + 0x2000);
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
}
else if (m_a800_cart_type == BBSB)
{
// this requires separate banking in 0x8000 & 0x9000!
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x8000, 0x8fff, "8000");
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x9000, 0x9fff, "9000");
machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base() + 0x0000);
machine().root_device().membank("9000")->set_base(machine().root_device().memregion("lslot")->base() + 0x4000);
machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base() + 0x8000);
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
}
else if (m_a800_cart_type == OSS_034M)
{
// this requires separate banking in 0xa000 & 0xb000!
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000");
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000");
machine().root_device().membank("b000")->set_base(machine().root_device().memregion("lslot")->base() + 0x3000);
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
}
else if (m_a800_cart_type == OSS_M091)
{
// this requires separate banking in 0xa000 & 0xb000!
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xa000, 0xafff, "a000");
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xb000, 0xbfff, "b000");
machine().root_device().membank("b000")->set_base(machine().root_device().memregion("lslot")->base());
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
}
else if (m_a800_cart_type == XEGS_32K)
{
machine().root_device().membank("8000")->set_base(machine().root_device().memregion("lslot")->base());
machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base() + 0x6000);
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x8000, 0xbfff);
}
else
{
machine().root_device().membank("a000")->set_base(machine().root_device().memregion("lslot")->base());
machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0xa000, 0xbfff);
}
}
}
/* MESS specific parts that have to be started */
void a400_state::ms_atari_machine_start(int type, int has_cart)
{
/* set atari type (temporarily not used) */
m_atari = type;
a800_setbank(m_a800_cart_loaded);
}
void a400_state::ms_atari800xl_machine_start(int type, int has_cart)
{
/* set atari type (temporarily not used) */
m_atari = type;
a800_setbank(m_a800_cart_loaded);
}
struct a800_pcb
{
const char *pcb_name;
int pcb_id;
};
// Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it
// WARNING: most of these are still unsupported by the driver
static const a800_pcb pcb_list[] =
{
{"standard 4k", A800_8K},
{"standard 8k", A800_8K},
{"standard 12k", A800_16K},
{"standard 16k", A800_16K},
{"right slot 4k", A800_RIGHT_4K},
{"right slot 8k", A800_RIGHT_8K},
{"oss 034m", OSS_034M},
{"oss m091", OSS_M091},
{"phoenix 8k", PHOENIX_8K},
{"xegs 32k", XEGS_32K},
{"bbsb", BBSB},
{"diamond 64k", DIAMOND_64K},
{"williams 64k", WILLIAMS_64K},
{"express 64", EXPRESS_64},
{"spartados x", SPARTADOS_X},
{"N/A", A800_UNKNOWN}
};
static int a800_get_pcb_id(const char *pcb)
{
int i;
for (i = 0; i < ARRAY_LENGTH(pcb_list); i++)
{
if (!mame_stricmp(pcb_list[i].pcb_name, pcb))
return pcb_list[i].pcb_id;
}
return A800_UNKNOWN;
}
static WRITE8_HANDLER( x32_bank_w )
{
// printf("written %x\n", data);
int bank = data & 0x03;
space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + bank * 0x2000);
}
static WRITE8_HANDLER( w64_bank_w )
{
// printf("write to %x\n", offset);
if (offset < 8)
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + offset * 0x2000);
else
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base());
// FIXME: writes to 0x8-0xf should disable the cart
}
// this covers Express 64, Diamond 64 and SpartaDOS (same bankswitch, but at different addresses)
static WRITE8_HANDLER( ex64_bank_w )
{
// printf("write to %x\n", offset);
if (offset < 8)
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + (7 - offset) * 0x2000);
else
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base());
// FIXME: writes to 0x8-0xf should disable the cart
}
static WRITE8_HANDLER( bbsb_bankl_w )
{
// printf("write to %x\n", 0x8000 + offset);
if (offset >= 0xff6 && offset <= 0xff9)
space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x0000 + (offset - 0xff6) * 0x1000);
}
static WRITE8_HANDLER( bbsb_bankh_w )
{
// printf("write to %x\n", 0x9000 + offset);
if (offset >= 0xff6 && offset <= 0xff9)
space.machine().root_device().membank("9000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000 + (offset - 0xff6) * 0x1000);
}
static WRITE8_HANDLER( oss_034m_w )
{
switch (offset & 0x0f)
{
case 0:
case 1:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base());
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 2:
case 6:
// docs says this should put 0xff in the 0xa000 bank -> let's point to the end of the cart
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 3:
case 7:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 4:
case 5:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
default:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000);
break;
}
}
static WRITE8_HANDLER( oss_m091_w )
{
switch (offset & 0x09)
{
case 0:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
case 1:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
case 8:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000);
break;
case 9:
space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000);
space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
}
}
static UINT8 xegs_banks = 0;
static UINT8 xegs_cart = 0;
static WRITE8_HANDLER( xegs_bankswitch )
{
UINT8 *cart = space.machine().root_device().memregion("user1")->base();
data &= xegs_banks - 1;
space.machine().root_device().membank("bank0")->set_base(cart + data * 0x2000);
}
MACHINE_START( xegs )
{
address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *cart = space.machine().root_device().memregion("user1")->base();
UINT8 *cpu = space.machine().root_device().memregion("maincpu")->base();
atari_machine_start(machine);
space.install_legacy_write_handler(0xd500, 0xd5ff, FUNC(xegs_bankswitch));
if (xegs_cart)
{
machine.root_device().membank("bank0")->set_base(cart);
machine.root_device().membank("bank1")->set_base(cart + (xegs_banks - 1) * 0x2000);
}
else
{
// point to built-in Missile Command (this does not work well, though... FIXME!!)
machine.root_device().membank("bank0")->set_base(cpu + 0x10000);
machine.root_device().membank("bank1")->set_base(cpu + 0x10000);
}
}
// currently this does nothing, but it will eventually install the memory handlers required by the mappers
static void a800_setup_mappers(running_machine &machine, int type)
{
switch (type)
{
case A800_4K:
case A800_RIGHT_4K:
case A800_12K:
case A800_8K:
case A800_16K:
case A800_RIGHT_8K:
case PHOENIX_8K: // as normal 8k cart, but it can be disabled by writing to 0xd500-0xdfff
break;
case XEGS_32K:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(x32_bank_w));
break;
case OSS_034M:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_034m_w));
break;
case OSS_M091:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd5ff, FUNC(oss_m091_w));
break;
case BBSB:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x8000, 0x8fff, FUNC(bbsb_bankl_w));
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x9000, 0x9fff, FUNC(bbsb_bankh_w));
break;
case WILLIAMS_64K:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd500, 0xd50f, FUNC(w64_bank_w));
break;
case DIAMOND_64K:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5d0, 0xd5df, FUNC(ex64_bank_w));
break;
case EXPRESS_64:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd570, 0xd57f, FUNC(ex64_bank_w));
break;
case SPARTADOS_X:
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0xd5e0, 0xd5ef, FUNC(ex64_bank_w));
break;
default:
break;
}
}
static int a800_get_type(device_image_interface &image)
{
UINT8 header[16];
image.fread(header, 0x10);
int hdr_type, cart_type = A800_UNKNOWN;
// add check of CART format
if (strncmp((const char *)header, "CART", 4))
fatalerror("Invalid header detected!\n");
hdr_type = (header[4] << 24) + (header[5] << 16) + (header[6] << 8) + (header[7] << 0);
switch (hdr_type)
{
case 1:
cart_type = A800_8K;
break;
case 2:
cart_type = A800_16K;
break;
case 3:
cart_type = OSS_034M;
break;
case 8:
cart_type = WILLIAMS_64K;
break;
case 9:
cart_type = DIAMOND_64K;
break;
case 10:
cart_type = EXPRESS_64;
break;
case 11:
cart_type = SPARTADOS_X;
break;
case 12:
cart_type = XEGS_32K;
break;
case 15:
cart_type = OSS_M091;
break;
case 18:
cart_type = BBSB;
break;
case 21:
cart_type = A800_RIGHT_8K;
break;
case 39:
cart_type = PHOENIX_8K;
break;
case 4:
case 6:
case 7:
case 16:
case 19:
case 20:
fatalerror("Cart type \"%d\" means this is an Atari 5200 cart.\n", hdr_type);
break;
default:
mame_printf_info("Cart type \"%d\" is currently unsupported.\n", hdr_type);
break;
}
return cart_type;
}
static int a800_check_cart_type(device_image_interface &image)
{
const char *pcb_name;
int type = A800_UNKNOWN;
if (image.software_entry() == NULL)
{
UINT32 size = image.length();
// check if there is an header, if so extract cart_type from it, otherwise
// try to guess the cart_type from the file size (notice that after the
// a800_get_type call, we point at the start of the data)
if ((size % 0x1000) == 0x10)
type = a800_get_type(image);
else if (size == 0x4000)
type = A800_16K;
else if (size == 0x2000)
{
if (strcmp(image.device().tag(),":cart2") == 0)
type = A800_RIGHT_8K;
else
type = A800_8K;
}
}
else
{
if ((pcb_name = image.get_feature("cart_type")) != NULL)
type = a800_get_pcb_id(pcb_name);
switch (type)
{
case A800_UNKNOWN:
case A800_4K:
case A800_RIGHT_4K:
case A800_12K:
case A800_8K:
case A800_16K:
case A800_RIGHT_8K:
break;
default:
mame_printf_info("Cart type \"%s\" currently unsupported.\n", pcb_name);
break;
}
}
if ((strcmp(image.device().tag(),":cart2") == 0) && (type != A800_RIGHT_8K))
fatalerror("You cannot load this image '%s' in the right slot\n", image.filename());
return type;
}
DEVICE_IMAGE_LOAD_MEMBER( a400_state, a800_cart )
{
UINT32 size, start = 0;
m_a800_cart_loaded = m_a800_cart_loaded & ~LEFT_CARTSLOT_MOUNTED;
m_a800_cart_type = a800_check_cart_type(image);
a800_setup_mappers(image.device().machine(), m_a800_cart_type);
if (image.software_entry() == NULL)
{
size = image.length();
// if there is an header, skip it
if ((size % 0x1000) == 0x10)
{
size -= 0x10;
start = 0x10;
}
image.fread(image.device().machine().root_device().memregion("lslot")->base(), size - start);
}
else
{
size = image.get_software_region_length("rom");
memcpy(image.device().machine().root_device().memregion("lslot")->base(), image.get_software_region("rom"), size);
}
m_a800_cart_loaded |= (size > 0x0000) ? 1 : 0;
logerror("%s loaded left cartridge '%s' size %dK\n", image.device().machine().system().name, image.filename(), size/1024);
return IMAGE_INIT_PASS;
}
DEVICE_IMAGE_LOAD_MEMBER( a400_state, a800_cart_right )
{
UINT32 size, start = 0;
m_a800_cart_loaded = m_a800_cart_loaded & ~RIGHT_CARTSLOT_MOUNTED;
m_a800_cart_type = a800_check_cart_type(image);
a800_setup_mappers(image.device().machine(), m_a800_cart_type);
if (image.software_entry() == NULL)
{
size = image.length();
// if there is an header, skip it
if ((size % 0x1000) == 0x10)
{
size -= 0x10;
start = 0x10;
}
image.fread(image.device().machine().root_device().memregion("rslot")->base(), size - start);
}
else
{
size = image.get_software_region_length("rom");
memcpy(image.device().machine().root_device().memregion("rslot")->base(), image.get_software_region("rom"), size);
}
m_a800_cart_loaded |= (size > 0x0000) ? 2 : 0;
logerror("%s loaded right cartridge '%s' size 8K\n", image.device().machine().system().name, image.filename());
return IMAGE_INIT_PASS;
}
DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, a800_cart )
{
m_a800_cart_loaded = m_a800_cart_loaded & ~LEFT_CARTSLOT_MOUNTED;
m_a800_cart_type = A800_UNKNOWN;
a800_setbank(m_a800_cart_loaded);
}
DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, a800_cart_right )
{
m_a800_cart_loaded = m_a800_cart_loaded & ~RIGHT_CARTSLOT_MOUNTED;
m_a800_cart_type = A800_UNKNOWN;
a800_setbank(m_a800_cart_loaded);
}
DEVICE_IMAGE_LOAD_MEMBER( a400_state, a5200_cart )
{
UINT8 *mem = image.device().machine().root_device().memregion("maincpu")->base();
UINT32 size;
bool A13_mirr = FALSE;
if (image.software_entry() == NULL)
{
/* load an optional (dual) cartidge */
size = image.fread(&mem[0x4000], 0x8000);
const char *info = hashfile_extrainfo(image);
if (info && !strcmp(info, "A13MIRRORING"))
A13_mirr = TRUE;
}
else
{
size = image.get_software_region_length("rom");
memcpy(mem + 0x4000, image.get_software_region("rom"), size);
const char *pcb_name = image.get_feature("cart_type");
if (pcb_name && !strcmp(pcb_name, "A13MIRRORING"))
A13_mirr = TRUE;
}
if (size<0x8000) memmove(mem+0x4000+0x8000-size, mem+0x4000, size);
// mirroring of smaller cartridges
if (size <= 0x1000) memcpy(mem+0xa000, mem+0xb000, 0x1000);
if (size <= 0x2000) memcpy(mem+0x8000, mem+0xa000, 0x2000);
if (size <= 0x4000)
{
memcpy(&mem[0x4000], &mem[0x8000], 0x4000);
if (A13_mirr)
{
memcpy(&mem[0x8000], &mem[0xa000], 0x2000);
memcpy(&mem[0x6000], &mem[0x4000], 0x2000);
}
}
logerror("A5200 loaded cartridge '%s' size %dK\n", image.filename() , size/1024);
return IMAGE_INIT_PASS;
}
DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, a5200_cart )
{
UINT8 *mem = image.device().machine().root_device().memregion("maincpu")->base();
/* zap the cartridge memory (again) */
memset(&mem[0x4000], 0x00, 0x8000);
}
DEVICE_IMAGE_LOAD_MEMBER( a400_state, xegs_cart )
{
UINT32 size;
UINT8 *ptr = image.device().machine().root_device().memregion("user1")->base();
if (image.software_entry() == NULL)
{
// skip the header
image.fseek(0x10, SEEK_SET);
size = image.length() - 0x10;
if (image.fread(ptr, size) != size)
return IMAGE_INIT_FAIL;
}
else
{
size = image.get_software_region_length("rom");
memcpy(ptr, image.get_software_region("rom"), size);
}
xegs_banks = size / 0x2000;
xegs_cart = 1;
return IMAGE_INIT_PASS;
}
DEVICE_IMAGE_UNLOAD_MEMBER( a400_state, xegs_cart )
{
xegs_cart = 0;
xegs_banks = 0;
}
MACHINE_START( a400 )
{
a400_state *state = machine.driver_data<a400_state>();
atari_machine_start(machine);
state->ms_atari_machine_start(ATARI_400, TRUE);
}
MACHINE_START( a800 )
{
a400_state *state = machine.driver_data<a400_state>();
atari_machine_start(machine);
state->ms_atari_machine_start(ATARI_800, TRUE);
}
MACHINE_START( a800xl )
{
a400_state *state = machine.driver_data<a400_state>();
atari_machine_start(machine);
state->ms_atari800xl_machine_start(ATARI_800XL, TRUE);
}
MACHINE_START( a5200 )
{
a400_state *state = machine.driver_data<a400_state>();
atari_machine_start(machine);
state->ms_atari_machine_start(ATARI_800XL, TRUE);
}
/************************************************************** /**************************************************************
* *
* PIA interface * PIA interface
@ -1066,8 +1760,8 @@ static MACHINE_CONFIG_FRAGMENT( a400_cartslot )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(a800_cart) MCFG_CARTSLOT_LOAD(a400_state,a800_cart)
MCFG_CARTSLOT_UNLOAD(a800_cart) MCFG_CARTSLOT_UNLOAD(a400_state,a800_cart)
MCFG_CARTSLOT_INTERFACE("a800_cart") MCFG_CARTSLOT_INTERFACE("a800_cart")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1075,15 +1769,15 @@ static MACHINE_CONFIG_FRAGMENT( a800_cartslot )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(a800_cart) MCFG_CARTSLOT_LOAD(a400_state,a800_cart)
MCFG_CARTSLOT_UNLOAD(a800_cart) MCFG_CARTSLOT_UNLOAD(a400_state,a800_cart)
MCFG_CARTSLOT_INTERFACE("a800_cart") MCFG_CARTSLOT_INTERFACE("a800_cart")
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(a800_cart_right) MCFG_CARTSLOT_LOAD(a400_state,a800_cart_right)
MCFG_CARTSLOT_UNLOAD(a800_cart_right) MCFG_CARTSLOT_UNLOAD(a400_state,a800_cart_right)
MCFG_CARTSLOT_INTERFACE("a800_cart") MCFG_CARTSLOT_INTERFACE("a800_cart")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1279,8 +1973,8 @@ static MACHINE_CONFIG_DERIVED( xegs, a800xl )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(xegs_cart) MCFG_CARTSLOT_LOAD(a400_state,xegs_cart)
MCFG_CARTSLOT_UNLOAD(xegs_cart) MCFG_CARTSLOT_UNLOAD(a400_state,xegs_cart)
MCFG_CARTSLOT_INTERFACE("xegs_cart") MCFG_CARTSLOT_INTERFACE("xegs_cart")
/* software lists */ /* software lists */
@ -1313,8 +2007,8 @@ static MACHINE_CONFIG_DERIVED( a5200, atari_common_nodac )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a52") MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a52")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(a5200_cart) MCFG_CARTSLOT_LOAD(a400_state,a5200_cart)
MCFG_CARTSLOT_UNLOAD(a5200_cart) MCFG_CARTSLOT_UNLOAD(a400_state,a5200_cart)
MCFG_CARTSLOT_INTERFACE("a5200_cart") MCFG_CARTSLOT_INTERFACE("a5200_cart")
/* Software lists */ /* Software lists */

View File

@ -700,7 +700,7 @@ static const struct atom_cart_range atom_cart_table[] =
{ 0 } { 0 }
}; };
static DEVICE_IMAGE_LOAD( atom_cart ) DEVICE_IMAGE_LOAD_MEMBER( atom_state, atom_cart )
{ {
UINT32 size; UINT32 size;
UINT8 *temp_copy; UINT8 *temp_copy;
@ -772,7 +772,7 @@ static DEVICE_IMAGE_LOAD( atom_cart )
MCFG_CARTSLOT_ADD(_tag) \ MCFG_CARTSLOT_ADD(_tag) \
MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") \ MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") \
MCFG_CARTSLOT_INTERFACE("atom_cart") \ MCFG_CARTSLOT_INTERFACE("atom_cart") \
MCFG_CARTSLOT_LOAD(atom_cart) MCFG_CARTSLOT_LOAD(atom_state, atom_cart)
static MACHINE_CONFIG_START( atom, atom_state ) static MACHINE_CONFIG_START( atom, atom_state )

View File

@ -820,22 +820,22 @@ static MACHINE_CONFIG_FRAGMENT( bbc_cartslot )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(bbcb_cart) MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart)
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(bbcb_cart) MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart)
MCFG_CARTSLOT_ADD("cart3") MCFG_CARTSLOT_ADD("cart3")
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(bbcb_cart) MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart)
MCFG_CARTSLOT_ADD("cart4") MCFG_CARTSLOT_ADD("cart4")
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(bbcb_cart) MCFG_CARTSLOT_LOAD(bbc_state, bbcb_cart)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( bbca, bbc_state ) static MACHINE_CONFIG_START( bbca, bbc_state )

View File

@ -29,6 +29,9 @@ public:
virtual void machine_start(); virtual void machine_start();
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 );
}; };
@ -130,17 +133,17 @@ static const z80_daisy_config bbcbc_daisy_chain[] =
}; };
static DEVICE_START( bbcbc_cart ) DEVICE_IMAGE_START_MEMBER( bbcbc_state, bbcbc_cart )
{ {
UINT8 *cart = device->machine().root_device().memregion("maincpu" )->base() + 0x4000; UINT8 *cart = machine().root_device().memregion("maincpu" )->base() + 0x4000;
memset( cart, 0xFF, 0x8000 ); memset( cart, 0xFF, 0x8000 );
} }
static DEVICE_IMAGE_LOAD( bbcbc_cart ) DEVICE_IMAGE_LOAD_MEMBER( bbcbc_state, bbcbc_cart )
{ {
UINT8 *cart = image.device().machine().root_device().memregion("maincpu" )->base() + 0x4000; UINT8 *cart = machine().root_device().memregion("maincpu" )->base() + 0x4000;
if ( image.software_entry() == NULL ) if ( image.software_entry() == NULL )
{ {
@ -187,8 +190,8 @@ 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_cart ) MCFG_CARTSLOT_START( bbcbc_state, bbcbc_cart )
MCFG_CARTSLOT_LOAD( bbcbc_cart ) MCFG_CARTSLOT_LOAD( bbcbc_state, bbcbc_cart )
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","bbcbc") MCFG_SOFTWARE_LIST_ADD("cart_list","bbcbc")

View File

@ -224,11 +224,9 @@ static const riot6532_interface beta_riot_interface =
/* Quickload */ /* Quickload */
static DEVICE_IMAGE_UNLOAD( beta_eprom ) DEVICE_IMAGE_UNLOAD_MEMBER( beta_state, beta_eprom )
{ {
beta_state *state = image.device().machine().driver_data<beta_state>(); UINT8 *ptr = m_eprom->base();
UINT8 *ptr = state->m_eprom->base();
image.fwrite(ptr, 0x800); image.fwrite(ptr, 0x800);
} }
@ -271,7 +269,7 @@ static MACHINE_CONFIG_START( beta, beta_state )
MCFG_CARTSLOT_ADD(EPROM_TAG) MCFG_CARTSLOT_ADD(EPROM_TAG)
MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_UNLOAD(beta_eprom) MCFG_CARTSLOT_UNLOAD(beta_state,beta_eprom)
/* internal ram */ /* internal ram */
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)

View File

@ -216,7 +216,7 @@ INPUT_PORTS_END
static DEVICE_IMAGE_LOAD( channelf_cart ) DEVICE_IMAGE_LOAD_MEMBER( channelf_state, channelf_cart )
{ {
UINT32 size; UINT32 size;
@ -251,7 +251,7 @@ static MACHINE_CONFIG_FRAGMENT( channelf_cart )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,chf") MCFG_CARTSLOT_EXTENSION_LIST("bin,chf")
MCFG_CARTSLOT_INTERFACE("channelf_cart") MCFG_CARTSLOT_INTERFACE("channelf_cart")
MCFG_CARTSLOT_LOAD(channelf_cart) MCFG_CARTSLOT_LOAD(channelf_state,channelf_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","channelf") MCFG_SOFTWARE_LIST_ADD("cart_list","channelf")

View File

@ -286,7 +286,7 @@ void coleco_state::machine_reset()
// return retval; // return retval;
//} //}
static DEVICE_IMAGE_LOAD( czz50_cart ) DEVICE_IMAGE_LOAD_MEMBER( coleco_state,czz50_cart )
{ {
UINT8 *ptr = image.device().machine().root_device().memregion(Z80_TAG)->base() + 0x8000; UINT8 *ptr = image.device().machine().root_device().memregion(Z80_TAG)->base() + 0x8000;
UINT32 size; UINT32 size;
@ -357,7 +357,7 @@ static MACHINE_CONFIG_START( czz50, coleco_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("rom,col,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,col,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(czz50_cart) MCFG_CARTSLOT_LOAD(coleco_state,czz50_cart)
MCFG_CARTSLOT_INTERFACE("coleco_cart") MCFG_CARTSLOT_INTERFACE("coleco_cart")
/* software lists */ /* software lists */

View File

@ -829,7 +829,7 @@ void laser2001_state::machine_start()
CARTRIDGE CARTRIDGE
***************************************************************************/ ***************************************************************************/
static DEVICE_IMAGE_LOAD( crvision_cart ) DEVICE_IMAGE_LOAD_MEMBER( crvision_state, crvision_cart )
{ {
UINT32 size; UINT32 size;
UINT8 *temp_copy; UINT8 *temp_copy;
@ -971,7 +971,7 @@ static MACHINE_CONFIG_START( creativision, crvision_state )
MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("crvision_cart") MCFG_CARTSLOT_INTERFACE("crvision_cart")
MCFG_CARTSLOT_LOAD(crvision_cart) MCFG_CARTSLOT_LOAD(crvision_state, crvision_cart)
// internal ram // internal ram
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)
@ -1036,7 +1036,7 @@ static MACHINE_CONFIG_START( lasr2001, laser2001_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
MCFG_CARTSLOT_INTERFACE("crvision_cart") MCFG_CARTSLOT_INTERFACE("crvision_cart")
MCFG_CARTSLOT_LOAD(crvision_cart) MCFG_CARTSLOT_LOAD(crvision_state, crvision_cart)
// internal ram // internal ram
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)

View File

@ -127,12 +127,12 @@ static MACHINE_CONFIG_START( gamecom, gamecom_state )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("bin,tgc") MCFG_CARTSLOT_EXTENSION_LIST("bin,tgc")
MCFG_CARTSLOT_INTERFACE("gamecom_cart") MCFG_CARTSLOT_INTERFACE("gamecom_cart")
MCFG_CARTSLOT_LOAD(gamecom_cart1) MCFG_CARTSLOT_LOAD(gamecom_state,gamecom_cart1)
MCFG_SOFTWARE_LIST_ADD("cart_list","gamecom") MCFG_SOFTWARE_LIST_ADD("cart_list","gamecom")
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_EXTENSION_LIST("bin,tgc") MCFG_CARTSLOT_EXTENSION_LIST("bin,tgc")
MCFG_CARTSLOT_INTERFACE("gamecom_cart") MCFG_CARTSLOT_INTERFACE("gamecom_cart")
MCFG_CARTSLOT_LOAD(gamecom_cart2) MCFG_CARTSLOT_LOAD(gamecom_state,gamecom_cart2)
MACHINE_CONFIG_END MACHINE_CONFIG_END
ROM_START( gamecom ) ROM_START( gamecom )

View File

@ -45,16 +45,14 @@ 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 };
static DEVICE_START(gamepock_cart) DEVICE_IMAGE_START_MEMBER(gamepock_state,gamepock_cart)
{ {
gamepock_state *state = device->machine().driver_data<gamepock_state>(); membank( "bank1" )->set_base( memregion("user1" )->base() );
state->membank( "bank1" )->set_base( state->memregion("user1" )->base() );
} }
static DEVICE_IMAGE_LOAD(gamepock_cart) { DEVICE_IMAGE_LOAD_MEMBER(gamepock_state,gamepock_cart) {
gamepock_state *state = image.device().machine().driver_data<gamepock_state>(); UINT8 *cart = memregion("user1" )->base();
UINT8 *cart = state->memregion("user1" )->base();
if ( image.software_entry() == NULL ) if ( image.software_entry() == NULL )
{ {
@ -69,7 +67,7 @@ static DEVICE_IMAGE_LOAD(gamepock_cart) {
cart = image.get_software_region( "rom" ); cart = image.get_software_region( "rom" );
} }
state->membank( "bank1" )->set_base( cart ); membank( "bank1" )->set_base( cart );
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
@ -102,8 +100,8 @@ 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_cart) MCFG_CARTSLOT_START(gamepock_state,gamepock_cart)
MCFG_CARTSLOT_LOAD(gamepock_cart) MCFG_CARTSLOT_LOAD(gamepock_state,gamepock_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","gamepock") MCFG_SOFTWARE_LIST_ADD("cart_list","gamepock")

View File

@ -590,8 +590,8 @@ 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_cart) MCFG_CARTSLOT_START(gb_state,gb_cart)
MCFG_CARTSLOT_LOAD(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")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -648,8 +648,8 @@ 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_cart) MCFG_CARTSLOT_START(gb_state,gb_cart)
MCFG_CARTSLOT_LOAD(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")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -689,7 +689,7 @@ static MACHINE_CONFIG_START( megaduck, gb_state )
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("megaduck_cart") MCFG_CARTSLOT_INTERFACE("megaduck_cart")
MCFG_CARTSLOT_LOAD(megaduck_cart) MCFG_CARTSLOT_LOAD(gb_state,megaduck_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","megaduck") MCFG_SOFTWARE_LIST_ADD("cart_list","megaduck")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -2955,7 +2955,7 @@ static int gba_get_pcb_id(const char *pcb)
return 0; return 0;
} }
static DEVICE_IMAGE_LOAD( gba_cart ) DEVICE_IMAGE_LOAD_MEMBER( gba_state, gba_cart )
{ {
UINT8 *ROM = image.device().machine().root_device().memregion("cartridge")->base(); UINT8 *ROM = image.device().machine().root_device().memregion("cartridge")->base();
UINT32 cart_size; UINT32 cart_size;
@ -3129,7 +3129,7 @@ static MACHINE_CONFIG_START( gbadv, gba_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("gba,bin") MCFG_CARTSLOT_EXTENSION_LIST("gba,bin")
MCFG_CARTSLOT_INTERFACE("gba_cart") MCFG_CARTSLOT_INTERFACE("gba_cart")
MCFG_CARTSLOT_LOAD(gba_cart) MCFG_CARTSLOT_LOAD(gba_state,gba_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","gba") MCFG_SOFTWARE_LIST_ADD("cart_list","gba")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -239,6 +239,8 @@ public:
DECLARE_READ16_MEMBER(unk0_r) { return 0; } DECLARE_READ16_MEMBER(unk0_r) { return 0; }
DECLARE_READ16_MEMBER(unk_r) { return machine().rand(); } DECLARE_READ16_MEMBER(unk_r) { return machine().rand(); }
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( iq128_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( iq128_cart );
private: private:
UINT16 m_gfx_y; UINT16 m_gfx_y;
@ -762,14 +764,14 @@ void geniusiq_state::cart_unload(device_image_interface &image)
m_cart_state = IQ128_NO_CART; m_cart_state = IQ128_NO_CART;
} }
static DEVICE_IMAGE_LOAD(iq128_cart) DEVICE_IMAGE_LOAD_MEMBER(geniusiq_state,iq128_cart)
{ {
return image.device().machine().driver_data<geniusiq_state>()->cart_load(image); return cart_load(image);
} }
static DEVICE_IMAGE_UNLOAD(iq128_cart) DEVICE_IMAGE_UNLOAD_MEMBER(geniusiq_state,iq128_cart)
{ {
image.device().machine().driver_data<geniusiq_state>()->cart_unload(image); cart_unload(image);
} }
static MACHINE_CONFIG_START( iq128, geniusiq_state ) static MACHINE_CONFIG_START( iq128, geniusiq_state )
@ -794,8 +796,8 @@ static MACHINE_CONFIG_START( iq128, geniusiq_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(iq128_cart) MCFG_CARTSLOT_LOAD(geniusiq_state,iq128_cart)
MCFG_CARTSLOT_UNLOAD(iq128_cart) MCFG_CARTSLOT_UNLOAD(geniusiq_state,iq128_cart)
MCFG_CARTSLOT_INTERFACE("iq128_cart") MCFG_CARTSLOT_INTERFACE("iq128_cart")
/* Software lists */ /* Software lists */

View File

@ -841,7 +841,7 @@ static MACHINE_CONFIG_START( intv, intv_state )
/* cartridge */ /* cartridge */
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv") MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv")
MCFG_CARTSLOT_LOAD(intv_cart) MCFG_CARTSLOT_LOAD(intv_state,intv_cart)
MCFG_CARTSLOT_INTERFACE("intv_cart") MCFG_CARTSLOT_INTERFACE("intv_cart")
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","intv") MCFG_SOFTWARE_LIST_ADD("cart_list","intv")
@ -890,13 +890,13 @@ static MACHINE_CONFIG_DERIVED( intvkbd, intv )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv") MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(intvkbd_cart) MCFG_CARTSLOT_LOAD(intv_state,intvkbd_cart)
MCFG_CARTSLOT_INTERFACE("intv_cart") MCFG_CARTSLOT_INTERFACE("intv_cart")
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv") MCFG_CARTSLOT_EXTENSION_LIST("int,rom,bin,itv")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(intvkbd_cart) MCFG_CARTSLOT_LOAD(intv_state,intvkbd_cart)
MCFG_CARTSLOT_INTERFACE("intv_cart") MCFG_CARTSLOT_INTERFACE("intv_cart")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -66,6 +66,7 @@ public:
UINT8 m_digit; UINT8 m_digit;
UINT8 m_keydata; UINT8 m_keydata;
TIMER_CALLBACK_MEMBER(mekd2_trace); TIMER_CALLBACK_MEMBER(mekd2_trace);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(mekd2_cart);
}; };
@ -295,7 +296,7 @@ static ACIA6850_INTERFACE( mekd2_acia_intf )
DEVCB_NULL /* out irq func */ DEVCB_NULL /* out irq func */
}; };
static DEVICE_IMAGE_LOAD( mekd2_cart ) DEVICE_IMAGE_LOAD_MEMBER( mekd2_state,mekd2_cart )
{ {
static const char magic[] = "MEK6800D2"; static const char magic[] = "MEK6800D2";
char buff[9]; char buff[9];
@ -344,7 +345,7 @@ static MACHINE_CONFIG_START( mekd2, mekd2_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("d2") MCFG_CARTSLOT_EXTENSION_LIST("d2")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(mekd2_cart) MCFG_CARTSLOT_LOAD(mekd2_state,mekd2_cart)
/* Devices */ /* Devices */
MCFG_PIA6821_ADD("pia_s", mekd2_s_mc6821_intf) MCFG_PIA6821_ADD("pia_s", mekd2_s_mc6821_intf)

View File

@ -41,6 +41,7 @@ public:
DECLARE_MACHINE_RESET(microvision); DECLARE_MACHINE_RESET(microvision);
void screen_vblank(screen_device &screen, bool state); void screen_vblank(screen_device &screen, bool state);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( microvision_cart );
// i8021 interface // i8021 interface
DECLARE_WRITE8_MEMBER(i8021_p0_write); DECLARE_WRITE8_MEMBER(i8021_p0_write);
@ -453,7 +454,7 @@ WRITE16_MEMBER( microvision_state::tms1100_write_r )
} }
static DEVICE_IMAGE_LOAD(microvision_cart) DEVICE_IMAGE_LOAD_MEMBER(microvision_state,microvision_cart)
{ {
microvision_state *state = image.device().machine().driver_data<microvision_state>(); microvision_state *state = image.device().machine().driver_data<microvision_state>();
UINT8 *rom1 = state->memregion("maincpu1")->base(); UINT8 *rom1 = state->memregion("maincpu1")->base();
@ -640,7 +641,7 @@ static MACHINE_CONFIG_START( microvision, microvision_state )
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("microvision_cart") MCFG_CARTSLOT_INTERFACE("microvision_cart")
MCFG_CARTSLOT_LOAD(microvision_cart) MCFG_CARTSLOT_LOAD(microvision_state,microvision_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","microvision") MCFG_SOFTWARE_LIST_ADD("cart_list","microvision")

View File

@ -1053,15 +1053,15 @@ static MACHINE_CONFIG_FRAGMENT( msx_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("mx1,rom") MCFG_CARTSLOT_EXTENSION_LIST("mx1,rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("msx_cart") MCFG_CARTSLOT_INTERFACE("msx_cart")
MCFG_CARTSLOT_LOAD(msx_cart) MCFG_CARTSLOT_LOAD(msx_state, msx_cart)
MCFG_CARTSLOT_UNLOAD(msx_cart) MCFG_CARTSLOT_UNLOAD(msx_state, msx_cart)
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_EXTENSION_LIST("mx1,rom") MCFG_CARTSLOT_EXTENSION_LIST("mx1,rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("msx_cart") MCFG_CARTSLOT_INTERFACE("msx_cart")
MCFG_CARTSLOT_LOAD(msx_cart) MCFG_CARTSLOT_LOAD(msx_state, msx_cart)
MCFG_CARTSLOT_UNLOAD(msx_cart) MCFG_CARTSLOT_UNLOAD(msx_state, msx_cart)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( msx, msx_state ) static MACHINE_CONFIG_START( msx, msx_state )

View File

@ -24,6 +24,7 @@ public:
DECLARE_READ32_MEMBER(dd_null_r); DECLARE_READ32_MEMBER(dd_null_r);
DECLARE_MACHINE_START(n64dd); DECLARE_MACHINE_START(n64dd);
INTERRUPT_GEN_MEMBER(n64_reset_poll); INTERRUPT_GEN_MEMBER(n64_reset_poll);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(n64_cart);
}; };
READ32_MEMBER(n64_mess_state::dd_null_r) READ32_MEMBER(n64_mess_state::dd_null_r)
@ -171,7 +172,7 @@ static void mempak_format(UINT8* pak)
memcpy(pak, pak_header, 272); memcpy(pak, pak_header, 272);
} }
static DEVICE_IMAGE_LOAD(n64_cart) DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart)
{ {
int i, length; int i, length;
n64_periphs *periphs = image.device().machine().device<n64_periphs>("rcp"); n64_periphs *periphs = image.device().machine().device<n64_periphs>("rcp");
@ -309,7 +310,7 @@ static MACHINE_CONFIG_START( n64, n64_mess_state )
MCFG_CARTSLOT_EXTENSION_LIST("v64,z64,rom,n64,bin") MCFG_CARTSLOT_EXTENSION_LIST("v64,z64,rom,n64,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("n64_cart") MCFG_CARTSLOT_INTERFACE("n64_cart")
MCFG_CARTSLOT_LOAD(n64_cart) MCFG_CARTSLOT_LOAD(n64_mess_state,n64_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","n64") MCFG_SOFTWARE_LIST_ADD("cart_list","n64")

View File

@ -1609,9 +1609,9 @@ 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_pcmcia_card) MCFG_CARTSLOT_START(nc_state,nc_pcmcia_card)
MCFG_CARTSLOT_LOAD(nc_pcmcia_card) MCFG_CARTSLOT_LOAD(nc_state,nc_pcmcia_card)
MCFG_CARTSLOT_UNLOAD(nc_pcmcia_card) MCFG_CARTSLOT_UNLOAD(nc_state,nc_pcmcia_card)
/* internal ram */ /* internal ram */
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)

View File

@ -474,7 +474,7 @@ static MACHINE_CONFIG_START( nes, nes_state )
MCFG_CARTSLOT_EXTENSION_LIST("nes,unf") MCFG_CARTSLOT_EXTENSION_LIST("nes,unf")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("nes_cart") MCFG_CARTSLOT_INTERFACE("nes_cart")
MCFG_CARTSLOT_LOAD(nes_cart) MCFG_CARTSLOT_LOAD(nes_state,nes_cart)
MCFG_CARTSLOT_PARTIALHASH(nes_partialhash) MCFG_CARTSLOT_PARTIALHASH(nes_partialhash)
MCFG_SOFTWARE_LIST_ADD("cart_list","nes") MCFG_SOFTWARE_LIST_ADD("cart_list","nes")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -526,7 +526,7 @@ static MACHINE_CONFIG_DERIVED( famicom, nes )
MCFG_CARTSLOT_MODIFY("cart") MCFG_CARTSLOT_MODIFY("cart")
MCFG_CARTSLOT_EXTENSION_LIST("nes,unf") MCFG_CARTSLOT_EXTENSION_LIST("nes,unf")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(nes_cart) MCFG_CARTSLOT_LOAD(nes_state,nes_cart)
MCFG_CARTSLOT_PARTIALHASH(nes_partialhash) MCFG_CARTSLOT_PARTIALHASH(nes_partialhash)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, nes_floppy_interface) MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, nes_floppy_interface)

View File

@ -1528,7 +1528,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( aes, neogeo_base, ng_aes_state )
MCFG_MACHINE_RESET_OVERRIDE(ng_aes_state, neogeo) MCFG_MACHINE_RESET_OVERRIDE(ng_aes_state, neogeo)
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_LOAD(neo_cartridge) MCFG_CARTSLOT_LOAD(ng_aes_state,neo_cartridge)
MCFG_CARTSLOT_INTERFACE("neo_cart") MCFG_CARTSLOT_INTERFACE("neo_cart")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY

View File

@ -173,6 +173,10 @@ public:
UINT32 screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
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_UNLOAD_MEMBER( ngp_cart );
}; };
@ -630,24 +634,22 @@ UINT32 ngp_state::screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap,
} }
static DEVICE_START( ngp_cart ) DEVICE_IMAGE_START_MEMBER( ngp_state, ngp_cart )
{ {
ngp_state *state = device->machine().driver_data<ngp_state>(); UINT8 *cart = memregion("cart")->base();
UINT8 *cart = state->memregion("cart")->base();
state->m_flash_chip[0].present = 0; m_flash_chip[0].present = 0;
state->m_flash_chip[0].state = F_READ; m_flash_chip[0].state = F_READ;
state->m_flash_chip[0].data = cart; m_flash_chip[0].data = cart;
state->m_flash_chip[1].present = 0; m_flash_chip[1].present = 0;
state->m_flash_chip[1].state = F_READ; m_flash_chip[1].state = F_READ;
state->m_flash_chip[1].data = cart + 0x200000; m_flash_chip[1].data = cart + 0x200000;
} }
static DEVICE_IMAGE_LOAD( ngp_cart ) DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart )
{ {
ngp_state *state = image.device().machine().driver_data<ngp_state>();
UINT32 filesize; UINT32 filesize;
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
@ -660,7 +662,7 @@ static DEVICE_IMAGE_LOAD( ngp_cart )
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
} }
if (image.fread( image.device().machine().root_device().memregion("cart")->base(), filesize) != filesize) if (image.fread( machine().root_device().memregion("cart")->base(), 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;
@ -669,83 +671,81 @@ static DEVICE_IMAGE_LOAD( ngp_cart )
else else
{ {
filesize = image.get_software_region_length("rom"); filesize = image.get_software_region_length("rom");
memcpy(image.device().machine().root_device().memregion("cart")->base(), image.get_software_region("rom"), filesize); memcpy(machine().root_device().memregion("cart")->base(), 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),
// (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x22), (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x23)); // (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x22), (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x23));
state->m_flash_chip[0].manufacturer_id = 0x98; m_flash_chip[0].manufacturer_id = 0x98;
switch( filesize ) switch( filesize )
{ {
case 0x8000: case 0x8000:
case 0x80000: case 0x80000:
state->m_flash_chip[0].device_id = 0xab; m_flash_chip[0].device_id = 0xab;
break; break;
case 0x100000: case 0x100000:
state->m_flash_chip[0].device_id = 0x2c; m_flash_chip[0].device_id = 0x2c;
break; break;
case 0x200000: case 0x200000:
state->m_flash_chip[0].device_id = 0x2f; m_flash_chip[0].device_id = 0x2f;
break; break;
case 0x400000: case 0x400000:
state->m_flash_chip[0].device_id = 0x2f; m_flash_chip[0].device_id = 0x2f;
state->m_flash_chip[1].manufacturer_id = 0x98; m_flash_chip[1].manufacturer_id = 0x98;
state->m_flash_chip[1].device_id = 0x2f; m_flash_chip[1].device_id = 0x2f;
state->m_flash_chip[1].present = 0; m_flash_chip[1].present = 0;
state->m_flash_chip[1].state = F_READ; m_flash_chip[1].state = F_READ;
break; break;
} }
state->m_flash_chip[0].org_data[0] = state->m_flash_chip[0].data[0]; m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0];
state->m_flash_chip[0].org_data[1] = state->m_flash_chip[0].data[1]; m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1];
state->m_flash_chip[0].org_data[2] = state->m_flash_chip[0].data[2]; m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2];
state->m_flash_chip[0].org_data[3] = state->m_flash_chip[0].data[3]; m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3];
state->m_flash_chip[0].org_data[4] = state->m_flash_chip[0].data[0x7c000]; m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000];
state->m_flash_chip[0].org_data[5] = state->m_flash_chip[0].data[0x7c001]; m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001];
state->m_flash_chip[0].org_data[6] = state->m_flash_chip[0].data[0x7c002]; m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002];
state->m_flash_chip[0].org_data[7] = state->m_flash_chip[0].data[0x7c003]; m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003];
state->m_flash_chip[0].org_data[8] = state->m_flash_chip[0].data[0xfc000]; m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000];
state->m_flash_chip[0].org_data[9] = state->m_flash_chip[0].data[0xfc001]; m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001];
state->m_flash_chip[0].org_data[10] = state->m_flash_chip[0].data[0xfc002]; m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002];
state->m_flash_chip[0].org_data[11] = state->m_flash_chip[0].data[0xfc003]; m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003];
state->m_flash_chip[0].org_data[12] = state->m_flash_chip[0].data[0x1fc000]; m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000];
state->m_flash_chip[0].org_data[13] = state->m_flash_chip[0].data[0x1fc001]; m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001];
state->m_flash_chip[0].org_data[14] = state->m_flash_chip[0].data[0x1fc002]; m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002];
state->m_flash_chip[0].org_data[15] = state->m_flash_chip[0].data[0x1fc003]; m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003];
state->m_flash_chip[1].org_data[0] = state->m_flash_chip[1].data[0]; m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0];
state->m_flash_chip[1].org_data[1] = state->m_flash_chip[1].data[1]; m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1];
state->m_flash_chip[1].org_data[2] = state->m_flash_chip[1].data[2]; m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2];
state->m_flash_chip[1].org_data[3] = state->m_flash_chip[1].data[3]; m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3];
state->m_flash_chip[1].org_data[4] = state->m_flash_chip[1].data[0x7c000]; m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000];
state->m_flash_chip[1].org_data[5] = state->m_flash_chip[1].data[0x7c001]; m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001];
state->m_flash_chip[1].org_data[6] = state->m_flash_chip[1].data[0x7c002]; m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002];
state->m_flash_chip[1].org_data[7] = state->m_flash_chip[1].data[0x7c003]; m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003];
state->m_flash_chip[1].org_data[8] = state->m_flash_chip[1].data[0xfc000]; m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000];
state->m_flash_chip[1].org_data[9] = state->m_flash_chip[1].data[0xfc001]; m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001];
state->m_flash_chip[1].org_data[10] = state->m_flash_chip[1].data[0xfc002]; m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002];
state->m_flash_chip[1].org_data[11] = state->m_flash_chip[1].data[0xfc003]; m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003];
state->m_flash_chip[1].org_data[12] = state->m_flash_chip[1].data[0x1fc000]; m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000];
state->m_flash_chip[1].org_data[13] = state->m_flash_chip[1].data[0x1fc001]; m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001];
state->m_flash_chip[1].org_data[14] = state->m_flash_chip[1].data[0x1fc002]; m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002];
state->m_flash_chip[1].org_data[15] = state->m_flash_chip[1].data[0x1fc003]; m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003];
state->m_flash_chip[0].present = 1; m_flash_chip[0].present = 1;
state->m_flash_chip[0].state = F_READ; m_flash_chip[0].state = F_READ;
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_UNLOAD( ngp_cart ) DEVICE_IMAGE_UNLOAD_MEMBER( ngp_state, ngp_cart )
{ {
ngp_state *state = image.device().machine().driver_data<ngp_state>(); m_flash_chip[0].present = 0;
m_flash_chip[0].state = F_READ;
state->m_flash_chip[0].present = 0; m_flash_chip[1].present = 0;
state->m_flash_chip[0].state = F_READ; m_flash_chip[1].state = F_READ;
state->m_flash_chip[1].present = 0;
state->m_flash_chip[1].state = F_READ;
} }
@ -805,10 +805,10 @@ 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_cart) MCFG_CARTSLOT_START(ngp_state, ngp_cart)
MCFG_CARTSLOT_LOAD(ngp_cart) MCFG_CARTSLOT_LOAD(ngp_state, ngp_cart)
MCFG_CARTSLOT_INTERFACE("ngp_cart") MCFG_CARTSLOT_INTERFACE("ngp_cart")
MCFG_CARTSLOT_UNLOAD(ngp_cart) MCFG_CARTSLOT_UNLOAD(ngp_state, ngp_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","ngp") MCFG_SOFTWARE_LIST_ADD("cart_list","ngp")
@ -826,10 +826,10 @@ 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_cart) MCFG_CARTSLOT_START(ngp_state,ngp_cart)
MCFG_CARTSLOT_LOAD(ngp_cart) MCFG_CARTSLOT_LOAD(ngp_state,ngp_cart)
MCFG_CARTSLOT_INTERFACE("ngp_cart") MCFG_CARTSLOT_INTERFACE("ngp_cart")
MCFG_CARTSLOT_UNLOAD(ngp_cart) MCFG_CARTSLOT_UNLOAD(ngp_state,ngp_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","ngpc") MCFG_SOFTWARE_LIST_ADD("cart_list","ngpc")

View File

@ -1313,12 +1313,12 @@ static MACHINE_CONFIG_START( ibmpcjr, pc_state )
MCFG_CARTSLOT_INTERFACE("ibmpcjr_cart") MCFG_CARTSLOT_INTERFACE("ibmpcjr_cart")
MCFG_CARTSLOT_EXTENSION_LIST("jrc") MCFG_CARTSLOT_EXTENSION_LIST("jrc")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(pcjr_cartridge) MCFG_CARTSLOT_LOAD(pc_state,pcjr_cartridge)
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_INTERFACE("ibmpcjr_cart") MCFG_CARTSLOT_INTERFACE("ibmpcjr_cart")
MCFG_CARTSLOT_EXTENSION_LIST("jrc") MCFG_CARTSLOT_EXTENSION_LIST("jrc")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(pcjr_cartridge) MCFG_CARTSLOT_LOAD(pc_state,pcjr_cartridge)
/* internal ram */ /* internal ram */
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)

View File

@ -244,6 +244,7 @@ public:
DECLARE_WRITE8_MEMBER(pc6001_8255_portb_w); DECLARE_WRITE8_MEMBER(pc6001_8255_portb_w);
DECLARE_WRITE8_MEMBER(pc6001_8255_portc_w); DECLARE_WRITE8_MEMBER(pc6001_8255_portc_w);
DECLARE_READ8_MEMBER(pc6001_8255_portc_r); DECLARE_READ8_MEMBER(pc6001_8255_portc_r);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pc6001_cass);
}; };
@ -2261,7 +2262,7 @@ static const cassette_interface pc6001_cassette_interface =
NULL NULL
}; };
static DEVICE_IMAGE_LOAD( pc6001_cass ) DEVICE_IMAGE_LOAD_MEMBER( pc6001_state,pc6001_cass )
{ {
pc6001_state *state = image.device().machine().driver_data<pc6001_state>(); pc6001_state *state = image.device().machine().driver_data<pc6001_state>();
UINT8 *cas = state->memregion("cas")->base(); UINT8 *cas = state->memregion("cas")->base();
@ -2347,7 +2348,7 @@ static MACHINE_CONFIG_START( pc6001, pc6001_state )
MCFG_CARTSLOT_EXTENSION_LIST("cas,p6") MCFG_CARTSLOT_EXTENSION_LIST("cas,p6")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("pc6001_cass") MCFG_CARTSLOT_INTERFACE("pc6001_cass")
MCFG_CARTSLOT_LOAD(pc6001_cass) MCFG_CARTSLOT_LOAD(pc6001_state,pc6001_cass)
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ay8910", AY8910, PC6001_MAIN_CLOCK/4) MCFG_SOUND_ADD("ay8910", AY8910, PC6001_MAIN_CLOCK/4)

View File

@ -270,7 +270,7 @@ static MACHINE_CONFIG_FRAGMENT( pce_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("pce,bin") MCFG_CARTSLOT_EXTENSION_LIST("pce,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("pce_cart") MCFG_CARTSLOT_INTERFACE("pce_cart")
MCFG_CARTSLOT_LOAD(pce_cart) MCFG_CARTSLOT_LOAD(pce_state,pce_cart)
MCFG_CARTSLOT_PARTIALHASH(pce_partialhash) MCFG_CARTSLOT_PARTIALHASH(pce_partialhash)
MCFG_SOFTWARE_LIST_ADD("cart_list","pce") MCFG_SOFTWARE_LIST_ADD("cart_list","pce")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -280,7 +280,7 @@ static MACHINE_CONFIG_FRAGMENT( tg16_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("pce,bin") MCFG_CARTSLOT_EXTENSION_LIST("pce,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("tg16_cart") MCFG_CARTSLOT_INTERFACE("tg16_cart")
MCFG_CARTSLOT_LOAD(pce_cart) MCFG_CARTSLOT_LOAD(pce_state,pce_cart)
MCFG_CARTSLOT_PARTIALHASH(pce_partialhash) MCFG_CARTSLOT_PARTIALHASH(pce_partialhash)
MCFG_SOFTWARE_LIST_ADD("cart_list","tg16") MCFG_SOFTWARE_LIST_ADD("cart_list","tg16")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -290,7 +290,7 @@ static MACHINE_CONFIG_FRAGMENT( sgx_cartslot )
MCFG_CARTSLOT_EXTENSION_LIST("pce,bin") MCFG_CARTSLOT_EXTENSION_LIST("pce,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("pce_cart") MCFG_CARTSLOT_INTERFACE("pce_cart")
MCFG_CARTSLOT_LOAD(pce_cart) MCFG_CARTSLOT_LOAD(pce_state,pce_cart)
MCFG_CARTSLOT_PARTIALHASH(pce_partialhash) MCFG_CARTSLOT_PARTIALHASH(pce_partialhash)
MCFG_SOFTWARE_LIST_ADD("cart_list","sgx") MCFG_SOFTWARE_LIST_ADD("cart_list","sgx")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -82,6 +82,11 @@ public:
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_DRIVER_INIT(pegasus); DECLARE_DRIVER_INIT(pegasus);
TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq); TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_1);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_2);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_3);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_4);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pegasus_cart_5);
}; };
TIMER_DEVICE_CALLBACK_MEMBER(pegasus_state::pegasus_firq) TIMER_DEVICE_CALLBACK_MEMBER(pegasus_state::pegasus_firq)
@ -433,7 +438,7 @@ static void pegasus_decrypt_rom( running_machine &machine, UINT16 addr )
} }
} }
static DEVICE_IMAGE_LOAD( pegasus_cart_1 ) DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_1 )
{ {
image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x0000, 0x1000); image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x0000, 0x1000);
pegasus_decrypt_rom( image.device().machine(), 0x0000 ); pegasus_decrypt_rom( image.device().machine(), 0x0000 );
@ -441,7 +446,7 @@ static DEVICE_IMAGE_LOAD( pegasus_cart_1 )
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_LOAD( pegasus_cart_2 ) DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_2 )
{ {
image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x1000, 0x1000); image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x1000, 0x1000);
pegasus_decrypt_rom( image.device().machine(), 0x1000 ); pegasus_decrypt_rom( image.device().machine(), 0x1000 );
@ -449,7 +454,7 @@ static DEVICE_IMAGE_LOAD( pegasus_cart_2 )
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_LOAD( pegasus_cart_3 ) DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_3 )
{ {
image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x2000, 0x1000); image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0x2000, 0x1000);
pegasus_decrypt_rom( image.device().machine(), 0x2000 ); pegasus_decrypt_rom( image.device().machine(), 0x2000 );
@ -457,7 +462,7 @@ static DEVICE_IMAGE_LOAD( pegasus_cart_3 )
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_LOAD( pegasus_cart_4 ) DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_4 )
{ {
image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0xc000, 0x1000); image.fread(image.device().machine().root_device().memregion("maincpu")->base() + 0xc000, 0x1000);
pegasus_decrypt_rom( image.device().machine(), 0xc000 ); pegasus_decrypt_rom( image.device().machine(), 0xc000 );
@ -465,7 +470,7 @@ static DEVICE_IMAGE_LOAD( pegasus_cart_4 )
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_LOAD( pegasus_cart_5 ) DEVICE_IMAGE_LOAD_MEMBER( pegasus_state, pegasus_cart_5 )
{ {
image.fread( image.device().machine().root_device().memregion("maincpu")->base() + 0xd000, 0x1000); image.fread( image.device().machine().root_device().memregion("maincpu")->base() + 0xd000, 0x1000);
pegasus_decrypt_rom( image.device().machine(), 0xd000 ); pegasus_decrypt_rom( image.device().machine(), 0xd000 );
@ -518,19 +523,19 @@ static MACHINE_CONFIG_START( pegasus, pegasus_state )
MCFG_PIA6821_ADD( "pia_u", pegasus_pia_u_intf ) MCFG_PIA6821_ADD( "pia_u", pegasus_pia_u_intf )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_LOAD(pegasus_cart_1) MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_1)
MCFG_CARTSLOT_ADD("cart2") MCFG_CARTSLOT_ADD("cart2")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_LOAD(pegasus_cart_2) MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_2)
MCFG_CARTSLOT_ADD("cart3") MCFG_CARTSLOT_ADD("cart3")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_LOAD(pegasus_cart_3) MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_3)
MCFG_CARTSLOT_ADD("cart4") MCFG_CARTSLOT_ADD("cart4")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_LOAD(pegasus_cart_4) MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_4)
MCFG_CARTSLOT_ADD("cart5") MCFG_CARTSLOT_ADD("cart5")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_LOAD(pegasus_cart_5) MCFG_CARTSLOT_LOAD(pegasus_state,pegasus_cart_5)
MCFG_CASSETTE_ADD( CASSETTE_TAG, pegasus_cassette_interface ) MCFG_CASSETTE_ADD( CASSETTE_TAG, pegasus_cassette_interface )
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -126,6 +126,7 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(input_update); DECLARE_INPUT_CHANGED_MEMBER(input_update);
TIMER_CALLBACK_MEMBER(timer_tick); TIMER_CALLBACK_MEMBER(timer_tick);
TIMER_CALLBACK_MEMBER(rtc_tick); TIMER_CALLBACK_MEMBER(rtc_tick);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pockstat_flash );
}; };
@ -956,7 +957,7 @@ UINT32 pockstat_state::screen_update_pockstat(screen_device &screen, bitmap_rgb3
return 0; return 0;
} }
static DEVICE_IMAGE_LOAD( pockstat_flash ) DEVICE_IMAGE_LOAD_MEMBER( pockstat_state, pockstat_flash )
{ {
int i, length; int i, length;
UINT8 *cart = image.device().machine().root_device().memregion("flash")->base(); UINT8 *cart = image.device().machine().root_device().memregion("flash")->base();
@ -1007,7 +1008,7 @@ static MACHINE_CONFIG_START( pockstat, pockstat_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("gme") MCFG_CARTSLOT_EXTENSION_LIST("gme")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(pockstat_flash) MCFG_CARTSLOT_LOAD(pockstat_state, pockstat_flash)
MACHINE_CONFIG_END MACHINE_CONFIG_END
/* ROM definition */ /* ROM definition */

View File

@ -95,7 +95,7 @@ static MACHINE_CONFIG_START( pokemini, pokemini_state )
MCFG_CARTSLOT_EXTENSION_LIST("min,bin") MCFG_CARTSLOT_EXTENSION_LIST("min,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("pokemini_cart") MCFG_CARTSLOT_INTERFACE("pokemini_cart")
MCFG_CARTSLOT_LOAD(pokemini_cart) MCFG_CARTSLOT_LOAD(pokemini_state,pokemini_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","pokemini") MCFG_SOFTWARE_LIST_ADD("cart_list","pokemini")

View File

@ -741,7 +741,7 @@ static const centronics_interface centronics_intf =
// DEVICE_IMAGE_LOAD( portfolio_cart ) // DEVICE_IMAGE_LOAD( portfolio_cart )
//------------------------------------------------- //-------------------------------------------------
static DEVICE_IMAGE_LOAD( portfolio_cart ) DEVICE_IMAGE_LOAD_MEMBER( portfolio_state, portfolio_cart )
{ {
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
} }
@ -862,7 +862,7 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_INTERFACE("portfolio_cart") MCFG_CARTSLOT_INTERFACE("portfolio_cart")
MCFG_CARTSLOT_LOAD(portfolio_cart) MCFG_CARTSLOT_LOAD(portfolio_state,portfolio_cart)
/* memory card */ /* memory card */
/* MCFG_MEMCARD_ADD("memcard_a") /* MCFG_MEMCARD_ADD("memcard_a")

View File

@ -106,6 +106,7 @@ public:
UINT32 screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(d65010_irq_on_cb); TIMER_CALLBACK_MEMBER(d65010_irq_on_cb);
TIMER_CALLBACK_MEMBER(d65010_irq_off_cb); TIMER_CALLBACK_MEMBER(d65010_irq_off_cb);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pv1000_cart );
}; };
@ -237,7 +238,7 @@ void pv1000_state::palette_init()
} }
static DEVICE_IMAGE_LOAD( pv1000_cart ) DEVICE_IMAGE_LOAD_MEMBER( pv1000_state, pv1000_cart )
{ {
UINT8 *cart = image.device().machine().root_device().memregion("cart")->base(); UINT8 *cart = image.device().machine().root_device().memregion("cart")->base();
UINT32 size; UINT32 size;
@ -439,7 +440,7 @@ static MACHINE_CONFIG_START( pv1000, pv1000_state )
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("pv1000_cart") MCFG_CARTSLOT_INTERFACE("pv1000_cart")
MCFG_CARTSLOT_LOAD(pv1000_cart) MCFG_CARTSLOT_LOAD(pv1000_state,pv1000_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","pv1000") MCFG_SOFTWARE_LIST_ADD("cart_list","pv1000")

View File

@ -62,6 +62,7 @@ public:
UINT8 m_cass_conf; UINT8 m_cass_conf;
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pv2000_cart );
}; };
@ -377,7 +378,7 @@ void pv2000_state::machine_reset()
memset(&memregion("maincpu")->base()[0x7000], 0xff, 0x1000); // initialize RAM memset(&memregion("maincpu")->base()[0x7000], 0xff, 0x1000); // initialize RAM
} }
static DEVICE_IMAGE_LOAD( pv2000_cart ) DEVICE_IMAGE_LOAD_MEMBER( pv2000_state, pv2000_cart )
{ {
UINT8 *cart = image.device().machine().root_device().memregion("maincpu")->base() + 0xC000; UINT8 *cart = image.device().machine().root_device().memregion("maincpu")->base() + 0xC000;
UINT32 size; UINT32 size;
@ -446,7 +447,7 @@ static MACHINE_CONFIG_START( pv2000, pv2000_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("rom,col,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,col,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(pv2000_cart) MCFG_CARTSLOT_LOAD(pv2000_state,pv2000_cart)
MCFG_CARTSLOT_INTERFACE("pv2000_cart") MCFG_CARTSLOT_INTERFACE("pv2000_cart")
/* Software lists */ /* Software lists */

View File

@ -78,6 +78,7 @@ public:
DECLARE_DRIVER_INIT(rx78); DECLARE_DRIVER_INIT(rx78);
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cass; required_device<cassette_image_device> m_cass;
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( rx78_cart );
}; };
@ -401,7 +402,7 @@ void rx78_state::machine_reset()
{ {
} }
static DEVICE_IMAGE_LOAD( rx78_cart ) DEVICE_IMAGE_LOAD_MEMBER( rx78_state, rx78_cart )
{ {
UINT8 *cart = image.device().machine().root_device().memregion("cart_img")->base(); UINT8 *cart = image.device().machine().root_device().memregion("cart_img")->base();
UINT32 size; UINT32 size;
@ -480,7 +481,7 @@ static MACHINE_CONFIG_START( rx78, rx78_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(rx78_cart) MCFG_CARTSLOT_LOAD(rx78_state,rx78_cart)
MCFG_CARTSLOT_INTERFACE("rx78_cart") MCFG_CARTSLOT_INTERFACE("rx78_cart")
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)

View File

@ -57,6 +57,8 @@ 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 );
protected: protected:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
@ -358,27 +360,23 @@ WRITE8_MEMBER( scv_state::scv_portc_w )
} }
static DEVICE_START( scv_cart ) DEVICE_IMAGE_START_MEMBER( scv_state, scv_cart )
{ {
scv_state *state = device->machine().driver_data<scv_state>(); m_cart_rom = memregion( "cart" )->base();
m_cart_rom_size = 0;
state->m_cart_rom = state->memregion( "cart" )->base(); m_cart_ram = NULL;
state->m_cart_rom_size = 0; m_cart_ram_size = 0;
state->m_cart_ram = NULL;
state->m_cart_ram_size = 0;
} }
static DEVICE_IMAGE_LOAD( scv_cart ) DEVICE_IMAGE_LOAD_MEMBER( scv_state, scv_cart )
{ {
scv_state *state = image.device().machine().driver_data<scv_state>();
if ( image.software_entry() == NULL ) if ( image.software_entry() == NULL )
{ {
UINT8 *cart = image.device().machine().root_device().memregion( "cart" )->base(); UINT8 *cart = image.device().machine().root_device().memregion( "cart" )->base();
int size = image.length(); int size = image.length();
if ( size > state->memregion( "cart" )->bytes() ) if ( size > memregion( "cart" )->bytes() )
{ {
image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size" ); image.seterror( IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size" );
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
@ -390,17 +388,17 @@ static DEVICE_IMAGE_LOAD( scv_cart )
return IMAGE_INIT_FAIL; return IMAGE_INIT_FAIL;
} }
state->m_cart_rom = cart; m_cart_rom = cart;
state->m_cart_rom_size = size; m_cart_rom_size = size;
state->m_cart_ram = NULL; m_cart_ram = NULL;
state->m_cart_ram_size = 0; m_cart_ram_size = 0;
} }
else else
{ {
state->m_cart_rom = image.get_software_region( "rom" ); m_cart_rom = image.get_software_region( "rom" );
state->m_cart_rom_size = image.get_software_region_length( "rom" ); m_cart_rom_size = image.get_software_region_length( "rom" );
state->m_cart_ram = image.get_software_region( "ram" ); m_cart_ram = image.get_software_region( "ram" );
state->m_cart_ram_size = image.get_software_region_length( "ram" ); m_cart_ram_size = image.get_software_region_length( "ram" );
} }
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
@ -861,8 +859,8 @@ 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_cart ) MCFG_CARTSLOT_START( scv_state, scv_cart )
MCFG_CARTSLOT_LOAD( scv_cart ) MCFG_CARTSLOT_LOAD( scv_state, scv_cart )
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","scv") MCFG_SOFTWARE_LIST_ADD("cart_list","scv")

View File

@ -674,7 +674,7 @@ void sg1000_state::install_cartridge(UINT8 *ptr, int size)
DEVICE_IMAGE_LOAD( sg1000_cart ) DEVICE_IMAGE_LOAD( sg1000_cart )
-------------------------------------------------*/ -------------------------------------------------*/
static DEVICE_IMAGE_LOAD( sg1000_cart ) DEVICE_IMAGE_LOAD_MEMBER( sg1000_state,sg1000_cart )
{ {
running_machine &machine = image.device().machine(); running_machine &machine = image.device().machine();
sg1000_state *state = machine.driver_data<sg1000_state>(); sg1000_state *state = machine.driver_data<sg1000_state>();
@ -788,7 +788,7 @@ static DEVICE_IMAGE_LOAD( sg1000_cart )
DEVICE_IMAGE_LOAD( omv_cart ) DEVICE_IMAGE_LOAD( omv_cart )
-------------------------------------------------*/ -------------------------------------------------*/
static DEVICE_IMAGE_LOAD( omv_cart ) DEVICE_IMAGE_LOAD_MEMBER( sg1000_state,omv_cart )
{ {
running_machine &machine = image.device().machine(); running_machine &machine = image.device().machine();
sg1000_state *state = machine.driver_data<sg1000_state>(); sg1000_state *state = machine.driver_data<sg1000_state>();
@ -845,7 +845,7 @@ void sc3000_state::install_cartridge(UINT8 *ptr, int size)
DEVICE_IMAGE_LOAD( sc3000_cart ) DEVICE_IMAGE_LOAD( sc3000_cart )
-------------------------------------------------*/ -------------------------------------------------*/
static DEVICE_IMAGE_LOAD( sc3000_cart ) DEVICE_IMAGE_LOAD_MEMBER( sc3000_state,sc3000_cart )
{ {
running_machine &machine = image.device().machine(); running_machine &machine = image.device().machine();
sc3000_state *state = machine.driver_data<sc3000_state>(); sc3000_state *state = machine.driver_data<sc3000_state>();
@ -1097,7 +1097,7 @@ static MACHINE_CONFIG_START( sg1000, sg1000_state )
MCFG_CARTSLOT_EXTENSION_LIST("sg,bin") MCFG_CARTSLOT_EXTENSION_LIST("sg,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("sg1000_cart") MCFG_CARTSLOT_INTERFACE("sg1000_cart")
MCFG_CARTSLOT_LOAD(sg1000_cart) MCFG_CARTSLOT_LOAD(sg1000_state,sg1000_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000") MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000")
@ -1119,7 +1119,7 @@ static MACHINE_CONFIG_DERIVED( omv, sg1000 )
MCFG_CARTSLOT_MODIFY("cart") MCFG_CARTSLOT_MODIFY("cart")
MCFG_CARTSLOT_EXTENSION_LIST("sg,bin") MCFG_CARTSLOT_EXTENSION_LIST("sg,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(omv_cart) MCFG_CARTSLOT_LOAD(sg1000_state,omv_cart)
MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_MODIFY(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("2K") MCFG_RAM_DEFAULT_SIZE("2K")
@ -1156,7 +1156,7 @@ static MACHINE_CONFIG_START( sc3000, sc3000_state )
MCFG_CARTSLOT_EXTENSION_LIST("sg,sc,bin") MCFG_CARTSLOT_EXTENSION_LIST("sg,sc,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("sg1000_cart") MCFG_CARTSLOT_INTERFACE("sg1000_cart")
MCFG_CARTSLOT_LOAD(sc3000_cart) MCFG_CARTSLOT_LOAD(sc3000_state,sc3000_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000") MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000")

View File

@ -402,8 +402,8 @@ 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_cart) MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","sms") MCFG_SOFTWARE_LIST_ADD("cart_list","sms")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -413,8 +413,8 @@ 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_cart) MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","gamegear") MCFG_SOFTWARE_LIST_ADD("cart_list","gamegear")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -495,8 +495,8 @@ 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_cart) \ MCFG_CARTSLOT_START(sms_state,sms_cart) \
MCFG_CARTSLOT_LOAD(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,8 +512,8 @@ 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_cart) MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MCFG_SMSSDISP_CARTSLOT_ADD("cart2") MCFG_SMSSDISP_CARTSLOT_ADD("cart2")
MCFG_SMSSDISP_CARTSLOT_ADD("cart3") MCFG_SMSSDISP_CARTSLOT_ADD("cart3")
@ -617,8 +617,8 @@ 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_cart) MCFG_CARTSLOT_START(sms_state,sms_cart)
MCFG_CARTSLOT_LOAD(sms_cart) MCFG_CARTSLOT_LOAD(sms_state,sms_cart)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( sms2_fm, sms2_ntsc ) static MACHINE_CONFIG_DERIVED( sms2_fm, sms2_ntsc )

View File

@ -663,7 +663,7 @@ static const cassette_interface spectrum_cassette_interface =
NULL NULL
}; };
static DEVICE_IMAGE_LOAD( spectrum_cart ) DEVICE_IMAGE_LOAD_MEMBER( spectrum_state,spectrum_cart )
{ {
UINT32 filesize; UINT32 filesize;
@ -732,7 +732,7 @@ MACHINE_CONFIG_START( spectrum_common, spectrum_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(spectrum_cart) MCFG_CARTSLOT_LOAD(spectrum_state,spectrum_cart)
MCFG_CARTSLOT_INTERFACE("spectrum_cart") MCFG_CARTSLOT_INTERFACE("spectrum_cart")
MCFG_SOFTWARE_LIST_ADD("cart_list","spectrum") MCFG_SOFTWARE_LIST_ADD("cart_list","spectrum")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -24,6 +24,7 @@ public:
virtual void machine_reset(); virtual void machine_reset();
UINT32 screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_INPUT_CHANGED_MEMBER(panel_check); DECLARE_INPUT_CHANGED_MEMBER(panel_check);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(ssem_store);
}; };
@ -514,7 +515,7 @@ static void strlower(char *buf)
* Image loading * * Image loading *
\****************************************************/ \****************************************************/
static DEVICE_IMAGE_LOAD(ssem_store) DEVICE_IMAGE_LOAD_MEMBER(ssem_state,ssem_store)
{ {
ssem_state *state = image.device().machine().driver_data<ssem_state>(); ssem_state *state = image.device().machine().driver_data<ssem_state>();
const char* image_name = image.filename(); const char* image_name = image.filename();
@ -650,7 +651,7 @@ static MACHINE_CONFIG_START( ssem, ssem_state )
/* cartridge */ /* cartridge */
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("snp,asm") MCFG_CARTSLOT_EXTENSION_LIST("snp,asm")
MCFG_CARTSLOT_LOAD(ssem_store) MCFG_CARTSLOT_LOAD(ssem_state,ssem_store)
MACHINE_CONFIG_END MACHINE_CONFIG_END
ROM_START( ssem ) ROM_START( ssem )

View File

@ -433,7 +433,7 @@ void mpt02_state::machine_reset()
m_cti->reset(); m_cti->reset();
} }
DEVICE_IMAGE_LOAD( studio2_cart_load ) DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load )
{ {
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
return device_load_st2_cartslot_load(image); return device_load_st2_cartslot_load(image);
@ -454,7 +454,7 @@ static MACHINE_CONFIG_FRAGMENT( studio2_cartslot )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("st2,bin") MCFG_CARTSLOT_EXTENSION_LIST("st2,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(studio2_cart_load) MCFG_CARTSLOT_LOAD(studio2_state,studio2_cart_load)
MCFG_CARTSLOT_INTERFACE("studio2_cart") MCFG_CARTSLOT_INTERFACE("studio2_cart")
/* software lists */ /* software lists */

View File

@ -207,6 +207,7 @@ public:
TIMER_CALLBACK_MEMBER(supracan_line_on_callback); TIMER_CALLBACK_MEMBER(supracan_line_on_callback);
TIMER_CALLBACK_MEMBER(supracan_line_off_callback); TIMER_CALLBACK_MEMBER(supracan_line_off_callback);
TIMER_CALLBACK_MEMBER(supracan_video_callback); TIMER_CALLBACK_MEMBER(supracan_video_callback);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(supracan_cart);
}; };
@ -1726,7 +1727,7 @@ WRITE16_MEMBER( supracan_state::supracan_video_w )
} }
static DEVICE_IMAGE_LOAD( supracan_cart ) DEVICE_IMAGE_LOAD_MEMBER( supracan_state, supracan_cart )
{ {
UINT8 *cart = image.device().machine().root_device().memregion("cart")->base(); UINT8 *cart = image.device().machine().root_device().memregion("cart")->base();
UINT32 size = 0; UINT32 size = 0;
@ -1906,7 +1907,7 @@ static MACHINE_CONFIG_START( supracan, supracan_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("bin") MCFG_CARTSLOT_EXTENSION_LIST("bin")
MCFG_CARTSLOT_INTERFACE("supracan_cart") MCFG_CARTSLOT_INTERFACE("supracan_cart")
MCFG_CARTSLOT_LOAD(supracan_cart) MCFG_CARTSLOT_LOAD(supracan_state,supracan_cart)
MCFG_SOFTWARE_LIST_ADD("cart_list","supracan") MCFG_SOFTWARE_LIST_ADD("cart_list","supracan")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -299,9 +299,9 @@ 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_cart) MCFG_CARTSLOT_START(svi318_state,svi318_cart)
MCFG_CARTSLOT_LOAD(svi318_cart) MCFG_CARTSLOT_LOAD(svi318_state,svi318_cart)
MCFG_CARTSLOT_UNLOAD(svi318_cart) MCFG_CARTSLOT_UNLOAD(svi318_state,svi318_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","svi318_cart") MCFG_SOFTWARE_LIST_ADD("cart_list","svi318_cart")

View File

@ -471,7 +471,7 @@ DRIVER_INIT_MEMBER(svision_state,svisions)
m_pet.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(svision_state::svision_pet_timer),this)); m_pet.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(svision_state::svision_pet_timer),this));
} }
static DEVICE_IMAGE_LOAD( svision_cart ) DEVICE_IMAGE_LOAD_MEMBER( svision_state, svision_cart )
{ {
UINT32 size; UINT32 size;
UINT8 *temp_copy; UINT8 *temp_copy;
@ -569,7 +569,7 @@ static MACHINE_CONFIG_START( svision, svision_state )
MCFG_CARTSLOT_EXTENSION_LIST("bin,ws,sv") MCFG_CARTSLOT_EXTENSION_LIST("bin,ws,sv")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("svision_cart") MCFG_CARTSLOT_INTERFACE("svision_cart")
MCFG_CARTSLOT_LOAD(svision_cart) MCFG_CARTSLOT_LOAD(svision_state, svision_cart)
/* Software lists */ /* Software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","svision") MCFG_SOFTWARE_LIST_ADD("cart_list","svision")

View File

@ -292,14 +292,6 @@ They can run the same software and accept the same devices and extensions.
**********************************************************************/ **********************************************************************/
class thomson_state : public driver_device
{
public:
thomson_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { }
};
/* ------------ address maps ------------ */ /* ------------ address maps ------------ */
@ -692,7 +684,7 @@ static MACHINE_CONFIG_START( to7, thomson_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("m7,rom") MCFG_CARTSLOT_EXTENSION_LIST("m7,rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(to7_cartridge) MCFG_CARTSLOT_LOAD(thomson_state,to7_cartridge)
MCFG_CARTSLOT_INTERFACE("to7_cart") MCFG_CARTSLOT_INTERFACE("to7_cart")
MCFG_SOFTWARE_LIST_ADD("cart_list","to7_cart") MCFG_SOFTWARE_LIST_ADD("cart_list","to7_cart")
@ -1067,7 +1059,7 @@ static MACHINE_CONFIG_DERIVED( mo5, to7 )
MCFG_CARTSLOT_MODIFY("cart") MCFG_CARTSLOT_MODIFY("cart")
MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") MCFG_CARTSLOT_EXTENSION_LIST("m5,rom")
MCFG_CARTSLOT_LOAD(mo5_cartridge) MCFG_CARTSLOT_LOAD(thomson_state,mo5_cartridge)
MCFG_CARTSLOT_INTERFACE("mo5_cart") MCFG_CARTSLOT_INTERFACE("mo5_cart")
MCFG_DEVICE_REMOVE("cart_list") MCFG_DEVICE_REMOVE("cart_list")
@ -2107,7 +2099,7 @@ static MACHINE_CONFIG_DERIVED( mo6, to7 )
MCFG_CARTSLOT_MODIFY("cart") MCFG_CARTSLOT_MODIFY("cart")
MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") MCFG_CARTSLOT_EXTENSION_LIST("m5,rom")
MCFG_CARTSLOT_LOAD(mo5_cartridge) MCFG_CARTSLOT_LOAD(thomson_state, mo5_cartridge)
/* internal ram */ /* internal ram */
MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_MODIFY(RAM_TAG)
@ -2332,7 +2324,7 @@ static MACHINE_CONFIG_DERIVED( mo5nr, to7 )
MCFG_CARTSLOT_MODIFY("cart") MCFG_CARTSLOT_MODIFY("cart")
MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") MCFG_CARTSLOT_EXTENSION_LIST("m5,rom")
MCFG_CARTSLOT_LOAD(mo5_cartridge) MCFG_CARTSLOT_LOAD(thomson_state, mo5_cartridge)
/* internal ram */ /* internal ram */
MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_MODIFY(RAM_TAG)

View File

@ -608,6 +608,18 @@ MACHINE_RESET_MEMBER(spectrum_state,tc2048)
} }
DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart )
{
return device_load_timex_cart( image );
}
DEVICE_IMAGE_UNLOAD_MEMBER( spectrum_state, timex_cart )
{
device_unload_timex_cart( image );
}
/* F4 Character Displayer - tc2048 code is inherited from the spectrum */ /* F4 Character Displayer - tc2048 code is inherited from the spectrum */
static const gfx_layout ts2068_charlayout = static const gfx_layout ts2068_charlayout =
{ {
@ -653,8 +665,8 @@ static MACHINE_CONFIG_DERIVED( ts2068, spectrum_128 )
MCFG_CARTSLOT_MODIFY("cart") MCFG_CARTSLOT_MODIFY("cart")
MCFG_CARTSLOT_EXTENSION_LIST("dck") MCFG_CARTSLOT_EXTENSION_LIST("dck")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(timex_cart) MCFG_CARTSLOT_LOAD(spectrum_state,timex_cart)
MCFG_CARTSLOT_UNLOAD(timex_cart) MCFG_CARTSLOT_UNLOAD(spectrum_state,timex_cart)
/* internal ram */ /* internal ram */
MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_MODIFY(RAM_TAG)

View File

@ -207,6 +207,8 @@ public:
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset(); virtual void machine_reset();
TIMER_CALLBACK_MEMBER(tape_interrupt_handler); TIMER_CALLBACK_MEMBER(tape_interrupt_handler);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( tutor_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( tutor_cart );
}; };
@ -296,7 +298,7 @@ READ8_MEMBER( tutor_state::key_r )
} }
static DEVICE_IMAGE_LOAD( tutor_cart ) DEVICE_IMAGE_LOAD_MEMBER( tutor_state, tutor_cart )
{ {
UINT32 size; UINT32 size;
UINT8 *ptr = image.device().machine().root_device().memregion("maincpu")->base(); UINT8 *ptr = image.device().machine().root_device().memregion("maincpu")->base();
@ -316,7 +318,7 @@ static DEVICE_IMAGE_LOAD( tutor_cart )
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_UNLOAD( tutor_cart ) DEVICE_IMAGE_UNLOAD_MEMBER( tutor_state, tutor_cart )
{ {
memset(image.device().machine().root_device().memregion("maincpu")->base() + cartridge_base, 0, 0x6000); memset(image.device().machine().root_device().memregion("maincpu")->base() + cartridge_base, 0, 0x6000);
} }
@ -781,8 +783,8 @@ static MACHINE_CONFIG_START( tutor, tutor_state )
/* cartridge */ /* cartridge */
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(tutor_cart) MCFG_CARTSLOT_LOAD(tutor_state, tutor_cart)
MCFG_CARTSLOT_UNLOAD(tutor_cart) MCFG_CARTSLOT_UNLOAD(tutor_state, tutor_cart)
MCFG_CARTSLOT_INTERFACE("tutor_cart") MCFG_CARTSLOT_INTERFACE("tutor_cart")
/* software lists */ /* software lists */

View File

@ -46,6 +46,7 @@ public:
void line_update(); void line_update();
int cart_load(device_image_interface &image); int cart_load(device_image_interface &image);
UINT32 screen_update_uzebox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_uzebox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(uzebox_cart);
private: private:
int m_vpos; int m_vpos;
@ -290,9 +291,9 @@ int uzebox_state::cart_load(device_image_interface &image)
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_LOAD(uzebox_cart) DEVICE_IMAGE_LOAD_MEMBER(uzebox_state,uzebox_cart)
{ {
return image.device().machine().driver_data<uzebox_state>()->cart_load(image); return cart_load(image);
} }
/****************************************************\ /****************************************************\
@ -329,7 +330,7 @@ static MACHINE_CONFIG_START( uzebox, uzebox_state )
MCFG_CARTSLOT_ADD("cart1") MCFG_CARTSLOT_ADD("cart1")
MCFG_CARTSLOT_EXTENSION_LIST("bin,uze") MCFG_CARTSLOT_EXTENSION_LIST("bin,uze")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_LOAD(uzebox_cart) MCFG_CARTSLOT_LOAD(uzebox_state,uzebox_cart)
MCFG_CARTSLOT_INTERFACE("uzebox") MCFG_CARTSLOT_INTERFACE("uzebox")
MCFG_SOFTWARE_LIST_ADD("eprom_list","uzebox") MCFG_SOFTWARE_LIST_ADD("eprom_list","uzebox")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -218,6 +218,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineL); TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineL);
TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineR); TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineR);
void vboy_machine_stop(); void vboy_machine_stop();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vboy_cart);
}; };
@ -1346,7 +1347,7 @@ WRITE32_MEMBER(vboy_state::sram_w)
} }
static DEVICE_IMAGE_LOAD( vboy_cart ) DEVICE_IMAGE_LOAD_MEMBER( vboy_state, vboy_cart )
{ {
vboy_state *state = image.device().machine().driver_data<vboy_state>(); vboy_state *state = image.device().machine().driver_data<vboy_state>();
UINT32 chip = 0; UINT32 chip = 0;
@ -1422,7 +1423,7 @@ static MACHINE_CONFIG_START( vboy, vboy_state )
MCFG_CARTSLOT_EXTENSION_LIST("vb,bin") MCFG_CARTSLOT_EXTENSION_LIST("vb,bin")
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("vboy_cart") MCFG_CARTSLOT_INTERFACE("vboy_cart")
MCFG_CARTSLOT_LOAD(vboy_cart) MCFG_CARTSLOT_LOAD(vboy_state, vboy_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","vboy") MCFG_SOFTWARE_LIST_ADD("cart_list","vboy")

View File

@ -335,10 +335,9 @@ void vc4000_state::palette_init()
palette_set_colors(machine(), 0, vc4000_palette, ARRAY_LENGTH(vc4000_palette)); palette_set_colors(machine(), 0, vc4000_palette, ARRAY_LENGTH(vc4000_palette));
} }
static DEVICE_IMAGE_LOAD( vc4000_cart ) DEVICE_IMAGE_LOAD_MEMBER( vc4000_state, vc4000_cart )
{ {
running_machine &machine = image.device().machine(); running_machine &machine = image.device().machine();
vc4000_state *state = machine.driver_data<vc4000_state>();
address_space &memspace = machine.device("maincpu")->memory().space(AS_PROGRAM); address_space &memspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 size; UINT32 size;
@ -353,23 +352,23 @@ static DEVICE_IMAGE_LOAD( vc4000_cart )
if (size > 0x1000) /* 6k rom + 1k ram - Chess2 only */ if (size > 0x1000) /* 6k rom + 1k ram - Chess2 only */
{ {
memspace.install_read_bank(0x0800, 0x15ff, "bank1"); /* extra rom */ memspace.install_read_bank(0x0800, 0x15ff, "bank1"); /* extra rom */
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000); membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000);
memspace.install_readwrite_bank(0x1800, 0x1bff, "bank2"); /* ram */ memspace.install_readwrite_bank(0x1800, 0x1bff, "bank2"); /* ram */
state->membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1800); membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1800);
} }
else if (size > 0x0800) /* some 4k roms have 1k of mirrored ram */ else if (size > 0x0800) /* some 4k roms have 1k of mirrored ram */
{ {
memspace.install_read_bank(0x0800, 0x0fff, "bank1"); /* extra rom */ memspace.install_read_bank(0x0800, 0x0fff, "bank1"); /* extra rom */
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800); membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800);
memspace.install_readwrite_bank(0x1000, 0x15ff, 0, 0x800, "bank2"); /* ram */ memspace.install_readwrite_bank(0x1000, 0x15ff, 0, 0x800, "bank2"); /* ram */
state->membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000); membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000);
} }
else if (size == 0x0800) /* 2k roms + 2k ram - Hobby Module(Radofin) and elektor TVGC*/ else if (size == 0x0800) /* 2k roms + 2k ram - Hobby Module(Radofin) and elektor TVGC*/
{ {
memspace.install_readwrite_bank(0x0800, 0x0fff, "bank1"); /* ram */ memspace.install_readwrite_bank(0x0800, 0x0fff, "bank1"); /* ram */
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800); membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x0800);
} }
if (size > 0) if (size > 0)
@ -417,7 +416,7 @@ static MACHINE_CONFIG_START( vc4000, vc4000_state )
MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_INTERFACE("vc4000_cart") MCFG_CARTSLOT_INTERFACE("vc4000_cart")
MCFG_CARTSLOT_LOAD(vc4000_cart) MCFG_CARTSLOT_LOAD(vc4000_state,vc4000_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","vc4000") MCFG_SOFTWARE_LIST_ADD("cart_list","vc4000")

View File

@ -143,6 +143,8 @@ public:
INTERRUPT_GEN_MEMBER(vii_vblank); INTERRUPT_GEN_MEMBER(vii_vblank);
TIMER_CALLBACK_MEMBER(tmb1_tick); TIMER_CALLBACK_MEMBER(tmb1_tick);
TIMER_CALLBACK_MEMBER(tmb2_tick); TIMER_CALLBACK_MEMBER(tmb2_tick);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vii_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vsmile_cart);
}; };
enum enum
@ -924,10 +926,9 @@ static INPUT_PORTS_START( walle )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button") PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("B Button")
INPUT_PORTS_END INPUT_PORTS_END
static DEVICE_IMAGE_LOAD( vii_cart ) DEVICE_IMAGE_LOAD_MEMBER( vii_state, vii_cart )
{ {
vii_state *state = image.device().machine().driver_data<vii_state>(); UINT8 *cart = memregion( "cart" )->base();
UINT8 *cart = state->memregion( "cart" )->base();
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
{ {
int size = image.length(); int size = image.length();
@ -942,7 +943,7 @@ static DEVICE_IMAGE_LOAD( vii_cart )
memcpy(cart, image.get_software_region("rom"), filesize); memcpy(cart, image.get_software_region("rom"), filesize);
} }
memcpy(state->m_p_cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2); memcpy(m_p_cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2);
if( cart[0x3cd808] == 0x99 && if( cart[0x3cd808] == 0x99 &&
cart[0x3cd809] == 0x99 && cart[0x3cd809] == 0x99 &&
@ -953,15 +954,14 @@ static DEVICE_IMAGE_LOAD( vii_cart )
cart[0x3cd80e] == 0x78 && cart[0x3cd80e] == 0x78 &&
cart[0x3cd80f] == 0x7f ) cart[0x3cd80f] == 0x7f )
{ {
state->m_centered_coordinates = 0; m_centered_coordinates = 0;
} }
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
static DEVICE_IMAGE_LOAD( vsmile_cart ) DEVICE_IMAGE_LOAD_MEMBER( vii_state, vsmile_cart )
{ {
vii_state *state = image.device().machine().driver_data<vii_state>(); UINT8 *cart = memregion( "cart" )->base();
UINT8 *cart = state->memregion( "cart" )->base();
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
{ {
int size = image.length(); int size = image.length();
@ -977,7 +977,7 @@ static DEVICE_IMAGE_LOAD( vsmile_cart )
int filesize = image.get_software_region_length("rom"); int filesize = image.get_software_region_length("rom");
memcpy(cart, image.get_software_region("rom"), filesize); memcpy(cart, image.get_software_region("rom"), filesize);
} }
memcpy(state->m_p_cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2); memcpy(m_p_cart, cart + 0x4000*2, (0x400000 - 0x4000) * 2);
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
@ -1105,7 +1105,7 @@ static MACHINE_CONFIG_START( vii, vii_state )
MCFG_CARTSLOT_ADD( "cart" ) MCFG_CARTSLOT_ADD( "cart" )
MCFG_CARTSLOT_EXTENSION_LIST( "bin" ) MCFG_CARTSLOT_EXTENSION_LIST( "bin" )
MCFG_CARTSLOT_LOAD( vii_cart ) MCFG_CARTSLOT_LOAD( vii_state, vii_cart )
MCFG_CARTSLOT_INTERFACE("vii_cart") MCFG_CARTSLOT_INTERFACE("vii_cart")
MCFG_SOFTWARE_LIST_ADD("vii_cart","vii") MCFG_SOFTWARE_LIST_ADD("vii_cart","vii")
@ -1128,7 +1128,7 @@ static MACHINE_CONFIG_START( vsmile, vii_state )
MCFG_CARTSLOT_ADD( "cart" ) MCFG_CARTSLOT_ADD( "cart" )
MCFG_CARTSLOT_EXTENSION_LIST( "bin" ) MCFG_CARTSLOT_EXTENSION_LIST( "bin" )
MCFG_CARTSLOT_MANDATORY MCFG_CARTSLOT_MANDATORY
MCFG_CARTSLOT_LOAD( vsmile_cart ) MCFG_CARTSLOT_LOAD( vii_state, vsmile_cart )
MACHINE_CONFIG_END MACHINE_CONFIG_END
static const i2cmem_interface i2cmem_interface = static const i2cmem_interface i2cmem_interface =

View File

@ -459,8 +459,8 @@ static MACHINE_CONFIG_START( laser350, vtech2_state )
MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_ADD("cart")
MCFG_CARTSLOT_EXTENSION_LIST("rom") MCFG_CARTSLOT_EXTENSION_LIST("rom")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(laser_cart) MCFG_CARTSLOT_LOAD(vtech2_state,laser_cart)
MCFG_CARTSLOT_UNLOAD(laser_cart) MCFG_CARTSLOT_UNLOAD(vtech2_state,laser_cart)
/* 5.25" Floppy drive */ /* 5.25" Floppy drive */
MCFG_LEGACY_FLOPPY_DRIVE_ADD( FLOPPY_0, vtech2_floppy_interface ) MCFG_LEGACY_FLOPPY_DRIVE_ADD( FLOPPY_0, vtech2_floppy_interface )

View File

@ -155,8 +155,8 @@ 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_cart) MCFG_CARTSLOT_START(wswan_state,wswan_cart)
MCFG_CARTSLOT_LOAD(wswan_cart) MCFG_CARTSLOT_LOAD(wswan_state,wswan_cart)
/* software lists */ /* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list","wswan") MCFG_SOFTWARE_LIST_ADD("cart_list","wswan")

View File

@ -1034,16 +1034,14 @@ inline void x07_state::draw_udk()
} }
} }
static DEVICE_IMAGE_LOAD( x07_card ) DEVICE_IMAGE_LOAD_MEMBER( x07_state, x07_card )
{ {
running_machine &machine = image.device().machine(); address_space &space = m_maincpu->space( AS_PROGRAM );
x07_state *state = machine.driver_data<x07_state>(); UINT16 ram_size = m_ram->size();
address_space &space = state->m_maincpu->space( AS_PROGRAM );
UINT16 ram_size = state->m_ram->size();
if (image.software_entry() == NULL) if (image.software_entry() == NULL)
{ {
UINT8 *rom = machine.memory().region_alloc( "card", image.length(), 1, ENDIANNESS_LITTLE )->base(); UINT8 *rom = machine().memory().region_alloc( "card", image.length(), 1, ENDIANNESS_LITTLE )->base();
image.fread(rom, image.length()); image.fread(rom, image.length());
space.install_ram(ram_size, ram_size + 0xfff); space.install_ram(ram_size, ram_size + 0xfff);
@ -1537,7 +1535,7 @@ static MACHINE_CONFIG_START( x07, x07_state )
MCFG_CARTSLOT_ADD("card") MCFG_CARTSLOT_ADD("card")
MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") MCFG_CARTSLOT_EXTENSION_LIST("rom,bin")
MCFG_CARTSLOT_NOT_MANDATORY MCFG_CARTSLOT_NOT_MANDATORY
MCFG_CARTSLOT_LOAD(x07_card) MCFG_CARTSLOT_LOAD(x07_state,x07_card)
MCFG_CARTSLOT_INTERFACE("x07_card") MCFG_CARTSLOT_INTERFACE("x07_card")
/* cassette */ /* cassette */

View File

@ -47,7 +47,7 @@ struct st2_header
DEVICE_IMAGE_LOAD( st2_cartslot_load ) DEVICE_IMAGE_LOAD( st2_cartslot_load )
-------------------------------------------------*/ -------------------------------------------------*/
DEVICE_IMAGE_LOAD( st2_cartslot_load ) DEVICE_IMAGE_LOAD_LEGACY( st2_cartslot_load )
{ {
st2_header header; st2_header header;

View File

@ -13,6 +13,6 @@
#include "emu.h" #include "emu.h"
DEVICE_IMAGE_LOAD( st2_cartslot_load ); DEVICE_IMAGE_LOAD_LEGACY( st2_cartslot_load );
#endif #endif

View File

@ -31,7 +31,7 @@
static timex_cart_t timex_cart; static timex_cart_t timex_cart;
DEVICE_IMAGE_LOAD( timex_cart ) DEVICE_IMAGE_LOAD_LEGACY( timex_cart )
{ {
int file_size; int file_size;
UINT8 * file_data; UINT8 * file_data;
@ -111,7 +111,7 @@ DEVICE_IMAGE_LOAD( timex_cart )
return IMAGE_INIT_PASS; return IMAGE_INIT_PASS;
} }
DEVICE_IMAGE_UNLOAD( timex_cart ) DEVICE_IMAGE_UNLOAD_LEGACY( timex_cart )
{ {
if (timex_cart.data) if (timex_cart.data)
{ {

View File

@ -27,7 +27,7 @@ struct timex_cart_t
const timex_cart_t *timex_cart_data(void); const timex_cart_t *timex_cart_data(void);
DEVICE_IMAGE_LOAD( timex_cart ); DEVICE_IMAGE_LOAD_LEGACY( timex_cart );
DEVICE_IMAGE_UNLOAD( timex_cart ); DEVICE_IMAGE_UNLOAD_LEGACY( timex_cart );
#endif /* __TIMEX_DCK_H__ */ #endif /* __TIMEX_DCK_H__ */

View File

@ -70,6 +70,9 @@ public:
DECLARE_READ8_MEMBER(riot_joystick_r); DECLARE_READ8_MEMBER(riot_joystick_r);
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 );
}; };
/*----------- defined in machine/a7800.c -----------*/ /*----------- defined in machine/a7800.c -----------*/
@ -78,7 +81,4 @@ extern const riot6532_interface a7800_r6532_interface;
void a7800_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); void a7800_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions);
DEVICE_START( a7800_cart );
DEVICE_IMAGE_LOAD( a7800_cart );
#endif /* A7800_H_ */ #endif /* A7800_H_ */

View File

@ -191,6 +191,8 @@ public:
DECLARE_FLOPPY_FORMATS( floppy_formats ); DECLARE_FLOPPY_FORMATS( floppy_formats );
IRQ_CALLBACK_MEMBER(amstrad_cpu_acknowledge_int); IRQ_CALLBACK_MEMBER(amstrad_cpu_acknowledge_int);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( amstrad_plus_cartridge );
}; };
@ -204,8 +206,6 @@ WRITE_LINE_DEVICE_HANDLER( cpc_romen );
SNAPSHOT_LOAD( amstrad ); SNAPSHOT_LOAD( amstrad );
DEVICE_IMAGE_LOAD(amstrad_plus_cartridge);
extern const mc6845_interface amstrad_mc6845_intf; extern const mc6845_interface amstrad_mc6845_intf;
extern const mc6845_interface amstrad_plus_mc6845_intf; extern const mc6845_interface amstrad_plus_mc6845_intf;

View File

@ -93,6 +93,7 @@ public:
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(arcadia_video_line); INTERRUPT_GEN_MEMBER(arcadia_video_line);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( arcadia_cart );
protected: protected:
required_device<arcadia_sound_device> m_custom; required_device<arcadia_sound_device> m_custom;

View File

@ -116,6 +116,8 @@ public:
/* devices */ /* devices */
int m_previous_i8271_int_state; int m_previous_i8271_int_state;
TIMER_DEVICE_CALLBACK_MEMBER(cassette_output_tick); TIMER_DEVICE_CALLBACK_MEMBER(cassette_output_tick);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( atom_cart );
}; };
class atomeb_state : public atom_state class atomeb_state : public atom_state

View File

@ -304,6 +304,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_intrq_w); DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_intrq_w);
DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_drq_w); DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_drq_w);
DECLARE_WRITE_LINE_MEMBER(bbc_vsync); DECLARE_WRITE_LINE_MEMBER(bbc_vsync);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( bbcb_cart );
}; };
@ -317,10 +319,6 @@ extern const via6522_interface bbcb_system_via;
extern const via6522_interface bbcb_user_via; extern const via6522_interface bbcb_user_via;
extern const wd17xx_interface bbc_wd17xx_interface; extern const wd17xx_interface bbc_wd17xx_interface;
/* disc support */
DEVICE_IMAGE_LOAD ( bbcb_cart );
/* tape support */ /* tape support */

View File

@ -47,6 +47,8 @@ public:
DECLARE_WRITE8_MEMBER( riot_pb_w ); DECLARE_WRITE8_MEMBER( riot_pb_w );
DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( beta_eprom );
/* EPROM state */ /* EPROM state */
int m_eprom_oe; int m_eprom_oe;
int m_eprom_ce; int m_eprom_ce;

View File

@ -89,6 +89,9 @@ 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 );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( c64_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( c64_cart );
}; };

View File

@ -51,6 +51,7 @@ public:
virtual void video_start(); virtual void video_start();
virtual void palette_init(); virtual void palette_init();
UINT32 screen_update_channelf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_channelf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( channelf_cart );
}; };

View File

@ -48,6 +48,7 @@ public:
TIMER_CALLBACK_MEMBER(paddle_pulse_callback); TIMER_CALLBACK_MEMBER(paddle_pulse_callback);
TIMER_DEVICE_CALLBACK_MEMBER(paddle_update_callback); TIMER_DEVICE_CALLBACK_MEMBER(paddle_update_callback);
DECLARE_WRITE_LINE_MEMBER(coleco_vdp_interrupt); DECLARE_WRITE_LINE_MEMBER(coleco_vdp_interrupt);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(czz50_cart);
}; };
#endif #endif

View File

@ -53,6 +53,7 @@ public:
DECLARE_READ8_MEMBER( pia_pa_r ); DECLARE_READ8_MEMBER( pia_pa_r );
DECLARE_READ8_MEMBER( pia_pb_r ); DECLARE_READ8_MEMBER( pia_pb_r );
DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi ); DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( crvision_cart );
UINT8 read_keyboard(int pa); UINT8 read_keyboard(int pa);

View File

@ -260,6 +260,8 @@ public:
TIMER_CALLBACK_MEMBER(gamecom_scanline); TIMER_CALLBACK_MEMBER(gamecom_scanline);
DECLARE_WRITE8_MEMBER( gamecom_handle_dma ); DECLARE_WRITE8_MEMBER( gamecom_handle_dma );
DECLARE_WRITE8_MEMBER( gamecom_update_timers ); DECLARE_WRITE8_MEMBER( gamecom_update_timers );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( gamecom_cart1 );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( gamecom_cart2 );
protected: protected:
required_memory_bank m_bank1; required_memory_bank m_bank1;
@ -275,10 +277,4 @@ protected:
required_ioport m_io_styy; required_ioport m_io_styy;
}; };
/*----------- defined in machine/gamecom.c -----------*/
extern DEVICE_IMAGE_LOAD( gamecom_cart1 );
extern DEVICE_IMAGE_LOAD( gamecom_cart2 );
#endif /* GAMECOM_H_ */ #endif /* GAMECOM_H_ */

View File

@ -30,6 +30,8 @@ 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);
}; };

View File

@ -267,6 +267,9 @@ 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_DEVICE_IMAGE_LOAD_MEMBER(gb_cart);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(megaduck_cart);
protected: protected:
required_device<lr35902_cpu_device> m_maincpu; required_device<lr35902_cpu_device> m_maincpu;
@ -308,21 +311,12 @@ protected:
/*----------- defined in machine/gb.c -----------*/ /*----------- defined in machine/gb.c -----------*/
DEVICE_START(gb_cart);
DEVICE_IMAGE_LOAD(gb_cart);
/* -- Super Game Boy specific -- */ /* -- Super Game Boy specific -- */
#define SGB_BORDER_PAL_OFFSET 64 /* Border colours stored from pal 4-7 */ #define SGB_BORDER_PAL_OFFSET 64 /* Border colours stored from pal 4-7 */
#define SGB_XOFFSET 48 /* GB screen starts at column 48 */ #define SGB_XOFFSET 48 /* GB screen starts at column 48 */
#define SGB_YOFFSET 40 /* GB screen starts at row 40 */ #define SGB_YOFFSET 40 /* GB screen starts at row 40 */
/* -- Megaduck specific -- */
extern DEVICE_IMAGE_LOAD(megaduck_cart);
/*----------- defined in video/gb.c -----------*/ /*----------- defined in video/gb.c -----------*/
enum enum

View File

@ -278,6 +278,7 @@ public:
TIMER_CALLBACK_MEMBER(perform_hbl); TIMER_CALLBACK_MEMBER(perform_hbl);
TIMER_CALLBACK_MEMBER(perform_scan); TIMER_CALLBACK_MEMBER(perform_scan);
void gba_machine_stop(); void gba_machine_stop();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gba_cart);
}; };
/*----------- defined in video/gba.c -----------*/ /*----------- defined in video/gba.c -----------*/

View File

@ -140,20 +140,12 @@ public:
TIMER_CALLBACK_MEMBER(intv_interrupt2_complete); TIMER_CALLBACK_MEMBER(intv_interrupt2_complete);
TIMER_CALLBACK_MEMBER(intv_interrupt_complete); TIMER_CALLBACK_MEMBER(intv_interrupt_complete);
TIMER_CALLBACK_MEMBER(intv_btb_fill); TIMER_CALLBACK_MEMBER(intv_btb_fill);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( intv_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( intvkbd_cart );
}; };
/*----------- defined in video/intv.c -----------*/ /*----------- defined in video/intv.c -----------*/
void intv_stic_screenrefresh(running_machine &machine); void intv_stic_screenrefresh(running_machine &machine);
/*----------- defined in machine/intv.c -----------*/
/* for the console alone... */
DEVICE_START( intv_cart );
DEVICE_IMAGE_LOAD( intv_cart );
/* for the console + keyboard component... */
DEVICE_IMAGE_LOAD( intvkbd_cart );
#endif /* INTV_H_ */ #endif /* INTV_H_ */

View File

@ -145,6 +145,7 @@ public:
TIMER_CALLBACK_MEMBER(lynx_uart_loopback_timer); TIMER_CALLBACK_MEMBER(lynx_uart_loopback_timer);
TIMER_CALLBACK_MEMBER(lynx_uart_timer); TIMER_CALLBACK_MEMBER(lynx_uart_timer);
void lynx_postload(); void lynx_postload();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( lynx_cart );
}; };

View File

@ -130,6 +130,9 @@ public:
DECLARE_WRITE8_MEMBER(msx_printer_strobe_w); DECLARE_WRITE8_MEMBER(msx_printer_strobe_w);
DECLARE_WRITE8_MEMBER(msx_printer_data_w); DECLARE_WRITE8_MEMBER(msx_printer_data_w);
DECLARE_READ8_MEMBER(msx_printer_status_r); DECLARE_READ8_MEMBER(msx_printer_status_r);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( msx_cart );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( msx_cart );
}; };
@ -139,9 +142,6 @@ extern const i8255_interface msx_ppi8255_interface;
extern const wd17xx_interface msx_wd17xx_interface; extern const wd17xx_interface msx_wd17xx_interface;
/* start/stop functions */ /* start/stop functions */
DEVICE_IMAGE_LOAD( msx_cart );
DEVICE_IMAGE_UNLOAD( msx_cart );
void msx_vdp_interrupt(device_t *, v99x8_device &device, int i); void msx_vdp_interrupt(device_t *, v99x8_device &device, int i);
/* I/O functions */ /* I/O functions */

View File

@ -54,6 +54,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(nascom2_fdc_drq_w); DECLARE_WRITE_LINE_MEMBER(nascom2_fdc_drq_w);
DECLARE_READ8_MEMBER(nascom1_hd6402_si); DECLARE_READ8_MEMBER(nascom1_hd6402_si);
DECLARE_WRITE8_MEMBER(nascom1_hd6402_so); DECLARE_WRITE8_MEMBER(nascom1_hd6402_so);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( nascom1_cassette );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( nascom1_cassette );
}; };
@ -61,7 +63,5 @@ public:
extern const wd17xx_interface nascom2_wd17xx_interface; extern const wd17xx_interface nascom2_wd17xx_interface;
DEVICE_IMAGE_LOAD( nascom1_cassette );
DEVICE_IMAGE_UNLOAD( nascom1_cassette );
SNAPSHOT_LOAD( nascom1 ); SNAPSHOT_LOAD( nascom1 );
#endif /* NASCOM1_H_ */ #endif /* NASCOM1_H_ */

View File

@ -94,6 +94,11 @@ public:
DECLARE_WRITE_LINE_MEMBER(nc200_fdc_interrupt); DECLARE_WRITE_LINE_MEMBER(nc200_fdc_interrupt);
void nc200_fdc_interrupt(bool state); void nc200_fdc_interrupt(bool state);
DECLARE_DEVICE_IMAGE_START_MEMBER( nc_pcmcia_card );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( nc_pcmcia_card );
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( nc_pcmcia_card );
void nc100_machine_stop(); void nc100_machine_stop();
void nc200_machine_stop(); void nc200_machine_stop();
}; };
@ -112,11 +117,4 @@ void nc200_video_set_backlight(running_machine &machine, int state);
void nc_set_card_present_state(running_machine &machine, int state); void nc_set_card_present_state(running_machine &machine, int state);
/*----------- defined in machine/nc.c -----------*/
DEVICE_START( nc_pcmcia_card );
DEVICE_IMAGE_LOAD( nc_pcmcia_card );
DEVICE_IMAGE_UNLOAD( nc_pcmcia_card );
#endif /* NC_H_ */ #endif /* NC_H_ */

View File

@ -126,6 +126,10 @@ public:
DECLARE_WRITE8_MEMBER(psg_4015_w); DECLARE_WRITE8_MEMBER(psg_4015_w);
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_START_MEMBER(nes_disk);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(nes_disk);
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER(nes_disk);
ioport_port *m_io_ctrlsel; ioport_port *m_io_ctrlsel;
ioport_port *m_io_fckey[9]; ioport_port *m_io_fckey[9];
@ -156,11 +160,6 @@ private:
/* protos */ /* protos */
DEVICE_IMAGE_LOAD(nes_cart);
DEVICE_START(nes_disk);
DEVICE_IMAGE_LOAD(nes_disk);
DEVICE_IMAGE_UNLOAD(nes_disk);
int nes_ppu_vidaccess( device_t *device, int address, int data ); int nes_ppu_vidaccess( device_t *device, int address, int data );
void nes_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); void nes_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions);

View File

@ -148,6 +148,8 @@ public:
void mc1502_fdc_irq_drq(bool state); void mc1502_fdc_irq_drq(bool state);
DECLARE_FLOPPY_FORMATS( floppy_formats ); DECLARE_FLOPPY_FORMATS( floppy_formats );
IRQ_CALLBACK_MEMBER(pc_irq_callback); IRQ_CALLBACK_MEMBER(pc_irq_callback);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pcjr_cartridge );
}; };
/*----------- defined in machine/pc.c -----------*/ /*----------- defined in machine/pc.c -----------*/
@ -173,9 +175,6 @@ void pc_speaker_set_input(running_machine &machine, UINT8 data);
void mess_init_pc_common( running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int), void (*set_hdc_int_func)(running_machine &,int,int)); void mess_init_pc_common( running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int), void (*set_hdc_int_func)(running_machine &,int,int));
DEVICE_IMAGE_LOAD( pcjr_cartridge );
void pc_rtc_init(running_machine &machine); void pc_rtc_init(running_machine &machine);

View File

@ -153,11 +153,11 @@ public:
TIMER_CALLBACK_MEMBER(pce_cd_clear_ack); TIMER_CALLBACK_MEMBER(pce_cd_clear_ack);
TIMER_CALLBACK_MEMBER(pce_cd_adpcm_dma_timer_callback); TIMER_CALLBACK_MEMBER(pce_cd_adpcm_dma_timer_callback);
DECLARE_WRITE_LINE_MEMBER(pce_irq_changed); DECLARE_WRITE_LINE_MEMBER(pce_irq_changed);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pce_cart);
}; };
/*----------- defined in machine/pce.c -----------*/ /*----------- defined in machine/pce.c -----------*/
DEVICE_IMAGE_LOAD(pce_cart);
extern const msm5205_interface pce_cd_msm5205_interface; extern const msm5205_interface pce_cd_msm5205_interface;
#endif /* PCE_H_ */ #endif /* PCE_H_ */

View File

@ -78,6 +78,7 @@ public:
TIMER_CALLBACK_MEMBER(pokemini_prc_counter_callback); TIMER_CALLBACK_MEMBER(pokemini_prc_counter_callback);
DECLARE_WRITE8_MEMBER(pokemini_hwreg_w); DECLARE_WRITE8_MEMBER(pokemini_hwreg_w);
DECLARE_READ8_MEMBER(pokemini_hwreg_r); DECLARE_READ8_MEMBER(pokemini_hwreg_r);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pokemini_cart);
protected: protected:
required_device<speaker_sound_device> m_speaker; required_device<speaker_sound_device> m_speaker;
@ -88,8 +89,4 @@ protected:
void pokemini_update_sound(); void pokemini_update_sound();
}; };
/*----------- defined in machine/pokemini.c -----------*/
DEVICE_IMAGE_LOAD( pokemini_cart );
#endif /* POKEMINI_H */ #endif /* POKEMINI_H */

View File

@ -112,6 +112,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(counter_tick); TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
DECLARE_READ8_MEMBER(hd61830_rd_r); DECLARE_READ8_MEMBER(hd61830_rd_r);
IRQ_CALLBACK_MEMBER(portfolio_int_ack); IRQ_CALLBACK_MEMBER(portfolio_int_ack);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( portfolio_cart );
}; };
#endif #endif

View File

@ -67,6 +67,8 @@ public:
DECLARE_READ8_MEMBER( tvdraw_data_r ); DECLARE_READ8_MEMBER( tvdraw_data_r );
DECLARE_READ8_MEMBER( joysel_r ); DECLARE_READ8_MEMBER( joysel_r );
DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi ); DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( sg1000_cart );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( omv_cart );
/* keyboard state */ /* keyboard state */
UINT8 m_keylatch; UINT8 m_keylatch;
@ -126,6 +128,7 @@ public:
DECLARE_READ8_MEMBER( ppi_pa_r ); DECLARE_READ8_MEMBER( ppi_pa_r );
DECLARE_READ8_MEMBER( ppi_pb_r ); DECLARE_READ8_MEMBER( ppi_pb_r );
DECLARE_WRITE8_MEMBER( ppi_pc_w ); DECLARE_WRITE8_MEMBER( ppi_pc_w );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( sc3000_cart );
ioport_port* m_key_row[16]; ioport_port* m_key_row[16];
}; };

Some files were not shown because too many files have changed in this diff Show More