Previous 15994 Revisions Next

r8932 Saturday 28th August, 2010 at 18:02:45 UTC by Angelo Salese
[MZ-2500]: Added individual PCG select feature, needed by Tower of Druaga
[src/mess/drivers]mz2500.c

src/mess/drivers/mz2500.c
r8931r8932
104104                  pen_bit[1] = ((gfx_data[tile*8+yi+0x1000]>>(7-xi)) & 1) ? 2 : 0; //R
105105                  pen_bit[2] = ((gfx_data[tile*8+yi+0x0800]>>(7-xi)) & 1) ? 1 : 0; //B
106106
107                  pen = pen_bit[0]|pen_bit[1]|pen_bit[2];
107                  pen = (pen_bit[0]|pen_bit[1]|pen_bit[2]);
108108               }
109109               else
110110                  pen = ((gfx_data[tile*8+yi]>>(7-xi)) & 1) ? color : 0;
r8931r8932
119119   }
120120}
121121
122static void draw_40x25(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int tv_mode)
122static void draw_40x25(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int plane)
123123{
124124   UINT8 *vram = memory_region(machine, "maincpu");
125125   int x,y,count,xi,yi;
126126   UINT8 *gfx_data;
127127   UINT8 y_step;
128128
129   count = 0x70000;
129   count = 0x70000 + (plane * 0x400);
130130
131   if(tv_mode != 1)
132      popmessage("%02x %02x %02x",tv_mode,text_reg[1],text_reg[2]);
133
134131   y_step = (text_font_reg) ? 1 : 2;
135132
136133   for (y=0;y<25;y+=y_step)
r8931r8932
163160                  pen_bit[1] = ((gfx_data[tile*8+yi+0x1000]>>(7-xi)) & 1) ? 2 : 0; //R
164161                  pen_bit[2] = ((gfx_data[tile*8+yi+0x0800]>>(7-xi)) & 1) ? 1 : 0; //B
165162
166                  pen = pen_bit[0]|pen_bit[1]|pen_bit[2];
163                  pen = (pen_bit[0]|pen_bit[1]|pen_bit[2]);
167164               }
168165               else
169                  pen = ((gfx_data[tile*8+yi]>>(7-xi)) & 1) ? color : 0;
166               {
167                  if((gfx_sel & 0x30) == 0x30)
168                     pen = ((gfx_data[tile*8+yi+0x1800]>>(7-xi)) & 1) ? color : 0; //G
169                  else if((gfx_sel & 0x30) == 0x20)
170                     pen = ((gfx_data[tile*8+yi+0x1000]>>(7-xi)) & 1) ? color : 0; //R
171                  else if((gfx_sel & 0x30) == 0x10)
172                     pen = ((gfx_data[tile*8+yi+0x0800]>>(7-xi)) & 1) ? color : 0; //B
173                  else
174                     pen = ((gfx_data[tile*8+yi+0x0000]>>(7-xi)) & 1) ? color : 0;
175               }
170176
171               *BITMAP_ADDR16(bitmap, (y*8+yi), x*8+xi) = machine->pens[pen];
177
178               if(pen)
179                  *BITMAP_ADDR16(bitmap, (y*8+yi), x*8+xi) = machine->pens[pen];
172180            }
173181         }
174182            //drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfx_num],tile,color,0,0,x*8,(y)*8);
r8931r8932
184192   if(text_col_size)
185193      draw_80x25(machine,bitmap,cliprect);
186194   else
187      draw_40x25(machine,bitmap,cliprect,text_reg[0] >> 2);
195   {
196      int tv_mode;
188197
198      tv_mode = text_reg[0] >> 2;
199
200      switch(tv_mode)
201      {
202//         case 0: mixed 6bpp mode
203         case 1:
204            draw_40x25(machine,bitmap,cliprect,0);
205            break;
206         case 2:
207            draw_40x25(machine,bitmap,cliprect,1);
208            break;
209         case 3:
210            draw_40x25(machine,bitmap,cliprect,0);
211            draw_40x25(machine,bitmap,cliprect,1);
212            break;
213         default: popmessage("%02x %02x %02x",tv_mode,text_reg[1],text_reg[2]); break;
214      }
215   }
216
189217   #if 0
190218   if(text_font_reg)
191219   {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team