wwww
Revision | 6d7a981e6e607a373d9418d064ab6dc881d10282 (tree) |
---|---|
Time | 2016-04-17 15:33:16 |
Author | Jonathan Campbell <jonathan@cast...> |
Commiter | Jonathan Campbell |
modex mode 1 is 320x240 so make sure it's 320 across.
@@ -94,9 +94,12 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) | ||
94 | 94 | case 1: |
95 | 95 | //CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]); |
96 | 96 | /* width and height */ |
97 | - gv->video.page[0].sw=vga_state.vga_width = 320; // VGA lib currently does not update this | |
98 | - gv->video.page[0].sh=vga_state.vga_height = 240; // VGA lib currently does not update this | |
97 | + gv->video.page[0].sw = vga_state.vga_width = 320; // VGA lib currently does not update this | |
98 | + gv->video.page[0].sh = vga_state.vga_height = 240; // VGA lib currently does not update this | |
99 | 99 | |
100 | + // mode X BYTE mode | |
101 | + cm.word_mode = 0; | |
102 | + cm.dword_mode = 0; | |
100 | 103 | // 320x240 mode 60Hz |
101 | 104 | cm.horizontal_total=0x5f + 5; /* CRTC[0] -5 */ |
102 | 105 | cm.horizontal_display_end=0x4f + 1; /* CRTC[1] -1 */ |
@@ -115,8 +118,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) | ||
115 | 118 | cm.clock_select = 0; /* misc register = 0xE3 25MHz */ |
116 | 119 | cm.vsync_neg = 1; |
117 | 120 | cm.hsync_neg = 1; |
118 | - vga_state.vga_stride=0x58; | |
119 | - cm.offset=0x2c; | |
121 | + cm.offset = (vga_state.vga_width / (4 * 2)); // 320 wide (40 x 4 pixel groups x 2) | |
120 | 122 | break; |
121 | 123 | case 2: // TODO: 160x120 according to ModeX_160x120regs |
122 | 124 | return; |
@@ -130,6 +132,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) | ||
130 | 132 | return; |
131 | 133 | } |
132 | 134 | |
135 | + vga_state.vga_stride = cm.offset * 2; | |
133 | 136 | vga_write_crtc_mode(&cm,0); |
134 | 137 | |
135 | 138 | /* clear video memory */ |