mirror of
https://github.com/holub/mame
synced 2025-10-04 08:28:39 +03:00
Merge pull request #4811 from DavidHaywood/250319
SPG110 - use some SPG24X I/O handling to give inputs in Classic Arcade Pinball
This commit is contained in:
commit
b4cfd4f501
@ -2624,6 +2624,8 @@ if (MACHINES["SPG2XX"]~=null) then
|
||||
MAME_DIR .. "src/devices/machine/spg2xx.h",
|
||||
MAME_DIR .. "src/devices/machine/spg2xx_audio.cpp",
|
||||
MAME_DIR .. "src/devices/machine/spg2xx_audio.h",
|
||||
MAME_DIR .. "src/devices/machine/spg2xx_io.cpp",
|
||||
MAME_DIR .. "src/devices/machine/spg2xx_io.h",
|
||||
MAME_DIR .. "src/devices/machine/spg110.cpp",
|
||||
MAME_DIR .. "src/devices/machine/spg110.h",
|
||||
}
|
||||
|
@ -17,13 +17,23 @@
|
||||
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)
|
||||
: device_t(mconfig, type, tag, owner, clock),
|
||||
device_memory_interface(mconfig, *this),
|
||||
m_space_config("spg110", ENDIANNESS_BIG, 16, 32, 0, address_map_constructor(FUNC(spg110_device::map_video), this)),
|
||||
m_cpu(*this, finder_base::DUMMY_TAG),
|
||||
m_palette(*this, "palette"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palram(*this, "palram")
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, device_memory_interface(mconfig, *this)
|
||||
, m_space_config("spg110", ENDIANNESS_BIG, 16, 32, 0, address_map_constructor(FUNC(spg110_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_spg_io(*this, "spg_io")
|
||||
, 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}, {*this}}
|
||||
, m_chip_sel(*this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -210,7 +220,24 @@ static GFXDECODE_START( gfx )
|
||||
GFXDECODE_ENTRY( ":maincpu", 0, charlayout6, 0, 16 ) // correct for lots of the tiles inc. startup text
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
void spg110_device::configure_spg_io(spg2xx_io_device* io)
|
||||
{
|
||||
io->porta_in().set(FUNC(spg110_device::porta_r));
|
||||
io->portb_in().set(FUNC(spg110_device::portb_r));
|
||||
io->portc_in().set(FUNC(spg110_device::portc_r));
|
||||
io->porta_out().set(FUNC(spg110_device::porta_w));
|
||||
io->portb_out().set(FUNC(spg110_device::portb_w));
|
||||
io->portc_out().set(FUNC(spg110_device::portc_w));
|
||||
io->adc_in<0>().set(FUNC(spg110_device::adc_r<0>));
|
||||
io->adc_in<1>().set(FUNC(spg110_device::adc_r<1>));
|
||||
io->chip_select().set(FUNC(spg110_device::cs_w));
|
||||
// io->pal_read_callback().set(FUNC(spg110_device::get_pal_r));
|
||||
// io->write_timer_irq_callback().set(FUNC(spg110_device::timerirq_w));
|
||||
// io->write_uart_adc_irq_callback().set(FUNC(spg110_device::uartirq_w));
|
||||
// io->write_external_irq_callback().set(FUNC(spg110_device::extirq_w));
|
||||
// io->write_ffrq_tmr1_irq_callback().set(FUNC(spg110_device::ffreq1_w));
|
||||
// io->write_ffrq_tmr2_irq_callback().set(FUNC(spg110_device::ffreq2_w));
|
||||
}
|
||||
|
||||
void spg110_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
@ -222,6 +249,10 @@ void spg110_device::device_add_mconfig(machine_config &config)
|
||||
PALETTE(config, m_palette, palette_device::BLACK, 256);
|
||||
|
||||
GFXDECODE(config, m_gfxdecode, m_palette, gfx);
|
||||
|
||||
SPG24X_IO(config, m_spg_io, DERIVED_CLOCK(1, 1), m_cpu, m_screen);
|
||||
configure_spg_io(m_spg_io);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -250,25 +281,6 @@ WRITE16_MEMBER(spg110_device::spg110_2063_w)
|
||||
m_cpu->set_state_unsynced(UNSP_IRQ0_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
READ16_MEMBER(spg110_device::datasegment_r)
|
||||
{
|
||||
uint16_t val = m_cpu->get_ds();
|
||||
return val;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(spg110_device::datasegment_w)
|
||||
{
|
||||
m_cpu->set_ds(data & 0x3f);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(spg110_device::spg110_3221_w)
|
||||
{
|
||||
/* first write on startup? */
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(spg110_device::spg110_3223_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3225_w) { }
|
||||
|
||||
|
||||
WRITE16_MEMBER(spg110_device::spg110_201c_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_2020_w) { }
|
||||
@ -351,17 +363,6 @@ READ16_MEMBER(spg110_device::dma_len_status_r)
|
||||
READ16_MEMBER(spg110_device::spg110_2037_r) { return 0x0000; }
|
||||
READ16_MEMBER(spg110_device::spg110_2042_r) { return 0x0000; }
|
||||
|
||||
WRITE16_MEMBER(spg110_device::spg110_3200_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3201_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3203_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3204_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3206_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3208_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3209_w) { }
|
||||
|
||||
READ16_MEMBER(spg110_device::spg110_3201_r) { return 0x0000; }
|
||||
READ16_MEMBER(spg110_device::spg110_3225_r) { return 0x0000; }
|
||||
READ16_MEMBER(spg110_device::spg110_322c_r) { return 0x0000; }
|
||||
|
||||
WRITE16_MEMBER(spg110_device::spg110_3100_w) { }
|
||||
WRITE16_MEMBER(spg110_device::spg110_3101_w) { }
|
||||
@ -520,24 +521,7 @@ void spg110_device::map(address_map &map)
|
||||
map(0x00310f, 0x00310f).r(FUNC(spg110_device::spg110_310f_r));
|
||||
|
||||
// 0032xx looks like it could be the same as 003d00 on spg2xx
|
||||
map(0x003200, 0x003200).w(FUNC(spg110_device::spg110_3200_w));
|
||||
|
||||
map(0x003201, 0x003201).rw(FUNC(spg110_device::spg110_3201_r),FUNC(spg110_device::spg110_3201_w));
|
||||
|
||||
map(0x003203, 0x003203).w(FUNC(spg110_device::spg110_3203_w));
|
||||
map(0x003204, 0x003204).w(FUNC(spg110_device::spg110_3204_w));
|
||||
|
||||
map(0x003206, 0x003206).w(FUNC(spg110_device::spg110_3206_w));
|
||||
|
||||
map(0x003208, 0x003208).w(FUNC(spg110_device::spg110_3208_w));
|
||||
map(0x003209, 0x003209).w(FUNC(spg110_device::spg110_3209_w));
|
||||
|
||||
map(0x003221, 0x003221).w(FUNC(spg110_device::spg110_3221_w));
|
||||
map(0x003223, 0x003223).w(FUNC(spg110_device::spg110_3223_w));
|
||||
map(0x003225, 0x003225).rw(FUNC(spg110_device::spg110_3225_r),FUNC(spg110_device::spg110_3225_w));
|
||||
map(0x00322c, 0x00322c).r(FUNC(spg110_device::spg110_322c_r));
|
||||
|
||||
map(0x00322f, 0x00322f).rw(FUNC(spg110_device::datasegment_r),FUNC(spg110_device::datasegment_w));
|
||||
map(0x003200, 0x00322f).rw(m_spg_io, FUNC(spg2xx_io_device::io_r), FUNC(spg2xx_io_device::io_w));
|
||||
}
|
||||
|
||||
// this seems to be a different, non-cpu mapped space only accessible via the DMA?
|
||||
@ -574,6 +558,17 @@ void spg110_device::device_start()
|
||||
save_item(NAME(m_bg_scrollx));
|
||||
save_item(NAME(m_bg_scrolly));
|
||||
save_item(NAME(m_2036_scroll));
|
||||
|
||||
m_porta_out.resolve_safe();
|
||||
m_portb_out.resolve_safe();
|
||||
m_portc_out.resolve_safe();
|
||||
m_porta_in.resolve_safe(0);
|
||||
m_portb_in.resolve_safe(0);
|
||||
m_portc_in.resolve_safe(0);
|
||||
m_adc_in[0].resolve_safe(0x0fff);
|
||||
m_adc_in[1].resolve_safe(0x0fff);
|
||||
m_chip_sel.resolve_safe();
|
||||
|
||||
}
|
||||
|
||||
void spg110_device::device_reset()
|
||||
|
@ -9,6 +9,7 @@
|
||||
//#include "spg2xx.h"
|
||||
#include "cpu/unsp/unsp.h"
|
||||
#include "emupal.h"
|
||||
#include "spg2xx_io.h"
|
||||
|
||||
|
||||
class spg110_device : public device_t, public device_memory_interface
|
||||
@ -18,11 +19,12 @@ public:
|
||||
spg110_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
spg110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
template <typename T>
|
||||
spg110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
|
||||
template <typename T, typename U>
|
||||
spg110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&screen_tag)
|
||||
: spg110_device(mconfig, tag, owner, clock)
|
||||
{
|
||||
m_cpu.set_tag(std::forward<T>(cpu_tag));
|
||||
m_screen.set_tag(std::forward<U>(screen_tag));
|
||||
}
|
||||
|
||||
void map(address_map &map);
|
||||
@ -32,6 +34,17 @@ public:
|
||||
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(vblank);
|
||||
|
||||
auto porta_out() { return m_porta_out.bind(); }
|
||||
auto portb_out() { return m_portb_out.bind(); }
|
||||
auto portc_out() { return m_portc_out.bind(); }
|
||||
auto porta_in() { return m_porta_in.bind(); }
|
||||
auto portb_in() { return m_portb_in.bind(); }
|
||||
auto portc_in() { return m_portc_in.bind(); }
|
||||
|
||||
template <size_t Line> auto adc_in() { return m_adc_in[Line].bind(); }
|
||||
|
||||
auto chip_select() { return m_chip_sel.bind(); }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
@ -66,9 +79,11 @@ private:
|
||||
};
|
||||
|
||||
required_device<unsp_device> m_cpu;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_shared_ptr<uint16_t> m_palram;
|
||||
required_device<spg2xx_io_device> m_spg_io;
|
||||
|
||||
//TIMER_CALLBACK_MEMBER(test_timer);
|
||||
//emu_timer *m_test_timer;
|
||||
@ -132,26 +147,6 @@ private:
|
||||
DECLARE_READ16_MEMBER(dma_len_status_r);
|
||||
DECLARE_READ16_MEMBER(spg110_2063_r);
|
||||
|
||||
DECLARE_WRITE16_MEMBER(spg110_3200_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3201_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3203_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3204_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3206_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3208_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3209_w);
|
||||
|
||||
DECLARE_READ16_MEMBER(spg110_3201_r);
|
||||
|
||||
DECLARE_WRITE16_MEMBER(spg110_3221_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3223_w);
|
||||
DECLARE_WRITE16_MEMBER(spg110_3225_w);
|
||||
|
||||
DECLARE_READ16_MEMBER(spg110_3225_r);
|
||||
DECLARE_READ16_MEMBER(spg110_322c_r);
|
||||
|
||||
READ16_MEMBER(datasegment_r);
|
||||
WRITE16_MEMBER(datasegment_w);
|
||||
|
||||
DECLARE_WRITE16_MEMBER(spg110_3100_w);
|
||||
|
||||
DECLARE_WRITE16_MEMBER(spg110_3101_w);
|
||||
@ -195,6 +190,29 @@ private:
|
||||
void blit(const rectangle &cliprect, uint32_t line, uint32_t xoff, uint32_t yoff, uint32_t attr, uint32_t ctrl, uint32_t bitmap_addr, uint16_t tile);
|
||||
void blit_page(const rectangle &cliprect, uint32_t scanline, int depth, uint32_t bitmap_addr, uint16_t *regs);
|
||||
uint32_t m_screenbuf[320 * 240];
|
||||
|
||||
devcb_write16 m_porta_out;
|
||||
devcb_write16 m_portb_out;
|
||||
devcb_write16 m_portc_out;
|
||||
devcb_read16 m_porta_in;
|
||||
devcb_read16 m_portb_in;
|
||||
devcb_read16 m_portc_in;
|
||||
|
||||
devcb_read16 m_adc_in[2];
|
||||
|
||||
devcb_write8 m_chip_sel;
|
||||
|
||||
DECLARE_READ16_MEMBER(porta_r) { return m_porta_in(); };
|
||||
DECLARE_READ16_MEMBER(portb_r) { return m_portb_in(); };
|
||||
DECLARE_READ16_MEMBER(portc_r) { return m_portc_in(); };
|
||||
DECLARE_WRITE16_MEMBER(porta_w) { m_porta_out(offset, data, mem_mask); };
|
||||
DECLARE_WRITE16_MEMBER(portb_w) { m_portb_out(offset, data, mem_mask); };
|
||||
DECLARE_WRITE16_MEMBER(portc_w) { m_portc_out(offset, data, mem_mask); };
|
||||
template <size_t Line> DECLARE_READ16_MEMBER(adc_r) { return m_adc_in[Line](); };
|
||||
DECLARE_WRITE8_MEMBER(cs_w) { m_chip_sel(offset, data, mem_mask); };
|
||||
DECLARE_READ16_MEMBER(get_pal_r) { return 0; /*m_pal_flag;*/ };
|
||||
void configure_spg_io(spg2xx_io_device* io);
|
||||
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(SPG110, spg110_device)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -36,6 +36,7 @@
|
||||
|
||||
#include "cpu/unsp/unsp.h"
|
||||
#include "spg2xx_audio.h"
|
||||
#include "spg2xx_io.h"
|
||||
#include "screen.h"
|
||||
|
||||
class spg2xx_device : public device_t, public device_mixer_interface
|
||||
@ -64,14 +65,14 @@ public:
|
||||
|
||||
auto chip_select() { return m_chip_sel.bind(); }
|
||||
|
||||
void uart_rx(uint8_t data);
|
||||
|
||||
void extint_w(int channel, bool state);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(vblank);
|
||||
|
||||
required_device<spg2xx_audio_device> m_spg_audio;
|
||||
required_device<spg2xx_io_device> m_spg_io;
|
||||
|
||||
void extint_w(int channel, bool state) { m_spg_io->extint_w(channel, state); };
|
||||
void uart_rx(uint8_t data) { m_spg_io->uart_rx(data); };
|
||||
|
||||
protected:
|
||||
spg2xx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint32_t sprite_limit)
|
||||
@ -80,8 +81,6 @@ protected:
|
||||
m_sprite_limit = sprite_limit;
|
||||
}
|
||||
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
enum
|
||||
{
|
||||
PAGE_ENABLE_MASK = 0x0008,
|
||||
@ -103,48 +102,29 @@ protected:
|
||||
DECLARE_READ16_MEMBER(video_r);
|
||||
DECLARE_WRITE16_MEMBER(video_w);
|
||||
|
||||
virtual DECLARE_READ16_MEMBER(io_r);
|
||||
virtual DECLARE_WRITE16_MEMBER(io_w);
|
||||
DECLARE_READ16_MEMBER(dma_r);
|
||||
DECLARE_WRITE16_MEMBER(dma_w);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(audioirq_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(timerirq_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(uartirq_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(extirq_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(ffreq1_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(ffreq2_w);
|
||||
|
||||
DECLARE_READ16_MEMBER(space_r);
|
||||
|
||||
void check_extint_irq(int channel);
|
||||
void check_irqs(const uint16_t changed);
|
||||
inline void check_video_irq();
|
||||
|
||||
void spg2xx_map(address_map &map);
|
||||
|
||||
static const device_timer_id TIMER_TMB1 = 0;
|
||||
static const device_timer_id TIMER_TMB2 = 1;
|
||||
static const device_timer_id TIMER_SCREENPOS = 2;
|
||||
static const device_timer_id TIMER_BEAT = 3;
|
||||
static const device_timer_id TIMER_UART_TX = 4;
|
||||
static const device_timer_id TIMER_UART_RX = 5;
|
||||
static const device_timer_id TIMER_4KHZ = 6;
|
||||
static const device_timer_id TIMER_SRC_AB = 7;
|
||||
static const device_timer_id TIMER_SRC_C = 8;
|
||||
|
||||
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
void update_porta_special_modes();
|
||||
void update_portb_special_modes();
|
||||
void do_gpio(uint32_t offset, bool write);
|
||||
uint16_t do_special_gpio(uint32_t index, uint16_t mask);
|
||||
|
||||
void update_timer_b_rate();
|
||||
void update_timer_ab_src();
|
||||
void update_timer_c_src();
|
||||
void increment_timer_a();
|
||||
|
||||
void uart_transmit_tick();
|
||||
void uart_receive_tick();
|
||||
|
||||
void system_timer_tick();
|
||||
|
||||
void do_i2c();
|
||||
void do_cpu_dma(uint32_t len);
|
||||
|
||||
void do_sprite_dma(uint32_t len);
|
||||
@ -190,17 +170,7 @@ protected:
|
||||
bool m_debug_palette;
|
||||
uint8_t m_sprite_index_to_debug;
|
||||
|
||||
|
||||
uint16_t m_io_regs[0x200];
|
||||
uint8_t m_uart_rx_fifo[8];
|
||||
uint8_t m_uart_rx_fifo_start;
|
||||
uint8_t m_uart_rx_fifo_end;
|
||||
uint8_t m_uart_rx_fifo_count;
|
||||
bool m_uart_rx_available;
|
||||
bool m_uart_rx_irq;
|
||||
bool m_uart_tx_irq;
|
||||
|
||||
bool m_extint[2];
|
||||
uint16_t m_dma_regs[0x4];
|
||||
|
||||
uint16_t m_video_regs[0x100];
|
||||
uint32_t m_sprite_limit;
|
||||
@ -223,31 +193,31 @@ protected:
|
||||
|
||||
devcb_write8 m_chip_sel;
|
||||
|
||||
uint16_t m_timer_a_preload;
|
||||
uint16_t m_timer_b_preload;
|
||||
uint16_t m_timer_b_divisor;
|
||||
uint16_t m_timer_b_tick_rate;
|
||||
|
||||
emu_timer *m_tmb1;
|
||||
emu_timer *m_tmb2;
|
||||
emu_timer *m_timer_src_ab;
|
||||
emu_timer *m_timer_src_c;
|
||||
emu_timer *m_screenpos_timer;
|
||||
|
||||
emu_timer *m_4khz_timer;
|
||||
uint32_t m_2khz_divider;
|
||||
uint32_t m_1khz_divider;
|
||||
uint32_t m_4hz_divider;
|
||||
|
||||
uint32_t m_uart_baud_rate;
|
||||
emu_timer *m_uart_tx_timer;
|
||||
emu_timer *m_uart_rx_timer;
|
||||
|
||||
required_device<unsp_device> m_cpu;
|
||||
required_device<screen_device> m_screen;
|
||||
required_shared_ptr<uint16_t> m_scrollram;
|
||||
required_shared_ptr<uint16_t> m_paletteram;
|
||||
required_shared_ptr<uint16_t> m_spriteram;
|
||||
|
||||
void configure_spg_io(spg2xx_io_device* io);
|
||||
|
||||
DECLARE_READ16_MEMBER(porta_r) { return m_porta_in(); };
|
||||
DECLARE_READ16_MEMBER(portb_r) { return m_portb_in(); };
|
||||
DECLARE_READ16_MEMBER(portc_r) { return m_portc_in(); };
|
||||
DECLARE_WRITE16_MEMBER(porta_w) { m_porta_out(offset, data, mem_mask); };
|
||||
DECLARE_WRITE16_MEMBER(portb_w) { m_portb_out(offset, data, mem_mask); };
|
||||
DECLARE_WRITE16_MEMBER(portc_w) { m_portc_out(offset, data, mem_mask); };
|
||||
template <size_t Line> DECLARE_READ16_MEMBER(adc_r) { return m_adc_in[Line](); };
|
||||
|
||||
DECLARE_WRITE8_MEMBER(eepromx_w) { m_eeprom_w(offset, data, mem_mask); };
|
||||
DECLARE_READ8_MEMBER(eepromx_r) { return m_eeprom_r(); };
|
||||
|
||||
DECLARE_WRITE8_MEMBER(tx_w) { m_uart_tx(offset, data, mem_mask); };
|
||||
DECLARE_WRITE8_MEMBER(cs_w) { m_chip_sel(offset, data, mem_mask); };
|
||||
DECLARE_READ16_MEMBER(get_pal_r) { return m_pal_flag; };
|
||||
|
||||
};
|
||||
|
||||
class spg24x_device : public spg2xx_device
|
||||
@ -262,6 +232,9 @@ public:
|
||||
}
|
||||
|
||||
spg24x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
};
|
||||
|
||||
class spg28x_device : public spg2xx_device
|
||||
@ -277,7 +250,8 @@ public:
|
||||
|
||||
spg28x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual DECLARE_WRITE16_MEMBER(io_w) override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(SPG24X, spg24x_device)
|
||||
|
1313
src/devices/machine/spg2xx_io.cpp
Normal file
1313
src/devices/machine/spg2xx_io.cpp
Normal file
File diff suppressed because it is too large
Load Diff
183
src/devices/machine/spg2xx_io.h
Normal file
183
src/devices/machine/spg2xx_io.h
Normal file
@ -0,0 +1,183 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Ryan Holtz
|
||||
|
||||
#ifndef MAME_MACHINE_SPG2XX_IO_H
|
||||
#define MAME_MACHINE_SPG2XX_IO_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cpu/unsp/unsp.h"
|
||||
#include "screen.h"
|
||||
|
||||
class spg2xx_io_device : public device_t
|
||||
{
|
||||
public:
|
||||
spg2xx_io_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
auto porta_out() { return m_porta_out.bind(); }
|
||||
auto portb_out() { return m_portb_out.bind(); }
|
||||
auto portc_out() { return m_portc_out.bind(); }
|
||||
auto porta_in() { return m_porta_in.bind(); }
|
||||
auto portb_in() { return m_portb_in.bind(); }
|
||||
auto portc_in() { return m_portc_in.bind(); }
|
||||
|
||||
template <size_t Line> auto adc_in() { return m_adc_in[Line].bind(); }
|
||||
|
||||
auto eeprom_w() { return m_eeprom_w.bind(); }
|
||||
auto eeprom_r() { return m_eeprom_r.bind(); }
|
||||
|
||||
auto uart_tx() { return m_uart_tx.bind(); }
|
||||
|
||||
auto chip_select() { return m_chip_sel.bind(); }
|
||||
|
||||
void uart_rx(uint8_t data);
|
||||
|
||||
void extint_w(int channel, bool state);
|
||||
|
||||
DECLARE_READ16_MEMBER(io_r);
|
||||
DECLARE_WRITE16_MEMBER(io_w);
|
||||
|
||||
virtual DECLARE_READ16_MEMBER(io_extended_r);
|
||||
virtual DECLARE_WRITE16_MEMBER(io_extended_w);
|
||||
|
||||
|
||||
auto pal_read_callback() { return m_pal_read_cb.bind(); };
|
||||
|
||||
auto write_timer_irq_callback() { return m_timer_irq_cb.bind(); };
|
||||
auto write_uart_adc_irq_callback() { return m_uart_adc_irq_cb.bind(); };
|
||||
auto write_external_irq_callback() { return m_external_irq_cb.bind(); };
|
||||
auto write_ffrq_tmr1_irq_callback() { return m_ffreq_tmr1_irq_cb.bind(); };
|
||||
auto write_ffrq_tmr2_irq_callback() { return m_ffreq_tmr2_irq_cb.bind(); };
|
||||
|
||||
protected:
|
||||
spg2xx_io_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const uint32_t sprite_limit)
|
||||
: spg2xx_io_device(mconfig, type, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void check_extint_irq(int channel);
|
||||
void check_irqs(const uint16_t changed);
|
||||
|
||||
static const device_timer_id TIMER_TMB1 = 0;
|
||||
static const device_timer_id TIMER_TMB2 = 1;
|
||||
|
||||
static const device_timer_id TIMER_UART_TX = 4;
|
||||
static const device_timer_id TIMER_UART_RX = 5;
|
||||
static const device_timer_id TIMER_4KHZ = 6;
|
||||
static const device_timer_id TIMER_SRC_AB = 7;
|
||||
static const device_timer_id TIMER_SRC_C = 8;
|
||||
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
void update_porta_special_modes();
|
||||
void update_portb_special_modes();
|
||||
void do_gpio(uint32_t offset, bool write);
|
||||
uint16_t do_special_gpio(uint32_t index, uint16_t mask);
|
||||
|
||||
void update_timer_b_rate();
|
||||
void update_timer_ab_src();
|
||||
void update_timer_c_src();
|
||||
void increment_timer_a();
|
||||
|
||||
void uart_transmit_tick();
|
||||
void uart_receive_tick();
|
||||
|
||||
void system_timer_tick();
|
||||
|
||||
void do_i2c();
|
||||
|
||||
uint16_t m_io_regs[0x100];
|
||||
|
||||
uint8_t m_uart_rx_fifo[8];
|
||||
uint8_t m_uart_rx_fifo_start;
|
||||
uint8_t m_uart_rx_fifo_end;
|
||||
uint8_t m_uart_rx_fifo_count;
|
||||
bool m_uart_rx_available;
|
||||
bool m_uart_rx_irq;
|
||||
bool m_uart_tx_irq;
|
||||
|
||||
bool m_extint[2];
|
||||
|
||||
devcb_write16 m_porta_out;
|
||||
devcb_write16 m_portb_out;
|
||||
devcb_write16 m_portc_out;
|
||||
devcb_read16 m_porta_in;
|
||||
devcb_read16 m_portb_in;
|
||||
devcb_read16 m_portc_in;
|
||||
|
||||
devcb_read16 m_adc_in[2];
|
||||
|
||||
devcb_write8 m_eeprom_w;
|
||||
devcb_read8 m_eeprom_r;
|
||||
|
||||
devcb_write8 m_uart_tx;
|
||||
|
||||
devcb_write8 m_chip_sel;
|
||||
|
||||
uint16_t m_timer_a_preload;
|
||||
uint16_t m_timer_b_preload;
|
||||
uint16_t m_timer_b_divisor;
|
||||
uint16_t m_timer_b_tick_rate;
|
||||
|
||||
emu_timer *m_tmb1;
|
||||
emu_timer *m_tmb2;
|
||||
emu_timer *m_timer_src_ab;
|
||||
emu_timer *m_timer_src_c;
|
||||
|
||||
emu_timer *m_4khz_timer;
|
||||
uint32_t m_2khz_divider;
|
||||
uint32_t m_1khz_divider;
|
||||
uint32_t m_4hz_divider;
|
||||
|
||||
uint32_t m_uart_baud_rate;
|
||||
emu_timer *m_uart_tx_timer;
|
||||
emu_timer *m_uart_rx_timer;
|
||||
|
||||
required_device<unsp_device> m_cpu;
|
||||
required_device<screen_device> m_screen;
|
||||
|
||||
devcb_read16 m_pal_read_cb;
|
||||
|
||||
devcb_write_line m_timer_irq_cb;
|
||||
devcb_write_line m_uart_adc_irq_cb;
|
||||
devcb_write_line m_external_irq_cb;
|
||||
devcb_write_line m_ffreq_tmr1_irq_cb;
|
||||
devcb_write_line m_ffreq_tmr2_irq_cb;
|
||||
};
|
||||
|
||||
class spg24x_io_device : public spg2xx_io_device
|
||||
{
|
||||
public:
|
||||
template <typename T, typename U>
|
||||
spg24x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&screen_tag)
|
||||
: spg24x_io_device(mconfig, tag, owner, clock)
|
||||
{
|
||||
m_cpu.set_tag(std::forward<T>(cpu_tag));
|
||||
m_screen.set_tag(std::forward<U>(screen_tag));
|
||||
}
|
||||
|
||||
spg24x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
};
|
||||
|
||||
class spg28x_io_device : public spg2xx_io_device
|
||||
{
|
||||
public:
|
||||
template <typename T, typename U>
|
||||
spg28x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&screen_tag)
|
||||
: spg28x_io_device(mconfig, tag, owner, clock)
|
||||
{
|
||||
m_cpu.set_tag(std::forward<T>(cpu_tag));
|
||||
m_screen.set_tag(std::forward<U>(screen_tag));
|
||||
}
|
||||
|
||||
spg28x_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual DECLARE_WRITE16_MEMBER(io_extended_w) override;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(SPG24X_IO, spg24x_io_device)
|
||||
DECLARE_DEVICE_TYPE(SPG28X_IO, spg28x_io_device)
|
||||
|
||||
#endif // MAME_MACHINE_SPG2XX_IO_H
|
@ -51,9 +51,312 @@ void spg110_game_state::mem_map(address_map &map)
|
||||
map(0x000000, 0x003fff).m(m_spg, FUNC(spg110_device::map));
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( spg110 )
|
||||
static INPUT_PORTS_START( jak_capb )
|
||||
PORT_START("PA")
|
||||
PORT_DIPNAME( 0x0001, 0x0000, "PA" )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( On ) )
|
||||
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Menu")
|
||||
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_NAME("Left Flipper")
|
||||
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Nudge")// nudge (motion control)
|
||||
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("Right Flipper")
|
||||
PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("PB")
|
||||
PORT_DIPNAME( 0x0001, 0x0000, "PB" )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("PC")
|
||||
PORT_DIPNAME( 0x0001, 0x0000, "PC" )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("JOYX")
|
||||
PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("JOYY")
|
||||
PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) PORT_NAME("Plunger")
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( jak_spdmo )
|
||||
PORT_START("PA")
|
||||
PORT_DIPNAME( 0x0001, 0x0000, "PA" )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("PB")
|
||||
PORT_DIPNAME( 0x0001, 0x0000, "PB" )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("PC")
|
||||
PORT_DIPNAME( 0x0001, 0x0000, "PC" )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0002, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0004, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("JOYX")
|
||||
|
||||
PORT_START("JOYY")
|
||||
|
||||
INPUT_PORTS_END
|
||||
|
||||
void spg110_game_state::spg110_base(machine_config &config)
|
||||
{
|
||||
@ -72,7 +375,12 @@ void spg110_game_state::spg110_base(machine_config &config)
|
||||
// m_spg->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
|
||||
// m_spg->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
|
||||
|
||||
SPG110(config, m_spg, XTAL(27'000'000), "maincpu");
|
||||
SPG110(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
|
||||
m_spg->porta_in().set_ioport("PA");
|
||||
m_spg->portb_in().set_ioport("PB");
|
||||
m_spg->portc_in().set_ioport("PC");
|
||||
m_spg->adc_in<0>().set_ioport("JOYX");
|
||||
m_spg->adc_in<1>().set_ioport("JOYY");
|
||||
}
|
||||
|
||||
ROM_START( jak_capb )
|
||||
@ -87,5 +395,5 @@ ROM_START( jak_spdmo )
|
||||
ROM_END
|
||||
|
||||
// JAKKS Pacific Inc TV games
|
||||
CONS( 2004, jak_capb, 0, 0, spg110_base, spg110, 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, spg110, spg110_game_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Spider-Man (JAKKS Pacific TV Game) (older hardare)", 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_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 hardare)", 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.
|
||||
|
Loading…
Reference in New Issue
Block a user