Previous 15994 Revisions Next

r9035 Saturday 4th September, 2010 at 16:20:20 UTC by Angelo Salese
[MZ-2500]: Preparing variables for TV layer window effect (disabled by default due of a bug)
[src/mess/drivers]mz2500.c

src/mess/drivers/mz2500.c
r9034r9035
99    - Find real CRTC registers
1010    - Some games doesn't set proper registers if you have interlace enabled, is there any real reason?
1111    - Implement external ROM hook-up;
12    - Add remaining missing peripherals, SIO, HDD and w1300a network;
1213    - FDC loading without the IPLPRO doesn't work at all, why?
1314    - reverse / blanking tvram attributes;
14    - there's a soft reset PCG init bug now (try for example Eiyuu Densetsu Saga then Excite Bike);
15    - there's a soft reset PCG init bug now (try for example Eiyuu Densetsu Saga then Excite Bike), MAME / MESS core bug?
1516    - clean-ups! ^^'
1617
1718    per-game/program specific TODO:
r9034r9035
8586static UINT8 text_col_size, text_font_reg;
8687static UINT8 pal_select;
8788static UINT16 cg_vs,cg_ve,cg_hs,cg_he; //CG window parameters
89static UINT16 tv_vs,tv_ve,tv_hs,tv_he; //TV window parameters
8890static UINT8 cg_latch[4];
8991static UINT8 cg_reg_index;
9092static UINT8 cg_reg[0x20];
r9034r9035
183185            {
184186               UINT8 pen_bit[3],pen;
185187
188               int res_x,res_y;
189
190               res_x = x*8+xi;
191               res_y = y*8+yi-s_y;
192
193               /* check TV window boundaries */
194               //if(res_x < tv_hs || res_x >= tv_he || res_y < tv_vs || res_y >= tv_ve)
195               //   continue;
196
186197               if(gfx_sel & 0x8)
187198               {
188199                  pen_bit[0] = ((gfx_data[tile*8+yi+0x1800]>>(7-xi)) & 1) ? 4 : 0; //G
r9034r9035
200211
201212               if(pen)
202213               {
203                  if((y*8+yi-s_y) >= 0 && (y*8+yi-s_y) < 200*y_step)
204                     mz2500_draw_pixel(machine,bitmap,x*8+xi,y*8+yi-s_y,pen+(pal_select ? 0x00 : 0x18),0,0);
214                  if((res_y) >= 0 && (res_y) < 200*y_step)
215                     mz2500_draw_pixel(machine,bitmap,res_x,res_y,pen+(pal_select ? 0x00 : 0x18),0,0);
205216               }
206217            }
207218         }
r9034r9035
264275            for(xi=0;xi<8;xi++)
265276            {
266277               UINT8 pen_bit[3],pen;
278               int res_x,res_y;
267279
280               res_x = x*8+xi;
281               res_y = y*8+yi-s_y;
282
283               /* check TV window boundaries */
284               //if(res_x < tv_hs || res_x >= tv_he || res_y < tv_vs || res_y >= tv_ve)
285               //   continue;
286
268287               if(gfx_sel & 0x8)
269288               {
270289                  pen_bit[0] = ((gfx_data[tile*8+yi+0x1800]>>(7-xi)) & 1) ? 4 : 0; //G
r9034r9035
280299
281300               if(pen)
282301               {
283                  if((y*8+yi-s_y) >= 0 && (y*8+yi-s_y) < 200*y_step)
284                     mz2500_draw_pixel(machine,bitmap,x*8+xi,y*8+yi-s_y,pen+(pal_select ? 0x000 : 0x18),scr_x_size == 640,0);
302                  if((res_y) >= 0 && (res_y) < 200*y_step)
303                     mz2500_draw_pixel(machine,bitmap,res_x,res_y,pen+(pal_select ? 0x000 : 0x18),scr_x_size == 640,0);
285304               }
286305            }
287306         }
r9034r9035
353372   s_x = (cg_reg[0x0f] & 0xf);
354373   cg_interlace = text_font_reg ? 1 : 2;
355374
356   popmessage("%d %d %d %d",cg_hs,cg_he,cg_vs,cg_ve);
375//   popmessage("%d %d %d %d",cg_hs,cg_he,cg_vs,cg_ve);
357376
358377   for(y=0;y<200;y++)
359378   {
r9034r9035
441460   base_addr = text_reg[1] | ((text_reg[2] & 0x7) << 8);
442461
443462//  popmessage("%02x",text_reg[9]);
463//   popmessage("%d %d %d %d",tv_hs,(tv_he),tv_vs,(tv_ve));
444464
445465   if(text_col_size)
446466      draw_80x25(machine,bitmap,cliprect,base_addr);
r9034r9035
528548   visarea.max_x = scr_x_size - 1;
529549   visarea.max_y = scr_y_size - 1;
530550
551   //popmessage("%d %d %d %d %02x",vs,ve,hs,he,cg_reg[0x0e]);
552
553   machine->primary_screen->configure(720, 480, visarea, machine->primary_screen->frame_period().attoseconds);
554
555   /* calculate CG window parameters here */
531556   cg_vs = (cg_reg[0x08]) | ((cg_reg[0x09]<<8) & 1);
532557   cg_ve = (cg_reg[0x0a]) | ((cg_reg[0x0b]<<8) & 1);
533558   cg_hs = ((cg_reg[0x0c] & 0x7f)*8);
r9034r9035
539564      cg_he /= 2;
540565   }
541566
542   //popmessage("%d %d %d %d %02x",vs,ve,hs,he,cg_reg[0x0e]);
567   /* calculate TV window parameters here */
568   {
569      static int x_offs,y_offs;
543570
544   machine->primary_screen->configure(720, 480, visarea, machine->primary_screen->frame_period().attoseconds);
571      switch((text_font_reg|text_col_size<<1) & 3)
572      {
573         case 0: x_offs = 64; break;
574         case 1: x_offs = 80; break;
575         case 2: x_offs = 72; break;
576         case 3: x_offs = 72; break;
577      }
578      //printf("%d %d %d\n",x_offs,(text_reg[7] & 0x7f) * 8,(text_reg[8] & 0x7f)* 8);
579
580      y_offs = text_font_reg ? 76 : 34;
581
582      tv_hs = ((text_reg[7] & 0x7f)*8) - x_offs;
583      tv_he = ((text_reg[8] & 0x7f)*8) - x_offs;
584      tv_vs = (text_reg[3]*2) - y_offs;
585      tv_ve = (text_reg[5]*2) - y_offs;
586
587      if(scr_x_size == 320)
588      {
589         tv_hs /= 2;
590         tv_he /= 2;
591      }
592
593      if(scr_y_size == 200)
594      {
595         tv_vs /= 2;
596         tv_ve /= 2;
597      }
598   }
545599}
546600
547601static UINT8 mz2500_cg_latch_compare(void)
r9034r9035
888942         #endif
889943         //popmessage("%d %02x %d %02x %d %d",text_reg[3],text_reg[4],text_reg[5],text_reg[6],text_reg[7]*8,text_reg[8]*8);
890944
945         mz2500_reconfigure_screen(space->machine);
946
891947         if(text_reg_index == 0x0a) // set 256 color palette
892948         {
893949            int i,r,g,b;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team