diff options
| author | 2017-12-21 22:50:07 -0500 | |
|---|---|---|
| committer | 2017-12-21 22:50:07 -0500 | |
| commit | fa4d18a25a933e4415d06a4dbc11909b77480e97 (patch) | |
| tree | cd4cbea2143f69751ab97d8982babda4c50a7bff /src | |
| parent | 5a3174576236bb4e2619a2e3ad5b6d9f30d69542 (diff) | |
| parent | 35c0fb6cd675c88ebd4f5a2113186f17af4742e6 (diff) | |
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]
Diffstat (limited to 'src')
| -rw-r--r-- | src/devices/video/pc_vga.cpp | 15 | ||||
| -rw-r--r-- | src/devices/video/pc_vga.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp index 249ebc6a0fd..8370483f147 100644 --- a/src/devices/video/pc_vga.cpp +++ b/src/devices/video/pc_vga.cpp @@ -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++) { diff --git a/src/devices/video/pc_vga.h b/src/devices/video/pc_vga.h index 6c154ada507..9d45ed2e9e2 100644 --- a/src/devices/video/pc_vga.h +++ b/src/devices/video/pc_vga.h @@ -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) |
