sensorboard: only load last position when the chesscomputer expects it (nw)

This commit is contained in:
hap 2020-06-09 01:11:04 +02:00
parent 3f5784f3a9
commit d9ee5234f7
19 changed files with 32 additions and 3 deletions

View File

@ -79,6 +79,7 @@ sensorboard_device::sensorboard_device(const machine_config &mconfig, const char
m_custom_spawn_cb(*this),
m_custom_output_cb(*this)
{
m_nvram_on = false;
m_nosensors = false;
m_magnets = false;
m_inductive = false;
@ -202,8 +203,13 @@ void sensorboard_device::device_reset()
{
cancel_sensor();
cancel_hand();
undo_reset();
if (!m_nvram_on)
{
clear_board();
m_custom_init_cb(0);
}
undo_reset();
refresh();
}

View File

@ -33,6 +33,7 @@ public:
sensorboard_device &set_spawnpoints(u8 i) { m_maxspawn = i; m_maxid = i; return *this; } // number of piece spawnpoints, max 16
sensorboard_device &set_max_id(u8 i) { m_maxid = i; return *this; } // maximum piece id (if larger than set_spawnpoints)
sensorboard_device &set_delay(attotime delay) { m_sensordelay = delay; return *this; } // delay when activating a sensor (like PORT_IMPULSE), set to attotime::never to disable
sensorboard_device &set_nvram(bool b) { m_nvram_on = b; return *this; } // load last board position on start
sensorboard_device &set_ui_enable(bool b) { if (!b) m_maxspawn = 0; m_ui_enabled = (b) ? 3 : 0; return *this; } // enable UI inputs
sensorboard_device &set_mod_enable(bool b) { if (b) m_ui_enabled |= 1; else m_ui_enabled &= 2; return *this; } // enable modifier keys
@ -124,6 +125,7 @@ private:
u32 m_usize;
void nvram_init(nvram_device &nvram, void *data, size_t size);
bool m_nvram_on;
emu_timer *m_undotimer;
TIMER_CALLBACK_MEMBER(undo_tick);

View File

@ -292,6 +292,7 @@ void sphinx40_state::sphinx40(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(150));
m_board->set_nvram(true);
/* video hardware */
HD61603(config, m_lcd, 0);

View File

@ -623,6 +623,7 @@ void eag_state::eag_base(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(150));
m_board->set_nvram(true);
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(9, 16);

View File

@ -466,6 +466,7 @@ void elite_state::eas(machine_config &config)
m_ppi8255->tri_pc_callback().set_constant(0);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
m_board->set_nvram(true);
config.set_default_layout(layout_fidel_eas);
}

View File

@ -138,6 +138,8 @@ void berlin_state::berlin(machine_config &config)
ADDRESS_MAP_BANK(config, "nvram_map").set_map(&berlin_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13);
MEPHISTO_BUTTONS_BOARD(config, m_board);
subdevice<sensorboard_device>("board:board")->set_nvram(true);
MEPHISTO_DISPLAY_MODULE2(config, "display");
config.set_default_layout(layout_mephisto_berlin);
}

View File

@ -181,6 +181,7 @@ void mephisto_modena_state::modena(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(150));
m_board->set_nvram(true);
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(3, 8);

View File

@ -410,8 +410,9 @@ void mmodular_state::alm16(machine_config &config)
ADDRESS_MAP_BANK(config, "nvram_map").set_map(&mmodular_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13);
MEPHISTO_SENSORS_BOARD(config, m_board);
m_board->subdevice<sensorboard_device>("board")->set_spawnpoints(12+2); // 2 jokers
m_board->subdevice<sensorboard_device>("board")->spawn_cb().set(FUNC(mmodular_state::spawn_cb));
subdevice<sensorboard_device>("board:board")->set_spawnpoints(12+2); // 2 jokers
subdevice<sensorboard_device>("board:board")->spawn_cb().set(FUNC(mmodular_state::spawn_cb));
subdevice<sensorboard_device>("board:board")->set_nvram(true);
TIMER(config, "bav_busy").configure_generic(nullptr);

View File

@ -213,6 +213,8 @@ void mmtm_state::mmtm_v(machine_config &config)
ADDRESS_MAP_BANK(config, "nvram_map").set_map(&mmtm_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13);
MEPHISTO_SENSORS_BOARD(config, "board");
subdevice<sensorboard_device>("board:board")->set_nvram(true);
MEPHISTO_DISPLAY_MODULE2(config, "display");
config.set_default_layout(layout_mephisto_modular_tm);
}

View File

@ -259,6 +259,7 @@ void cforte_state::cforte(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(200));
m_board->set_nvram(true);
/* video hardware */
HLCD0538(config, m_lcd).write_cols().set(FUNC(cforte_state::lcd_output_w));

View File

@ -377,6 +377,7 @@ void const_state::ssensor4(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &const_state::ssensor4_map);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
m_board->set_nvram(true);
config.set_default_layout(layout_novag_ssensor4);
}
@ -447,6 +448,7 @@ void const_state::sconst(machine_config &config)
m_irq_on->set_start_delay(m_irq_on->period() - attotime::from_nsec(10200)); // irq active for 10.2us
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
m_board->set_nvram(true);
config.set_default_layout(layout_novag_supercon);
}

View File

@ -299,6 +299,7 @@ void diablo_state::diablo68k(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(100));
m_board->set_nvram(true);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_LCD);

View File

@ -429,6 +429,7 @@ void sexpert_state::sexpert(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(200));
m_board->set_nvram(true);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_LCD);
@ -472,6 +473,7 @@ void sforte_state::sforte(machine_config &config)
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &sforte_state::sforte_map);
m_irq_on->set_start_delay(m_irq_on->period() - attotime::from_usec(10)); // tlow measured between 8us and 12us (unstable)
m_board->set_type(sensorboard_device::BUTTONS);
config.set_default_layout(layout_novag_sforte);

View File

@ -283,6 +283,7 @@ void corona_state::corona(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(200));
m_board->set_nvram(true);
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(3+8, 8);

View File

@ -457,6 +457,7 @@ void mark5_state::mark6(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(150));
m_board->set_nvram(true);
PWM_DISPLAY(config, m_display[3]).set_size(8, 8);
m_display[3]->set_bri_levels(0.001);

View File

@ -301,6 +301,7 @@ void risc2500_state::risc2500(machine_config &config)
m_board->set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(100));
m_board->set_nvram(true);
RAM(config, m_ram).set_default_size("2M").set_extra_options("128K, 256K, 512K, 1M, 2M");

View File

@ -312,6 +312,7 @@ void simultano_state::simultano(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(350));
m_board->set_nvram(true);
/* video hardware */
SED1502(config, m_lcd, 32768).write_segs().set(FUNC(simultano_state::lcd_output_w));

View File

@ -483,6 +483,7 @@ void stratos_state::stratos(machine_config &config)
SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS);
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(350));
m_board->set_nvram(true);
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(2+4, 8+1);

View File

@ -233,6 +233,7 @@ void tasc_state::tasc(machine_config &config)
m_lcd->set_fs(1); // font size 6x8
TASC_SB30(config, m_smartboard);
subdevice<sensorboard_device>("smartboard:board")->set_nvram(true);
config.set_default_layout(layout_tascr30);