src/mess/drivers/pc8801.c
| r15791 | r15792 | |
| 528 | 528 | |
| 529 | 529 | |
| 530 | 530 | |
| 531 | | static UINT8 extract_text_attribute(running_machine &machine,UINT32 address,int x) |
| 531 | static UINT8 extract_text_attribute(running_machine &machine,UINT32 address,int x, UINT8 width) |
| 532 | 532 | { |
| 533 | 533 | pc8801_state *state = machine.driver_data<pc8801_state>(); |
| 534 | 534 | UINT8 *vram = state->memregion("wram")->base(); |
| 535 | 535 | int i; |
| 536 | 536 | int fifo_size; |
| 537 | int offset; |
| 537 | 538 | |
| 538 | 539 | if(state->m_crtc.param[0][4] & 0x80) |
| 539 | 540 | { |
| r15791 | r15792 | |
| 542 | 543 | } |
| 543 | 544 | |
| 544 | 545 | fifo_size = (state->m_crtc.param[0][4] & 0x20) ? 0 : ((state->m_crtc.param[0][4] & 0x1f) + 1); |
| 546 | /* TODO: correct or hack-ish? Certainly having 0 as a attribute X is weird in any case. */ |
| 547 | offset = (vram[address] == 0) ? 2 : 0; |
| 545 | 548 | |
| 546 | 549 | for(i=0;i<fifo_size;i++) |
| 547 | 550 | { |
| 548 | | /* TODO: DMA timing bug? N-BASIC attributes doesn't work without +2 here ... */ |
| 549 | | if(x < vram[address]) |
| 551 | if(x < vram[address+offset]) |
| 550 | 552 | { |
| 551 | 553 | return vram[address+1]; |
| 552 | 554 | } |
| r15791 | r15792 | |
| 554 | 556 | address+=2; |
| 555 | 557 | } |
| 556 | 558 | |
| 557 | | return 0; |
| 559 | return vram[address-3+offset]; |
| 558 | 560 | } |
| 559 | 561 | |
| 560 | 562 | static void pc8801_draw_char(running_machine &machine,bitmap_ind16 &bitmap,int x,int y,int pal,UINT8 gfx_mode,UINT8 reverse,UINT8 secret,UINT8 blink,UINT8 upper,UINT8 lower,int y_size,int height,int width) |
| r15791 | r15792 | |
| 660 | 662 | UINT8 blink; |
| 661 | 663 | int pal; |
| 662 | 664 | |
| 663 | | // popmessage("%02x",state->m_crtc.param[0][4]); |
| 664 | | |
| 665 | 665 | for(y=0;y<y_size;y++) |
| 666 | 666 | { |
| 667 | 667 | for(x=0;x<80;x++) |
| r15791 | r15792 | |
| 669 | 669 | if(x & 1 && !width) |
| 670 | 670 | continue; |
| 671 | 671 | |
| 672 | | attr = extract_text_attribute(machine,(((y*120)+80+state->m_dma_address[2]) & 0xffff),(x)); |
| 672 | attr = extract_text_attribute(machine,(((y*120)+80+state->m_dma_address[2]) & 0xffff),(x),width); |
| 673 | 673 | |
| 674 | 674 | if(text_color_flag) // color mode |
| 675 | 675 | { |
| r15791 | r15792 | |
| 1264 | 1264 | |
| 1265 | 1265 | READ8_MEMBER(pc8801_state::pc8801_crtc_param_r) |
| 1266 | 1266 | { |
| 1267 | printf("CRTC param reading\n"); |
| 1267 | 1268 | return 0xff; |
| 1268 | 1269 | } |
| 1269 | 1270 | |
| r15791 | r15792 | |
| 1336 | 1337 | } |
| 1337 | 1338 | |
| 1338 | 1339 | //if((data >> 5) != 4) |
| 1339 | | // printf("CRTC cmd %s polled\n",crtc_command[data >> 5]); |
| 1340 | // printf("CRTC cmd %s polled %02x\n",crtc_command[data >> 5],data & 0x1f); |
| 1340 | 1341 | } |
| 1341 | 1342 | |
| 1342 | 1343 | READ8_MEMBER(pc8801_state::pc8801_dmac_r) |