VGA's CRTC Mode control register map13,14&Address wrap bits?

I'm currently writing a full VGA emulation for my emulator, but I can't get BIOS Video mode 06h working. I think the problem is somewhere in the Address wrap and MAP13/14 bits in the CRTC Mode Control Register. (functions addresswrap() and patch_map1314() in vga/vga_screen/vga_displaygeneration_crtcontroller.c)

The rendering of individual pixels and setting of the scan line address is in vga/vga_screen/vga_sequencer_graphicsmode.c, the setting of the scan line counter is in vga/vga_screen/vga_sequencer.c.

I keep getting a distorted screen with BIOS video mode 06h (All other modes 00h-13h work fine.)

File with full VGA chipset emulation (as far as it's working, although slow):
http://superfury.heliohost.org/cplusplus/vga_20131012_1941.zip

vga/vga_screen/vga_screen.c is the start of the renderer (also the rest of the directory's files)
vga/vga.c contains the main vga allocation/registration.
vga/vga_mmu.c contains all MMU i/o (address 0xA0000-0xBFFFF)
vga/vga_io.c contains all VGA register I/O (using CPU outb/w and inb/w)

Anyone can help me with this?

The flow of rendering is like this:

vga_screen->vga_sequencer ->
->vga_sequencer_textmode->>vga_sequencer_textmode_cursor.c
OR
->vga_sequencer_graphicsmode.c

next:
->vga_attributecontroller.c->vga_dac.c

Finally the rendering from the 1024x1024 buffer is done by the GPU rendering, which is SDL-dependant.
Last edited on
Funny. I had been amusing myself with such things about 13 years ago and I did not think I ever will see something of this again :)

I doubt I can help you since I never had gone deeper than bios interrupts (and it looks you avoid using bios interrupts?) and I'm not pretty sure I've seen this mode working (it was not of great use due to big disproportion of pixels) though I've tested most of them.

However I want to ask:

distorted screen


Do you mean some static mess of black and white pixels on the screen, or some dynamically changing noise of pixels, perhaps, in many colors?
@rodiongork: Just made a screen capture: http://superfury.heliohost.org/cplusplus/7.bmp

It's supposed to be half black (0's at the left half), half white (1's at the right half). I'm using the int10_putpixel.c from Dosbox function for cpu rendering testing to write to VRAM.
Last edited on
Topic archived. No new replies allowed.