src/mess/drivers/pc8801.c
| r15575 | r15576 | |
| 551 | 551 | } |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | | static void draw_text_80(running_machine &machine, bitmap_ind16 &bitmap,int y_size) |
| 554 | static void draw_text(running_machine &machine, bitmap_ind16 &bitmap,int y_size, UINT8 width) |
| 555 | 555 | { |
| 556 | 556 | pc8801_state *state = machine.driver_data<pc8801_state>(); |
| 557 | 557 | int x,y; |
| r15575 | r15576 | |
| 568 | 568 | { |
| 569 | 569 | for(x=0;x<80;x++) |
| 570 | 570 | { |
| 571 | if(x & 1 && !width) |
| 572 | continue; |
| 573 | |
| 571 | 574 | attr = extract_text_attribute(machine,(((y*120)+80+state->m_dma_address[2]) & 0xffff),(x)); |
| 572 | 575 | |
| 573 | 576 | if(text_color_flag) // color mode |
| r15575 | r15576 | |
| 596 | 599 | popmessage("Warning: mono gfx mode enabled, contact MESSdev"); |
| 597 | 600 | } |
| 598 | 601 | |
| 599 | | pc8801_draw_char(machine,bitmap,x,y,pal,gfx_mode,reverse,secret,upper,lower,blink,y_size,monitor_24KHz,0); |
| 602 | pc8801_draw_char(machine,bitmap,x,y,pal,gfx_mode,reverse,secret,upper,lower,blink,y_size,monitor_24KHz,!width); |
| 600 | 603 | } |
| 601 | 604 | } |
| 602 | 605 | } |
| 603 | 606 | |
| 604 | | static void draw_text_40(running_machine &machine, bitmap_ind16 &bitmap, int y_size) |
| 605 | | { |
| 606 | | pc8801_state *state = machine.driver_data<pc8801_state>(); |
| 607 | | int x,y; |
| 608 | | UINT8 attr; |
| 609 | | UINT8 reverse; |
| 610 | | UINT8 gfx_mode; |
| 611 | | UINT8 secret; |
| 612 | | UINT8 upper; |
| 613 | | UINT8 lower; |
| 614 | | UINT8 blink; |
| 615 | | int pal; |
| 616 | | |
| 617 | | for(y=0;y<y_size;y++) |
| 618 | | { |
| 619 | | for(x=0;x<80;x++) |
| 620 | | { |
| 621 | | if(x & 1) |
| 622 | | continue; |
| 623 | | |
| 624 | | attr = extract_text_attribute(machine,(((y*120)+80+state->m_dma_address[2]) & 0xffff),(x)); |
| 625 | | |
| 626 | | if(text_color_flag) |
| 627 | | { |
| 628 | | pal = (attr & 8) ? ((attr & 0xe0) >> 5) : 7; // Alpha behaves on this |
| 629 | | gfx_mode = (attr & 0x10) >> 4; |
| 630 | | reverse = 0; |
| 631 | | secret = 0; |
| 632 | | upper = 0; |
| 633 | | lower = 0; |
| 634 | | blink = 0; |
| 635 | | pal|=8; //text pal bank |
| 636 | | } |
| 637 | | else |
| 638 | | { |
| 639 | | pal = (state->m_txt_color) ? 7 : 0; |
| 640 | | gfx_mode = 0; |
| 641 | | reverse = (attr & 4) >> 2; |
| 642 | | secret = (attr & 1); |
| 643 | | upper = (attr & 0x10) >> 4; |
| 644 | | lower = (attr & 0x20) >> 5; |
| 645 | | blink = (attr & 2) >> 1; |
| 646 | | pal|=8; //text pal bank |
| 647 | | |
| 648 | | if(attr & 0x80) |
| 649 | | popmessage("Warning: mono gfx mode enabled, contact MESSdev"); |
| 650 | | } |
| 651 | | |
| 652 | | pc8801_draw_char(machine,bitmap,x,y,pal,gfx_mode,reverse,secret,upper,lower,blink,y_size,monitor_24KHz,1); |
| 653 | | } |
| 654 | | } |
| 655 | | } |
| 656 | | |
| 657 | 607 | static SCREEN_UPDATE_IND16( pc8801 ) |
| 658 | 608 | { |
| 659 | 609 | pc8801_state *state = screen.machine().driver_data<pc8801_state>(); |
| r15575 | r15576 | |
| 680 | 630 | if(y_size < 20) y_size = 20; |
| 681 | 631 | if(y_size > 25) y_size = 25; |
| 682 | 632 | |
| 683 | | if(state->m_txt_width) |
| 684 | | draw_text_80(screen.machine(),bitmap,y_size); |
| 685 | | else |
| 686 | | draw_text_40(screen.machine(),bitmap,y_size); |
| 633 | draw_text(screen.machine(),bitmap,y_size,state->m_txt_width); |
| 687 | 634 | } |
| 688 | 635 | |
| 689 | 636 | return 0; |