Previous 15994 Revisions Next

r15888 Tuesday 14th August, 2012 at 00:35:52 UTC by Angelo Salese
Added pixel clock selector, fixed regression with 1bpp graphics colors
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r15887r15888
4444    - Fire Hawk: tries to r/w the opn ports (probably crashed due to floppy?)
4545    - Grobda: palette is ugly (parent pc8801 only);
4646   - Music Collection Vol. 2 - Final Fantasy Tokushuu: sound irq dies pretty soon
47   - N88 Basic Nihongo (app): background is currently purple for whatever reason;
4847    - Wanderers from Ys: user data disk looks screwed? It loads with everything as maximum as per now ...
4948    - Xevious: game is too fast (parent pc8801 only)
5049
r15887r15888
8988   - Dungeon Buster
9089   - El Dorado Denki
9190   - Elevator Action
92   (Elthlead)
91   - Emerald Densetsu
92    - Emerald Dragon (it seems to miss a timer)
93    - Emmy
94   (Exective he no Michi)
95
9396    - Harakiri
9497    - Kaseijin (app) (code snippet is empty at some point)
9598    - MakaiMura (attempts to r/w the sio ports, but it's clearly crashed)
r15887r15888
451454
452455   count = 0;
453456
454   y_double = ((lines_per_char & 0x10) >> 4); // TODO: true condition of this?
457   y_double = (state->m_gfx_ctrl & 0x20) >> 5; // TODO: true condition of this?
455458   y_size = (y_double+1) * 200;
456459
457460   for(y=0;y<y_size;y+=(y_double+1))
r15887r15888
495498   int x,y,xi;
496499   UINT32 count;
497500   UINT8 *gvram = state->memregion("gvram")->base();
501   UINT8 color;
498502
499503   count = 0;
504   color = (state->m_gfx_ctrl & 1) ? 7 & ((state->m_layer_mask ^ 0xe) >> 1) : 7;
500505
501506   for(y=0;y<200;y++)
502507   {
r15887r15888
508513
509514            pen = ((gvram[count+0x0000] >> (7-xi)) & 1) << 0;
510515
511            if(state->m_gfx_ctrl & 1)
516            if(state->m_gfx_ctrl & 0x20) // pixel clock select
512517            {
513518               if(cliprect.contains(x+xi, y*2+0))
514                  bitmap.pix16(y*2+0, x+xi) = machine.pens[pen ? 7 & ((state->m_layer_mask ^ 0xe) >> 1) : 0];
519                  bitmap.pix16(y*2+0, x+xi) = machine.pens[pen ? color : 0];
515520
516521               if(cliprect.contains(x+xi, y*2+1))
517                  bitmap.pix16(y*2+1, x+xi) = machine.pens[pen ? 7 & ((state->m_layer_mask ^ 0xe) >> 1) : 0];
522                  bitmap.pix16(y*2+1, x+xi) = machine.pens[pen ? color : 0];
518523            }
519524            else
520525            {
521526               if(cliprect.contains(x+xi, y))
522                  bitmap.pix16(y, x+xi) = machine.pens[pen ? 7 & ((state->m_layer_mask ^ 0xe) >> 1) : 0];
527                  bitmap.pix16(y, x+xi) = machine.pens[pen ? color : 0];
523528            }
524529         }
525530
r15887r15888
542547               pen = ((gvram[count+0x4000] >> (7-xi)) & 1) << 0;
543548
544549               if(cliprect.contains(x+xi, y))
545                  bitmap.pix16(y, x+xi) = machine.pens[pen ? 7 & ((state->m_layer_mask ^ 0xe) >> 1) : 0];
550                  bitmap.pix16(y, x+xi) = machine.pens[pen ? 7 : 0];
546551            }
547552
548553            count++;
r15887r15888
629634   UINT8 y_step;
630635
631636   y_height = lines_per_char;
632   y_double = (lines_per_char & 0x10) >> 4; // TODO: find correct condition
633   y_step = (non_special) ? 80 : 120; // Elthlead uses this
637   y_double = (state->m_gfx_ctrl & 0x20) >> 5;
638   y_step = (non_special) ? 80 : 120; // trusted by Elthlead
634639
635640   for(yi=0;yi<y_height;yi++)
636641   {
r15887r15888
793798
794799   if(!(state->m_layer_mask & 1) && state->m_dmac_mode & 4 && state->m_crtc.status & 0x10 && state->m_crtc.irq_mask == 3)
795800   {
796      int y_size;
797
798801      //popmessage("%02x %02x",state->m_crtc.param[0][0],state->m_crtc.param[0][4]);
799802
800      /* TODO: left-over, to be removed */
801      y_size = (state->m_crtc.param[0][1] & 0x3f) + 1;
802
803      if(y_size < 20) y_size = 20;
804      if(y_size > 25) y_size = 25;
805
806      draw_text(screen.machine(),bitmap,y_size,state->m_txt_width);
803      draw_text(screen.machine(),bitmap,screen_height,state->m_txt_width);
807804   }
808805
809806   return 0;
r15887r15888
11981195//   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);
11991196
12001197   visarea.set(0, xvis - 1, 0, yvis - 1);
1201   if(ysize >= 400) /* TODO: correct bit for this (m_gfx_ctrl & 1?) */
1198   if(state->m_gfx_ctrl & 0x20) /* TODO: correct bit for this (m_gfx_ctrl & 1?) */
12021199      refresh = HZ_TO_ATTOSECONDS(PIXEL_CLOCK_24KHz) * (xsize) * ysize;
12031200   else
12041201      refresh = HZ_TO_ATTOSECONDS(PIXEL_CLOCK_15KHz) * (xsize) * ysize;
r15887r15888
12091206WRITE8_MEMBER(pc8801_state::pc8801_gfx_ctrl_w)
12101207{
12111208   /*
1212    --x- ---- VRAM y 25 (1) / 20 (0)
1209    --x- ---- Pixel clock select?
12131210    ---x ---- graphic color yes (1) / no (0)
12141211    ---- x--- graphic display yes (1) / no (0)
12151212    ---- -x-- Basic N (1) / N88 (0)
12161213    ---- --x- RAM select yes (1) / no (0)
1217    ---- ---x VRAM 200 lines (1) / 400 lines (0), 15 KHz / 24 KHz
1214    ---- ---x VRAM 200 lines (1) / 400 lines (0) in 1bpp mode
12181215    */
12191216
12201217   m_gfx_ctrl = data;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team