diff options
author | cracyc <cracyc@users.noreply.github.com> | 2018-08-07 17:15:19 -0500 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2018-08-07 17:15:19 -0500 |
commit | 2dcb1e978e520a05a2c283be97fc4dae46213cd5 (patch) | |
tree | 249730b5e765fa1f43a72fbb20e47e572e881be2 | |
parent | 2e3e3ccb65a04309b487973f1a77ef3ae1de8880 (diff) |
vis: fix display in 256 color mode and add buttons 1 and 2 [Carl]
-rw-r--r-- | src/devices/video/pc_vga.cpp | 7 | ||||
-rw-r--r-- | src/devices/video/pc_vga.h | 1 | ||||
-rw-r--r-- | src/mame/drivers/vis.cpp | 7 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp index 86385b658cd..78575c56e7d 100644 --- a/src/devices/video/pc_vga.cpp +++ b/src/devices/video/pc_vga.cpp @@ -314,6 +314,7 @@ void vga_device::device_start() save_item(NAME(vga.crtc.map13)); save_item(NAME(vga.crtc.irq_clear)); save_item(NAME(vga.crtc.irq_disable)); + save_item(NAME(vga.crtc.no_wrap)); save_item(NAME(vga.gc.index)); save_item(NAME(vga.gc.latch)); @@ -359,6 +360,7 @@ void svga_device::device_start() save_item(NAME(svga.bank_r)); save_item(NAME(svga.bank_w)); + save_item(NAME(svga.rgb8_en)); save_item(NAME(svga.rgb15_en)); save_item(NAME(svga.rgb16_en)); save_item(NAME(svga.rgb24_en)); @@ -575,6 +577,7 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect) int yi; int xi; int pel_shift = (vga.attribute.pel_shift & 6); + int addrmask = vga.crtc.no_wrap ? -1 : 0xffff; /* line compare is screen sensitive */ mask_comp = 0x3ff; //| (LINES & 0x300); @@ -605,7 +608,7 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect) { if(!screen().visible_area().contains(c+xi-(pel_shift), line + yi)) continue; - bitmapline[c+xi-(pel_shift)] = pen(vga.memory[(pos & 0xffff)+((xi >> 1)*0x10000)]); + bitmapline[c+xi-(pel_shift)] = pen(vga.memory[(pos & addrmask)+((xi >> 1)*0x10000)]); } } } @@ -632,7 +635,7 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect) { if(!screen().visible_area().contains(c+xi-(pel_shift), line + yi)) continue; - bitmapline[c+xi-pel_shift] = pen(vga.memory[(pos+(xi >> 1)) & 0xffff]); + bitmapline[c+xi-pel_shift] = pen(vga.memory[(pos+(xi >> 1)) & addrmask]); } } } diff --git a/src/devices/video/pc_vga.h b/src/devices/video/pc_vga.h index 6dc4fa6737e..afde9bfdfd6 100644 --- a/src/devices/video/pc_vga.h +++ b/src/devices/video/pc_vga.h @@ -184,6 +184,7 @@ protected: /**/ uint8_t map13; /**/ uint8_t irq_clear; /**/ uint8_t irq_disable; + uint8_t no_wrap; } crtc; struct diff --git a/src/mame/drivers/vis.cpp b/src/mame/drivers/vis.cpp index 8ef1fcff403..0b1822f8303 100644 --- a/src/mame/drivers/vis.cpp +++ b/src/mame/drivers/vis.cpp @@ -391,6 +391,7 @@ void vis_vga_device::device_start() m_isa->install_memory(0x0a0000, 0x0bffff, read8_delegate(FUNC(vis_vga_device::visvgamem_r), this), write8_delegate(FUNC(vis_vga_device::visvgamem_w), this)); svga_device::device_start(); vga.svga_intf.seq_regcount = 0x2d; + save_pointer(m_crtc_regs,"VIS CRTC",0x32); } void vis_vga_device::device_reset() @@ -511,6 +512,7 @@ WRITE8_MEMBER(vis_vga_device::vga_w) { vga.gc.shift256 = 1; vga.crtc.dw = 1; + vga.crtc.no_wrap = 1; if(m_8bit_640) svga.rgb8_en = 1; else @@ -520,6 +522,7 @@ WRITE8_MEMBER(vis_vga_device::vga_w) { vga.gc.shift256 = m_shift256; vga.crtc.dw = m_dw; + vga.crtc.no_wrap = 0; svga.rgb8_en = 0; } break; @@ -883,9 +886,9 @@ static void vis_cards(device_slot_interface &device) static INPUT_PORTS_START(vis) PORT_START("PAD") PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("1") PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("A") PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("2") PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("B") PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, vis_state, update, 0) |