diff options
Diffstat (limited to 'src/mess/drivers/dim68k.c')
-rw-r--r-- | src/mess/drivers/dim68k.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/mess/drivers/dim68k.c b/src/mess/drivers/dim68k.c index af052b4c8bd..9c12fb1caff 100644 --- a/src/mess/drivers/dim68k.c +++ b/src/mess/drivers/dim68k.c @@ -66,6 +66,7 @@ public: DECLARE_WRITE16_MEMBER( dim68k_video_high_w ); DECLARE_WRITE16_MEMBER( dim68k_video_reset_w ); DECLARE_WRITE8_MEMBER(kbd_put); + MC6845_UPDATE_ROW(crtc_update_row); const UINT8 *m_p_chargen; bool m_speaker_bit; UINT8 m_video_control; @@ -224,15 +225,14 @@ void dim68k_state::video_start() } // Text-only; graphics isn't emulated yet. Need to find out if hardware cursor is used. -MC6845_UPDATE_ROW( dim68k_update_row ) +MC6845_UPDATE_ROW( dim68k_state::crtc_update_row ) { - dim68k_state *state = device->machine().driver_data<dim68k_state>(); - const rgb_t *palette = state->m_palette->palette()->entry_list_raw(); + const rgb_t *palette = m_palette->palette()->entry_list_raw(); UINT8 chr,gfx,x,xx,inv; UINT16 chr16=0x2020; // set to spaces if screen is off UINT32 *p = &bitmap.pix32(y); - UINT8 screen_on = ~state->m_video_control & 4; - UINT8 dot8 = ~state->m_video_control & 40; + UINT8 screen_on = ~m_video_control & 4; + UINT8 dot8 = ~m_video_control & 40; // need to divide everything in half to cater for 16-bit reads x_count /= 2; @@ -242,14 +242,14 @@ MC6845_UPDATE_ROW( dim68k_update_row ) for (x = 0; x < x_count; x++) { if (screen_on) - chr16 = state->m_ram[ma+x]; // reads 2 characters + chr16 = m_ram[ma+x]; // reads 2 characters inv=0; if (xx == cursor_x && screen_on) inv=0xff; xx++; chr = chr16>>8; - gfx = state->m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0); + gfx = m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0); *p++ = palette[BIT(gfx, 7)]; *p++ = palette[BIT(gfx, 6)]; *p++ = palette[BIT(gfx, 5)]; @@ -264,7 +264,7 @@ MC6845_UPDATE_ROW( dim68k_update_row ) xx++; chr = chr16; - gfx = state->m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0); + gfx = m_p_chargen[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0); *p++ = palette[BIT(gfx, 7)]; *p++ = palette[BIT(gfx, 6)]; *p++ = palette[BIT(gfx, 5)]; @@ -294,21 +294,6 @@ static GFXDECODE_START( dim68k ) GFXDECODE_ENTRY( "chargen", 0x0000, dim68k_charlayout, 0, 1 ) GFXDECODE_END -static MC6845_INTERFACE( dim68k_crtc ) -{ - false, - 0,0,0,0, /* visarea adjustment */ - 8, /* number of dots per character - switchable 7 or 8 */ - NULL, - dim68k_update_row, /* handler to display a scanline */ - NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - NULL -}; - static SLOT_INTERFACE_START( dim68k_floppies ) SLOT_INTERFACE( "525hd", FLOPPY_525_HD ) SLOT_INTERFACE_END @@ -342,7 +327,12 @@ static MACHINE_CONFIG_START( dim68k, dim68k_state ) MCFG_UPD765A_ADD("fdc", true, true) // these options unknown MCFG_FLOPPY_DRIVE_ADD("fdc:0", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:1", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats) - MCFG_MC6845_ADD("crtc", MC6845, "screen", 1790000, dim68k_crtc) + + MCFG_MC6845_ADD("crtc", MC6845, "screen", 1790000) + MCFG_MC6845_SHOW_BORDER_AREA(false) + MCFG_MC6845_CHAR_WIDTH(8) + MCFG_MC6845_UPDATE_ROW_CB(dim68k_state, crtc_update_row) + MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(WRITE8(dim68k_state, kbd_put)) MACHINE_CONFIG_END |