diff options
author | David Haywood <28625134+DavidHaywood@users.noreply.github.com> | 2020-03-13 16:10:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 12:10:36 -0400 |
commit | 9e990af6aace3d42f141ff4f4f8e3873083a5bec (patch) | |
tree | 72468b3a9fe7ef8cc094f41149f0226385c657f9 | |
parent | c861181b46601eaab83f6ef17d60051f0e955551 (diff) |
Pug and Play work (#6434)
* new clones
---
Spider-Man (JAKKS Pacific TV Game) (older hardware, set 2) [Sean Riddle]
* (nw)
* sh6578 work (nw)
* new NOT WORKING
----
Fox Sports 7 in 1 Sports Games Plug n' Play [Sean Riddle, David Haywood]
Ford Racing [Sean Riddle, David Haywood]
- some sh6578 work (nw)
* new NOT WORKING
----
Lazer Tag Video Game Module [Sean Riddle, David Haywood]
(quickly hits unimplemented 00F596: divq mr, r2)
* sh6578 input tweaks (nw)
* sh6578 gfx work (nw)
* sh6578 video work (nw)
* sh6578 - use m6502 type instead of n2a03 type as apparently most of these clones follow that pattern (nw)
* sh6578 - use logmacro (nw)
* sh6578 misc work (nw)
-rw-r--r-- | src/devices/machine/spg110.cpp | 32 | ||||
-rw-r--r-- | src/devices/machine/spg110.h | 3 | ||||
-rw-r--r-- | src/devices/machine/spg110_video.cpp | 33 | ||||
-rw-r--r-- | src/devices/machine/spg110_video.h | 2 | ||||
-rw-r--r-- | src/mame/drivers/nes_sh6578.cpp | 458 | ||||
-rw-r--r-- | src/mame/drivers/spg110.cpp | 23 | ||||
-rw-r--r-- | src/mame/drivers/spg2xx.cpp | 176 | ||||
-rw-r--r-- | src/mame/drivers/sunplus_unsp20soc.cpp | 12 | ||||
-rw-r--r-- | src/mame/includes/sunplus_unsp20soc.h | 2 | ||||
-rw-r--r-- | src/mame/mame.lst | 4 |
10 files changed, 646 insertions, 99 deletions
diff --git a/src/devices/machine/spg110.cpp b/src/devices/machine/spg110.cpp index d5b607c3d37..b02362b3780 100644 --- a/src/devices/machine/spg110.cpp +++ b/src/devices/machine/spg110.cpp @@ -16,21 +16,22 @@ DEFINE_DEVICE_TYPE(SPG110, spg110_device, "spg110", "SPG110 System-on-a-Chip") -spg110_device::spg110_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal) - : unsp_device(mconfig, type, tag, owner, clock, internal) - , device_mixer_interface(mconfig, *this, 2) - , m_screen(*this, finder_base::DUMMY_TAG) - , m_spg_io(*this, "spg_io") - , m_spg_video(*this, "spg_video") - , m_spg_audio(*this, "spgaudio") - , m_porta_out(*this) - , m_portb_out(*this) - , m_portc_out(*this) - , m_porta_in(*this) - , m_portb_in(*this) - , m_portc_in(*this) - , m_adc_in(*this) - , m_chip_sel(*this) +spg110_device::spg110_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal) : + unsp_device(mconfig, type, tag, owner, clock, internal), + device_mixer_interface(mconfig, *this, 2), + m_screen(*this, finder_base::DUMMY_TAG), + m_spg_io(*this, "spg_io"), + m_spg_video(*this, "spg_video"), + m_spg_audio(*this, "spgaudio"), + m_porta_out(*this), + m_portb_out(*this), + m_portc_out(*this), + m_porta_in(*this), + m_portb_in(*this), + m_portc_in(*this), + m_adc_in(*this), + m_chip_sel(*this), + m_is_spiderman(false) { } @@ -182,4 +183,5 @@ void spg110_device::device_start() void spg110_device::device_reset() { unsp_device::device_reset(); + m_spg_video->set_video_irq_spidman(m_is_spiderman); } diff --git a/src/devices/machine/spg110.h b/src/devices/machine/spg110.h index 126035fff3e..f24c68ddf09 100644 --- a/src/devices/machine/spg110.h +++ b/src/devices/machine/spg110.h @@ -26,6 +26,8 @@ public: m_screen.set_tag(std::forward<T>(screen_tag)); } + void set_video_irq_spidman(bool is_spiderman) { m_is_spiderman = is_spiderman; } + auto porta_out() { return m_porta_out.bind(); } auto portb_out() { return m_portb_out.bind(); } auto portc_out() { return m_portc_out.bind(); } @@ -87,6 +89,7 @@ private: void configure_spg_io(spg2xx_io_device* io); DECLARE_WRITE_LINE_MEMBER(videoirq_w); + bool m_is_spiderman; }; DECLARE_DEVICE_TYPE(SPG110, spg110_device) diff --git a/src/devices/machine/spg110_video.cpp b/src/devices/machine/spg110_video.cpp index 6ec0ee6c5f4..067f901e22a 100644 --- a/src/devices/machine/spg110_video.cpp +++ b/src/devices/machine/spg110_video.cpp @@ -6,20 +6,20 @@ DEFINE_DEVICE_TYPE(SPG110_VIDEO, spg110_video_device, "spg110_video", "SPG110 System-on-a-Chip (Video)") -spg110_video_device::spg110_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, type, tag, owner, clock) - , device_memory_interface(mconfig, *this) - , m_space_config("spg110_video", ENDIANNESS_BIG, 16, 32, 0, address_map_constructor(FUNC(spg110_video_device::map_video), this)) - , m_cpu(*this, finder_base::DUMMY_TAG) - , m_screen(*this, finder_base::DUMMY_TAG) - , m_palette(*this, "palette") - , m_gfxdecode(*this, "gfxdecode") - , m_palram(*this, "palram") - , m_palctrlram(*this, "palctrlram") - , m_sprtileno(*this, "sprtileno") - , m_sprattr1(*this, "sprattr1") - , m_sprattr2(*this, "sprattr2") - , m_video_irq_cb(*this) +spg110_video_device::spg110_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + device_memory_interface(mconfig, *this), + m_space_config("spg110_video", ENDIANNESS_BIG, 16, 32, 0, address_map_constructor(FUNC(spg110_video_device::map_video), this)), + m_cpu(*this, finder_base::DUMMY_TAG), + m_screen(*this, finder_base::DUMMY_TAG), + m_palette(*this, "palette"), + m_gfxdecode(*this, "gfxdecode"), + m_palram(*this, "palram"), + m_palctrlram(*this, "palctrlram"), + m_sprtileno(*this, "sprtileno"), + m_sprattr1(*this, "sprattr1"), + m_sprattr2(*this, "sprattr2"), + m_video_irq_cb(*this) { } @@ -550,11 +550,6 @@ void spg110_video_device::device_start() save_item(NAME(m_2036_scroll)); m_video_irq_cb.resolve(); - - if (!strcmp(machine().system().name, "jak_spdmo")) - m_is_spiderman = true; - else - m_is_spiderman = false; } void spg110_video_device::device_reset() diff --git a/src/devices/machine/spg110_video.h b/src/devices/machine/spg110_video.h index bd8a7fa8e04..59b052c4476 100644 --- a/src/devices/machine/spg110_video.h +++ b/src/devices/machine/spg110_video.h @@ -27,6 +27,8 @@ public: m_screen.set_tag(std::forward<U>(screen_tag)); } + void set_video_irq_spidman(bool is_spiderman) { m_is_spiderman = is_spiderman; } + void map_video(address_map &map); double hue2rgb(double p, double q, double t); diff --git a/src/mame/drivers/nes_sh6578.cpp b/src/mame/drivers/nes_sh6578.cpp index 4d6ab147ed7..e3407e7f9c0 100644 --- a/src/mame/drivers/nes_sh6578.cpp +++ b/src/mame/drivers/nes_sh6578.cpp @@ -11,13 +11,22 @@ */ #include "emu.h" -#include "cpu/m6502/n2a03.h" +#include "cpu/m6502/m6502.h" +#include "sound/nes_apu.h" #include "emupal.h" #include "screen.h" #include "speaker.h" #include "machine/bankdev.h" #include "machine/timer.h" +#define LOG_DMA (1U << 1) +#define LOG_PPU (1U << 0) + +//#define VERBOSE (LOG_PPU) +#define VERBOSE (0) + +#include "logmacro.h" + class nes_sh6578_state : public driver_device { public: @@ -28,10 +37,14 @@ public: m_fullrom(*this, "fullrom"), m_vram(*this, "vram"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_apu(*this, "nesapu"), + m_timer(*this, "timer"), + m_in(*this, "IN%u", 0U) { } void nes_sh6578(machine_config& config); + void nes_sh6578_pal(machine_config& config); void init_nes_sh6578(); @@ -43,12 +56,14 @@ protected: WRITE8_MEMBER(sprite_dma_w); private: - required_device<n2a03_device> m_maincpu; + required_device<cpu_device> m_maincpu; required_memory_bank m_bank; required_device<address_map_bank_device> m_fullrom; required_device<address_map_bank_device> m_vram; required_device<screen_device> m_screen; required_device<palette_device> m_palette; + required_device<nesapu_device> m_apu; + required_device<timer_device> m_timer; rgb_t nespal_to_RGB(int color_intensity, int color_num); @@ -80,12 +95,27 @@ private: DECLARE_WRITE8_MEMBER(timing_setting_control_w); DECLARE_WRITE8_MEMBER(initial_startup_w); + DECLARE_WRITE8_MEMBER(irq_mask_w); + DECLARE_WRITE8_MEMBER(timer_config_w); + DECLARE_WRITE8_MEMBER(timer_value_w); DECLARE_WRITE8_MEMBER(write_ppu); DECLARE_READ8_MEMBER(read_ppu); DECLARE_WRITE8_MEMBER(write_palette); DECLARE_READ8_MEMBER(read_palette); + DECLARE_READ8_MEMBER(io0_r); + DECLARE_READ8_MEMBER(io1_r); + DECLARE_WRITE8_MEMBER(io_w); + + DECLARE_READ8_MEMBER(psg1_4014_r); + DECLARE_READ8_MEMBER(psg1_4015_r); + DECLARE_WRITE8_MEMBER(psg1_4015_w); + DECLARE_WRITE8_MEMBER(psg1_4017_w); + DECLARE_READ8_MEMBER(apu_read_mem); + + DECLARE_WRITE_LINE_MEMBER(apu_irq); + int m_iniital_startup_state; std::vector<uint8_t> m_palette_ram; @@ -98,6 +128,18 @@ private: uint8_t m_dma_length[2]; uint8_t m_2000; + uint8_t m_2001; + uint8_t m_2002; + uint8_t m_2003; + uint8_t m_2004; + uint16_t m_scrollreg; + bool m_scrollreg_firstwrite; + + uint16_t m_vramaddr; + uint8_t m_2007; + + uint8_t m_irqmask; + uint8_t m_colsel_pntstart; TIMER_DEVICE_CALLBACK_MEMBER(scanline); @@ -107,7 +149,18 @@ private: void vram_map(address_map& map); void nes_sh6578_map(address_map& map); + uint16_t get_tileaddress(uint8_t x, uint8_t y, bool ishigh); + uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); + + TIMER_DEVICE_CALLBACK_MEMBER(timer_expired); + int m_timerval; + + // this might be game specific + uint8_t m_previo; + uint8_t m_iolatch[2]; + bool m_isbanked; + required_ioport_array<2> m_in; }; TIMER_DEVICE_CALLBACK_MEMBER(nes_sh6578_state::scanline) @@ -159,14 +212,14 @@ READ8_MEMBER(nes_sh6578_state::dma_r) { switch (offset) { - case 0x00: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Control : %02x\n", machine().describe_context(), offset); return m_dma_control; - case 0x01: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Bank Select : %02x\n", machine().describe_context(), offset); return m_dma_bank; - case 0x02: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Source Address Low : %02x\n", machine().describe_context(), offset); return m_dma_source[0]; - case 0x03: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Source Address High : %02x\n", machine().describe_context(), offset); return m_dma_source[1]; - case 0x04: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Destination Address Low : %02x\n", machine().describe_context(), offset); return m_dma_dest[0]; - case 0x05: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Destination Address High : %02x\n", machine().describe_context(), offset); return m_dma_dest[1]; - case 0x06: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Length Low : %02x\n", machine().describe_context(), offset); return m_dma_length[0]; - case 0x07: logerror("%s: nes_sh6578_state::dma_r offset %01x : DMA Length High : %02x\n", machine().describe_context(), offset); return m_dma_length[1]; + case 0x00: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Control : %02x\n", machine().describe_context(), offset, m_dma_control); return m_dma_control & 0x7f; + case 0x01: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Bank Select\n", machine().describe_context(), offset); return m_dma_bank; + case 0x02: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Source Address Low\n", machine().describe_context(), offset); return m_dma_source[0]; + case 0x03: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Source Address High\n", machine().describe_context(), offset); return m_dma_source[1]; + case 0x04: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Destination Address Low\n", machine().describe_context(), offset); return m_dma_dest[0]; + case 0x05: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Destination Address High\n", machine().describe_context(), offset); return m_dma_dest[1]; + case 0x06: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Length Low\n", machine().describe_context(), offset); return m_dma_length[0]; + case 0x07: LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_r offset %01x : DMA Length High\n", machine().describe_context(), offset); return m_dma_length[1]; } return 0x00; } @@ -179,7 +232,7 @@ void nes_sh6578_state::do_dma() uint16_t dma_dest = m_dma_dest[0] | (m_dma_dest[1] << 8); uint16_t dma_length = m_dma_length[0] | (m_dma_length[1] << 8); - logerror("Doing DMA :%02x bank:%02x: source:%04x dest:%04x length:%04x\n", m_dma_control, m_dma_bank, dma_source, dma_dest, dma_length); + LOGMASKED(LOG_DMA, "Doing DMA :%02x bank:%02x: source:%04x dest:%04x length:%04x\n", m_dma_control, m_dma_bank, dma_source, dma_dest, dma_length); uint16_t realsourceaddress = dma_source; uint16_t realdestaddress = dma_dest; @@ -214,8 +267,11 @@ void nes_sh6578_state::do_dma() realsourceaddress++; realdestaddress++; } - } + + // but games seem to be making quite a few DMA writes with lengths that seem too large? buggy code? + //m_dma_length[0] = 0; + //m_dma_length[1] = 0; } WRITE8_MEMBER(nes_sh6578_state::dma_w) @@ -223,43 +279,43 @@ WRITE8_MEMBER(nes_sh6578_state::dma_w) switch (offset) { case 0x0: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Control : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Control : %02x\n", machine().describe_context(), offset, data); m_dma_control = data; do_dma(); break; case 0x1: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Bank Select : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Bank Select : %02x\n", machine().describe_context(), offset, data); m_dma_bank = data; break; case 0x2: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Source Address Low : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Source Address Low : %02x\n", machine().describe_context(), offset, data); m_dma_source[0] = data; break; case 0x3: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Source Address High : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Source Address High : %02x\n", machine().describe_context(), offset, data); m_dma_source[1] = data; break; case 0x4: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Destination Address Low : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Destination Address Low : %02x\n", machine().describe_context(), offset, data); m_dma_dest[0] = data; break; case 0x5: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Destination Address High : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Destination Address High : %02x\n", machine().describe_context(), offset, data); m_dma_dest[1] = data; break; case 0x6: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Length Low : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Length Low : %02x\n", machine().describe_context(), offset, data); m_dma_length[0] = data; break; case 0x7: - logerror("%s: nes_sh6578_state::dma_w offset %01x : DMA Length High : %02x\n", machine().describe_context(), offset, data); + LOGMASKED(LOG_DMA, "%s: nes_sh6578_state::dma_w offset %01x : DMA Length High : %02x\n", machine().describe_context(), offset, data); m_dma_length[1] = data; break; } @@ -306,6 +362,35 @@ WRITE8_MEMBER(nes_sh6578_state::initial_startup_w) } } +WRITE8_MEMBER(nes_sh6578_state::irq_mask_w) +{ + m_irqmask = data; + + if (m_irqmask & 0x80) + m_maincpu->set_input_line(0, CLEAR_LINE); +} + +WRITE8_MEMBER(nes_sh6578_state::timer_config_w) +{ + logerror("%s: nes_sh6578_state::timer_config_w : %02x (at pos y: %d x: %d )\n", machine().describe_context(), data, m_screen->vpos(), m_screen->hpos() ); + + if ((data & 0x80) && (data & 0x20)) + { + m_timer->adjust(m_screen->scan_period() * m_timerval); + } + else + { + m_timer->adjust(attotime::never); + } +} + +WRITE8_MEMBER(nes_sh6578_state::timer_value_w) +{ + logerror("%s: nes_sh6578_state::timer_value_w : %02x\n", machine().describe_context(), data); + m_timerval = data; +} + + WRITE8_MEMBER(nes_sh6578_state::timing_setting_control_w) { logerror("%s: nes_sh6578_state::timing_setting_control_w : %02x\n", machine().describe_context(), data); @@ -385,13 +470,13 @@ rgb_t nes_sh6578_state::nespal_to_RGB(int color_intensity, int color_num) READ8_MEMBER(nes_sh6578_state::read_palette) { - logerror("%s: nes_sh6578_state::read_ppu : Palette Entry %02x\n", machine().describe_context(), offset); + //logerror("%s: nes_sh6578_state::read_ppu : Palette Entry %02x\n", machine().describe_context(), offset); return m_palette_ram[offset]; } WRITE8_MEMBER(nes_sh6578_state::write_palette) { - logerror("%s: nes_sh6578_state::write_ppu : Palette Entry %02x : %02x\n", machine().describe_context(), offset, data); + //logerror("%s: nes_sh6578_state::write_ppu : Palette Entry %02x : %02x\n", machine().describe_context(), offset, data); m_palette_ram[offset] = data; rgb_t col = nespal_to_RGB((data & 0x30) >> 4, data & 0x0f); @@ -404,7 +489,7 @@ READ8_MEMBER(nes_sh6578_state::read_ppu) switch (offset) { case 0x08: - logerror("%s: nes_sh6578_state::read_ppu : Color Select & PNT Start Address\n", machine().describe_context()); + LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::read_ppu : Color Select & PNT Start Address\n", machine().describe_context()); return m_colsel_pntstart; case 0x00: @@ -420,8 +505,13 @@ READ8_MEMBER(nes_sh6578_state::read_ppu) return ret; } + case 0x01: return m_2001; + case 0x03: return m_2003; + case 0x04: return m_2004; + case 0x07: return m_2007; + default: - //return ppu2c0x_device::read(space, offset); + LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::read_ppu : unhandled offset %02x\n", machine().describe_context(), offset); return 0x00; } } @@ -431,13 +521,54 @@ WRITE8_MEMBER(nes_sh6578_state::write_ppu) switch (offset) { case 0x08: - logerror("%s: nes_sh6578_state::write_ppu : Color Select & PNT Start Address : %02x\n", machine().describe_context(), data); + LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu : Color Select & PNT Start Address : %02x\n", machine().describe_context(), data); m_colsel_pntstart = data; break; - case 0x00: - m_2000 = data; + case 0x00: m_2000 = data; LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); break; + case 0x01: m_2001 = data; LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); break; + case 0x02: m_2002 = data; LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); break; + case 0x03: m_2003 = data; LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); break; + case 0x04: m_2004 = data; LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); break; + case 0x05: + { + LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); + if (m_scrollreg_firstwrite) + { + m_scrollreg = (m_scrollreg & 0xff00) | data; + m_scrollreg_firstwrite = false; + + } + else + { + m_scrollreg = (m_scrollreg & 0x00ff) | (data<<8); + m_scrollreg_firstwrite = true; + } + + break; + } + + case 0x06: + { + LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); + m_vramaddr <<= 8; + m_vramaddr = (m_vramaddr & 0xff00) | data; + logerror(" vram address is now %04x\n", m_vramaddr); break; + } + + case 0x07: + { + LOGMASKED(LOG_PPU, "%s: nes_sh6578_state::write_ppu offset %02x : %02x\n", machine().describe_context(), offset, data); + m_vram->write8(m_vramaddr, data); + + if (m_2000 & 4) + m_vramaddr += 64; // big race and pioneer racing in ts_handy11 need this to be 64, not 32 + else + m_vramaddr++; + + break; + } default: break; @@ -445,6 +576,75 @@ WRITE8_MEMBER(nes_sh6578_state::write_ppu) } } +READ8_MEMBER(nes_sh6578_state::io0_r) +{ + uint8_t ret = m_iolatch[0] & 0x01; + m_iolatch[0] >>= 1; + return ret; +} + +READ8_MEMBER(nes_sh6578_state::io1_r) +{ + uint8_t ret = m_iolatch[1] & 0x01; + m_iolatch[1] >>= 1; + return ret; +} + +WRITE8_MEMBER(nes_sh6578_state::io_w) +{ + if ((data != 0x00) && (data != 0x01) && (data != 0x02) && (data != 0x03)) + logerror("%s: io_w : unexpected value : %02x\n", machine().describe_context(), data); + + if ((m_previo & 0x01) != (data & 0x01)) + { + // latch on rising or falling? + if (!(data & 0x01)) + { + m_iolatch[0] = m_in[0]->read(); + m_iolatch[1] = m_in[1]->read(); + } + } + + if (m_isbanked) + { + m_bank->set_entry((data>>1)&1); + } + + m_previo = data; +} + + +READ8_MEMBER(nes_sh6578_state::psg1_4014_r) +{ + return m_apu->read(0x14); +} + +READ8_MEMBER(nes_sh6578_state::psg1_4015_r) +{ + return m_apu->read(0x15); +} + +WRITE8_MEMBER(nes_sh6578_state::psg1_4015_w) +{ + m_apu->write(0x15, data); +} + +WRITE8_MEMBER(nes_sh6578_state::psg1_4017_w) +{ + m_apu->write(0x17, data); +} + +WRITE_LINE_MEMBER(nes_sh6578_state::apu_irq) +{ + // unimplemented +} + +READ8_MEMBER(nes_sh6578_state::apu_read_mem) +{ + return m_maincpu->space(AS_PROGRAM).read_byte(offset); +} + + void nes_sh6578_state::nes_sh6578_map(address_map& map) { @@ -455,9 +655,19 @@ void nes_sh6578_state::nes_sh6578_map(address_map& map) map(0x4014, 0x4014).w(FUNC(nes_sh6578_state::sprite_dma_w)); + map(0x4000, 0x4013).rw(m_apu, FUNC(nesapu_device::read), FUNC(nesapu_device::write)); + map(0x4014, 0x4014).r(FUNC(nes_sh6578_state::psg1_4014_r)); + map(0x4015, 0x4015).rw(FUNC(nes_sh6578_state::psg1_4015_r), FUNC(nes_sh6578_state::psg1_4015_w)); + map(0x4016, 0x4016).rw(FUNC(nes_sh6578_state::io0_r), FUNC(nes_sh6578_state::io_w)); + map(0x4017, 0x4017).rw(FUNC(nes_sh6578_state::io1_r), FUNC(nes_sh6578_state::psg1_4017_w)); + map(0x4020, 0x4020).w(FUNC(nes_sh6578_state::timing_setting_control_w)); map(0x4031, 0x4031).w(FUNC(nes_sh6578_state::initial_startup_w)); + map(0x4032, 0x4032).w(FUNC(nes_sh6578_state::irq_mask_w)); + + map(0x4034, 0x4034).w(FUNC(nes_sh6578_state::timer_config_w)); + map(0x4035, 0x4035).w(FUNC(nes_sh6578_state::timer_value_w)); map(0x4040, 0x4047).rw(FUNC(nes_sh6578_state::bankswitch_r), FUNC(nes_sh6578_state::bankswitch_w)); @@ -479,6 +689,18 @@ void nes_sh6578_state::nes_sh6578_map(address_map& map) } static INPUT_PORTS_START(nes_sh6578) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY + + PORT_START("IN1") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END void nes_sh6578_state::video_start() @@ -496,12 +718,39 @@ void nes_sh6578_state::machine_reset() m_palette_ram[i] = 0x00; m_iniital_startup_state = 0; + m_bank->set_entry(0); + + m_2000 = 0; + m_2001 = 0; + m_2002 = 0; + m_2003 = 0; + m_2004 = 0; + m_2007 = 0; + + m_scrollreg = 0x00; + m_scrollreg_firstwrite = true; + + m_colsel_pntstart = 0; + + m_irqmask = 0xff; + m_timerval = 0x00; } void nes_sh6578_state::machine_start() { m_bank->configure_entry(0, memregion("maincpu")->base() + 0x0000000); m_bank->set_entry(0); + + if (memregion("maincpu")->bytes() == 0x200000) + { + m_isbanked = true; + m_bank->configure_entry(1, memregion("maincpu")->base() + 0x100000); + } + else + { + m_isbanked = false; + } + } // SH6578 can address 20-bit address space (1MB of ROM) @@ -513,21 +762,83 @@ void nes_sh6578_state::rom_map(address_map& map) void nes_sh6578_state::vram_map(address_map& map) { map(0x0000, 0x27ff).ram(); + map(0x2800, 0x7fff).nopr(); map(0x8000, 0xffff).ram(); } +uint16_t nes_sh6578_state::get_tileaddress(uint8_t x, uint8_t y, bool ishigh) +{ + if (!ishigh) + { + x &= 0x3f; // can't be bigger than 64x64; + y &= 0x3f; + + if (x & 0x20) // right hand side of tilemap + { + x &= 0x1f; + if (y & 0x20) // bottom of tilemap + { + y &= 0x1f; + return 0x1800 + (x * 2) + (y * 0x40); + } + else + { + //y &= 0x1f; + return 0x0800 + (x * 2) + (y * 0x40); + } + } + else // left hand side of tilemap + { + //x &= 0x1f; + if (y & 0x20) // bottom of tilemap + { + y &= 0x1f; + return 0x1000 + (x * 2) + (y * 0x40); + } + else + { + //y &= 0x1f; + return 0x0000 + (x * 2) + (y * 0x40); + } + } + } + else + { + x &= 0x1f; + y &= 0x1f; + + return 0x2000 + (x * 2) + (y * 0x40); + } +} uint32_t nes_sh6578_state::screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect) { - // nametable base depends on bits in 0x2008, it isn't fixed at 0x2000 as it is on a NES - int address = 0; const pen_t *paldata = m_palette->pens(); // pages are 32 tiles high, not 30 as on NES - for (int y = 0; y < 32; y++) + for (int scanline = cliprect.min_y; scanline <= cliprect.max_y; scanline++) { + int xscrollmsb = m_2000 & 0x1; + int yscrollmsb = (m_2000 & 0x2)>>1; + + uint16_t yscroll = (m_scrollreg & 0xff00) >> 8; + yscroll |= (yscrollmsb << 8); + + uint16_t xscroll = m_scrollreg & 0x00ff; + xscroll |= (xscrollmsb << 8); + + int realy = scanline + yscroll; + + int y = realy >> 3; + int tileline = realy & 7; + for (int x = 0; x < 32; x++) { + int xtile = x + (xscroll >> 3); + + // nametable base depends on bits in 0x2008, it isn't fixed at 0x2000 as it is on a NES + uint16_t address = get_tileaddress(xtile, y, (m_colsel_pntstart & 1) ? true : false); + // character gfx pointer and palette select are encoded in a pair of bytes, not using separate attribute table for palette uint16_t tileaddr; tileaddr = (m_vram->read8(address) << 0); @@ -539,41 +850,54 @@ uint32_t nes_sh6578_state::screen_update(screen_device& screen, bitmap_rgb32& bi tileaddr &= 0x0fff; tileaddr <<= 4; - for (int yy = 0; yy < 8; yy++) - { - uint32_t* destptr = &bitmap.pix32((y*8)+ yy); - - uint8_t plane0 = m_vram->read8(tileaddr+0); - uint8_t plane1 = m_vram->read8(tileaddr+8); - uint8_t plane2 = m_vram->read8(tileaddr+16); - uint8_t plane3 = m_vram->read8(tileaddr+24); - for (int xx = 0; xx < 8; xx++) - { - uint8_t pixval = ((plane0 >> (7-xx)) & 1) << 0; - pixval |= ((plane1 >> (7-xx)) & 1) << 1; - pixval |= ((plane2 >> (7-xx)) & 1) << 2; - pixval |= ((plane3 >> (7-xx)) & 1) << 3; + uint32_t* destptr = &bitmap.pix32(scanline); - pixval |= ((pal & 0xc) << 2); + uint8_t plane0 = m_vram->read8(tileaddr+0+tileline); + uint8_t plane1 = m_vram->read8(tileaddr+8+tileline); + uint8_t plane2 = m_vram->read8(tileaddr+16+tileline); + uint8_t plane3 = m_vram->read8(tileaddr+24+tileline); - destptr[(x * 8) + xx] = paldata[pixval]; - } + for (int xx = 0; xx < 8; xx++) + { + uint8_t pixval = ((plane0 >> (7-xx)) & 1) << 0; + pixval |= ((plane1 >> (7-xx)) & 1) << 1; + pixval |= ((plane2 >> (7-xx)) & 1) << 2; + pixval |= ((plane3 >> (7-xx)) & 1) << 3; - tileaddr++; + pixval |= ((pal & 0xc) << 2); + destptr[(x * 8) + xx] = paldata[pixval]; } - } } return 0; } +TIMER_DEVICE_CALLBACK_MEMBER(nes_sh6578_state::timer_expired) +{ + if (!(m_irqmask & 0x80)) + { + //printf("timer expired on line %d\n", m_screen->vpos()); + m_maincpu->set_input_line(0, ASSERT_LINE); + } + + m_timer->adjust(attotime::never); +} + + +// from n2a03.h verify that it actually uses these +#define N2A03_NTSC_XTAL XTAL(21'477'272) +#define N2A03_PAL_XTAL XTAL(26'601'712) +#define NTSC_APU_CLOCK (N2A03_NTSC_XTAL/12) /* 1.7897726666... MHz */ +#define PAL_APU_CLOCK (N2A03_PAL_XTAL/16) /* 1.662607 MHz */ +#define PALC_APU_CLOCK (N2A03_PAL_XTAL/15) /* 1.77344746666... MHz */ + void nes_sh6578_state::nes_sh6578(machine_config& config) { /* basic machine hardware */ - N2A03(config, m_maincpu, NTSC_APU_CLOCK); + M6502(config, m_maincpu, NTSC_APU_CLOCK); // regular M6502 core, not N2A03? m_maincpu->set_addrmap(AS_PROGRAM, &nes_sh6578_state::nes_sh6578_map); ADDRESS_MAP_BANK(config, m_fullrom).set_map(&nes_sh6578_state::rom_map).set_options(ENDIANNESS_NATIVE, 8, 20, 0x100000); @@ -588,15 +912,35 @@ void nes_sh6578_state::nes_sh6578(machine_config& config) m_screen->set_size(32 * 8, 262); m_screen->set_visarea(0 * 8, 32 * 8 - 1, 0 * 8, 30 * 8 - 1); m_screen->set_screen_update(FUNC(nes_sh6578_state::screen_update)); + m_screen->set_video_attributes(VIDEO_UPDATE_SCANLINE); + + TIMER(config, m_timer).configure_periodic(FUNC(nes_sh6578_state::timer_expired), attotime::never); PALETTE(config, m_palette).set_entries(0x40); /* sound hardware */ SPEAKER(config, "mono").front_center(); - m_maincpu->add_route(ALL_OUTPUTS, "mono", 0.50); + + // have to add the APU separately due to using M6502 + NES_APU(config, m_apu, NTSC_APU_CLOCK); + m_apu->irq().set(FUNC(nes_sh6578_state::apu_irq)); + m_apu->mem_read().set(FUNC(nes_sh6578_state::apu_read_mem)); + m_apu->add_route(ALL_OUTPUTS, "mono", 0.50); } +void nes_sh6578_state::nes_sh6578_pal(machine_config& config) +{ + nes_sh6578(config); + + m_maincpu->set_clock(PALC_APU_CLOCK); + m_apu->set_clock(PALC_APU_CLOCK); + m_screen->set_refresh_hz(50.0070); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((113.66 / (PALC_APU_CLOCK.dvalue() / 1000000)) * + (310 - 291 + 1 + 2))); + m_screen->set_size(32 * 8, 312); + m_screen->set_visarea(0 * 8, 32 * 8 - 1, 0 * 8, 30 * 8 - 1); +} void nes_sh6578_state::init_nes_sh6578() { @@ -625,12 +969,12 @@ ROM_START( ablwikid ) ROM_END -CONS( 1997, bandgpad, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Bandai", "Multi Game Player Gamepad", MACHINE_NOT_WORKING ) +CONS( 1997, bandgpad, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Bandai", "Multi Game Player Gamepad", 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( 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, "<unknown>", "City Patrolman", MACHINE_NOT_WORKING ) +CONS( 200?, cpatrolm, 0, 0, nes_sh6578_pal, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "TimeTop", "City Patrolman", MACHINE_NOT_WORKING ) -// this writes the 0x65 0x76 startup code to 0x4031, but the ROM is larger than expected, extra banking? -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 +// ROM is banked +CONS( 200?, ablwikid, 0, 0, nes_sh6578_pal, 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/spg110.cpp b/src/mame/drivers/spg110.cpp index 637553a8f15..cc6a8048528 100644 --- a/src/mame/drivers/spg110.cpp +++ b/src/mame/drivers/spg110.cpp @@ -31,13 +31,14 @@ class spg110_game_state : public driver_device { public: - spg110_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") + spg110_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") { } void spg110_base(machine_config &config); + void spg110_spdmo(machine_config& config); DECLARE_CUSTOM_INPUT_MEMBER(plunger_r); @@ -508,6 +509,12 @@ void spg110_game_state::spg110_base(machine_config &config) m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); } +void spg110_game_state::spg110_spdmo(machine_config& config) +{ + spg110_base(config); + m_maincpu->set_video_irq_spidman(true); +} + ROM_START( jak_capb ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "classicarcadepinball.bin", 0x000000, 0x200000, CRC(b643dab0) SHA1(f57d546758ba442e28b5f0f48b3819b2fc2eb7f7) ) @@ -519,6 +526,11 @@ ROM_START( jak_spdmo ) ROM_LOAD16_WORD_SWAP( "spidermaneyes.bin", 0x000000, 0x200000, CRC(d5eaa6ae) SHA1(df226d378b41cf6ef90b9f72e48ff5e66385dcba) ) ROM_END +ROM_START( jak_spdmoa ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "spiderman.bin", 0x000000, 0x200000, CRC(b2a5a55a) SHA1(93c87ac0387997b753d4f0fb894a0dd02138b460) ) +ROM_END + ROM_START( conyteni ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "tennis_m29w160eb.bin", 0x000000, 0x200000, CRC(70050f17) SHA1(929f0d8599b7380b5994684424bb91063c4f6569) ) @@ -550,7 +562,8 @@ ROM_END // JAKKS Pacific Inc TV games CONS( 2004, jak_capb, 0, 0, spg110_base, jak_capb, spg110_game_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Classic Arcade Pinball (JAKKS Pacific TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2004, jak_spdmo, jak_spdm, 0, spg110_base, jak_spdmo, spg110_game_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Spider-Man (JAKKS Pacific TV Game) (older hardware)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // this is the smaller more 'square' style joystick that was originally released before the GameKey slot was added. +CONS( 2004, jak_spdmo, jak_spdm, 0, spg110_spdmo, jak_spdmo, spg110_game_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Spider-Man (JAKKS Pacific TV Game) (older hardware, set 1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // this is the smaller more 'square' style joystick that was originally released before the GameKey slot was added. +CONS( 2004, jak_spdmoa,jak_spdm, 0, spg110_spdmo, jak_spdmo, spg110_game_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Spider-Man (JAKKS Pacific TV Game) (older hardware, set 2)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // this is the resdesigned stick, but before the GameKey release // this was sold by SDW Games for the US market, ROM not yet verified to be the same, also appears in some mutligames? CONS( 2003, conyteni, 0, 0, spg110_base, conyteni, spg110_game_state, empty_init, "Conny", "TV Virtual Tennis", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // needs motion inputs, and video fixes, setting to PAL diff --git a/src/mame/drivers/spg2xx.cpp b/src/mame/drivers/spg2xx.cpp index b5a73dc14a5..42d15ee6cbb 100644 --- a/src/mame/drivers/spg2xx.cpp +++ b/src/mame/drivers/spg2xx.cpp @@ -646,6 +646,158 @@ static INPUT_PORTS_START( abltenni ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END +static INPUT_PORTS_START( fordrace ) + 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_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( comil ) PORT_START("EXTRA0") PORT_BIT( 0x1, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("50:50") @@ -1226,6 +1378,12 @@ ROM_START( abltenni ) ROM_LOAD16_WORD_SWAP( "ablpnpwirelesstennis.bin", 0x000000, 0x400000, CRC(66bd8ef1) SHA1(a83640d5d9e84e10d29a065a61e0d7bbec16c6e4) ) ROM_END +ROM_START( fordrace ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "fordracing_29lv320ct_00c222a7.bin", 0x000000, 0x400000, CRC(998cad17) SHA1(98a65e9e0ec17e3366e0ac6ddc2d852a7efb360e) ) +ROM_END + + ROM_START( comil ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "ukmillionaire.bin", 0x000000, 0x400000, CRC(b7e8e126) SHA1(fc76dba672eb5c4c115e16d8ea4a45a6e859f87c) ) @@ -1241,6 +1399,10 @@ ROM_START( decathln ) ROM_LOAD16_WORD_SWAP( "decathlon.bin", 0x000000, 0x400000, CRC(63c8e6b6) SHA1(6a25b68b45336e04a2bfd75b43a494349024d714) ) ROM_END +ROM_START( foxsport ) + ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "foxsports.bin", 0x000000, 0x1000000, CRC(a5092f49) SHA1(feb4d432486b17d6cd2aed8cefd3d084f77c1733) ) // only a tiny amount of data in the 2nd half, what's it used for (if anything) +ROM_END ROM_START( wiwi18 ) ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) @@ -1309,9 +1471,12 @@ void spg2xx_game_state::init_crc() void spg2xx_game_state::init_wiwi18() { uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); - rom[0x1ca259] = 0xf165; + if (rom[0x1ca259]==0x4e04) rom[0x1ca259] = 0xf165; // wiwi18 + if (rom[0x1355a4]==0x4e04) rom[0x1355a4] = 0xf165; // foxsport } + + void spg2xx_game_state::init_tvsprt10() { uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); @@ -1346,6 +1511,9 @@ CONS( 2007, rad_fb2, 0, 0, rad_skat, rad_fb2, spg2xx_game_state, ini // ABL TV Games CONS( 2006, abltenni, 0, 0, abltenni, abltenni, spg2xx_game_state, empty_init, "Advance Bright Ltd / V-Tac Technology Co Ltd.", "Wireless Tennis (WT2000, ABL TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2006, fordrace, 0, 0, abltenni, fordrace, spg2xx_game_state, empty_init, "Excalibur Electronics", "Ford Racing", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + + CONS( 2008, comil, 0, 0, comil, comil, spg2xx_game_comil_state, empty_init, "Character Options", "Who Wants to Be a Millionaire? (Character Options, Plug and Play, UK)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // same as Excalibur Decathlon? not the same as the ABL game @@ -1372,7 +1540,11 @@ CONS( 2008, swclone, 0, 0, swclone, swclone, spg2xx_game_s // Mattel games CONS( 2005, mattelcs, 0, 0, rad_skat, mattelcs, spg2xx_game_state, empty_init, "Mattel", "Mattel Classic Sports", MACHINE_IMPERFECT_SOUND ) +// both the WiWi and Fox Sports units seem to be related to the 'Virtual Interactive' (aka 'Vi') console + // box marked 'Wireless game console' 'Drahtlose Spielekonsole' 87 Sports games included : 18 hyper sports games, 69 arcade games. // Unit marked 'Hamy System' 'WiWi' // actually a cartridge, but all hardware is in the cart, overriding any internal hardware entirely. see nes_vt.cp 'mc_sp69' for the '69 arcade game' part -CONS( 200?, wiwi18, 0, 0, rad_skat, wiwi18, spg2xx_game_state, init_wiwi18, "Hamy System", "WiWi 18-in-1 Sports Game", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, wiwi18, 0, 0, rad_skat, wiwi18, spg2xx_game_state, init_wiwi18, "Hamy System", "WiWi 18-in-1 Sports Game", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +CONS( 200?, foxsport,0, 0, rad_skat, wiwi18, spg2xx_game_state, init_wiwi18, "Excalibur Electronics", "Fox Sports 7 in 1 Sports Games Plug n' Play", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/sunplus_unsp20soc.cpp b/src/mame/drivers/sunplus_unsp20soc.cpp index dc52866dfc2..cf0c6c9cfba 100644 --- a/src/mame/drivers/sunplus_unsp20soc.cpp +++ b/src/mame/drivers/sunplus_unsp20soc.cpp @@ -155,7 +155,7 @@ void gcm394_game_state::cs_map_base(address_map& map) READ16_MEMBER(wrlshunt_game_state::cs0_r) { - return m_romregion[offset & 0x3ffffff]; + return m_romregion[offset & m_romwords_mask]; } WRITE16_MEMBER(wrlshunt_game_state::cs0_w) @@ -177,6 +177,7 @@ WRITE16_MEMBER(wrlshunt_game_state::cs1_w) void wrlshunt_game_state::machine_start() { + m_romwords_mask = (memregion("maincpu")->bytes()/2)-1; save_item(NAME(m_sdram)); } @@ -1321,6 +1322,14 @@ ROM_START( tkmag220 ) ROM_LOAD16_WORD_SWAP( "u1g-2a.u2", 0x0000000, 0x8000000, CRC(0fd769a1) SHA1(df19402bcd20075483d63fb98fb3fa42bd33ccfd) ) ROM_END +ROM_START(lazertag) + //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(0x1000000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD16_WORD_SWAP("lazertag.bin", 0x000000, 0x1000000, CRC(8bf16a28) SHA1(90d05e1876332324b074e4845e28b90fcb007122) ) +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 ) @@ -1594,6 +1603,7 @@ CONS(2013, gormiti, 0, 0, base, gormiti, gcm394_game_state, empty_init, "Gioc // also sold as "Pac-Man Connect & Play 35th Anniversary" (same ROM?) CONS(2012, paccon, 0, 0, paccon, paccon, jak_s500_game_state, init_wrlshunt, "Bandai", "Pac-Man Connect & Play (Feb 14 2012 10:46:23)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) +CONS(2008, lazertag, 0, 0, wrlshunt, jak_s500, jak_s500_game_state, init_wrlshunt, "Tiger Electronics", "Lazer Tag Video Game Module", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) 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(2009, jak_smwm, 0, 0, wrlshunt, jak_s500, jak_s500_game_state, init_wrlshunt, "JAKKS Pacific Inc", "Spider-Man Web Master (JAKKS Pacific TV Motion Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) diff --git a/src/mame/includes/sunplus_unsp20soc.h b/src/mame/includes/sunplus_unsp20soc.h index ce4c06360d8..5fe6b29a8ea 100644 --- a/src/mame/includes/sunplus_unsp20soc.h +++ b/src/mame/includes/sunplus_unsp20soc.h @@ -284,6 +284,8 @@ private: virtual DECLARE_WRITE16_MEMBER(cs0_w) override; virtual DECLARE_READ16_MEMBER(cs1_r) override; virtual DECLARE_WRITE16_MEMBER(cs1_w) override; + + int m_romwords_mask; }; class jak_s500_game_state : public wrlshunt_game_state diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 1c9e80f4ecb..f18bf0331eb 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -37124,6 +37124,7 @@ speglsht // (c) 1994 Seta @source:spg110.cpp jak_capb // jak_spdmo // +jak_spdmoa conyteni // conyping // conyfght @@ -37145,9 +37146,11 @@ rad_fb2 // mattelcs // comil // abltenni // +fordrace tvsprt10 // decathln wiwi18 // +foxsport guitarfv guitarss jjstrip @@ -37838,6 +37841,7 @@ starfigh // (c) 1990 SunA @source:sunplus_unsp20soc.cpp paccon +lazertag jak_s500 jak_smwm jak_pf |