diimage.cpp: Allow image devices to be configured with a fixed

(not user selectable) piece of software and updated a few options
and menu to acknowledge such possibility. [Fabio Priuli]

macs.cpp: Converted to use generic cartslot with fixed software
configuration. Cleaned up loading and banking systems in the driver
as a result. [Fabio Priuli]
This commit is contained in:
etabeta78 2016-04-12 14:37:22 +02:00
parent b47168d7e6
commit c1600cafd9
11 changed files with 189 additions and 131 deletions

View File

@ -38,7 +38,8 @@ const device_type GENERIC_SOCKET = &device_creator<generic_slot_device>;
device_generic_cart_interface::device_generic_cart_interface(const machine_config &mconfig, device_t &device)
: device_slot_card_interface(mconfig, device),
m_rom(nullptr),
m_rom_size(0)
m_rom_size(0),
m_region(*this, DEVICE_SELF)
{
}

View File

@ -28,8 +28,8 @@ public:
virtual void rom_alloc(size_t size, int width, endianness_t end, const char *tag);
virtual void ram_alloc(UINT32 size);
UINT8* get_rom_base() { return m_rom; }
UINT32 get_rom_size() { return m_rom_size; }
UINT8* get_rom_base() { if (m_region.found()) return m_region->base(); return m_rom; }
UINT32 get_rom_size() { if (m_region.found()) return m_region->bytes(); return m_rom_size; }
UINT8* get_ram_base() { return &m_ram[0]; }
UINT32 get_ram_size() { return m_ram.size(); }
@ -40,6 +40,9 @@ public:
UINT8 *m_rom;
UINT32 m_rom_size;
dynamic_buffer m_ram;
// this replaces m_rom for non-user configurable carts!
optional_memory_region m_region;
};
@ -137,8 +140,8 @@ public:
virtual void rom_alloc(size_t size, int width, endianness_t end) { if (m_cart) m_cart->rom_alloc(size, width, end, tag()); }
virtual void ram_alloc(UINT32 size) { if (m_cart) m_cart->ram_alloc(size); }
UINT8* get_rom_base() { if (m_cart) return m_cart->get_rom_base(); return nullptr; }
UINT8* get_ram_base() { if (m_cart) return m_cart->get_ram_base(); return nullptr; }
UINT8* get_rom_base() { if (m_cart) return m_cart->get_rom_base(); return nullptr; }
UINT8* get_ram_base() { if (m_cart) return m_cart->get_ram_base(); return nullptr; }
UINT32 get_rom_size() { if (m_cart) return m_cart->get_rom_size(); return 0; }
void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
@ -173,4 +176,9 @@ extern const device_type GENERIC_SOCKET;
MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false) \
MCFG_GENERIC_INTERFACE(_dev_intf)
#define MCFG_GENERIC_CARTSLOT_ADD_WITH_DEFAULT(_tag, _slot_intf, _dev_intf, _default) \
MCFG_DEVICE_ADD(_tag, GENERIC_SOCKET, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _default, false) \
MCFG_GENERIC_INTERFACE(_dev_intf)
#endif

View File

