Minor cleanup of H19

This commit is contained in:
Mark Garlanger 2017-03-25 00:16:34 -05:00 committed by Vas Crabb
parent 7c2ee1a762
commit 37d2804c4a

View File

@ -15,8 +15,6 @@
is pressed/data is received.
TODO:
- Finish connecting up the 8250
- enable 8520 interrupts
- speed up emulation
- update SW401 baud rate options for Watz ROM
- update SW401 & SW402 definitions for Super-19 ROM
@ -64,6 +62,7 @@ Address Description
#define H19_CLOCK (XTAL_12_288MHz / 6)
#define MC6845_CLOCK (XTAL_12_288MHz /8)
#define INS8250_CLOCK (XTAL_12_288MHz /4)
// Capacitor value in pF
#define H19_KEY_DEBOUNCE_CAPACITOR 5000
#define MM5740_CLOCK (mm5740_device::calc_effective_clock_key_debounce(H19_KEY_DEBOUNCE_CAPACITOR))
@ -73,7 +72,6 @@ Address Description
#define KBDC_TAG "mm5740"
class h19_state : public driver_device
{
public:
@ -111,6 +109,7 @@ public:
private:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual void machine_reset() override;
required_device<palette_device> m_palette;
required_device<cpu_device> m_maincpu;
required_device<mc6845_device> m_crtc;
@ -124,9 +123,10 @@ private:
uint8_t m_transchar;
bool m_strobe;
uint16_t translate_mm5740_b(uint16_t b);
bool m_keyclickactive;
bool m_bellactive;
uint16_t translate_mm5740_b(uint16_t b);
};
void h19_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@ -271,7 +271,6 @@ static INPUT_PORTS_START( h19 )
PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Scroll") PORT_CODE(KEYCODE_LWIN)
PORT_START("X8")
PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
@ -284,7 +283,6 @@ static INPUT_PORTS_START( h19 )
PORT_BIT(0x100, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
PORT_BIT(0x200, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
PORT_START("X9")
PORT_BIT(0x001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
PORT_BIT(0x002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
@ -419,15 +417,13 @@ READ8_MEMBER(h19_state::kbd_key_r)
READ8_MEMBER(h19_state::kbd_flags_r)
{
uint8_t rv = 0;
uint16_t modifiers = m_kbspecial->read();
rv = modifiers & 0xff;
uint8_t rv = modifiers & 0x7f;
// check both shifts
if (((modifiers & 0x020) == 0) || ((modifiers & 0x100) == 0))
{
rv |= 0x1;
rv |= KB_STATUS_SHIFT_KEYS_MASK;
}
// invert offline switch
@ -463,20 +459,16 @@ WRITE_LINE_MEMBER(h19_state::mm5740_data_ready_w)
}
}
MC6845_UPDATE_ROW( h19_state::crtc_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
uint8_t chr,gfx;
uint16_t mem,x;
uint32_t *p = &bitmap.pix32(y);
for (x = 0; x < x_count; x++)
for (uint16_t x = 0; x < x_count; x++)
{
uint8_t inv=0;
if (x == cursor_x) inv=0xff;
mem = (ma + x) & 0x7ff;
chr = m_p_videoram[mem];
uint8_t inv = (x == cursor_x) ? 0xff : 0;
uint8_t chr = m_p_videoram[(ma + x) & 0x7ff];
if (chr & 0x80)
{
@ -485,7 +477,7 @@ MC6845_UPDATE_ROW( h19_state::crtc_update_row )
}
/* get pattern of pixels for that character scanline */
gfx = m_p_chargen[(chr<<4) | ra] ^ inv;
uint8_t gfx = m_p_chargen[(chr<<4) | ra] ^ inv;
/* Display a scanline of a character (8 pixels) */
*p++ = palette[BIT(gfx, 7)];
@ -520,11 +512,12 @@ GFXDECODE_END
static MACHINE_CONFIG_START( h19, h19_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80, H19_CLOCK) // From schematics
MCFG_CPU_ADD("maincpu", Z80, H19_CLOCK) // From schematics
MCFG_CPU_PROGRAM_MAP(h19_mem)
MCFG_CPU_IO_MAP(h19_io)
/* video hardware */
// TODO: make configurable, Heath offered 3 different CRTs - White, Green, Amber.
MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::green())
MCFG_SCREEN_REFRESH_RATE(60) // TODO- this is adjustable by dipswitch.
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
@ -542,7 +535,7 @@ static MACHINE_CONFIG_START( h19, h19_state )
MCFG_MC6845_OUT_VSYNC_CB(INPUTLINE("maincpu", INPUT_LINE_NMI)) // frame pulse
MCFG_DEVICE_ADD("ins8250", INS8250, INS8250_CLOCK)
MCFG_INS8250_OUT_INT_CB(INPUTLINE("maincpu", 0)) // interrupt
MCFG_INS8250_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(KBDC_TAG, MM5740, MM5740_CLOCK)
MCFG_MM5740_MATRIX_X1(IOPORT("X1"))
@ -609,7 +602,8 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
COMP( 1979, h19, 0, 0, h19, h19, driver_device, 0, "Heath Inc", "Heathkit H-19", 0 )
/* TODO - verify the years for these third-party replacement ROMs. */
//Super-19 ROM - ATG Systems, Inc - Adv in Sextant Issue 4, Winter 1983. With the magazine lead-time, likely released late 1982.
COMP( 1982, super19, h19, 0, h19, h19, driver_device, 0, "Heath Inc", "Heathkit H-19 w/ Super-19 ROM", 0 )
// Watzman ROM - HUG p/n 885-1121, announced in REMark Issue 33, Oct. 1982
COMP( 1982, watz19, h19, 0, h19, h19, driver_device, 0, "Heath Inc", "Heathkit H-19 w/ Watzman ROM", 0 )