diff --git a/.gitattributes b/.gitattributes index 21385792552..b3be22a5bbc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -582,6 +582,10 @@ src/emu/bus/apf/rom.c svneol=native#text/plain src/emu/bus/apf/rom.h svneol=native#text/plain src/emu/bus/apf/slot.c svneol=native#text/plain src/emu/bus/apf/slot.h svneol=native#text/plain +src/emu/bus/arcadia/rom.c svneol=native#text/plain +src/emu/bus/arcadia/rom.h svneol=native#text/plain +src/emu/bus/arcadia/slot.c svneol=native#text/plain +src/emu/bus/arcadia/slot.h svneol=native#text/plain src/emu/bus/bml3/bml3bus.c svneol=native#text/plain src/emu/bus/bml3/bml3bus.h svneol=native#text/plain src/emu/bus/bml3/bml3kanji.c svneol=native#text/plain @@ -1598,6 +1602,10 @@ src/emu/bus/vboy/rom.c svneol=native#text/plain src/emu/bus/vboy/rom.h svneol=native#text/plain src/emu/bus/vboy/slot.c svneol=native#text/plain src/emu/bus/vboy/slot.h svneol=native#text/plain +src/emu/bus/vc4000/rom.c svneol=native#text/plain +src/emu/bus/vc4000/rom.h svneol=native#text/plain +src/emu/bus/vc4000/slot.c svneol=native#text/plain +src/emu/bus/vc4000/slot.h svneol=native#text/plain src/emu/bus/vcs/compumat.c svneol=native#text/plain src/emu/bus/vcs/compumat.h svneol=native#text/plain src/emu/bus/vcs/dpc.c svneol=native#text/plain diff --git a/hash/arcadia.xml b/hash/arcadia.xml index 6023a583834..3246d8a22f8 100644 --- a/hash/arcadia.xml +++ b/hash/arcadia.xml @@ -381,6 +381,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -394,6 +395,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -406,6 +408,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -418,6 +421,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -430,6 +434,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -441,6 +446,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1980 UA Ltd. + @@ -453,6 +459,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -464,6 +471,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1983 UA Ltd. + @@ -477,6 +485,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -488,6 +497,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -499,6 +509,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -511,6 +522,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -523,6 +535,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -534,6 +547,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -546,6 +560,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -558,6 +573,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -570,6 +586,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -581,6 +598,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -593,6 +611,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -605,6 +624,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -616,6 +636,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1983 Bandai + @@ -627,6 +648,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1983 Bandai + @@ -639,6 +661,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -650,6 +673,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1983 UA Ltd. + @@ -662,6 +686,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -674,6 +699,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -686,6 +712,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -697,6 +724,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1983 UA Ltd. + @@ -716,6 +744,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -728,6 +757,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -741,6 +771,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -752,6 +783,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -764,6 +796,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho Bandai + @@ -776,6 +809,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho Bandai + @@ -788,6 +822,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -800,6 +835,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -812,6 +848,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -824,6 +861,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -836,6 +874,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -847,6 +886,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1983 UA Ltd. + @@ -858,6 +898,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1981 UA Ltd. + @@ -869,6 +910,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -881,6 +923,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -892,6 +935,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1983 UA Ltd. + @@ -904,6 +948,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -915,6 +960,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -926,6 +972,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -937,6 +984,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -949,6 +997,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -961,6 +1010,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -973,6 +1023,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -985,6 +1036,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -996,6 +1048,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -1008,6 +1061,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -1019,6 +1073,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -1030,6 +1085,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -1042,6 +1098,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho UA Ltd. + @@ -1053,6 +1110,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -1064,6 +1122,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 1982 UA Ltd. + @@ -1076,6 +1135,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -1090,6 +1150,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + @@ -1102,6 +1163,7 @@ Rumoured or Unreleased files: - 3D Raceway, Centipede, Fun with Math, Galaga, Ho 198? UA Ltd. + diff --git a/hash/vc4000.xml b/hash/vc4000.xml index 14a7e99d823..f3bf2c7cc4b 100644 --- a/hash/vc4000.xml +++ b/hash/vc4000.xml @@ -9,6 +9,7 @@ 19?? Interton + @@ -21,6 +22,7 @@ 19?? Interton + @@ -33,6 +35,7 @@ 19?? Interton + @@ -45,6 +48,7 @@ 19?? Interton + @@ -57,6 +61,7 @@ 19?? Interton + @@ -69,6 +74,7 @@ 19?? Interton + @@ -81,6 +87,7 @@ 19?? Interton + @@ -93,6 +100,7 @@ 19?? Interton + @@ -105,6 +113,7 @@ 19?? Interton + @@ -117,6 +126,7 @@ 19?? Interton + @@ -129,6 +139,7 @@ 19?? Interton + @@ -141,6 +152,7 @@ 19?? Interton + @@ -153,10 +165,12 @@ 19?? Interton - + + + @@ -166,6 +180,7 @@ 19?? Interton + @@ -178,6 +193,7 @@ 19?? Interton + @@ -190,6 +206,7 @@ 19?? Interton + @@ -202,6 +219,7 @@ 19?? Interton + @@ -214,6 +232,7 @@ 19?? Interton + @@ -226,6 +245,7 @@ 19?? Interton + @@ -238,6 +258,7 @@ 19?? Interton + @@ -250,6 +271,7 @@ 19?? Interton + @@ -262,11 +284,13 @@ 19?? Interton - + + + @@ -276,6 +300,7 @@ 19?? Interton + @@ -288,6 +313,7 @@ 1979 Interton + @@ -300,6 +326,7 @@ 19?? Interton + @@ -312,10 +339,12 @@ 19?? Interton - + + + @@ -325,6 +354,7 @@ 19?? Interton + @@ -337,6 +367,7 @@ 19?? <unknown> + @@ -349,6 +380,7 @@ 19?? Interton + @@ -361,6 +393,7 @@ 19?? Interton + @@ -373,6 +406,7 @@ 19?? Interton + @@ -385,6 +419,7 @@ 19?? Interton + @@ -397,6 +432,7 @@ 19?? Interton + @@ -412,10 +448,12 @@ 19?? Interton - + + + @@ -425,6 +463,7 @@ 19?? Interton + @@ -437,6 +476,7 @@ 19?? Interton + @@ -451,6 +491,7 @@ 19?? Interton + diff --git a/src/emu/bus/arcadia/rom.c b/src/emu/bus/arcadia/rom.c new file mode 100644 index 00000000000..f6963d849c9 --- /dev/null +++ b/src/emu/bus/arcadia/rom.c @@ -0,0 +1,60 @@ +/*********************************************************************************************************** + + + Emerson Arcadia 2001 cart emulation + + Golf carts have the "extra_rom" handler installed at $4000 instead of $2000 + + ***********************************************************************************************************/ + + +#include "emu.h" +#include "rom.h" + + +//------------------------------------------------- +// arcadia_rom_device - constructor +//------------------------------------------------- + +const device_type ARCADIA_ROM_STD = &device_creator; +const device_type ARCADIA_ROM_GOLF = &device_creator; + + +arcadia_rom_device::arcadia_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_arcadia_cart_interface( mconfig, *this ) +{ +} + +arcadia_rom_device::arcadia_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, ARCADIA_ROM_STD, "Emerson Arcadia Standard Carts", tag, owner, clock, "arcadia_rom", __FILE__), + device_arcadia_cart_interface( mconfig, *this ) +{ +} + +arcadia_golf_device::arcadia_golf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : arcadia_rom_device(mconfig, ARCADIA_ROM_GOLF, "Emerson Arcadia Golf Cart", tag, owner, clock, "arcadia_golf", __FILE__) +{ +} + + +/*------------------------------------------------- + mapper specific handlers + -------------------------------------------------*/ + +READ8_MEMBER(arcadia_rom_device::read_rom) +{ + if (offset < m_rom_size) + return m_rom[offset]; + else + return 0xff; +} + + +READ8_MEMBER(arcadia_rom_device::extra_rom) +{ + if (offset + 0x1000 < m_rom_size) + return m_rom[offset + 0x1000]; + else + return 0xff; +} diff --git a/src/emu/bus/arcadia/rom.h b/src/emu/bus/arcadia/rom.h new file mode 100644 index 00000000000..332632349ab --- /dev/null +++ b/src/emu/bus/arcadia/rom.h @@ -0,0 +1,42 @@ +#ifndef __ARCADIA_ROM_H +#define __ARCADIA_ROM_H + +#include "slot.h" + + +// ======================> arcadia_rom_device + +class arcadia_rom_device : public device_t, + public device_arcadia_cart_interface +{ +public: + // construction/destruction + arcadia_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + arcadia_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start() {} + virtual void device_reset() {} + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom); + virtual DECLARE_READ8_MEMBER(extra_rom); +}; + +// ======================> arcadia_golf_device + +class arcadia_golf_device : public arcadia_rom_device +{ +public: + // construction/destruction + arcadia_golf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + + + +// device type definition +extern const device_type ARCADIA_ROM_STD; +extern const device_type ARCADIA_ROM_GOLF; + +#endif diff --git a/src/emu/bus/arcadia/slot.c b/src/emu/bus/arcadia/slot.c new file mode 100644 index 00000000000..1a7b96e7cf4 --- /dev/null +++ b/src/emu/bus/arcadia/slot.c @@ -0,0 +1,260 @@ +/*********************************************************************************************************** + + Emerson Arcadia 2001 (and clones) cart emulation + (through slot devices) + + ***********************************************************************************************************/ + + +#include "emu.h" +#include "slot.h" + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type EA2001_CART_SLOT = &device_creator; + +//************************************************************************** +// ARCADIA Cartridges Interface +//************************************************************************** + +//------------------------------------------------- +// device_arcadia_cart_interface - constructor +//------------------------------------------------- + +device_arcadia_cart_interface::device_arcadia_cart_interface(const machine_config &mconfig, device_t &device) + : device_slot_card_interface(mconfig, device), + m_rom(NULL), + m_rom_size(0) +{ +} + + +//------------------------------------------------- +// ~device_arcadia_cart_interface - destructor +//------------------------------------------------- + +device_arcadia_cart_interface::~device_arcadia_cart_interface() +{ +} + +//------------------------------------------------- +// rom_alloc - alloc the space for the cart +//------------------------------------------------- + +void device_arcadia_cart_interface::rom_alloc(UINT32 size, const char *tag) +{ + if (m_rom == NULL) + { + astring tempstring(tag); + tempstring.cat(EA2001SLOT_ROM_REGION_TAG); + m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom_size = size; + } +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// arcadia_cart_slot_device - constructor +//------------------------------------------------- +arcadia_cart_slot_device::arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, EA2001_CART_SLOT, "Emerson Arcadia Cartridge Slot", tag, owner, clock, "arcadia_cart_slot", __FILE__), + device_image_interface(mconfig, *this), + device_slot_interface(mconfig, *this), + m_type(ARCADIA_STD) +{ +} + + +//------------------------------------------------- +// arcadia_cart_slot_device - destructor +//------------------------------------------------- + +arcadia_cart_slot_device::~arcadia_cart_slot_device() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void arcadia_cart_slot_device::device_start() +{ + m_cart = dynamic_cast(get_card_device()); +} + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void arcadia_cart_slot_device::device_config_complete() +{ + // set brief and instance name + update_names(); +} + + +//------------------------------------------------- +// ARCADIA PCB +//------------------------------------------------- + +struct arcadia_slot +{ + int pcb_id; + const char *slot_option; +}; + +// Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it +static const arcadia_slot slot_list[] = +{ + { ARCADIA_STD, "std" }, + { ARCADIA_GOLF, "golf" } +}; + +static int arcadia_get_pcb_id(const char *slot) +{ + for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) + { + if (!core_stricmp(slot_list[i].slot_option, slot)) + return slot_list[i].pcb_id; + } + + return 0; +} + +static const char *arcadia_get_slot(int type) +{ + for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) + { + if (slot_list[i].pcb_id == type) + return slot_list[i].slot_option; + } + + return "std"; +} + + +/*------------------------------------------------- + call load + -------------------------------------------------*/ + +bool arcadia_cart_slot_device::call_load() +{ + if (m_cart) + { + UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom"); + + m_cart->rom_alloc(len, tag()); + + if (software_entry() == NULL) + fread(m_cart->get_rom_base(), len); + else + memcpy(m_cart->get_rom_base(), get_software_region("rom"), len); + + if (software_entry() == NULL) + { + // we need to identify Golf! + m_type = ARCADIA_STD; + + +// the patch below is kept in case it could be used to identify golf cart from fullpath +#if 0 + // this is a testpatch for the golf cartridge + // so to make it work on a standard arcadia 2001 + // cart (i.e. mapping the hi 2K to $2000) + // not enough yet (some pointers stored as data?) + patch[]= { + // addr, orig. value, patched value + { 0x0077, 0x40, 0x20 }, + { 0x011e, 0x40, 0x20 }, + { 0x0348, 0x40, 0x20 }, + { 0x03be, 0x40, 0x20 }, + { 0x04ce, 0x40, 0x20 }, + { 0x04da, 0x40, 0x20 }, + { 0x0562, 0x42, 0x22 }, + { 0x0617, 0x40, 0x20 }, + { 0x0822, 0x40, 0x20 }, + { 0x095e, 0x42, 0x22 }, + { 0x09d3, 0x42, 0x22 }, + { 0x0bb0, 0x42, 0x22 }, + { 0x0efb, 0x40, 0x20 }, + { 0x0ec1, 0x43, 0x23 }, + { 0x0f00, 0x40, 0x20 }, + { 0x0f12, 0x40, 0x20 }, + { 0x0ff5, 0x43, 0x23 }, + { 0x0ff7, 0x41, 0x21 }, + { 0x0ff9, 0x40, 0x20 }, + { 0x0ffb, 0x41, 0x21 }, + { 0x20ec, 0x42, 0x22 } + }; +#endif + + } + else + { + const char *pcb_name = get_feature("slot"); + if (pcb_name) + m_type = arcadia_get_pcb_id(pcb_name); + } + + printf("Type: %s\n", arcadia_get_slot(m_type)); + + return IMAGE_INIT_PASS; + } + + return IMAGE_INIT_PASS; +} + + +/*------------------------------------------------- + call softlist load + -------------------------------------------------*/ + +bool arcadia_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) +{ + load_software_part_region(*this, swlist, swname, start_entry); + return TRUE; +} + + + +/*------------------------------------------------- + get default card software + -------------------------------------------------*/ + +void arcadia_cart_slot_device::get_default_card_software(astring &result) +{ + software_get_default_slot(result, "std"); +} + +/*------------------------------------------------- + read + -------------------------------------------------*/ + +READ8_MEMBER(arcadia_cart_slot_device::read_rom) +{ + if (m_cart) + return m_cart->read_rom(space, offset); + else + return 0xff; +} + +/*------------------------------------------------- + write + -------------------------------------------------*/ + +READ8_MEMBER(arcadia_cart_slot_device::extra_rom) +{ + if (m_cart) + return m_cart->extra_rom(space, offset); + else + return 0xff; +} + diff --git a/src/emu/bus/arcadia/slot.h b/src/emu/bus/arcadia/slot.h new file mode 100644 index 00000000000..90df2dd1113 --- /dev/null +++ b/src/emu/bus/arcadia/slot.h @@ -0,0 +1,102 @@ +#ifndef __ARCADIA_SLOT_H +#define __ARCADIA_SLOT_H + +/*************************************************************************** + TYPE DEFINITIONS + ***************************************************************************/ + + +/* PCB */ +enum +{ + ARCADIA_STD = 0, + ARCADIA_GOLF +}; + + +// ======================> device_arcadia_cart_interface + +class device_arcadia_cart_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_arcadia_cart_interface(const machine_config &mconfig, device_t &device); + virtual ~device_arcadia_cart_interface(); + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; } + virtual DECLARE_READ8_MEMBER(extra_rom) { return 0xff; } + + void rom_alloc(UINT32 size, const char *tag); + UINT8* get_rom_base() { return m_rom; } + UINT32 get_rom_size() { return m_rom_size; } + +protected: + // internal state + UINT8 *m_rom; + UINT32 m_rom_size; +}; + + +// ======================> arcadia_cart_slot_device + +class arcadia_cart_slot_device : public device_t, + public device_image_interface, + public device_slot_interface +{ +public: + // construction/destruction + arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ~arcadia_cart_slot_device(); + + // device-level overrides + virtual void device_start(); + virtual void device_config_complete(); + + // image-level overrides + virtual bool call_load(); + virtual void call_unload() {} + virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry); + + int get_type() { return m_type; } + + virtual iodevice_t image_type() const { return IO_CARTSLOT; } + virtual bool is_readable() const { return 1; } + virtual bool is_writeable() const { return 0; } + virtual bool is_creatable() const { return 0; } + virtual bool must_be_loaded() const { return 1; } + virtual bool is_reset_on_load() const { return 1; } + virtual const option_guide *create_option_guide() const { return NULL; } + virtual const char *image_interface() const { return "arcadia_cart"; } + virtual const char *file_extensions() const { return "bin"; } + + // slot interface overrides + virtual void get_default_card_software(astring &result); + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom); + virtual DECLARE_READ8_MEMBER(extra_rom); + +protected: + + int m_type; + device_arcadia_cart_interface* m_cart; +}; + + + +// device type definition +extern const device_type EA2001_CART_SLOT; + + +/*************************************************************************** + DEVICE CONFIGURATION MACROS + ***************************************************************************/ + +#define EA2001SLOT_ROM_REGION_TAG ":cart:rom" + +#define MCFG_ARCADIA_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ + MCFG_DEVICE_ADD(_tag, EA2001_CART_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ + +#endif diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index e2b2b56b410..4bd37ccedcd 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -108,6 +108,18 @@ BUSOBJS += $(BUSOBJ)/apf/rom.o endif +#------------------------------------------------- +# +#@src/emu/bus/arcadia/slot.h,BUSES += ARCADIA +#------------------------------------------------- + +ifneq ($(filter ARCADIA,$(BUSES)),) +OBJDIRS += $(BUSOBJ)/arcadia +BUSOBJS += $(BUSOBJ)/arcadia/slot.o +BUSOBJS += $(BUSOBJ)/arcadia/rom.o +endif + + #------------------------------------------------- # #@src/emu/bus/bw2/exp.h,BUSES += BW2 @@ -630,6 +642,18 @@ BUSOBJS += $(BUSOBJ)/tvc/hbf.o endif +#------------------------------------------------- +# +#@src/emu/bus/vc4000/slot.h,BUSES += VC4000 +#------------------------------------------------- + +ifneq ($(filter VC4000,$(BUSES)),) +OBJDIRS += $(BUSOBJ)/vc4000 +BUSOBJS += $(BUSOBJ)/vc4000/slot.o +BUSOBJS += $(BUSOBJ)/vc4000/rom.o +endif + + #------------------------------------------------- # #@src/emu/bus/vcs/vcs_slot.h,BUSES += VCS diff --git a/src/emu/bus/vc4000/rom.c b/src/emu/bus/vc4000/rom.c new file mode 100644 index 00000000000..28106329f7f --- /dev/null +++ b/src/emu/bus/vc4000/rom.c @@ -0,0 +1,261 @@ +/*********************************************************************************************************** + + + Interton Electronic VC 4000 cart emulation + + + ***********************************************************************************************************/ + + +/* Game List and Emulation Status + + When you load a game it will normally appear to be unresponsive. Most carts contain a number of variants + of each game (e.g. Difficulty, Player1 vs Player2 or Player1 vs Computer, etc). + + Press F2 (if needed) to select which game variant you would like to play. The variant number will increment + on-screen. When you've made your choice, press F1 to start. The main keys are unlabelled, because an overlay + is provided with each cart. See below for a guide. You need to read the instructions that come with each game. + + In some games, the joystick is used like 4 buttons, and other games like a paddle. The two modes are + incompatible when using a keyboard. Therefore (in the emulation) a config dipswitch is used. The preferred + setting is listed below. + + (AC = Auto-centre, NAC = no auto-centre, 90 = turn controller 90 degrees). + + The list is rather incomplete, information will be added as it becomes available. + + The game names and numbers were obtained from the Amigan Software site. + + Cart Num Name + ---------------------------------------------- + 1. Grand Prix / Car Races / Autosport / Motor Racing / Road Race + Config: Paddle, NAC + Status: Working + Controls: Left-Right: Steer; Up: Accelerate + + 2. Black Jack + Status: Not working (some digits missing; indicator missing; dealer's cards missing) + Controls: set bet with S and D; A to deal; 1 to hit, 2 to stay; Q accept insurance, E to decline; double-up (unknown key) + Indicator: E make a bet then deal; I choose insurance; - you lost; + you won; X hit or stay + + 3. Olympics / Paddle Games / Bat & Ball / Pro Sport 60 / Sportsworld + Config: Paddle, NAC + Status: Working + + 4. Tank Battle / Combat + Config: Button, 90 + Status: Working + Controls: Left-Right: Steer; Up: Accelerate; Fire: Shoot + + 5. Maths 1 + Status: Working + Controls: Z difficulty; X = addition or subtraction; C ask question; A=1;S=2;D=3;Q=4;W=5;E=6;1=7;2=8;3=9;0=0; C enter + + 6. Maths 2 + Status: Not working + Controls: Same as above. + + 7. Air Sea Attack / Air Sea Battle + Config: Button, 90 + Status: Working + Controls: Left-Right: Move; Fire: Shoot + + 8. Treasure Hunt / Capture the Flag / Concentration / Memory Match + Config: Buttons + Status: Working + + 9. Labyrinth / Maze / Intelligence 1 + Config: Buttons + Status: Working + + 10. Winter Sports + Notes: Background colours should be Cyan and White instead of Red and Black + + 11. Hippodrome / Horse Race + + 12. Hunting / Shooting Gallery + + 13. Chess 1 + Status: Can't see what you're typing, wrong colours + + 14. Moto-cros + + 15. Four in a row / Intelligence 2 + Config: Buttons + Status: Working + Notes: Seems the unused squares should be black. The screen jumps about while the computer is "thinking". + + 16. Code Breaker / Master Mind / Intelligence 3 / Challenge + + 17. Circus + STatus: severe gfx issues + + 18. Boxing / Prize Fight + + 19. Outer Space / Spacewar / Space Attack / Outer Space Combat + + 20. Melody Simon / Musical Memory / Follow the Leader / Musical Games / Electronic Music / Face the Music + + 21. Capture / Othello / Reversi / Attack / Intelligence 4 + Config: Buttons + Status: Working + Notes: Seems the unused squares should be black + + 22. Chess 2 + Status: Can't see what you're typing, wrong colours + + 23. Pinball / Flipper / Arcade + Status: gfx issues + + 24. Soccer + + 25. Bowling / NinePins + Config: Paddle, rotated 90 degrees, up/down autocentre, left-right does not + Status: Working + + 26. Draughts + + 27. Golf + Status: gfx issues + + 28. Cockpit + Status: gfx issues + + 29. Metropolis / Hangman + Status: gfx issues + + 30. Solitaire + + 31. Casino + Status: gfx issues, items missing and unplayable + Controls: 1 or 3=START; q=GO; E=STOP; D=$; Z=^; X=tens; C=units + + 32. Invaders / Alien Invasion / Earth Invasion + Status: Works + Config: Buttons + + 33. Super Invaders + Status: Stars are missing, colours are wrong + Config: Buttons (90) + + 36. BackGammon + Status: Not all counters are visible, Dice & game number not visible. + Controls: Fire=Exec; 1=D+; 3=D-; Q,W,E=4,5,6; A,S,D=1,2,3; Z=CL; X=STOP; C=SET + + 37. Monster Man / Spider's Web + Status: Works + Config: Buttons + + 38. Hyperspace + Status: Works + Config: Buttons (90) + Controls: 3 - status button; Q,W,E,A,S,D,Z,X,C selects which galaxy to visit + + + 40. Super Space + Status: Works, some small gfx issues near the bottom + Config: Buttons + + + + Acetronic: (dumps are compatible) + ------------ + + * Shooting Gallery + Status: works but screen flickers + Config: Buttons + + * Planet Defender + Status: Works + Config: Paddle (NAC) + + * Laser Attack + Status: Works + Config: Buttons + + + + Public Domain: (written for emulators, may not work on real hardware) + --------------- + * Picture (no controls) - works + * Wincadia Stub (no controls) - works, small graphic error */ + + + +#include "emu.h" +#include "rom.h" + + +//------------------------------------------------- +// vc4000_rom_device - constructor +//------------------------------------------------- + +const device_type VC4000_ROM_STD = &device_creator; +const device_type VC4000_ROM_RAM1K = &device_creator; +const device_type VC4000_ROM_CHESS2 = &device_creator; + + +vc4000_rom_device::vc4000_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_vc4000_cart_interface( mconfig, *this ) +{ +} + +vc4000_rom_device::vc4000_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, VC4000_ROM_STD, "VC 4000 Standard Carts", tag, owner, clock, "vc4000_rom", __FILE__), + device_vc4000_cart_interface( mconfig, *this ) +{ +} + +vc4000_ram1k_device::vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : vc4000_rom_device(mconfig, VC4000_ROM_RAM1K, "VC 4000 Carts w/1K RAM", tag, owner, clock, "vc4000_ram1k", __FILE__) +{ +} + +vc4000_chess2_device::vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : vc4000_rom_device(mconfig, VC4000_ROM_CHESS2, "VC 4000 Chess II Cart", tag, owner, clock, "vc4000_chess2", __FILE__) +{ +} + + +/*------------------------------------------------- + mapper specific handlers + -------------------------------------------------*/ + +READ8_MEMBER(vc4000_rom_device::read_rom) +{ + if (offset < m_rom_size) + return m_rom[offset]; + else + return 0xff; +} + + +READ8_MEMBER(vc4000_ram1k_device::read_ram) +{ + return m_ram[offset & m_ram.count()]; +} + +WRITE8_MEMBER(vc4000_ram1k_device::write_ram) +{ + m_ram[offset & m_ram.count()] = data; +} + + +READ8_MEMBER(vc4000_chess2_device::extra_rom) +{ + if (offset < (m_rom_size - 0x2000)) + return m_rom[offset + 0x2000]; + else + return 0xff; +} + +READ8_MEMBER(vc4000_chess2_device::read_ram) +{ + return m_ram[offset & m_ram.count()]; +} + +WRITE8_MEMBER(vc4000_chess2_device::write_ram) +{ + m_ram[offset & m_ram.count()] = data; +} diff --git a/src/emu/bus/vc4000/rom.h b/src/emu/bus/vc4000/rom.h new file mode 100644 index 00000000000..63b4edd7e29 --- /dev/null +++ b/src/emu/bus/vc4000/rom.h @@ -0,0 +1,62 @@ +#ifndef __VC4000_ROM_H +#define __VC4000_ROM_H + +#include "slot.h" + + +// ======================> vc4000_rom_device + +class vc4000_rom_device : public device_t, + public device_vc4000_cart_interface +{ +public: + // construction/destruction + vc4000_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + vc4000_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start() {} + virtual void device_reset() {} + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom); +}; + +// ======================> vc4000_ram1k_device + +class vc4000_ram1k_device : public vc4000_rom_device +{ +public: + // construction/destruction + vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_ram); + virtual DECLARE_WRITE8_MEMBER(write_ram); +}; + +// ======================> vc4000_chess2_device + +class vc4000_chess2_device : public vc4000_rom_device +{ +public: + // construction/destruction + vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // reading and writing + virtual DECLARE_READ8_MEMBER(extra_rom); + virtual DECLARE_READ8_MEMBER(read_ram); + virtual DECLARE_WRITE8_MEMBER(write_ram); +}; + + + + + +// device type definition +extern const device_type VC4000_ROM_STD; +extern const device_type VC4000_ROM_RAM1K; +extern const device_type VC4000_ROM_CHESS2; + + +#endif diff --git a/src/emu/bus/vc4000/slot.c b/src/emu/bus/vc4000/slot.c new file mode 100644 index 00000000000..9812a235489 --- /dev/null +++ b/src/emu/bus/vc4000/slot.c @@ -0,0 +1,296 @@ +/*********************************************************************************************************** + + Interton Electronic VC 4000 cart emulation + (through slot devices) + + ***********************************************************************************************************/ + + +#include "emu.h" +#include "slot.h" + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type VC4000_CART_SLOT = &device_creator; + +//************************************************************************** +// APF Cartridges Interface +//************************************************************************** + +//------------------------------------------------- +// device_vc4000_cart_interface - constructor +//------------------------------------------------- + +device_vc4000_cart_interface::device_vc4000_cart_interface(const machine_config &mconfig, device_t &device) + : device_slot_card_interface(mconfig, device), + m_rom(NULL), + m_rom_size(0) +{ +} + + +//------------------------------------------------- +// ~device_vc4000_cart_interface - destructor +//------------------------------------------------- + +device_vc4000_cart_interface::~device_vc4000_cart_interface() +{ +} + +//------------------------------------------------- +// rom_alloc - alloc the space for the cart +//------------------------------------------------- + +void device_vc4000_cart_interface::rom_alloc(UINT32 size, const char *tag) +{ + if (m_rom == NULL) + { + astring tempstring(tag); + tempstring.cat(VC4000SLOT_ROM_REGION_TAG); + m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); + m_rom_size = size; + } +} + + +//------------------------------------------------- +// ram_alloc - alloc the space for the ram +//------------------------------------------------- + +void device_vc4000_cart_interface::ram_alloc(UINT32 size) +{ + m_ram.resize(size); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vc4000_cart_slot_device - constructor +//------------------------------------------------- +vc4000_cart_slot_device::vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VC4000_CART_SLOT, "Interton VC 4000 Cartridge Slot", tag, owner, clock, "vc4000_cart_slot", __FILE__), + device_image_interface(mconfig, *this), + device_slot_interface(mconfig, *this), + m_type(VC4000_STD) +{ +} + + +//------------------------------------------------- +// vc4000_cart_slot_device - destructor +//------------------------------------------------- + +vc4000_cart_slot_device::~vc4000_cart_slot_device() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vc4000_cart_slot_device::device_start() +{ + m_cart = dynamic_cast(get_card_device()); +} + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void vc4000_cart_slot_device::device_config_complete() +{ + // set brief and instance name + update_names(); +} + + +//------------------------------------------------- +// APF PCB +//------------------------------------------------- + +struct vc4000_slot +{ + int pcb_id; + const char *slot_option; +}; + +// Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it +static const vc4000_slot slot_list[] = +{ + { VC4000_STD, "std" }, + { VC4000_RAM1K, "ram1k" }, + { VC4000_CHESS2, "chess2" } +}; + +static int vc4000_get_pcb_id(const char *slot) +{ + for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) + { + if (!core_stricmp(slot_list[i].slot_option, slot)) + return slot_list[i].pcb_id; + } + + return 0; +} + +static const char *vc4000_get_slot(int type) +{ + for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) + { + if (slot_list[i].pcb_id == type) + return slot_list[i].slot_option; + } + + return "std"; +} + + +/*------------------------------------------------- + call load + -------------------------------------------------*/ + +bool vc4000_cart_slot_device::call_load() +{ + if (m_cart) + { + UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom"); + + if (size > 0x1800) + { + seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for a VC4000 cart"); + return IMAGE_INIT_FAIL; + } + + m_cart->rom_alloc(size, tag()); + + if (software_entry() == NULL) + fread(m_cart->get_rom_base(), size); + else + memcpy(m_cart->get_rom_base(), get_software_region("rom"), size); + + if (software_entry() == NULL) + { + m_type = VC4000_STD; + // attempt to identify the non-standard types + if (size > 0x1000) // 6k rom + 1k ram - Chess2 only + m_type = VC4000_CHESS2; + else if (size > 0x0800) // some 4k roms have 1k of mirrored ram + m_type = VC4000_RAM1K; + + if (m_type == VC4000_RAM1K || m_type == VC4000_CHESS2) + m_cart->ram_alloc(0x400); + } + else + { + const char *pcb_name = get_feature("slot"); + if (pcb_name) + m_type = vc4000_get_pcb_id(pcb_name); + + if (get_software_region("ram")) + m_cart->ram_alloc(get_software_region_length("ram")); + } + + //printf("Type: %s\n", vc4000_get_slot(m_type)); + + return IMAGE_INIT_PASS; + } + + return IMAGE_INIT_PASS; +} + + +/*------------------------------------------------- + call softlist load + -------------------------------------------------*/ + +bool vc4000_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) +{ + load_software_part_region(*this, swlist, swname, start_entry); + return TRUE; +} + + +/*------------------------------------------------- + get default card software + -------------------------------------------------*/ + +void vc4000_cart_slot_device::get_default_card_software(astring &result) +{ + if (open_image_file(mconfig().options())) + { + const char *slot_string = "std"; + UINT32 size = core_fsize(m_file); + int type = VC4000_STD; + + // attempt to identify the non-standard types + if (size > 0x1000) // 6k rom + 1k ram - Chess2 only + type = VC4000_CHESS2; + else if (size > 0x0800) // some 4k roms have 1k of mirrored ram + type = VC4000_RAM1K; + + slot_string = vc4000_get_slot(type); + + //printf("type: %s\n", slot_string); + clear(); + + result.cpy(slot_string); + return; + } + + software_get_default_slot(result, "std"); +} + +/*------------------------------------------------- + read + -------------------------------------------------*/ + +READ8_MEMBER(vc4000_cart_slot_device::read_rom) +{ + if (m_cart) + return m_cart->read_rom(space, offset); + else + return 0xff; +} + +/*------------------------------------------------- + read + -------------------------------------------------*/ + +READ8_MEMBER(vc4000_cart_slot_device::extra_rom) +{ + if (m_cart) + return m_cart->extra_rom(space, offset); + else + return 0xff; +} + +/*------------------------------------------------- + read + -------------------------------------------------*/ + +READ8_MEMBER(vc4000_cart_slot_device::read_ram) +{ + if (m_cart) + return m_cart->read_ram(space, offset); + else + return 0xff; +} + +/*------------------------------------------------- + write + -------------------------------------------------*/ + +WRITE8_MEMBER(vc4000_cart_slot_device::write_ram) +{ + if (m_cart) + m_cart->write_ram(space, offset, data); +} + + diff --git a/src/emu/bus/vc4000/slot.h b/src/emu/bus/vc4000/slot.h new file mode 100644 index 00000000000..219f0819ebf --- /dev/null +++ b/src/emu/bus/vc4000/slot.h @@ -0,0 +1,115 @@ +#ifndef __VC4000_SLOT_H +#define __VC4000_SLOT_H + +/*************************************************************************** + TYPE DEFINITIONS + ***************************************************************************/ + + +/* PCB */ +enum +{ + VC4000_STD = 0, + VC4000_RAM1K, + VC4000_CHESS2 +}; + + +// ======================> device_vc4000_cart_interface + +class device_vc4000_cart_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_vc4000_cart_interface(const machine_config &mconfig, device_t &device); + virtual ~device_vc4000_cart_interface(); + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; } + virtual DECLARE_READ8_MEMBER(extra_rom) { return 0xff; } + virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } + virtual DECLARE_WRITE8_MEMBER(write_ram) {} + + void rom_alloc(UINT32 size, const char *tag); + void ram_alloc(UINT32 size); + UINT8* get_rom_base() { return m_rom; } + UINT8* get_ram_base() { return m_ram; } + UINT32 get_rom_size() { return m_rom_size; } + UINT32 get_ram_size() { return m_ram.count(); } + + void save_ram() { device().save_item(NAME(m_ram)); } + +protected: + // internal state + UINT8 *m_rom; + UINT32 m_rom_size; + dynamic_buffer m_ram; +}; + + +// ======================> vc4000_cart_slot_device + +class vc4000_cart_slot_device : public device_t, + public device_image_interface, + public device_slot_interface +{ +public: + // construction/destruction + vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ~vc4000_cart_slot_device(); + + // device-level overrides + virtual void device_start(); + virtual void device_config_complete(); + + // image-level overrides + virtual bool call_load(); + virtual void call_unload() {} + virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry); + + int get_type() { return m_type; } + + void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); } + + virtual iodevice_t image_type() const { return IO_CARTSLOT; } + virtual bool is_readable() const { return 1; } + virtual bool is_writeable() const { return 0; } + virtual bool is_creatable() const { return 0; } + virtual bool must_be_loaded() const { return 0; } + virtual bool is_reset_on_load() const { return 1; } + virtual const option_guide *create_option_guide() const { return NULL; } + virtual const char *image_interface() const { return "vc4000_cart"; } + virtual const char *file_extensions() const { return "bin,rom"; } + + // slot interface overrides + virtual void get_default_card_software(astring &result); + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom); + virtual DECLARE_READ8_MEMBER(extra_rom); + virtual DECLARE_READ8_MEMBER(read_ram); + virtual DECLARE_WRITE8_MEMBER(write_ram); + +protected: + + int m_type; + device_vc4000_cart_interface* m_cart; +}; + + + +// device type definition +extern const device_type VC4000_CART_SLOT; + + +/*************************************************************************** + DEVICE CONFIGURATION MACROS + ***************************************************************************/ + +#define VC4000SLOT_ROM_REGION_TAG ":cart:rom" + +#define MCFG_VC4000_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ + MCFG_DEVICE_ADD(_tag, VC4000_CART_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ + +#endif diff --git a/src/mess/drivers/arcadia.c b/src/mess/drivers/arcadia.c index 0d9b25e1af2..66600106b9b 100644 --- a/src/mess/drivers/arcadia.c +++ b/src/mess/drivers/arcadia.c @@ -120,13 +120,12 @@ anything in hardware. No cartridge has been found which uses them. #include "includes/arcadia.h" static ADDRESS_MAP_START( arcadia_mem, AS_PROGRAM, 8, arcadia_state ) - AM_RANGE( 0x0000, 0x0fff) AM_ROM - AM_RANGE( 0x1800, 0x1aff) AM_READWRITE( arcadia_video_r, arcadia_video_w ) - AM_RANGE( 0x2000, 0x2fff) AM_ROM + AM_RANGE( 0x0000, 0x0fff) AM_DEVREAD("cartslot", arcadia_cart_slot_device, read_rom) + AM_RANGE( 0x1800, 0x1aff) AM_READWRITE(video_r, video_w) ADDRESS_MAP_END static ADDRESS_MAP_START( arcadia_io, AS_IO, 8, arcadia_state ) - AM_RANGE( S2650_SENSE_PORT,S2650_SENSE_PORT) AM_READ( arcadia_vsync_r) + AM_RANGE( S2650_SENSE_PORT,S2650_SENSE_PORT) AM_READ(vsync_r) ADDRESS_MAP_END /* The Emerson Arcadia 2001 controllers have 2 fire buttons on the side, @@ -440,95 +439,41 @@ static const unsigned short arcadia_palette[128+8] = /* bgnd, fgnd */ PALETTE_INIT_MEMBER(arcadia_state, arcadia) { - int i; - - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) palette.set_indirect_color(i, arcadia_colors[i]); - for (i = 0; i < 128+8; i++) + for (int i = 0; i < 128+8; i++) palette.set_pen_indirect(i, arcadia_palette[i]); } -DEVICE_IMAGE_LOAD_MEMBER( arcadia_state, arcadia_cart ) +void arcadia_state::machine_start() { - UINT8 *rom = memregion("maincpu")->base(); - int size; - - memset(rom, 0, 0x8000); - if (image.software_entry() == NULL) + if (m_cart->exists()) { - size = image.length(); - - if (size > memregion("maincpu")->bytes()) - size = memregion("maincpu")->bytes(); - - if (image.fread(rom, size) != size) - return IMAGE_INIT_FAIL; + switch (m_cart->get_type()) + { + case ARCADIA_STD: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0xffff, read8_delegate(FUNC(arcadia_cart_slot_device::extra_rom),(arcadia_cart_slot_device*)m_cart)); + break; + case ARCADIA_GOLF: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x4fff, read8_delegate(FUNC(arcadia_cart_slot_device::extra_rom),(arcadia_cart_slot_device*)m_cart)); + break; + } } - else - { - size = image.get_software_region_length("rom"); - memcpy(rom, image.get_software_region("rom"), size); - } - - if (size > 0x1000) - memmove(rom + 0x2000, rom + 0x1000, size - 0x1000); - - if (size > 0x2000) - memmove(rom + 0x4000, rom + 0x3000, size - 0x2000); - -#if 1 - // golf cartridge support - // 4kbyte at 0x0000 - // 2kbyte at 0x4000 - if (size <= 0x2000) - memcpy(rom + 0x4000, rom + 0x2000, 0x1000); -#else - /* this is a testpatch for the golf cartridge - so it could be burned in a arcadia 2001 cartridge - activate it and use debugger to save patched version */ - // not enough yet (some pointers stored as data?) - int i; - static const struct { UINT16 address; UINT8 old; UINT8 new; } - patch[]= { - { 0x0077,0x40,0x20 }, - { 0x011e,0x40,0x20 }, - { 0x0348,0x40,0x20 }, - { 0x03be,0x40,0x20 }, - { 0x04ce,0x40,0x20 }, - { 0x04da,0x40,0x20 }, - { 0x0562,0x42,0x22 }, - { 0x0617,0x40,0x20 }, - { 0x0822,0x40,0x20 }, - { 0x095e,0x42,0x22 }, - { 0x09d3,0x42,0x22 }, - { 0x0bb0,0x42,0x22 }, - { 0x0efb,0x40,0x20 }, - { 0x0ec1,0x43,0x23 }, - { 0x0f00,0x40,0x20 }, - { 0x0f12,0x40,0x20 }, - { 0x0ff5,0x43,0x23 }, - { 0x0ff7,0x41,0x21 }, - { 0x0ff9,0x40,0x20 }, - { 0x0ffb,0x41,0x21 }, - { 0x20ec,0x42,0x22 } - }; - - for (i = 0; i < ARRAY_LENGTH(patch); i++) - { - assert(rom[patch[i].address] == patch[i].old); - rom[patch[i].address] = patch[i].new; - } -#endif - return IMAGE_INIT_PASS; } +static SLOT_INTERFACE_START(arcadia_cart) + SLOT_INTERFACE_INTERNAL("std", ARCADIA_ROM_STD) + SLOT_INTERFACE_INTERNAL("golf", ARCADIA_ROM_GOLF) +SLOT_INTERFACE_END + + static MACHINE_CONFIG_START( arcadia, arcadia_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", S2650, 3580000/4) /* 0.895 MHz */ MCFG_CPU_PROGRAM_MAP(arcadia_mem) MCFG_CPU_IO_MAP(arcadia_io) - MCFG_CPU_PERIODIC_INT_DRIVER(arcadia_state, arcadia_video_line, 262*60) + MCFG_CPU_PERIODIC_INT_DRIVER(arcadia_state, video_line, 262*60) MCFG_QUANTUM_TIME(attotime::from_hz(60)) /* video hardware */ @@ -545,23 +490,19 @@ static MACHINE_CONFIG_START( arcadia, arcadia_state ) MCFG_PALETTE_INDIRECT_ENTRIES(8) MCFG_PALETTE_INIT_OWNER(arcadia_state, arcadia) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_ARCADIA_SOUND_ADD("custom") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* cartridge */ - MCFG_CARTSLOT_ADD("cart") - MCFG_CARTSLOT_EXTENSION_LIST("bin") - MCFG_CARTSLOT_NOT_MANDATORY - MCFG_CARTSLOT_INTERFACE("arcadia_cart") - MCFG_CARTSLOT_LOAD(arcadia_state,arcadia_cart) + MCFG_ARCADIA_CARTRIDGE_ADD("cartslot", arcadia_cart, NULL) /* Software lists */ MCFG_SOFTWARE_LIST_ADD("cart_list","arcadia") MACHINE_CONFIG_END + ROM_START(advsnha) ROM_REGION(0x8000,"maincpu", ROMREGION_ERASEFF) ROM_REGION(0x100,"gfx1", ROMREGION_ERASEFF) diff --git a/src/mess/drivers/vc4000.c b/src/mess/drivers/vc4000.c index 1acda2a524f..ce5f7c490d2 100644 --- a/src/mess/drivers/vc4000.c +++ b/src/mess/drivers/vc4000.c @@ -45,8 +45,6 @@ It consisted of a 2K ROM and 2K RAM which are most likely mapped as follows (nee The Cartridge is called Hobby Module and the Rom is probably the same as used in elektor TV Game Computer which is a kind of developer machine for the VC4000. -Go to the bottom to see the game list and emulation status of each. - ****************************************************************************** Elektor TV Games Computer @@ -360,55 +358,166 @@ PALETTE_INIT_MEMBER(vc4000_state, vc4000) palette.set_pen_colors(0, vc4000_palette, ARRAY_LENGTH(vc4000_palette)); } -DEVICE_IMAGE_LOAD_MEMBER( vc4000_state, vc4000_cart ) + +void vc4000_state::machine_start() { - address_space &memspace = m_maincpu->space(AS_PROGRAM); - UINT32 size; - - if (image.software_entry() == NULL) - size = image.length(); - else - size = image.get_software_region_length("rom"); - - if (size > 0x1600) - size = 0x1600; - - if (size > 0x1000) /* 6k rom + 1k ram - Chess2 only */ + if (m_cart->exists()) { - memspace.install_read_bank(0x0800, 0x15ff, "bank1"); /* extra rom */ - membank("bank1")->set_base(memregion("maincpu")->base() + 0x1000); - - memspace.install_readwrite_bank(0x1800, 0x1bff, "bank2"); /* ram */ - membank("bank2")->set_base(memregion("maincpu")->base() + 0x1800); - } - else if (size > 0x0800) /* some 4k roms have 1k of mirrored ram */ - { - memspace.install_read_bank(0x0800, 0x0fff, "bank1"); /* extra rom */ - membank("bank1")->set_base(memregion("maincpu")->base() + 0x0800); - - memspace.install_readwrite_bank(0x1000, 0x15ff, 0, 0x800, "bank2"); /* ram */ - membank("bank2")->set_base(memregion("maincpu")->base() + 0x1000); - } - else if (size == 0x0800) /* 2k roms + 2k ram - Hobby Module(Radofin) and elektor TVGC*/ - { - memspace.install_readwrite_bank(0x0800, 0x0fff, "bank1"); /* ram */ - membank("bank1")->set_base(memregion("maincpu")->base() + 0x0800); - } - - if (size > 0) - { - if (image.software_entry() == NULL) + // extra handler + switch (m_cart->get_type()) { - if (image.fread(memregion("maincpu")->base(), size) != size) - return IMAGE_INIT_FAIL; + case VC4000_STD: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x07ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart)); + break; + case VC4000_RAM1K: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x0fff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1000, 0x15ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart)); + break; + case VC4000_CHESS2: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x15ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1800, 0x1bff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart)); + break; + // undumped Radofin Hobby Module +// case VC4000_HOBBY: +// m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x07ff, read8_delegate(FUNC(vc4000_cart_slot_device::read_rom),(vc4000_cart_slot_device*)m_cart)); +// m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0800, 0x0fff, read8_delegate(FUNC(vc4000_cart_slot_device::read_ram),(vc4000_cart_slot_device*)m_cart), write8_delegate(FUNC(vc4000_cart_slot_device::write_ram),(vc4000_cart_slot_device*)m_cart)); +// break; + } + + m_cart->save_ram(); + } +} + + +QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000) +{ + address_space &space = m_maincpu->space(AS_PROGRAM); + int i; + int exec_addr; + int quick_length; + dynamic_buffer quick_data; + int read_; + int result = IMAGE_INIT_FAIL; + + quick_length = image.length(); + quick_data.resize(quick_length); + read_ = image.fread( quick_data, quick_length); + if (read_ != quick_length) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Cannot read the file"); + image.message(" Cannot read the file"); + } + else + { + if (core_stricmp(image.filetype(), "tvc")==0) + { + if (quick_data[0] != 2) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Invalid header"); + image.message(" Invalid header"); + } + else + { + int quick_addr = quick_data[1] * 256 + quick_data[2]; + exec_addr = quick_data[3] * 256 + quick_data[4]; + + if (quick_length < 0x5) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too short"); + image.message(" File too short"); + } + else + if ((quick_length + quick_addr - 5) > 0x1600) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too long"); + image.message(" File too long"); + } + else + { + space.write_byte(0x08be, quick_data[3]); + space.write_byte(0x08bf, quick_data[4]); + + for (i = 5; i < quick_length; i++) + space.write_byte(i - 5 + quick_addr, quick_data[i]); + + /* display a message about the loaded quickload */ + image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length-5,quick_addr,quick_addr+quick_length-5,exec_addr); + + // Start the quickload + m_maincpu->set_state_int(S2650_PC, exec_addr); + result = IMAGE_INIT_PASS; + } + } } else - memcpy(memregion("maincpu")->base(), image.get_software_region("rom"), size); + if (core_stricmp(image.filetype(), "pgm")==0) + { + if (quick_data[0] != 0) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Invalid header"); + image.message(" Invalid header"); + } + else + { + exec_addr = quick_data[1] * 256 + quick_data[2]; + + if (exec_addr >= quick_length) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Exec address beyond end of file"); + image.message(" Exec address beyond end of file"); + } + else + if (quick_length < 0x904) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too short"); + image.message(" File too short"); + } + else + if (quick_length > 0x2000) + { + image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too long"); + image.message(" File too long"); + } + else + { + space.write_byte(0x08be, quick_data[1]); + space.write_byte(0x08bf, quick_data[2]); + + // load to 08C0-15FF (standard ram + extra) + int read_ = 0x1600; + if (quick_length < 0x1600) + read_ = quick_length; + for (i = 0x8c0; i < read_; i++) + space.write_byte(i, quick_data[i]); + + // load to 1F50-1FAF (PVI regs) + read_ = 0x1FB0; + if (quick_length < 0x1FB0) + read_ = quick_length; + if (quick_length > 0x1FC0) + for (i = 0x1F50; i < read_; i++) + vc4000_video_w(space, i-0x1f00, quick_data[i]); + + /* display a message about the loaded quickload */ + image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr); + + // Start the quickload + m_maincpu->set_state_int(S2650_PC, exec_addr); + result = IMAGE_INIT_PASS; + } + } + } } - - return IMAGE_INIT_PASS; + return result; } +static SLOT_INTERFACE_START(vc4000_cart) + SLOT_INTERFACE_INTERNAL("std", VC4000_ROM_STD) + SLOT_INTERFACE_INTERNAL("ram1k", VC4000_ROM_RAM1K) + SLOT_INTERFACE_INTERNAL("chess2", VC4000_ROM_CHESS2) +SLOT_INTERFACE_END + + static MACHINE_CONFIG_START( vc4000, vc4000_state ) /* basic machine hardware */ // MCFG_CPU_ADD("maincpu", S2650, 865000) /* 3550000/4, 3580000/3, 4430000/3 */ @@ -437,11 +546,7 @@ static MACHINE_CONFIG_START( vc4000, vc4000_state ) MCFG_QUICKLOAD_ADD("quickload", vc4000_state, vc4000, "pgm,tvc", 0) /* cartridge */ - MCFG_CARTSLOT_ADD("cart") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_NOT_MANDATORY - MCFG_CARTSLOT_INTERFACE("vc4000_cart") - MCFG_CARTSLOT_LOAD(vc4000_state,vc4000_cart) + MCFG_VC4000_CARTRIDGE_ADD("cartslot", vc4000_cart, NULL) /* software lists */ MCFG_SOFTWARE_LIST_ADD("cart_list","vc4000") @@ -552,131 +657,10 @@ ROM_START( elektor ) ROM_LOAD( "elektor.rom", 0x0000, 0x0800, CRC(e6ef1ee1) SHA1(6823b5a22582344016415f2a37f9f3a2dc75d2a7)) ROM_END -QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000) -{ - address_space &space = m_maincpu->space(AS_PROGRAM); - int i; - int exec_addr; - int quick_length; - dynamic_buffer quick_data; - int read_; - int result = IMAGE_INIT_FAIL; - - quick_length = image.length(); - quick_data.resize(quick_length); - read_ = image.fread( quick_data, quick_length); - if (read_ != quick_length) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Cannot read the file"); - image.message(" Cannot read the file"); - } - else - { - if (core_stricmp(image.filetype(), "tvc")==0) - { - if (quick_data[0] != 2) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Invalid header"); - image.message(" Invalid header"); - } - else - { - int quick_addr = quick_data[1] * 256 + quick_data[2]; - exec_addr = quick_data[3] * 256 + quick_data[4]; - - if (quick_length < 0x5) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too short"); - image.message(" File too short"); - } - else - if ((quick_length + quick_addr - 5) > 0x1600) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too long"); - image.message(" File too long"); - } - else - { - space.write_byte(0x08be, quick_data[3]); - space.write_byte(0x08bf, quick_data[4]); - - for (i = 5; i < quick_length; i++) - space.write_byte(i - 5 + quick_addr, quick_data[i]); - - /* display a message about the loaded quickload */ - image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length-5,quick_addr,quick_addr+quick_length-5,exec_addr); - - // Start the quickload - m_maincpu->set_state_int(S2650_PC, exec_addr); - result = IMAGE_INIT_PASS; - } - } - } - else - if (core_stricmp(image.filetype(), "pgm")==0) - { - if (quick_data[0] != 0) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Invalid header"); - image.message(" Invalid header"); - } - else - { - exec_addr = quick_data[1] * 256 + quick_data[2]; - - if (exec_addr >= quick_length) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Exec address beyond end of file"); - image.message(" Exec address beyond end of file"); - } - else - if (quick_length < 0x904) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too short"); - image.message(" File too short"); - } - else - if (quick_length > 0x2000) - { - image.seterror(IMAGE_ERROR_INVALIDIMAGE, "File too long"); - image.message(" File too long"); - } - else - { - space.write_byte(0x08be, quick_data[1]); - space.write_byte(0x08bf, quick_data[2]); - - // load to 08C0-15FF (standard ram + extra) - int read_ = 0x1600; - if (quick_length < 0x1600) - read_ = quick_length; - for (i = 0x8c0; i < read_; i++) - space.write_byte(i, quick_data[i]); - - // load to 1F50-1FAF (PVI regs) - read_ = 0x1FB0; - if (quick_length < 0x1FB0) - read_ = quick_length; - if (quick_length > 0x1FC0) - for (i = 0x1F50; i < read_; i++) - vc4000_video_w(space, i-0x1f00, quick_data[i]); - - /* display a message about the loaded quickload */ - image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr); - - // Start the quickload - m_maincpu->set_state_int(S2650_PC, exec_addr); - result = IMAGE_INIT_PASS; - } - } - } - } - return result; -} /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ -CONS(1978, vc4000, 0, 0, vc4000, vc4000, driver_device, 0, "Interton", "Intertion Electronic VC 4000", GAME_IMPERFECT_GRAPHICS ) /* Germany, Austria, UK, Australia */ +CONS(1978, vc4000, 0, 0, vc4000, vc4000, driver_device, 0, "Interton", "Interton Electronic VC 4000", GAME_IMPERFECT_GRAPHICS ) /* Germany, Austria, UK, Australia */ CONS(1979, spc4000, vc4000, 0, vc4000, vc4000, driver_device, 0, "Grundig", "Super Play Computer 4000", GAME_IMPERFECT_GRAPHICS ) /* Germany, Austria */ CONS(1979, cx3000tc, vc4000, 0, vc4000, vc4000, driver_device, 0, "Palson", "CX 3000 Tele Computer", GAME_IMPERFECT_GRAPHICS ) /* Spain */ CONS(1979, tvc4000, vc4000, 0, vc4000, vc4000, driver_device, 0, "Koerting", "TVC-4000", GAME_IMPERFECT_GRAPHICS ) /* Argentina */ @@ -700,176 +684,3 @@ CONS(1979, krvnjvtv, 0, vc4000, vc4000, vc4000, driver_device, CONS(1979, oc2000, krvnjvtv, 0, vc4000, vc4000, driver_device, 0, "SOE", "OC-2000", GAME_IMPERFECT_GRAPHICS ) /* France */ CONS(1980, mpt05, 0, vc4000, vc4000, vc4000, driver_device, 0, "ITMC", "MPT-05", GAME_IMPERFECT_GRAPHICS ) /* France */ CONS(1979, elektor, 0, 0, elektor, elektor, driver_device, 0, "Elektor", "Elektor TV Games Computer", GAME_IMPERFECT_GRAPHICS ) - -/* Game List and Emulation Status - -When you load a game it will normally appear to be unresponsive. Most carts contain a number of variants -of each game (e.g. Difficulty, Player1 vs Player2 or Player1 vs Computer, etc). - -Press F2 (if needed) to select which game variant you would like to play. The variant number will increment -on-screen. When you've made your choice, press F1 to start. The main keys are unlabelled, because an overlay -is provided with each cart. See below for a guide. You need to read the instructions that come with each game. - -In some games, the joystick is used like 4 buttons, and other games like a paddle. The two modes are -incompatible when using a keyboard. Therefore (in the emulation) a config dipswitch is used. The preferred -setting is listed below. - -(AC = Auto-centre, NAC = no auto-centre, 90 = turn controller 90 degrees). - -The list is rather incomplete, information will be added as it becomes available. - -The game names and numbers were obtained from the Amigan Software site. - -Cart Num Name ----------------------------------------------- -1. Grand Prix / Car Races / Autosport / Motor Racing / Road Race -Config: Paddle, NAC -Status: Working -Controls: Left-Right: Steer; Up: Accelerate - -2. Black Jack -Status: Not working (some digits missing; indicator missing; dealer's cards missing) -Controls: set bet with S and D; A to deal; 1 to hit, 2 to stay; Q accept insurance, E to decline; double-up (unknown key) -Indicator: E make a bet then deal; I choose insurance; - you lost; + you won; X hit or stay - -3. Olympics / Paddle Games / Bat & Ball / Pro Sport 60 / Sportsworld -Config: Paddle, NAC -Status: Working - -4. Tank Battle / Combat -Config: Button, 90 -Status: Working -Controls: Left-Right: Steer; Up: Accelerate; Fire: Shoot - -5. Maths 1 -Status: Working -Controls: Z difficulty; X = addition or subtraction; C ask question; A=1;S=2;D=3;Q=4;W=5;E=6;1=7;2=8;3=9;0=0; C enter - -6. Maths 2 -Status: Not working -Controls: Same as above. - -7. Air Sea Attack / Air Sea Battle -Config: Button, 90 -Status: Working -Controls: Left-Right: Move; Fire: Shoot - -8. Treasure Hunt / Capture the Flag / Concentration / Memory Match -Config: Buttons -Status: Working - -9. Labyrinth / Maze / Intelligence 1 -Config: Buttons -Status: Working - -10. Winter Sports -Notes: Background colours should be Cyan and White instead of Red and Black - -11. Hippodrome / Horse Race - -12. Hunting / Shooting Gallery - -13. Chess 1 -Status: Can't see what you're typing, wrong colours - -14. Moto-cros - -15. Four in a row / Intelligence 2 -Config: Buttons -Status: Working -Notes: Seems the unused squares should be black. The screen jumps about while the computer is "thinking". - -16. Code Breaker / Master Mind / Intelligence 3 / Challenge - -17. Circus -STatus: severe gfx issues - -18. Boxing / Prize Fight - -19. Outer Space / Spacewar / Space Attack / Outer Space Combat - -20. Melody Simon / Musical Memory / Follow the Leader / Musical Games / Electronic Music / Face the Music - -21. Capture / Othello / Reversi / Attack / Intelligence 4 -Config: Buttons -Status: Working -Notes: Seems the unused squares should be black - -22. Chess 2 -Status: Can't see what you're typing, wrong colours - -23. Pinball / Flipper / Arcade -Status: gfx issues - -24. Soccer - -25. Bowling / NinePins -Config: Paddle, rotated 90 degrees, up/down autocentre, left-right does not -Status: Working - -26. Draughts - -27. Golf -Status: gfx issues - -28. Cockpit -Status: gfx issues - -29. Metropolis / Hangman -Status: gfx issues - -30. Solitaire - -31. Casino -Status: gfx issues, items missing and unplayable -Controls: 1 or 3=START; q=GO; E=STOP; D=$; Z=^; X=tens; C=units - -32. Invaders / Alien Invasion / Earth Invasion -Status: Works -Config: Buttons - -33. Super Invaders -Status: Stars are missing, colours are wrong -Config: Buttons (90) - -36. BackGammon -Status: Not all counters are visible, Dice & game number not visible. -Controls: Fire=Exec; 1=D+; 3=D-; Q,W,E=4,5,6; A,S,D=1,2,3; Z=CL; X=STOP; C=SET - -37. Monster Man / Spider's Web -Status: Works -Config: Buttons - -38. Hyperspace -Status: Works -Config: Buttons (90) -Controls: 3 - status button; Q,W,E,A,S,D,Z,X,C selects which galaxy to visit - - -40. Super Space -Status: Works, some small gfx issues near the bottom -Config: Buttons - - - -Acetronic: (dumps are compatible) ------------- - -* Shooting Gallery -Status: works but screen flickers -Config: Buttons - -* Planet Defender -Status: Works -Config: Paddle (NAC) - -* Laser Attack -Status: Works -Config: Buttons - - - -Public Domain: (written for emulators, may not work on real hardware) ---------------- -* Picture (no controls) - works -* Wincadia Stub (no controls) - works, small graphic error */ diff --git a/src/mess/includes/arcadia.h b/src/mess/includes/arcadia.h index 78074e6e70d..99e7e18168f 100644 --- a/src/mess/includes/arcadia.h +++ b/src/mess/includes/arcadia.h @@ -9,9 +9,10 @@ #include "emu.h" #include "cpu/s2650/s2650.h" -#include "imagedev/cartslot.h" #include "audio/arcadia.h" +#include "bus/arcadia/slot.h" +#include "bus/arcadia/rom.h" // space vultures sprites above // combat below and invisible @@ -40,13 +41,14 @@ public: m_controller2_extra(*this, "controller2_extra"), m_joysticks(*this, "joysticks") , m_maincpu(*this, "maincpu"), + m_cart(*this, "cartslot"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_screen(*this, "screen") { } - DECLARE_READ8_MEMBER(arcadia_vsync_r); - DECLARE_READ8_MEMBER(arcadia_video_r); - DECLARE_WRITE8_MEMBER(arcadia_video_w); + DECLARE_READ8_MEMBER(vsync_r); + DECLARE_READ8_MEMBER(video_r); + DECLARE_WRITE8_MEMBER(video_w); int m_line; int m_charline; int m_shift; @@ -92,11 +94,11 @@ public: } m_reg; bitmap_ind16 *m_bitmap; DECLARE_DRIVER_INIT(arcadia); + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(arcadia); UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(arcadia_video_line); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER( arcadia_cart ); + INTERRUPT_GEN_MEMBER(video_line); protected: required_device m_custom; @@ -111,11 +113,12 @@ protected: required_ioport m_controller2_extra; required_ioport m_joysticks; - void arcadia_draw_char(UINT8 *ch, int charcode, int y, int x); - void arcadia_vh_draw_line(int y, UINT8 chars1[16]); - int arcadia_sprite_collision(int n1, int n2); - void arcadia_draw_sprites(); + void draw_char(UINT8 *ch, int charcode, int y, int x); + void vh_draw_line(int y, UINT8 chars1[16]); + int sprite_collision(int n1, int n2); + void draw_sprites(); required_device m_maincpu; + required_device m_cart; required_device m_gfxdecode; required_device m_palette; required_device m_screen; diff --git a/src/mess/includes/vc4000.h b/src/mess/includes/vc4000.h index c6f79cb2d48..bdba708b86c 100644 --- a/src/mess/includes/vc4000.h +++ b/src/mess/includes/vc4000.h @@ -9,11 +9,13 @@ #include "emu.h" #include "cpu/s2650/s2650.h" -#include "imagedev/cartslot.h" #include "imagedev/snapquik.h" #include "imagedev/cassette.h" #include "sound/wave.h" +#include "bus/vc4000/slot.h" +#include "bus/vc4000/rom.h" + // define this to use digital inputs instead of the slow // autocentering analog mame joys #define ANALOG_HACK @@ -73,9 +75,10 @@ class vc4000_state : public driver_device public: vc4000_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_cassette(*this, "cassette"), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), + m_cassette(*this, "cassette"), + m_cart(*this, "cartslot"), m_keypad1_1(*this, "KEYPAD1_1"), m_keypad1_2(*this, "KEYPAD1_2"), m_keypad1_3(*this, "KEYPAD1_3"), @@ -110,17 +113,18 @@ public: UINT8 m_objects[512]; UINT8 m_irq_pause; bitmap_ind16 *m_bitmap; - optional_device m_cassette; + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(vc4000); UINT32 screen_update_vc4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vc4000_video_line); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vc4000_cart); DECLARE_QUICKLOAD_LOAD_MEMBER(vc4000); protected: required_device m_maincpu; required_device m_screen; + optional_device m_cassette; + required_device m_cart; required_ioport m_keypad1_1; required_ioport m_keypad1_2; required_ioport m_keypad1_3; diff --git a/src/mess/mess.mak b/src/mess/mess.mak index 37691c7acdb..58cabc3ea51 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -569,6 +569,7 @@ BUSES += ABCKB BUSES += ADAM BUSES += ADAMNET BUSES += APF +BUSES += ARCADIA BUSES += BML3 BUSES += BW2 BUSES += C64 @@ -622,6 +623,7 @@ BUSES += SNES BUSES += TI99PEB BUSES += TVC BUSES += VBOY +BUSES += VC4000 BUSES += VCS BUSES += VCS_CTRL BUSES += VIC10 diff --git a/src/mess/video/arcadia.c b/src/mess/video/arcadia.c index 7889b150afd..3b8ab6bc29d 100644 --- a/src/mess/video/arcadia.c +++ b/src/mess/video/arcadia.c @@ -308,7 +308,7 @@ void arcadia_state::video_start() } } -READ8_MEMBER( arcadia_state::arcadia_video_r ) +READ8_MEMBER( arcadia_state::video_r ) { UINT8 data=0; switch (offset) @@ -370,7 +370,7 @@ READ8_MEMBER( arcadia_state::arcadia_video_r ) return data; } -WRITE8_MEMBER( arcadia_state::arcadia_video_w ) +WRITE8_MEMBER( arcadia_state::video_w ) { m_reg.data[offset]=data; switch (offset) @@ -419,7 +419,7 @@ WRITE8_MEMBER( arcadia_state::arcadia_video_w ) } } -void arcadia_state::arcadia_draw_char(UINT8 *ch, int charcode, int y, int x) +void arcadia_state::draw_char(UINT8 *ch, int charcode, int y, int x) { int k,b,cc,sc, colour; if (m_multicolor) @@ -472,7 +472,7 @@ void arcadia_state::arcadia_draw_char(UINT8 *ch, int charcode, int y, int x) } -void arcadia_state::arcadia_vh_draw_line(int y, UINT8 chars1[16]) +void arcadia_state::vh_draw_line(int y, UINT8 chars1[16]) { int x, ch, j, h; int graphics = m_graphics; @@ -501,14 +501,14 @@ void arcadia_state::arcadia_vh_draw_line(int y, UINT8 chars1[16]) } } if (graphics) - arcadia_draw_char(m_rectangle[ch&0x3f], ch, y, x); + draw_char(m_rectangle[ch&0x3f], ch, y, x); else - arcadia_draw_char(m_chars[ch&0x3f], ch, y, x); + draw_char(m_chars[ch&0x3f], ch, y, x); } } -int arcadia_state::arcadia_sprite_collision(int n1, int n2) +int arcadia_state::sprite_collision(int n1, int n2) { int k, b1, b2, x; if (m_pos[n1].x+8<=m_pos[n2].x) @@ -536,7 +536,7 @@ int arcadia_state::arcadia_sprite_collision(int n1, int n2) } -void arcadia_state::arcadia_draw_sprites() +void arcadia_state::draw_sprites() { int i, k, x, y, color=0; UINT8 b; @@ -603,15 +603,15 @@ void arcadia_state::arcadia_draw_sprites() } } } - if (arcadia_sprite_collision(0,1)) m_reg.d.collision_sprite&=~1; - if (arcadia_sprite_collision(0,2)) m_reg.d.collision_sprite&=~2; - if (arcadia_sprite_collision(0,3)) m_reg.d.collision_sprite&=~4; - if (arcadia_sprite_collision(1,2)) m_reg.d.collision_sprite&=~8; - if (arcadia_sprite_collision(1,3)) m_reg.d.collision_sprite&=~0x10; //guess - if (arcadia_sprite_collision(2,3)) m_reg.d.collision_sprite&=~0x20; //guess + if (sprite_collision(0,1)) m_reg.d.collision_sprite&=~1; + if (sprite_collision(0,2)) m_reg.d.collision_sprite&=~2; + if (sprite_collision(0,3)) m_reg.d.collision_sprite&=~4; + if (sprite_collision(1,2)) m_reg.d.collision_sprite&=~8; + if (sprite_collision(1,3)) m_reg.d.collision_sprite&=~0x10; //guess + if (sprite_collision(2,3)) m_reg.d.collision_sprite&=~0x20; //guess } -INTERRUPT_GEN_MEMBER(arcadia_state::arcadia_video_line) +INTERRUPT_GEN_MEMBER(arcadia_state::video_line) { int width = m_screen->width(); @@ -639,7 +639,7 @@ INTERRUPT_GEN_MEMBER(arcadia_state::arcadia_video_line) { if (((m_line-m_ypos)&(h-1))==0) { - arcadia_vh_draw_line(m_charline*h+m_ypos, m_reg.d.chars1[m_charline]); + vh_draw_line(m_charline*h+m_ypos, m_reg.d.chars1[m_charline]); } } else @@ -647,7 +647,7 @@ INTERRUPT_GEN_MEMBER(arcadia_state::arcadia_video_line) { if (((m_line-m_ypos)&(h-1))==0) { - arcadia_vh_draw_line(m_charline*h+m_ypos, m_reg.d.chars2[m_charline-13]); + vh_draw_line(m_charline*h+m_ypos, m_reg.d.chars2[m_charline-13]); } m_charline-=13; } @@ -659,10 +659,10 @@ INTERRUPT_GEN_MEMBER(arcadia_state::arcadia_video_line) } } if (m_line==261) - arcadia_draw_sprites(); + draw_sprites(); } -READ8_MEMBER( arcadia_state::arcadia_vsync_r ) +READ8_MEMBER( arcadia_state::vsync_r ) { return m_line>=216 ? 0x80 : 0 ; }