diff options
author | cracyc <cracyc@users.noreply.github.com> | 2015-11-17 13:11:03 -0600 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2015-11-17 13:13:26 -0600 |
commit | 465caf8038a120b4c1ffad9df67a1dc7474e5bb1 (patch) | |
tree | 4cd845a68a83e56303cc381e9582bf972d5f21ea /src/devices/bus/isa/cga.cpp | |
parent | 09d7fbc9fa8cc099595c6df55bb18b050ccc702e (diff) |
cga: treat as fixed sync monitor (nw)
Diffstat (limited to 'src/devices/bus/isa/cga.cpp')
-rw-r--r-- | src/devices/bus/isa/cga.cpp | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp index 47f72f22121..d7759045208 100644 --- a/src/devices/bus/isa/cga.cpp +++ b/src/devices/bus/isa/cga.cpp @@ -183,6 +183,10 @@ MC6845_UPDATE_ROW( isa8_cga_device::crtc_update_row ) if (m_update_row_type == -1) return; + y = m_y; + if(m_y >= bitmap.height()) + return; + switch (m_update_row_type) { case CGA_TEXT_INTEN: @@ -253,6 +257,8 @@ static MACHINE_CONFIG_FRAGMENT( cga ) MCFG_MC6845_UPDATE_ROW_CB(isa8_cga_device, crtc_update_row) MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(isa8_cga_device, hsync_changed)) MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(isa8_cga_device, vsync_changed)) + MCFG_MC6845_RECONFIGURE_CB(isa8_cga_device, reconfigure) + MCFG_VIDEO_SET_SCREEN(NULL) MACHINE_CONFIG_END @@ -304,7 +310,8 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag, m_cga_config(*this, "cga_config"), m_framecnt(0), m_mode_control(0), m_color_select(0), m_update_row_type(-1), m_chr_gen_base(nullptr), m_chr_gen(nullptr), m_vsync(0), m_hsync(0), m_vram_size( 0x4000 ), m_plantronics(0), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_screen(*this, "screen") { m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800; m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000; @@ -319,7 +326,8 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, device_type type m_cga_config(*this, "cga_config"), m_framecnt(0), m_mode_control(0), m_color_select(0), m_update_row_type(-1), m_chr_gen_base(nullptr), m_chr_gen(nullptr), m_vsync(0), m_hsync(0), m_vram_size( 0x4000 ), m_plantronics(0), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_screen(*this, "screen") { m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800; m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000; @@ -346,6 +354,7 @@ void isa8_cga_device::device_start() /* Initialise the cga palette */ int i; + for ( i = 0; i < CGA_PALETTE_SETS * 16; i++ ) { m_palette->set_pen_color( i, cga_palette[i][0], cga_palette[i][1], cga_palette[i][2] ); @@ -376,6 +385,7 @@ void isa8_cga_device::device_start() save_item(NAME(m_hsync)); save_item(NAME(m_vram)); save_item(NAME(m_plantronics)); + save_item(NAME(m_y)); } @@ -390,6 +400,7 @@ void isa8_cga_device::device_reset() m_vsync = 0; m_hsync = 0; m_color_select = 0; + m_y = 0; memset(m_palette_lut_2bpp, 0, sizeof(m_palette_lut_2bpp)); } @@ -911,18 +922,33 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_1bpp_update_row ) WRITE_LINE_MEMBER( isa8_cga_device::hsync_changed ) { m_hsync = state ? 1 : 0; + if(state && !m_vsync) + { + m_screen->update_now(); + m_y++; + } } WRITE_LINE_MEMBER( isa8_cga_device::vsync_changed ) { - m_vsync = state ? 9 : 0; if ( state ) { m_framecnt++; } + else + { + m_screen->reset_origin(); + m_y = 0; + } + m_vsync = state ? 9 : 0; } +MC6845_RECONFIGURE( isa8_cga_device::reconfigure ) +{ + rectangle curvisarea = m_screen->visible_area(); + m_screen->set_visible_area(visarea.min_x, visarea.max_x, curvisarea.min_y, curvisarea.max_y); +} void isa8_cga_device::set_palette_luts(void) { @@ -1893,6 +1919,17 @@ const rom_entry *isa8_cga_mc1502_device::device_rom_region() const const device_type ISA8_CGA_M24 = &device_creator<isa8_cga_m24_device>; +static MACHINE_CONFIG_DERIVED( m24, cga ) + MCFG_DEVICE_MODIFY(CGA_SCREEN_NAME) + MCFG_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,912,0,640,462,0,400) + MCFG_DEVICE_MODIFY(CGA_MC6845_NAME) + MCFG_MC6845_RECONFIGURE_CB(isa8_cga_m24_device, reconfigure) +MACHINE_CONFIG_END + +machine_config_constructor isa8_cga_m24_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( m24 ); +} isa8_cga_m24_device::isa8_cga_m24_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : isa8_cga_device( mconfig, ISA8_CGA_M24, "Olivetti M24 CGA", tag, owner, clock, "cga_m24", __FILE__), m_mode2(0), m_index(0) { @@ -1906,6 +1943,12 @@ void isa8_cga_m24_device::device_reset() m_start_offset = 0; } +MC6845_RECONFIGURE( isa8_cga_m24_device::reconfigure ) +{ + // just reconfigure the screen, the apb sets it to 256 lines rather than 400 + m_screen->configure(width, height, visarea, frame_period); +} + WRITE8_MEMBER( isa8_cga_m24_device::io_write ) { mc6845_device *mc6845 = subdevice<mc6845_device>(CGA_MC6845_NAME); |