(MESS) msx.c: Bye bye MSX_DRIVER_LIST. (nw)

This commit is contained in:
Wilbert Pol 2014-04-14 21:28:36 +00:00
parent 85621ccc9a
commit 621d0a7b6f
4 changed files with 782 additions and 351 deletions

File diff suppressed because it is too large Load Diff

View File

@ -35,11 +35,15 @@
#define TC8521_TAG "rtc"
#define MCFG_MSX_LAYOUT(_layout) \
msx_state::set_layout(*owner, msx_slot_layout_##_layout);
class msx_state : public driver_device
{
public:
msx_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_layout(NULL),
m_maincpu(*this, "maincpu"),
m_v9938(*this, "v9938"),
m_v9958(*this, "v9958"),
@ -74,6 +78,9 @@ public:
m_io_key4(*this, "KEY4"),
m_io_key5(*this, "KEY5") { }
// static configuration helpers
static void set_layout(device_t &device, const msx_slot_layout *layout) { downcast<msx_state &>(device).m_layout = layout; }
DECLARE_WRITE8_MEMBER(msx_page0_w);
DECLARE_WRITE8_MEMBER(msx_page0_1_w);
DECLARE_WRITE8_MEMBER(msx_page1_w);

View File

@ -237,20 +237,5 @@ const msx_slot msx_slot_list[] = {
#define MSX_SLOT_SAVESRAM(nm) \
static int slot_##nm##_savesram (running_machine &machine, slot_state *state)
struct msx_driver_struct {
char name[9];
const msx_slot_layout *layout;
};
extern const msx_driver_struct msx_driver_list[];
#define MSX_DRIVER_LIST \
const msx_driver_struct msx_driver_list[] = {
#define MSX_DRIVER(foo) \
{ #foo, msx_slot_layout_##foo },
#define MSX_DRIVER_END \
{ "", NULL } \
};
#endif /* MSX_SLOT_H_ */

View File

@ -788,10 +788,13 @@ void msx_state::msx_memory_init()
int size = 0;
const msx_slot_layout *layout= (msx_slot_layout*)NULL;
const msx_slot *slot;
const msx_driver_struct *driver;
slot_state *st;
UINT8 *mem = NULL;
if ( m_layout == NULL ) {
fatalerror("No msx slot layout defined for this system!\n");
}
m_empty = auto_alloc_array(machine(), UINT8, 0x4000);
memset (m_empty, 0xff, 0x4000);
@ -803,21 +806,7 @@ void msx_state::msx_memory_init()
}
}
for (driver = msx_driver_list; driver->name[0]; driver++) {
if (!strcmp (driver->name, machine().system().name)) {
layout = driver->layout;
}
}
if (!layout) {
logerror ("msx_memory_init: error: missing layout definition in "
"msx_driver_list\n");
return;
}
m_layout = layout;
for (; layout->entry != MSX_LAYOUT_LAST; layout++) {
for (layout = m_layout; layout->entry != MSX_LAYOUT_LAST; layout++) {
switch (layout->entry) {
case MSX_LAYOUT_SLOT_ENTRY:
prim = layout->slot_primary;