src/mess/video/pc8801.c
| r2070 | r2071 | |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | /* NOTE: The palette and colortable have been fixed after the changes in the 0.123-0.124 cycle, |
| 8 | but the pen colours may be wrong. This needs to be tested. */ |
| 9 | |
| 7 | 10 | #include "driver.h" |
| 8 | 11 | #include "includes/pc8801.h" |
| 9 | 12 | |
| r2070 | r2071 | |
| 465 | 468 | GRP_DIRTY(x,y) || |
| 466 | 469 | full_refresh) { |
| 467 | 470 | plot_box(wbm2,x*8,y*BLOCK_YSIZE,8,BLOCK_YSIZE,palette_transparent_pen); |
| 468 | | ct=screen->machine->pens[((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8]; |
| 471 | ct=((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8; |
| 469 | 472 | TEXT_OLD(x,y)=text_new; |
| 470 | 473 | ATTR_OLD(x,y)=attr_new; |
| 471 | 474 | if(attr_new&TX_GL) { |
| r2070 | r2071 | |
| 518 | 521 | (((gVRAM[0x0000+x+y*2*80+gy*80] << gx) & 0x80) >> 7) | |
| 519 | 522 | (((gVRAM[0x4000+x+y*2*80+gy*80] << gx) & 0x80) >> 6) | |
| 520 | 523 | (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) >> 5); |
| 521 | | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,screen->machine->pens[cg]); |
| 522 | | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,screen->machine->pens[17]); |
| 524 | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,cg); |
| 525 | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,17); |
| 523 | 526 | } |
| 524 | 527 | } |
| 525 | 528 | break; |
| r2070 | r2071 | |
| 534 | 537 | (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) && |
| 535 | 538 | disp_plane[2]) ? |
| 536 | 539 | ((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8 : 16; |
| 537 | | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,screen->machine->pens[cg]); |
| 538 | | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,screen->machine->pens[17]); |
| 540 | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,cg); |
| 541 | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,17); |
| 539 | 542 | } |
| 540 | 543 | } |
| 541 | 544 | break; |
| r2070 | r2071 | |
| 547 | 550 | & 0x80) && |
| 548 | 551 | disp_plane[y<200 ? 0 : 1] ? |
| 549 | 552 | ((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8 : 16; |
| 550 | | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy,screen->machine->pens[cg]); |
| 553 | pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy,cg); |
| 551 | 554 | } |
| 552 | 555 | } |
| 553 | 556 | break; |
| 554 | 557 | case GRAPH_NO: |
| 555 | 558 | default: |
| 556 | | plot_box(wbm1,x*8,y*4,8,4,screen->machine->pens[16]); |
| 559 | plot_box(wbm1,x*8,y*4,8,4,16); |
| 557 | 560 | break; |
| 558 | 561 | } |
| 559 | 562 | } else { |
| r2070 | r2071 | |
| 565 | 568 | (((gVRAM[0x0000+x+y*2*80+gy*80] << gx) & 0x80) >> 7) | |
| 566 | 569 | (((gVRAM[0x4000+x+y*2*80+gy*80] << gx) & 0x80) >> 6) | |
| 567 | 570 | (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) >> 5); |
| 568 | | pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,screen->machine->pens[cg]); |
| 571 | pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,cg); |
| 569 | 572 | } |
| 570 | 573 | } |
| 571 | 574 | break; |
| r2070 | r2071 | |
| 580 | 583 | (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) && |
| 581 | 584 | disp_plane[2]) ? |
| 582 | 585 | ((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8 : 16; |
| 583 | | pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,screen->machine->pens[cg]); |
| 586 | pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,cg); |
| 584 | 587 | } |
| 585 | 588 | } |
| 586 | 589 | break; |
| 587 | 590 | case GRAPH_NO: |
| 588 | 591 | default: |
| 589 | | plot_box(wbm1,x*8,y*2,8,2,screen->machine->pens[16]); |
| 592 | plot_box(wbm1,x*8,y*2,8,2,16); |
| 590 | 593 | break; |
| 591 | 594 | } |
| 592 | 595 | } |
| r2070 | r2071 | |
| 603 | 606 | |
| 604 | 607 | PALETTE_INIT( pc8801 ) |
| 605 | 608 | { |
| 606 | | int i; |
| 609 | UINT8 i; |
| 607 | 610 | |
| 608 | | for (i = 0; i < 8; i++) |
| 609 | | palette_set_color_rgb(machine, i, 0, 0, 0); /* for graphics */ |
| 611 | machine->colortable = colortable_alloc(machine, 18); |
| 610 | 612 | |
| 611 | | /* for text */ |
| 612 | | for (i = 0; i < 8; i++) |
| 613 | for ( i = 0; i < 8; i++ ) /* for graphics */ |
| 614 | colortable_palette_set_color(machine->colortable, i, RGB_BLACK); |
| 615 | |
| 616 | |
| 617 | for (i = 0; i < 8; i++) /* standard colours */ |
| 618 | colortable_palette_set_color(machine->colortable, i+8, |
| 619 | MAKE_RGB((i & 2) ? 0xff : 0, (i & 4) ? 0xff : 0, (i & 1) ? 0xff : 0)); |
| 620 | |
| 621 | /* for background and scanline */ |
| 622 | colortable_palette_set_color(machine->colortable, 16, RGB_BLACK); |
| 623 | colortable_palette_set_color(machine->colortable, 17, RGB_BLACK); |
| 624 | |
| 625 | |
| 626 | for ( i = 0; i < 8; i++ ) |
| 613 | 627 | { |
| 614 | | palette_set_color_rgb(machine, i+8, |
| 615 | | (i & 2) ? 0xff : 0x00, |
| 616 | | (i & 4) ? 0xff : 0x00, |
| 617 | | (i & 1) ? 0xff : 0x00); |
| 628 | colortable_entry_set_value(machine->colortable, i*2, 0); |
| 629 | colortable_entry_set_value(machine->colortable, i*2+1, i+8); |
| 630 | colortable_entry_set_value(machine->colortable, i*2+16, i+8); |
| 631 | colortable_entry_set_value(machine->colortable, i*2+17, 0); |
| 618 | 632 | } |
| 619 | | |
| 620 | | /* for background and scanline */ |
| 621 | | palette_set_color_rgb(machine, 16, 0, 0, 0); |
| 622 | | palette_set_color_rgb(machine, 17, 0, 0, 0); |
| 623 | 633 | } |
| 624 | 634 | |
| 625 | 635 | WRITE8_HANDLER(pc8801_crtc_write) |
| r2070 | r2071 | |
| 644 | 654 | case 0x60: |
| 645 | 655 | /* get light pen point */ |
| 646 | 656 | crtc_state=lpenx; |
| 647 | | return; |
| 648 | | case 0x80: |
| 657 | return; case 0x80: |
| 649 | 658 | /* set cursor */ |
| 650 | 659 | crtc_state=cursorx; |
| 651 | 660 | text_cursor=((data&1)!=0x00); |
| r2070 | r2071 | |
| 914 | 923 | r[offset] = (data & 2) ? 0xff : 0x00; |
| 915 | 924 | g[offset] = (data & 4) ? 0xff : 0x00; |
| 916 | 925 | } |
| 917 | | palette_set_color_rgb(machine, palno,r[offset],g[offset],b[offset]); |
| 926 | colortable_palette_set_color(machine->colortable, palno, MAKE_RGB(r[offset],g[offset],b[offset])); |
| 918 | 927 | } |