Merge pull request #2955 from MoochMcGee/vga-work

pc_vga.cpp: CRTC start address is supposed to be shifted left by 2, from 86Box [Melissa Goad]
This commit is contained in:
R. Belmont 2017-12-21 22:50:07 -05:00 committed by GitHub
commit fa4d18a25a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -439,6 +439,17 @@ uint16_t vga_device::offset()
return vga.crtc.offset << 2;
}
uint32_t vga_device::start_addr()
{
// popmessage("Offset: %04x %s %s **",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD");
if(vga.crtc.dw)
return vga.crtc.start_addr << 2;
if(vga.crtc.word_mode)
return vga.crtc.start_addr << 0;
else
return vga.crtc.start_addr << 1;
}
void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint8_t ch, attr;
@ -579,7 +590,7 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
curr_addr = 0;
if(!(vga.sequencer.data[4] & 0x08))
{
for (addr = VGA_START_ADDRESS, line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
for (addr = start_addr(), line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
{
for(yi = 0;yi < height; yi++)
{
@ -608,7 +619,7 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
}
else
{
for (addr = VGA_START_ADDRESS, line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
for (addr = start_addr(), line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
{
for(yi = 0;yi < height; yi++)
{

View File

@ -83,6 +83,7 @@ protected:
void attribute_reg_write(uint8_t index, uint8_t data);
void gc_reg_write(uint8_t index,uint8_t data);
virtual uint16_t offset();
virtual uint32_t start_addr();
inline uint8_t vga_latch_write(int offs, uint8_t data);
inline uint8_t rotate_right(uint8_t val) { return (val >> vga.gc.rotate_count) | (val << (8 - vga.gc.rotate_count)); }
inline uint8_t vga_logical_op(uint8_t data, uint8_t plane, uint8_t mask)