dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */\r
int CRTParmCount;\r
/* common mode X initiation stuff~ */\r
- modexsetBaseXMode(gv->video.page);\r
- vga_enable_256color_modex(); // VGA mode X\r
- update_state_from_vga();\r
+ modexsetBaseXMode();\r
\r
switch(vq)\r
{\r
struct vga_mode_params cm;\r
vga_read_crtc_mode(&cm);\r
\r
+// 0x5f00, /* Horizontal total */\r
+// 0x4f01, /* horizontal display enable end */\r
+// 0x5002, /* Start horizontal blanking */\r
+// 0x8203, /* End horizontal blanking */\r
+// 0x5404, /* Start horizontal retrace */\r
+// 0x8005, /* End horizontal retrace */\r
+// 0x0d06, /* vertical total */\r
+// 0x3e07, /* overflow (bit 8 of vertical counts) */\r
+// 0x4109, /* cell height (2 to double-scan */\r
+// 0xea10, /* v sync start */\r
+// 0xac11, /* v sync end and protect cr0-cr7 */\r
+// 0xdf12, /* vertical displayed */\r
+// 0x2813, /* offset/logical width */\r
+// 0x0014, /* turn off dword mode */\r
+// 0xe715, /* v blank start */\r
+// 0x0616, /* v blank end */\r
+// 0xe317 /* turn on byte mode */\r
+\r
// 320x240 mode 60Hz\r
+ cm.horizontal_total=0x5f; /* CRTC[0] -5 */\r
+ cm.horizontal_display_end=0x4f; /* CRTC[1] -1 */\r
+ cm.horizontal_blank_start=0x50; /* CRTC[2] */\r
+ cm.horizontal_blank_end=0x82; /* CRTC[3] bit 0-4 & CRTC[5] bit 7 */\r
+ cm.horizontal_start_retrace=0x54;/* CRTC[4] */\r
+ cm.horizontal_end_retrace=0x80; /* CRTC[5] bit 0-4 */\r
+ //cm.horizontal_start_delay_after_total=0x3e; /* CRTC[3] bit 5-6 */\r
+ //cm.horizontal_start_delay_after_retrace=0x41; /* CRTC[5] bit 5-6 */\r
cm.vertical_total = 525;\r
cm.vertical_start_retrace = 0x1EA;\r
cm.vertical_end_retrace = 0x1EC;\r
\r
void\r
modexLeave() {\r
- /* TODO restore original mode and palette */\r
- vgaSetMode(TEXT_MODE);\r
+ /* TODO restore original mode and palette */\r
+ vgaSetMode(TEXT_MODE);\r
}\r
\r
// setBaseXMode() does the initialization to make the VGA ready to\r
// involves enabling writes to index 0 to 7 of the CRT controller (port\r
// 0x3D4), by clearing the most significant bit (bit 7) of index 0x11.\r
void\r
-modexsetBaseXMode(page_t *page)\r
+modexsetBaseXMode()\r
{\r
- word temp;\r
/* TODO save current video mode and palette */\r
vgaSetMode(VGA_256_COLOR_MODE);\r
\r
+ vga_enable_256color_modex();\r
+\r
/* disable chain4 mode */\r
- outpw(SC_INDEX, 0x0604);\r
+ //outpw(SC_INDEX, 0x0604);\r
\r
/* synchronous reset while setting Misc Output */\r
- outpw(SC_INDEX, 0x0100);\r
+ //outpw(SC_INDEX, 0x0100);\r
\r
/* select 25 MHz dot clock & 60 Hz scanning rate */\r
outp(MISC_OUTPUT, 0xe3);\r
\r
/* undo reset (restart sequencer) */\r
- outpw(SC_INDEX, 0x0300);\r
+ //outpw(SC_INDEX, 0x0300);\r
\r
/* reprogram the CRT controller */\r
outp(CRTC_INDEX, 0x11); /* VSync End reg contains register write prot */\r
// outp(CRTC_INDEX, 0x11);\r
outp(CRTC_DATA, 0x7f); /* get current write protect on varios regs */\r
// outp(CRTC_DATA, temp); /* get current write protect on varios regs */\r
+ update_state_from_vga();\r
}\r
\r
page_t\r