ckmaster,ch2001: change irq frequency

This commit is contained in:
hap 2020-07-28 12:06:40 +02:00
parent 0eacedc1c7
commit 34ee31faeb
3 changed files with 13 additions and 15 deletions

View File

@ -4,6 +4,7 @@
/******************************************************************************
Chess King Master (yes, it's plainly named "Master")
According to the manual, the chess engine is Cyrus (by Richard Lang).
Hardware notes:
- Z80 CPU(NEC D780C-1) @ 4MHz(8MHz XTAL), IRQ from 555 timer
@ -80,13 +81,12 @@ private:
u8 input_r();
void control_w(u8 data);
u16 m_inp_mux;
u16 m_inp_mux = 0;
};
void master_state::machine_start()
{
// zerofill, register for savestates
m_inp_mux = 0;
// register for savestates
save_item(NAME(m_inp_mux));
}
@ -225,14 +225,14 @@ void master_state::master(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &master_state::main_trampoline);
ADDRESS_MAP_BANK(config, "mainmap").set_map(&master_state::main_map).set_options(ENDIANNESS_LITTLE, 8, 16);
const attotime irq_period = attotime::from_hz(429); // theoretical frequency from 555 timer (22nF, 150K, 1K5), measurement was 418Hz
const attotime irq_period = attotime::from_hz(418); // 555 timer (22nF, 150K, 1K5), measured 418Hz
TIMER(config, m_irq_on).configure_periodic(FUNC(master_state::irq_on<INPUT_LINE_IRQ0>), irq_period);
m_irq_on->set_start_delay(irq_period - attotime::from_nsec(22870)); // active for 22.87us
TIMER(config, "irq_off").configure_periodic(FUNC(master_state::irq_off<INPUT_LINE_IRQ0>), irq_period);
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(100));
m_board->set_delay(attotime::from_msec(150));
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(9, 2);
@ -254,7 +254,7 @@ void master_state::master(machine_config &config)
ROM_START( ckmaster )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("ckmaster.ic2", 0x0000, 0x2000, CRC(59cbec9e) SHA1(2e0629e65778da62bed857406b91a334698d2fe8) ) // D2764C, no label
ROM_LOAD("d2764c-3.ic2", 0x0000, 0x2000, CRC(59cbec9e) SHA1(2e0629e65778da62bed857406b91a334698d2fe8) ) // no custom label
ROM_END
} // anonymous namespace

View File

@ -3,7 +3,8 @@
// thanks-to:Berger
/******************************************************************************
CXG Chess 2001, also sold by Hanimex as HCG 1900 and by CGL as Computachess Champion.
CXG Chess 2001, also sold by Hanimex as Computachess (model HCG 1900),
and by CGL as Computachess Champion.
CXG Chess 3000 is assumed to be on similar hardware as this.
The chess engine is by Richard Lang, based on Cyrus.
@ -74,16 +75,12 @@ private:
void leds_w(u8 data);
u8 input_r();
u16 m_inp_mux;
int m_dac_data;
u16 m_inp_mux = 0;
int m_dac_data = 0;
};
void ch2001_state::machine_start()
{
// zerofill
m_inp_mux = 0;
m_dac_data = 0;
// register for savestates
save_item(NAME(m_inp_mux));
save_item(NAME(m_dac_data));
@ -188,7 +185,7 @@ void ch2001_state::ch2001(machine_config &config)
Z80(config, m_maincpu, 8_MHz_XTAL/2);
m_maincpu->set_addrmap(AS_PROGRAM, &ch2001_state::main_map);
const attotime irq_period = attotime::from_hz(533); // theoretical frequency from 555 timer (20nF, 100K+33K, 1K2), measurement was 568Hz
const attotime irq_period = attotime::from_hz(568); // 555 timer (20nF, 100K+33K, 1K2), measured 568Hz
TIMER(config, m_irq_on).configure_periodic(FUNC(ch2001_state::irq_on<INPUT_LINE_IRQ0>), irq_period);
m_irq_on->set_start_delay(irq_period - attotime::from_nsec(16600)); // active for 16.6us
TIMER(config, "irq_off").configure_periodic(FUNC(ch2001_state::irq_off<INPUT_LINE_IRQ0>), irq_period);

View File

@ -259,7 +259,8 @@ uint32_t microvision_state::screen_update(screen_device &screen, bitmap_rgb32 &b
int p = m_lcd_pwm->read_element_bri(y ^ 15, x ^ 15) * 10000;
p = (p > 255) ? 0 : p ^ 255;
bitmap.pix32(y, x) = p << 16 | p << 8 | p;
if (cliprect.contains(x, y))
bitmap.pix32(y, x) = p << 16 | p << 8 | p;
}
}