From 8de1502e81c325166bbb4a6ee819ce939772f94b Mon Sep 17 00:00:00 2001 From: David Haywood <28625134+DavidHaywood@users.noreply.github.com> Date: Wed, 12 Feb 2020 14:57:59 +0000 Subject: Plug and Play work (#6295) * new WORKING machines ---- Guitar Super Star (Fender Stratocaster style) [Sean Riddle, David Haywood] * better filename (nw) * new NOT WORKING ---- Excite Sports Tennis x Fitness (Japan) [Sean Riddle, Peter Wilhelmsen, ShouTime] * shuffle (nw) * new NOT WORKING ---- Wikid Joystick [TeamEurope, David Haywood] * new Software List entries (Mobigo.xml) [TeamEurope] Rapunzel - Neu Verfohnt (Germany) (80-251704) Cars 2 (Germany) (80-251904) Die Pinguine aus Madagascar - Operation Krone (Germany) (80-250304) Micky Maus - Wunderhaus (Germany) (80-250504) Ben 10 - UltimateAlien - Mine der Gedanken (Germany) (80-250604) Dora - Tag des Zwillings (Germany) (80-250804) Disney Princess (Germany) (80-251104) Cars Toon - Hooks unglaubliche Geschichten (Germany) (80-251204) * new Software List entries (telestory_cart.xml) [TeamEurope, David Haywood] Power Rangers - Mystic Force Dora the Explorer (Spanish) * new NOT WORKING --- TV Touch Games: Star Wars Original Trilogy [Sean Riddle, David Haywood] * srcclean some of my stuff (nw) * shuffle (nw) * shuffle (nw) * new NOT WORKING --- Big Buck Hunter Safari (JAKKS Pacific TV Game) [Sean Riddle, David Haywood] * (nw) * (nw) * (nw) --- hash/buzztime_cart.xml | 10 +- hash/casio_rompack.xml | 4 +- hash/jakks_gamekey_nm.xml | 8 +- hash/mobigo_cart.xml | 102 +- hash/smarttv_cart.xml | 2 +- hash/telestory_cart.xml | 28 +- scripts/target/mame/mess.lua | 8 +- src/devices/machine/sunplus_gcm394.cpp | 16 +- src/mame/drivers/casio_rompack.cpp | 14 +- src/mame/drivers/elan_eu3a05.cpp | 6 +- src/mame/drivers/hyperscan.cpp | 656 --------- src/mame/drivers/lexibook_jg7425.cpp | 109 -- src/mame/drivers/nes_sh6578.cpp | 14 +- src/mame/drivers/nes_vt.cpp | 6 +- src/mame/drivers/spg29x.cpp | 728 ++++++++++ src/mame/drivers/spg29x_lexibook_jg7425.cpp | 109 ++ src/mame/drivers/spg2xx.cpp | 32 +- src/mame/drivers/spg2xx_jakks.cpp | 172 ++- src/mame/drivers/spg2xx_lexibook.cpp | 2 +- src/mame/drivers/spg2xx_mysprtch.cpp | 18 +- src/mame/drivers/spg2xx_zone.cpp | 8 +- src/mame/drivers/sunplus_gcm394.cpp | 1813 ------------------------- src/mame/drivers/sunplus_unsp20soc.cpp | 1529 +++++++++++++++++++++ src/mame/drivers/sunplus_unsp20soc_mobigo.cpp | 91 ++ src/mame/drivers/vtech_mobigo.cpp | 78 -- src/mame/drivers/xavix.cpp | 27 +- src/mame/includes/sunplus_unsp20soc.h | 302 ++++ src/mame/machine/elan_eu3a05gpio.h | 2 +- src/mame/mame.lst | 25 +- src/mame/mess.flt | 8 +- src/mame/video/xavix.cpp | 38 +- 31 files changed, 3209 insertions(+), 2756 deletions(-) delete mode 100644 src/mame/drivers/hyperscan.cpp delete mode 100644 src/mame/drivers/lexibook_jg7425.cpp create mode 100644 src/mame/drivers/spg29x.cpp create mode 100644 src/mame/drivers/spg29x_lexibook_jg7425.cpp delete mode 100644 src/mame/drivers/sunplus_gcm394.cpp create mode 100644 src/mame/drivers/sunplus_unsp20soc.cpp create mode 100644 src/mame/drivers/sunplus_unsp20soc_mobigo.cpp delete mode 100644 src/mame/drivers/vtech_mobigo.cpp create mode 100644 src/mame/includes/sunplus_unsp20soc.h diff --git a/hash/buzztime_cart.xml b/hash/buzztime_cart.xml index 424420b4345..c1e0dcb5d6a 100644 --- a/hash/buzztime_cart.xml +++ b/hash/buzztime_cart.xml @@ -14,7 +14,7 @@ - + Series 1 - History Trivia 200? @@ -25,7 +25,7 @@ - + Series 1 - Everything Trivia 200? @@ -35,8 +35,8 @@ - - + + Series 1 - Sports Trivia 200? @@ -46,6 +46,6 @@ - + diff --git a/hash/casio_rompack.xml b/hash/casio_rompack.xml index a068ca1ee08..a6bea615b0f 100644 --- a/hash/casio_rompack.xml +++ b/hash/casio_rompack.xml @@ -112,7 +112,7 @@ - + How to Play your Casio ROM Keyboard (RO-251) 1984 @@ -122,6 +122,6 @@ - + diff --git a/hash/jakks_gamekey_nm.xml b/hash/jakks_gamekey_nm.xml index 1fbf9266916..91f12c6d005 100644 --- a/hash/jakks_gamekey_nm.xml +++ b/hash/jakks_gamekey_nm.xml @@ -6,7 +6,7 @@ - + Pac-Man & Bosconian (01 APR 2005 A SKU G) 2005 @@ -17,10 +17,10 @@ - - + + - + New Rally X & Dig Dug (01 APR 2005 A SKU E) 2005 diff --git a/hash/mobigo_cart.xml b/hash/mobigo_cart.xml index 5e16eaf1a4c..63eb5e411c0 100644 --- a/hash/mobigo_cart.xml +++ b/hash/mobigo_cart.xml @@ -1,12 +1,12 @@ - - + + Kung Fu Panda 2 (Germany) (80-252004) - 200? + 201? VTech @@ -14,17 +14,105 @@ - + + + Die Pinguine aus Madagascar - Operation Krone (Germany) (80-250304) + 201? + VTech + + + + + + + + + Micky Maus - Wunderhaus (Germany) (80-250504) + 201? + VTech + + + + + + + + + Ben 10 - UltimateAlien - Mine der Gedanken (Germany) (80-250604) + 201? + VTech + + + + + + + + + Dora - Tag des Zwillings (Germany) (80-250804) + 201? + VTech + + + + + + + + + Disney Princess (Germany) (80-251104) + 201? + VTech + + + + + + + + + Cars Toon - Hooks unglaubliche Geschichten (Germany) (80-251204) + 201? + VTech + + + + + + + + + Rapunzel - Neu Verfohnt (Germany) (80-251704) + 201? + VTech + + + + + + + + + Cars 2 (Germany) (80-251904) + 201? + VTech + + + + + + + Mobigo Kiosk (Germany) - 200? + 201? VTech - - + + diff --git a/hash/smarttv_cart.xml b/hash/smarttv_cart.xml index 11c2b678c9c..70496ddea10 100644 --- a/hash/smarttv_cart.xml +++ b/hash/smarttv_cart.xml @@ -2,7 +2,7 @@ - + Amusement Park 200? diff --git a/hash/telestory_cart.xml b/hash/telestory_cart.xml index a9a4c773286..2529a81d9ed 100644 --- a/hash/telestory_cart.xml +++ b/hash/telestory_cart.xml @@ -54,7 +54,7 @@ Undumped carts: La Cenicienta - Bellezas en Flor / Cinderella - Beauties in Bloom (Spain) 2006 - JAKKS Pacific / Toymax + JAKKS Pacific / Toymax / Handheld Games @@ -65,7 +65,7 @@ Undumped carts: Winnie the Pooh - Salta, Tigger, Salta / Winnie the Pooh - Bounce, Tigger, Bounce (Spain) 2006 - JAKKS Pacific / Toymax + JAKKS Pacific / Toymax / Handheld Games @@ -76,7 +76,7 @@ Undumped carts: El Rey León II - El orgullo de Simba / The Lion King II - Simba's Pride (Spain) 2006 - JAKKS Pacific / Toymax + JAKKS Pacific / Toymax / Handheld Games @@ -84,4 +84,26 @@ Undumped carts: + + Power Rangers - Mystic Force + 2006 + JAKKS Pacific / Toymax / HotGen + + + + + + + + + Dora the Explorer (Spanish) + 2006 + JAKKS Pacific / Toymax / HotGen + + + + + + + diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index c84331d44e1..f235d30aa8c 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -2681,7 +2681,6 @@ files { MAME_DIR .. "src/mame/includes/aquarius.h", MAME_DIR .. "src/mame/video/aquarius.cpp", MAME_DIR .. "src/mame/drivers/juicebox.cpp", - MAME_DIR .. "src/mame/drivers/hyperscan.cpp", MAME_DIR .. "src/mame/drivers/mattelchess.cpp", } @@ -3826,7 +3825,10 @@ files { MAME_DIR .. "src/mame/drivers/spg2xx_lexibook.cpp", MAME_DIR .. "src/mame/drivers/spg2xx_smarttv.cpp", MAME_DIR .. "src/mame/includes/spg2xx.h", - MAME_DIR .. "src/mame/drivers/sunplus_gcm394.cpp", + MAME_DIR .. "src/mame/drivers/spg29x.cpp", + MAME_DIR .. "src/mame/drivers/spg29x_lexibook_jg7425.cpp", + MAME_DIR .. "src/mame/drivers/sunplus_unsp20soc.cpp", + MAME_DIR .. "src/mame/drivers/sunplus_unsp20soc_mobigo.cpp", MAME_DIR .. "src/mame/drivers/generalplus_gpl32612.cpp", MAME_DIR .. "src/mame/drivers/xavix.cpp", MAME_DIR .. "src/mame/video/xavix.cpp", @@ -3849,7 +3851,6 @@ files { MAME_DIR .. "src/mame/machine/xavix2002_io.h", MAME_DIR .. "src/mame/drivers/xavix2.cpp", MAME_DIR .. "src/mame/drivers/titan_soc.cpp", - MAME_DIR .. "src/mame/drivers/lexibook_jg7425.cpp", MAME_DIR .. "src/mame/drivers/unkmandd.cpp", MAME_DIR .. "src/mame/drivers/bbl380.cpp", MAME_DIR .. "src/mame/drivers/actions_atj2279b.cpp", @@ -3983,7 +3984,6 @@ files { MAME_DIR .. "src/mame/drivers/vsmileb.cpp", MAME_DIR .. "src/mame/drivers/clickstart.cpp", MAME_DIR .. "src/mame/drivers/storio.cpp", - MAME_DIR .. "src/mame/drivers/vtech_mobigo.cpp", } createMESSProjects(_target, _subtarget, "wang") diff --git a/src/devices/machine/sunplus_gcm394.cpp b/src/devices/machine/sunplus_gcm394.cpp index 29f83441d36..105eadfbd84 100644 --- a/src/devices/machine/sunplus_gcm394.cpp +++ b/src/devices/machine/sunplus_gcm394.cpp @@ -62,12 +62,12 @@ void sunplus_gcm394_base_device::write_dma_params(int channel, int offset, uint1 LOGMASKED(LOG_GCM394_SYSDMA, "%s:sunplus_gcm394_base_device::write_dma_params (channel %01x) %01x %04x\n", machine().describe_context(), channel, offset, data); m_dma_params[offset][channel] = data; - + if (offset == 0 && (data & 1)) { trigger_systemm_dma(space, channel); } - + } @@ -133,7 +133,7 @@ void sunplus_gcm394_base_device::trigger_systemm_dma(address_space &space, int c uint32_t length = m_dma_params[3][channel] | (m_dma_params[6][channel] << 16); int sourcedelta = 0; int destdelta = 0; - + if ((mode & 0xa0) == 0x00) sourcedelta = 1; else if ((mode & 0xa0) == 0x20) @@ -165,7 +165,7 @@ void sunplus_gcm394_base_device::trigger_systemm_dma(address_space &space, int c } source += sourcedelta; - + if (mode & 0x2000) { write_space(dest, val & 0xFF); @@ -184,10 +184,10 @@ void sunplus_gcm394_base_device::trigger_systemm_dma(address_space &space, int c // note, these patch the code copied to SRAM so the 'PROGRAM ROM' check fails (it passes otherwise) //if (mem.read_word(0x4368c) == 0x4846) - // mem.write_word(0x4368c, 0x4840); // cars 2 force service mode + // mem.write_word(0x4368c, 0x4840); // cars 2 force service mode //if (mem.read_word(0x34410) == 0x4846) - // mem.write_word(0x34410, 0x4840); // golden tee force service mode + // mem.write_word(0x34410, 0x4840); // golden tee force service mode // what is it waiting for when we need these? (needed on some service mode screens) if (mem.read_word(0x3f368) == 0x4840) @@ -1012,7 +1012,7 @@ void generalplus_gpac800_device::recalculate_calculate_effective_nand_address() uint8_t type = m_nand_7856 & 0xf; uint8_t shift = 0; uint32_t page_offset = 0; - + if (type == 7) shift = 4; else if (type == 11) @@ -1027,7 +1027,7 @@ void generalplus_gpac800_device::recalculate_calculate_effective_nand_address() if (m_nand_7850 & 0x4000) nandaddress *= 2; - + uint32_t page = type ? nandaddress : /*(m_nand_7850 & 0x4000) ?*/ nandaddress >> 8 /*: nandaddress >> 9*/; m_effectiveaddress = (page * 528 + page_offset) << shift; diff --git a/src/mame/drivers/casio_rompack.cpp b/src/mame/drivers/casio_rompack.cpp index c41f7303f29..87693fc56a9 100644 --- a/src/mame/drivers/casio_rompack.cpp +++ b/src/mame/drivers/casio_rompack.cpp @@ -1,15 +1,15 @@ // license:BSD-3-Clause // copyright-holders: -/* - This is just a holder for the Casio ROM Pack Software List to ensure they aren't orphaned - These ROM Packs are used by various devices, but none of the devices have been dumped - - Once a supported system is dumped this can be removed and the list can be hooked up to that +/* + This is just a holder for the Casio ROM Pack Software List to ensure they aren't orphaned + These ROM Packs are used by various devices, but none of the devices have been dumped - Possible systems: + Once a supported system is dumped this can be removed and the list can be hooked up to that - TODO + Possible systems: + + TODO */ #include "emu.h" diff --git a/src/mame/drivers/elan_eu3a05.cpp b/src/mame/drivers/elan_eu3a05.cpp index 73f2f3921c9..43205a2f2a2 100644 --- a/src/mame/drivers/elan_eu3a05.cpp +++ b/src/mame/drivers/elan_eu3a05.cpp @@ -238,9 +238,9 @@ void elan_eu3a05_buzztime_state::elan_buzztime(machine_config &config) m_sys->set_alt_timer(); m_gpio->read_0_callback().set(FUNC(elan_eu3a05_buzztime_state::porta_r)); // I/O lives in here -// m_gpio->read_1_callback().set(FUNC(elan_eu3a05_buzztime_state::random_r)); // nothing of note -// m_gpio->read_2_callback().set(FUNC(elan_eu3a05_buzztime_state::random_r)); // nothing of note - m_gpio->write_1_callback().set(FUNC(elan_eu3a05_buzztime_state::portb_w)); // control related +// m_gpio->read_1_callback().set(FUNC(elan_eu3a05_buzztime_state::random_r)); // nothing of note +// m_gpio->read_2_callback().set(FUNC(elan_eu3a05_buzztime_state::random_r)); // nothing of note + m_gpio->write_1_callback().set(FUNC(elan_eu3a05_buzztime_state::portb_w)); // control related GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "buzztime_cart"); m_cart->set_width(GENERIC_ROM16_WIDTH); diff --git a/src/mame/drivers/hyperscan.cpp b/src/mame/drivers/hyperscan.cpp deleted file mode 100644 index 6c89baf2d7f..00000000000 --- a/src/mame/drivers/hyperscan.cpp +++ /dev/null @@ -1,656 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Sandro Ronco -/*************************************************************************** - - Mattel HyperScan - - 08/17/2013 Skeleton driver by Sandro Ronco - - SPG290 Interrupt: - - Vector Source - 63 SPU FIQ - 62 SPU Beatirq - 61 SPU Envirq - 60 CD servo - 59 ADC gain overflow / ADC recorder / FIFO overflow - 58 General purpose ADC - 57 Timer base - 56 Timer - 55 TV vblanking start - 54 LCD vblanking start - 53 PPU vblanking start - 52 TV - 51 Sensor frame end - 50 Sensor coordinate hit - 49 Sensor motion frame end - 48 Sensor capture done + sensor debug IRQ - 47 TV coordinate hit - 46 PPU coordinate hit - 45 USB host+device - 44 SIO - 43 SPI - 42 Uart (IrDA) - 41 NAND - 40 SD - 39 I2C master - 38 I2S slave - 37 APBDMA CH1 - 36 APBDMA CH2 - 35 LDM_DMA - 34 BLN_DMA - 33 APBDMA CH3 - 32 APBDMA CH4 - 31 Alarm + HMS - 30 MP4 - 29 C3 (ECC module) - 28 GPIO - 27 Bufctl (for debug) + TV/PPU vblanking end (for debug) - 26 RESERVED1 - 25 RESERVED2 - 24 RESERVED3 - -****************************************************************************/ - -#include "emu.h" -#include "cpu/score/score.h" -#include "screen.h" -#include "softlist_dev.h" - -#define LOG_SPG290_REGISTER_ACCESS (1) - - - -class hyperscan_state : public driver_device -{ -public: - hyperscan_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") - { } - - void hyperscan(machine_config &config); - -private: - required_device m_maincpu; - - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - - uint32_t spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - DECLARE_READ32_MEMBER(spg290_regs_r); - DECLARE_WRITE32_MEMBER(spg290_regs_w); - void spg290_timers_update(); - DECLARE_WRITE_LINE_MEMBER(spg290_vblank_irq); - inline uint32_t spg290_read_mem(uint32_t offset); - inline void spg290_write_mem(uint32_t offset, uint32_t data); - void spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t argb); - void spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t rgb, uint32_t transrgb); - void spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, uint32_t *palettes, uint32_t buf_start); - void spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb); - void spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb); - - void spg290_mem(address_map &map); - - static const device_timer_id TIMER_SPG290 = 0; - static const device_timer_id TIMER_I2C = 1; - - struct spg290_miu - { - uint32_t status; - }; - - struct spg290_ppu - { - uint32_t control; - uint32_t irq_control; - uint32_t irq_status; - uint32_t sprite_max; - uint32_t sprite_buf_start; - uint32_t frame_buff[3]; - uint32_t palettes[0x200]; - uint32_t tx_hoffset[0x200]; - uint32_t tx_hcomp[0x200]; - uint32_t transrgb; - - struct ppu_spite - { - uint32_t control; - uint32_t attribute; - } sprites[0x200]; - - struct ppu_tx - { - uint32_t control; - uint32_t attribute; - uint32_t posx; - uint32_t posy; - uint32_t nptr; - uint32_t buf_start[3]; - } txs[3]; - }; - - struct spg290_timer - { - uint32_t control; - uint32_t control2; - uint16_t preload; - uint16_t counter; - }; - - struct spg290_i2c - { - uint32_t config; - uint32_t irq_control; - uint32_t clock; - uint8_t count; - uint32_t id; - uint32_t port_addr; - uint32_t wdata; - uint32_t rdata; - }; - - spg290_miu m_miu; - spg290_ppu m_ppu; - spg290_timer m_timers[6]; - spg290_i2c m_i2c; - emu_timer * m_update_timer; - emu_timer * m_i2c_timer; -}; - - - -#if LOG_SPG290_REGISTER_ACCESS -static void log_spg290_regs(device_t *device,uint8_t module, uint16_t reg, uint32_t mem_mask, bool write, uint32_t data=0) -{ - static const char *const modules_name[] = - { - "CSI", "PPU", "JPG", "TV", "LCD", "SPU", "CD", "MIU", "APBDMA", "BUFCTL","IRQCTL", "GPUBUF", "LDMDMA", - "BLNDMA", "TPGBUF", "AHBDEC", "GPIO", "SPI", "SIO", "I2C", "I2S", "UART", "TIMERS/RTC", "WDOG", "SD", - "FLASH", "ADC", "USB device", "USB host", "Reserved", "Reserved", "Reserved", "SFTCFG", "CKG", "MP4", - "MIU2", "ECC" - }; - - if (module < 0x25) - device->logerror("SPG: %-10s", modules_name[module]); - else - device->logerror("SPG: mod 0x%02x ", module); - - if (!write) - device->logerror(" R 0x%04x", reg); - else - device->logerror(" W 0x%04x = 0x%08x", reg, data); - - if (mem_mask != 0xffffffffu) - device->logerror(" (0x%08x)\n", mem_mask); - else - device->logerror("\n"); -} -#endif - - -READ32_MEMBER(hyperscan_state::spg290_regs_r) -{ - uint32_t addr = offset << 2; - uint32_t data = 0; - - if (addr == 0x010000) // PPU Control - { - data = m_ppu.control; - } - else if (addr == 0x010084) // PPU IRQ Status - { - data = m_ppu.irq_status; - } - if (addr == 0x07006c) // MIU Status - { - data = m_miu.status; - } - else if ((addr & 0xff0fff) == 0x160000) // Timer X Status - { - int idx = (offset>>10) & 0x0f; - data = m_timers[idx].control; - } - else if(addr == 0x130024) // I2C interrupt - { - data = m_i2c.irq_control; - } - else if(addr == 0x130034) // I2C write data - { - data = m_i2c.wdata; - } - else if(addr == 0x130038) // I2C data data - { - data = m_i2c.rdata; - } - -#if LOG_SPG290_REGISTER_ACCESS - //else - { - if (!machine().side_effects_disabled()) - log_spg290_regs(this,(offset >> 14) & 0xff, (offset<<2) & 0xffff, mem_mask, false); - } -#endif - - return data; -} - -WRITE32_MEMBER(hyperscan_state::spg290_regs_w) -{ - uint32_t addr = offset << 2; - - if (addr == 0x010000) // PPU Control - { - COMBINE_DATA(&m_ppu.control); - } - else if (addr == 0x010008) // PPU Max Sprites - { - COMBINE_DATA(&m_ppu.sprite_max); - } - else if (addr == 0x010010) // PPU Max Sprites - { - COMBINE_DATA(&m_ppu.transrgb); - } - else if (addr == 0x0100d0) // Sprites buffer start - { - COMBINE_DATA(&m_ppu.sprite_buf_start); - } - else if (addr == 0x010020 || addr == 0x01003c || addr == 0x010058) // Text Layers x pos - { - int idx = (((offset>>3) & 3) | ((offset>>4) & 1)) - 1; - COMBINE_DATA(&m_ppu.txs[idx].posx); - } - else if (addr == 0x010024 || addr == 0x010040 || addr == 0x01005c) // Text Layers y pos - { - int idx = (((offset>>3) & 3) | ((offset>>4) & 1)) - 1; - COMBINE_DATA(&m_ppu.txs[idx].posy); - } - else if (addr == 0x010028 || addr == 0x010044 || addr == 0x010060) // Text Layers attribute - { - int idx = ((offset>>3) & 3) - 1; - COMBINE_DATA(&m_ppu.txs[idx].attribute); - } - else if (addr == 0x01002c || addr == 0x010048 || addr == 0x010064) // Text Layers control - { - int idx = ((offset>>3) & 3) - 1; - COMBINE_DATA(&m_ppu.txs[idx].control); - } - else if (addr == 0x010030 || addr == 0x01004c || addr == 0x010068) // Text Layers number ptr - { - int idx = ((offset>>3) & 3) - 1; - COMBINE_DATA(&m_ppu.txs[idx].nptr); - } - else if (addr == 0x010080) // PPU IRQ Control - { - COMBINE_DATA(&m_ppu.irq_control); - } - else if (addr == 0x010084) // PPU IRQ ack - { - if (ACCESSING_BITS_0_7) - m_ppu.irq_status &= ~data; - } - else if (addr >= 0x0100a0 && addr <= 0x0100a8) // Tx1 buffer start - { - COMBINE_DATA(&m_ppu.txs[0].buf_start[offset & 3]); - } - else if (addr >= 0x0100ac && addr <= 0x0100b4) // Tx2 buffer start - { - COMBINE_DATA(&m_ppu.txs[1].buf_start[(offset+1) & 3]); - } - else if (addr >= 0x0100b8 && addr <= 0x0100c0) // Tx3 buffer starts - { - COMBINE_DATA(&m_ppu.txs[2].buf_start[(offset+2) & 3]); - } - else if ((addr & 0xfff000) == 0x011000) // Palettes - { - COMBINE_DATA(&m_ppu.palettes[offset & 0x01ff]); - } - else if ((addr & 0xfff000) == 0x012000) // Tx horizontal offset - { - COMBINE_DATA(&m_ppu.tx_hoffset[offset & 0x01ff]); - } - else if ((addr & 0xfff000) == 0x013000) // Tx horizontal compression - { - COMBINE_DATA(&m_ppu.tx_hcomp[offset & 0x01ff]); - } - else if ((addr & 0xfff000) == 0x014000) // Sprite Control Registers - { - int idx = (offset>>1) & 0x1ff; - if (offset & 1) - COMBINE_DATA(&m_ppu.sprites[idx].attribute); - else - COMBINE_DATA(&m_ppu.sprites[idx].control); - } - else if (addr == 0x07005c) // MIU Status - { - COMBINE_DATA(&m_miu.status); - } - else if ((addr & 0xff0fff) == 0x160000) // Timer X Control 1 - { - int idx = (offset>>10) & 0x07; - COMBINE_DATA(&m_timers[idx].control); - - if (ACCESSING_BITS_24_31) - m_timers[idx].control &= ~(data & 0x04000000); // Timers IRQ ack - } - else if ((addr & 0xff0fff) == 0x160004) // Timer X Control 2 - { - int idx = (offset>>10) & 0x07; - COMBINE_DATA(&m_timers[idx].control2); - } - else if ((addr & 0xff0fff) == 0x160008) // Timer X Preload - { - int idx = (offset>>10) & 0x07; - COMBINE_DATA(&m_timers[idx].preload); - } - else if (addr == 0x2100e4) // Timer Source Clock Selection - { - const auto timers_clk = XTAL(27'000'000) / ((data & 0xff) + 1); - m_update_timer->adjust(attotime::from_hz(timers_clk), 0, attotime::from_hz(timers_clk)); - } - else if(addr == 0x130020) // I2C configuration - { - COMBINE_DATA(&m_i2c.config); - } - else if(addr == 0x130024) // I2C interrupt - { - COMBINE_DATA(&m_i2c.irq_control); - - if (ACCESSING_BITS_0_7) - m_i2c.irq_control &= ~(data & 0x00000001); // I2C IRQ ack - } - else if(addr == 0x130028) // I2C clock setting - { - COMBINE_DATA(&m_i2c.clock); - const auto i2c_clk = XTAL(27'000'000) / ((m_i2c.clock & 0x3ff) + 1); - m_i2c_timer->adjust(attotime::from_hz(i2c_clk), 0, attotime::from_hz(i2c_clk)); - } - else if(addr == 0x13002c) // I2C ID - { - COMBINE_DATA(&m_i2c.id); - } - else if(addr == 0x130030) // I2C port address - { - COMBINE_DATA(&m_i2c.port_addr); - } - else if(addr == 0x130034) // I2C write data - { - COMBINE_DATA(&m_i2c.wdata); - } - else if(addr == 0x130038) // I2C data data - { - COMBINE_DATA(&m_i2c.rdata); - } - else if(addr == 0x150000) // UART data - { - if (ACCESSING_BITS_0_7) - printf("%c", data & 0xff); - } - -#if LOG_SPG290_REGISTER_ACCESS - //else - { - if (!machine().side_effects_disabled()) - log_spg290_regs(this,(offset >> 14) & 0xff, (offset<<2) & 0xffff, mem_mask, true, data); - } -#endif -} - -inline uint32_t hyperscan_state::spg290_read_mem(uint32_t offset) -{ - return m_maincpu->space(0).read_dword(offset); -} - -inline void hyperscan_state::spg290_write_mem(uint32_t offset, uint32_t data) -{ - return m_maincpu->space(0).write_dword(offset, data); -} - -void hyperscan_state::spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t argb) -{ - if (!(argb & 0x8000) && cliprect.contains(posx, posy)) - { - rgb_t color = rgb_t(pal5bit(argb >> 10), pal5bit(argb >> 5), pal5bit(argb >> 0)); - bitmap.pix32(posy, posx) = color; - } -} - -void hyperscan_state::spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t rgb, uint32_t transrgb) -{ - if ((!(transrgb & 0x10000) || (transrgb & 0xffff) != rgb) && cliprect.contains(posx, posy)) - { - rgb_t color = rgb_t(pal5bit(rgb >> 11), pal6bit(rgb >> 5), pal5bit(rgb >> 0)); - bitmap.pix32(posy, posx) = color; - } -} - -void hyperscan_state::spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, uint32_t *palettes, uint32_t buf_start) -{ - uint32_t sprite_base = buf_start + ((control & 0xffff) << 8); - uint16_t sprite_x = (control >> 16) & 0x3ff; - uint16_t sprite_y = (attribute >> 16) & 0x3ff; - uint8_t sprite_hsize = 8 << ((attribute >> 4) & 0x03); - uint8_t sprite_vsize = 8 << ((attribute >> 6) & 0x03); - uint8_t bit_pixel = ((attribute & 3) + 1) << 1; - uint8_t pixel_word = 32 / bit_pixel; - uint8_t word_line = sprite_hsize / pixel_word; - uint8_t sprite_flip = (attribute >> 2) & 0x03; - - for (int y=0; y < sprite_vsize; y++) - for (int x=0; x < word_line; x++) - { - uint32_t data = spg290_read_mem(sprite_base + (y * pixel_word + x) * 4); - - for (int b=0; b < pixel_word; b++) - { - uint16_t pen = ((data >> (b * bit_pixel)) & ((1 << bit_pixel) - 1)); - uint16_t posx; - if (sprite_flip & 0x01) - posx = sprite_x + (sprite_hsize - (x * word_line + b)); - else - posx = sprite_x + x * (word_line) + b; - - uint16_t posy; - if (sprite_flip & 0x02) - posy = sprite_y + (sprite_vsize - y); - else - posy = sprite_y + y; - - spg290_argb1555(bitmap, cliprect, posy, posx, palettes[pen]); - } - } -} - -void hyperscan_state::spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb) -{ - for (int y=0; y<512; y++) - { - int line = (control & 0x04) ? 0 : y; - uint32_t tx_start = spg290_read_mem(nptr + (posy + line) * 4); - - for (int x=0; x < 1024>>1; x++) - { - uint32_t data = spg290_read_mem(buf_start + (tx_start + posx) * 2 + x * 4); - - for (int b=0; b < 2; b++) - { - uint16_t posx = x * 2 + b; - uint16_t posy = y; - uint16_t pix = (data >> (b*16)) & 0xffff; - - if (control & 0x0080) - spg290_argb1555(bitmap, cliprect, posy, posx, pix); - if (control & 0x1000) - spg290_rgb565(bitmap, cliprect, posy, posx, pix, transrgb); - } - } - } -} - -void hyperscan_state::spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb) -{ - // TODO -} - - -uint32_t hyperscan_state::spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - if (m_ppu.control & 0x1000) - { - for (int depth=0; depth<4; depth++) - { - // draw the bitmap/text layers - for (int l=0; l<3; l++) - if ((m_ppu.txs[l].control & 0x08) && ((m_ppu.txs[l].attribute >> 13) & 3) == depth) - { - if (m_ppu.txs[l].control & 0x01) - spg290_blit_bitmap(bitmap, cliprect, m_ppu.txs[l].control, m_ppu.txs[l].attribute, m_ppu.txs[l].posy & 0x1ff, m_ppu.txs[l].posx & 0x1ff, m_ppu.txs[l].nptr, m_ppu.txs[l].buf_start[0], m_ppu.transrgb); - else - spg290_blit_character(bitmap, cliprect, m_ppu.txs[l].control, m_ppu.txs[l].attribute, m_ppu.txs[l].posy & 0x1ff, m_ppu.txs[l].posx & 0x1ff, m_ppu.txs[l].nptr, m_ppu.txs[l].buf_start[0], m_ppu.transrgb); - } - - // draw the sprites - for (int i=0; i<=(m_ppu.sprite_max & 0x1ff); i++) - { - if (((m_ppu.sprites[i].attribute >> 13) & 3) == depth) - spg290_blit_sprite(bitmap, cliprect, m_ppu.sprites[i].control, m_ppu.sprites[i].attribute, m_ppu.palettes, m_ppu.sprite_buf_start); - } - } - } - else - { - bitmap.fill(rgb_t::black(), cliprect); - } - - return 0; -} - -void hyperscan_state::spg290_timers_update() -{ - for(auto & elem : m_timers) - if (elem.control & 0x80000000) - { - if (((elem.control2 >> 30) & 0x03) == 0x00) - { - if (elem.counter == 0xffff) - { - elem.counter = elem.preload; - if (elem.control & 0x08000000) - { - elem.control |= 0x04000000; - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 56); // SCORE7 - } - } - else - elem.counter++; - } - else - { - // TODO: capture, comparison and PWM mode - - } - } -} - -WRITE_LINE_MEMBER(hyperscan_state::spg290_vblank_irq) -{ - if (state && m_ppu.irq_control & 0x01) // VBlanking Start IRQ - { - m_ppu.irq_status |= 0x01; - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 53); // SCORE7 - } - else if (!state && m_ppu.irq_control & 0x02) // VBlanking End IRQ - { - m_ppu.irq_status |= 0x02; - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 53); // SCORE7 - } -} - - -void hyperscan_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - switch (id) - { - case TIMER_SPG290: - spg290_timers_update(); - break; - case TIMER_I2C: - if ((m_i2c.config & 0x40) && (m_i2c.config & 0x01)) - { - // TODO: replace with real I2C emulation - m_i2c.rdata = 0; - - m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 39); // SCORE7 - } - break; - } -} - -void hyperscan_state::spg290_mem(address_map &map) -{ - map.global_mask(0x1fffffff); - map(0x00000000, 0x00ffffff).ram().mirror(0x07000000); - map(0x08000000, 0x09ffffff).rw(FUNC(hyperscan_state::spg290_regs_r), FUNC(hyperscan_state::spg290_regs_w)); - map(0x0a000000, 0x0a003fff).ram(); // internal SRAM - map(0x0b000000, 0x0b007fff).rom().region("spg290", 0); // internal ROM - map(0x10000000, 0x100fffff).rom().region("bios", 0).mirror(0x0e000000); - map(0x11000000, 0x110fffff).rom().region("bios", 0).mirror(0x0e000000); -} - -/* Input ports */ -static INPUT_PORTS_START( hyperscan ) -INPUT_PORTS_END - - -void hyperscan_state::machine_start() -{ - m_update_timer = timer_alloc(TIMER_SPG290); - m_i2c_timer = timer_alloc(TIMER_I2C); -} - -void hyperscan_state::machine_reset() -{ - memset(&m_ppu, 0, sizeof(spg290_ppu)); - memset(&m_miu, 0, sizeof(spg290_miu)); - memset(&m_i2c, 0, sizeof(m_i2c)); - m_i2c_timer->adjust(attotime::never, 0, attotime::never); - - // disable JTAG - m_maincpu->set_state_int(SCORE_CR + 29, 0x20000000); -} - - -void hyperscan_state::hyperscan(machine_config &config) -{ - /* basic machine hardware */ - SCORE7(config, m_maincpu, XTAL(27'000'000) * 4); // 108MHz S+core 7 - m_maincpu->set_addrmap(AS_PROGRAM, &hyperscan_state::spg290_mem); - - SOFTWARE_LIST(config, "cd_list").set_original("hyperscan"); - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(50); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ - screen.set_screen_update(FUNC(hyperscan_state::spg290_screen_update)); - screen.set_size(640, 480); - screen.set_visarea(0, 640-1, 0, 480-1); - screen.screen_vblank().set(FUNC(hyperscan_state::spg290_vblank_irq)); -} - - -/* ROM definition */ -ROM_START( hs ) - ROM_REGION( 0x100000, "bios", ROMREGION_32BIT | ROMREGION_LE ) - ROM_LOAD32_DWORD("hyperscan.bin", 0x000000, 0x100000, CRC(ce346a14) SHA1(560cb747e7193e6781d4b8b0bd4d7b45d3d28690)) - - ROM_REGION( 0x008000, "spg290", ROMREGION_32BIT | ROMREGION_LE ) - ROM_LOAD32_DWORD("spg290.bin", 0x000000, 0x008000, NO_DUMP) // 256Kbit SPG290 internal ROM -ROM_END - - -/* Driver */ - -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 2006, hs, 0, 0, hyperscan, hyperscan, hyperscan_state, empty_init, "Mattel", "HyperScan", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/drivers/lexibook_jg7425.cpp b/src/mame/drivers/lexibook_jg7425.cpp deleted file mode 100644 index c8fecbcb964..00000000000 --- a/src/mame/drivers/lexibook_jg7425.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood - - -/* - -a 221 games console which uses a 4GB sd-card for gamestorage and a MX29LV160 flashrom for the internal bios. (only 512kb are used from the 2mb romspace) -Starting the console without SD-Card just show's a looping video with "Please insert Memory Card". - -SD card image produced with WinHex (hardware write blocker used to prevent Windows from corrupting data) -compressed with "chdman createhd -i 4GBSD.img -o lexibook_jg7425_4gbsd.chd" (is this correct?) - -TODO: -is there an internal ROM / bootstrap area, or does this SunPlus core use vectors in a different way to the one in hyperscan.cpp? -If SPG290, should probably be merged with hyperscan.cpp - -(only noteworthy features of PCB are ROM + RAM + Cpu Glob) - -*/ - -#include "emu.h" -#include "screen.h" -#include "cpu/score/score.h" - -class lexibook_jg7425_state : public driver_device -{ -public: - lexibook_jg7425_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_mainram(*this, "mainram"), - m_romregion(*this, "maincpu") - { } - - void lexibook_jg7425(machine_config &config); - - void map(address_map& map); - -protected: - uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); - -private: - virtual void machine_start() override; - virtual void machine_reset() override; - - required_device m_maincpu; - required_device m_screen; - required_shared_ptr m_mainram; - required_region_ptr m_romregion; -}; - - - -void lexibook_jg7425_state::machine_start() -{ - // I think this code should be running from RAM at least, probably some kind of bootstrap / internal ROM to copy it? (hyperscan.cpp indicates that SoC can have internal ROM at least) - - // first 0x20 bytes are probably pointers, code starts at 0x20 and is offset, maps at 0x500000 - - for (int i = 0; i < 0x80000 / 4; i++) - { - m_mainram[i+(0x500000/4) - (0x20/4)] = m_romregion[i]; - } -} - -void lexibook_jg7425_state::machine_reset() -{ -} - -static INPUT_PORTS_START( lexibook_jg7425 ) -INPUT_PORTS_END - - -uint32_t lexibook_jg7425_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - return 0; -} - -void lexibook_jg7425_state::map(address_map &map) -{ - map(0x00000000, 0x00ffffff).ram().share("mainram"); - - map(0x9f000000, 0x9fffffff).ram().share("mainram"); -} - - -void lexibook_jg7425_state::lexibook_jg7425(machine_config &config) -{ - /* basic machine hardware */ - SCORE7(config, m_maincpu, XTAL(27'000'000) * 4); // ? not certain on exact type - m_maincpu->set_addrmap(AS_PROGRAM, &lexibook_jg7425_state::map); - - 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(lexibook_jg7425_state::screen_update)); -} - -ROM_START( lx_jg7425 ) - ROM_REGION( 0x200000, "maincpu", ROMREGION_32BIT | ROMREGION_LE ) - ROM_LOAD32_DWORD( "mx29lv160.u6", 0x000000, 0x200000, CRC(43c90080) SHA1(4c9e5c8f880d40bd684357ce67ae45c3f5d24b62) ) - - DISK_REGION( "ata:0:hdd:image" ) /* 4GB SD Card */ - DISK_IMAGE( "lexibook_jg7425_4gbsd", 0, SHA1(dc0985103edec3992efdd493feef6185daedb3fd) ) -ROM_END - -CONS( 2015, lx_jg7425, 0, 0, lexibook_jg7425, lexibook_jg7425, lexibook_jg7425_state, empty_init, "Lexibook", "Lexibook JG7425 221-in-1", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/nes_sh6578.cpp b/src/mame/drivers/nes_sh6578.cpp index 4dffc85cf37..24edcd7e823 100644 --- a/src/mame/drivers/nes_sh6578.cpp +++ b/src/mame/drivers/nes_sh6578.cpp @@ -2,8 +2,8 @@ // copyright-holders:David Haywood /* - SH6578 NES clone hardware - enhanced NES, different to VT / OneBus systems + SH6578 NES clone hardware + enhanced NES, different to VT / OneBus systems */ #include "emu.h" @@ -119,17 +119,23 @@ ROM_START( ts_handy11 ) ROM_LOAD( "tvplaypowercontroller.bin", 0x00000, 0x100000, CRC(9c7fe9ff) SHA1(c872e91ca835b66c9dd3b380e8374b51f12bcae0) ) // 29LV008B ROM_END - ROM_START( cpatrolm ) ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD( "citypatrolman.bin", 0x00000, 0x100000, CRC(4b139c67) SHA1(a5b03f472a94ee879f58bbff201b671fbf4f1ea1) ) ROM_END +ROM_START( ablwikid ) + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD( "mx29f1610atc.u2", 0x00000, 0x200000, CRC(f16abf79) SHA1(aeccbb40d7fdd451ba8e5cca20464da2cf116461) ) +ROM_END + CONS( 1997, bandgpad, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Bandai", "Gamppad (Bandai)", MACHINE_NOT_WORKING ) // possibly newer than 2001 CONS( 2001, ts_handy11, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Techno Source", "Handy Boy 11-in-1 (TV Play Power)", MACHINE_NOT_WORKING ) - CONS( 200?, cpatrolm, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "", "City Patrolman", MACHINE_NOT_WORKING ) + +// this may or may not belong here, it appears to have 4bpp gfx, but unless the banks are scrambled, doesn't fit a standard VT scheme +CONS( 200?, ablwikid, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Advance Bright Ltd.", "Wikid Joystick", MACHINE_NOT_WORKING ) // or Wik!d Joystick diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp index 6f0595a2386..ac4cec921bf 100644 --- a/src/mame/drivers/nes_vt.cpp +++ b/src/mame/drivers/nes_vt.cpp @@ -349,7 +349,7 @@ public: m_latch0_bit(0), m_latch1_bit(0) { } - + protected: virtual DECLARE_READ8_MEMBER(in0_r) override; virtual DECLARE_READ8_MEMBER(in1_r) override; @@ -536,7 +536,7 @@ WRITE8_MEMBER(nes_vt_cy_lexibook_state::in0_w) m_latch1_bit = m_latch1 & 0x01; m_latch1 >>= 1; } - + m_previous_port0 = data; } @@ -1965,7 +1965,7 @@ void nes_vt_waixing_state::machine_reset() nes_vt_state::machine_reset(); m_ppu->set_201x_descramble(0x3, 0x2, 0x7, 0x6, 0x5, 0x4); // reasonable -// set_8000_scramble(0x5, 0x4, 0x3, 0x2, 0x7, 0x6, 0x7, 0x8); +// set_8000_scramble(0x5, 0x4, 0x3, 0x2, 0x7, 0x6, 0x7, 0x8); } void nes_vt_hum_state::machine_reset() diff --git a/src/mame/drivers/spg29x.cpp b/src/mame/drivers/spg29x.cpp new file mode 100644 index 00000000000..4c821b3030f --- /dev/null +++ b/src/mame/drivers/spg29x.cpp @@ -0,0 +1,728 @@ +// license:BSD-3-Clause +// copyright-holders:Sandro Ronco +/*************************************************************************** + + Mattel HyperScan + + 08/17/2013 Skeleton driver by Sandro Ronco + + SPG290 Interrupt: + + Vector Source + 63 SPU FIQ + 62 SPU Beatirq + 61 SPU Envirq + 60 CD servo + 59 ADC gain overflow / ADC recorder / FIFO overflow + 58 General purpose ADC + 57 Timer base + 56 Timer + 55 TV vblanking start + 54 LCD vblanking start + 53 PPU vblanking start + 52 TV + 51 Sensor frame end + 50 Sensor coordinate hit + 49 Sensor motion frame end + 48 Sensor capture done + sensor debug IRQ + 47 TV coordinate hit + 46 PPU coordinate hit + 45 USB host+device + 44 SIO + 43 SPI + 42 Uart (IrDA) + 41 NAND + 40 SD + 39 I2C master + 38 I2S slave + 37 APBDMA CH1 + 36 APBDMA CH2 + 35 LDM_DMA + 34 BLN_DMA + 33 APBDMA CH3 + 32 APBDMA CH4 + 31 Alarm + HMS + 30 MP4 + 29 C3 (ECC module) + 28 GPIO + 27 Bufctl (for debug) + TV/PPU vblanking end (for debug) + 26 RESERVED1 + 25 RESERVED2 + 24 RESERVED3 + +****************************************************************************/ + +#include "emu.h" +#include "cpu/score/score.h" +#include "screen.h" +#include "softlist_dev.h" + +#define LOG_SPG290_REGISTER_ACCESS (1) + + + +class spg29x_game_state : public driver_device +{ +public: + spg29x_game_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void hyperscan(machine_config &config); + +private: + required_device m_maincpu; + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + uint32_t spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_READ32_MEMBER(spg290_regs_r); + DECLARE_WRITE32_MEMBER(spg290_regs_w); + void spg290_timers_update(); + DECLARE_WRITE_LINE_MEMBER(spg290_vblank_irq); + inline uint32_t spg290_read_mem(uint32_t offset); + inline void spg290_write_mem(uint32_t offset, uint32_t data); + void spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t argb); + void spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t rgb, uint32_t transrgb); + void spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, uint32_t *palettes, uint32_t buf_start); + void spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb); + void spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb); + + void spg290_mem(address_map &map); + + static const device_timer_id TIMER_SPG290 = 0; + static const device_timer_id TIMER_I2C = 1; + + struct spg290_miu + { + uint32_t status; + }; + + struct spg290_ppu + { + uint32_t control; + uint32_t irq_control; + uint32_t irq_status; + uint32_t sprite_max; + uint32_t sprite_buf_start; + uint32_t frame_buff[3]; + uint32_t palettes[0x200]; + uint32_t tx_hoffset[0x200]; + uint32_t tx_hcomp[0x200]; + uint32_t transrgb; + + struct ppu_spite + { + uint32_t control; + uint32_t attribute; + } sprites[0x200]; + + struct ppu_tx + { + uint32_t control; + uint32_t attribute; + uint32_t posx; + uint32_t posy; + uint32_t nptr; + uint32_t buf_start[3]; + } txs[3]; + }; + + struct spg290_timer + { + uint32_t control; + uint32_t control2; + uint16_t preload; + uint16_t counter; + }; + + struct spg290_i2c + { + uint32_t config; + uint32_t irq_control; + uint32_t clock; + uint8_t count; + uint32_t id; + uint32_t port_addr; + uint32_t wdata; + uint32_t rdata; + }; + + spg290_miu m_miu; + spg290_ppu m_ppu; + spg290_timer m_timers[6]; + spg290_i2c m_i2c; + emu_timer * m_update_timer; + emu_timer * m_i2c_timer; + + +}; + +class spg29x_nand_game_state : public spg29x_game_state +{ +public: + spg29x_nand_game_state(const machine_config& mconfig, device_type type, const char* tag) : + spg29x_game_state(mconfig, type, tag) + { } + + void nand_init(int blocksize, int blocksize_stripped); + void nand_init210(); + +private: + std::vector m_strippedrom; +}; + + + +#if LOG_SPG290_REGISTER_ACCESS +static void log_spg290_regs(device_t *device,uint8_t module, uint16_t reg, uint32_t mem_mask, bool write, uint32_t data=0) +{ + static const char *const modules_name[] = + { + "CSI", "PPU", "JPG", "TV", "LCD", "SPU", "CD", "MIU", "APBDMA", "BUFCTL","IRQCTL", "GPUBUF", "LDMDMA", + "BLNDMA", "TPGBUF", "AHBDEC", "GPIO", "SPI", "SIO", "I2C", "I2S", "UART", "TIMERS/RTC", "WDOG", "SD", + "FLASH", "ADC", "USB device", "USB host", "Reserved", "Reserved", "Reserved", "SFTCFG", "CKG", "MP4", + "MIU2", "ECC" + }; + + if (module < 0x25) + device->logerror("SPG: %-10s", modules_name[module]); + else + device->logerror("SPG: mod 0x%02x ", module); + + if (!write) + device->logerror(" R 0x%04x", reg); + else + device->logerror(" W 0x%04x = 0x%08x", reg, data); + + if (mem_mask != 0xffffffffu) + device->logerror(" (0x%08x)\n", mem_mask); + else + device->logerror("\n"); +} +#endif + + +READ32_MEMBER(spg29x_game_state::spg290_regs_r) +{ + uint32_t addr = offset << 2; + uint32_t data = 0; + + if (addr == 0x010000) // PPU Control + { + data = m_ppu.control; + } + else if (addr == 0x010084) // PPU IRQ Status + { + data = m_ppu.irq_status; + } + if (addr == 0x07006c) // MIU Status + { + data = m_miu.status; + } + else if ((addr & 0xff0fff) == 0x160000) // Timer X Status + { + int idx = (offset>>10) & 0x0f; + data = m_timers[idx].control; + } + else if(addr == 0x130024) // I2C interrupt + { + data = m_i2c.irq_control; + } + else if(addr == 0x130034) // I2C write data + { + data = m_i2c.wdata; + } + else if(addr == 0x130038) // I2C data data + { + data = m_i2c.rdata; + } + +#if LOG_SPG290_REGISTER_ACCESS + //else + { + if (!machine().side_effects_disabled()) + log_spg290_regs(this,(offset >> 14) & 0xff, (offset<<2) & 0xffff, mem_mask, false); + } +#endif + + return data; +} + +WRITE32_MEMBER(spg29x_game_state::spg290_regs_w) +{ + uint32_t addr = offset << 2; + + if (addr == 0x010000) // PPU Control + { + COMBINE_DATA(&m_ppu.control); + } + else if (addr == 0x010008) // PPU Max Sprites + { + COMBINE_DATA(&m_ppu.sprite_max); + } + else if (addr == 0x010010) // PPU Max Sprites + { + COMBINE_DATA(&m_ppu.transrgb); + } + else if (addr == 0x0100d0) // Sprites buffer start + { + COMBINE_DATA(&m_ppu.sprite_buf_start); + } + else if (addr == 0x010020 || addr == 0x01003c || addr == 0x010058) // Text Layers x pos + { + int idx = (((offset>>3) & 3) | ((offset>>4) & 1)) - 1; + COMBINE_DATA(&m_ppu.txs[idx].posx); + } + else if (addr == 0x010024 || addr == 0x010040 || addr == 0x01005c) // Text Layers y pos + { + int idx = (((offset>>3) & 3) | ((offset>>4) & 1)) - 1; + COMBINE_DATA(&m_ppu.txs[idx].posy); + } + else if (addr == 0x010028 || addr == 0x010044 || addr == 0x010060) // Text Layers attribute + { + int idx = ((offset>>3) & 3) - 1; + COMBINE_DATA(&m_ppu.txs[idx].attribute); + } + else if (addr == 0x01002c || addr == 0x010048 || addr == 0x010064) // Text Layers control + { + int idx = ((offset>>3) & 3) - 1; + COMBINE_DATA(&m_ppu.txs[idx].control); + } + else if (addr == 0x010030 || addr == 0x01004c || addr == 0x010068) // Text Layers number ptr + { + int idx = ((offset>>3) & 3) - 1; + COMBINE_DATA(&m_ppu.txs[idx].nptr); + } + else if (addr == 0x010080) // PPU IRQ Control + { + COMBINE_DATA(&m_ppu.irq_control); + } + else if (addr == 0x010084) // PPU IRQ ack + { + if (ACCESSING_BITS_0_7) + m_ppu.irq_status &= ~data; + } + else if (addr >= 0x0100a0 && addr <= 0x0100a8) // Tx1 buffer start + { + COMBINE_DATA(&m_ppu.txs[0].buf_start[offset & 3]); + } + else if (addr >= 0x0100ac && addr <= 0x0100b4) // Tx2 buffer start + { + COMBINE_DATA(&m_ppu.txs[1].buf_start[(offset+1) & 3]); + } + else if (addr >= 0x0100b8 && addr <= 0x0100c0) // Tx3 buffer starts + { + COMBINE_DATA(&m_ppu.txs[2].buf_start[(offset+2) & 3]); + } + else if ((addr & 0xfff000) == 0x011000) // Palettes + { + COMBINE_DATA(&m_ppu.palettes[offset & 0x01ff]); + } + else if ((addr & 0xfff000) == 0x012000) // Tx horizontal offset + { + COMBINE_DATA(&m_ppu.tx_hoffset[offset & 0x01ff]); + } + else if ((addr & 0xfff000) == 0x013000) // Tx horizontal compression + { + COMBINE_DATA(&m_ppu.tx_hcomp[offset & 0x01ff]); + } + else if ((addr & 0xfff000) == 0x014000) // Sprite Control Registers + { + int idx = (offset>>1) & 0x1ff; + if (offset & 1) + COMBINE_DATA(&m_ppu.sprites[idx].attribute); + else + COMBINE_DATA(&m_ppu.sprites[idx].control); + } + else if (addr == 0x07005c) // MIU Status + { + COMBINE_DATA(&m_miu.status); + } + else if ((addr & 0xff0fff) == 0x160000) // Timer X Control 1 + { + int idx = (offset>>10) & 0x07; + COMBINE_DATA(&m_timers[idx].control); + + if (ACCESSING_BITS_24_31) + m_timers[idx].control &= ~(data & 0x04000000); // Timers IRQ ack + } + else if ((addr & 0xff0fff) == 0x160004) // Timer X Control 2 + { + int idx = (offset>>10) & 0x07; + COMBINE_DATA(&m_timers[idx].control2); + } + else if ((addr & 0xff0fff) == 0x160008) // Timer X Preload + { + int idx = (offset>>10) & 0x07; + COMBINE_DATA(&m_timers[idx].preload); + } + else if (addr == 0x2100e4) // Timer Source Clock Selection + { + const auto timers_clk = XTAL(27'000'000) / ((data & 0xff) + 1); + m_update_timer->adjust(attotime::from_hz(timers_clk), 0, attotime::from_hz(timers_clk)); + } + else if(addr == 0x130020) // I2C configuration + { + COMBINE_DATA(&m_i2c.config); + } + else if(addr == 0x130024) // I2C interrupt + { + COMBINE_DATA(&m_i2c.irq_control); + + if (ACCESSING_BITS_0_7) + m_i2c.irq_control &= ~(data & 0x00000001); // I2C IRQ ack + } + else if(addr == 0x130028) // I2C clock setting + { + COMBINE_DATA(&m_i2c.clock); + const auto i2c_clk = XTAL(27'000'000) / ((m_i2c.clock & 0x3ff) + 1); + m_i2c_timer->adjust(attotime::from_hz(i2c_clk), 0, attotime::from_hz(i2c_clk)); + } + else if(addr == 0x13002c) // I2C ID + { + COMBINE_DATA(&m_i2c.id); + } + else if(addr == 0x130030) // I2C port address + { + COMBINE_DATA(&m_i2c.port_addr); + } + else if(addr == 0x130034) // I2C write data + { + COMBINE_DATA(&m_i2c.wdata); + } + else if(addr == 0x130038) // I2C data data + { + COMBINE_DATA(&m_i2c.rdata); + } + else if(addr == 0x150000) // UART data + { + if (ACCESSING_BITS_0_7) + printf("%c", data & 0xff); + } + +#if LOG_SPG290_REGISTER_ACCESS + //else + { + if (!machine().side_effects_disabled()) + log_spg290_regs(this,(offset >> 14) & 0xff, (offset<<2) & 0xffff, mem_mask, true, data); + } +#endif +} + +inline uint32_t spg29x_game_state::spg290_read_mem(uint32_t offset) +{ + return m_maincpu->space(0).read_dword(offset); +} + +inline void spg29x_game_state::spg290_write_mem(uint32_t offset, uint32_t data) +{ + return m_maincpu->space(0).write_dword(offset, data); +} + +void spg29x_game_state::spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t argb) +{ + if (!(argb & 0x8000) && cliprect.contains(posx, posy)) + { + rgb_t color = rgb_t(pal5bit(argb >> 10), pal5bit(argb >> 5), pal5bit(argb >> 0)); + bitmap.pix32(posy, posx) = color; + } +} + +void spg29x_game_state::spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t rgb, uint32_t transrgb) +{ + if ((!(transrgb & 0x10000) || (transrgb & 0xffff) != rgb) && cliprect.contains(posx, posy)) + { + rgb_t color = rgb_t(pal5bit(rgb >> 11), pal6bit(rgb >> 5), pal5bit(rgb >> 0)); + bitmap.pix32(posy, posx) = color; + } +} + +void spg29x_game_state::spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, uint32_t *palettes, uint32_t buf_start) +{ + uint32_t sprite_base = buf_start + ((control & 0xffff) << 8); + uint16_t sprite_x = (control >> 16) & 0x3ff; + uint16_t sprite_y = (attribute >> 16) & 0x3ff; + uint8_t sprite_hsize = 8 << ((attribute >> 4) & 0x03); + uint8_t sprite_vsize = 8 << ((attribute >> 6) & 0x03); + uint8_t bit_pixel = ((attribute & 3) + 1) << 1; + uint8_t pixel_word = 32 / bit_pixel; + uint8_t word_line = sprite_hsize / pixel_word; + uint8_t sprite_flip = (attribute >> 2) & 0x03; + + for (int y=0; y < sprite_vsize; y++) + for (int x=0; x < word_line; x++) + { + uint32_t data = spg290_read_mem(sprite_base + (y * pixel_word + x) * 4); + + for (int b=0; b < pixel_word; b++) + { + uint16_t pen = ((data >> (b * bit_pixel)) & ((1 << bit_pixel) - 1)); + uint16_t posx; + if (sprite_flip & 0x01) + posx = sprite_x + (sprite_hsize - (x * word_line + b)); + else + posx = sprite_x + x * (word_line) + b; + + uint16_t posy; + if (sprite_flip & 0x02) + posy = sprite_y + (sprite_vsize - y); + else + posy = sprite_y + y; + + spg290_argb1555(bitmap, cliprect, posy, posx, palettes[pen]); + } + } +} + +void spg29x_game_state::spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb) +{ + for (int y=0; y<512; y++) + { + int line = (control & 0x04) ? 0 : y; + uint32_t tx_start = spg290_read_mem(nptr + (posy + line) * 4); + + for (int x=0; x < 1024>>1; x++) + { + uint32_t data = spg290_read_mem(buf_start + (tx_start + posx) * 2 + x * 4); + + for (int b=0; b < 2; b++) + { + uint16_t posx = x * 2 + b; + uint16_t posy = y; + uint16_t pix = (data >> (b*16)) & 0xffff; + + if (control & 0x0080) + spg290_argb1555(bitmap, cliprect, posy, posx, pix); + if (control & 0x1000) + spg290_rgb565(bitmap, cliprect, posy, posx, pix, transrgb); + } + } + } +} + +void spg29x_game_state::spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb) +{ + // TODO +} + + +uint32_t spg29x_game_state::spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + if (m_ppu.control & 0x1000) + { + for (int depth=0; depth<4; depth++) + { + // draw the bitmap/text layers + for (int l=0; l<3; l++) + if ((m_ppu.txs[l].control & 0x08) && ((m_ppu.txs[l].attribute >> 13) & 3) == depth) + { + if (m_ppu.txs[l].control & 0x01) + spg290_blit_bitmap(bitmap, cliprect, m_ppu.txs[l].control, m_ppu.txs[l].attribute, m_ppu.txs[l].posy & 0x1ff, m_ppu.txs[l].posx & 0x1ff, m_ppu.txs[l].nptr, m_ppu.txs[l].buf_start[0], m_ppu.transrgb); + else + spg290_blit_character(bitmap, cliprect, m_ppu.txs[l].control, m_ppu.txs[l].attribute, m_ppu.txs[l].posy & 0x1ff, m_ppu.txs[l].posx & 0x1ff, m_ppu.txs[l].nptr, m_ppu.txs[l].buf_start[0], m_ppu.transrgb); + } + + // draw the sprites + for (int i=0; i<=(m_ppu.sprite_max & 0x1ff); i++) + { + if (((m_ppu.sprites[i].attribute >> 13) & 3) == depth) + spg290_blit_sprite(bitmap, cliprect, m_ppu.sprites[i].control, m_ppu.sprites[i].attribute, m_ppu.palettes, m_ppu.sprite_buf_start); + } + } + } + else + { + bitmap.fill(rgb_t::black(), cliprect); + } + + return 0; +} + +void spg29x_game_state::spg290_timers_update() +{ + for(auto & elem : m_timers) + if (elem.control & 0x80000000) + { + if (((elem.control2 >> 30) & 0x03) == 0x00) + { + if (elem.counter == 0xffff) + { + elem.counter = elem.preload; + if (elem.control & 0x08000000) + { + elem.control |= 0x04000000; + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 56); // SCORE7 + } + } + else + elem.counter++; + } + else + { + // TODO: capture, comparison and PWM mode + + } + } +} + +WRITE_LINE_MEMBER(spg29x_game_state::spg290_vblank_irq) +{ + if (state && m_ppu.irq_control & 0x01) // VBlanking Start IRQ + { + m_ppu.irq_status |= 0x01; + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 53); // SCORE7 + } + else if (!state && m_ppu.irq_control & 0x02) // VBlanking End IRQ + { + m_ppu.irq_status |= 0x02; + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 53); // SCORE7 + } +} + + +void spg29x_game_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + switch (id) + { + case TIMER_SPG290: + spg290_timers_update(); + break; + case TIMER_I2C: + if ((m_i2c.config & 0x40) && (m_i2c.config & 0x01)) + { + // TODO: replace with real I2C emulation + m_i2c.rdata = 0; + + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 39); // SCORE7 + } + break; + } +} + +void spg29x_game_state::spg290_mem(address_map &map) +{ + map.global_mask(0x1fffffff); + map(0x00000000, 0x00ffffff).ram().mirror(0x07000000); + map(0x08000000, 0x09ffffff).rw(FUNC(spg29x_game_state::spg290_regs_r), FUNC(spg29x_game_state::spg290_regs_w)); + map(0x0a000000, 0x0a003fff).ram(); // internal SRAM + map(0x0b000000, 0x0b007fff).rom().region("spg290", 0); // internal ROM + map(0x10000000, 0x100fffff).rom().region("bios", 0).mirror(0x0e000000); + map(0x11000000, 0x110fffff).rom().region("bios", 0).mirror(0x0e000000); +} + +/* Input ports */ +static INPUT_PORTS_START( hyperscan ) +INPUT_PORTS_END + + +void spg29x_game_state::machine_start() +{ + m_update_timer = timer_alloc(TIMER_SPG290); + m_i2c_timer = timer_alloc(TIMER_I2C); +} + +void spg29x_game_state::machine_reset() +{ + memset(&m_ppu, 0, sizeof(spg290_ppu)); + memset(&m_miu, 0, sizeof(spg290_miu)); + memset(&m_i2c, 0, sizeof(m_i2c)); + m_i2c_timer->adjust(attotime::never, 0, attotime::never); + + // disable JTAG + m_maincpu->set_state_int(SCORE_CR + 29, 0x20000000); +} + + +void spg29x_game_state::hyperscan(machine_config &config) +{ + /* basic machine hardware */ + SCORE7(config, m_maincpu, XTAL(27'000'000) * 4); // 108MHz S+core 7 + m_maincpu->set_addrmap(AS_PROGRAM, &spg29x_game_state::spg290_mem); + + SOFTWARE_LIST(config, "cd_list").set_original("hyperscan"); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(50); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_screen_update(FUNC(spg29x_game_state::spg290_screen_update)); + screen.set_size(640, 480); + screen.set_visarea(0, 640-1, 0, 480-1); + screen.screen_vblank().set(FUNC(spg29x_game_state::spg290_vblank_irq)); +} + + + +void spg29x_nand_game_state::nand_init(int blocksize, int blocksize_stripped) +{ + uint8_t* rom = memregion("nand")->base(); + int size = memregion("nand")->bytes(); + + int numblocks = size / blocksize; + + m_strippedrom.resize(numblocks * blocksize_stripped); + + for (int i = 0; i < numblocks; i++) + { + const int base = i * blocksize; + const int basestripped = i * blocksize_stripped; + + for (int j = 0; j < blocksize_stripped; j++) + { + m_strippedrom[basestripped + j] = rom[base + j]; + } + } + + // debug to allow for easy use of unidasm.exe + if (0) + { + FILE *fp; + char filename[256]; + sprintf(filename,"stripped_%s", machine().system().name); + fp=fopen(filename, "w+b"); + if (fp) + { + fwrite(&m_strippedrom[0], blocksize_stripped * numblocks, 1, fp); + fclose(fp); + } + } +} + +void spg29x_nand_game_state::nand_init210() +{ + nand_init(0x210, 0x200); +} + + +/* ROM definition */ +ROM_START( hyprscan ) + ROM_REGION( 0x100000, "bios", ROMREGION_32BIT | ROMREGION_LE ) + ROM_LOAD32_DWORD("hyperscan.bin", 0x000000, 0x100000, CRC(ce346a14) SHA1(560cb747e7193e6781d4b8b0bd4d7b45d3d28690)) + + ROM_REGION( 0x008000, "spg290", ROMREGION_32BIT | ROMREGION_LE ) + ROM_LOAD32_DWORD("spg290.bin", 0x000000, 0x008000, NO_DUMP) // 256Kbit SPG290 internal ROM +ROM_END + +ROM_START( jak_bbsf ) + ROM_REGION( 0x100000, "bios", ROMREGION_32BIT | ROMREGION_LE | ROMREGION_ERASE00 ) + + ROM_REGION( 0x4200000, "nand", 0 ) + ROM_LOAD("bigbucksafari.bin", 0x000000, 0x4200000, CRC(dc5f9bf1) SHA1(27893c396d62f353ced52ef88fd9ade5c051598f) ) + + ROM_REGION( 0x008000, "spg290", ROMREGION_32BIT | ROMREGION_LE ) + ROM_LOAD32_DWORD("internal.rom", 0x000000, 0x008000, NO_DUMP) +ROM_END + + +/* Driver */ + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 2006, hyprscan, 0, 0, hyperscan, hyperscan, spg29x_game_state, empty_init, "Mattel", "HyperScan", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) + +COMP( 2009, jak_bbsf, 0, 0, hyperscan, hyperscan, spg29x_nand_game_state, nand_init210, "JAKKS Pacific Inc", "Big Buck Hunter Safari (JAKKS Pacific TV Game)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) + + diff --git a/src/mame/drivers/spg29x_lexibook_jg7425.cpp b/src/mame/drivers/spg29x_lexibook_jg7425.cpp new file mode 100644 index 00000000000..c8fecbcb964 --- /dev/null +++ b/src/mame/drivers/spg29x_lexibook_jg7425.cpp @@ -0,0 +1,109 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + + +/* + +a 221 games console which uses a 4GB sd-card for gamestorage and a MX29LV160 flashrom for the internal bios. (only 512kb are used from the 2mb romspace) +Starting the console without SD-Card just show's a looping video with "Please insert Memory Card". + +SD card image produced with WinHex (hardware write blocker used to prevent Windows from corrupting data) +compressed with "chdman createhd -i 4GBSD.img -o lexibook_jg7425_4gbsd.chd" (is this correct?) + +TODO: +is there an internal ROM / bootstrap area, or does this SunPlus core use vectors in a different way to the one in hyperscan.cpp? +If SPG290, should probably be merged with hyperscan.cpp + +(only noteworthy features of PCB are ROM + RAM + Cpu Glob) + +*/ + +#include "emu.h" +#include "screen.h" +#include "cpu/score/score.h" + +class lexibook_jg7425_state : public driver_device +{ +public: + lexibook_jg7425_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_mainram(*this, "mainram"), + m_romregion(*this, "maincpu") + { } + + void lexibook_jg7425(machine_config &config); + + void map(address_map& map); + +protected: + uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); + +private: + virtual void machine_start() override; + virtual void machine_reset() override; + + required_device m_maincpu; + required_device m_screen; + required_shared_ptr m_mainram; + required_region_ptr m_romregion; +}; + + + +void lexibook_jg7425_state::machine_start() +{ + // I think this code should be running from RAM at least, probably some kind of bootstrap / internal ROM to copy it? (hyperscan.cpp indicates that SoC can have internal ROM at least) + + // first 0x20 bytes are probably pointers, code starts at 0x20 and is offset, maps at 0x500000 + + for (int i = 0; i < 0x80000 / 4; i++) + { + m_mainram[i+(0x500000/4) - (0x20/4)] = m_romregion[i]; + } +} + +void lexibook_jg7425_state::machine_reset() +{ +} + +static INPUT_PORTS_START( lexibook_jg7425 ) +INPUT_PORTS_END + + +uint32_t lexibook_jg7425_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void lexibook_jg7425_state::map(address_map &map) +{ + map(0x00000000, 0x00ffffff).ram().share("mainram"); + + map(0x9f000000, 0x9fffffff).ram().share("mainram"); +} + + +void lexibook_jg7425_state::lexibook_jg7425(machine_config &config) +{ + /* basic machine hardware */ + SCORE7(config, m_maincpu, XTAL(27'000'000) * 4); // ? not certain on exact type + m_maincpu->set_addrmap(AS_PROGRAM, &lexibook_jg7425_state::map); + + 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(lexibook_jg7425_state::screen_update)); +} + +ROM_START( lx_jg7425 ) + ROM_REGION( 0x200000, "maincpu", ROMREGION_32BIT | ROMREGION_LE ) + ROM_LOAD32_DWORD( "mx29lv160.u6", 0x000000, 0x200000, CRC(43c90080) SHA1(4c9e5c8f880d40bd684357ce67ae45c3f5d24b62) ) + + DISK_REGION( "ata:0:hdd:image" ) /* 4GB SD Card */ + DISK_IMAGE( "lexibook_jg7425_4gbsd", 0, SHA1(dc0985103edec3992efdd493feef6185daedb3fd) ) +ROM_END + +CONS( 2015, lx_jg7425, 0, 0, lexibook_jg7425, lexibook_jg7425, lexibook_jg7425_state, empty_init, "Lexibook", "Lexibook JG7425 221-in-1", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/spg2xx.cpp b/src/mame/drivers/spg2xx.cpp index 305528ef205..84879259611 100644 --- a/src/mame/drivers/spg2xx.cpp +++ b/src/mame/drivers/spg2xx.cpp @@ -691,7 +691,7 @@ static INPUT_PORTS_START( guitarfv ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Wheel") // 'Wheel' + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Wheel / Whammy") // 'Wheel' in test mode PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused? @@ -702,6 +702,27 @@ static INPUT_PORTS_START( guitarfv ) PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused? INPUT_PORTS_END +static INPUT_PORTS_START( guitarss ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B1: Blue / Up") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B2: ellow / Down") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("B3: Purple") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("B4: Red") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("B5: Green") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Strum / Select") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) // unused? no Strum down? + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Whammy") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Start / Select") // pause + PORT_BIT( 0xfe00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // unused? + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // unused? + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // unused? + +INPUT_PORTS_END + static INPUT_PORTS_START( jjstrip ) PORT_START("P1") // active LOW or HIGH? PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) @@ -1074,6 +1095,12 @@ ROM_START( guitarfv ) ROM_LOAD16_WORD_SWAP( "mx26l64.bin", 0x000000, 0x800000, CRC(eaadd2c2) SHA1(0c3fe004dbaa52a335c6ddcecb9e9f5582d7ef35) ) ROM_END +ROM_START( guitarss ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "guitar_superstar_stratocaster.bin", 0x000000, 0x800000, CRC(63950016) SHA1(28b9613571f47c49995aa35c4d4a2d6f68389813) ) +ROM_END + + ROM_START( jjstrip ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "strippoker.bin", 0x000000, 0x200000, CRC(7a70e6c8) SHA1(3d5da4774b00977939f309f3e71473dde9b70435) ) @@ -1143,6 +1170,9 @@ CONS( 200?, decathln, 0, 0, tvsprt10, decathln, spg2xx_ga CONS( 2007, guitarfv, 0, 0, guitarfv, guitarfv, spg2xx_game_state, empty_init, "Advance Bright Ltd", "Guitar Fever (2007.07.03 Ver 2.7)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +// Another version of this has a red "Gibson Flying V" style controller. The difference is reflected on the title screen, songs are the same. +CONS( 200?, guitarss, 0, 0, abltenni, guitarss, spg2xx_game_state, empty_init, "Senario", "Guitar Super Star (Fender Stratocaster style)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + CONS( 200?, jjstrip, 0, 0, tvsprt10, jjstrip, spg2xx_game_state, empty_init, "Shiggles Inc.", "Club Jenna Presents: Jenna Jameson's Strip Poker", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) CONS( 2005, tmntmutm, 0, 0, tvsprt10, tmntmutm, spg2xx_game_state, empty_init, "Tech2Go / WayForward", "Teenage Mutant Ninja Turtles: Mutant and Monster Mayhem", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_jakks.cpp b/src/mame/drivers/spg2xx_jakks.cpp index 46bbd408382..5d8152c8b8e 100644 --- a/src/mame/drivers/spg2xx_jakks.cpp +++ b/src/mame/drivers/spg2xx_jakks.cpp @@ -40,6 +40,8 @@ public: void jakks_gkr_wp(machine_config &config); void jakks_gkr_cb(machine_config &config); + void jakks_tvtouch(machine_config& config); + DECLARE_READ_LINE_MEMBER(i2c_gkr_r); protected: @@ -456,6 +458,155 @@ static INPUT_PORTS_START( jak_dpr_i2c ) INPUT_PORTS_END +static INPUT_PORTS_START( tvtouch ) + PORT_START("P1") + PORT_DIPNAME( 0x0001, 0x0001, "P1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P2") + PORT_DIPNAME( 0x0001, 0x0001, "P2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("P3") + PORT_DIPNAME( 0x0001, 0x0001, "P3" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // might not only be a button input, check code + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END void jakks_gkr_state::jakks(machine_config &config) @@ -625,8 +776,6 @@ void jakks_gkr_state::jakks_gkr_wf_i2c(machine_config &config) //SOFTWARE_LIST(config, "jakks_gamekey_wf").set_original("jakks_gamekey_wf"); // no game keys were released } - - void jakks_gkr_state::walle(machine_config &config) { jakks_i2c(config); @@ -635,6 +784,22 @@ void jakks_gkr_state::walle(machine_config &config) m_maincpu->portc_out().set(FUNC(jakks_gkr_state::walle_portc_w)); } +void jakks_gkr_state::jakks_tvtouch(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_4m); + + spg2xx_base(config); + + m_maincpu->porta_in().set(FUNC(jakks_gkr_state::rad_porta_r)); + m_maincpu->portb_in().set(FUNC(jakks_gkr_state::rad_portb_r)); + m_maincpu->portc_in().set(FUNC(jakks_gkr_state::rad_portc_r)); +} + +ROM_START( tvtchsw ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "touchstarwars.bin", 0x000000, 0x400000, CRC(db5ccc31) SHA1(786af933ef1fb644faf8eed935c448b93296bc33) ) +ROM_END ROM_START( jak_batm ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) @@ -782,3 +947,6 @@ CONS( 2005, jak_pooh, 0, 0, jakks_gkr_wp, jak_pooh, jakks_gkr_state, emp CONS( 2005, jak_care, 0, 0, jakks_gkr_cb, jak_care, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Backbone Entertainment", "Care Bears TV Games (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // CB (no game-keys released) // Some versions of the Shrek - Over the Hedge unit show the GameKey logo on startup (others don't) there is no evidence to suggest it was ever released with a GameKey port tho, and the internal PCB has no place for one on the versions we've seen (which show the logo) + +// TV Touch Games (these are re-release versions of classic JAKKS games but using a touchpad controller) +CONS( 2012, tvtchsw, 0, 0, jakks_tvtouch, tvtouch, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Code Mystics", "TV Touch Games: Star Wars Original Trilogy", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_lexibook.cpp b/src/mame/drivers/spg2xx_lexibook.cpp index 3257dc86bc3..3e0816841c1 100644 --- a/src/mame/drivers/spg2xx_lexibook.cpp +++ b/src/mame/drivers/spg2xx_lexibook.cpp @@ -264,4 +264,4 @@ ROM_END CONS( 200?, lexizeus, 0, 0, lexizeus, lexizeus, spg2xx_lexiseal_game_state, init_zeus, "Lexibook", "Zeus IG900 20-in-1 (US?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad sound and some corrupt bg tilemap entries in Tiger Rescue, verify ROM data (same game runs in Zone 60 without issue) CONS( 200?, lexiseal, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Lexibook / Sit Up Limited", "Seal 50-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // also has bad sound in Tiger Rescue, but no corrupt tilemap CONS( 200?, discpal, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Performance Designed Products / Disney / Jungle Soft", "Disney Game It! Classic Pals", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -// there was also a Game It! Princess Pals \ No newline at end of file +// there was also a Game It! Princess Pals diff --git a/src/mame/drivers/spg2xx_mysprtch.cpp b/src/mame/drivers/spg2xx_mysprtch.cpp index 49c07f28e6a..2560c024156 100644 --- a/src/mame/drivers/spg2xx_mysprtch.cpp +++ b/src/mame/drivers/spg2xx_mysprtch.cpp @@ -23,13 +23,13 @@ public: protected: virtual void machine_start() override; virtual void machine_reset() override; - + void mem_map_mysprtch(address_map& map); virtual DECLARE_WRITE16_MEMBER(porta_w) override; int m_romsize; - + int m_mysprtch_rombase; uint16_t m_prev_porta; int m_bank_enabled; @@ -71,7 +71,7 @@ void spg2xx_game_mysprtch_state::machine_start() spg2xx_game_state::machine_start(); m_romsize = (memregion("maincpu")->bytes()/2); - + save_item(NAME(m_mysprtch_rombase)); save_item(NAME(m_prev_porta)); save_item(NAME(m_bank_enabled)); @@ -290,7 +290,7 @@ WRITE16_MEMBER(spg2xx_game_mysprtch24_state::porta_w) // probably should be the same logic for both games, as the test mode on this one proves // that the logic in spg2xx_game_mysprtch_state::porta_w is incorrect - if (m_maincpu->pc() < 0x4000) + if (m_maincpu->pc() < 0x4000) { int bank = 0; bank |= (data & 0x0400) ? 1 : 0; @@ -302,7 +302,7 @@ WRITE16_MEMBER(spg2xx_game_mysprtch24_state::porta_w) m_prev_porta = data; } - + void spg2xx_game_mysprtch_state::mysprtch(machine_config& config) { @@ -337,10 +337,10 @@ void spg2xx_game_mysprtch_state::init_mysprtcp() for (int i = 0; i < size / 2; i++) { ROM[i] = bitswap<16>(ROM[i], 15, 13, 14, 12, - 7, 6, 5, 4, - 11, 10, 9, 8, - 3, 1, 2, 0); - + 7, 6, 5, 4, + 11, 10, 9, 8, + 3, 1, 2, 0); + ROM[i] = ROM[i] ^ 0xfafa; } } diff --git a/src/mame/drivers/spg2xx_zone.cpp b/src/mame/drivers/spg2xx_zone.cpp index 1ad736d7db0..4616d8502f7 100644 --- a/src/mame/drivers/spg2xx_zone.cpp +++ b/src/mame/drivers/spg2xx_zone.cpp @@ -120,7 +120,7 @@ WRITE16_MEMBER(zone40_state::zone40_porta_w) //logerror("%s: zone40_porta_w %04x z80 bank is now %04x \n", machine().describe_context(), data, m_z40_rombase); m_maincpu->invalidate_cache(); - + } READ16_MEMBER(zone40_state::zone40_porta_r) @@ -276,7 +276,7 @@ void zone40_state::init_zone40() { ROM[i] = bitswap<16>(ROM[i], 11, 10, 3, 2, 4, 12, 5, 13, 9, 1, 8, 0, 6, 7, 14, 15); - + ROM[i] = ROM[i] ^ 0xa5a5; } } @@ -290,7 +290,7 @@ void zone40_state::init_reactmd() for (int i = 0; i < size/2; i++) { ROM[i] = bitswap<16>(ROM[i], 15, 13, 14, 12, 7, 6, 5, 4, - 11, 10, 9, 8, 3, 1, 2, 0); + 11, 10, 9, 8, 3, 1, 2, 0); ROM[i] = ROM[i] ^ 0xa5a5; } @@ -352,7 +352,7 @@ CONS( 2011, lx_jg7415,0, 0, wireless60, wirels60, wireless60_state, init_lx_jg7 // Two systems in one unit - Genesis on a Chip and SunPlus, only the SunPlus part is currently emulated. Genesis on a chip is a very poor implementation with many issues on real hardware. -// This should actually boot to a menu on the MD size, with the SunPlus only being enabled if selected from that menu. MD side menu runs in some enhanced / custom MD mode tho. +// This should actually boot to a menu on the MD size, with the SunPlus only being enabled if selected from that menu. MD side menu runs in some enhanced / custom MD mode tho. // Badminton hangs, as it does in the 49-in-1 above CONS( 2009, reactmd, 0, 0, zone40p, wirels60, zone40_state, init_reactmd, "AtGames / Sega", "Reactor MD (PAL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/sunplus_gcm394.cpp b/src/mame/drivers/sunplus_gcm394.cpp deleted file mode 100644 index a2131a05183..00000000000 --- a/src/mame/drivers/sunplus_gcm394.cpp +++ /dev/null @@ -1,1813 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/* - SunPlus unSP based hardware, SPG-??? (6xx?) (die is GCM394) - - Compared to vii.cpp this is clearly newer, has extra opcodes, different internal map etc. also scaling and higher resolutions based on Spongebob - - note, these SoC types always have a 128Kwords internal ROM, which the JAKKS games appear to use for basic bootstrap purposes. - - GPAC800 / GCM394 (SpongeBob Bikini Bottom 500 Test Mode also calls this GPAC800, even if the mappings appear different to the NAND version below - different CS base, maybe just depends on boot mode?) - Smart Fit Park - SpongeBob SquarePants Bikini Bottom 500 - Spiderman - The Masked Menace 'Spider Sense' (pad type with Spiderman model) - (Wireless Hunting? - maybe, register map looks the same even if it sets stack to 2fff not 6fff) - - GPAC800 (with NAND support) - Wireless Air 60 - Golden Tee Golf - Cars 2 - Toy Story Mania - V.Baby - Playskool Heroes Transformers Rescue Bots Beam Box - - GPAC500 (based on test modes, unknown hardware, might be GPAC800 but without the higher resolution support?) - The Price is Right - Bejeweled? (might be GPAC800) - - Notes - smartfp: hold button Circle, Star and Home on startup for Test Menu - - these are all unsp 2.0 type, as they use the extended ocpodes - - - NAND types: - - Toy Story Mania H27U518S2C dumped as HY27US08121A (512+16) x 32 x 4096 - Beam Box GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 - Golden Tee GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 - Cars 2 GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 - - V.Baby HY27UF081G2A (2048+64) x 64 x 1024 - -*/ - -#include "emu.h" - -#include "machine/sunplus_gcm394.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" - -#include "screen.h" -#include "speaker.h" - - - - -class full_memory_device : - public device_t, - public device_memory_interface -{ -public: - // construction/destruction - full_memory_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); - - // configuration helpers - template full_memory_device& set_map(T &&... args) { set_addrmap(0, std::forward(args)...); return *this; } - - template full_memory_device& map(T &&... args) { set_addrmap(0, std::forward(args)...); return *this; } - - address_space* get_program() { return m_program; } - -protected: - virtual void device_start() override; - virtual void device_config_complete() override; - - // device_memory_interface overrides - virtual space_config_vector memory_space_config() const override; - - -private: - // internal state - address_space_config m_program_config; - address_space *m_program; -}; - - -// device type definition -DECLARE_DEVICE_TYPE(FULL_MEMORY, full_memory_device) - -// device type definition -DEFINE_DEVICE_TYPE(FULL_MEMORY, full_memory_device, "full_memory", "SunPlus Full CS Memory Map") - -full_memory_device::full_memory_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - device_t(mconfig, FULL_MEMORY, tag, owner, clock), - device_memory_interface(mconfig, *this), - m_program(nullptr) -{ -} - -device_memory_interface::space_config_vector full_memory_device::memory_space_config() const -{ - return space_config_vector { - std::make_pair(AS_PROGRAM, &m_program_config) - }; -} - -/* -':maincpu' (00F87F):possible DMA operation (7abf) (trigger 0001) with params mode:4009 source:00040000 (word offset) dest:00830000 (word offset) length:00007800 (words) -':maincpu' (002384):possible DMA operation (7abf) (trigger 0001) with params mode:0009 source:00180000 (word offset) dest:00840000 (word offset) length:00160000 (words) - -':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:000025bc (word offset) length:000001e0 (words) -':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:000024cc (word offset) length:000000f0 (words) -':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000002 (word offset) length:00000400 (words) -':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000402 (word offset) length:00000400 (words) -':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000802 (word offset) length:00000400 (words) - -gtg -':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030000 (word offset) length:00000200 (words) -':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030100 (word offset) length:00000200 (words) -':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030200 (word offset) length:00000200 (words) -':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030300 (word offset) length:00000200 (words) -':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030400 (word offset) length:00000200 (words) - -*/ - -void full_memory_device::device_config_complete() -{ - m_program_config = address_space_config( "program", ENDIANNESS_BIG, 16, 32, -1 ); -} - -void full_memory_device::device_start() -{ - m_program = &space(AS_PROGRAM); -} - - -class gcm394_game_state : public driver_device -{ -public: - gcm394_game_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_io(*this, "IN%u", 0U), - m_romregion(*this, "maincpu"), - m_memory(*this, "memory") - { - } - - void base(machine_config &config); - - void cs_map_base(address_map &map); - - virtual DECLARE_READ16_MEMBER(cs0_r); - virtual DECLARE_WRITE16_MEMBER(cs0_w); - virtual DECLARE_READ16_MEMBER(cs1_r); - virtual DECLARE_WRITE16_MEMBER(cs1_w); - virtual DECLARE_READ16_MEMBER(cs2_r); - virtual DECLARE_WRITE16_MEMBER(cs2_w); - virtual DECLARE_READ16_MEMBER(cs3_r); - virtual DECLARE_WRITE16_MEMBER(cs3_w); - virtual DECLARE_READ16_MEMBER(cs4_r); - virtual DECLARE_WRITE16_MEMBER(cs4_w); - - void cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - - required_device m_maincpu; - required_device m_screen; - - - required_ioport_array<3> m_io; - - - optional_region_ptr m_romregion; - required_device m_memory; - - virtual DECLARE_READ16_MEMBER(porta_r); - virtual DECLARE_READ16_MEMBER(portb_r); - virtual DECLARE_READ16_MEMBER(portc_r); - virtual DECLARE_WRITE16_MEMBER(porta_w); - - virtual DECLARE_READ16_MEMBER(read_external_space); - virtual DECLARE_WRITE16_MEMBER(write_external_space); - -private: -}; - -READ16_MEMBER(gcm394_game_state::cs0_r) -{ - return m_romregion[offset & 0x3fffff]; -} - -WRITE16_MEMBER(gcm394_game_state::cs0_w) -{ - logerror("cs0_w %04x %04x (to ROM!)\n", offset, data); -} - -READ16_MEMBER(gcm394_game_state::cs1_r) { logerror("cs1_r %06n", offset); return 0x0000; } -WRITE16_MEMBER(gcm394_game_state::cs1_w) { logerror("cs1_w %06x %04x\n", offset, data); } -READ16_MEMBER(gcm394_game_state::cs2_r) { logerror("cs2_r %06n", offset); return 0x0000; } -WRITE16_MEMBER(gcm394_game_state::cs2_w) { logerror("cs2_w %06x %04x\n", offset, data); } -READ16_MEMBER(gcm394_game_state::cs3_r) { logerror("cs3_r %06n", offset); return 0x0000; } -WRITE16_MEMBER(gcm394_game_state::cs3_w) { logerror("cs3_w %06x %04x\n", offset, data); } -READ16_MEMBER(gcm394_game_state::cs4_r) { logerror("cs4_r %06n", offset); return 0x0000; } -WRITE16_MEMBER(gcm394_game_state::cs4_w) { logerror("cs4_w %06x %04x\n", offset, data); } - - -/* - map info (NAND type) - - map(0x000000, 0x006fff) internal RAM - map(0x007000, 0x007fff) internal peripherals - map(0x008000, 0x00ffff) internal ROM (lower 32kwords) - can also be configured to mirror CS0 308000 area with external pin for boot from external ROM - map(0x010000, 0x027fff) internal ROM (upper 96kwords) - can't be switched - map(0x028000, 0x02ffff) reserved - - map(0x030000, 0x0.....) view into external spaces (CS0 area starts here. followed by CS1 area, CS2 area etc.) - - map(0x200000, 0x3fffff) continued view into external spaces, but this area is banked with m_membankswitch_7810 (valid bank values 0x00-0x3f) -*/ - - - -void gcm394_game_state::cs_map_base(address_map& map) -{ -} - - -class generalplus_gpac800_game_state : public gcm394_game_state -{ -public: - generalplus_gpac800_game_state(const machine_config& mconfig, device_type type, const char* tag) : - gcm394_game_state(mconfig, type, tag), - m_nandregion(*this, "nandrom"), - m_initial_copy_words(0x2000) - { - } - - void generalplus_gpac800(machine_config &config); - - void nand_init210(); - void nand_init840(); - void nand_wlsair60(); - void nand_vbaby(); - void nand_tsm(); - void nand_beambox(); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - DECLARE_READ8_MEMBER(read_nand); - std::vector m_sdram; - std::vector m_sdram2; - - virtual DECLARE_READ16_MEMBER(cs0_r) override; - virtual DECLARE_WRITE16_MEMBER(cs0_w) override; - virtual DECLARE_READ16_MEMBER(cs1_r) override; - virtual DECLARE_WRITE16_MEMBER(cs1_w) override; - -private: - optional_region_ptr m_nandregion; - - void nand_create_stripped_region(); - - std::vector m_strippedrom; - int m_strippedsize; - int m_size; - int m_nandblocksize; - int m_nandblocksize_stripped; - - int m_initial_copy_words; - int m_vectorbase; -}; - -class generalplus_gpac800_vbaby_game_state : public generalplus_gpac800_game_state -{ -public: - generalplus_gpac800_vbaby_game_state(const machine_config& mconfig, device_type type, const char* tag) : - generalplus_gpac800_game_state(mconfig, type, tag), - m_cart(*this, "cartslot") - { - } - - void generalplus_gpac800_vbaby(machine_config &config); - -protected: - required_device m_cart; - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); - -private: -}; - - -class generalplus_gpspispi_game_state : public gcm394_game_state -{ -public: - generalplus_gpspispi_game_state(const machine_config& mconfig, device_type type, const char* tag) : - gcm394_game_state(mconfig, type, tag) - { - } - - void generalplus_gpspispi(machine_config &config); - - void init_spi(); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - -private: -}; - - - -class generalplus_gpspispi_bkrankp_game_state : public generalplus_gpspispi_game_state -{ -public: - generalplus_gpspispi_bkrankp_game_state(const machine_config& mconfig, device_type type, const char* tag) : - generalplus_gpspispi_game_state(mconfig, type, tag), - m_cart(*this, "cartslot") - { - } - - void generalplus_gpspispi_bkrankp(machine_config &config); - -protected: - required_device m_cart; - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); - -private: -}; - - - -class tkmag220_game_state : public gcm394_game_state -{ -public: - tkmag220_game_state(const machine_config& mconfig, device_type type, const char* tag) : - gcm394_game_state(mconfig, type, tag) - { - } - - void tkmag220(machine_config &config); - -protected: - - /* - virtual DECLARE_READ16_MEMBER(porta_r) override - { - return machine().rand(); - } - - virtual DECLARE_READ16_MEMBER(portb_r) override - { - return machine().rand(); - } - - virtual DECLARE_WRITE16_MEMBER(porta_w) override - { - } - */ - -private: - - virtual DECLARE_READ16_MEMBER(cs0_r) override - { - return m_romregion[offset & 0x3ffffff]; - } -}; - -class wrlshunt_game_state : public gcm394_game_state -{ -public: - wrlshunt_game_state(const machine_config& mconfig, device_type type, const char* tag) : - gcm394_game_state(mconfig, type, tag) - { - } - - void wrlshunt(machine_config &config); - - void init_wrlshunt(); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - - std::vector m_sdram; - - virtual DECLARE_READ16_MEMBER(porta_r) override; - virtual DECLARE_WRITE16_MEMBER(porta_w) override; - -private: - - - //required_shared_ptr m_mainram; - - virtual DECLARE_READ16_MEMBER(cs0_r) override; - virtual DECLARE_WRITE16_MEMBER(cs0_w) override; - virtual DECLARE_READ16_MEMBER(cs1_r) override; - virtual DECLARE_WRITE16_MEMBER(cs1_w) override; -}; - -class jak_s500_game_state : public wrlshunt_game_state -{ -public: - jak_s500_game_state(const machine_config& mconfig, device_type type, const char* tag) : - wrlshunt_game_state(mconfig, type, tag) - { - } - -protected: - //virtual void machine_start() override; - virtual void machine_reset() override; - - virtual DECLARE_READ16_MEMBER(porta_r) override; - virtual DECLARE_READ16_MEMBER(portb_r) override; - -private: -}; - - - - -READ16_MEMBER(wrlshunt_game_state::cs0_r) -{ - return m_romregion[offset & 0x3ffffff]; -} - -WRITE16_MEMBER(wrlshunt_game_state::cs0_w) -{ - logerror("cs0_w write to ROM?\n"); - //m_romregion[offset & 0x3ffffff] = data; -} - -READ16_MEMBER(wrlshunt_game_state::cs1_r) -{ - return m_sdram[offset & 0x3fffff]; -} - -WRITE16_MEMBER(wrlshunt_game_state::cs1_w) -{ - m_sdram[offset & 0x3fffff] = data; -} - - -void wrlshunt_game_state::machine_start() -{ - save_item(NAME(m_sdram)); -} - -void wrlshunt_game_state::machine_reset() -{ - cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); - m_maincpu->set_cs_space(m_memory->get_program()); - m_maincpu->reset(); // reset CPU so vector gets read etc. - - m_maincpu->set_paldisplaybank_high_hack(1); - m_maincpu->set_alt_tile_addressing_hack(1); -} - -READ16_MEMBER(jak_s500_game_state::porta_r) -{ - uint16_t data = m_io[0]->read(); - logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); - - //address_space& mem = m_maincpu->space(AS_PROGRAM); - - //if (mem.read_word(0x22b408) == 0x4846) - // mem.write_word(0x22b408, 0x4840); // jak_s500 force service mode - - //if (mem.read_word(0x236271) == 0x4846) - // mem.write_word(0x236271, 0x4840); // jak_totm force service mode - - return data; -} - -READ16_MEMBER(jak_s500_game_state::portb_r) -{ - uint16_t data = m_io[1]->read(); - logerror("%s: Port B Read: %04x\n", machine().describe_context(), data); - return data; -} - - -void jak_s500_game_state::machine_reset() -{ - cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); - m_maincpu->set_cs_space(m_memory->get_program()); - m_maincpu->reset(); // reset CPU so vector gets read etc. - - m_maincpu->set_paldisplaybank_high_hack(0); - m_maincpu->set_alt_tile_addressing_hack(1); -} - - -void generalplus_gpspispi_game_state::machine_start() -{ -} - -void generalplus_gpspispi_game_state::machine_reset() -{ - m_maincpu->reset(); // reset CPU so vector gets read etc. - - m_maincpu->set_paldisplaybank_high_hack(0); - m_maincpu->set_alt_tile_addressing_hack(1); -} - - - -void wrlshunt_game_state::init_wrlshunt() -{ - m_sdram.resize(0x400000); // 0x400000 bytes, 0x800000 words -} - -READ16_MEMBER(generalplus_gpac800_game_state::cs0_r) -{ - return m_sdram2[offset & 0xffff]; -} - -WRITE16_MEMBER(generalplus_gpac800_game_state::cs0_w) -{ - m_sdram2[offset & 0xffff] = data; -} - -READ16_MEMBER(generalplus_gpac800_game_state::cs1_r) -{ - return m_sdram[offset & 0x3fffff]; -} - -WRITE16_MEMBER(generalplus_gpac800_game_state::cs1_w) -{ - m_sdram[offset & 0x3fffff] = data; -} - -READ8_MEMBER(generalplus_gpac800_game_state::read_nand) -{ - if (!m_nandregion) - return 0x0000; - - return (offset < m_size) ? m_nandregion[offset] : 0xFF; - //return m_strippedrom[offset & (m_strippedsize - 1)]; -} - -READ16_MEMBER(gcm394_game_state::read_external_space) -{ - return m_memory->get_program()->read_word(offset); -} - -WRITE16_MEMBER(gcm394_game_state::write_external_space) -{ - m_memory->get_program()->write_word(offset, data); -} - -READ16_MEMBER(gcm394_game_state::porta_r) -{ - uint16_t data = m_io[0]->read(); - logerror("Port A Read: %04x\n", data); - return data; -} - -READ16_MEMBER(gcm394_game_state::portb_r) -{ - uint16_t data = m_io[1]->read(); - logerror("Port B Read: %04x\n", data); - return data; -} - -READ16_MEMBER(gcm394_game_state::portc_r) -{ - uint16_t data = m_io[2]->read(); - logerror("Port C Read: %04x\n", data); - return data; -} - -WRITE16_MEMBER(gcm394_game_state::porta_w) -{ - logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); -} - -// some sources indicate these later SoC types run at 96Mhz, others indicate 48Mhz. -// unSP 2.0 CPUs have a lower average CPI too (2 instead of 6 on unSP 1.0 or 5 on unSP 1.1 / 1.2 / unSP 2.0) so using regular unSP timings might result in things being too slow -// as with the older SunPlus chips this appears to be an fully internally generated frequency, external XTALs again are typically 6MHz or simply not present. - -void gcm394_game_state::base(machine_config &config) -{ - GCM394(config, m_maincpu, 96000000/2, m_screen); - m_maincpu->porta_in().set(FUNC(gcm394_game_state::porta_r)); - m_maincpu->portb_in().set(FUNC(gcm394_game_state::portb_r)); - m_maincpu->portc_in().set(FUNC(gcm394_game_state::portc_r)); - m_maincpu->porta_out().set(FUNC(gcm394_game_state::porta_w)); - m_maincpu->space_read_callback().set(FUNC(gcm394_game_state::read_external_space)); - m_maincpu->space_write_callback().set(FUNC(gcm394_game_state::write_external_space)); - m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); - m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); - m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); - m_maincpu->set_bootmode(1); // boot from external ROM / CS mirror - m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); - - FULL_MEMORY(config, m_memory).set_map(&gcm394_game_state::cs_map_base); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_size(320*2, 262*2); - m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); - m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); - m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); - - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); -} - -void wrlshunt_game_state::wrlshunt(machine_config &config) -{ - gcm394_game_state::base(config); -} - -void tkmag220_game_state::tkmag220(machine_config &config) -{ - gcm394_game_state::base(config); - - m_maincpu->porta_in().set_ioport("IN0"); - m_maincpu->portb_in().set_ioport("IN1"); - m_maincpu->portc_in().set_ioport("IN2"); -} - - -READ16_MEMBER(wrlshunt_game_state::porta_r) -{ - uint16_t data = m_io[0]->read(); - logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); - return data; -} - -WRITE16_MEMBER(wrlshunt_game_state::porta_w) -{ - logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); - - // HACK - address_space& mem = m_maincpu->space(AS_PROGRAM); - if (mem.read_word(0x5b354) == 0xafd0) // wrlshubt - skip check (EEPROM?) - mem.write_word(0x5b354, 0xB403); -} - - -void generalplus_gpac800_game_state::generalplus_gpac800(machine_config &config) -{ - GPAC800(config, m_maincpu, 96000000/2, m_screen); - m_maincpu->porta_in().set(FUNC(generalplus_gpac800_game_state::porta_r)); - m_maincpu->portb_in().set(FUNC(generalplus_gpac800_game_state::portb_r)); - m_maincpu->portc_in().set(FUNC(generalplus_gpac800_game_state::portc_r)); - m_maincpu->porta_out().set(FUNC(generalplus_gpac800_game_state::porta_w)); - m_maincpu->space_read_callback().set(FUNC(generalplus_gpac800_game_state::read_external_space)); - m_maincpu->space_write_callback().set(FUNC(generalplus_gpac800_game_state::write_external_space)); - m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); - m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); - m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); - m_maincpu->set_bootmode(0); // boot from internal ROM (NAND bootstrap) - m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); - - m_maincpu->nand_read_callback().set(FUNC(generalplus_gpac800_game_state::read_nand)); - - FULL_MEMORY(config, m_memory).set_map(&generalplus_gpac800_game_state::cs_map_base); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_size(320*2, 262*2); - m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); - m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); - m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); - - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); -} - -DEVICE_IMAGE_LOAD_MEMBER(generalplus_gpac800_vbaby_game_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 image_init_result::PASS; -} - -void generalplus_gpac800_vbaby_game_state::generalplus_gpac800_vbaby(machine_config &config) -{ - generalplus_gpac800_game_state::generalplus_gpac800(config); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "vbaby_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(generalplus_gpac800_vbaby_game_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("vbaby_cart"); -} - - -void gcm394_game_state::machine_start() -{ -} - -void gcm394_game_state::machine_reset() -{ - cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); - m_maincpu->set_cs_space(m_memory->get_program()); - - m_maincpu->reset(); // reset CPU so vector gets read etc. - - m_maincpu->set_paldisplaybank_high_hack(1); - m_maincpu->set_alt_tile_addressing_hack(0); -} - - -void gcm394_game_state::cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4) -{ - // wipe existing mappings; - m_memory->get_program()->unmap_readwrite(0, (0x8000000*5)-1); - - int start_address = 0; - int end_address; - - int size; // cs region sizes in kwords - - size = (((cs0 & 0xff00) >> 8) + 1) * 0x10000; - end_address = start_address + (size - 1); - logerror("installing cs0 handler start_address %08x end_address %08x\n", start_address, end_address); - m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs0_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs0_w))); - start_address += size; - - size = (((cs1 & 0xff00) >> 8) + 1) * 0x10000; - end_address = start_address + (size - 1); - logerror("installing cs1 handler start_address %08x end_address %08x\n", start_address, end_address); - m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs1_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs1_w))); - start_address += size; - - size = (((cs2 & 0xff00) >> 8) + 1) * 0x10000; - end_address = start_address + (size - 1); - logerror("installing cs2 handler start_address %08x end_address %08x\n", start_address, end_address); - m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs2_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs2_w))); - start_address += size; - - size = (((cs3 & 0xff00) >> 8) + 1) * 0x10000; - end_address = start_address + (size - 1); - logerror("installing cs3 handler start_address %08x end_address %08x\n", start_address, end_address); - m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs3_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs3_w))); - start_address += size; - - size = (((cs4 & 0xff00) >> 8) + 1) * 0x10000; - end_address = start_address + (size - 1); - logerror("installing cs4 handler start_address %08x end_address %08x\n", start_address, end_address); - m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs4_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs4_w))); - //start_address += size; -} - - -void generalplus_gpspispi_game_state::generalplus_gpspispi(machine_config &config) -{ - GP_SPISPI(config, m_maincpu, 96000000/2, m_screen); - m_maincpu->porta_in().set(FUNC(generalplus_gpspispi_game_state::porta_r)); - m_maincpu->portb_in().set(FUNC(generalplus_gpspispi_game_state::portb_r)); - m_maincpu->portc_in().set(FUNC(generalplus_gpspispi_game_state::portc_r)); - m_maincpu->porta_out().set(FUNC(generalplus_gpspispi_game_state::porta_w)); - m_maincpu->space_read_callback().set(FUNC(generalplus_gpspispi_game_state::read_external_space)); - m_maincpu->space_write_callback().set(FUNC(generalplus_gpspispi_game_state::write_external_space)); - m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); - m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); - m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); - m_maincpu->set_bootmode(0); // boot from internal ROM (SPI bootstrap) - m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); - - FULL_MEMORY(config, m_memory).set_map(&generalplus_gpspispi_game_state::cs_map_base); - - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_size(320*2, 262*2); - m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); - m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); - m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); - - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); -} - -DEVICE_IMAGE_LOAD_MEMBER(generalplus_gpspispi_bkrankp_game_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 image_init_result::PASS; -} - -void generalplus_gpspispi_bkrankp_game_state::generalplus_gpspispi_bkrankp(machine_config &config) -{ - generalplus_gpspispi_game_state::generalplus_gpspispi(config); - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "bkrankp_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(generalplus_gpspispi_bkrankp_game_state::cart_load)); - - SOFTWARE_LIST(config, "cart_list").set_original("bkrankp_cart"); -} - -static INPUT_PORTS_START( gcm394 ) - PORT_START("IN0") - PORT_START("IN1") - PORT_START("IN2") -INPUT_PORTS_END - -static INPUT_PORTS_START( smartfp ) - PORT_START("IN0") - // entirely non-standard mat based controller (0-11 are where your feet are placed normally, row of selection places to step above those) - // no sensible default mapping unless forced - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_Q) PORT_NAME("0") - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_W) PORT_NAME("1") - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_E) PORT_NAME("2") - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_CODE(KEYCODE_R) PORT_NAME("3") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_CODE(KEYCODE_T) PORT_NAME("4") - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_CODE(KEYCODE_Y) PORT_NAME("5") - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_CODE(KEYCODE_U) PORT_NAME("6") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_CODE(KEYCODE_I) PORT_NAME("7") - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_CODE(KEYCODE_O) PORT_NAME("8") - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_CODE(KEYCODE_P) PORT_NAME("9") - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("10") - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("11") - - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_A) PORT_NAME("Circle / Red") - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_S) PORT_NAME("Square / Orange") - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_D) PORT_NAME("Triangle / Yellow") - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_F) PORT_NAME("Star / Blue") - - PORT_START("IN1") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN2") - PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("HOME") - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( wrlshunt ) - PORT_START("IN0") - PORT_START("IN1") - PORT_START("IN2") -INPUT_PORTS_END - -static INPUT_PORTS_START( tkmag220 ) - PORT_START("IN0") - PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("IN1") - PORT_DIPNAME( 0x0001, 0x0001, "IN1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0000, "Important" ) // gets stuck in inf loop if this is wrong - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("IN2") - PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_car2 ) - PORT_START("IN0") - PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) // unused - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("IN1") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN2") - PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( jak_gtg ) - PORT_START("IN0") - PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("IN1") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN2") - PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( jak_s500 ) - PORT_START("IN0") - PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) - - PORT_START("IN1") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN2") - PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -ROM_START(smartfp) - //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) - //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) - - ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) - ROM_LOAD16_WORD_SWAP("smartfitpark.bin", 0x000000, 0x800000, CRC(ada84507) SHA1(a3a80bf71fae62ebcbf939166a51d29c24504428)) -ROM_END - -ROM_START( tkmag220 ) - //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) - //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) - - ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "u1g-2a.u2", 0x0000000, 0x8000000, CRC(0fd769a1) SHA1(df19402bcd20075483d63fb98fb3fa42bd33ccfd) ) -ROM_END - -ROM_START(jak_s500) - //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) - //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) - - ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) - ROM_LOAD16_WORD_SWAP("spbwheel.bin", 0x000000, 0x800000, CRC(6ba1d335) SHA1(1bb3e4d02c7b35dd4d336971c6a9f82071cc6ce1) ) -ROM_END - -ROM_START(jak_totm) - //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) - //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) - - ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) - ROM_LOAD16_WORD_SWAP("toysonthemove.bin", 0x000000, 0x800000, CRC(d08fb72a) SHA1(1fea98542ef7c65eef31afb70fd50952b4cef1c1) ) -ROM_END - - -ROM_START(wrlshunt) - //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) - //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) - - ROM_REGION(0x8000000, "maincpu", ROMREGION_ERASE00) - ROM_LOAD16_WORD_SWAP("wireless.bin", 0x0000, 0x8000000, CRC(a6ecc20e) SHA1(3645f23ba2bb218e92d4560a8ae29dddbaabf796)) -ROM_END - -/* -Wireless Hunting Video Game System -(info provided with dump) - -System: Wireless Hunting Video Game System -Publisher: Hamy / Kids Station Toys Inc -Year: 2011 -ROM: FDI MSP55LV100G -RAM: Micron Technology 48LC8M16A2 - -Games: - -Secret Mission -Predator -Delta Force -Toy Land -Dream Forest -Trophy Season -Freedom Force -Be Careful -Net Power -Open Training -Super Archer -Ultimate Frisbee -UFO Shooting -Happy Darts -Balloon Shoot -Avatair -Angry Pirate -Penguin War -Ghost Shooter -Duck Hunt - - -ROM Board: - -Package: SO44 -Spacing: 1.27 mm -Width: 16.14 mm -Length: 27.78 mm -Voltage: 3V -Pinout: - - A25 A24 - | | - +--------------------------+ -A21 --|== # # `.__.' ==|-- A20 -A18 --|== ==|-- A19 -A17 --|== ==|-- A8 - A7 --|== ==|-- A9 - A6 --|== o ==|-- A10 - A5 --|== +----------------+ ==|-- A11 - A4 --|== | | ==|-- A12 - A3 --|== | MSP55LV100G | ==|-- A13 - A2 --|== | 0834 M02H | ==|-- A14 - A1 --|== | JAPAN | ==|-- A15 - A0 --|== | | ==|-- A16 -#CE --|== | | ==|-- A23 -GND --|== | | ==|-- A22 -#OE --|== | | ==|-- Q15 - Q0 --|== | | ==|-- Q7 - Q8 --|== | | ==|-- Q14 - Q1 --|== +----------------+ ==|-- Q6 - Q9 --|== ==|-- Q13 - Q2 --|== M55L100G ==|-- Q5 -Q10 --|== ==|-- Q12 - Q3 --|== ==|-- Q4 -Q11 --|== ==|-- VCC - +--------------------------+ - - -The only interesting string in this ROM is SPF2ALP, -which is also found in the Wireless Air 60 ROM. - -*/ - - -/* -Wireless Air 60 -(info provided with dump) - -System: Wireless Air 60 -ROM: Toshiba TC58NVG0S3ETA00 -RAM: ESMT M12L128168A - -This is a raw NAND flash dump - -Interesting Strings: - -GPnandnand; (GP is General Plus, which is Sunplus by another name) -GLB_GP-F_5B_USBD_1.0.0 -SP_ToneMaker -GLB_GP-FS1_0405L_SPU_1.0.2.3 -SPF2ALP - -"GPnandnand" as a required signature appears to be referenced right here, in page 19 of a GeneralPlus document; -https://web.archive.org/web/20180106005235/http://www.lcis.com.tw/paper_store/paper_store/GPL162004A-507A_162005A-707AV10_code_reference-20147131205102.pdf - -*/ - -ROM_START( wlsair60 ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x8400000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "wlsair60.nand", 0x0000, 0x8400000, CRC(eec23b97) SHA1(1bb88290cf54579a5bb51c08a02d793cd4d79f7a) ) -ROM_END - -ROM_START( jak_gtg ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "goldentee.bin", 0x0000, 0x4200000, CRC(87d5e815) SHA1(5dc46cd753b791449cc41d5eff4928c0dcaf35c0) ) -ROM_END - -ROM_START( jak_car2 ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "cars2.bin", 0x0000, 0x4200000, CRC(4d610e09) SHA1(bc59f5f7f676a8f2a78dfda7fb62c804bbf850b6) ) -ROM_END - -ROM_START( jak_tsm ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "toystorymania.bin", 0x0000, 0x4200000, CRC(183b20a5) SHA1(eb4fa5ee9dfac58f5244d00d4e833b1e461cc52c) ) -ROM_END - - -ROM_START( jak_duck ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "duckcommander_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(d9356d5b) SHA1(aca05525b4a504f7ad264ae9bbc2f1f8f399c4ca) ) -ROM_END - -ROM_START( jak_swc ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "jakksstarwarspistol_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(024d49b8) SHA1(9694f4c7cd083c976ffbbcfa6f626fc6b4bc8d91) ) -ROM_END - -ROM_START( jak_wdzh ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "walkingdeadrifle_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(b2c762f0) SHA1(7e10df517cc24924e0ec55e2a263563023d945f8) ) -ROM_END - -ROM_START( jak_wdbg ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "amcwalkingdeadcrossbow_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(66510fd4) SHA1(3ad6347c5a7758c035654cb3e96858320875b97a) ) -ROM_END - - -ROM_START( vbaby ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x8400000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "vbaby.bin", 0x0000, 0x8400000, CRC(d904441b) SHA1(3742bc4e1e403f061ce2813ecfafc6f30a44d287) ) -ROM_END - -ROM_START( mgtfit ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x8400000, "nandrom", ROMREGION_ERASE00 ) // Samsung 937 K9F1G08U0D Ident: 0xEC 0xF1 Full Ident: 0xECF1001540 - ROM_LOAD( "k9f1g08u0d.bin", 0x0000, 0x8400000, CRC(1ca5ac09) SHA1(c2e123085d2198999c2c0edb1df4895361c00a99) ) -ROM_END - -ROM_START( beambox ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) - ROM_LOAD( "beambox.bin", 0x0000, 0x4200000, CRC(a486f04e) SHA1(73c7d99d8922eba58d94e955e254b9c3baa4443e) ) -ROM_END - -// the JAKKS ones of these seem to be known as 'Generalplus GPAC500' hardware? -CONS(2009, smartfp, 0, 0, base, smartfp, gcm394_game_state, empty_init, "Fisher-Price", "Fun 2 Learn Smart Fit Park (Spain)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) -CONS(200?, tkmag220, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "TaiKee", "Mini Arcade Games Console (Family Sport 220-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) - -// Fun 2 Learn 3-in-1 SMART SPORTS ? - -CONS(2009, jak_s500, 0, 0, wrlshunt, jak_s500, jak_s500_game_state, init_wrlshunt, "JAKKS Pacific Inc", "SpongeBob SquarePants Bikini Bottom 500 (JAKKS Pacific TV Motion Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) -CONS(200?, jak_totm, 0, 0, wrlshunt, jak_s500, jak_s500_game_state, init_wrlshunt, "JAKKS Pacific Inc", "Toy Story - Toys on the Move (JAKKS Pacific TV Motion Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) - -CONS(2011, wrlshunt, 0, 0, wrlshunt, wrlshunt, wrlshunt_game_state, init_wrlshunt, "Hamy / Kids Station Toys Inc", "Wireless Hunting Video Game System", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) - -void generalplus_gpac800_game_state::machine_start() -{ - save_item(NAME(m_sdram)); -} - -void generalplus_gpac800_game_state::nand_create_stripped_region() -{ - uint8_t* rom = m_nandregion; - int size = memregion("nandrom")->bytes(); - m_size = size; - - int numblocks = size / m_nandblocksize; - m_strippedsize = numblocks * m_nandblocksize_stripped; - m_strippedrom.resize(m_strippedsize); - - for (int i = 0; i < numblocks; i++) - { - const int base = i * m_nandblocksize; - const int basestripped = i * m_nandblocksize_stripped; - - for (int j = 0; j < m_nandblocksize_stripped; j++) - { - m_strippedrom[basestripped + j] = rom[(base + j)]; - } - } - - // debug to allow for easy use of unidasm.exe - if (0) - { - FILE *fp; - char filename[256]; - sprintf(filename,"stripped_%s", machine().system().name); - fp=fopen(filename, "w+b"); - if (fp) - { - fwrite(&m_strippedrom[0], m_nandblocksize_stripped * numblocks, 1, fp); - fclose(fp); - } - } -} - -void generalplus_gpac800_game_state::machine_reset() -{ - // configure CS defaults - address_space& mem = m_maincpu->space(AS_PROGRAM); - mem.write_word(0x007820, 0x0047); - mem.write_word(0x007821, 0xff47); - mem.write_word(0x007822, 0x00c7); - mem.write_word(0x007823, 0x0047); - mem.write_word(0x007824, 0x0047); - - m_maincpu->set_cs_space(m_memory->get_program()); - - if (m_nandregion) - { - nand_create_stripped_region(); - - // up to 256 pages (16384kw) for each space - - // (size of cs0 + cs1 + cs2 + cs3 + cs4) <= 81920kwords - - // simulate bootstrap / internal ROM - - address_space& mem = m_maincpu->space(AS_PROGRAM); - - /* Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - 00000000 (50 47 61 6E 64 6E 61 6E 64 6E)-- -- -- -- -- -- PGandnandn------ - 00000010 -- -- -- -- -- bb -- -- -- -- -- -- -- -- -- -- ---------------- - - bb = where to copy first block - - The header is GPnandnand (byteswapped) then some params - one of the params appears to be for the initial code copy operation done - by the bootstrap - */ - - // probably more bytes are used - int dest = m_strippedrom[0x15] << 8; - - // copy a block of code from the NAND to RAM - for (int i = 0; i < m_initial_copy_words; i++) - { - uint16_t word = m_strippedrom[(i * 2) + 0] | (m_strippedrom[(i * 2) + 1] << 8); - - mem.write_word(dest + i, word); - } - - // these vectors must either directly point to RAM, or at least redirect there after some code - uint16_t* internal = (uint16_t*)memregion("maincpu:internal")->base(); - internal[0x7ff5] = m_vectorbase + 0x0a; - internal[0x7ff6] = m_vectorbase + 0x0c; - internal[0x7ff7] = dest + 0x20; // point boot vector at code in RAM (probably in reality points to internal code that copies the first block) - internal[0x7ff8] = m_vectorbase + 0x10; - internal[0x7ff9] = m_vectorbase + 0x12; - internal[0x7ffa] = m_vectorbase + 0x14; - internal[0x7ffb] = m_vectorbase + 0x16; - internal[0x7ffc] = m_vectorbase + 0x18; - internal[0x7ffd] = m_vectorbase + 0x1a; - internal[0x7ffe] = m_vectorbase + 0x1c; - internal[0x7fff] = m_vectorbase + 0x1e; - } - - m_maincpu->reset(); // reset CPU so vector gets read etc. - - m_maincpu->set_paldisplaybank_high_hack(0); - m_maincpu->set_alt_tile_addressing_hack(1); -} - - -void generalplus_gpac800_game_state::nand_init210() -{ - m_sdram.resize(0x400000); // 0x400000 words (0x800000 bytes) - m_sdram2.resize(0x10000); - - m_nandblocksize = 0x210; - m_nandblocksize_stripped = 0x200; - - m_vectorbase = 0x6fe0; -} - -void generalplus_gpac800_game_state::nand_init840() -{ - m_sdram.resize(0x400000); // 0x400000 words (0x800000 bytes) - m_sdram2.resize(0x10000); - - m_nandblocksize = 0x840; - m_nandblocksize_stripped = 0x800; - - m_vectorbase = 0x6fe0; -} - -void generalplus_gpac800_game_state::nand_wlsair60() -{ - nand_init840(); - m_initial_copy_words = 0x2800; -} - -void generalplus_gpac800_game_state::nand_vbaby() -{ - nand_init840(); - m_initial_copy_words = 0x1000; - m_maincpu->set_romtype(2); -} - -void generalplus_gpac800_game_state::nand_tsm() -{ - - // something odd must be going on with the bootloader? - // structure has the first 0x4000 block repeated 3 times (must appear in RAM on startup?) - // then it has a 0x10000 block repeated 4 times (must get copied to 0x30000 by code) - // then it has the larger, main payload, just the once. - - // the addresses written to the NAND device don't compensate for these data repeats, however dump seems ok as no other data is being repeated? - // reads after startup still need checking - nand_init210(); - m_maincpu->set_romtype(1); -} - -void generalplus_gpac800_game_state::nand_beambox() -{ - nand_init210(); - m_vectorbase = 0x2fe0; -} - - - -// NAND dumps w/ internal bootstrap (and u'nSP 2.0 extended opcodes) (have gpnandnand strings) -// the JAKKS ones seem to be known as 'Generalplus GPAC800' hardware -CONS(2010, wlsair60, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_gtg, 0, 0, generalplus_gpac800, jak_gtg, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_car2, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Cars 2 (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_duck, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Duck Commander (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_swc, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Star Wars Clone Trooper (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_wdzh, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "The Walking Dead: Zombie Hunter (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_wdbg, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "The Walking Dead: Battleground (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_tsm , 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_tsm, "JAKKS Pacific Inc", "Toy Story Mania (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, beambox, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_beambox, "Hasbro", "Playskool Heroes Transformers Rescue Bots Beam Box (Spain)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, mgtfit, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "MGT", "Fitness Konsole (NC1470)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // probably has other names in English too? menus don't appear to be in German -CONS(200?, vbaby, 0, 0, generalplus_gpac800_vbaby, jak_car2, generalplus_gpac800_vbaby_game_state, nand_vbaby, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) - - -ROM_START( bkrankp ) - ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) - //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only - - ROM_REGION(0x400000, "maincpu", ROMREGION_ERASE00) - ROM_LOAD16_WORD_SWAP( "unit_mx25l3206e_c22016.bin", 0x0000, 0x400000, CRC(7efad116) SHA1(427d707e97586ae6ab5fe08f29ca450ddc7ad36e) ) -ROM_END - - -void generalplus_gpspispi_game_state::init_spi() -{ - int vectorbase = 0x2fe0; - uint8_t* spirom = memregion("maincpu")->base(); - - address_space& mem = m_maincpu->space(AS_PROGRAM); - - /* Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F - - 00000000 50 47 70 73 73 69 69 70 70 73 44 00 44 3F 44 00 PGpssiipps - 00000010 -- -- -- -- -- bb -- -- -- -- -- -- -- -- -- -- - ^^ copy dest, just like with nand type - - bb = where to copy first block - - The header is GPspispi (byteswapped) then some params - one of the params appears to be for the initial code copy operation done - by the bootstrap - */ - - // probably more bytes are used - int dest = spirom[0x15] << 8; - - // copy a block of code from the NAND to RAM - for (int i = 0; i < 0x2000; i++) - { - uint16_t word = spirom[(i * 2) + 0] | (spirom[(i * 2) + 1] << 8); - - mem.write_word(dest + i, word); - } - - // these vectors must either directly point to RAM, or at least redirect there after some code - uint16_t* internal = (uint16_t*)memregion("maincpu:internal")->base(); - internal[0x7ff5] = vectorbase + 0x0a; - internal[0x7ff6] = vectorbase + 0x0c; - internal[0x7ff7] = dest + 0x20; // point boot vector at code in RAM (probably in reality points to internal code that copies the first block) - internal[0x7ff8] = vectorbase + 0x10; - internal[0x7ff9] = vectorbase + 0x12; - internal[0x7ffa] = vectorbase + 0x14; - internal[0x7ffb] = vectorbase + 0x16; - internal[0x7ffc] = vectorbase + 0x18; - internal[0x7ffd] = vectorbase + 0x1a; - internal[0x7ffe] = vectorbase + 0x1c; - internal[0x7fff] = vectorbase + 0x1e; -} - - -CONS(200?, bkrankp, 0, 0, generalplus_gpspispi_bkrankp, gcm394, generalplus_gpspispi_bkrankp_game_state , init_spi, "Bandai", "Karaoke Ranking Party (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) - - diff --git a/src/mame/drivers/sunplus_unsp20soc.cpp b/src/mame/drivers/sunplus_unsp20soc.cpp new file mode 100644 index 00000000000..6eb8f295bfe --- /dev/null +++ b/src/mame/drivers/sunplus_unsp20soc.cpp @@ -0,0 +1,1529 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +/* + (unSP 2.0 based System on a Chip) + + JAKKS call this GPAC800, other sources call it GPL16250 + + die on Smart Fit Park and Spongebob Bikini Bottom 500 is marked GCM394 + some of the systems here might use newer dies but the video etc. appears the same. + + Compared to vii.cpp this is clearly newer, has extra opcodes, different internal map etc. also scaling and higher resolutions based on Spongebob + + note, these SoC types always have a 128Kwords internal ROM, which the JAKKS games appear to use for basic bootstrap purposes. + + GPAC800 / GCM394 (SpongeBob Bikini Bottom 500 Test Mode also calls this GPAC800, even if the mappings appear different to the NAND version below - different CS base, maybe just depends on boot mode?) + Smart Fit Park + SpongeBob SquarePants Bikini Bottom 500 + Spiderman - The Masked Menace 'Spider Sense' (pad type with Spiderman model) + (Wireless Hunting? - maybe, register map looks the same even if it sets stack to 2fff not 6fff) + + GPAC800 (with NAND support) + Wireless Air 60 + Golden Tee Golf + Cars 2 + Toy Story Mania + V.Baby + Playskool Heroes Transformers Rescue Bots Beam Box + + GPAC500 (based on test modes, unknown hardware, might be GPAC800 but without the higher resolution support?) + The Price is Right + Bejeweled? (might be GPAC800) + + Notes + smartfp: hold button Circle, Star and Home on startup for Test Menu + + these are all unsp 2.0 type, as they use the extended ocpodes + + + NAND types: + + Toy Story Mania H27U518S2C dumped as HY27US08121A (512+16) x 32 x 4096 + Beam Box GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 + Golden Tee GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 + Cars 2 GPR27P512A dumped as HY27US08121A (512+16) x 32 x 4096 + + V.Baby HY27UF081G2A (2048+64) x 64 x 1024 + +*/ + +#include "emu.h" +#include "includes/sunplus_unsp20soc.h" + + +// device type definition +DEFINE_DEVICE_TYPE(FULL_MEMORY, full_memory_device, "full_memory", "SunPlus Full CS Memory Map") + +full_memory_device::full_memory_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + device_t(mconfig, FULL_MEMORY, tag, owner, clock), + device_memory_interface(mconfig, *this), + m_program(nullptr) +{ +} + +device_memory_interface::space_config_vector full_memory_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config) + }; +} + +/* +':maincpu' (00F87F):possible DMA operation (7abf) (trigger 0001) with params mode:4009 source:00040000 (word offset) dest:00830000 (word offset) length:00007800 (words) +':maincpu' (002384):possible DMA operation (7abf) (trigger 0001) with params mode:0009 source:00180000 (word offset) dest:00840000 (word offset) length:00160000 (words) + +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:000025bc (word offset) length:000001e0 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:000024cc (word offset) length:000000f0 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000002 (word offset) length:00000400 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000402 (word offset) length:00000400 (words) +':maincpu' (05048D):possible DMA operation (7abf) (trigger 0001) with params mode:0089 source:00006fa3 (word offset) dest:00000802 (word offset) length:00000400 (words) + +gtg +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030000 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030100 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030200 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030300 (word offset) length:00000200 (words) +':maincpu' (005ACE):possible DMA operation (7abf) (trigger 0001) with params mode:1089 source:30007854 (word offset) dest:00030400 (word offset) length:00000200 (words) + +*/ + +void full_memory_device::device_config_complete() +{ + m_program_config = address_space_config( "program", ENDIANNESS_BIG, 16, 32, -1 ); +} + +void full_memory_device::device_start() +{ + m_program = &space(AS_PROGRAM); +} + + + +READ16_MEMBER(gcm394_game_state::cs0_r) +{ + return m_romregion[offset & 0x3fffff]; +} + +WRITE16_MEMBER(gcm394_game_state::cs0_w) +{ + logerror("cs0_w %04x %04x (to ROM!)\n", offset, data); +} + +READ16_MEMBER(gcm394_game_state::cs1_r) { logerror("cs1_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs1_w) { logerror("cs1_w %06x %04x\n", offset, data); } +READ16_MEMBER(gcm394_game_state::cs2_r) { logerror("cs2_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs2_w) { logerror("cs2_w %06x %04x\n", offset, data); } +READ16_MEMBER(gcm394_game_state::cs3_r) { logerror("cs3_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs3_w) { logerror("cs3_w %06x %04x\n", offset, data); } +READ16_MEMBER(gcm394_game_state::cs4_r) { logerror("cs4_r %06n", offset); return 0x0000; } +WRITE16_MEMBER(gcm394_game_state::cs4_w) { logerror("cs4_w %06x %04x\n", offset, data); } + + +/* + map info (NAND type) + + map(0x000000, 0x006fff) internal RAM + map(0x007000, 0x007fff) internal peripherals + map(0x008000, 0x00ffff) internal ROM (lower 32kwords) - can also be configured to mirror CS0 308000 area with external pin for boot from external ROM + map(0x010000, 0x027fff) internal ROM (upper 96kwords) - can't be switched + map(0x028000, 0x02ffff) reserved + + map(0x030000, 0x0.....) view into external spaces (CS0 area starts here. followed by CS1 area, CS2 area etc.) + + map(0x200000, 0x3fffff) continued view into external spaces, but this area is banked with m_membankswitch_7810 (valid bank values 0x00-0x3f) +*/ + + + +void gcm394_game_state::cs_map_base(address_map& map) +{ +} + + + + + +READ16_MEMBER(wrlshunt_game_state::cs0_r) +{ + return m_romregion[offset & 0x3ffffff]; +} + +WRITE16_MEMBER(wrlshunt_game_state::cs0_w) +{ + logerror("cs0_w write to ROM?\n"); + //m_romregion[offset & 0x3ffffff] = data; +} + +READ16_MEMBER(wrlshunt_game_state::cs1_r) +{ + return m_sdram[offset & 0x3fffff]; +} + +WRITE16_MEMBER(wrlshunt_game_state::cs1_w) +{ + m_sdram[offset & 0x3fffff] = data; +} + + +void wrlshunt_game_state::machine_start() +{ + save_item(NAME(m_sdram)); +} + +void wrlshunt_game_state::machine_reset() +{ + cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); + m_maincpu->set_cs_space(m_memory->get_program()); + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(1); + m_maincpu->set_alt_tile_addressing_hack(1); +} + +READ16_MEMBER(jak_s500_game_state::porta_r) +{ + uint16_t data = m_io[0]->read(); + logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); + + //address_space& mem = m_maincpu->space(AS_PROGRAM); + + //if (mem.read_word(0x22b408) == 0x4846) + // mem.write_word(0x22b408, 0x4840); // jak_s500 force service mode + + //if (mem.read_word(0x236271) == 0x4846) + // mem.write_word(0x236271, 0x4840); // jak_totm force service mode + + return data; +} + +READ16_MEMBER(jak_s500_game_state::portb_r) +{ + uint16_t data = m_io[1]->read(); + logerror("%s: Port B Read: %04x\n", machine().describe_context(), data); + return data; +} + + +void jak_s500_game_state::machine_reset() +{ + cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); + m_maincpu->set_cs_space(m_memory->get_program()); + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(0); + m_maincpu->set_alt_tile_addressing_hack(1); +} + + +void generalplus_gpspispi_game_state::machine_start() +{ +} + +void generalplus_gpspispi_game_state::machine_reset() +{ + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(0); + m_maincpu->set_alt_tile_addressing_hack(1); +} + + + +void wrlshunt_game_state::init_wrlshunt() +{ + m_sdram.resize(0x400000); // 0x400000 bytes, 0x800000 words +} + +READ16_MEMBER(generalplus_gpac800_game_state::cs0_r) +{ + return m_sdram2[offset & 0xffff]; +} + +WRITE16_MEMBER(generalplus_gpac800_game_state::cs0_w) +{ + m_sdram2[offset & 0xffff] = data; +} + +READ16_MEMBER(generalplus_gpac800_game_state::cs1_r) +{ + return m_sdram[offset & 0x3fffff]; +} + +WRITE16_MEMBER(generalplus_gpac800_game_state::cs1_w) +{ + m_sdram[offset & 0x3fffff] = data; +} + +READ8_MEMBER(generalplus_gpac800_game_state::read_nand) +{ + if (!m_nandregion) + return 0x0000; + + return (offset < m_size) ? m_nandregion[offset] : 0xFF; + //return m_strippedrom[offset & (m_strippedsize - 1)]; +} + +READ16_MEMBER(gcm394_game_state::read_external_space) +{ + return m_memory->get_program()->read_word(offset); +} + +WRITE16_MEMBER(gcm394_game_state::write_external_space) +{ + m_memory->get_program()->write_word(offset, data); +} + +READ16_MEMBER(gcm394_game_state::porta_r) +{ + uint16_t data = m_io[0]->read(); + logerror("Port A Read: %04x\n", data); + return data; +} + +READ16_MEMBER(gcm394_game_state::portb_r) +{ + uint16_t data = m_io[1]->read(); + logerror("Port B Read: %04x\n", data); + return data; +} + +READ16_MEMBER(gcm394_game_state::portc_r) +{ + uint16_t data = m_io[2]->read(); + logerror("Port C Read: %04x\n", data); + return data; +} + +WRITE16_MEMBER(gcm394_game_state::porta_w) +{ + logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); +} + +// some sources indicate these later SoC types run at 96Mhz, others indicate 48Mhz. +// unSP 2.0 CPUs have a lower average CPI too (2 instead of 6 on unSP 1.0 or 5 on unSP 1.1 / 1.2 / unSP 2.0) so using regular unSP timings might result in things being too slow +// as with the older SunPlus chips this appears to be an fully internally generated frequency, external XTALs again are typically 6MHz or simply not present. + +void gcm394_game_state::base(machine_config &config) +{ + GCM394(config, m_maincpu, 96000000/2, m_screen); + m_maincpu->porta_in().set(FUNC(gcm394_game_state::porta_r)); + m_maincpu->portb_in().set(FUNC(gcm394_game_state::portb_r)); + m_maincpu->portc_in().set(FUNC(gcm394_game_state::portc_r)); + m_maincpu->porta_out().set(FUNC(gcm394_game_state::porta_w)); + m_maincpu->space_read_callback().set(FUNC(gcm394_game_state::read_external_space)); + m_maincpu->space_write_callback().set(FUNC(gcm394_game_state::write_external_space)); + m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); + m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + m_maincpu->set_bootmode(1); // boot from external ROM / CS mirror + m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); + + FULL_MEMORY(config, m_memory).set_map(&gcm394_game_state::cs_map_base); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); + m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); +} + +void wrlshunt_game_state::wrlshunt(machine_config &config) +{ + gcm394_game_state::base(config); +} + +void tkmag220_game_state::tkmag220(machine_config &config) +{ + gcm394_game_state::base(config); + + m_maincpu->porta_in().set_ioport("IN0"); + m_maincpu->portb_in().set_ioport("IN1"); + m_maincpu->portc_in().set_ioport("IN2"); +} + + +READ16_MEMBER(wrlshunt_game_state::porta_r) +{ + uint16_t data = m_io[0]->read(); + logerror("%s: Port A Read: %04x\n", machine().describe_context(), data); + return data; +} + +WRITE16_MEMBER(wrlshunt_game_state::porta_w) +{ + logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); + + // HACK + address_space& mem = m_maincpu->space(AS_PROGRAM); + if (mem.read_word(0x5b354) == 0xafd0) // wrlshubt - skip check (EEPROM?) + mem.write_word(0x5b354, 0xB403); +} + + +void generalplus_gpac800_game_state::generalplus_gpac800(machine_config &config) +{ + GPAC800(config, m_maincpu, 96000000/2, m_screen); + m_maincpu->porta_in().set(FUNC(generalplus_gpac800_game_state::porta_r)); + m_maincpu->portb_in().set(FUNC(generalplus_gpac800_game_state::portb_r)); + m_maincpu->portc_in().set(FUNC(generalplus_gpac800_game_state::portc_r)); + m_maincpu->porta_out().set(FUNC(generalplus_gpac800_game_state::porta_w)); + m_maincpu->space_read_callback().set(FUNC(generalplus_gpac800_game_state::read_external_space)); + m_maincpu->space_write_callback().set(FUNC(generalplus_gpac800_game_state::write_external_space)); + m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); + m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + m_maincpu->set_bootmode(0); // boot from internal ROM (NAND bootstrap) + m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); + + m_maincpu->nand_read_callback().set(FUNC(generalplus_gpac800_game_state::read_nand)); + + FULL_MEMORY(config, m_memory).set_map(&generalplus_gpac800_game_state::cs_map_base); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); + m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); +} + +DEVICE_IMAGE_LOAD_MEMBER(generalplus_gpac800_vbaby_game_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 image_init_result::PASS; +} + +void generalplus_gpac800_vbaby_game_state::generalplus_gpac800_vbaby(machine_config &config) +{ + generalplus_gpac800_game_state::generalplus_gpac800(config); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "vbaby_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(generalplus_gpac800_vbaby_game_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("vbaby_cart"); +} + + +void gcm394_game_state::machine_start() +{ +} + +void gcm394_game_state::machine_reset() +{ + cs_callback(0x00, 0x00, 0x00, 0x00, 0x00); + m_maincpu->set_cs_space(m_memory->get_program()); + + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(1); + m_maincpu->set_alt_tile_addressing_hack(0); +} + + +void gcm394_game_state::cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4) +{ + // wipe existing mappings; + m_memory->get_program()->unmap_readwrite(0, (0x8000000*5)-1); + + int start_address = 0; + int end_address; + + int size; // cs region sizes in kwords + + size = (((cs0 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs0 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs0_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs0_w))); + start_address += size; + + size = (((cs1 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs1 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs1_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs1_w))); + start_address += size; + + size = (((cs2 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs2 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs2_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs2_w))); + start_address += size; + + size = (((cs3 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs3 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs3_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs3_w))); + start_address += size; + + size = (((cs4 & 0xff00) >> 8) + 1) * 0x10000; + end_address = start_address + (size - 1); + logerror("installing cs4 handler start_address %08x end_address %08x\n", start_address, end_address); + m_memory->get_program()->install_readwrite_handler( start_address, end_address, read16_delegate(*this, FUNC(gcm394_game_state::cs4_r)), write16_delegate(*this, FUNC(gcm394_game_state::cs4_w))); + //start_address += size; +} + + +void generalplus_gpspispi_game_state::generalplus_gpspispi(machine_config &config) +{ + GP_SPISPI(config, m_maincpu, 96000000/2, m_screen); + m_maincpu->porta_in().set(FUNC(generalplus_gpspispi_game_state::porta_r)); + m_maincpu->portb_in().set(FUNC(generalplus_gpspispi_game_state::portb_r)); + m_maincpu->portc_in().set(FUNC(generalplus_gpspispi_game_state::portc_r)); + m_maincpu->porta_out().set(FUNC(generalplus_gpspispi_game_state::porta_w)); + m_maincpu->space_read_callback().set(FUNC(generalplus_gpspispi_game_state::read_external_space)); + m_maincpu->space_write_callback().set(FUNC(generalplus_gpspispi_game_state::write_external_space)); + m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); + m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + m_maincpu->set_bootmode(0); // boot from internal ROM (SPI bootstrap) + m_maincpu->set_cs_config_callback(FUNC(gcm394_game_state::cs_callback)); + + FULL_MEMORY(config, m_memory).set_map(&generalplus_gpspispi_game_state::cs_map_base); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); + m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); +} + +DEVICE_IMAGE_LOAD_MEMBER(generalplus_gpspispi_bkrankp_game_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 image_init_result::PASS; +} + +void generalplus_gpspispi_bkrankp_game_state::generalplus_gpspispi_bkrankp(machine_config &config) +{ + generalplus_gpspispi_game_state::generalplus_gpspispi(config); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "bkrankp_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(generalplus_gpspispi_bkrankp_game_state::cart_load)); + + SOFTWARE_LIST(config, "cart_list").set_original("bkrankp_cart"); +} + +static INPUT_PORTS_START( gcm394 ) + PORT_START("IN0") + PORT_START("IN1") + PORT_START("IN2") +INPUT_PORTS_END + +static INPUT_PORTS_START( smartfp ) + PORT_START("IN0") + // entirely non-standard mat based controller (0-11 are where your feet are placed normally, row of selection places to step above those) + // no sensible default mapping unless forced + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_Q) PORT_NAME("0") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_W) PORT_NAME("1") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_E) PORT_NAME("2") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_CODE(KEYCODE_R) PORT_NAME("3") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_CODE(KEYCODE_T) PORT_NAME("4") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_CODE(KEYCODE_Y) PORT_NAME("5") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_CODE(KEYCODE_U) PORT_NAME("6") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_CODE(KEYCODE_I) PORT_NAME("7") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_CODE(KEYCODE_O) PORT_NAME("8") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_CODE(KEYCODE_P) PORT_NAME("9") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("10") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("11") + + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_A) PORT_NAME("Circle / Red") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_S) PORT_NAME("Square / Orange") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_D) PORT_NAME("Triangle / Yellow") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_F) PORT_NAME("Star / Blue") + + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("HOME") + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( wrlshunt ) + PORT_START("IN0") + PORT_START("IN1") + PORT_START("IN2") +INPUT_PORTS_END + +static INPUT_PORTS_START( tkmag220 ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_DIPNAME( 0x0001, 0x0001, "IN1" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "Important" ) // gets stuck in inf loop if this is wrong + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_car2 ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) // unused + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jak_gtg ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( jak_s500 ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0001, "IN0" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) + + PORT_START("IN1") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0001, "IN2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +ROM_START(smartfp) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("smartfitpark.bin", 0x000000, 0x800000, CRC(ada84507) SHA1(a3a80bf71fae62ebcbf939166a51d29c24504428)) +ROM_END + +ROM_START( tkmag220 ) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "u1g-2a.u2", 0x0000000, 0x8000000, CRC(0fd769a1) SHA1(df19402bcd20075483d63fb98fb3fa42bd33ccfd) ) +ROM_END + +ROM_START(jak_s500) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("spbwheel.bin", 0x000000, 0x800000, CRC(6ba1d335) SHA1(1bb3e4d02c7b35dd4d336971c6a9f82071cc6ce1) ) +ROM_END + +ROM_START(jak_totm) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION(0x800000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("toysonthemove.bin", 0x000000, 0x800000, CRC(d08fb72a) SHA1(1fea98542ef7c65eef31afb70fd50952b4cef1c1) ) +ROM_END + + +ROM_START(wrlshunt) + //ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) // not on this model? (or at least not this size, as CS base is different) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) + + ROM_REGION(0x8000000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("wireless.bin", 0x0000, 0x8000000, CRC(a6ecc20e) SHA1(3645f23ba2bb218e92d4560a8ae29dddbaabf796)) +ROM_END + +/* +Wireless Hunting Video Game System +(info provided with dump) + +System: Wireless Hunting Video Game System +Publisher: Hamy / Kids Station Toys Inc +Year: 2011 +ROM: FDI MSP55LV100G +RAM: Micron Technology 48LC8M16A2 + +Games: + +Secret Mission +Predator +Delta Force +Toy Land +Dream Forest +Trophy Season +Freedom Force +Be Careful +Net Power +Open Training +Super Archer +Ultimate Frisbee +UFO Shooting +Happy Darts +Balloon Shoot +Avatair +Angry Pirate +Penguin War +Ghost Shooter +Duck Hunt + + +ROM Board: + +Package: SO44 +Spacing: 1.27 mm +Width: 16.14 mm +Length: 27.78 mm +Voltage: 3V +Pinout: + + A25 A24 + | | + +--------------------------+ +A21 --|== # # `.__.' ==|-- A20 +A18 --|== ==|-- A19 +A17 --|== ==|-- A8 + A7 --|== ==|-- A9 + A6 --|== o ==|-- A10 + A5 --|== +----------------+ ==|-- A11 + A4 --|== | | ==|-- A12 + A3 --|== | MSP55LV100G | ==|-- A13 + A2 --|== | 0834 M02H | ==|-- A14 + A1 --|== | JAPAN | ==|-- A15 + A0 --|== | | ==|-- A16 +#CE --|== | | ==|-- A23 +GND --|== | | ==|-- A22 +#OE --|== | | ==|-- Q15 + Q0 --|== | | ==|-- Q7 + Q8 --|== | | ==|-- Q14 + Q1 --|== +----------------+ ==|-- Q6 + Q9 --|== ==|-- Q13 + Q2 --|== M55L100G ==|-- Q5 +Q10 --|== ==|-- Q12 + Q3 --|== ==|-- Q4 +Q11 --|== ==|-- VCC + +--------------------------+ + + +The only interesting string in this ROM is SPF2ALP, +which is also found in the Wireless Air 60 ROM. + +*/ + + +/* +Wireless Air 60 +(info provided with dump) + +System: Wireless Air 60 +ROM: Toshiba TC58NVG0S3ETA00 +RAM: ESMT M12L128168A + +This is a raw NAND flash dump + +Interesting Strings: + +GPnandnand; (GP is General Plus, which is Sunplus by another name) +GLB_GP-F_5B_USBD_1.0.0 +SP_ToneMaker +GLB_GP-FS1_0405L_SPU_1.0.2.3 +SPF2ALP + +"GPnandnand" as a required signature appears to be referenced right here, in page 19 of a GeneralPlus document; +https://web.archive.org/web/20180106005235/http://www.lcis.com.tw/paper_store/paper_store/GPL162004A-507A_162005A-707AV10_code_reference-20147131205102.pdf + +*/ + +ROM_START( wlsair60 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x8400000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "wlsair60.nand", 0x0000, 0x8400000, CRC(eec23b97) SHA1(1bb88290cf54579a5bb51c08a02d793cd4d79f7a) ) +ROM_END + +ROM_START( jak_gtg ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "goldentee.bin", 0x0000, 0x4200000, CRC(87d5e815) SHA1(5dc46cd753b791449cc41d5eff4928c0dcaf35c0) ) +ROM_END + +ROM_START( jak_car2 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "cars2.bin", 0x0000, 0x4200000, CRC(4d610e09) SHA1(bc59f5f7f676a8f2a78dfda7fb62c804bbf850b6) ) +ROM_END + +ROM_START( jak_tsm ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "toystorymania.bin", 0x0000, 0x4200000, CRC(183b20a5) SHA1(eb4fa5ee9dfac58f5244d00d4e833b1e461cc52c) ) +ROM_END + + +ROM_START( jak_duck ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "duckcommander_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(d9356d5b) SHA1(aca05525b4a504f7ad264ae9bbc2f1f8f399c4ca) ) +ROM_END + +ROM_START( jak_swc ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "jakksstarwarspistol_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(024d49b8) SHA1(9694f4c7cd083c976ffbbcfa6f626fc6b4bc8d91) ) +ROM_END + +ROM_START( jak_wdzh ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "walkingdeadrifle_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(b2c762f0) SHA1(7e10df517cc24924e0ec55e2a263563023d945f8) ) +ROM_END + +ROM_START( jak_wdbg ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "amcwalkingdeadcrossbow_gpr27p512a_c276_as_hy27us08121a.bin", 0x0000, 0x4200000, CRC(66510fd4) SHA1(3ad6347c5a7758c035654cb3e96858320875b97a) ) +ROM_END + + +ROM_START( vbaby ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x8400000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "vbaby.bin", 0x0000, 0x8400000, CRC(d904441b) SHA1(3742bc4e1e403f061ce2813ecfafc6f30a44d287) ) +ROM_END + +ROM_START( mgtfit ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x8400000, "nandrom", ROMREGION_ERASE00 ) // Samsung 937 K9F1G08U0D Ident: 0xEC 0xF1 Full Ident: 0xECF1001540 + ROM_LOAD( "k9f1g08u0d.bin", 0x0000, 0x8400000, CRC(1ca5ac09) SHA1(c2e123085d2198999c2c0edb1df4895361c00a99) ) +ROM_END + +ROM_START( beambox ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION( 0x4200000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "beambox.bin", 0x0000, 0x4200000, CRC(a486f04e) SHA1(73c7d99d8922eba58d94e955e254b9c3baa4443e) ) +ROM_END + +// the JAKKS ones of these seem to be known as 'Generalplus GPAC500' hardware? +CONS(2009, smartfp, 0, 0, base, smartfp, gcm394_game_state, empty_init, "Fisher-Price", "Fun 2 Learn Smart Fit Park (Spain)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +CONS(200?, tkmag220, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "TaiKee", "Mini Arcade Games Console (Family Sport 220-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +// Fun 2 Learn 3-in-1 SMART SPORTS ? + +CONS(2009, jak_s500, 0, 0, wrlshunt, jak_s500, jak_s500_game_state, init_wrlshunt, "JAKKS Pacific Inc", "SpongeBob SquarePants Bikini Bottom 500 (JAKKS Pacific TV Motion Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +CONS(200?, jak_totm, 0, 0, wrlshunt, jak_s500, jak_s500_game_state, init_wrlshunt, "JAKKS Pacific Inc", "Toy Story - Toys on the Move (JAKKS Pacific TV Motion Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) + +CONS(2011, wrlshunt, 0, 0, wrlshunt, wrlshunt, wrlshunt_game_state, init_wrlshunt, "Hamy / Kids Station Toys Inc", "Wireless Hunting Video Game System", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +void generalplus_gpac800_game_state::machine_start() +{ + save_item(NAME(m_sdram)); +} + +void generalplus_gpac800_game_state::nand_create_stripped_region() +{ + uint8_t* rom = m_nandregion; + int size = memregion("nandrom")->bytes(); + m_size = size; + + int numblocks = size / m_nandblocksize; + m_strippedsize = numblocks * m_nandblocksize_stripped; + m_strippedrom.resize(m_strippedsize); + + for (int i = 0; i < numblocks; i++) + { + const int base = i * m_nandblocksize; + const int basestripped = i * m_nandblocksize_stripped; + + for (int j = 0; j < m_nandblocksize_stripped; j++) + { + m_strippedrom[basestripped + j] = rom[(base + j)]; + } + } + + // debug to allow for easy use of unidasm.exe + if (0) + { + FILE *fp; + char filename[256]; + sprintf(filename,"stripped_%s", machine().system().name); + fp=fopen(filename, "w+b"); + if (fp) + { + fwrite(&m_strippedrom[0], m_nandblocksize_stripped * numblocks, 1, fp); + fclose(fp); + } + } +} + +void generalplus_gpac800_game_state::machine_reset() +{ + // configure CS defaults + address_space& mem = m_maincpu->space(AS_PROGRAM); + mem.write_word(0x007820, 0x0047); + mem.write_word(0x007821, 0xff47); + mem.write_word(0x007822, 0x00c7); + mem.write_word(0x007823, 0x0047); + mem.write_word(0x007824, 0x0047); + + m_maincpu->set_cs_space(m_memory->get_program()); + + if (m_nandregion) + { + nand_create_stripped_region(); + + // up to 256 pages (16384kw) for each space + + // (size of cs0 + cs1 + cs2 + cs3 + cs4) <= 81920kwords + + // simulate bootstrap / internal ROM + + address_space& mem = m_maincpu->space(AS_PROGRAM); + + /* Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F + 00000000 (50 47 61 6E 64 6E 61 6E 64 6E)-- -- -- -- -- -- PGandnandn------ + 00000010 -- -- -- -- -- bb -- -- -- -- -- -- -- -- -- -- ---------------- + + bb = where to copy first block + + The header is GPnandnand (byteswapped) then some params + one of the params appears to be for the initial code copy operation done + by the bootstrap + */ + + // probably more bytes are used + int dest = m_strippedrom[0x15] << 8; + + // copy a block of code from the NAND to RAM + for (int i = 0; i < m_initial_copy_words; i++) + { + uint16_t word = m_strippedrom[(i * 2) + 0] | (m_strippedrom[(i * 2) + 1] << 8); + + mem.write_word(dest + i, word); + } + + // these vectors must either directly point to RAM, or at least redirect there after some code + uint16_t* internal = (uint16_t*)memregion("maincpu:internal")->base(); + internal[0x7ff5] = m_vectorbase + 0x0a; + internal[0x7ff6] = m_vectorbase + 0x0c; + internal[0x7ff7] = dest + 0x20; // point boot vector at code in RAM (probably in reality points to internal code that copies the first block) + internal[0x7ff8] = m_vectorbase + 0x10; + internal[0x7ff9] = m_vectorbase + 0x12; + internal[0x7ffa] = m_vectorbase + 0x14; + internal[0x7ffb] = m_vectorbase + 0x16; + internal[0x7ffc] = m_vectorbase + 0x18; + internal[0x7ffd] = m_vectorbase + 0x1a; + internal[0x7ffe] = m_vectorbase + 0x1c; + internal[0x7fff] = m_vectorbase + 0x1e; + } + + m_maincpu->reset(); // reset CPU so vector gets read etc. + + m_maincpu->set_paldisplaybank_high_hack(0); + m_maincpu->set_alt_tile_addressing_hack(1); +} + + +void generalplus_gpac800_game_state::nand_init210() +{ + m_sdram.resize(0x400000); // 0x400000 words (0x800000 bytes) + m_sdram2.resize(0x10000); + + m_nandblocksize = 0x210; + m_nandblocksize_stripped = 0x200; + + m_vectorbase = 0x6fe0; +} + +void generalplus_gpac800_game_state::nand_init840() +{ + m_sdram.resize(0x400000); // 0x400000 words (0x800000 bytes) + m_sdram2.resize(0x10000); + + m_nandblocksize = 0x840; + m_nandblocksize_stripped = 0x800; + + m_vectorbase = 0x6fe0; +} + +void generalplus_gpac800_game_state::nand_wlsair60() +{ + nand_init840(); + m_initial_copy_words = 0x2800; +} + +void generalplus_gpac800_game_state::nand_vbaby() +{ + nand_init840(); + m_initial_copy_words = 0x1000; + m_maincpu->set_romtype(2); +} + +void generalplus_gpac800_game_state::nand_tsm() +{ + + // something odd must be going on with the bootloader? + // structure has the first 0x4000 block repeated 3 times (must appear in RAM on startup?) + // then it has a 0x10000 block repeated 4 times (must get copied to 0x30000 by code) + // then it has the larger, main payload, just the once. + + // the addresses written to the NAND device don't compensate for these data repeats, however dump seems ok as no other data is being repeated? + // reads after startup still need checking + nand_init210(); + m_maincpu->set_romtype(1); +} + +void generalplus_gpac800_game_state::nand_beambox() +{ + nand_init210(); + m_vectorbase = 0x2fe0; +} + + + +// NAND dumps w/ internal bootstrap (and u'nSP 2.0 extended opcodes) (have gpnandnand strings) +// the JAKKS ones seem to be known as 'Generalplus GPAC800' hardware +CONS(2010, wlsair60, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_gtg, 0, 0, generalplus_gpac800, jak_gtg, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_car2, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Cars 2 (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_duck, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Duck Commander (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_swc, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Star Wars Clone Trooper (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_wdzh, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "The Walking Dead: Zombie Hunter (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_wdbg, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "The Walking Dead: Battleground (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_tsm , 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_tsm, "JAKKS Pacific Inc", "Toy Story Mania (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, beambox, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_beambox, "Hasbro", "Playskool Heroes Transformers Rescue Bots Beam Box (Spain)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, mgtfit, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "MGT", "Fitness Konsole (NC1470)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // probably has other names in English too? menus don't appear to be in German +CONS(200?, vbaby, 0, 0, generalplus_gpac800_vbaby, jak_car2, generalplus_gpac800_vbaby_game_state, nand_vbaby, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + + +ROM_START( bkrankp ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + //ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // used as bootstrap only + + ROM_REGION(0x400000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP( "unit_mx25l3206e_c22016.bin", 0x0000, 0x400000, CRC(7efad116) SHA1(427d707e97586ae6ab5fe08f29ca450ddc7ad36e) ) +ROM_END + + +void generalplus_gpspispi_game_state::init_spi() +{ + int vectorbase = 0x2fe0; + uint8_t* spirom = memregion("maincpu")->base(); + + address_space& mem = m_maincpu->space(AS_PROGRAM); + + /* Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F + + 00000000 50 47 70 73 73 69 69 70 70 73 44 00 44 3F 44 00 PGpssiipps + 00000010 -- -- -- -- -- bb -- -- -- -- -- -- -- -- -- -- + ^^ copy dest, just like with nand type + + bb = where to copy first block + + The header is GPspispi (byteswapped) then some params + one of the params appears to be for the initial code copy operation done + by the bootstrap + */ + + // probably more bytes are used + int dest = spirom[0x15] << 8; + + // copy a block of code from the NAND to RAM + for (int i = 0; i < 0x2000; i++) + { + uint16_t word = spirom[(i * 2) + 0] | (spirom[(i * 2) + 1] << 8); + + mem.write_word(dest + i, word); + } + + // these vectors must either directly point to RAM, or at least redirect there after some code + uint16_t* internal = (uint16_t*)memregion("maincpu:internal")->base(); + internal[0x7ff5] = vectorbase + 0x0a; + internal[0x7ff6] = vectorbase + 0x0c; + internal[0x7ff7] = dest + 0x20; // point boot vector at code in RAM (probably in reality points to internal code that copies the first block) + internal[0x7ff8] = vectorbase + 0x10; + internal[0x7ff9] = vectorbase + 0x12; + internal[0x7ffa] = vectorbase + 0x14; + internal[0x7ffb] = vectorbase + 0x16; + internal[0x7ffc] = vectorbase + 0x18; + internal[0x7ffd] = vectorbase + 0x1a; + internal[0x7ffe] = vectorbase + 0x1c; + internal[0x7fff] = vectorbase + 0x1e; +} + + +CONS(200?, bkrankp, 0, 0, generalplus_gpspispi_bkrankp, gcm394, generalplus_gpspispi_bkrankp_game_state , init_spi, "Bandai", "Karaoke Ranking Party (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) + + diff --git a/src/mame/drivers/sunplus_unsp20soc_mobigo.cpp b/src/mame/drivers/sunplus_unsp20soc_mobigo.cpp new file mode 100644 index 00000000000..5612e956b0f --- /dev/null +++ b/src/mame/drivers/sunplus_unsp20soc_mobigo.cpp @@ -0,0 +1,91 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + +#include "emu.h" +#include "includes/sunplus_unsp20soc.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" +#include "softlist_dev.h" +#include "screen.h" + + +class mobigo_state : public generalplus_gpac800_game_state +{ +public: + mobigo_state(const machine_config &mconfig, device_type type, const char *tag) : + generalplus_gpac800_game_state(mconfig, type, tag), + m_cart(*this, "cartslot") + { } + + void mobigo(machine_config &config); + +protected: + + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + required_device m_cart; +}; + + +static INPUT_PORTS_START( mobigo ) + PORT_START("IN0") + PORT_START("IN1") + PORT_START("IN2") +INPUT_PORTS_END + + + +DEVICE_IMAGE_LOAD_MEMBER(mobigo_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 image_init_result::PASS; +} + +void mobigo_state::mobigo(machine_config &config) +{ + GPAC800(config, m_maincpu, 96000000/2, m_screen); // Doesn't have GPnandnand header in NAND tho, so non-standard bootloader + m_maincpu->porta_in().set(FUNC(mobigo_state::porta_r)); + m_maincpu->portb_in().set(FUNC(mobigo_state::portb_r)); + m_maincpu->portc_in().set(FUNC(mobigo_state::portc_r)); + m_maincpu->porta_out().set(FUNC(mobigo_state::porta_w)); + m_maincpu->space_read_callback().set(FUNC(mobigo_state::read_external_space)); + m_maincpu->space_write_callback().set(FUNC(mobigo_state::write_external_space)); + m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); + m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); + m_maincpu->set_bootmode(0); // boot from internal ROM (NAND bootstrap) + m_maincpu->set_cs_config_callback(FUNC(mobigo_state::cs_callback)); + + m_maincpu->nand_read_callback().set(FUNC(mobigo_state::read_nand)); + + FULL_MEMORY(config, m_memory).set_map(&mobigo_state::cs_map_base); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + m_screen->set_screen_update("maincpu", FUNC(sunplus_gcm394_device::screen_update)); + m_screen->screen_vblank().set(m_maincpu, FUNC(sunplus_gcm394_device::vblank)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "mobigo_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(mobigo_state::cart_load)); + //m_cart->set_must_be_loaded(true); + + SOFTWARE_LIST(config, "cart_list").set_original("mobigo_cart"); +} + +ROM_START( mobigo2 ) + ROM_REGION16_BE( 0x40000, "maincpu:internal", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "internal.rom", 0x00000, 0x40000, NO_DUMP ) // doesn't have GPnandnand header in NAND, so bootstrap is likely custom + + ROM_REGION( 0x8400000, "nandrom", ROMREGION_ERASE00 ) + ROM_LOAD( "mobigo2_bios_ger.bin", 0x00000, 0x8400000, CRC(d5ab613d) SHA1(6fb104057dc3484fa958e2cb20c5dd0c19589f75) ) // SPANSION S34ML01G100TF100 +ROM_END + + +CONS( 200?, mobigo2, 0, 0, mobigo, mobigo, mobigo_state, nand_init840, "VTech", "MobiGo 2 (Germany)", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/vtech_mobigo.cpp b/src/mame/drivers/vtech_mobigo.cpp deleted file mode 100644 index 02c06279660..00000000000 --- a/src/mame/drivers/vtech_mobigo.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood - -#include "emu.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "softlist_dev.h" -#include "screen.h" - - -class mobigo_state : public driver_device -{ -public: - mobigo_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_cart(*this, "cartslot"), - m_screen(*this, "screen") - { } - - void mobigo(machine_config &config); - -protected: - - void video_start() override; - - uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); - - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); - required_device m_cart; - required_device m_screen; -}; - - -static INPUT_PORTS_START( mobigo ) -INPUT_PORTS_END - -void mobigo_state::video_start() -{ -} - -uint32_t mobigo_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - return 0; -} - -DEVICE_IMAGE_LOAD_MEMBER(mobigo_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 image_init_result::PASS; -} - -void mobigo_state::mobigo(machine_config &config) -{ - // CPU type not identified (ARM? S+Core?) - - GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "mobigo_cart"); - m_cart->set_width(GENERIC_ROM16_WIDTH); - m_cart->set_device_load(FUNC(mobigo_state::cart_load)); - m_cart->set_must_be_loaded(true); - - 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(mobigo_state::screen_update)); - - SOFTWARE_LIST(config, "cart_list").set_original("mobigo_cart"); -} - -ROM_START( mobigo2 ) - ROM_REGION( 0x8400000, "mainrom", 0 ) - ROM_LOAD( "mobigo2_bios_ger.bin", 0x00000, 0x8400000, CRC(d5ab613d) SHA1(6fb104057dc3484fa958e2cb20c5dd0c19589f75) ) // TODO: what type of NAND? -ROM_END - - -CONS( 200?, mobigo2, 0, 0, mobigo, mobigo, mobigo_state, empty_init, "VTech", "MobiGo 2 (Germany)", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp index 5f1656fd0e0..2acd2c6e5ad 100644 --- a/src/mame/drivers/xavix.cpp +++ b/src/mame/drivers/xavix.cpp @@ -547,6 +547,24 @@ static INPUT_PORTS_START( xavix_i2c ) INPUT_PORTS_END +static INPUT_PORTS_START( epo_tfit ) + PORT_INCLUDE(xavix) + + PORT_MODIFY("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // select + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // back + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_MODIFY("IN1") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda) +INPUT_PORTS_END + + static INPUT_PORTS_START( tomcpin ) PORT_INCLUDE(xavix_i2c) @@ -2355,7 +2373,6 @@ ROM_START( epo_ebox ) ROM_LOAD("exciteboxing.bin", 0x000000, 0x400000, CRC(e25ae4f5) SHA1(7f7b613f0ab8f43f5cad0d13de538921e77cae9c) ) ROM_END - ROM_START( ttv_sw ) ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) ROM_LOAD( "jedi.bin", 0x000000, 0x800000, CRC(51cae5fd) SHA1(1ed8d556f31b4182259ca8c766d60c824d8d9744) ) @@ -2381,6 +2398,7 @@ ROM_START( ban_onep ) ROM_LOAD("onepiece.bin", 0x000000, 0x800000, CRC(c5cb5a5f) SHA1(db85f6cc48d77c5a4967b9b8e2999167e3dfc8c8) ) ROM_END + CONS( 2002, epo_ebox, 0, 0, xavix2000_nv, epo_epp, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Excite Boxing (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // doesn't use XaviX2000 extra opcodes, but had that type of CPU // die not confirmed, but uses extra opcodes. (hangs on title screen due to combination of freq_timer_done nested interrupts tripping, and waiting on bits in input ports to change CONS( 2002, epo_bowl, 0, 0, xavix2000_i2c_24c02, epo_bowl, xavix_i2c_state, init_xavix, "Epoch / SSD Company LTD", "Excite Bowling (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) @@ -2487,6 +2505,11 @@ ROM_START( tmy_thom ) ROM_LOAD( "thomastank.bin", 0x000000, 0x800000, CRC(a52a23be) SHA1(e5b3500239d9e56eb5405f7585982959e5a162da) ) ROM_END +ROM_START( epo_tfit ) + ROM_REGION(0x400000, "bios", ROMREGION_ERASE00) + ROM_LOAD("tennisfitness.bin", 0x000000, 0x400000, CRC(cbf65bd2) SHA1(30b3da6f061b2dd91679db42a050f715901beb87) ) +ROM_END + CONS( 2004, xavtenni, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Tennis (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) CONS( 2004, xavbaseb, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Baseball (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) @@ -2520,5 +2543,7 @@ CONS( 2007, domdance, 0, 0, xavix2002_i2c_jmat, xavixp, xavix_i2c_jmat_state, in CONS( 2005, mrangbat, 0, 0, xavix2002_i2c_mrangbat, mrangbat, xavix_i2c_state, init_xavix, "Bandai / SSD Company LTD", "Mahou Taiketsu Magiranger - Magimat de Dance & Battle (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 2004, epo_tfit, 0, 0, xavix2002_i2c_24c04, epo_tfit, xavix_i2c_state, init_xavix, "Epoch / SSD Company LTD", "Excite Sports Tennis x Fitness (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) + // TODO: does it have an SEEPROM? why does it hang? full title? CONS( 2005, tmy_thom, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "Tomy / SSD Company LTD", "Thomas and Friends (Tomy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/includes/sunplus_unsp20soc.h b/src/mame/includes/sunplus_unsp20soc.h new file mode 100644 index 00000000000..c08145bd21b --- /dev/null +++ b/src/mame/includes/sunplus_unsp20soc.h @@ -0,0 +1,302 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood +#ifndef MAME_INCLUDES_SUNPLUS_GCM394_H +#define MAME_INCLUDES_SUNPLUS_GCM394_H + +#pragma once + +#include "machine/sunplus_gcm394.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" + +#include "screen.h" +#include "speaker.h" + + +class full_memory_device : + public device_t, + public device_memory_interface +{ +public: + // construction/destruction + full_memory_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + // configuration helpers + template full_memory_device& set_map(T &&... args) { set_addrmap(0, std::forward(args)...); return *this; } + + template full_memory_device& map(T &&... args) { set_addrmap(0, std::forward(args)...); return *this; } + + address_space* get_program() { return m_program; } + +protected: + virtual void device_start() override; + virtual void device_config_complete() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + +private: + // internal state + address_space_config m_program_config; + address_space *m_program; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(FULL_MEMORY, full_memory_device) + + + +class gcm394_game_state : public driver_device +{ +public: + gcm394_game_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_io(*this, "IN%u", 0U), + m_romregion(*this, "maincpu"), + m_memory(*this, "memory") + { + } + + void base(machine_config &config); + + void cs_map_base(address_map &map); + + virtual DECLARE_READ16_MEMBER(cs0_r); + virtual DECLARE_WRITE16_MEMBER(cs0_w); + virtual DECLARE_READ16_MEMBER(cs1_r); + virtual DECLARE_WRITE16_MEMBER(cs1_w); + virtual DECLARE_READ16_MEMBER(cs2_r); + virtual DECLARE_WRITE16_MEMBER(cs2_w); + virtual DECLARE_READ16_MEMBER(cs3_r); + virtual DECLARE_WRITE16_MEMBER(cs3_w); + virtual DECLARE_READ16_MEMBER(cs4_r); + virtual DECLARE_WRITE16_MEMBER(cs4_w); + + void cs_callback(uint16_t cs0, uint16_t cs1, uint16_t cs2, uint16_t cs3, uint16_t cs4); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + + required_device m_maincpu; + required_device m_screen; + + + required_ioport_array<3> m_io; + + + optional_region_ptr m_romregion; + required_device m_memory; + + virtual DECLARE_READ16_MEMBER(porta_r); + virtual DECLARE_READ16_MEMBER(portb_r); + virtual DECLARE_READ16_MEMBER(portc_r); + virtual DECLARE_WRITE16_MEMBER(porta_w); + + virtual DECLARE_READ16_MEMBER(read_external_space); + virtual DECLARE_WRITE16_MEMBER(write_external_space); + +private: +}; + + +class generalplus_gpac800_game_state : public gcm394_game_state +{ +public: + generalplus_gpac800_game_state(const machine_config& mconfig, device_type type, const char* tag) : + gcm394_game_state(mconfig, type, tag), + m_nandregion(*this, "nandrom"), + m_initial_copy_words(0x2000) + { + } + + void generalplus_gpac800(machine_config &config); + + void nand_init210(); + void nand_init840(); + void nand_wlsair60(); + void nand_vbaby(); + void nand_tsm(); + void nand_beambox(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + DECLARE_READ8_MEMBER(read_nand); + std::vector m_sdram; + std::vector m_sdram2; + + virtual DECLARE_READ16_MEMBER(cs0_r) override; + virtual DECLARE_WRITE16_MEMBER(cs0_w) override; + virtual DECLARE_READ16_MEMBER(cs1_r) override; + virtual DECLARE_WRITE16_MEMBER(cs1_w) override; + +private: + optional_region_ptr m_nandregion; + + void nand_create_stripped_region(); + + std::vector m_strippedrom; + int m_strippedsize; + int m_size; + int m_nandblocksize; + int m_nandblocksize_stripped; + + int m_initial_copy_words; + int m_vectorbase; +}; + + +class generalplus_gpac800_vbaby_game_state : public generalplus_gpac800_game_state +{ +public: + generalplus_gpac800_vbaby_game_state(const machine_config& mconfig, device_type type, const char* tag) : + generalplus_gpac800_game_state(mconfig, type, tag), + m_cart(*this, "cartslot") + { + } + + void generalplus_gpac800_vbaby(machine_config &config); + +protected: + required_device m_cart; + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + +private: +}; + + +class generalplus_gpspispi_game_state : public gcm394_game_state +{ +public: + generalplus_gpspispi_game_state(const machine_config& mconfig, device_type type, const char* tag) : + gcm394_game_state(mconfig, type, tag) + { + } + + void generalplus_gpspispi(machine_config &config); + + void init_spi(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: +}; + + + +class generalplus_gpspispi_bkrankp_game_state : public generalplus_gpspispi_game_state +{ +public: + generalplus_gpspispi_bkrankp_game_state(const machine_config& mconfig, device_type type, const char* tag) : + generalplus_gpspispi_game_state(mconfig, type, tag), + m_cart(*this, "cartslot") + { + } + + void generalplus_gpspispi_bkrankp(machine_config &config); + +protected: + required_device m_cart; + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); + +private: +}; + + + +class tkmag220_game_state : public gcm394_game_state +{ +public: + tkmag220_game_state(const machine_config& mconfig, device_type type, const char* tag) : + gcm394_game_state(mconfig, type, tag) + { + } + + void tkmag220(machine_config &config); + +protected: + + /* + virtual DECLARE_READ16_MEMBER(porta_r) override + { + return machine().rand(); + } + + virtual DECLARE_READ16_MEMBER(portb_r) override + { + return machine().rand(); + } + + virtual DECLARE_WRITE16_MEMBER(porta_w) override + { + } + */ + +private: + + virtual DECLARE_READ16_MEMBER(cs0_r) override + { + return m_romregion[offset & 0x3ffffff]; + } +}; + +class wrlshunt_game_state : public gcm394_game_state +{ +public: + wrlshunt_game_state(const machine_config& mconfig, device_type type, const char* tag) : + gcm394_game_state(mconfig, type, tag) + { + } + + void wrlshunt(machine_config &config); + + void init_wrlshunt(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + std::vector m_sdram; + + virtual DECLARE_READ16_MEMBER(porta_r) override; + virtual DECLARE_WRITE16_MEMBER(porta_w) override; + +private: + + + //required_shared_ptr m_mainram; + + virtual DECLARE_READ16_MEMBER(cs0_r) override; + virtual DECLARE_WRITE16_MEMBER(cs0_w) override; + virtual DECLARE_READ16_MEMBER(cs1_r) override; + virtual DECLARE_WRITE16_MEMBER(cs1_w) override; +}; + +class jak_s500_game_state : public wrlshunt_game_state +{ +public: + jak_s500_game_state(const machine_config& mconfig, device_type type, const char* tag) : + wrlshunt_game_state(mconfig, type, tag) + { + } + +protected: + //virtual void machine_start() override; + virtual void machine_reset() override; + + virtual DECLARE_READ16_MEMBER(porta_r) override; + virtual DECLARE_READ16_MEMBER(portb_r) override; + +private: +}; + +#endif diff --git a/src/mame/machine/elan_eu3a05gpio.h b/src/mame/machine/elan_eu3a05gpio.h index c476a303641..28372741a92 100644 --- a/src/mame/machine/elan_eu3a05gpio.h +++ b/src/mame/machine/elan_eu3a05gpio.h @@ -16,7 +16,7 @@ public: auto read_0_callback() { return m_read_0_callback.bind(); } auto read_1_callback() { return m_read_1_callback.bind(); } auto read_2_callback() { return m_read_2_callback.bind(); } - + DECLARE_READ8_MEMBER(gpio_r); DECLARE_WRITE8_MEMBER(gpio_w); diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 1f30efed645..722b504f6a4 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -16202,9 +16202,6 @@ ecm6127 // hyhoo // (c) 1987 hyhoo2 // (c) 1987 -@source:hyperscan.cpp -hs // - @source:hyperspt.cpp hpolym84 // GX330 (c) 1984 hyperspt // GX330 (c) 1984 + Centuri @@ -19034,9 +19031,6 @@ lethalj // (c) 1996 The Game Room ripribit // (c) 1997 LAI Games ripribita // (c) 1997 LAI Games -@source:lexibook_jg7425.cpp -lx_jg7425 - @source:lft.cpp lft1230 // lft1510 // @@ -31331,6 +31325,7 @@ afbm7800 bandgpad cpatrolm ts_handy11 +ablwikid @source:nes_vt.cpp vdogdeme @@ -37005,6 +37000,13 @@ conyping // conyfght karaokd2 +@source:spg29x.cpp +hyprscan // +jak_bbsf + +@source:spg29x_lexibook_jg7425.cpp +lx_jg7425 + @source:spg2xx.cpp rad_skat // rad_skatp // @@ -37017,6 +37019,7 @@ tvsprt10 // decathln wiwi18 // guitarfv +guitarss jjstrip tmntmutm @@ -37050,6 +37053,7 @@ jak_pooh // jak_care // jak_nick // jak_sbfc // +tvtchsw @source:spg2xx_lexibook.cpp lexizeus // Lexibook @@ -37682,7 +37686,7 @@ srangero // (c) 1988 srangerw // (c) 1988 SunA (WDK License) starfigh // (c) 1990 SunA -@source:sunplus_gcm394.cpp +@source:sunplus_unsp20soc.cpp jak_s500 jak_totm smartfp // Smart Fit Park @@ -37701,6 +37705,9 @@ mgtfit beambox bkrankp +@source:sunplus_unsp20soc_mobigo.cpp +mobigo2 + @source:supbtime.cpp chinatwn // MAK (c) 1991 Data East Corporation (Japan) supbtime // MAE (c) 1990 Data East Corporation (World) @@ -40271,9 +40278,6 @@ laser700 // 1984? Laser 700 @source:vtech_eu3a12.cpp vreadere -@source:vtech_mobigo.cpp -mobigo2 - @source:vulgus.cpp mach9 // bootleg (ITISA) vulgus // 5/1984 (c) 1984 @@ -41220,6 +41224,7 @@ epo_epp // epo_eppk // epo_epp3 // epo_efdx // +epo_tfit epo_ebox // epo_sdb // epo_guru // diff --git a/src/mame/mess.flt b/src/mame/mess.flt index b9949207298..c834077f2a3 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -377,7 +377,7 @@ hunter2.cpp hunter16.cpp husky.cpp hx20.cpp -hyperscan.cpp +spg29x.cpp i7000.cpp ibm3153.cpp ibm6580.cpp @@ -453,7 +453,7 @@ leapfrog_leappad.cpp leapster.cpp learnwin.cpp lee1214.cpp -lexibook_jg7425.cpp +spg29x_lexibook_jg7425.cpp lft.cpp lg-dvd.cpp lilith.cpp @@ -835,7 +835,8 @@ sun2.cpp sun3.cpp sun3x.cpp sun4.cpp -sunplus_gcm394.cpp +sunplus_unsp20soc.cpp +sunplus_unsp20soc_mobigo.cpp super6.cpp super80.cpp superga2.cpp @@ -993,7 +994,6 @@ vta2000.cpp vtech1.cpp vtech2.cpp vtech_eu3a12.cpp -vtech_mobigo.cpp wangpc.cpp wicat.cpp wrinkles.cpp diff --git a/src/mame/video/xavix.cpp b/src/mame/video/xavix.cpp index 2c576515c83..541d026b97b 100644 --- a/src/mame/video/xavix.cpp +++ b/src/mame/video/xavix.cpp @@ -836,7 +836,7 @@ uint32_t xavix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, uint16_t start = ((m_bmp_base[0x11] << 8) | m_bmp_base[0x10]); uint8_t end = m_bmp_base[0x12]; // ?? related to width? uint8_t size = m_bmp_base[0x13]; // some kind of additional scaling? - uint8_t mode = m_bmp_base[0x14]; // eanble,bpp, zval etc. + uint8_t mode = m_bmp_base[0x14]; // enable,bpp, zval etc. uint32_t unused = ((m_bmp_base[0x15] << 16) | (m_bmp_base[0x16] << 8) | (m_bmp_base[0x17] << 0)); @@ -856,29 +856,35 @@ uint32_t xavix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, int width = (rgtadr * 8) / bpp; //int count = 0; - set_data_address(base + base2, 0); - for (int y = top; y < 256; y++) + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - for (int x = 0; x < width; x++) + int line = y - top; + + if ((line > 0) && (y < bot)) { - uint32_t* yposptr = &bitmap.pix32(y); - uint16_t* zyposptr = &m_zbuffer.pix16(y); + set_data_address(base + base2 + ((line * width * bpp) / 8), 0); - uint8_t dat = 0; - for (int i = 0; i < bpp; i++) + for (int x = 0; x < width; x++) { - dat |= (get_next_bit() << i); - } + uint32_t* yposptr = &bitmap.pix32(y); + uint16_t* zyposptr = &m_zbuffer.pix16(y); - if (((x <= cliprect.max_x) && (x >= cliprect.min_x)) && ((y <= cliprect.max_y) && (y >= cliprect.min_y))) - { - if ((m_bmp_palram_sh[dat] & 0x1f) < 24) // same transparency logic as everything else? (baseball title) + uint8_t dat = 0; + for (int i = 0; i < bpp; i++) + { + dat |= (get_next_bit() << i); + } + + if (((x <= cliprect.max_x) && (x >= cliprect.min_x)) && ((y <= cliprect.max_y) && (y >= cliprect.min_y))) { - if (zval >= zyposptr[x]) + if ((m_bmp_palram_sh[dat] & 0x1f) < 24) // same transparency logic as everything else? (baseball title) { - yposptr[x] = paldata[dat + 0x100]; - zyposptr[x] = zval; + if (zval >= zyposptr[x]) + { + yposptr[x] = paldata[dat + 0x100]; + zyposptr[x] = zval; + } } } } -- cgit v1.2.3