Previous 15994 Revisions Next

r5510 Thursday 27th August, 2009 at 19:35:33 UTC by Angelo Salese
[X1]: Hooked up 320 bitmap mode and added char double height feature.
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5509r5510
146146   {
147147      int count,xi,yi;
148148      int pen_r,pen_g,pen_b,color;
149      int yi_size;
149150
150151      count = 0;
151152
152      for(yi=0;yi<8;yi++)
153      yi_size = (w == 1) ? 16 : 8;
154
155      for(yi=0;yi<yi_size;yi++)
153156      {
154157         for(y=0;y<200;y+=8)
155158         {
r5509r5510
163166
164167                  color = pen_r<<2 | pen_g<<1 | pen_b<<0;
165168
166                  if((x+xi)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y)
167                     *BITMAP_ADDR16(bitmap, y+yi, x+xi) = screen->machine->pens[color+0x100];
169                  if(w == 1)
170                  {
171                     if(yi & 1)
172                        continue;
168173
174                     if((x+xi)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y)
175                        *BITMAP_ADDR16(bitmap, y+(yi >> 1), x+xi) = screen->machine->pens[color+0x100];
176                  }
177                  else
178                  {
179                     if((x+xi)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y)
180                        *BITMAP_ADDR16(bitmap, y+yi, x+xi) = screen->machine->pens[color+0x100];
181                  }
169182               }
170183               count++;
171184            }
r5509r5510
181194         int tile = videoram[x+(y*40*w)];
182195         int color = colorram[x+(y*40*w)] & 0x1f;
183196         int width = (colorram[x+(y*40*w)] & 0x80)>>7;
184         int bank = (colorram[x+(y*40*w)] & 0x20)>>4;
197         int height = (colorram[x+(y*40*w)] & 0x40)>>6;
198         int pcg_bank = (colorram[x+(y*40*w)] & 0x20)>>4;
199         int region = (width+(height<<1)) & 3;
185200
186         if(tile == 0) continue; //<- correct?
201         if(pcg_bank)
202         {
203            region = 4;
204            width = 0;
205            height = 0;
206         }
207         else if(tile == 0) continue; //<- correct?
187208
188209         if(color & 0x38)
189            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[width+bank],tile,color,0,0,(x/(width+1))*8*(width+1),y*8);
210            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[region],tile,color,0,0,(x/(width+1))*8*(width+1),(y/(height+1))*8*(height+1));
190211         else
191            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[width+bank],tile,color,0,0,(x/(width+1))*8*(width+1),y*8,0);
212            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[region],tile,color,0,0,(x/(width+1))*8*(width+1),(y/(height+1))*8*(height+1),0);
192213      }
193214   }
194215
r5509r5510
521542   8*8
522543};
523544
545static const gfx_layout x1_chars_8x8w =
546{
547   8,16,
548   RGN_FRAC(1,1),
549   1,
550   { 0 },
551   { 0, 1, 2, 3, 4, 5, 6, 7 },
552   { 0*8, 0*8, 1*8, 1*8, 2*8, 2*8, 3*8, 3*8, 4*8, 4*8, 5*8, 5*8, 6*8, 6*8, 7*8, 7*8 },
553   8*8
554};
555
556static const gfx_layout x1_chars_8wx8w =
557{
558   16,16,
559   RGN_FRAC(1,1),
560   1,
561   { 0 },
562   { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 },
563   { 0*8, 0*8, 1*8, 1*8, 2*8, 2*8, 3*8, 3*8, 4*8, 4*8, 5*8, 5*8, 6*8, 6*8, 7*8, 7*8 },
564   8*8
565};
566
524567static const gfx_layout x1_chars_16x16 =
525568{
526569   16,16,
r5509r5510
547590static GFXDECODE_START( x1 )
548591   GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8,    0, 0x40 )
549592   GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8wx8,   0, 0x40 )
593   GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8w,   0, 0x40 )
594   GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8wx8w,  0, 0x40 )
550595   GFXDECODE_ENTRY( "pcg",   0x00000, x1_pcg_8x8,      0x80, 1 )
551596   GFXDECODE_ENTRY( "cgrom", 0x01800, x1_chars_16x16,  0, 0x40 ) //only x1turboz uses this so far
552597   GFXDECODE_ENTRY( "kanji", 0x27000, x1_chars_16x16,  0, 0x40 ) //needs to be checked when the ROM will be redumped

Previous 15994 Revisions Next


© 1998-2018 The MESS Team