Previous 15994 Revisions Next

r15719 Thursday 2nd August, 2012 at 17:51:05 UTC by Angelo Salese
PC-8801: more CRTC work
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r15718r15719
1919    - below notes states that plain PC-8801 doesn't have a disk CPU, but the BIOS clearly checks the floppy ports. Wrong info?
2020    - PC-8801MC disk shows that bitmap and text colors mixes with additive blending (basically if the tv charset has white then the bitmap draws
2121      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)
2223
2324    per-game specific TODO:
2425    - 177: gameplay is too fast (parent pc8801 only);
r15718r15719
4849    - Bokosuka Wars (polls read ID command)
4950    - Bouken Roman
5051    - Bruce Lee
51    - Burning Point
52    - Burning Point (trips a spurious irq)
5253    - Burunet
5354    - Castle Excellent (sets sector 0xf4?)
5455    - Card Game Pro 8.8k Plus Unit 1 (prints Disk i/o error 135 in vram, not visible for whatever reason)
r15718r15719
174175#define IRQ_LOG(x) do { if (IRQ_DEBUG) printf x; } while (0)
175176
176177#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
177181
178182#define I8214_TAG      "i8214"
179183#define UPD1990A_TAG   "upd1990a"
r15718r15719
352356#define lines_per_char ((state->m_crtc.param[0][2] & 0x1f) + 1)
353357
354358#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
356360
357361#define text_color_flag (state->m_crtc.param[0][4] & 0x40)
358362#define monitor_24KHz ((state->m_gfx_ctrl & 0x19) == 0x08) /* TODO: this is most likely to be WRONG */
r15718r15719
553557            if(!machine.primary_screen->visible_area().contains(res_x, res_y))
554558               continue;
555559
560            /* TODO: fix this */
556561            if(gfx_mode)
557562            {
558563               UINT8 mask;
r15718r15719
565570            {
566571               UINT8 char_data;
567572
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;
575575               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;
582577
583578               if(yi == 0 && upper)
584579                  char_data = 1;
r15718r15719
696691
697692      //popmessage("%02x %02x",state->m_crtc.param[0][0],state->m_crtc.param[0][4]);
698693
694      /* TODO: left-over, to be removed */
699695      y_size = (state->m_crtc.param[0][1] & 0x3f) + 1;
700696
701697      if(y_size < 20) y_size = 20;
r15718r15719
10521048{
10531049   pc8801_state *state = machine.driver_data<pc8801_state>();
10541050   rectangle visarea;
1055   int xsize,ysize;
1051   int xsize,ysize,xvis,yvis;
1052   attoseconds_t refresh;;
10561053
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;
10601057
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;
10631062
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);
10651064
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);
10671072}
10681073
10691074WRITE8_MEMBER(pc8801_state::pc8801_gfx_ctrl_w)
r15718r15719
21432148   state->m_layer_mask = 0x00;
21442149   state->m_vram_sel = 3;
21452150
2146   pc8801_dynamic_res_change(machine);
2151//   pc8801_dynamic_res_change(machine);
21472152
21482153   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
21492154

Previous 15994 Revisions Next


© 1998-2018 The MESS Team