src/emu/video/pc_vga.c
| r14145 | r14146 | |
| 22 | 22 | - add emulated mc6845 hook-up |
| 23 | 23 | - fix video update. |
| 24 | 24 | - rewrite video drawing functions (they are horrible) |
| 25 | | - add emulated CGA |
| 25 | - fix RAM read/writes, CGA and Mono has video bugs due of corrupted vga.memory |
| 26 | - fix emulated CGA and Mono modes |
| 26 | 27 | - add VESA etc. |
| 27 | 28 | - (and many more ...) |
| 28 | 29 | |
| r14145 | r14146 | |
| 404 | 405 | |
| 405 | 406 | static void vga_vh_cga(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 406 | 407 | { |
| 407 | | popmessage("CGA mode"); |
| 408 | UINT32 *bitmapline; |
| 409 | //int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1); |
| 410 | int x,y,yi; |
| 411 | UINT32 addr; |
| 412 | pen_t pen; |
| 413 | |
| 414 | addr = 0; |
| 415 | |
| 416 | for(y=0;y<200;y++) |
| 417 | { |
| 418 | //addr = (y) * test; |
| 419 | |
| 420 | for(x=0;x<640;x+=16) |
| 421 | { |
| 422 | for(yi=0;yi<1;yi++) |
| 423 | { |
| 424 | bitmapline = &bitmap.pix32(y + yi); |
| 425 | |
| 426 | /* TODO: debug dirty assignment */ |
| 427 | { |
| 428 | pen = vga.pens[(vga.memory[addr] >> (6)) & 3]; |
| 429 | bitmapline[x+0] = pen; |
| 430 | pen = vga.pens[(vga.memory[addr] >> (4)) & 3]; |
| 431 | bitmapline[x+1] = pen; |
| 432 | pen = vga.pens[(vga.memory[addr] >> (2)) & 3]; |
| 433 | bitmapline[x+2] = pen; |
| 434 | pen = vga.pens[(vga.memory[addr] >> (0)) & 3]; |
| 435 | bitmapline[x+3] = pen; |
| 436 | pen = vga.pens[(vga.memory[addr+0x4000] >> (6)) & 3]; |
| 437 | bitmapline[x+4] = pen; |
| 438 | pen = vga.pens[(vga.memory[addr+0x4000] >> (4)) & 3]; |
| 439 | bitmapline[x+5] = pen; |
| 440 | pen = vga.pens[(vga.memory[addr+0x4000] >> (2)) & 3]; |
| 441 | bitmapline[x+6] = pen; |
| 442 | pen = vga.pens[(vga.memory[addr+0x4000] >> (0)) & 3]; |
| 443 | bitmapline[x+7] = pen; |
| 444 | pen = vga.pens[(vga.memory[addr+1] >> (6)) & 3]; |
| 445 | bitmapline[x+8] = pen; |
| 446 | pen = vga.pens[(vga.memory[addr+1] >> (4)) & 3]; |
| 447 | bitmapline[x+9] = pen; |
| 448 | pen = vga.pens[(vga.memory[addr+1] >> (2)) & 3]; |
| 449 | bitmapline[x+10] = pen; |
| 450 | pen = vga.pens[(vga.memory[addr+1] >> (0)) & 3]; |
| 451 | bitmapline[x+11] = pen; |
| 452 | pen = vga.pens[(vga.memory[addr+1+0x4000] >> (6)) & 3]; |
| 453 | bitmapline[x+12] = pen; |
| 454 | pen = vga.pens[(vga.memory[addr+1+0x4000] >> (4)) & 3]; |
| 455 | bitmapline[x+13] = pen; |
| 456 | pen = vga.pens[(vga.memory[addr+1+0x4000] >> (2)) & 3]; |
| 457 | bitmapline[x+14] = pen; |
| 458 | pen = vga.pens[(vga.memory[addr+1+0x4000] >> (0)) & 3]; |
| 459 | bitmapline[x+15] = pen; |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | //popmessage("%02x %02x %02x %02x %02x %02x %02x %02x",vga.memory[0],vga.memory[1],vga.memory[2],vga.memory[3],vga.memory[4],vga.memory[5],vga.memory[6],vga.memory[7]); |
| 464 | |
| 465 | addr+=2; |
| 466 | } |
| 467 | } |
| 408 | 468 | } |
| 409 | 469 | |
| 410 | 470 | static void vga_vh_mono(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 411 | 471 | { |
| 412 | | popmessage("Mono mode"); |
| 472 | UINT32 *bitmapline; |
| 473 | //int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1); |
| 474 | int x,xi,y,yi; |
| 475 | UINT32 addr; |
| 476 | pen_t pen; |
| 477 | |
| 478 | addr = 0; |
| 479 | |
| 480 | for(y=0;y<200;y++) |
| 481 | { |
| 482 | //addr = (y) * test; |
| 483 | |
| 484 | for(x=0;x<640;x+=8) |
| 485 | { |
| 486 | for(yi=0;yi<1;yi++) |
| 487 | { |
| 488 | bitmapline = &bitmap.pix32(y + yi); |
| 489 | |
| 490 | for(xi=0;xi<8;xi++) |
| 491 | { |
| 492 | pen = vga.pens[(vga.memory[addr] >> (xi)) & 1]; |
| 493 | bitmapline[x+xi] = pen; |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | //popmessage("%02x %02x %02x %02x %02x %02x %02x %02x",vga.memory[0],vga.memory[1],vga.memory[2],vga.memory[3],vga.memory[4],vga.memory[5],vga.memory[6],vga.memory[7]); |
| 498 | |
| 499 | addr++; |
| 500 | } |
| 501 | } |
| 413 | 502 | } |
| 414 | 503 | |
| 415 | 504 | |