src/emu/video/pc_vga.c
| r14479 | r14480 | |
| 377 | 377 | int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1); |
| 378 | 378 | int yi; |
| 379 | 379 | int xi; |
| 380 | | int pel_shift = vga.attribute.pel_shift; |
| 380 | int pel_shift = 0;//vga.attribute.pel_shift; /* TODO: timing bug with this */ |
| 381 | 381 | |
| 382 | 382 | /* line compare is screen sensitive */ |
| 383 | 383 | mask_comp = 0x3ff; //| (LINES & 0x300); |
| r14479 | r14480 | |
| 845 | 845 | |
| 846 | 846 | //popmessage("%02x %02x",cur_mode,vga.attribute.data[0x13]); |
| 847 | 847 | //popmessage("%d",vga.attribute.pel_shift); |
| 848 | //popmessage("%d %d %d",vga.crtc.vert_blank_start,vga.crtc.vert_blank_end,vga.crtc.vert_total); |
| 848 | 849 | |
| 849 | 850 | switch(cur_mode) |
| 850 | 851 | { |
| r14479 | r14480 | |
| 1235 | 1236 | } |
| 1236 | 1237 | } |
| 1237 | 1238 | |
| 1239 | static UINT8 vga_vblank(running_machine &machine) |
| 1240 | { |
| 1241 | UINT8 res; |
| 1242 | UINT16 vblank_start,vblank_end,vpos; |
| 1243 | |
| 1244 | /* calculate vblank start / end positions */ |
| 1245 | res = 0; |
| 1246 | vblank_start = vga.crtc.vert_blank_start; |
| 1247 | vblank_end = vga.crtc.vert_blank_start + vga.crtc.vert_blank_end; |
| 1248 | vpos = machine.primary_screen->vpos(); |
| 1249 | |
| 1250 | /* check if we are under vblank period */ |
| 1251 | if(vblank_end > vga.crtc.vert_total) |
| 1252 | { |
| 1253 | vblank_end -= vga.crtc.vert_total; |
| 1254 | if(vpos >= vblank_start || vpos < vblank_end) |
| 1255 | res = 1; |
| 1256 | } |
| 1257 | else |
| 1258 | { |
| 1259 | if(vpos >= vblank_start && vpos < vblank_end) |
| 1260 | res = 1; |
| 1261 | } |
| 1262 | |
| 1263 | // popmessage("%d %d %d",vblank_start,vblank_end,vga.crtc.vert_total); |
| 1264 | |
| 1265 | return res; |
| 1266 | } |
| 1267 | |
| 1238 | 1268 | static READ8_HANDLER(vga_crtc_r) |
| 1239 | 1269 | { |
| 1240 | 1270 | UINT8 data = 0xff; |
| r14479 | r14480 | |
| 1252 | 1282 | data = 0; |
| 1253 | 1283 | |
| 1254 | 1284 | hsync = space->machine().primary_screen->hblank() & 1; |
| 1255 | | vsync = space->machine().primary_screen->vblank() & 1; |
| 1285 | vsync = vga_vblank(space->machine()); //space->machine().primary_screen->vblank() & 1; |
| 1256 | 1286 | |
| 1257 | 1287 | data |= (hsync | vsync) & 1; // DD - display disable register |
| 1258 | 1288 | data |= (vsync & 1) << 3; // VRetrace register |
| r14479 | r14480 | |
| 2203 | 2233 | case 5: |
| 2204 | 2234 | vga.crtc.data[vga.crtc.index] = data; |
| 2205 | 2235 | tseng_crtc_reg_write(space->machine(),vga.crtc.index,data); |
| 2236 | //if((vga.crtc.index & 0xfe) != 0x0e) |
| 2237 | // printf("%02x %02x %d\n",vga.crtc.index,data,space->machine().primary_screen->vpos()); |
| 2206 | 2238 | break; |
| 2207 | 2239 | case 8: |
| 2208 | 2240 | et4k.reg_3d8 = data; |