@ -715,6 +715,9 @@ void cli_frontend::listmedia(const char *gamename)
bool first = true;
for (const device_image_interface *imagedev = iter.first(); imagedev != nullptr; imagedev = iter.next())
{
if (!imagedev->user_loadable())
continue;
// extract the shortname with parentheses
std::string paren_shortname = string_format("(%s)", imagedev->brief_instance_name());

View File

@ -68,6 +68,7 @@ device_image_interface::device_image_interface(const machine_config &mconfig, de
m_from_swlist(false),
m_create_format(0),
m_create_args(nullptr),
m_user_loadable(TRUE),
m_is_loading(FALSE)
{
}

View File

@ -129,6 +129,9 @@ typedef void (*device_image_partialhash_func)(hash_collection &, const unsigned
#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()))
#define MCFG_SET_IMAGE_LOADABLE(_usrload) \
device_image_interface::static_set_user_loadable(*device, _usrload);
// ======================> device_image_interface
@ -223,8 +226,6 @@ public:
const char *image_type_name() const { return device_typename(image_type()); }
const char *instance_name() const { return m_instance_name.c_str(); }
const char *brief_instance_name() const { return m_brief_instance_name.c_str(); }
bool uses_file_extension(const char *file_extension) const;
@ -239,6 +240,15 @@ public:
int reopen_for_write(const char *path);
static void software_name_split(const char *swlist_swname, std::string &swlist_name, std::string &swname, std::string &swpart);
static void static_set_user_loadable(device_t &device, bool user_loadable) {
device_image_interface *img;
if (!device.interface(img))
throw emu_fatalerror("MCFG_SET_IMAGE_LOADABLE called on device '%s' with no image interface\n", device.tag());
img->m_user_loadable = user_loadable;
}
bool user_loadable() const { return m_user_loadable; }
protected:
bool load_internal(const char *path, bool is_create, int create_format, option_resolution *create_args, bool just_load);
@ -311,10 +321,14 @@ protected:
std::string m_brief_instance_name;
std::string m_instance_name;
/* creation info */
simple_list<image_device_format> m_formatlist;
/* in the case of arcade cabinet with fixed carts inserted,
we want to disable command line cart loading... */
bool m_user_loadable;
bool m_is_loading;
};

View File

@ -346,7 +346,10 @@ void emu_options::add_device_options()
image_interface_iterator iter(config.root_device());
for (const device_image_interface *image = iter.first(); image != nullptr; image = iter.next())
{
// retrieve info about the device instance
if (!image->user_loadable())
continue;
// retrieve info about the device instance
std::ostringstream option_name;
util::stream_format(option_name, "%s;%s", image->instance_name(), image->brief_instance_name());
if (strcmp(image->device_typename(image->image_type()), image->instance_name()) == 0)

View File

@ -36,6 +36,9 @@ image_manager::image_manager(running_machine &machine)
/* is an image specified for this image */
image_name = machine.options().value(image->instance_name());
if (!image->user_loadable())
continue;
if ((image_name != nullptr) && (image_name[0] != '\0'))
{
/* mark init state */
@ -226,6 +229,7 @@ void image_manager::postdevice_init()
for (device_image_interface *image = iter.first(); image != nullptr; image = iter.next())
{
int result = image->finish_load();
/* did the image load fail? */
if (result)
{

View File

@ -148,6 +148,7 @@ const char info_xml_creator::s_dtd_string[] =
"\t\t<!ELEMENT device (instance*, extension*)>\n"
"\t\t\t<!ATTLIST device type CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST device tag CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST device fixed_image CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST device mandatory CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST device interface CDATA #IMPLIED>\n"
"\t\t\t<!ELEMENT instance EMPTY>\n"
@ -1428,6 +1429,7 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
{
if (strcmp(imagedev->device().tag(), device.tag()))
{
bool loadable = imagedev->user_loadable();
std::string newtag(imagedev->device().tag()), oldtag(":");
newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
@ -1438,9 +1440,13 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
if (imagedev->device().tag())
fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
// is this device mandatory?
if (imagedev->must_be_loaded())
fprintf(m_output, " mandatory=\"1\"");
// is this device available as media switch?
if (!loadable)
fprintf(m_output, " fixed_image=\"1\"");
// is this device mandatory?
if (imagedev->must_be_loaded())
fprintf(m_output, " mandatory=\"1\"");
if (imagedev->image_interface() && imagedev->image_interface()[0])
fprintf(m_output, " interface=\"%s\"", xml_normalize_string(imagedev->image_interface()));
@ -1448,25 +1454,27 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag)
// close the XML tag
fprintf(m_output, ">\n");
const char *name = imagedev->instance_name();
const char *shortname = imagedev->brief_instance_name();
fprintf(m_output, "\t\t\t<instance");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(name));
fprintf(m_output, " briefname=\"%s\"", xml_normalize_string(shortname));
fprintf(m_output, "/>\n");
std::string extensions(imagedev->file_extensions());
char *ext = strtok((char *)extensions.c_str(), ",");
while (ext != nullptr)
{
fprintf(m_output, "\t\t\t<extension");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(ext));
fprintf(m_output, "/>\n");
ext = strtok(nullptr, ",");
}
if (loadable)
{
const char *name = imagedev->instance_name();
const char *shortname = imagedev->brief_instance_name();
fprintf(m_output, "\t\t\t<instance");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(name));
fprintf(m_output, " briefname=\"%s\"", xml_normalize_string(shortname));
fprintf(m_output, "/>\n");
std::string extensions(imagedev->file_extensions());
char *ext = strtok((char *)extensions.c_str(), ",");
while (ext != nullptr)
{
fprintf(m_output, "\t\t\t<extension");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(ext));
fprintf(m_output, "/>\n");
ext = strtok(nullptr, ",");
}
}
fprintf(m_output, "\t\t</device>\n");
}
}

View File

@ -129,6 +129,9 @@ void ui_menu_file_manager::populate()
image_interface_iterator subiterator(*dev);
for (device_image_interface *scan = subiterator.first(); scan != nullptr; scan = subiterator.next())
{
if (!scan->user_loadable())
continue;
// if it is a children device, and not something further down the device tree, we want it in the menu!
if (strcmp(scan->device().owner()->tag(), dev->tag()) == 0)
if (devtags.insert(scan->device().tag()).second)

View File

@ -72,47 +72,46 @@ void ui_menu_main::populate()
item_append(_("Machine Information"), nullptr, 0, (void *)GAME_INFO);
image_interface_iterator imgiter(machine().root_device());
if (imgiter.first() != nullptr)
{
/* add image info menu */
item_append(_("Image Information"), nullptr, 0, (void *)IMAGE_MENU_IMAGE_INFO);
for (device_image_interface *image = imgiter.first(); image != nullptr; image = imgiter.next())
{
if (image->user_loadable())
{
/* add image info menu */
item_append(_("Image Information"), nullptr, 0, (void *)IMAGE_MENU_IMAGE_INFO);
/* add file manager menu */
item_append(_("File Manager"), nullptr, 0, (void *)IMAGE_MENU_FILE_MANAGER);
break;
}
}
/* add file manager menu */
item_append(_("File Manager"), nullptr, 0, (void *)IMAGE_MENU_FILE_MANAGER);
/* add tape control menu */
cassette_device_iterator cassiter(machine().root_device());
if (cassiter.first() != nullptr)
item_append(_("Tape Control"), nullptr, 0, (void *)TAPE_CONTROL);
/* add tape control menu */
cassette_device_iterator cassiter(machine().root_device());
if (cassiter.first() != nullptr)
item_append(_("Tape Control"), nullptr, 0, (void *)TAPE_CONTROL);
}
pty_interface_iterator ptyiter(machine().root_device());
if (ptyiter.first() != nullptr)
item_append(_("Pseudo terminals"), nullptr, 0, (void *)PTY_INFO);
pty_interface_iterator ptyiter(machine().root_device());
if (ptyiter.first() != nullptr) {
item_append(_("Pseudo terminals"), nullptr, 0, (void *)PTY_INFO);
}
if (machine().ioport().has_bioses())
if (machine().ioport().has_bioses())
item_append(_("Bios Selection"), nullptr, 0, (void *)BIOS_SELECTION);
/* add slot info menu */
slot_interface_iterator slotiter(machine().root_device());
if (slotiter.first() != nullptr)
{
/* add slot info menu */
item_append(_("Slot Devices"), nullptr, 0, (void *)SLOT_DEVICES);
}
/* add Barcode reader menu */
barcode_reader_device_iterator bcriter(machine().root_device());
if (bcriter.first() != nullptr)
{
/* add slot info menu */
item_append(_("Barcode Reader"), nullptr, 0, (void *)BARCODE_READ);
}
/* add network info menu */
network_interface_iterator netiter(machine().root_device());
if (netiter.first() != nullptr)
{
/* add image info menu */
item_append(_("Network Devices"), nullptr, 0, (void*)NETWORK_DEVICES);
}
/* add keyboard mode menu */
if (machine().ioport().has_keyboard() && machine().ioport().natkeyboard().can_post())

View File

@ -60,6 +60,8 @@ KISEKAE -- info
#include "emu.h"
#include "machine/st0016.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
class macs_state : public driver_device
{
@ -67,8 +69,9 @@ public:
macs_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_ram2(*this, "ram2"),
m_maincpu(*this,"maincpu")
m_maincpu(*this,"maincpu"),
m_cart1(*this, "slot_a"),
m_cart2(*this, "slot_b")
{ }
UINT8 m_mux_data;
@ -84,17 +87,18 @@ public:
DECLARE_DRIVER_INIT(kisekaem);
DECLARE_DRIVER_INIT(macs2);
DECLARE_MACHINE_RESET(macs);
DECLARE_MACHINE_START(macs);
UINT32 screen_update_macs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
optional_device<st0016_cpu_device> m_maincpu;
optional_device<generic_slot_device> m_cart1;
optional_device<generic_slot_device> m_cart2;
};
static ADDRESS_MAP_START( macs_mem, AS_PROGRAM, 8, macs_state )
AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank4")
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
@ -111,7 +115,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(macs_state::rambank_w)
{
membank("bank3")->set_base(&m_ram1[0x10000+(data&1)*0x800] );
membank("bank3")->set_entry(2 + (data & 1));
}
READ8_MEMBER(macs_state::macs_input_r)
@ -149,16 +153,12 @@ READ8_MEMBER(macs_state::macs_input_r)
WRITE8_MEMBER(macs_state::macs_rom_bank_w)
{
membank("bank1")->set_base(memregion("maincpu")->base() + (data* 0x4000) + macs_cart_slot*0x400000 );
// m_st0016_rom_bank=data;
membank("bank1")->set_entry(macs_cart_slot * 0x100 + data);
}
WRITE8_MEMBER(macs_state::macs_output_w)
{
UINT8 *ROM = memregion("maincpu")->base();
switch(offset)
switch(offset)
{
case 0:
/*
@ -169,16 +169,16 @@ WRITE8_MEMBER(macs_state::macs_output_w)
if(m_rev == 1)
{
/* FIXME: dunno if this RAM bank is right, DASM tracking made on the POST screens indicates that there's just one RAM bank,
but then MACS2 games locks up. */
membank("bank3")->set_base(&m_ram1[((data&0x20)>>5)*0x1000+0x000] );
/* FIXME: dunno if this RAM bank is right, DASM tracking made on the POST
screens indicates that there's just one RAM bank, but then MACS2 games
locks up. */
membank("bank3")->set_entry(BIT(data, 5));
macs_cart_slot = (data & 0xc) >> 2;
membank("bank4")->set_base(&ROM[macs_cart_slot*0x400000] );
membank("bank4")->set_entry(macs_cart_slot * 0x100);
}
membank("bank2")->set_base(&m_ram1[((data&0x20)>>5)*0x1000+0x800] );
membank("bank2")->set_entry(BIT(data, 5));
break;
case 2: m_mux_data = data; break;
@ -492,6 +492,7 @@ static MACHINE_CONFIG_START( macs, macs_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", macs_state, irq0_line_hold)
MCFG_MACHINE_START_OVERRIDE(macs_state,macs)
MCFG_MACHINE_RESET_OVERRIDE(macs_state,macs)
/* video hardware */
@ -502,91 +503,90 @@ static MACHINE_CONFIG_START( macs, macs_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 128*8-1, 0*8, 128*8-1)
MCFG_SCREEN_UPDATE_DRIVER(macs_state, screen_update_macs)
MCFG_SCREEN_PALETTE("maincpu:palette")
MCFG_GENERIC_CARTSLOT_ADD_WITH_DEFAULT("slot_a", generic_plain_slot, "macs_cart", "rom")
MCFG_SET_IMAGE_LOADABLE(FALSE)
MCFG_GENERIC_CARTSLOT_ADD_WITH_DEFAULT("slot_b", generic_plain_slot, "macs_cart", "rom")
MCFG_SET_IMAGE_LOADABLE(FALSE)
MACHINE_CONFIG_END
#define MACS_BIOS \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_REGION( 0x1000000, "bios", 0 ) \
ROM_LOAD16_BYTE( "macsos_l.u43", 0x00000, 0x80000, CRC(0b5aed5e) SHA1(042e705017ee34656e2c6af45825bb2dd3447747) ) \
ROM_LOAD16_BYTE( "macsos_h.u44", 0x00001, 0x80000, CRC(538b68e4) SHA1(a0534147791e94e726f49451d0e95671ae0a87d5) )
#define MACS2_BIOS \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_REGION( 0x1000000, "bios", 0 ) \
ROM_LOAD16_BYTE( "macs2os_l.bin", 0x00000, 0x80000, NO_DUMP ) \
ROM_LOAD16_BYTE( "macs2os_h.bin", 0x00001, 0x80000, NO_DUMP )
ROM_START( macsbios )
MACS_BIOS
ROM_REGION( 0x400000, "user2", ROMREGION_ERASEFF ) // Slot A
ROM_REGION( 0x400000, "user3", ROMREGION_ERASEFF ) // Slot B
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "user1", 0x000000, 0x000000, 0x400000 ) // Bios
ROM_COPY( "bios", 0x000000, 0x000000, 0x400000 )
ROM_REGION( 0x400000, "slot_a:rom", ROMREGION_ERASEFF )
ROM_REGION( 0x400000, "slot_b:rom", ROMREGION_ERASEFF )
ROM_END
ROM_START( mac2bios )
MACS2_BIOS
ROM_REGION( 0x400000, "user2", ROMREGION_ERASEFF ) // Slot A
ROM_REGION( 0x400000, "user3", ROMREGION_ERASEFF ) // Slot B
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "user1", 0x000000, 0x000000, 0x400000 ) // Bios
ROM_COPY( "bios", 0x000000, 0x000000, 0x400000 )
ROM_REGION( 0x400000, "slot_a:rom", ROMREGION_ERASEFF )
ROM_REGION( 0x400000, "slot_b:rom", ROMREGION_ERASEFF )
ROM_END
ROM_START( kisekaem )
MACS_BIOS
ROM_REGION( 0x400000, "user2", 0 ) // Slot A
ROM_LOAD16_BYTE( "am-mj.u8", 0x000000, 0x100000, CRC(3cf85151) SHA1(e05400065c384730f04ef565db5ba27eb3973d15) )
ROM_LOAD16_BYTE( "am-mj.u7", 0x000001, 0x100000, CRC(4b645354) SHA1(1dbf9141c3724e5dff2cd8066117fb1b94671a80) )
ROM_LOAD16_BYTE( "am-mj.u6", 0x200000, 0x100000, CRC(23b3aa24) SHA1(bfabdb16f9b1b60230bb636a944ab46fdfda49d7) )
ROM_LOAD16_BYTE( "am-mj.u5", 0x200001, 0x100000, CRC(b4d53e29) SHA1(d7683fdd5531bf1aa0ef1e4e6f517b31e2d5829e) )
ROM_REGION( 0x400000, "user3", ROMREGION_ERASEFF ) // Slot B
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "user1", 0x000000, 0x000000, 0x400000 ) // Bios
ROM_COPY( "user2", 0x000000, 0x400000, 0x400000 ) // Slot A
ROM_COPY( "bios", 0x000000, 0x000000, 0x400000 )
ROM_REGION( 0x400000, "slot_a:rom", 0 )
ROM_LOAD16_BYTE( "am-mj.u8", 0x000000, 0x100000, CRC(3cf85151) SHA1(e05400065c384730f04ef565db5ba27eb3973d15) )
ROM_LOAD16_BYTE( "am-mj.u7", 0x000001, 0x100000, CRC(4b645354) SHA1(1dbf9141c3724e5dff2cd8066117fb1b94671a80) )
ROM_LOAD16_BYTE( "am-mj.u6", 0x200000, 0x100000, CRC(23b3aa24) SHA1(bfabdb16f9b1b60230bb636a944ab46fdfda49d7) )
ROM_LOAD16_BYTE( "am-mj.u5", 0x200001, 0x100000, CRC(b4d53e29) SHA1(d7683fdd5531bf1aa0ef1e4e6f517b31e2d5829e) )
ROM_REGION( 0x400000, "slot_b:rom", ROMREGION_ERASEFF )
ROM_END
ROM_START( kisekaeh )
MACS_BIOS
ROM_REGION( 0x400000, "user2", 0 ) // Slot A
ROM_LOAD16_BYTE( "kh-u8.bin", 0x000000, 0x100000, CRC(601b9e6a) SHA1(54508a6db3928f78897df64ce400791e4789d0f6) )
ROM_LOAD16_BYTE( "kh-u7.bin", 0x000001, 0x100000, CRC(8f6e4bb3) SHA1(361545189feeda0887f930727d25655309b84629) )
ROM_LOAD16_BYTE( "kh-u6.bin", 0x200000, 0x100000, CRC(8e700204) SHA1(876e5530d749828de077293cb109a71b67cef140) )
ROM_LOAD16_BYTE( "kh-u5.bin", 0x200001, 0x100000, CRC(709bf7c8) SHA1(0a93e0c4f9be22a3302a1c5d2a6ec4739b202ea8) )
ROM_REGION( 0x400000, "user3", ROMREGION_ERASEFF ) // Slot B
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "user1", 0x000000, 0x000000, 0x400000 ) // Bios
ROM_COPY( "user2", 0x000000, 0x400000, 0x400000 ) // Slot A
ROM_COPY( "bios", 0x000000, 0x000000, 0x400000 )
ROM_REGION( 0x400000, "slot_a:rom", 0 )
ROM_LOAD16_BYTE( "kh-u8.bin", 0x000000, 0x100000, CRC(601b9e6a) SHA1(54508a6db3928f78897df64ce400791e4789d0f6) )
ROM_LOAD16_BYTE( "kh-u7.bin", 0x000001, 0x100000, CRC(8f6e4bb3) SHA1(361545189feeda0887f930727d25655309b84629) )
ROM_LOAD16_BYTE( "kh-u6.bin", 0x200000, 0x100000, CRC(8e700204) SHA1(876e5530d749828de077293cb109a71b67cef140) )
ROM_LOAD16_BYTE( "kh-u5.bin", 0x200001, 0x100000, CRC(709bf7c8) SHA1(0a93e0c4f9be22a3302a1c5d2a6ec4739b202ea8) )
ROM_REGION( 0x400000, "slot_b:rom", ROMREGION_ERASEFF )
ROM_END
ROM_START( cultname ) // uses printer - two different games ? (slot a - checks for printer, slot b - not)
MACS_BIOS
ROM_REGION( 0x400000, "user2", 0 ) // Slot A
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "bios", 0x000000, 0x000000, 0x400000 )
ROM_REGION( 0x400000, "slot_a:rom", 0 )
ROM_LOAD16_BYTE( "cult-d0.u8", 0x000000, 0x100000, CRC(394bc1a6) SHA1(98df5406862234815b46c7b0ac0b19e4b597d1b6) )
ROM_LOAD16_BYTE( "cult-d1.u7", 0x000001, 0x100000, CRC(f628133b) SHA1(f06e20212074e5d95cc7d419ac8ce98fb9be3b62) )
ROM_LOAD16_BYTE( "cult-d2.u6", 0x200000, 0x100000, CRC(c5521bc6) SHA1(7554b56b0201b7d81754defa2244fb7ff7452bf6) )
ROM_LOAD16_BYTE( "cult-d3.u5", 0x200001, 0x100000, CRC(4325b09b) SHA1(45699a0444a221f893724754c917d33041cabcb9) )
ROM_REGION( 0x400000, "user3", 0 ) // Slot B
ROM_REGION( 0x400000, "slot_b:rom", 0 )
ROM_LOAD16_BYTE( "cult-g0.u8", 0x000000, 0x100000, CRC(f5ab977b) SHA1(e7ee758cc2864500b339e236b944f98df9a1c10e) )
ROM_LOAD16_BYTE( "cult-g1.u7", 0x000001, 0x100000, CRC(32ae15a4) SHA1(061992efec1ed5527f200bf4c111344b156e759d) )
ROM_LOAD16_BYTE( "cult-g2.u6", 0x200000, 0x100000, CRC(30ed056d) SHA1(71735339bb501b94402ef403b5a2a60effa39c36) )
ROM_LOAD16_BYTE( "cult-g3.u5", 0x200001, 0x100000, CRC(fe58b418) SHA1(512f5c544cfafaa98bd2b3791ff1cf67adecec8d) )
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "user1", 0x000000, 0x000000, 0x400000 ) // Bios
ROM_COPY( "user2", 0x000000, 0x400000, 0x400000 ) // Slot A
ROM_COPY( "user3", 0x000000, 0x800000, 0x400000 ) // Slot B
ROM_END
/* these are listed as MACS2 sub-boards, is it the same? - it's not ;) */
@ -594,31 +594,31 @@ ROM_END
ROM_START( yuka )
MACS2_BIOS
ROM_REGION( 0x400000, "user2", 0 ) // Slot A
ROM_REGION( 0x400000, "slot_a:rom", 0 )
ROM_LOAD16_BYTE( "yu-ka_2.u6", 0x000001, 0x100000, CRC(c3c5728b) SHA1(e53cdcae556f34bab45d9342fd78ec29b6543c46) )
ROM_LOAD16_BYTE( "yu-ka_4.u5", 0x000000, 0x100000, CRC(7e391ee6) SHA1(3a0c122c9d0e2a91df6d8039fb958b6d00997747) )
ROM_LOAD16_BYTE( "yu-ka_1.u8", 0x200001, 0x100000, CRC(bccd1b15) SHA1(02511f3be60c53b5f5d90f12f0648f6e184ca667) )
ROM_LOAD16_BYTE( "yu-ka_3.u7", 0x200000, 0x100000, CRC(45b8263e) SHA1(59e1846c91dc39a086e8306260506673eb91de0b) )
ROM_REGION( 0x400000, "user3", ROMREGION_ERASE00 ) // Slot B
ROM_REGION( 0x400000, "slot_b:rom", ROMREGION_ERASE00 )
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "user2", 0x000000, 0x000000, 0x400000 ) // Slot A
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "slot_a:rom", 0x000000, 0x000000, 0x400000 )
ROM_END
ROM_START( yujan )
MACS2_BIOS
ROM_REGION( 0x400000, "user2", 0 ) // Slot A
ROM_REGION( 0x400000, "slot_a:rom", 0 )
ROM_LOAD16_BYTE( "yu-jan_2.u6", 0x000001, 0x100000, CRC(2f4a8d4b) SHA1(4b328a253b1980a76f46a9a98a7f486813894a33) )
ROM_LOAD16_BYTE( "yu-jan_4.u5", 0x000000, 0x100000, CRC(226df87b) SHA1(a887728f1ea2ef5f6b4dcd6b5b61586f5e8f267d) )
ROM_LOAD16_BYTE( "yu-jan_1.u8", 0x200001, 0x100000, CRC(feeeee6a) SHA1(e9613f50d6d2e62fac6b529f81486250cfe83819) )
ROM_LOAD16_BYTE( "yu-jan_3.u7", 0x200000, 0x100000, CRC(1c1d6997) SHA1(9b07ae6b9ef1c0b57fbaa5fd0bcf1d2d7f17351f) )
ROM_REGION( 0x400000, "user3", ROMREGION_ERASEFF ) // Slot B
ROM_REGION( 0x400000, "slot_b:rom", ROMREGION_ERASEFF )
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "user2", 0x000000, 0x000000, 0x400000 ) // Slot A
ROM_REGION( 0x1000000, "maincpu", 0 )
ROM_COPY( "slot_a:rom", 0x000000, 0x000000, 0x400000 )
ROM_END
#if 0
@ -637,10 +637,29 @@ static const UINT8 ramdata[160]=
};
#endif
MACHINE_START_MEMBER(macs_state,macs)
{
membank("bank1")->configure_entries(0 , 256, memregion("maincpu")->base(), 0x4000);
membank("bank1")->configure_entries(256, 256, m_cart1->get_rom_base(), 0x4000);
membank("bank1")->configure_entries(512, 256, m_cart2->get_rom_base(), 0x4000);
membank("bank1")->set_entry(0);
membank("bank2")->configure_entries(0, 2, m_ram1.get() + 0x2000, 0x800);
membank("bank2")->set_entry(0);
membank("bank3")->configure_entries(0, 4, m_ram1.get(), 0x800);
membank("bank3")->set_entry(2);
membank("bank4")->configure_entries(0 , 256, memregion("maincpu")->base(), 0x4000);
membank("bank4")->configure_entries(256, 256, m_cart1->get_rom_base(), 0x4000);
membank("bank4")->configure_entries(512, 256, m_cart2->get_rom_base(), 0x4000);
membank("bank4")->set_entry(0);
}
MACHINE_RESET_MEMBER(macs_state,macs)
{
UINT8 *macs_ram1 = m_ram1.get();
#if 0
UINT8 *macs_ram1 = m_ram1.get();
UINT8 *macs_ram2 = m_ram2;
/*
BIOS ram init:
@ -670,11 +689,11 @@ MACHINE_RESET_MEMBER(macs_state,macs)
730E: ED B0 ldir
...
*/
memcpy(macs_ram1 + 0x0e9f, memregion("user1")->base()+0x7327, 0xc7);
memcpy(macs_ram1 + 0x1e9f, memregion("user1")->base()+0x7327, 0xc7);
memcpy(macs_ram1 + 0x0e9f, memregion("bios")->base()+0x7327, 0xc7);
memcpy(macs_ram1 + 0x1e9f, memregion("bios")->base()+0x7327, 0xc7);
memcpy(macs_ram1 + 0x0800, memregion("user1")->base()+0x73fa, 0x507);
memcpy(macs_ram1 + 0x1800, memregion("user1")->base()+0x73fa, 0x507);
memcpy(macs_ram1 + 0x0800, memregion("bios")->base()+0x73fa, 0x507);
memcpy(macs_ram1 + 0x1800, memregion("bios")->base()+0x73fa, 0x507);
#define MAKEJMP(n,m) macs_ram2[(n) - 0xe800 + 0]=0xc3;\
macs_ram2[(n) - 0xe800 + 1]=(m)&0xff;\
@ -709,11 +728,6 @@ MACHINE_RESET_MEMBER(macs_state,macs)
macs_ram1[0x0ff9]=0x07;
macs_ram1[0x1ff9]=0x07;
#endif
membank("bank1")->set_base(memregion("maincpu")->base() );
membank("bank2")->set_base(macs_ram1+0x800);
membank("bank3")->set_base(macs_ram1+0x10000);
membank("bank4")->set_base(memregion("maincpu")->base() );
}
DRIVER_INIT_MEMBER(macs_state,macs)