From 62ba8c558cb440db771f735554457c70a333172d Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Sun, 27 Jan 2019 21:34:29 +0100 Subject: [PATCH 1/8] spg2xx: Correct PRNG emulation. [Ryan Holtz] --- src/devices/machine/spg2xx.cpp | 54 +++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index 9fd4c864936..a5e3aa11288 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -237,6 +237,9 @@ void spg2xx_device::device_reset() m_timer_b_tick_rate = 0; m_io_regs[0x23] = 0x0028; + m_io_regs[0x2c] = 0x1418; + m_io_regs[0x2d] = 0x1658; + m_uart_rx_available = false; memset(m_uart_rx_fifo, 0, ARRAY_LENGTH(m_uart_rx_fifo)); m_uart_rx_fifo_start = 0; @@ -1022,6 +1025,38 @@ void spg2xx_device::uart_rx(uint8_t data) } } +static uint16_t prng_mul(uint16_t a, uint16_t b) +{ + uint16_t d = 0; + if (a >= 0x8000) a &= 0x7fff; + if (b >= 0x8000) b &= 0x7fff; + for (int i = 0; i < 16; i++) + { + d = (d > 0x4000) ? ((d << 1) - 0x8000) : (d << 1); + if (a & 0x8000) + d += b; + if (d >= 0x8000) + d -= 0x8000; + a <<= 1; + } + return d; +} + +static uint16_t prng_pow(uint16_t value, uint16_t exponent) +{ + uint16_t r = 1; + while (exponent > 0) + { + if (exponent & 1) + { + r = prng_mul(r, value); + } + exponent >>= 1; + value = prng_mul(value, value); + } + return r; +} + READ16_MEMBER(spg2xx_device::io_r) { static const char *const gpioregs[] = { "GPIO Data Port", "GPIO Buffer Port", "GPIO Direction Port", "GPIO Attribute Port", "GPIO IRQ/Latch Port" }; @@ -1096,10 +1131,21 @@ READ16_MEMBER(spg2xx_device::io_r) LOGMASKED(LOG_IO_READS, "io_r: NTSC/PAL = %04x\n", m_pal_flag); return m_pal_flag; - case 0x2c: case 0x2d: // PRNG 0/1 - val = machine().rand() & 0x0000ffff; - LOGMASKED(LOG_IO_READS, "io_r: PRNG %d = %04x\n", offset - 0x2c, val); - break; + case 0x2c: // PRNG 0 + { + const uint16_t value = m_io_regs[0x2c]; + const uint16_t pow14 = prng_pow(value, 14); + m_io_regs[0x2c] = (pow14*value + pow14 + 1) & 0x7fff; + return value; + } + + case 0x2d: // PRNG 1 + { + const uint16_t value = m_io_regs[0x2d]; + const uint16_t pow14 = prng_pow(value, 14); + m_io_regs[0x2d] = (pow14*value + pow14 + 1) & 0x7fff; + return value; + } case 0x2e: // FIQ Source Select LOGMASKED(LOG_FIQ, "io_r: FIQ Source Select = %04x\n", val); From dda8bad8aad23fd6b1265f1b3ee14a6eeb8ee4f4 Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Sun, 27 Jan 2019 21:54:17 +0100 Subject: [PATCH 2/8] -spg2xx: More correct PRNG emulation, nw --- src/devices/machine/spg2xx.cpp | 48 +++++++++------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index a5e3aa11288..19bc7151b3b 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -1025,38 +1025,6 @@ void spg2xx_device::uart_rx(uint8_t data) } } -static uint16_t prng_mul(uint16_t a, uint16_t b) -{ - uint16_t d = 0; - if (a >= 0x8000) a &= 0x7fff; - if (b >= 0x8000) b &= 0x7fff; - for (int i = 0; i < 16; i++) - { - d = (d > 0x4000) ? ((d << 1) - 0x8000) : (d << 1); - if (a & 0x8000) - d += b; - if (d >= 0x8000) - d -= 0x8000; - a <<= 1; - } - return d; -} - -static uint16_t prng_pow(uint16_t value, uint16_t exponent) -{ - uint16_t r = 1; - while (exponent > 0) - { - if (exponent & 1) - { - r = prng_mul(r, value); - } - exponent >>= 1; - value = prng_mul(value, value); - } - return r; -} - READ16_MEMBER(spg2xx_device::io_r) { static const char *const gpioregs[] = { "GPIO Data Port", "GPIO Buffer Port", "GPIO Direction Port", "GPIO Attribute Port", "GPIO IRQ/Latch Port" }; @@ -1134,16 +1102,14 @@ READ16_MEMBER(spg2xx_device::io_r) case 0x2c: // PRNG 0 { const uint16_t value = m_io_regs[0x2c]; - const uint16_t pow14 = prng_pow(value, 14); - m_io_regs[0x2c] = (pow14*value + pow14 + 1) & 0x7fff; + m_io_regs[0x2c] = ((value << 1) | (BIT(value, 14) ^ BIT(value, 13))) & 0x7fff; return value; } case 0x2d: // PRNG 1 { const uint16_t value = m_io_regs[0x2d]; - const uint16_t pow14 = prng_pow(value, 14); - m_io_regs[0x2d] = (pow14*value + pow14 + 1) & 0x7fff; + m_io_regs[0x2d] = ((value << 1) | (BIT(value, 14) ^ BIT(value, 13))) & 0x7fff; return value; } @@ -1712,6 +1678,16 @@ WRITE16_MEMBER(spg2xx_device::io_w) break; } + case 0x2c: // PRNG 0 seed + LOGMASKED(LOG_IO_WRITES, "io_w: PRNG 0 seed = %04x\n", data & 0x7fff); + m_io_regs[offset] = data & 0x7fff; + break; + + case 0x2d: // PRNG 1 seed + LOGMASKED(LOG_IO_WRITES, "io_w: PRNG 1 seed = %04x\n", data & 0x7fff); + m_io_regs[offset] = data & 0x7fff; + break; + case 0x2e: // FIQ Source Select { static const char* const s_fiq_select[8] = From d70681e1b32aa37f230a557e47379208a08b730e Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 28 Jan 2019 10:48:24 +1100 Subject: [PATCH 3/8] turn off SPG200 logging for release (nw) --- src/devices/machine/spg2xx.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index 19bc7151b3b..428fb2e10f1 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -52,8 +52,7 @@ DEFINE_DEVICE_TYPE(SPG28X, spg28x_device, "spg28x", "SPG280-series System-on-a-C #define LOG_PPU (LOG_PPU_READS | LOG_PPU_WRITES | LOG_UNKNOWN_PPU) #define LOG_ALL (LOG_IO | LOG_SPU | LOG_PPU | LOG_VLINES | LOG_SEGMENT | LOG_FIQ) -#define VERBOSE (LOG_ALL & ~LOG_SPU) -//#define VERBOSE (0) +//#define VERBOSE (LOG_ALL & ~LOG_SPU) #include "logmacro.h" #define SPG_DEBUG_VIDEO (0) From 7988aa1100a19bfbc9c2c0f84f4853a498fc71b9 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Mon, 28 Jan 2019 18:08:30 +0100 Subject: [PATCH 4/8] New working machines -------------------- Star Wars - Revenge of the Sith (JAKKS Pacific TV Game, Game-Key Ready) [Sean Riddle, Peter Wilhelmsen] -vii: Mapped jak_sith controls. [Ryan Holtz] -spg2xx: Added polled ADC mode, and 2-channel ADC support. [Ryan Holtz] --- src/devices/machine/spg2xx.cpp | 11 ++++++++--- src/devices/machine/spg2xx.h | 4 ++-- src/mame/drivers/clickstart.cpp | 2 +- src/mame/drivers/vii.cpp | 33 ++++++++++++++++++++++++++------- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index 428fb2e10f1..548da6aba6d 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -72,7 +72,7 @@ spg2xx_device::spg2xx_device(const machine_config &mconfig, device_type type, co , m_porta_in(*this) , m_portb_in(*this) , m_portc_in(*this) - , m_adc_in(*this) + , m_adc_in{{*this}, {*this}} , m_eeprom_w(*this) , m_eeprom_r(*this) , m_uart_tx(*this) @@ -124,7 +124,8 @@ void spg2xx_device::device_start() m_porta_in.resolve_safe(0); m_portb_in.resolve_safe(0); m_portc_in.resolve_safe(0); - m_adc_in.resolve_safe(0x0fff); + m_adc_in[0].resolve_safe(0); + m_adc_in[1].resolve_safe(0); m_eeprom_w.resolve_safe(); m_eeprom_r.resolve_safe(0); m_uart_tx.resolve_safe(); @@ -1633,9 +1634,13 @@ WRITE16_MEMBER(spg2xx_device::io_w) { LOGMASKED(LOG_IO_WRITES, "%s: io_w: ADC Control = %04x\n", machine().describe_context(), data); m_io_regs[offset] = data & ~0x1000; + if (BIT(data, 0)) + { + m_io_regs[0x27] = 0x8000 | (m_adc_in[BIT(data, 5)]() & 0x7fff); + m_io_regs[0x25] |= 0x2000; + } if (BIT(data, 12) && !BIT(m_io_regs[offset], 1)) { - m_io_regs[0x27] = 0x8000 | (m_adc_in() & 0x7fff); const uint16_t old = IO_IRQ_STATUS; IO_IRQ_STATUS |= 0x2000; const uint16_t changed = (old & IO_IRQ_ENABLE) ^ (IO_IRQ_STATUS & IO_IRQ_ENABLE); diff --git a/src/devices/machine/spg2xx.h b/src/devices/machine/spg2xx.h index 78532a5d60e..e8a006dc273 100644 --- a/src/devices/machine/spg2xx.h +++ b/src/devices/machine/spg2xx.h @@ -54,7 +54,7 @@ public: auto portb_in() { return m_portb_in.bind(); } auto portc_in() { return m_portc_in.bind(); } - auto adc_in() { return m_adc_in.bind(); } + template 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(); } @@ -506,7 +506,7 @@ protected: devcb_read16 m_portb_in; devcb_read16 m_portc_in; - devcb_read16 m_adc_in; + devcb_read16 m_adc_in[2]; devcb_write8 m_eeprom_w; devcb_read8 m_eeprom_r; diff --git a/src/mame/drivers/clickstart.cpp b/src/mame/drivers/clickstart.cpp index c03fb706eea..69d1fb1235e 100644 --- a/src/mame/drivers/clickstart.cpp +++ b/src/mame/drivers/clickstart.cpp @@ -420,7 +420,7 @@ void clickstart_state::clickstart(machine_config &config) m_spg->porta_in().set(FUNC(clickstart_state::porta_r)); m_spg->portb_in().set(FUNC(clickstart_state::portb_r)); m_spg->portc_in().set(FUNC(clickstart_state::portc_r)); - m_spg->adc_in().set_constant(0x0fff); + m_spg->adc_in<0>().set_constant(0x0fff); m_spg->chip_select().set(FUNC(clickstart_state::chip_sel_w)); m_spg->add_route(ALL_OUTPUTS, "lspeaker", 0.5); m_spg->add_route(ALL_OUTPUTS, "rspeaker", 0.5); diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp index 6d8b82f31c2..51087d9feef 100644 --- a/src/mame/drivers/vii.cpp +++ b/src/mame/drivers/vii.cpp @@ -448,6 +448,23 @@ static INPUT_PORTS_START( walle ) PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END +static INPUT_PORTS_START( jak_sith ) + PORT_START("P1") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_BIT( 0xf3df, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, spg2xx_game_state,i2c_r, nullptr) + PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("JOYX") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) + + PORT_START("JOYY") + PORT_BIT(0x0fff, 0x0000, IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x0fff) +INPUT_PORTS_END static INPUT_PORTS_START( jak_gkr ) PORT_START("P1") @@ -968,6 +985,8 @@ void jakks_gkr_state::jakks_gkr_sw(machine_config &config) { jakks_gkr(config); m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m); + m_spg->adc_in<0>().set_ioport("JOYX"); + m_spg->adc_in<1>().set_ioport("JOYY"); SOFTWARE_LIST(config, "jakks_gamekey_sw").set_original("jakks_gamekey_sw"); } @@ -1273,13 +1292,13 @@ CONS( 2004, jak_batm, 0, 0, jakks, batman, spg2xx_game_state, empty_init, "JAKKS CONS( 2008, jak_wall, 0, 0, walle, walle, spg2xx_game_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Wall-E (JAKKS Pacific TV Game)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // 'Game-Key Ready' JAKKS games (these can also take per-game specific expansion cartridges, although not all games had them released) Some of these were available in versions without Game-Key ports, it is unconfirmed if code was the same unless otherwise stated -CONS( 2005, jak_wwe, 0, 0, jakks_gkr_1m, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "WWE (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WW (no game-keys released) -CONS( 2005, jak_fan4, 0, 0, jakks_gkr_1m, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Fantastic Four (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // F4 (no game-keys released) -CONS( 2005, jak_just, 0, 0, jakks_gkr_1m, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Taniko", "Justice League (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DC (no game-keys released) -CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer - Race To Play Park (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3+ released) -CONS( 2005, jak_sdoo, 0, 0, jakks_gkr_2m, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Jolliford Management","Scooby-Doo! and the Mystery of the Castle (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // SD (no game-keys released) -CONS( 2005, jak_disf, 0, 0, jakks_gkr_dy, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Disney Friends (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DY keys (3 released) -CONS( 2005, jak_sith, 0, 0, jakks_gkr_sw, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Griptonite Games", "Star Wars - Revenge of the Sith (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses SW keys (1 released) +CONS( 2005, jak_wwe, 0, 0, jakks_gkr_1m, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "WWE (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WW (no game-keys released) +CONS( 2005, jak_fan4, 0, 0, jakks_gkr_1m, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Fantastic Four (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // F4 (no game-keys released) +CONS( 2005, jak_just, 0, 0, jakks_gkr_1m, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Taniko", "Justice League (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DC (no game-keys released) +CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer - Race To Play Park (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3+ released) +CONS( 2005, jak_sdoo, 0, 0, jakks_gkr_2m, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Jolliford Management","Scooby-Doo! and the Mystery of the Castle (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // SD (no game-keys released) +CONS( 2005, jak_disf, 0, 0, jakks_gkr_dy, jak_gkr, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Disney Friends (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DY keys (3 released) +CONS( 2005, jak_sith, 0, 0, jakks_gkr_sw, jak_sith, jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Griptonite Games", "Star Wars - Revenge of the Sith (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses SW keys (1 released) // Nicktoons NK (3? keys available) (same keys as Dora the Explorer) // SpongeBob SquarePants: The Fry Cook Games NK (3? keys available) ^^ From 22b65045fa5846f2def8f9873001c302ee8bee08 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 28 Jan 2019 18:30:14 +0100 Subject: [PATCH 5/8] mephisto: fix mm2 display regression (nw) --- src/mame/drivers/mephisto.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mame/drivers/mephisto.cpp b/src/mame/drivers/mephisto.cpp index cb7b19f0f2b..6da04074995 100644 --- a/src/mame/drivers/mephisto.cpp +++ b/src/mame/drivers/mephisto.cpp @@ -233,7 +233,6 @@ static INPUT_PORTS_START( mephisto ) PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C 3") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) PORT_START("KEY2_7") //Port $2c0f PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D 4") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) - INPUT_PORTS_END @@ -244,20 +243,16 @@ TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_nmi) m_allowNMI = 0; m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); } - m_beep->set_state(m_outlatch->q6_r() ? 1 : 0); } TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_nmi_r5) { m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); - m_beep->set_state(m_outlatch->q6_r() ? 1 : 0); } TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_irq)//only mm2 { m_maincpu->set_input_line(M65C02_IRQ_LINE, HOLD_LINE); - - m_beep->set_state(m_outlatch->q6_r() ? 1 : 0); } void mephisto_state::machine_start() @@ -303,7 +298,6 @@ MACHINE_CONFIG_START(mephisto_state::mephisto) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu",M65C02,4915200) /* 65C02 */ MCFG_DEVICE_PROGRAM_MAP(mephisto_mem) - MCFG_QUANTUM_TIME(attotime::from_hz(60)) HC259(config, m_outlatch); m_outlatch->q_out_cb<0>().set_output("led100"); @@ -312,6 +306,7 @@ MACHINE_CONFIG_START(mephisto_state::mephisto) m_outlatch->q_out_cb<3>().set_output("led103"); m_outlatch->q_out_cb<4>().set_output("led104"); m_outlatch->q_out_cb<5>().set_output("led105"); + m_outlatch->q_out_cb<6>().set(m_beep, FUNC(beep_device::set_state)); m_outlatch->q_out_cb<7>().set(FUNC(mephisto_state::write_led7)); /* sound hardware */ @@ -327,26 +322,30 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(mephisto_state::rebel5) mephisto(config); - /* basic machine hardware */ + MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(rebel5_mem) + config.device_remove("nmi_timer"); TIMER(config, "nmi_timer_r5").configure_periodic(FUNC(mephisto_state::update_nmi_r5), attotime::from_hz(600)); - MACHINE_CONFIG_END MACHINE_CONFIG_START(mephisto_state::mm2) mephisto(config); + MCFG_DEVICE_REPLACE("maincpu", M65C02, 3700000) MCFG_DEVICE_PROGRAM_MAP(mm2_mem) MCFG_MACHINE_START_OVERRIDE(mephisto_state, mm2 ) config.device_remove("nmi_timer"); TIMER(config, "irq_timer").configure_periodic(FUNC(mephisto_state::update_irq), attotime::from_hz(450)); + + m_outlatch->q_out_cb<7>().set(FUNC(mephisto_state::write_led7)).invert(); MACHINE_CONFIG_END MACHINE_CONFIG_START(mephisto_state::mm4tk) mephisto(config); + MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_REPLACE("maincpu", M65C02, 18000000) MCFG_DEVICE_PROGRAM_MAP(mephisto_mem) From de7d35e2fdd203260d0ea7c1c4ecb82029cc289f Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Tue, 29 Jan 2019 15:55:49 +0100 Subject: [PATCH 6/8] -spg2xx: Return max ADC value if not hooked up, nw --- src/devices/machine/spg2xx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index 548da6aba6d..a5fef62486d 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -124,8 +124,8 @@ void spg2xx_device::device_start() m_porta_in.resolve_safe(0); m_portb_in.resolve_safe(0); m_portc_in.resolve_safe(0); - m_adc_in[0].resolve_safe(0); - m_adc_in[1].resolve_safe(0); + m_adc_in[0].resolve_safe(0x0fff); + m_adc_in[1].resolve_safe(0x0fff); m_eeprom_w.resolve_safe(); m_eeprom_r.resolve_safe(0); m_uart_tx.resolve_safe(); From 2ca871a18a4aafe7bbabd295b8f738c57f02b184 Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Mon, 28 Jan 2019 19:39:23 +0000 Subject: [PATCH 7/8] nascom1: Fixed snapshot loading regression on 32bit builds (nw) --- src/mame/drivers/nascom1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/nascom1.cpp b/src/mame/drivers/nascom1.cpp index b03189cd72e..ccab0c18afa 100644 --- a/src/mame/drivers/nascom1.cpp +++ b/src/mame/drivers/nascom1.cpp @@ -233,7 +233,7 @@ DEVICE_IMAGE_UNLOAD_MEMBER( nascom_state, nascom1_cassette ) SNAPSHOT_LOAD_MEMBER( nascom_state, nascom1 ) { - uint8_t line[28]; + uint8_t line[29]; while (image.fread(&line, sizeof(line)) == sizeof(line)) { @@ -264,7 +264,7 @@ SNAPSHOT_LOAD_MEMBER( nascom_state, nascom1 ) SNAPSHOT_LOAD_MEMBER(nascom_state, charrom) { - uint8_t line[28]; + uint8_t line[29]; while (image.fread(&line, sizeof(line)) == sizeof(line)) { From cf02fe333af9cb4d5a4d55fbc95fb9af548a8d8e Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 30 Jan 2019 04:07:32 +1100 Subject: [PATCH 8/8] version bump (nw) --- android-project/app/src/main/AndroidManifest.xml | 4 ++-- makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 63576631b81..aa668b45f59 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> diff --git a/makefile b/makefile index 573ebbba22e..6cbcf82110c 100644 --- a/makefile +++ b/makefile @@ -1608,14 +1608,14 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.205"' > $@ + @echo '#define BARE_BUILD_VERSION "0.206"' > $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char build_version[];' >> $@ @echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@ @echo 'const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))";' >> $@ else $(GENDIR)/version.cpp: $(GENDIR)/git_desc - @echo #define BARE_BUILD_VERSION "0.205" > $@ + @echo #define BARE_BUILD_VERSION "0.206" > $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char build_version[]; >> $@ @echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@