src/mess/drivers/pc8801.c
| r15718 | r15719 | |
| 19 | 19 | - below notes states that plain PC-8801 doesn't have a disk CPU, but the BIOS clearly checks the floppy ports. Wrong info? |
| 20 | 20 | - PC-8801MC disk shows that bitmap and text colors mixes with additive blending (basically if the tv charset has white then the bitmap draws |
| 21 | 21 | with inverted color output). |
| 22 | - clean-ups, banking and video in particular (i.e. hook-ups with memory region should go away and device models should be used instead) |
| 22 | 23 | |
| 23 | 24 | per-game specific TODO: |
| 24 | 25 | - 177: gameplay is too fast (parent pc8801 only); |
| r15718 | r15719 | |
| 48 | 49 | - Bokosuka Wars (polls read ID command) |
| 49 | 50 | - Bouken Roman |
| 50 | 51 | - Bruce Lee |
| 51 | | - Burning Point |
| 52 | - Burning Point (trips a spurious irq) |
| 52 | 53 | - Burunet |
| 53 | 54 | - Castle Excellent (sets sector 0xf4?) |
| 54 | 55 | - Card Game Pro 8.8k Plus Unit 1 (prints Disk i/o error 135 in vram, not visible for whatever reason) |
| r15718 | r15719 | |
| 174 | 175 | #define IRQ_LOG(x) do { if (IRQ_DEBUG) printf x; } while (0) |
| 175 | 176 | |
| 176 | 177 | #define MASTER_CLOCK XTAL_4MHz |
| 178 | /* TODO: clocks of this */ |
| 179 | #define PIXEL_CLOCK_15KHz XTAL_14_31818MHz |
| 180 | #define PIXEL_CLOCK_24KHz XTAL_21_4772MHz |
| 177 | 181 | |
| 178 | 182 | #define I8214_TAG "i8214" |
| 179 | 183 | #define UPD1990A_TAG "upd1990a" |
| r15718 | r15719 | |
| 352 | 356 | #define lines_per_char ((state->m_crtc.param[0][2] & 0x1f) + 1) |
| 353 | 357 | |
| 354 | 358 | #define vretrace (((state->m_crtc.param[0][3] & 0xe0) >> 5) + 1) |
| 355 | | #define hretrace ((state->m_crtc.param[0][3] & 0x1f) + 2) |
| 359 | #define hretrace ((state->m_crtc.param[0][3] & 0x1f) + 2) * 8 |
| 356 | 360 | |
| 357 | 361 | #define text_color_flag (state->m_crtc.param[0][4] & 0x40) |
| 358 | 362 | #define monitor_24KHz ((state->m_gfx_ctrl & 0x19) == 0x08) /* TODO: this is most likely to be WRONG */ |
| r15718 | r15719 | |
| 553 | 557 | if(!machine.primary_screen->visible_area().contains(res_x, res_y)) |
| 554 | 558 | continue; |
| 555 | 559 | |
| 560 | /* TODO: fix this */ |
| 556 | 561 | if(gfx_mode) |
| 557 | 562 | { |
| 558 | 563 | UINT8 mask; |
| r15718 | r15719 | |
| 565 | 570 | { |
| 566 | 571 | UINT8 char_data; |
| 567 | 572 | |
| 568 | | if(y_double) |
| 569 | | { |
| 570 | | if(yi >= 16 || secret) |
| 571 | | char_data = 0; |
| 572 | | else |
| 573 | | char_data = (gfx_rom[tile*8+(yi >> 1)] >> (7-xi)) & 1; |
| 574 | | } |
| 573 | if(yi >= (1 << (y_double+3)) || secret) |
| 574 | char_data = 0; |
| 575 | 575 | else |
| 576 | | { |
| 577 | | if(yi >= 8 || secret) |
| 578 | | char_data = 0; |
| 579 | | else |
| 580 | | char_data = (gfx_rom[tile*8+yi] >> (7-xi)) & 1; |
| 581 | | } |
| 576 | char_data = (gfx_rom[tile*8+(yi >> y_double)] >> (7-xi)) & 1; |
| 582 | 577 | |
| 583 | 578 | if(yi == 0 && upper) |
| 584 | 579 | char_data = 1; |
| r15718 | r15719 | |
| 696 | 691 | |
| 697 | 692 | //popmessage("%02x %02x",state->m_crtc.param[0][0],state->m_crtc.param[0][4]); |
| 698 | 693 | |
| 694 | /* TODO: left-over, to be removed */ |
| 699 | 695 | y_size = (state->m_crtc.param[0][1] & 0x3f) + 1; |
| 700 | 696 | |
| 701 | 697 | if(y_size < 20) y_size = 20; |
| r15718 | r15719 | |
| 1052 | 1048 | { |
| 1053 | 1049 | pc8801_state *state = machine.driver_data<pc8801_state>(); |
| 1054 | 1050 | rectangle visarea; |
| 1055 | | int xsize,ysize; |
| 1051 | int xsize,ysize,xvis,yvis; |
| 1052 | attoseconds_t refresh;; |
| 1056 | 1053 | |
| 1057 | | //printf("H %d V %d (%d x %d) HR %d VR %d (%d %d)\n",screen_width,screen_height * lines_per_char,screen_height,lines_per_char, |
| 1058 | | // hretrace,vretrace, screen_width + hretrace,screen_height * lines_per_char + vretrace * lines_per_char); |
| 1059 | | //printf("%02x %02x dyn res\n",monitor_24KHz,state->m_gfx_ctrl); |
| 1054 | /* bail out if screen params aren't valid */ |
| 1055 | if(!state->m_crtc.param[0][0] || !state->m_crtc.param[0][1] || !state->m_crtc.param[0][2] || !state->m_crtc.param[0][3]) |
| 1056 | return; |
| 1060 | 1057 | |
| 1061 | | xsize = screen_width; |
| 1062 | | ysize = screen_height * lines_per_char; |
| 1058 | xvis = screen_width; |
| 1059 | yvis = screen_height * lines_per_char; |
| 1060 | xsize = screen_width + hretrace; |
| 1061 | ysize = screen_height * lines_per_char + vretrace * lines_per_char; |
| 1063 | 1062 | |
| 1064 | | visarea.set(0, xsize - 1, 0, ysize - 1); |
| 1063 | // popmessage("H %d V %d (%d x %d) HR %d VR %d (%d %d)\n",xvis,yvis,screen_height,lines_per_char,hretrace,vretrace, xsize,ysize); |
| 1065 | 1064 | |
| 1066 | | machine.primary_screen->configure(640, 480, visarea, machine.primary_screen->frame_period().attoseconds); |
| 1065 | visarea.set(0, xvis - 1, 0, yvis - 1); |
| 1066 | if(ysize >= 400) /* TODO: correct bit for this (m_gfx_ctrl & 1?) */ |
| 1067 | refresh = HZ_TO_ATTOSECONDS(PIXEL_CLOCK_24KHz) * (xsize) * ysize; |
| 1068 | else |
| 1069 | refresh = HZ_TO_ATTOSECONDS(PIXEL_CLOCK_15KHz) * (xsize) * ysize; |
| 1070 | |
| 1071 | machine.primary_screen->configure(xsize, ysize, visarea, refresh); |
| 1067 | 1072 | } |
| 1068 | 1073 | |
| 1069 | 1074 | WRITE8_MEMBER(pc8801_state::pc8801_gfx_ctrl_w) |
| r15718 | r15719 | |
| 2143 | 2148 | state->m_layer_mask = 0x00; |
| 2144 | 2149 | state->m_vram_sel = 3; |
| 2145 | 2150 | |
| 2146 | | pc8801_dynamic_res_change(machine); |
| 2151 | // pc8801_dynamic_res_change(machine); |
| 2147 | 2152 | |
| 2148 | 2153 | state->m_fdc_irq_opcode = 0; //TODO: copied from PC-88VA, could be wrong here ... should be 0x7f ld a,a in the latter case |
| 2149 | 2154 | |