Skip to content

Commit 0133d14

Browse files
committed
-seta/ssv.cpp: Cleaned up key matrix code.
-docs: Fixed editing error.
1 parent e22aae6 commit 0133d14

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

docs/source/techspecs/layout_script.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ providing what’s needed:
495495
* ``emu.print_verbose``, ``emu.print_error``, ``emu.print_warning``,
496496
``emu.print_info`` and ``emu.print_debug`` functions for diagnostic output.
497497
* Standard Lua ``tonumber``, ``tostring``, ``pairs`` and ``ipairs`` functions,
498-
and ``math``, ``table`` and ``string`` objects for manipulating numbers,r
498+
and ``math``, ``table`` and ``string`` objects for manipulating numbers,
499499
strings, tables and other containers.
500500
* Standard Lua ``print`` function for text output to the console.
501501

src/mame/seta/ssv.cpp

+26-28
Original file line numberDiff line numberDiff line change
@@ -294,29 +294,29 @@ void gdfs_state::adc_int_w(int state)
294294
*/
295295
void ssv_state::lockout_w(offs_t offset, uint16_t data, uint16_t mem_mask)
296296
{
297-
// logerror("%s - Unknown lockout bit written %02X\n", machine().describe_context(), data & 0xff);
297+
//logerror("%s - Unknown lockout bit written %02X\n", machine().describe_context(), data & 0xff);
298298
if (ACCESSING_BITS_0_7)
299299
{
300300
machine().bookkeeping().coin_lockout_w(1, BIT(~data, 0));
301301
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 1));
302302
machine().bookkeeping().coin_counter_w(1, BIT( data, 2));
303303
machine().bookkeeping().coin_counter_w(0, BIT( data, 3));
304-
// Bit 6 is unknown
304+
// Bit 6 is unknown
305305
enable_video(BIT(data, 7));
306306
}
307307
}
308308

309309
// Same as above but with inverted lockout lines
310310
void ssv_state::lockout_inv_w(offs_t offset, uint16_t data, uint16_t mem_mask)
311311
{
312-
// logerror("%s - Unknown lockout bit written %02X\n", machine().describe_context(), data & 0xff);
312+
//logerror("%s - Unknown lockout bit written %02X\n", machine().describe_context(), data & 0xff);
313313
if (ACCESSING_BITS_0_7)
314314
{
315315
machine().bookkeeping().coin_lockout_w(1, BIT(data, 0));
316316
machine().bookkeeping().coin_lockout_w(0, BIT(data, 1));
317317
machine().bookkeeping().coin_counter_w(1, BIT(data, 2));
318318
machine().bookkeeping().coin_counter_w(0, BIT(data, 3));
319-
// Bit 6 is unknown
319+
// Bit 6 is unknown
320320
enable_video(BIT(data, 7));
321321
}
322322
}
@@ -511,13 +511,12 @@ uint16_t ssv_state::hypreact_input_r()
511511
{
512512
const uint16_t input_sel = *m_input_sel;
513513

514-
if (BIT(input_sel, 0)) return m_io_key[0]->read();
515-
if (BIT(input_sel, 1)) return m_io_key[1]->read();
516-
if (BIT(input_sel, 2)) return m_io_key[2]->read();
517-
if (BIT(input_sel, 3)) return m_io_key[3]->read();
518-
if (!machine().side_effects_disabled())
519-
logerror("CPU #0 PC %06X: unknown input read: %04X\n", m_maincpu->pc(), input_sel);
520-
return 0xffff;
514+
uint16_t result = 0xffff;
515+
if (BIT(input_sel, 0)) result &= m_io_key[0]->read();
516+
if (BIT(input_sel, 1)) result &= m_io_key[1]->read();
517+
if (BIT(input_sel, 2)) result &= m_io_key[2]->read();
518+
if (BIT(input_sel, 3)) result &= m_io_key[3]->read();
519+
return result;
521520
}
522521

523522
void ssv_state::hypreact_map(address_map &map)
@@ -642,13 +641,12 @@ uint16_t ssv_state::srmp4_input_r()
642641
{
643642
const uint16_t input_sel = *m_input_sel;
644643

645-
if (BIT(input_sel, 1)) return m_io_key[0]->read();
646-
if (BIT(input_sel, 2)) return m_io_key[1]->read();
647-
if (BIT(input_sel, 3)) return m_io_key[2]->read();
648-
if (BIT(input_sel, 4)) return m_io_key[3]->read();
649-
if (!machine().side_effects_disabled())
650-
logerror("CPU #0 PC %06X: unknown input read: %04X\n", m_maincpu->pc(), input_sel);
651-
return 0xffff;
644+
uint16_t result = 0xffff;
645+
if (BIT(input_sel, 1)) result &= m_io_key[0]->read();
646+
if (BIT(input_sel, 2)) result &= m_io_key[1]->read();
647+
if (BIT(input_sel, 3)) result &= m_io_key[2]->read();
648+
if (BIT(input_sel, 4)) result &= m_io_key[3]->read();
649+
return result;
652650
}
653651

654652
void ssv_state::srmp4_map(address_map &map)
@@ -2567,18 +2565,18 @@ void ssv_state::init_srmp7()
25672565
}
25682566

25692567

2570-
static constexpr XTAL SSV_MASTER_CLOCK = XTAL(48'000'000)/3;
2571-
2572-
static constexpr XTAL SSV_PIXEL_CLOCK = XTAL(42'954'545)/6;
2573-
static constexpr uint32_t SSV_HTOTAL = 0x1c6;
2574-
static constexpr uint32_t SSV_HBEND = 0;
2575-
static constexpr uint32_t SSV_HBSTART = 0x150;
2576-
static constexpr uint32_t SSV_VTOTAL = 0x106;
2577-
static constexpr uint32_t SSV_VBEND = 0;
2578-
static constexpr uint32_t SSV_VBSTART = 0xf0;
2579-
25802568
void ssv_state::ssv(machine_config &config)
25812569
{
2570+
constexpr XTAL SSV_MASTER_CLOCK = XTAL(48'000'000) / 3;
2571+
2572+
constexpr XTAL SSV_PIXEL_CLOCK = XTAL(42'954'545) / 6;
2573+
constexpr uint32_t SSV_HTOTAL = 0x1c6;
2574+
constexpr uint32_t SSV_HBEND = 0;
2575+
constexpr uint32_t SSV_HBSTART = 0x150;
2576+
constexpr uint32_t SSV_VTOTAL = 0x106;
2577+
constexpr uint32_t SSV_VBEND = 0;
2578+
constexpr uint32_t SSV_VBSTART = 0xf0;
2579+
25822580
// basic machine hardware
25832581
V60(config, m_maincpu, SSV_MASTER_CLOCK); // Based on STA-0001 & STA-0001B System boards
25842582
m_maincpu->set_irq_acknowledge_callback(FUNC(ssv_state::irq_callback));

0 commit comments

Comments
 (0)