case 1:\r
//CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]);\r
/* width and height */\r
- gv->video.page[0].sw=vga_state.vga_width = 320; // VGA lib currently does not update this\r
- gv->video.page[0].sh=vga_state.vga_height = 240; // VGA lib currently does not update this\r
+ gv->video.page[0].sw = vga_state.vga_width = 320; // VGA lib currently does not update this\r
+ gv->video.page[0].sh = vga_state.vga_height = 240; // VGA lib currently does not update this\r
\r
+ // mode X BYTE mode\r
+ cm.word_mode = 0;\r
+ cm.dword_mode = 0;\r
// 320x240 mode 60Hz\r
cm.horizontal_total=0x5f + 5; /* CRTC[0] -5 */\r
cm.horizontal_display_end=0x4f + 1; /* CRTC[1] -1 */\r
cm.clock_select = 0; /* misc register = 0xE3 25MHz */\r
cm.vsync_neg = 1;\r
cm.hsync_neg = 1;\r
- vga_state.vga_stride=0x58;\r
- cm.offset=0x2c;\r
+ cm.offset = (vga_state.vga_width / (4 * 2)); // 320 wide (40 x 4 pixel groups x 2)\r
break;\r
case 2: // TODO: 160x120 according to ModeX_160x120regs\r
return;\r
return;\r
}\r
\r
+ vga_state.vga_stride = cm.offset * 2;\r
vga_write_crtc_mode(&cm,0);\r
\r
/* clear video memory */\r