From 59051ff796ed888619cce6a30f6866c5a0eadb39 Mon Sep 17 00:00:00 2001 From: cracyc Date: Sat, 25 Nov 2017 15:41:12 -0600 Subject: cga: m24 also has 400 line text mode (nw) --- src/devices/bus/isa/cga.cpp | 104 ++++++++++++++++++++++++-------------------- src/devices/bus/isa/cga.h | 2 +- 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp index e2f98c6cfe9..91ee69d48b5 100644 --- a/src/devices/bus/isa/cga.cpp +++ b/src/devices/bus/isa/cga.cpp @@ -1721,11 +1721,26 @@ isa8_cga_m24_device::isa8_cga_m24_device(const machine_config &mconfig, device_t m_vram_size = 0x8000; } +ROM_START(cga_m24) + ROM_REGION(0x2000, "gfx1", 0) + ROM_LOAD("m24 graphics board go380 258 pqbq.bin", 0x00000, 0x1000, CRC(04495786) SHA1(ea34ee527c5632d049ec11a7ae0fde9e6dee545f)) + + ROM_REGION(0x1000, "crtc_prom", 0) + ROM_LOAD("m24 graphics board go380 gi 9433-0088.bin", 0x00000, 0x1000, CRC(5725e660) SHA1(634c2d165d401883a955e144a0abfa2078a47013)) +ROM_END + +const tiny_rom_entry *isa8_cga_m24_device::device_rom_region() const +{ + return ROM_NAME(cga_m24); +} + void isa8_cga_m24_device::device_reset() { isa8_cga_device::device_reset(); m_mode2 = 0; m_start_offset = 0; + m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x0000; + m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x0000; } MC6845_RECONFIGURE( isa8_cga_m24_device::reconfigure ) @@ -1794,12 +1809,50 @@ READ8_MEMBER( isa8_cga_m24_device::io_read ) return data; } -MC6845_UPDATE_ROW( isa8_cga_m24_device::crtc_update_row ) + +MC6845_UPDATE_ROW(isa8_cga_m24_device::crtc_update_row) { if(m_mode2 & 1) m24_gfx_1bpp_m24_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); - else - isa8_cga_device::crtc_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); + + 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: + cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); + break; + case CGA_TEXT_INTEN_ALT: + cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); + break; + case CGA_TEXT_INTEN_CG: // this hardware doesn't support composite + break; + case CGA_TEXT_BLINK: + cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); + break; + case CGA_TEXT_BLINK_ALT: + cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); + break; + case CGA_TEXT_BLINK_SI: + break; + case CGA_GFX_1BPP: + cga_gfx_1bpp_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); + break; + case CGA_GFX_2BPP: + cga_gfx_2bpp_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); + break; + case CGA_GFX_4BPPL: + cga_gfx_4bppl_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); + break; + case CGA_GFX_4BPPH: + cga_gfx_4bpph_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); + break; + } } MC6845_UPDATE_ROW( isa8_cga_m24_device::m24_gfx_1bpp_m24_update_row ) @@ -1905,48 +1958,3 @@ WRITE8_MEMBER(isa8_cga_cportiii_device::port_23c6_w) m_isa->install_bank(0xb8000, 0xb8000 + 0x8000 - 1, "bank_cga", &m_vram[0]); } -MC6845_UPDATE_ROW(isa8_cga_cportiii_device::crtc_update_row) -{ - if(m_mode2 & 1) - m24_gfx_1bpp_m24_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); - - 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: - cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); - break; - case CGA_TEXT_INTEN_ALT: - cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); - break; - case CGA_TEXT_INTEN_CG: // this hardware doesn't support composite - break; - case CGA_TEXT_BLINK: - cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); - break; - case CGA_TEXT_BLINK_ALT: - cga_text(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); - break; - case CGA_TEXT_BLINK_SI: - break; - case CGA_GFX_1BPP: - cga_gfx_1bpp_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); - break; - case CGA_GFX_2BPP: - cga_gfx_2bpp_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); - break; - case CGA_GFX_4BPPL: - cga_gfx_4bppl_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); - break; - case CGA_GFX_4BPPH: - cga_gfx_4bpph_update_row(bitmap, cliprect, ma, ra >> 1, y, x_count, cursor_x, de, hbp, vbp); - break; - } -} - diff --git a/src/devices/bus/isa/cga.h b/src/devices/bus/isa/cga.h index 8711d9b188e..ca799d9b8cc 100644 --- a/src/devices/bus/isa/cga.h +++ b/src/devices/bus/isa/cga.h @@ -284,6 +284,7 @@ protected: virtual void device_reset() override; // optional information overrides virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; uint8_t m_mode2, m_index; }; @@ -301,7 +302,6 @@ public: DECLARE_WRITE8_MEMBER(port_23c6_w); DECLARE_READ8_MEMBER(char_ram_read); DECLARE_WRITE8_MEMBER(char_ram_write); - virtual MC6845_UPDATE_ROW( crtc_update_row ) override; protected: virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; -- cgit v1.2.3