From aeccf9e8130b854bfadf388e15a3afad871d4907 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 2 Apr 2023 01:09:38 +1100 Subject: leapfrog: Less redundancy in source file names. Also edited a pile of copy/pasted comments and made some minor code cleanups (reducing variable scope, etc.). --- src/devices/bus/sdk85/memexp.h | 6 +- src/devices/bus/vc4000/slot.h | 6 +- src/devices/machine/hp_dc100_tape.h | 4 +- src/frontend/mame/ui/floppycntrl.cpp | 4 +- src/mame/atari/lynx.cpp | 19 +- src/mame/ausnz/binbug.cpp | 3 +- src/mame/ausnz/d6800.cpp | 19 +- src/mame/ausnz/eti660.cpp | 3 +- src/mame/ausnz/pipbug.cpp | 3 +- src/mame/booth/apexc_m.cpp | 11 +- src/mame/cantab/jupace.cpp | 24 +- src/mame/force/force68k.cpp | 2 +- src/mame/funtech/supracan.cpp | 2 +- src/mame/handheld/gameking.cpp | 2 +- src/mame/homebrew/phunsy.cpp | 18 +- src/mame/homebrew/ravens.cpp | 3 +- src/mame/homelab/homelab.cpp | 2 +- src/mame/hp/hp2640_tape.h | 2 +- src/mame/hp/hp48_port.h | 4 +- src/mame/hp/hp80_optrom.h | 4 +- src/mame/hp/hp9825_optrom.h | 4 +- src/mame/hp/hp9845_optrom.h | 6 +- src/mame/hp/hp_ipc_optrom.h | 4 +- src/mame/igs/pgm2_memcard.h | 6 +- src/mame/intel/rex6000.cpp | 1 + src/mame/leapfrog/iquest.cpp | 804 +++++++++++++++++++++++ src/mame/leapfrog/leapfrog_iquest.cpp | 804 ----------------------- src/mame/leapfrog/leapfrog_leappad.cpp | 233 ------- src/mame/leapfrog/leapfrog_leapster_explorer.cpp | 114 ---- src/mame/leapfrog/leappad.cpp | 233 +++++++ src/mame/leapfrog/leapster_explorer.cpp | 114 ++++ src/mame/mame.lst | 10 +- 32 files changed, 1234 insertions(+), 1240 deletions(-) create mode 100644 src/mame/leapfrog/iquest.cpp delete mode 100644 src/mame/leapfrog/leapfrog_iquest.cpp delete mode 100644 src/mame/leapfrog/leapfrog_leappad.cpp delete mode 100644 src/mame/leapfrog/leapfrog_leapster_explorer.cpp create mode 100644 src/mame/leapfrog/leappad.cpp create mode 100644 src/mame/leapfrog/leapster_explorer.cpp diff --git a/src/devices/bus/sdk85/memexp.h b/src/devices/bus/sdk85/memexp.h index 058df8eada4..5fa9c6153ba 100644 --- a/src/devices/bus/sdk85/memexp.h +++ b/src/devices/bus/sdk85/memexp.h @@ -52,10 +52,10 @@ public: void io_w(offs_t offset, u8 data); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; - // image-level overrides + // device_image_interface implementation virtual std::error_condition call_load() override; virtual void call_unload() override { } @@ -63,7 +63,7 @@ protected: virtual const char *image_interface() const noexcept override { return "sdk85_rom"; } virtual const char *file_extensions() const noexcept override { return "bin"; } - // slot interface overrides + // device_slot_interface implementation virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; private: diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h index 9da3d6d4d32..3a9d2dc1cc4 100644 --- a/src/devices/bus/vc4000/slot.h +++ b/src/devices/bus/vc4000/slot.h @@ -69,7 +69,7 @@ public: vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~vc4000_cart_slot_device(); - // image-level overrides + // device_image_interface implementation virtual std::error_condition call_load() override; virtual void call_unload() override { } @@ -77,7 +77,7 @@ public: virtual const char *image_interface() const noexcept override { return "vc4000_cart"; } virtual const char *file_extensions() const noexcept override { return "bin,rom"; } - // slot interface overrides + // device_slot_interface implementation virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override; int get_type() { return m_type; } @@ -98,7 +98,7 @@ protected: device_t *owner, uint32_t clock); - // device-level overrides + // device_t implementation virtual void device_start() override; int m_type; diff --git a/src/devices/machine/hp_dc100_tape.h b/src/devices/machine/hp_dc100_tape.h index 1642149211a..d3c1998b214 100644 --- a/src/devices/machine/hp_dc100_tape.h +++ b/src/devices/machine/hp_dc100_tape.h @@ -23,7 +23,7 @@ public: // Construction hp_dc100_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device_image_interface overrides + // device_image_interface implementation virtual std::error_condition call_load() override; virtual std::error_condition call_create(int format_type, util::option_resolution *format_options) override; virtual void call_unload() override; @@ -100,7 +100,7 @@ public: auto wr_bit() { return m_wr_bit_handler.bind(); } protected: - // device-level overrides + // device_t implementation virtual void device_start() override; virtual void device_reset() override; diff --git a/src/frontend/mame/ui/floppycntrl.cpp b/src/frontend/mame/ui/floppycntrl.cpp index ee4916bd737..31b353d8a53 100644 --- a/src/frontend/mame/ui/floppycntrl.cpp +++ b/src/frontend/mame/ui/floppycntrl.cpp @@ -40,7 +40,7 @@ menu_control_floppy_image::~menu_control_floppy_image() void menu_control_floppy_image::do_load_create() { - if(input_filename.compare("")==0) { + if(input_filename.empty()) { std::error_condition err = fd.create(output_filename, nullptr, nullptr); if (err) { machine().popmessage("Error: %s", err.message()); @@ -56,7 +56,7 @@ void menu_control_floppy_image::do_load_create() } } else { std::error_condition err = fd.load(input_filename); - if (!err && (output_filename.compare("") != 0)) + if (!err && !output_filename.empty()) { err = fd.reopen_for_write(output_filename); if (err) { machine().popmessage("Error: %s", err.message()); diff --git a/src/mame/atari/lynx.cpp b/src/mame/atari/lynx.cpp index 9af858bbe89..d465d67913f 100644 --- a/src/mame/atari/lynx.cpp +++ b/src/mame/atari/lynx.cpp @@ -151,13 +151,7 @@ ROM_END QUICKLOAD_LOAD_MEMBER(lynx_state::quickload_cb) { - address_space &space = m_maincpu->space(AS_PROGRAM); - std::vector data; - u8 *rom = memregion("maincpu")->base(); u8 header[10]; // 80 08 dw Start dw Len B S 9 3 - uint16_t start, length; - int i; - if (image.fread( header, sizeof(header)) != sizeof(header)) return image_error::UNSPECIFIED; @@ -169,21 +163,22 @@ QUICKLOAD_LOAD_MEMBER(lynx_state::quickload_cb) return err; } - start = header[3] | (header[2]<<8); //! big endian format in file format for little endian cpu - length = header[5] | (header[4]<<8); - length -= 10; + uint16_t const start = header[3] | (header[2]<<8); //! big endian format in file format for little endian cpu + uint16_t const length = (header[5] | (header[4]<<8)) - 10; + std::vector data; data.resize(length); - - if (image.fread( &data[0], length) != length) + if (image.fread(&data[0], length) != length) { osd_printf_error("%s: Invalid length in file header\n", image.basename()); return image_error::INVALIDIMAGE; } - for (i = 0; i < length; i++) + address_space &space = m_maincpu->space(AS_PROGRAM); + for (int i = 0; i < length; i++) space.write_byte(start + i, data[i]); + u8 *rom = memregion("maincpu")->base(); rom[0x1fc] = start & 0xff; rom[0x1fd] = start >> 8; space.write_byte(0x1fc, start & 0xff); diff --git a/src/mame/ausnz/binbug.cpp b/src/mame/ausnz/binbug.cpp index 39d3527a9a6..e1d35e1389e 100644 --- a/src/mame/ausnz/binbug.cpp +++ b/src/mame/ausnz/binbug.cpp @@ -183,12 +183,11 @@ QUICKLOAD_LOAD_MEMBER(binbug_state::quickload_cb) int i; int quick_addr = 0x440; int exec_addr; - int quick_length; std::vector quick_data; int read_; std::error_condition result = image_error::UNSPECIFIED; - quick_length = image.length(); + int const quick_length = image.length(); if (quick_length < 0x0444) { result = image_error::INVALIDLENGTH; diff --git a/src/mame/ausnz/d6800.cpp b/src/mame/ausnz/d6800.cpp index 7fd586858e5..9b137c55127 100644 --- a/src/mame/ausnz/d6800.cpp +++ b/src/mame/ausnz/d6800.cpp @@ -342,11 +342,9 @@ void d6800_state::machine_reset() QUICKLOAD_LOAD_MEMBER(d6800_state::quickload_cb) { - address_space &space = m_maincpu->space(AS_PROGRAM); - u8 ch; - u16 quick_addr = 0x200; - u16 exec_addr = 0xc000; - u32 quick_length = image.length(); + constexpr u16 QUICK_ADDR = 0x200; + + u32 const quick_length = image.length(); if (quick_length > 0xe00) { osd_printf_error("%s: File exceeds 3854 bytes\n", image.basename()); @@ -354,17 +352,20 @@ QUICKLOAD_LOAD_MEMBER(d6800_state::quickload_cb) return image_error::INVALIDIMAGE; } + address_space &space = m_maincpu->space(AS_PROGRAM); for (u32 i = 0; i < quick_length; i++) { + u8 ch; image.fread(&ch, 1); - space.write_byte(i + quick_addr, ch); + space.write_byte(i + QUICK_ADDR, ch); } + u16 exec_addr = 0xc000; if (image.is_filetype("bin")) - exec_addr = quick_addr; + exec_addr = QUICK_ADDR; - /* display a message about the loaded quickload */ - image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length,quick_addr,quick_addr+quick_length,exec_addr); + // display a message about the loaded quickload + image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X", quick_length, QUICK_ADDR, QUICK_ADDR+quick_length, exec_addr); // Start the quickload m_maincpu->set_pc(exec_addr); diff --git a/src/mame/ausnz/eti660.cpp b/src/mame/ausnz/eti660.cpp index 23fe35727df..6f301d42ab0 100644 --- a/src/mame/ausnz/eti660.cpp +++ b/src/mame/ausnz/eti660.cpp @@ -321,12 +321,11 @@ QUICKLOAD_LOAD_MEMBER(eti660_state::quickload_cb) int quick_addr = 0x600; int quick_length; std::vector quick_data; - int read_; std::error_condition result = image_error::UNSPECIFIED; quick_length = image.length(); quick_data.resize(quick_length); - read_ = image.fread( &quick_data[0], quick_length); + int const read_ = image.fread( &quick_data[0], quick_length); if (read_ != quick_length) { result = image_error::INVALIDIMAGE; diff --git a/src/mame/ausnz/pipbug.cpp b/src/mame/ausnz/pipbug.cpp index d79603e37ce..3e0c9387a82 100644 --- a/src/mame/ausnz/pipbug.cpp +++ b/src/mame/ausnz/pipbug.cpp @@ -154,12 +154,11 @@ QUICKLOAD_LOAD_MEMBER(pipbug_state::quickload_cb) int i; int quick_addr = 0x440; int exec_addr; - int quick_length; std::vector quick_data; int read_; std::error_condition result = image_error::UNSPECIFIED; - quick_length = image.length(); + int const quick_length = image.length(); if (quick_length < 0x0444) { result = image_error::INVALIDLENGTH; diff --git a/src/mame/booth/apexc_m.cpp b/src/mame/booth/apexc_m.cpp index e54fc39519f..7a338404058 100644 --- a/src/mame/booth/apexc_m.cpp +++ b/src/mame/booth/apexc_m.cpp @@ -29,14 +29,13 @@ std::error_condition apexc_cylinder_image_device::call_load() /* load RAM contents */ m_writable = !is_readonly(); - fread( machine().root_device().memshare("maincpu")->ptr(), 0x1000); + fread(machine().root_device().memshare("maincpu")->ptr(), 0x1000); #ifdef LSB_FIRST - { /* fix endianness */ - uint32_t *RAM = (uint32_t *)(machine().root_device().memshare("maincpu")->ptr()); + /* fix endianness */ + auto const RAM = reinterpret_cast(machine().root_device().memshare("maincpu")->ptr()); - for (int i=0; i < 0x0400; i++) - RAM[i] = big_endianize_int32(RAM[i]); - } + for (int i=0; i < 0x0400; i++) + RAM[i] = big_endianize_int32(RAM[i]); #endif return std::error_condition(); diff --git a/src/mame/cantab/jupace.cpp b/src/mame/cantab/jupace.cpp index 297f3ffc724..a7bec83268f 100644 --- a/src/mame/cantab/jupace.cpp +++ b/src/mame/cantab/jupace.cpp @@ -172,10 +172,6 @@ private: SNAPSHOT_LOAD_MEMBER(ace_state::snapshot_cb) { - std::vector RAM(0x10000); - cpu_device *cpu = m_maincpu; - address_space &space = cpu->space(AS_PROGRAM); - unsigned char ace_repeat, ace_byte; u16 ace_index=0x2000; bool done = false; @@ -187,9 +183,11 @@ SNAPSHOT_LOAD_MEMBER(ace_state::snapshot_cb) } logerror("Loading file %s.\r\n", image.filename()); + std::vector RAM(0x10000); while (!done && (ace_index < 0x8001)) { - image.fread( &ace_byte, 1); + unsigned char ace_repeat, ace_byte; + image.fread(&ace_byte, 1); if (ace_byte == 0xed) { image.fread(&ace_byte, 1); @@ -223,15 +221,16 @@ SNAPSHOT_LOAD_MEMBER(ace_state::snapshot_cb) return image_error::INVALIDIMAGE; } - // patch CPU registers - // Some games do not follow the standard, and have rubbish in the CPU area. So, - // we check that some other bytes are correct. - // 2080 = memory size of original machine, should be 0000 or 8000 or C000. - // 2118 = new stack pointer, do not use if between 8000 and FF00. + // patch CPU registers + // Some games do not follow the standard, and have rubbish in the CPU area. So, + // we check that some other bytes are correct. + // 2080 = memory size of original machine, should be 0000 or 8000 or C000. + // 2118 = new stack pointer, do not use if between 8000 and FF00. ace_index = RAM[0x2080] | (RAM[0x2081] << 8); - if ((ace_index & 0x3FFF)==0) + cpu_device *cpu = m_maincpu; + if ((ace_index & 0x3fff) == 0) { cpu->set_state_int(Z80_AF, RAM[0x2100] | (RAM[0x2101] << 8)); cpu->set_state_int(Z80_BC, RAM[0x2104] | (RAM[0x2105] << 8)); @@ -254,7 +253,8 @@ SNAPSHOT_LOAD_MEMBER(ace_state::snapshot_cb) cpu->set_state_int(Z80_SP, RAM[0x2118] | (RAM[0x2119] << 8)); } - /* Copy data to the address space */ + // Copy data to the address space + address_space &space = cpu->space(AS_PROGRAM); for (ace_index = 0x2000; ace_index < 0x8000; ace_index++) space.write_byte(ace_index, RAM[ace_index]); diff --git a/src/mame/force/force68k.cpp b/src/mame/force/force68k.cpp index 8f28c6d1861..a1d7b3a48ad 100644 --- a/src/mame/force/force68k.cpp +++ b/src/mame/force/force68k.cpp @@ -514,7 +514,7 @@ std::error_condition force68k_state::force68k_load_cart(device_image_interface & { uint32_t size = slot->common_get_size("rom"); - if (size > 0x20000) // Max 128Kb + if (size > 0x2'0000) // Max 128Kb { LOG("Cartridge size exceeding max size (128Kb): %d\n", size); osd_printf_error("%s: Cartridge size exceeding max size (128Kb)\n", image.basename()); diff --git a/src/mame/funtech/supracan.cpp b/src/mame/funtech/supracan.cpp index 64efd11b924..2638be2986e 100644 --- a/src/mame/funtech/supracan.cpp +++ b/src/mame/funtech/supracan.cpp @@ -1920,7 +1920,7 @@ DEVICE_IMAGE_LOAD_MEMBER(supracan_state::cart_load) { uint32_t size = m_cart->common_get_size("rom"); - if (size > 0x400000) + if (size > 0x40'0000) { osd_printf_error("%s: Unsupported cartridge size\n", image.basename()); return image_error::INVALIDLENGTH; diff --git a/src/mame/handheld/gameking.cpp b/src/mame/handheld/gameking.cpp index 8c23a8bdce1..16e02c72a4e 100644 --- a/src/mame/handheld/gameking.cpp +++ b/src/mame/handheld/gameking.cpp @@ -256,7 +256,7 @@ DEVICE_IMAGE_LOAD_MEMBER(gameking_state::cart_load) { uint32_t size = m_cart->common_get_size("rom"); - if (size > 0x100000) + if (size > 0x10'0000) { osd_printf_error("%s: Unsupported cartridge size\n", image.basename()); return image_error::INVALIDLENGTH; diff --git a/src/mame/homebrew/phunsy.cpp b/src/mame/homebrew/phunsy.cpp index 66ca5278932..6c84ad89c12 100644 --- a/src/mame/homebrew/phunsy.cpp +++ b/src/mame/homebrew/phunsy.cpp @@ -27,19 +27,22 @@ Rom banking (in U bank): ****************************************************************************/ #include "emu.h" + #include "cpu/s2650/s2650.h" #include "imagedev/cassette.h" #include "imagedev/snapquik.h" #include "machine/keyboard.h" #include "sound/spkrdev.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" +#define VERBOSE 1 +#include "logmacro.h" -namespace { -#define LOG 1 +namespace { class phunsy_state : public driver_device { @@ -119,8 +122,7 @@ void phunsy_state::phunsy_data(address_map &map) void phunsy_state::phunsy_ctrl_w(uint8_t data) { - if (LOG) - logerror("%s: phunsy_ctrl_w %02x\n", machine().describe_context(), data); + LOG("%s: phunsy_ctrl_w %02x\n", machine().describe_context(), data); // Q-bank membank("bankq")->set_entry(data & 15); @@ -135,8 +137,7 @@ void phunsy_state::phunsy_ctrl_w(uint8_t data) void phunsy_state::phunsy_data_w(uint8_t data) { - if (LOG) - logerror("%s: phunsy_data_w %02x\n", machine().describe_context(), data); + LOG("%s: phunsy_data_w %02x\n", machine().describe_context(), data); m_data_out = data; @@ -162,8 +163,7 @@ uint8_t phunsy_state::phunsy_data_r() { uint8_t data = 0xff; - //if (LOG) - //logerror("%s: phunsy_data_r\n", machine().describe_context()); + //LOG("%s: phunsy_data_r\n", machine().describe_context()); if ( m_data_out & 0x02 ) { @@ -290,7 +290,7 @@ QUICKLOAD_LOAD_MEMBER(phunsy_state::quickload_cb) uint16_t quick_addr = 0x1800; std::vector quick_data; std::error_condition result = image_error::UNSPECIFIED; - int quick_length = image.length(); + int const quick_length = image.length(); if (quick_length > 0x4000) { result = image_error::INVALIDLENGTH; diff --git a/src/mame/homebrew/ravens.cpp b/src/mame/homebrew/ravens.cpp index 3cae68c0b2d..d76073cd953 100644 --- a/src/mame/homebrew/ravens.cpp +++ b/src/mame/homebrew/ravens.cpp @@ -316,12 +316,11 @@ QUICKLOAD_LOAD_MEMBER(ravens_base::quickload_cb) int i; int quick_addr = 0x900; int exec_addr; - int quick_length; std::vector quick_data; int read_; std::error_condition result = image_error::UNSPECIFIED; - quick_length = image.length(); + int const quick_length = image.length(); if (quick_length < 0x0900) { result = image_error::INVALIDLENGTH; diff --git a/src/mame/homelab/homelab.cpp b/src/mame/homelab/homelab.cpp index 5f7b4b91b0c..89a081abffd 100644 --- a/src/mame/homelab/homelab.cpp +++ b/src/mame/homelab/homelab.cpp @@ -732,7 +732,7 @@ QUICKLOAD_LOAD_MEMBER(homelab_state::quickload_cb) for (i = 0; i < quick_length; i++) { - int j = (quick_addr + i); + unsigned j = (quick_addr + i); if (image.fread(&ch, 1) != 1) { osd_printf_error("%s: Unexpected EOF while writing byte to %04X\n", image.basename(), j); diff --git a/src/mame/hp/hp2640_tape.h b/src/mame/hp/hp2640_tape.h index 89ecbb95203..e44bf16c5f8 100644 --- a/src/mame/hp/hp2640_tape.h +++ b/src/mame/hp/hp2640_tape.h @@ -34,7 +34,7 @@ public: uint8_t poll_r () const; protected: - // device-level overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/mame/hp/hp48_port.h b/src/mame/hp/hp48_port.h index e668bd85cc1..44df0bd4a6d 100644 --- a/src/mame/hp/hp48_port.h +++ b/src/mame/hp/hp48_port.h @@ -34,7 +34,7 @@ public: m_max_size = max_size; } - // image-level overrides + // device_image_interface implementation virtual bool is_readable() const noexcept override { return true; } virtual bool is_writeable() const noexcept override { return true; } virtual bool is_creatable() const noexcept override { return true; } @@ -52,7 +52,7 @@ public: uint8_t *port_data() const { return m_port_data.get(); } protected: - // device-level overrides + // device_t implementation virtual void device_start() override; private: diff --git a/src/mame/hp/hp80_optrom.h b/src/mame/hp/hp80_optrom.h index f98f4d538e8..65336115598 100644 --- a/src/mame/hp/hp80_optrom.h +++ b/src/mame/hp/hp80_optrom.h @@ -34,10 +34,10 @@ public: void install_read_handler(address_space& space); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; - // image-level overrides + // device_image_interface implementation virtual std::error_condition call_load() override; virtual void call_unload() override; diff --git a/src/mame/hp/hp9825_optrom.h b/src/mame/hp/hp9825_optrom.h index 00e95b7f899..fe1f365c3f4 100644 --- a/src/mame/hp/hp9825_optrom.h +++ b/src/mame/hp/hp9825_optrom.h @@ -29,11 +29,11 @@ public: void install_rw_handlers(address_space *space_r , address_space *space_w); protected: - // device-level overrides + // device_t implementation virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; - // image-level overrides + // device_image_interface implementation virtual std::error_condition call_load() override; virtual void call_unload() override; diff --git a/src/mame/hp/hp9845_optrom.h b/src/mame/hp/hp9845_optrom.h index 1764c1a8edd..652261e5c08 100644 --- a/src/mame/hp/hp9845_optrom.h +++ b/src/mame/hp/hp9845_optrom.h @@ -19,15 +19,15 @@ class hp9845_optrom_device : public device_t, public device_rom_image_interface { public: - // construction/destruction + // construction/destruction hp9845_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~hp9845_optrom_device(); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; - // image-level overrides + // device_rom_image_interface implementation virtual std::error_condition call_load() override; virtual void call_unload() override; diff --git a/src/mame/hp/hp_ipc_optrom.h b/src/mame/hp/hp_ipc_optrom.h index bc4b246f7db..ca8c1bcdae4 100644 --- a/src/mame/hp/hp_ipc_optrom.h +++ b/src/mame/hp/hp_ipc_optrom.h @@ -31,10 +31,10 @@ public: void install_read_handler(address_space& space); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; - // image-level overrides + // device_image_interface implementation virtual std::error_condition call_load() override; virtual void call_unload() override; diff --git a/src/mame/igs/pgm2_memcard.h b/src/mame/igs/pgm2_memcard.h index 23b55a61956..781d7acf6b3 100644 --- a/src/mame/igs/pgm2_memcard.h +++ b/src/mame/igs/pgm2_memcard.h @@ -36,8 +36,6 @@ public: virtual void call_unload() override; virtual std::error_condition call_create(int format_type, util::option_resolution *format_options) override; - // device-level overrides - virtual void device_start() override; u8 read(offs_t offset); void write(offs_t offset, u8 data); @@ -49,7 +47,11 @@ public: /* returns the index of the current memory card, or -1 if none */ int present() { return is_loaded() ? 0 : -1; } + private: + // device_t implementation + virtual void device_start() override; + u8 m_memcard_data[0x100]; u8 m_protection_data[4]; u8 m_security_data[4]; diff --git a/src/mame/intel/rex6000.cpp b/src/mame/intel/rex6000.cpp index b482b0ab26a..fed5d44828d 100644 --- a/src/mame/intel/rex6000.cpp +++ b/src/mame/intel/rex6000.cpp @@ -732,6 +732,7 @@ void rex6000_state::rex6000_palettte(palette_device &palette) const QUICKLOAD_LOAD_MEMBER(rex6000_state::quickload_rex6000) { + // FIXME: this suffers buffer overruns on excessively short images and various kinds of invalid images static const char magic[] = "ApplicationName:Addin"; uint32_t img_start = 0; diff --git a/src/mame/leapfrog/iquest.cpp b/src/mame/leapfrog/iquest.cpp new file mode 100644 index 00000000000..22ff5248d55 --- /dev/null +++ b/src/mame/leapfrog/iquest.cpp @@ -0,0 +1,804 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/****************************************************************************** + + Leapfrog IQuest + + has LCD display + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/mcs51/mcs51.h" + +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" +#include "machine/bankdev.h" + +#include "screen.h" +#include "softlist_dev.h" +#include "speaker.h" +#include "screen.h" + + +namespace { + +class leapfrog_iquest_state : public driver_device +{ +public: + leapfrog_iquest_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_cart(*this, "cartslot") + , m_screen(*this, "screen") + , m_maincpu(*this, "maincpu") + , m_rombank(*this, "rombank") + , m_cart_region(nullptr) + { } + + void leapfrog_iquest(machine_config &config); + +protected: + void leapfrog_base(machine_config &config); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + required_device m_cart; + required_device m_screen; + + DECLARE_WRITE_LINE_MEMBER(rx_line_hack); + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + void prog_map(address_map &map); + void ext_map(address_map &map); + + required_device m_maincpu; + + void rom_map(address_map &map); + + required_device m_rombank; + memory_region *m_cart_region; + + uint8_t m_lowerbank[2]; + uint8_t m_upperbank[2]; + + uint8_t lowerbank_r(offs_t offset); + uint8_t upperbank_r(offs_t offset); + void lowerbank_w(offs_t offset, uint8_t data); + void upperbank_w(offs_t offset, uint8_t data); + + uint8_t m_iobank[2]; + + uint8_t iobank_r(offs_t offset); + void iobank_w(offs_t offset, uint8_t data); + + + uint8_t lowerwindow_r(offs_t offset); + uint8_t upperwindow_r(offs_t offset); + + uint8_t iowindow_r(offs_t offset); + void iowindow_w(offs_t offset, uint8_t data); + + uint8_t unk_ff80_r(); + void unk_ff80_w(uint8_t data); + uint8_t m_ff80 = 0; + + uint8_t unk_fc00_r(); + uint8_t unk_fc01_r(offs_t offset); + + uint8_t unk_fc2f_r(); + uint8_t unk_fc3f_r(); + void unk_fc3f_w(uint8_t data); + + void unk_fc22_w(uint8_t data); + + uint8_t unk_fce5_r(); + void unk_fce5_w(uint8_t data); + + uint8_t m_fce5 = 0; + + uint8_t unk_ff00_01_r(offs_t offset); + + void unk_ff81_84_w(offs_t offset, uint8_t data); + uint8_t m_ff81_84[4]{}; + + uint8_t unk_ff91_93_r(offs_t offset); + void unk_ff91_93_w(offs_t offset, uint8_t data); + uint8_t m_ff91_93[3]{}; + + uint8_t unk_ffa8_r(); + void unk_ffa8_w(uint8_t data); + uint8_t m_ffa8 = 0; + + void unk_ffa9_w(uint8_t data); + + void tx(uint8_t data); + uint8_t rx(); + + + uint8_t port0_r(); + void port0_w(u8 data); + uint8_t port1_r(); + void port1_w(u8 data); + uint8_t port2_r(); + void port2_w(u8 data); + uint8_t port3_r(); + void port3_w(u8 data); +}; + + +class leapfrog_turboextreme_state : public leapfrog_iquest_state +{ +public: + leapfrog_turboextreme_state(const machine_config &mconfig, device_type type, const char *tag) + : leapfrog_iquest_state(mconfig, type, tag) + { } + + void leapfrog_turboex(machine_config &config); +}; + +class leapfrog_turbotwistmath_state : public leapfrog_iquest_state +{ +public: + leapfrog_turbotwistmath_state(const machine_config &mconfig, device_type type, const char *tag) + : leapfrog_iquest_state(mconfig, type, tag) + { } + + void leapfrog_turbotwistmath(machine_config &config); +}; + +class leapfrog_turbotwistvocabulator_state : public leapfrog_iquest_state +{ +public: + leapfrog_turbotwistvocabulator_state(const machine_config &mconfig, device_type type, const char *tag) + : leapfrog_iquest_state(mconfig, type, tag) + { } + + void leapfrog_turbotwistvocabulator(machine_config &config); +}; + +class leapfrog_turbotwistspelling_state : public leapfrog_iquest_state +{ +public: + leapfrog_turbotwistspelling_state(const machine_config &mconfig, device_type type, const char *tag) + : leapfrog_iquest_state(mconfig, type, tag) + { } + + void leapfrog_turbotwistspelling(machine_config &config); +}; + + +class leapfrog_turbotwistbrainquest_state : public leapfrog_iquest_state +{ +public: + leapfrog_turbotwistbrainquest_state(const machine_config &mconfig, device_type type, const char *tag) + : leapfrog_iquest_state(mconfig, type, tag) + { } + + void leapfrog_turbotwistbrainquest(machine_config &config); +}; + + +void leapfrog_iquest_state::machine_start() +{ + // if there's a cart, override the standard mapping + if (m_cart && m_cart->exists()) + { + m_cart_region = memregion(std::string(m_cart->tag()) + GENERIC_ROM_REGION_TAG); + } +} + +void leapfrog_iquest_state::machine_reset() +{ + m_lowerbank[0] = m_lowerbank[1] = 0x00; + m_upperbank[0] = m_upperbank[1] = 0x00; + m_iobank[0] = m_iobank[1] = 0x00; + + m_rombank->set_bank(0); + m_ff80 = 0x00; + + m_fce5 = 0x00; + + m_ff91_93[0] = m_ff91_93[1] = m_ff91_93[2] = 0x00; +} + + +uint8_t leapfrog_iquest_state::lowerbank_r(offs_t offset) +{ + return m_lowerbank[offset]; +} + +uint8_t leapfrog_iquest_state::upperbank_r(offs_t offset) +{ + return m_upperbank[offset]; +} + + +void leapfrog_iquest_state::lowerbank_w(offs_t offset, uint8_t data) +{ + m_lowerbank[offset] = data; +} + +void leapfrog_iquest_state::upperbank_w(offs_t offset, uint8_t data) +{ + m_upperbank[offset] = data; +} + +uint8_t leapfrog_iquest_state::iobank_r(offs_t offset) +{ + return m_iobank[offset]; +} + + +void leapfrog_iquest_state::iobank_w(offs_t offset, uint8_t data) +{ + //printf("iobank_w %d, %02x\n", offset, data); + m_iobank[offset] = data; +} + + +void leapfrog_iquest_state::rom_map(address_map &map) +{ + map(0x00000000, 0x003fffff).rom().region("maincpu", 0); + map(0x00400000, 0x007fffff).ram(); +} + +uint8_t leapfrog_iquest_state::lowerwindow_r(offs_t offset) +{ + uint32_t bank = ((m_lowerbank[0] << 8) | (m_lowerbank[1])) * 0x8000; + return m_rombank->read8(bank + offset); +} + +uint8_t leapfrog_iquest_state::upperwindow_r(offs_t offset) +{ + uint32_t bank = ((m_upperbank[0] << 8) | (m_upperbank[1])) * 0x8000; + return m_rombank->read8(bank + offset); +} + +uint8_t leapfrog_iquest_state::iowindow_r(offs_t offset) +{ + uint32_t bank = ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000; + return m_rombank->read8(bank + offset); +} + +void leapfrog_iquest_state::iowindow_w(offs_t offset, uint8_t data) +{ + uint32_t bank = ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000; + m_rombank->write8(bank + offset, data); +} + + +void leapfrog_iquest_state::prog_map(address_map &map) +{ + map(0x0000, 0x7fff).r(FUNC(leapfrog_iquest_state::lowerwindow_r)); + map(0x8000, 0xffff).r(FUNC(leapfrog_iquest_state::upperwindow_r)); +} + +uint8_t leapfrog_iquest_state::unk_ff80_r() +{ + logerror("%s: unk_ff80_r\n", machine().describe_context()); + return m_ff80; +} + +void leapfrog_iquest_state::unk_ff80_w(uint8_t data) +{ + // must return what is written for some startup tests + logerror("%s: m_ff80 %02x\n", machine().describe_context(), data); + m_ff80 = data; +} + +uint8_t leapfrog_iquest_state::unk_fc00_r() +{ + logerror("%s: unk_fc00_r\n", machine().describe_context()); + return 0x00;// machine().rand(); +} + +uint8_t leapfrog_iquest_state::unk_fc01_r(offs_t offset) +{ + logerror("%s: unk_fc01_r %d\n", machine().describe_context(), offset); + return 0xff;// machine().rand(); +} + +uint8_t leapfrog_iquest_state::unk_fc2f_r() +{ + logerror("%s: unk_fc2f_r\n", machine().describe_context()); + return 0x00;// machine().rand(); +} + +uint8_t leapfrog_iquest_state::unk_fc3f_r() +{ + logerror("%s: unk_fc3f_r\n", machine().describe_context()); + return 0x00;// machine().rand(); +} + +void leapfrog_iquest_state::unk_fc3f_w(uint8_t data) +{ + logerror("%s: unk_fc3f_w %02x\n", machine().describe_context(), data); +} + +void leapfrog_iquest_state::unk_fc22_w(uint8_t data) +{ + logerror("%s: unk_fc22_w %02x\n", machine().describe_context(), data); +} + +uint8_t leapfrog_iquest_state::unk_ff00_01_r(offs_t offset) +{ + // read around the time of fc22 writes + logerror("%s: unk_ff00_01_r %d\n", machine().describe_context(), offset); + return 0x00; +} + +uint8_t leapfrog_iquest_state::unk_fce5_r() +{ + logerror("%s: unk_fce5_r\n", machine().describe_context()); + return 0x00;// m_fce5;// machine().rand(); +} + +void leapfrog_iquest_state::unk_fce5_w(uint8_t data) +{ + // repeated read/write pattern on this address + logerror("%s: unk_fce5_w %02x\n", machine().describe_context(), data); + m_fce5 = data; +} + +/* + +in all cases ff91-ff93 writes appear to be an address in the current main space +which is 0x10000-0x17fff, 0x10000-0x17fff in ROM at the time of writing +or for the later writes 0x10000-0x17fff, 0x20000-0x27fff (the b448 is from 0x23448 for example) + +each of the blocks pointed to is preceded by a 0x00 byte? (maybe 0x00 is a terminator for previous block?) + +the blocks being pointed at during startup are debug text, c style strings for 'printf' functions, complete with +formatting characters while the ff81 to ff84 area contains the parameters. + +it seems likely this is just a RAM area and these are temporary storage for the debug print function, +either for futher processing and output to an actual debug console, or shared with another device (ff80, which is +possibly the start of this RAM area, is written after putting these pointers in RAM) + +*/ + +uint8_t leapfrog_iquest_state::unk_ff91_93_r(offs_t offset) +{ + logerror("%s: unk_ff91_93_r %d\n", machine().describe_context(), offset); + return 0x00;// m_ff91_93[offset]; +} + +void leapfrog_iquest_state::unk_ff91_93_w(offs_t offset, uint8_t data) +{ + // these 3 values are written together + m_ff91_93[offset] = data; + + // form is ff then 2 other values, these are pointers into the main space it seems + + if (offset == 2) + { + logerror("%s: write to ff91 to ff93 region %02x %02x %02x (current banks are %08x %08x %08x)\n", machine().describe_context(), m_ff91_93[0], m_ff91_93[1], m_ff91_93[2], ((m_lowerbank[0] << 8) | (m_lowerbank[1])) * 0x8000, ((m_upperbank[0] << 8) | (m_upperbank[1])) * 0x8000, ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000); + + uint16_t pointer = (m_ff91_93[1] << 8) | (m_ff91_93[2]); + + address_space& spc = m_maincpu->space(AS_PROGRAM); + char readdat = 0x00; + + std::string textout; + do + { + readdat = spc.read_byte(pointer++); + textout.append(1, readdat); + } while (readdat != 0x00); + logerror("%s: DEBUG MESSAGE: %s", machine().describe_context(), textout); + logerror("\n"); + } +} + +void leapfrog_iquest_state::unk_ff81_84_w(offs_t offset, uint8_t data) +{ + // these 4 values are written together, with FFA8 before and FFA9 after + // form is usually 00 00 then 2 used values, maybe coordinates? + // used in conjunction with unk_ff91_93_w writes above + m_ff81_84[offset] = data; + + if (offset == 3) + { + logerror("%s: write to ff81 to ff84 region %02x %02x %02x %02x\n", machine().describe_context(), m_ff81_84[0], m_ff81_84[1], m_ff81_84[2], m_ff81_84[3]); + + uint16_t pointer = (m_ff81_84[2] << 8) | (m_ff81_84[3]); + + if (pointer != 0x00) + { + address_space& spc = m_maincpu->space(AS_PROGRAM); + char readdat = 0x00; + + std::string textout; + do + { + readdat = spc.read_byte(pointer++); + textout.append(1, readdat); + } while (readdat != 0x00); + + //logerror("%s: %s", machine().describe_context(), textout); + //logerror("\n"); + } + } +} + +uint8_t leapfrog_iquest_state::unk_ffa8_r() +{ + logerror("%s: read from ffa8 ----------- POSSIBLE END OF DEBUG TEXT OPERATION?\n", machine().describe_context()); + return 0x00; +} + +void leapfrog_iquest_state::unk_ffa8_w(uint8_t data) +{ + logerror("%s: write to ffa8 %02x ----------- POSSIBLE START OF DEBUG TEXT OPERATION?\n", machine().describe_context(), data); + m_ffa8 = data; +} + +void leapfrog_iquest_state::unk_ffa9_w(uint8_t data) +{ + logerror("%s: write to ffa9 %02x ----------- POSSIBLE TRIGGER DEBUG TEXT OPERATION?? (current banks are %08x %08x %08x)\n", machine().describe_context(), data, ((m_lowerbank[0] << 8) | (m_lowerbank[1])) * 0x8000, ((m_upperbank[0] << 8) | (m_upperbank[1])) * 0x8000, ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000); +} + + + + +void leapfrog_iquest_state::ext_map(address_map &map) +{ + map(0x0000, 0x7fff).rw(FUNC(leapfrog_iquest_state::iowindow_r), FUNC(leapfrog_iquest_state::iowindow_w)); // assume this accesses the same space, with different bank register + + map(0xc260, 0xc52f).ram(); // = clears 0x2d0 bytes (90*64 / 8) display buffer? + map(0xc530, 0xc7ff).ram(); // = clears 0x2d0 bytes (90*64 / 8) display buffer? + + //map(0xf001, 0xf056).ram(); // written as a block + map(0xf000, 0xf5ff).ram(); // ? 0xf400 - 0xf427 written as a block, other areas uncertain, might be more registers in here as there are reads too + + map(0xfc00, 0xfc00).r(FUNC(leapfrog_iquest_state::unk_fc00_r)); + map(0xfc01, 0xfc04).r(FUNC(leapfrog_iquest_state::unk_fc01_r)); + + map(0xfc06, 0xfc07).rw(FUNC(leapfrog_iquest_state::lowerbank_r), FUNC(leapfrog_iquest_state::lowerbank_w)); // ROM / RAM window in main space at 0000-7fff + map(0xfc08, 0xfc09).rw(FUNC(leapfrog_iquest_state::upperbank_r), FUNC(leapfrog_iquest_state::upperbank_w)); // ROM / RAM window in main space at 8000-ffff + map(0xfc0a, 0xfc0b).rw(FUNC(leapfrog_iquest_state::iobank_r), FUNC(leapfrog_iquest_state::iobank_w)); // ROM / RAM window in ext space at 0000-7fff + + map(0xfc22, 0xfc22).w(FUNC(leapfrog_iquest_state::unk_fc22_w)); + + map(0xfc2f, 0xfc2f).r(FUNC(leapfrog_iquest_state::unk_fc2f_r)); + map(0xfc3f, 0xfc3f).rw(FUNC(leapfrog_iquest_state::unk_fc3f_r), FUNC(leapfrog_iquest_state::unk_fc3f_w)); + + map(0xfce5, 0xfce5).rw(FUNC(leapfrog_iquest_state::unk_fce5_r), FUNC(leapfrog_iquest_state::unk_fce5_w)); + + map(0xff00, 0xff01).r(FUNC(leapfrog_iquest_state::unk_ff00_01_r)); + + // it seems more likely that this is just RAM, as that after setting pointers in RAM, they're used to construct + // strings to transmit over the serial. + // however, mapping this area as RAM instead results in the program stalling much earlier, waiting for $24.3 to + // be cleared. + // 017658: 20 23 fd jb $24.3,$17658 + // + //The only realistic place for this to be cleared is deep in the interrupt handler for + // Serial Receive/Transmit + // 010023: 02 76 9e ljmp $769E + // (which eventually can reach) + // 016991: c2 23 clr $24.3 + // however I'm uncertain how to get the driver to trigger this at all. + if (0) + { + map(0xff80, 0xffff).ram(); + } + else + { + map(0xff80, 0xff80).rw(FUNC(leapfrog_iquest_state::unk_ff80_r), FUNC(leapfrog_iquest_state::unk_ff80_w)); + + map(0xff81, 0xff84).w(FUNC(leapfrog_iquest_state::unk_ff81_84_w)); + + map(0xff91, 0xff93).rw(FUNC(leapfrog_iquest_state::unk_ff91_93_r), FUNC(leapfrog_iquest_state::unk_ff91_93_w)); + + map(0xffa8, 0xffa8).rw(FUNC(leapfrog_iquest_state::unk_ffa8_r), FUNC(leapfrog_iquest_state::unk_ffa8_w)); + map(0xffa9, 0xffa9).w(FUNC(leapfrog_iquest_state::unk_ffa9_w)); + } +} + +DEVICE_IMAGE_LOAD_MEMBER(leapfrog_iquest_state::cart_load) +{ + uint32_t size = m_cart->common_get_size("rom"); + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return std::error_condition(); +} + +static INPUT_PORTS_START( leapfrog_iquest ) +INPUT_PORTS_END + +uint32_t leapfrog_iquest_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +// never triggered? +void leapfrog_iquest_state::tx(uint8_t data) +{ + logerror("%s: transmitting %02x\n", machine().describe_context().c_str(), data); +} + +// never triggered? +uint8_t leapfrog_iquest_state::rx() +{ + logerror("%s: receiving\n", machine().describe_context().c_str()); + return machine().rand(); +} + + +// doesn't help? +WRITE_LINE_MEMBER(leapfrog_iquest_state::rx_line_hack) +{ + /* + m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE); + m_maincpu->set_input_line(MCS51_RX_LINE, CLEAR_LINE); + */ + + if (0) + { + // HACK: force past the wait loop if we're treating ff80 - ffff as RAM + address_space& spc = m_maincpu->space(AS_DATA); + uint8_t readdat = spc.read_byte(0x24); + readdat &= ~0x08; + spc.write_byte(0x24, readdat); + } +} + +uint8_t leapfrog_iquest_state::port0_r() +{ + logerror("%s: port0_r\n", machine().describe_context()); + return 0x00; +} + +uint8_t leapfrog_iquest_state::port1_r() +{ + logerror("%s: port1_r\n", machine().describe_context()); + return 0x00; +} + +uint8_t leapfrog_iquest_state::port2_r() +{ + logerror("%s: port2_r\n", machine().describe_context()); + return 0x00; +} + +uint8_t leapfrog_iquest_state::port3_r() +{ + logerror("%s: port3_r\n", machine().describe_context()); + return 0x00; +} + +void leapfrog_iquest_state::port0_w(u8 data) +{ + logerror("%s: port0_w %02x\n", machine().describe_context(), data); +} + +void leapfrog_iquest_state::port1_w(u8 data) +{ + logerror("%s: port1_w %02x\n", machine().describe_context(), data); +} + +void leapfrog_iquest_state::port2_w(u8 data) +{ + logerror("%s: port2_w %02x\n", machine().describe_context(), data); +} + +void leapfrog_iquest_state::port3_w(u8 data) +{ + logerror("%s: port3_w %02x\n", machine().describe_context(), data); +} + + + +void leapfrog_iquest_state::leapfrog_base(machine_config &config) +{ + // seems to have an IRQ vector at 002b, which would suggest it's an 8052 or similar, rather than plain 8031? + //I8052(config, m_maincpu, 96000000/10); // unknown clock + I8032(config, m_maincpu, 96000000/10); // unknown clock + m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_iquest_state::prog_map); + m_maincpu->set_addrmap(AS_IO, &leapfrog_iquest_state::ext_map); + m_maincpu->serial_tx_cb().set(FUNC(leapfrog_iquest_state::tx)); + m_maincpu->serial_rx_cb().set(FUNC(leapfrog_iquest_state::rx)); + m_maincpu->port_in_cb<0>().set(FUNC(leapfrog_iquest_state::port0_r)); + m_maincpu->port_out_cb<0>().set(FUNC(leapfrog_iquest_state::port0_w)); + m_maincpu->port_in_cb<1>().set(FUNC(leapfrog_iquest_state::port1_r)); + m_maincpu->port_out_cb<1>().set(FUNC(leapfrog_iquest_state::port1_w)); + m_maincpu->port_in_cb<2>().set(FUNC(leapfrog_iquest_state::port2_r)); + m_maincpu->port_out_cb<2>().set(FUNC(leapfrog_iquest_state::port2_w)); + m_maincpu->port_in_cb<3>().set(FUNC(leapfrog_iquest_state::port3_r)); + m_maincpu->port_out_cb<3>().set(FUNC(leapfrog_iquest_state::port3_w)); + + ADDRESS_MAP_BANK(config, "rombank").set_map(&leapfrog_iquest_state::rom_map).set_options(ENDIANNESS_LITTLE, 8, 31, 0x80000000); +} + +void leapfrog_iquest_state::leapfrog_iquest(machine_config &config) +{ + leapfrog_iquest_state::leapfrog_base(config); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); + m_screen->set_size(90, 64); + m_screen->set_visarea(0, 90-1, 0, 64-1); + m_screen->set_screen_update(FUNC(leapfrog_iquest_state::screen_update)); + m_screen->screen_vblank().set(FUNC(leapfrog_iquest_state::rx_line_hack)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_iquest_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_iquest_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_iquest_cart"); +} + +void leapfrog_turboextreme_state::leapfrog_turboex(machine_config &config) +{ + leapfrog_iquest_state::leapfrog_base(config); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); + m_screen->set_size(64, 32); // unknown resolution, lower than iquest + m_screen->set_visarea(0, 64-1, 0, 32-1); + m_screen->set_screen_update(FUNC(leapfrog_turboextreme_state::screen_update)); + m_screen->screen_vblank().set(FUNC(leapfrog_turboextreme_state::rx_line_hack)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turboextreme_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_turboextreme_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("turboextreme_cart"); +} + +void leapfrog_turbotwistmath_state::leapfrog_turbotwistmath(machine_config &config) +{ + leapfrog_iquest_state::leapfrog_base(config); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); + m_screen->set_size(64, 8); // unknown resolution, single row display + m_screen->set_visarea(0, 64-1, 0, 8-1); + m_screen->set_screen_update(FUNC(leapfrog_turbotwistmath_state::screen_update)); + m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistmath_state::rx_line_hack)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistmath_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_turbotwistmath_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("ttwist_math_cart"); +} + +void leapfrog_turbotwistspelling_state::leapfrog_turbotwistspelling(machine_config &config) +{ + leapfrog_iquest_state::leapfrog_base(config); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); + m_screen->set_size(64, 8); // unknown resolution, single row display + m_screen->set_visarea(0, 64-1, 0, 8-1); + m_screen->set_screen_update(FUNC(leapfrog_turbotwistspelling_state::screen_update)); + m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistspelling_state::rx_line_hack)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistspelling_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_turbotwistspelling_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("ttwist_spelling_cart"); +} + +void leapfrog_turbotwistvocabulator_state::leapfrog_turbotwistvocabulator(machine_config &config) +{ + leapfrog_iquest_state::leapfrog_base(config); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); + m_screen->set_size(64, 8); // unknown resolution, single row display + m_screen->set_visarea(0, 64-1, 0, 8-1); + m_screen->set_screen_update(FUNC(leapfrog_turbotwistvocabulator_state::screen_update)); + m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistvocabulator_state::rx_line_hack)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistvocabulator_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_turbotwistvocabulator_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("ttwist_vocabulator_cart"); +} + + +void leapfrog_turbotwistbrainquest_state::leapfrog_turbotwistbrainquest(machine_config &config) +{ + leapfrog_iquest_state::leapfrog_base(config); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); + m_screen->set_size(64, 8); // unknown resolution, single row display + m_screen->set_visarea(0, 64-1, 0, 8-1); + m_screen->set_screen_update(FUNC(leapfrog_turbotwistbrainquest_state::screen_update)); + m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistbrainquest_state::rx_line_hack)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistbrainquest_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_turbotwistbrainquest_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("ttwist_brainquest_cart"); +} + +ROM_START( iquest ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "iquest.bin", 0x000000, 0x400000, CRC(f785dc4e) SHA1(ec002c18df536737334fe6b7db0e7342bad7b66b)) + + // there is also a 39vf512 flash containing user data +ROM_END + +ROM_START( turboex ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "turbotwistextreme.bin", 0x000000, 0x400000, CRC(d7cabcff) SHA1(7813811c0518aba017f7a79fd477be5ed9fa7529)) +ROM_END + +ROM_START( ttwistm ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "turbotwistmath.bin", 0x000000, 0x200000, CRC(a21d3723) SHA1(d0ae245621d7bc92bdf9fd683908690db6e25133)) +ROM_END + +ROM_START( ttwistsp ) // PCB marks ROM glob as 8M + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "ttspelling.bin", 0x000000, 0x100000, CRC(09715a8e) SHA1(5d7eb7b714b95012aeb03c37dd0b71a1c025bdda)) +ROM_END + +ROM_START( ttwistvc ) // PCB marks ROM glob as 8M + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "vocabulator.bin", 0x000000, 0x100000, CRC(71f9c4c9) SHA1(8cafb42bd56c7db99949781e42b6ad4991ee2246)) +ROM_END + +ROM_START( ttwistbq ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "turbotwistbrainquest.bin", 0x000000, 0x200000, CRC(b184a517) SHA1(181975da58b3d117a389c54ac025b6a9b24342b2)) +ROM_END + +ROM_START( ttwistfb ) // PCB marks ROM glob as 16M + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "factblaster.bin", 0x000000, 0x200000, CRC(8efd63f5) SHA1(2cbd1299006ad9743d846e774afe7a134ba0fce3)) +ROM_END + +} // anonymous namespace + + +// year, name, parent, compat, machine, input, class, init, company, fullname, flags +// it is unknown if the versions of IQuest without 4.0 on the case have different system ROM +CONS( 2004, iquest, 0, 0, leapfrog_iquest, leapfrog_iquest, leapfrog_iquest_state, empty_init, "LeapFrog", "IQuest 4.0 (US)", MACHINE_IS_SKELETON ) + +CONS( 2004, turboex, 0, 0, leapfrog_turboex, leapfrog_iquest, leapfrog_turboextreme_state, empty_init, "LeapFrog", "Turbo Extreme (US)", MACHINE_IS_SKELETON ) + +// from a silver unit with orange lettering (there are different case styles, it is unknown if the software changed) +CONS( 2002, ttwistm, 0, 0, leapfrog_turbotwistmath, leapfrog_iquest, leapfrog_turbotwistmath_state, empty_init, "LeapFrog", "Turbo Twist Math (US)", MACHINE_IS_SKELETON ) + +// Brain Quest / Fact Blaster are compatible with the same cartridges +CONS( 200?, ttwistfb, 0, 0, leapfrog_turbotwistbrainquest, leapfrog_iquest, leapfrog_turbotwistbrainquest_state, empty_init, "LeapFrog", "Turbo Twist Fact Blaster (US)", MACHINE_IS_SKELETON ) +CONS( 2002, ttwistbq, 0, 0, leapfrog_turbotwistbrainquest, leapfrog_iquest, leapfrog_turbotwistbrainquest_state, empty_init, "LeapFrog", "Turbo Twist Brain Quest (US)", MACHINE_IS_SKELETON ) + +// from a green unit with blue edges +CONS( 2000, ttwistsp, 0, 0, leapfrog_turbotwistspelling, leapfrog_iquest, leapfrog_turbotwistspelling_state, empty_init, "LeapFrog", "Turbo Twist Spelling (US)", MACHINE_IS_SKELETON ) + +CONS( 2001, ttwistvc, 0, 0, leapfrog_turbotwistvocabulator, leapfrog_iquest, leapfrog_turbotwistvocabulator_state, empty_init, "LeapFrog", "Turbo Twist Vocabulator (US)", MACHINE_IS_SKELETON ) + +// Undumped units + +// These have 2 digit 7-seg style displays, it is unknown if they are on related hardware +// Twist & Shout Addition +// Twist & Shout Subtraction +// Twist & Shout Multiplication +// Twist & Shout Division + +// This appears to have a 4 digit 7-seg style display, unknown if it is on related hardware +// Twist & Shout Phonics diff --git a/src/mame/leapfrog/leapfrog_iquest.cpp b/src/mame/leapfrog/leapfrog_iquest.cpp deleted file mode 100644 index 22ff5248d55..00000000000 --- a/src/mame/leapfrog/leapfrog_iquest.cpp +++ /dev/null @@ -1,804 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/****************************************************************************** - - Leapfrog IQuest - - has LCD display - -*******************************************************************************/ - -#include "emu.h" - -#include "cpu/mcs51/mcs51.h" - -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "machine/bankdev.h" - -#include "screen.h" -#include "softlist_dev.h" -#include "speaker.h" -#include "screen.h" - - -namespace { - -class leapfrog_iquest_state : public driver_device -{ -public: - leapfrog_iquest_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_cart(*this, "cartslot") - , m_screen(*this, "screen") - , m_maincpu(*this, "maincpu") - , m_rombank(*this, "rombank") - , m_cart_region(nullptr) - { } - - void leapfrog_iquest(machine_config &config); - -protected: - void leapfrog_base(machine_config &config); - - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - - required_device m_cart; - required_device m_screen; - - DECLARE_WRITE_LINE_MEMBER(rx_line_hack); - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); - -private: - virtual void machine_start() override; - virtual void machine_reset() override; - - void prog_map(address_map &map); - void ext_map(address_map &map); - - required_device m_maincpu; - - void rom_map(address_map &map); - - required_device m_rombank; - memory_region *m_cart_region; - - uint8_t m_lowerbank[2]; - uint8_t m_upperbank[2]; - - uint8_t lowerbank_r(offs_t offset); - uint8_t upperbank_r(offs_t offset); - void lowerbank_w(offs_t offset, uint8_t data); - void upperbank_w(offs_t offset, uint8_t data); - - uint8_t m_iobank[2]; - - uint8_t iobank_r(offs_t offset); - void iobank_w(offs_t offset, uint8_t data); - - - uint8_t lowerwindow_r(offs_t offset); - uint8_t upperwindow_r(offs_t offset); - - uint8_t iowindow_r(offs_t offset); - void iowindow_w(offs_t offset, uint8_t data); - - uint8_t unk_ff80_r(); - void unk_ff80_w(uint8_t data); - uint8_t m_ff80 = 0; - - uint8_t unk_fc00_r(); - uint8_t unk_fc01_r(offs_t offset); - - uint8_t unk_fc2f_r(); - uint8_t unk_fc3f_r(); - void unk_fc3f_w(uint8_t data); - - void unk_fc22_w(uint8_t data); - - uint8_t unk_fce5_r(); - void unk_fce5_w(uint8_t data); - - uint8_t m_fce5 = 0; - - uint8_t unk_ff00_01_r(offs_t offset); - - void unk_ff81_84_w(offs_t offset, uint8_t data); - uint8_t m_ff81_84[4]{}; - - uint8_t unk_ff91_93_r(offs_t offset); - void unk_ff91_93_w(offs_t offset, uint8_t data); - uint8_t m_ff91_93[3]{}; - - uint8_t unk_ffa8_r(); - void unk_ffa8_w(uint8_t data); - uint8_t m_ffa8 = 0; - - void unk_ffa9_w(uint8_t data); - - void tx(uint8_t data); - uint8_t rx(); - - - uint8_t port0_r(); - void port0_w(u8 data); - uint8_t port1_r(); - void port1_w(u8 data); - uint8_t port2_r(); - void port2_w(u8 data); - uint8_t port3_r(); - void port3_w(u8 data); -}; - - -class leapfrog_turboextreme_state : public leapfrog_iquest_state -{ -public: - leapfrog_turboextreme_state(const machine_config &mconfig, device_type type, const char *tag) - : leapfrog_iquest_state(mconfig, type, tag) - { } - - void leapfrog_turboex(machine_config &config); -}; - -class leapfrog_turbotwistmath_state : public leapfrog_iquest_state -{ -public: - leapfrog_turbotwistmath_state(const machine_config &mconfig, device_type type, const char *tag) - : leapfrog_iquest_state(mconfig, type, tag) - { } - - void leapfrog_turbotwistmath(machine_config &config); -}; - -class leapfrog_turbotwistvocabulator_state : public leapfrog_iquest_state -{ -public: - leapfrog_turbotwistvocabulator_state(const machine_config &mconfig, device_type type, const char *tag) - : leapfrog_iquest_state(mconfig, type, tag) - { } - - void leapfrog_turbotwistvocabulator(machine_config &config); -}; - -class leapfrog_turbotwistspelling_state : public leapfrog_iquest_state -{ -public: - leapfrog_turbotwistspelling_state(const machine_config &mconfig, device_type type, const char *tag) - : leapfrog_iquest_state(mconfig, type, tag) - { } - - void leapfrog_turbotwistspelling(machine_config &config); -}; - - -class leapfrog_turbotwistbrainquest_state : public leapfrog_iquest_state -{ -public: - leapfrog_turbotwistbrainquest_state(const machine_config &mconfig, device_type type, const char *tag) - : leapfrog_iquest_state(mconfig, type, tag) - { } - - void leapfrog_turbotwistbrainquest(machine_config &config); -}; - - -void leapfrog_iquest_state::machine_start() -{ - // if there's a cart, override the standard mapping - if (m_cart && m_cart->exists()) - { - m_cart_region = memregion(std::string(m_cart->tag()) + GENERIC_ROM_REGION_TAG); - } -} - -void leapfrog_iquest_state::machine_reset() -{ - m_lowerbank[0] = m_lowerbank[1] = 0x00; - m_upperbank[0] = m_upperbank[1] = 0x00; - m_iobank[0] = m_iobank[1] = 0x00; - - m_rombank->set_bank(0); - m_ff80 = 0x00; - - m_fce5 = 0x00; - - m_ff91_93[0] = m_ff91_93[1] = m_ff91_93[2] = 0x00; -} - - -uint8_t leapfrog_iquest_state::lowerbank_r(offs_t offset) -{ - return m_lowerbank[offset]; -} - -uint8_t leapfrog_iquest_state::upperbank_r(offs_t offset) -{ - return m_upperbank[offset]; -} - - -void leapfrog_iquest_state::lowerbank_w(offs_t offset, uint8_t data) -{ - m_lowerbank[offset] = data; -} - -void leapfrog_iquest_state::upperbank_w(offs_t offset, uint8_t data) -{ - m_upperbank[offset] = data; -} - -uint8_t leapfrog_iquest_state::iobank_r(offs_t offset) -{ - return m_iobank[offset]; -} - - -void leapfrog_iquest_state::iobank_w(offs_t offset, uint8_t data) -{ - //printf("iobank_w %d, %02x\n", offset, data); - m_iobank[offset] = data; -} - - -void leapfrog_iquest_state::rom_map(address_map &map) -{ - map(0x00000000, 0x003fffff).rom().region("maincpu", 0); - map(0x00400000, 0x007fffff).ram(); -} - -uint8_t leapfrog_iquest_state::lowerwindow_r(offs_t offset) -{ - uint32_t bank = ((m_lowerbank[0] << 8) | (m_lowerbank[1])) * 0x8000; - return m_rombank->read8(bank + offset); -} - -uint8_t leapfrog_iquest_state::upperwindow_r(offs_t offset) -{ - uint32_t bank = ((m_upperbank[0] << 8) | (m_upperbank[1])) * 0x8000; - return m_rombank->read8(bank + offset); -} - -uint8_t leapfrog_iquest_state::iowindow_r(offs_t offset) -{ - uint32_t bank = ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000; - return m_rombank->read8(bank + offset); -} - -void leapfrog_iquest_state::iowindow_w(offs_t offset, uint8_t data) -{ - uint32_t bank = ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000; - m_rombank->write8(bank + offset, data); -} - - -void leapfrog_iquest_state::prog_map(address_map &map) -{ - map(0x0000, 0x7fff).r(FUNC(leapfrog_iquest_state::lowerwindow_r)); - map(0x8000, 0xffff).r(FUNC(leapfrog_iquest_state::upperwindow_r)); -} - -uint8_t leapfrog_iquest_state::unk_ff80_r() -{ - logerror("%s: unk_ff80_r\n", machine().describe_context()); - return m_ff80; -} - -void leapfrog_iquest_state::unk_ff80_w(uint8_t data) -{ - // must return what is written for some startup tests - logerror("%s: m_ff80 %02x\n", machine().describe_context(), data); - m_ff80 = data; -} - -uint8_t leapfrog_iquest_state::unk_fc00_r() -{ - logerror("%s: unk_fc00_r\n", machine().describe_context()); - return 0x00;// machine().rand(); -} - -uint8_t leapfrog_iquest_state::unk_fc01_r(offs_t offset) -{ - logerror("%s: unk_fc01_r %d\n", machine().describe_context(), offset); - return 0xff;// machine().rand(); -} - -uint8_t leapfrog_iquest_state::unk_fc2f_r() -{ - logerror("%s: unk_fc2f_r\n", machine().describe_context()); - return 0x00;// machine().rand(); -} - -uint8_t leapfrog_iquest_state::unk_fc3f_r() -{ - logerror("%s: unk_fc3f_r\n", machine().describe_context()); - return 0x00;// machine().rand(); -} - -void leapfrog_iquest_state::unk_fc3f_w(uint8_t data) -{ - logerror("%s: unk_fc3f_w %02x\n", machine().describe_context(), data); -} - -void leapfrog_iquest_state::unk_fc22_w(uint8_t data) -{ - logerror("%s: unk_fc22_w %02x\n", machine().describe_context(), data); -} - -uint8_t leapfrog_iquest_state::unk_ff00_01_r(offs_t offset) -{ - // read around the time of fc22 writes - logerror("%s: unk_ff00_01_r %d\n", machine().describe_context(), offset); - return 0x00; -} - -uint8_t leapfrog_iquest_state::unk_fce5_r() -{ - logerror("%s: unk_fce5_r\n", machine().describe_context()); - return 0x00;// m_fce5;// machine().rand(); -} - -void leapfrog_iquest_state::unk_fce5_w(uint8_t data) -{ - // repeated read/write pattern on this address - logerror("%s: unk_fce5_w %02x\n", machine().describe_context(), data); - m_fce5 = data; -} - -/* - -in all cases ff91-ff93 writes appear to be an address in the current main space -which is 0x10000-0x17fff, 0x10000-0x17fff in ROM at the time of writing -or for the later writes 0x10000-0x17fff, 0x20000-0x27fff (the b448 is from 0x23448 for example) - -each of the blocks pointed to is preceded by a 0x00 byte? (maybe 0x00 is a terminator for previous block?) - -the blocks being pointed at during startup are debug text, c style strings for 'printf' functions, complete with -formatting characters while the ff81 to ff84 area contains the parameters. - -it seems likely this is just a RAM area and these are temporary storage for the debug print function, -either for futher processing and output to an actual debug console, or shared with another device (ff80, which is -possibly the start of this RAM area, is written after putting these pointers in RAM) - -*/ - -uint8_t leapfrog_iquest_state::unk_ff91_93_r(offs_t offset) -{ - logerror("%s: unk_ff91_93_r %d\n", machine().describe_context(), offset); - return 0x00;// m_ff91_93[offset]; -} - -void leapfrog_iquest_state::unk_ff91_93_w(offs_t offset, uint8_t data) -{ - // these 3 values are written together - m_ff91_93[offset] = data; - - // form is ff then 2 other values, these are pointers into the main space it seems - - if (offset == 2) - { - logerror("%s: write to ff91 to ff93 region %02x %02x %02x (current banks are %08x %08x %08x)\n", machine().describe_context(), m_ff91_93[0], m_ff91_93[1], m_ff91_93[2], ((m_lowerbank[0] << 8) | (m_lowerbank[1])) * 0x8000, ((m_upperbank[0] << 8) | (m_upperbank[1])) * 0x8000, ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000); - - uint16_t pointer = (m_ff91_93[1] << 8) | (m_ff91_93[2]); - - address_space& spc = m_maincpu->space(AS_PROGRAM); - char readdat = 0x00; - - std::string textout; - do - { - readdat = spc.read_byte(pointer++); - textout.append(1, readdat); - } while (readdat != 0x00); - logerror("%s: DEBUG MESSAGE: %s", machine().describe_context(), textout); - logerror("\n"); - } -} - -void leapfrog_iquest_state::unk_ff81_84_w(offs_t offset, uint8_t data) -{ - // these 4 values are written together, with FFA8 before and FFA9 after - // form is usually 00 00 then 2 used values, maybe coordinates? - // used in conjunction with unk_ff91_93_w writes above - m_ff81_84[offset] = data; - - if (offset == 3) - { - logerror("%s: write to ff81 to ff84 region %02x %02x %02x %02x\n", machine().describe_context(), m_ff81_84[0], m_ff81_84[1], m_ff81_84[2], m_ff81_84[3]); - - uint16_t pointer = (m_ff81_84[2] << 8) | (m_ff81_84[3]); - - if (pointer != 0x00) - { - address_space& spc = m_maincpu->space(AS_PROGRAM); - char readdat = 0x00; - - std::string textout; - do - { - readdat = spc.read_byte(pointer++); - textout.append(1, readdat); - } while (readdat != 0x00); - - //logerror("%s: %s", machine().describe_context(), textout); - //logerror("\n"); - } - } -} - -uint8_t leapfrog_iquest_state::unk_ffa8_r() -{ - logerror("%s: read from ffa8 ----------- POSSIBLE END OF DEBUG TEXT OPERATION?\n", machine().describe_context()); - return 0x00; -} - -void leapfrog_iquest_state::unk_ffa8_w(uint8_t data) -{ - logerror("%s: write to ffa8 %02x ----------- POSSIBLE START OF DEBUG TEXT OPERATION?\n", machine().describe_context(), data); - m_ffa8 = data; -} - -void leapfrog_iquest_state::unk_ffa9_w(uint8_t data) -{ - logerror("%s: write to ffa9 %02x ----------- POSSIBLE TRIGGER DEBUG TEXT OPERATION?? (current banks are %08x %08x %08x)\n", machine().describe_context(), data, ((m_lowerbank[0] << 8) | (m_lowerbank[1])) * 0x8000, ((m_upperbank[0] << 8) | (m_upperbank[1])) * 0x8000, ((m_iobank[0] << 8) | (m_iobank[1])) * 0x8000); -} - - - - -void leapfrog_iquest_state::ext_map(address_map &map) -{ - map(0x0000, 0x7fff).rw(FUNC(leapfrog_iquest_state::iowindow_r), FUNC(leapfrog_iquest_state::iowindow_w)); // assume this accesses the same space, with different bank register - - map(0xc260, 0xc52f).ram(); // = clears 0x2d0 bytes (90*64 / 8) display buffer? - map(0xc530, 0xc7ff).ram(); // = clears 0x2d0 bytes (90*64 / 8) display buffer? - - //map(0xf001, 0xf056).ram(); // written as a block - map(0xf000, 0xf5ff).ram(); // ? 0xf400 - 0xf427 written as a block, other areas uncertain, might be more registers in here as there are reads too - - map(0xfc00, 0xfc00).r(FUNC(leapfrog_iquest_state::unk_fc00_r)); - map(0xfc01, 0xfc04).r(FUNC(leapfrog_iquest_state::unk_fc01_r)); - - map(0xfc06, 0xfc07).rw(FUNC(leapfrog_iquest_state::lowerbank_r), FUNC(leapfrog_iquest_state::lowerbank_w)); // ROM / RAM window in main space at 0000-7fff - map(0xfc08, 0xfc09).rw(FUNC(leapfrog_iquest_state::upperbank_r), FUNC(leapfrog_iquest_state::upperbank_w)); // ROM / RAM window in main space at 8000-ffff - map(0xfc0a, 0xfc0b).rw(FUNC(leapfrog_iquest_state::iobank_r), FUNC(leapfrog_iquest_state::iobank_w)); // ROM / RAM window in ext space at 0000-7fff - - map(0xfc22, 0xfc22).w(FUNC(leapfrog_iquest_state::unk_fc22_w)); - - map(0xfc2f, 0xfc2f).r(FUNC(leapfrog_iquest_state::unk_fc2f_r)); - map(0xfc3f, 0xfc3f).rw(FUNC(leapfrog_iquest_state::unk_fc3f_r), FUNC(leapfrog_iquest_state::unk_fc3f_w)); - - map(0xfce5, 0xfce5).rw(FUNC(leapfrog_iquest_state::unk_fce5_r), FUNC(leapfrog_iquest_state::unk_fce5_w)); - - map(0xff00, 0xff01).r(FUNC(leapfrog_iquest_state::unk_ff00_01_r)); - - // it seems more likely that this is just RAM, as that after setting pointers in RAM, they're used to construct - // strings to transmit over the serial. - // however, mapping this area as RAM instead results in the program stalling much earlier, waiting for $24.3 to - // be cleared. - // 017658: 20 23 fd jb $24.3,$17658 - // - //The only realistic place for this to be cleared is deep in the interrupt handler for - // Serial Receive/Transmit - // 010023: 02 76 9e ljmp $769E - // (which eventually can reach) - // 016991: c2 23 clr $24.3 - // however I'm uncertain how to get the driver to trigger this at all. - if (0) - { - map(0xff80, 0xffff).ram(); - } - else - { - map(0xff80, 0xff80).rw(FUNC(leapfrog_iquest_state::unk_ff80_r), FUNC(leapfrog_iquest_state::unk_ff80_w)); - - map(0xff81, 0xff84).w(FUNC(leapfrog_iquest_state::unk_ff81_84_w)); - - map(0xff91, 0xff93).rw(FUNC(leapfrog_iquest_state::unk_ff91_93_r), FUNC(leapfrog_iquest_state::unk_ff91_93_w)); - - map(0xffa8, 0xffa8).rw(FUNC(leapfrog_iquest_state::unk_ffa8_r), FUNC(leapfrog_iquest_state::unk_ffa8_w)); - map(0xffa9, 0xffa9).w(FUNC(leapfrog_iquest_state::unk_ffa9_w)); - } -} - -DEVICE_IMAGE_LOAD_MEMBER(leapfrog_iquest_state::cart_load) -{ - uint32_t size = m_cart->common_get_size("rom"); - - m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); - - return std::error_condition(); -} - -static INPUT_PORTS_START( leapfrog_iquest ) -INPUT_PORTS_END - -uint32_t leapfrog_iquest_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - return 0; -} - -// never triggered? -void leapfrog_iquest_state::tx(uint8_t data) -{ - logerror("%s: transmitting %02x\n", machine().describe_context().c_str(), data); -} - -// never triggered? -uint8_t leapfrog_iquest_state::rx() -{ - logerror("%s: receiving\n", machine().describe_context().c_str()); - return machine().rand(); -} - - -// doesn't help? -WRITE_LINE_MEMBER(leapfrog_iquest_state::rx_line_hack) -{ - /* - m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE); - m_maincpu->set_input_line(MCS51_RX_LINE, CLEAR_LINE); - */ - - if (0) - { - // HACK: force past the wait loop if we're treating ff80 - ffff as RAM - address_space& spc = m_maincpu->space(AS_DATA); - uint8_t readdat = spc.read_byte(0x24); - readdat &= ~0x08; - spc.write_byte(0x24, readdat); - } -} - -uint8_t leapfrog_iquest_state::port0_r() -{ - logerror("%s: port0_r\n", machine().describe_context()); - return 0x00; -} - -uint8_t leapfrog_iquest_state::port1_r() -{ - logerror("%s: port1_r\n", machine().describe_context()); - return 0x00; -} - -uint8_t leapfrog_iquest_state::port2_r() -{ - logerror("%s: port2_r\n", machine().describe_context()); - return 0x00; -} - -uint8_t leapfrog_iquest_state::port3_r() -{ - logerror("%s: port3_r\n", machine().describe_context()); - return 0x00; -} - -void leapfrog_iquest_state::port0_w(u8 data) -{ - logerror("%s: port0_w %02x\n", machine().describe_context(), data); -} - -void leapfrog_iquest_state::port1_w(u8 data) -{ - logerror("%s: port1_w %02x\n", machine().describe_context(), data); -} - -void leapfrog_iquest_state::port2_w(u8 data) -{ - logerror("%s: port2_w %02x\n", machine().describe_context(), data); -} - -void leapfrog_iquest_state::port3_w(u8 data) -{ - logerror("%s: port3_w %02x\n", machine().describe_context(), data); -} - - - -void leapfrog_iquest_state::leapfrog_base(machine_config &config) -{ - // seems to have an IRQ vector at 002b, which would suggest it's an 8052 or similar, rather than plain 8031? - //I8052(config, m_maincpu, 96000000/10); // unknown clock - I8032(config, m_maincpu, 96000000/10); // unknown clock - m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_iquest_state::prog_map); - m_maincpu->set_addrmap(AS_IO, &leapfrog_iquest_state::ext_map); - m_maincpu->serial_tx_cb().set(FUNC(leapfrog_iquest_state::tx)); - m_maincpu->serial_rx_cb().set(FUNC(leapfrog_iquest_state::rx)); - m_maincpu->port_in_cb<0>().set(FUNC(leapfrog_iquest_state::port0_r)); - m_maincpu->port_out_cb<0>().set(FUNC(leapfrog_iquest_state::port0_w)); - m_maincpu->port_in_cb<1>().set(FUNC(leapfrog_iquest_state::port1_r)); - m_maincpu->port_out_cb<1>().set(FUNC(leapfrog_iquest_state::port1_w)); - m_maincpu->port_in_cb<2>().set(FUNC(leapfrog_iquest_state::port2_r)); - m_maincpu->port_out_cb<2>().set(FUNC(leapfrog_iquest_state::port2_w)); - m_maincpu->port_in_cb<3>().set(FUNC(leapfrog_iquest_state::port3_r)); - m_maincpu->port_out_cb<3>().set(FUNC(leapfrog_iquest_state::port3_w)); - - ADDRESS_MAP_BANK(config, "rombank").set_map(&leapfrog_iquest_state::rom_map).set_options(ENDIANNESS_LITTLE, 8, 31, 0x80000000); -} - -void leapfrog_iquest_state::leapfrog_iquest(machine_config &config) -{ - leapfrog_iquest_state::leapfrog_base(config); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); - m_screen->set_size(90, 64); - m_screen->set_visarea(0, 90-1, 0, 64-1); - m_screen->set_screen_update(FUNC(leapfrog_iquest_state::screen_update)); - m_screen->screen_vblank().set(FUNC(leapfrog_iquest_state::rx_line_hack)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_iquest_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_iquest_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_iquest_cart"); -} - -void leapfrog_turboextreme_state::leapfrog_turboex(machine_config &config) -{ - leapfrog_iquest_state::leapfrog_base(config); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); - m_screen->set_size(64, 32); // unknown resolution, lower than iquest - m_screen->set_visarea(0, 64-1, 0, 32-1); - m_screen->set_screen_update(FUNC(leapfrog_turboextreme_state::screen_update)); - m_screen->screen_vblank().set(FUNC(leapfrog_turboextreme_state::rx_line_hack)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turboextreme_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_turboextreme_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("turboextreme_cart"); -} - -void leapfrog_turbotwistmath_state::leapfrog_turbotwistmath(machine_config &config) -{ - leapfrog_iquest_state::leapfrog_base(config); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); - m_screen->set_size(64, 8); // unknown resolution, single row display - m_screen->set_visarea(0, 64-1, 0, 8-1); - m_screen->set_screen_update(FUNC(leapfrog_turbotwistmath_state::screen_update)); - m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistmath_state::rx_line_hack)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistmath_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_turbotwistmath_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("ttwist_math_cart"); -} - -void leapfrog_turbotwistspelling_state::leapfrog_turbotwistspelling(machine_config &config) -{ - leapfrog_iquest_state::leapfrog_base(config); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); - m_screen->set_size(64, 8); // unknown resolution, single row display - m_screen->set_visarea(0, 64-1, 0, 8-1); - m_screen->set_screen_update(FUNC(leapfrog_turbotwistspelling_state::screen_update)); - m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistspelling_state::rx_line_hack)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistspelling_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_turbotwistspelling_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("ttwist_spelling_cart"); -} - -void leapfrog_turbotwistvocabulator_state::leapfrog_turbotwistvocabulator(machine_config &config) -{ - leapfrog_iquest_state::leapfrog_base(config); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); - m_screen->set_size(64, 8); // unknown resolution, single row display - m_screen->set_visarea(0, 64-1, 0, 8-1); - m_screen->set_screen_update(FUNC(leapfrog_turbotwistvocabulator_state::screen_update)); - m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistvocabulator_state::rx_line_hack)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistvocabulator_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_turbotwistvocabulator_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("ttwist_vocabulator_cart"); -} - - -void leapfrog_turbotwistbrainquest_state::leapfrog_turbotwistbrainquest(machine_config &config) -{ - leapfrog_iquest_state::leapfrog_base(config); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(10)); - m_screen->set_size(64, 8); // unknown resolution, single row display - m_screen->set_visarea(0, 64-1, 0, 8-1); - m_screen->set_screen_update(FUNC(leapfrog_turbotwistbrainquest_state::screen_update)); - m_screen->screen_vblank().set(FUNC(leapfrog_turbotwistbrainquest_state::rx_line_hack)); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_turbotwistbrainquest_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_turbotwistbrainquest_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("ttwist_brainquest_cart"); -} - -ROM_START( iquest ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "iquest.bin", 0x000000, 0x400000, CRC(f785dc4e) SHA1(ec002c18df536737334fe6b7db0e7342bad7b66b)) - - // there is also a 39vf512 flash containing user data -ROM_END - -ROM_START( turboex ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "turbotwistextreme.bin", 0x000000, 0x400000, CRC(d7cabcff) SHA1(7813811c0518aba017f7a79fd477be5ed9fa7529)) -ROM_END - -ROM_START( ttwistm ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "turbotwistmath.bin", 0x000000, 0x200000, CRC(a21d3723) SHA1(d0ae245621d7bc92bdf9fd683908690db6e25133)) -ROM_END - -ROM_START( ttwistsp ) // PCB marks ROM glob as 8M - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "ttspelling.bin", 0x000000, 0x100000, CRC(09715a8e) SHA1(5d7eb7b714b95012aeb03c37dd0b71a1c025bdda)) -ROM_END - -ROM_START( ttwistvc ) // PCB marks ROM glob as 8M - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "vocabulator.bin", 0x000000, 0x100000, CRC(71f9c4c9) SHA1(8cafb42bd56c7db99949781e42b6ad4991ee2246)) -ROM_END - -ROM_START( ttwistbq ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "turbotwistbrainquest.bin", 0x000000, 0x200000, CRC(b184a517) SHA1(181975da58b3d117a389c54ac025b6a9b24342b2)) -ROM_END - -ROM_START( ttwistfb ) // PCB marks ROM glob as 16M - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "factblaster.bin", 0x000000, 0x200000, CRC(8efd63f5) SHA1(2cbd1299006ad9743d846e774afe7a134ba0fce3)) -ROM_END - -} // anonymous namespace - - -// year, name, parent, compat, machine, input, class, init, company, fullname, flags -// it is unknown if the versions of IQuest without 4.0 on the case have different system ROM -CONS( 2004, iquest, 0, 0, leapfrog_iquest, leapfrog_iquest, leapfrog_iquest_state, empty_init, "LeapFrog", "IQuest 4.0 (US)", MACHINE_IS_SKELETON ) - -CONS( 2004, turboex, 0, 0, leapfrog_turboex, leapfrog_iquest, leapfrog_turboextreme_state, empty_init, "LeapFrog", "Turbo Extreme (US)", MACHINE_IS_SKELETON ) - -// from a silver unit with orange lettering (there are different case styles, it is unknown if the software changed) -CONS( 2002, ttwistm, 0, 0, leapfrog_turbotwistmath, leapfrog_iquest, leapfrog_turbotwistmath_state, empty_init, "LeapFrog", "Turbo Twist Math (US)", MACHINE_IS_SKELETON ) - -// Brain Quest / Fact Blaster are compatible with the same cartridges -CONS( 200?, ttwistfb, 0, 0, leapfrog_turbotwistbrainquest, leapfrog_iquest, leapfrog_turbotwistbrainquest_state, empty_init, "LeapFrog", "Turbo Twist Fact Blaster (US)", MACHINE_IS_SKELETON ) -CONS( 2002, ttwistbq, 0, 0, leapfrog_turbotwistbrainquest, leapfrog_iquest, leapfrog_turbotwistbrainquest_state, empty_init, "LeapFrog", "Turbo Twist Brain Quest (US)", MACHINE_IS_SKELETON ) - -// from a green unit with blue edges -CONS( 2000, ttwistsp, 0, 0, leapfrog_turbotwistspelling, leapfrog_iquest, leapfrog_turbotwistspelling_state, empty_init, "LeapFrog", "Turbo Twist Spelling (US)", MACHINE_IS_SKELETON ) - -CONS( 2001, ttwistvc, 0, 0, leapfrog_turbotwistvocabulator, leapfrog_iquest, leapfrog_turbotwistvocabulator_state, empty_init, "LeapFrog", "Turbo Twist Vocabulator (US)", MACHINE_IS_SKELETON ) - -// Undumped units - -// These have 2 digit 7-seg style displays, it is unknown if they are on related hardware -// Twist & Shout Addition -// Twist & Shout Subtraction -// Twist & Shout Multiplication -// Twist & Shout Division - -// This appears to have a 4 digit 7-seg style display, unknown if it is on related hardware -// Twist & Shout Phonics diff --git a/src/mame/leapfrog/leapfrog_leappad.cpp b/src/mame/leapfrog/leapfrog_leappad.cpp deleted file mode 100644 index 15ab6dd43c4..00000000000 --- a/src/mame/leapfrog/leapfrog_leappad.cpp +++ /dev/null @@ -1,233 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/****************************************************************************** - - LEAPPAD: - Example-Video: https://www.youtube.com/watch?v=LtUhENu5TKc - The LEAPPAD is basically compareable to the SEGA PICO, but without - Screen-Output! Each "Game" consists of two parts (Book + Cartridge). - Insert the cartridge into the system and add the Book on the Top of the - "console" and you can click on each pages and hear sounds or - learning-stuff on each page... - - MY FIRST LEAPPAD: - Basically the same as the LEAPPAD, but for even younger kids! (Cartridge - internal PCB's are identical to LEAPPAD). - Example Video: https://www.youtube.com/watch?v=gsf8XYV1Tpg - - LITTLE TOUCH LEAPPAD: - Same as the other LEAPPAD models, but aimed at babies. - - Don't get confused by the name "LEAPPAD", as it looks like Leapfrog - also released some kind of Tablet with this name, and they even released - a new "LEAPPAD" in around 2016: - https://www.youtube.com/watch?v=MXFSgj6xLTU , which nearly looks like the - same, but is most likely techically completely different... - - The cartridges pinout is the same on the three systems: - A1 N/C (A21?) - A2 A20 - A3 A19 - A4 A8 - A5 A9 - A6 A6 - A7 A5 - A8 A4 - A9 A3 - A10 A2 - A11 A1 - A12 A0 - A13 N/C (R/W? /CE2?) - A14 /CE - A15 /OE - A16 D0 - A17 D1 - A18 D2 - A19 D3 - A20 VCC - B1 N/C (A22?) - B2 N/C (A23?) - B3 A18 - B4 A17 - B5 A7 - B6 GND - B7 A10 - B8 A11 - B9 A12 - B10 A13 - B11 A14 - B12 A15 - B13 A16 - B14 GND - B15 A-1 - B16 D7 - B17 D6 - B18 D5 - B19 D4 - B20 GND - -*******************************************************************************/ - -#include "emu.h" - -#include "cpu/mcs51/mcs51.h" - -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" - -#include "screen.h" -#include "softlist_dev.h" -#include "speaker.h" - - -namespace { - -class leapfrog_leappad_state : public driver_device -{ -public: - leapfrog_leappad_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_cart(*this, "cartslot") - , m_cart_region(nullptr) - { } - - void leapfrog_leappad(machine_config &config); - void leapfrog_mfleappad(machine_config &config); - void leapfrog_ltleappad(machine_config &config); - -private: - virtual void machine_start() override; - virtual void machine_reset() override; - - void prog_map(address_map &map); - void ext_map(address_map &map); - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); - - required_device m_maincpu; - required_device m_cart; - memory_region *m_cart_region; -}; - - - -void leapfrog_leappad_state::machine_start() -{ - // if there's a cart, override the standard mapping - if (m_cart && m_cart->exists()) - { - m_cart_region = memregion(std::string(m_cart->tag()) + GENERIC_ROM_REGION_TAG); - } -} - -void leapfrog_leappad_state::machine_reset() -{ -} - -void leapfrog_leappad_state::prog_map(address_map &map) -{ - map(0x0000, 0xffff).rom().region("maincpu", 0x10000); // TODO: banking -} - -void leapfrog_leappad_state::ext_map(address_map &map) -{ -} - -DEVICE_IMAGE_LOAD_MEMBER(leapfrog_leappad_state::cart_load) -{ - uint32_t size = m_cart->common_get_size("rom"); - - m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); - - return std::error_condition(); -} - -static INPUT_PORTS_START( leapfrog_leappad ) -INPUT_PORTS_END - - - -void leapfrog_leappad_state::leapfrog_leappad(machine_config &config) -{ - I8032(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (which exact type is it?) - m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map); - m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map); - - // screenless - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_leappad_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_leappad_cart"); -} - -void leapfrog_leappad_state::leapfrog_mfleappad(machine_config &config) -{ - I8032(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (which exact type is it?) - m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map); - m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map); - - // screenless - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_mfleappad_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_mfleappad_cart"); -} - -void leapfrog_leappad_state::leapfrog_ltleappad(machine_config &config) -{ - I8032(config, m_maincpu, 96000000/10); // (which exact type is it?) - m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map); - m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map); - - // screenless - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_ltleappad_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_ltleappad_cart"); -} - - -// All of these contain the string "Have you copied our ROM?" near the date codes - -ROM_START( leappad ) - ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF ) - ROM_DEFAULT_BIOS("ila2_universal") - ROM_SYSTEM_BIOS( 0, "ila2_universal", "Universal" ) - ROMX_LOAD( "leappadbios.bin", 0x000000, 0x100000, CRC(c886cddc) SHA1(f8a83b156feb28315d2321758678e141600a0d4e), ROM_BIOS(0) ) // contains "Aug 06 2001.16:33:16.155-00450.LeapPad ILA2 Universal Base ROM" and "Copyright (c) 1998-2001 Knowledge Kids Enterprises, Inc." - ROM_SYSTEM_BIOS( 1, "2mb_canada_full", "Canada" ) - ROMX_LOAD( "leappadbioscanada.bin", 0x000000, 0x200000, CRC(cc12e3db) SHA1(adf52232adcfd4de5d8e31c0e0c09be61718a9d4), ROM_BIOS(1) ) // contains "Jan 23 2004 11:28:40 152-10620 2MB Canada Full Base ROM" and "Copyright (c) 2000-2004 LeapFrog Enterprises, Inc." -ROM_END - -ROM_START( mfleappad ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_DEFAULT_BIOS("internat_v1.3") - ROM_SYSTEM_BIOS( 0, "internat_v1.3", "International V1.3" ) - ROMX_LOAD( "myfirstleappadinternational.bin", 0x000000, 0x100000, CRC(4dc0c4d5) SHA1(573ecf2efaccf70e619cf54d63be9169e469ee6f), ROM_BIOS(0) ) // contains "May 07 2002 10:53:14 152-00932 MFLP International base ROM V1.3" and "Copyright (c) 2002 LeapFrog Enterprises, Inc." - ROM_SYSTEM_BIOS( 1, "us_2004", "US" ) - ROMX_LOAD( "myfirstleappadbios.bin", 0x000000, 0x400000, CRC(19174c16) SHA1(e0ba644fdf38fd5f91ab8c4b673c4a658cc3e612), ROM_BIOS(1) ) // contains "Feb 13 2004.10:58:53.152-10573.MFLP US Base ROM - 2004" and "Copyright (c) 2004 LeapFrog Enterprises, Inc." -ROM_END - -ROM_START( ltleappad ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) - ROM_DEFAULT_BIOS("mar_10_2005") - ROM_SYSTEM_BIOS( 0, "mar_10_2005", "Mar 10 2005" ) - ROMX_LOAD( "littletouchleappadbios.bin", 0x000000, 0x400000, CRC(13687b26) SHA1(6ec1a47aaef9c9ed134bb143c2631f4d89d7c236), ROM_BIOS(0) ) // contains "Mar 10 2005 07:01:53 152-11244" and "Copyright (c) 2002-2005 LeapFrog Enterprises, Inc." - ROM_SYSTEM_BIOS( 1, "germany", "Germany, Jan 11 2005" ) - ROMX_LOAD( "leappad_little_touch_german.bin", 0x000000, 0x400000, CRC(39ee76a2) SHA1(34f1b6e075e10e14380d925944f4c84d068ec58e), ROM_BIOS(1) ) // contains "Jan 11 2005 10:45:42 152-11010 Full Base ROM: V1.0 - Germany" -ROM_END - -} // anonymous namespace - - -// year, name, parent, compat, machine, input, class, init, company, fullname, flags -CONS( 2001, leappad, 0, 0, leapfrog_leappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "LeapPad", MACHINE_IS_SKELETON ) -CONS( 2002, mfleappad, 0, 0, leapfrog_mfleappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "My First LeapPad", MACHINE_IS_SKELETON ) -CONS( 2005, ltleappad, 0, 0, leapfrog_ltleappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "Little Touch LeapPad", MACHINE_IS_SKELETON ) diff --git a/src/mame/leapfrog/leapfrog_leapster_explorer.cpp b/src/mame/leapfrog/leapfrog_leapster_explorer.cpp deleted file mode 100644 index 160e4da5e44..00000000000 --- a/src/mame/leapfrog/leapfrog_leapster_explorer.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/****************************************************************************** - - LeapFrog Leapster Explorer - - - runs Linux - - unknown ARM9 based SoC - - Internal ROM not currently dumped, this file exists to reference the - Software List - -*******************************************************************************/ - -#include "emu.h" - -#include "cpu/arm7/arm7.h" -#include "cpu/arm7/arm7core.h" - -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" - -#include "screen.h" -#include "softlist_dev.h" -#include "speaker.h" - - -namespace { - -class leapfrog_leapster_explorer_state : public driver_device -{ -public: - leapfrog_leapster_explorer_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_screen(*this, "screen") - , m_cart(*this, "cartslot") - , m_cart_region(nullptr) - { } - - void leapfrog_leapster_explorer(machine_config &config); - -private: - virtual void machine_start() override; - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); - - required_device m_maincpu; - - required_device m_screen; - required_device m_cart; - memory_region *m_cart_region; - - uint32_t screen_update_innotab(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); -}; - -uint32_t leapfrog_leapster_explorer_state::screen_update_innotab(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - return 0; -} - -void leapfrog_leapster_explorer_state::machine_start() -{ - // if there's a cart, override the standard mapping - if (m_cart && m_cart->exists()) - { - m_cart_region = memregion(std::string(m_cart->tag()) + GENERIC_ROM_REGION_TAG); - } -} - -DEVICE_IMAGE_LOAD_MEMBER(leapfrog_leapster_explorer_state::cart_load) -{ - uint32_t size = m_cart->common_get_size("rom"); - - m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); - m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); - - return std::error_condition(); -} - -static INPUT_PORTS_START( leapfrog_leapster_explorer ) -INPUT_PORTS_END - - -void leapfrog_leapster_explorer_state::leapfrog_leapster_explorer(machine_config& config) -{ - ARM9(config, m_maincpu, 393000000); // unknown ARM9 type - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_size(320, 262); - m_screen->set_visarea(0, 320 - 1, 0, 240 - 1); - m_screen->set_screen_update(FUNC(leapfrog_leapster_explorer_state::screen_update_innotab)); - - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_leapster_explorer_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(leapfrog_leapster_explorer_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("leapster_explorer_cart"); -} - -ROM_START( leapexpr ) - ROM_REGION( 0x0100000, "maincpu", ROMREGION_ERASEFF ) - // unknown internal ROM - ROM_LOAD( "internal.rom", 0x000000, 0x0100000, NO_DUMP ) -ROM_END - -} // anonymous namespace - - -CONS( 2010, leapexpr, 0, 0, leapfrog_leapster_explorer, leapfrog_leapster_explorer, leapfrog_leapster_explorer_state, empty_init, "LeapFrog", "Leapster Explorer", MACHINE_IS_SKELETON ) diff --git a/src/mame/leapfrog/leappad.cpp b/src/mame/leapfrog/leappad.cpp new file mode 100644 index 00000000000..15ab6dd43c4 --- /dev/null +++ b/src/mame/leapfrog/leappad.cpp @@ -0,0 +1,233 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/****************************************************************************** + + LEAPPAD: + Example-Video: https://www.youtube.com/watch?v=LtUhENu5TKc + The LEAPPAD is basically compareable to the SEGA PICO, but without + Screen-Output! Each "Game" consists of two parts (Book + Cartridge). + Insert the cartridge into the system and add the Book on the Top of the + "console" and you can click on each pages and hear sounds or + learning-stuff on each page... + + MY FIRST LEAPPAD: + Basically the same as the LEAPPAD, but for even younger kids! (Cartridge + internal PCB's are identical to LEAPPAD). + Example Video: https://www.youtube.com/watch?v=gsf8XYV1Tpg + + LITTLE TOUCH LEAPPAD: + Same as the other LEAPPAD models, but aimed at babies. + + Don't get confused by the name "LEAPPAD", as it looks like Leapfrog + also released some kind of Tablet with this name, and they even released + a new "LEAPPAD" in around 2016: + https://www.youtube.com/watch?v=MXFSgj6xLTU , which nearly looks like the + same, but is most likely techically completely different... + + The cartridges pinout is the same on the three systems: + A1 N/C (A21?) + A2 A20 + A3 A19 + A4 A8 + A5 A9 + A6 A6 + A7 A5 + A8 A4 + A9 A3 + A10 A2 + A11 A1 + A12 A0 + A13 N/C (R/W? /CE2?) + A14 /CE + A15 /OE + A16 D0 + A17 D1 + A18 D2 + A19 D3 + A20 VCC + B1 N/C (A22?) + B2 N/C (A23?) + B3 A18 + B4 A17 + B5 A7 + B6 GND + B7 A10 + B8 A11 + B9 A12 + B10 A13 + B11 A14 + B12 A15 + B13 A16 + B14 GND + B15 A-1 + B16 D7 + B17 D6 + B18 D5 + B19 D4 + B20 GND + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/mcs51/mcs51.h" + +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +#include "screen.h" +#include "softlist_dev.h" +#include "speaker.h" + + +namespace { + +class leapfrog_leappad_state : public driver_device +{ +public: + leapfrog_leappad_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_cart(*this, "cartslot") + , m_cart_region(nullptr) + { } + + void leapfrog_leappad(machine_config &config); + void leapfrog_mfleappad(machine_config &config); + void leapfrog_ltleappad(machine_config &config); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + void prog_map(address_map &map); + void ext_map(address_map &map); + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + + required_device m_maincpu; + required_device m_cart; + memory_region *m_cart_region; +}; + + + +void leapfrog_leappad_state::machine_start() +{ + // if there's a cart, override the standard mapping + if (m_cart && m_cart->exists()) + { + m_cart_region = memregion(std::string(m_cart->tag()) + GENERIC_ROM_REGION_TAG); + } +} + +void leapfrog_leappad_state::machine_reset() +{ +} + +void leapfrog_leappad_state::prog_map(address_map &map) +{ + map(0x0000, 0xffff).rom().region("maincpu", 0x10000); // TODO: banking +} + +void leapfrog_leappad_state::ext_map(address_map &map) +{ +} + +DEVICE_IMAGE_LOAD_MEMBER(leapfrog_leappad_state::cart_load) +{ + uint32_t size = m_cart->common_get_size("rom"); + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return std::error_condition(); +} + +static INPUT_PORTS_START( leapfrog_leappad ) +INPUT_PORTS_END + + + +void leapfrog_leappad_state::leapfrog_leappad(machine_config &config) +{ + I8032(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (which exact type is it?) + m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map); + m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map); + + // screenless + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_leappad_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_leappad_cart"); +} + +void leapfrog_leappad_state::leapfrog_mfleappad(machine_config &config) +{ + I8032(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (which exact type is it?) + m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map); + m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map); + + // screenless + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_mfleappad_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_mfleappad_cart"); +} + +void leapfrog_leappad_state::leapfrog_ltleappad(machine_config &config) +{ + I8032(config, m_maincpu, 96000000/10); // (which exact type is it?) + m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map); + m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map); + + // screenless + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_ltleappad_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_ltleappad_cart"); +} + + +// All of these contain the string "Have you copied our ROM?" near the date codes + +ROM_START( leappad ) + ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS("ila2_universal") + ROM_SYSTEM_BIOS( 0, "ila2_universal", "Universal" ) + ROMX_LOAD( "leappadbios.bin", 0x000000, 0x100000, CRC(c886cddc) SHA1(f8a83b156feb28315d2321758678e141600a0d4e), ROM_BIOS(0) ) // contains "Aug 06 2001.16:33:16.155-00450.LeapPad ILA2 Universal Base ROM" and "Copyright (c) 1998-2001 Knowledge Kids Enterprises, Inc." + ROM_SYSTEM_BIOS( 1, "2mb_canada_full", "Canada" ) + ROMX_LOAD( "leappadbioscanada.bin", 0x000000, 0x200000, CRC(cc12e3db) SHA1(adf52232adcfd4de5d8e31c0e0c09be61718a9d4), ROM_BIOS(1) ) // contains "Jan 23 2004 11:28:40 152-10620 2MB Canada Full Base ROM" and "Copyright (c) 2000-2004 LeapFrog Enterprises, Inc." +ROM_END + +ROM_START( mfleappad ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS("internat_v1.3") + ROM_SYSTEM_BIOS( 0, "internat_v1.3", "International V1.3" ) + ROMX_LOAD( "myfirstleappadinternational.bin", 0x000000, 0x100000, CRC(4dc0c4d5) SHA1(573ecf2efaccf70e619cf54d63be9169e469ee6f), ROM_BIOS(0) ) // contains "May 07 2002 10:53:14 152-00932 MFLP International base ROM V1.3" and "Copyright (c) 2002 LeapFrog Enterprises, Inc." + ROM_SYSTEM_BIOS( 1, "us_2004", "US" ) + ROMX_LOAD( "myfirstleappadbios.bin", 0x000000, 0x400000, CRC(19174c16) SHA1(e0ba644fdf38fd5f91ab8c4b673c4a658cc3e612), ROM_BIOS(1) ) // contains "Feb 13 2004.10:58:53.152-10573.MFLP US Base ROM - 2004" and "Copyright (c) 2004 LeapFrog Enterprises, Inc." +ROM_END + +ROM_START( ltleappad ) + ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS("mar_10_2005") + ROM_SYSTEM_BIOS( 0, "mar_10_2005", "Mar 10 2005" ) + ROMX_LOAD( "littletouchleappadbios.bin", 0x000000, 0x400000, CRC(13687b26) SHA1(6ec1a47aaef9c9ed134bb143c2631f4d89d7c236), ROM_BIOS(0) ) // contains "Mar 10 2005 07:01:53 152-11244" and "Copyright (c) 2002-2005 LeapFrog Enterprises, Inc." + ROM_SYSTEM_BIOS( 1, "germany", "Germany, Jan 11 2005" ) + ROMX_LOAD( "leappad_little_touch_german.bin", 0x000000, 0x400000, CRC(39ee76a2) SHA1(34f1b6e075e10e14380d925944f4c84d068ec58e), ROM_BIOS(1) ) // contains "Jan 11 2005 10:45:42 152-11010 Full Base ROM: V1.0 - Germany" +ROM_END + +} // anonymous namespace + + +// year, name, parent, compat, machine, input, class, init, company, fullname, flags +CONS( 2001, leappad, 0, 0, leapfrog_leappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "LeapPad", MACHINE_IS_SKELETON ) +CONS( 2002, mfleappad, 0, 0, leapfrog_mfleappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "My First LeapPad", MACHINE_IS_SKELETON ) +CONS( 2005, ltleappad, 0, 0, leapfrog_ltleappad, leapfrog_leappad, leapfrog_leappad_state, empty_init, "LeapFrog", "Little Touch LeapPad", MACHINE_IS_SKELETON ) diff --git a/src/mame/leapfrog/leapster_explorer.cpp b/src/mame/leapfrog/leapster_explorer.cpp new file mode 100644 index 00000000000..160e4da5e44 --- /dev/null +++ b/src/mame/leapfrog/leapster_explorer.cpp @@ -0,0 +1,114 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/****************************************************************************** + + LeapFrog Leapster Explorer + + - runs Linux + - unknown ARM9 based SoC + + Internal ROM not currently dumped, this file exists to reference the + Software List + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/arm7/arm7.h" +#include "cpu/arm7/arm7core.h" + +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +#include "screen.h" +#include "softlist_dev.h" +#include "speaker.h" + + +namespace { + +class leapfrog_leapster_explorer_state : public driver_device +{ +public: + leapfrog_leapster_explorer_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_screen(*this, "screen") + , m_cart(*this, "cartslot") + , m_cart_region(nullptr) + { } + + void leapfrog_leapster_explorer(machine_config &config); + +private: + virtual void machine_start() override; + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + + required_device m_maincpu; + + required_device m_screen; + required_device m_cart; + memory_region *m_cart_region; + + uint32_t screen_update_innotab(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); +}; + +uint32_t leapfrog_leapster_explorer_state::screen_update_innotab(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void leapfrog_leapster_explorer_state::machine_start() +{ + // if there's a cart, override the standard mapping + if (m_cart && m_cart->exists()) + { + m_cart_region = memregion(std::string(m_cart->tag()) + GENERIC_ROM_REGION_TAG); + } +} + +DEVICE_IMAGE_LOAD_MEMBER(leapfrog_leapster_explorer_state::cart_load) +{ + uint32_t size = m_cart->common_get_size("rom"); + + m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); + + return std::error_condition(); +} + +static INPUT_PORTS_START( leapfrog_leapster_explorer ) +INPUT_PORTS_END + + +void leapfrog_leapster_explorer_state::leapfrog_leapster_explorer(machine_config& config) +{ + ARM9(config, m_maincpu, 393000000); // unknown ARM9 type + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320, 262); + m_screen->set_visarea(0, 320 - 1, 0, 240 - 1); + m_screen->set_screen_update(FUNC(leapfrog_leapster_explorer_state::screen_update_innotab)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "leapfrog_leapster_explorer_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(leapfrog_leapster_explorer_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("leapster_explorer_cart"); +} + +ROM_START( leapexpr ) + ROM_REGION( 0x0100000, "maincpu", ROMREGION_ERASEFF ) + // unknown internal ROM + ROM_LOAD( "internal.rom", 0x000000, 0x0100000, NO_DUMP ) +ROM_END + +} // anonymous namespace + + +CONS( 2010, leapexpr, 0, 0, leapfrog_leapster_explorer, leapfrog_leapster_explorer, leapfrog_leapster_explorer_state, empty_init, "LeapFrog", "Leapster Explorer", MACHINE_IS_SKELETON ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index dddb4895d19..2554f2a2e9f 100755 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -24372,7 +24372,7 @@ tandy102 // tandy200 // trsm100 // -@source:leapfrog/leapfrog_iquest.cpp +@source:leapfrog/iquest.cpp iquest ttwistfb ttwistbq @@ -24381,20 +24381,20 @@ ttwistsp ttwistvc turboex -@source:leapfrog/leapfrog_leappad.cpp +@source:leapfrog/leappad.cpp leappad // (c) 2001 LeapFrog / Knowledge Kids Enterprises, Inc. mfleappad // (c) 2002 LeapFrog ltleappad // (c) 2005 LeapFrog -@source:leapfrog/leapfrog_leapster_explorer.cpp -leapexpr - @source:leapfrog/leapster.cpp leapster // leapster2 // leapsterlmx // leapstertv // +@source:leapfrog/leapster_explorer.cpp +leapexpr + @source:learsiegler/adm11.cpp adm12 // -- cgit v1.2.3