Previous 15994 Revisions Next

r2050 Saturday 22nd March, 2008 at 00:39:56 UTC by Robbbert
[VTECH2] Fixed palette (bug 1540).
[src/mess/drivers]vtech2.c
[src/mess/video]vtech2.c

src/mess/video/vtech2.c
r2049r2050
126126   int offs, x, y;
127127   int full_refresh = 1;
128128
129    if( full_refresh )
130   {
131      fillbitmap(bitmap, screen->machine->pens[(laser_bg_mode >> 4) & 15], cliprect);
132    }
129   if( full_refresh )
130      fillbitmap(bitmap, ((laser_bg_mode >> 4) & 15)<<1, cliprect);
133131
134132   if (laser_latch & 0x08)
135133   {
r2049r2050
142140          * GR 5
143141          * 640x192 1bpp
144142          */
145            for( y = 0; y < 192; y++ )
146            {
143         for( y = 0; y < 192; y++ )
144         {
147145            offs = offs_2[y];
148                for( x = 0; x < 80; x++, offs++ )
149                {
146            for( x = 0; x < 80; x++, offs++ )
147            {
150148               int sx, sy, code, color = laser_two_color;
151149               sy = BORDER_V/2 + y;
152150               sx = BORDER_H/2 + x * 8;
153                    code = videoram[offs];
154               drawgfx(bitmap,screen->machine->gfx[2],code,color,0,0,sx,sy,
155                        cliprect,TRANSPARENCY_NONE,0);
156                }
157            }
158            break;
151               code = videoram[offs];
152               drawgfx(bitmap,screen->machine->gfx[2],code,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
153            }
154         }
155         break;
159156
160      case 2:
157      case 2:
161158         /*
162159          * GR 4
163160          * 320x192 1bpp with two colors per 8 pixels
164161          */
165            for( y = 0; y < 192; y++ )
166            {
162         for( y = 0; y < 192; y++ )
163         {
167164            offs = offs_2[y];
168165            for( x = 0; x < 40; x++, offs += 2 )
169                {
166            {
170167               int sx, sy, code, color;
171168               sy = BORDER_V/2 + y;
172169               sx = BORDER_H/2 + x * 16;
173                    code = videoram[offs];
170               code = videoram[offs];
174171               color = videoram[offs+1];
175               drawgfx(bitmap,screen->machine->gfx[3],code,color,0,0,sx,sy,
176                        cliprect,TRANSPARENCY_NONE,0);
177                }
178            }
179            break;
172               drawgfx(bitmap,screen->machine->gfx[3],code,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
173            }
174         }
175         break;
180176
181177      case  3:
182178         /*
183179          * GR 3
184180          * 160x192 4bpp
185181          */
186            for( y = 0; y < 192; y++ )
187            {
182         for( y = 0; y < 192; y++ )
183         {
188184            offs = offs_2[y];
189185            for( x = 0; x < 80; x++, offs++ )
190                {
186            {
191187               int sx, sy, code;
192188               sy = BORDER_V/2 + y;
193189               sx = BORDER_H/2 + x * 8;
194                    code = videoram[offs];
195               drawgfx(bitmap,screen->machine->gfx[5],code,0,0,0,sx,sy,
196                        cliprect,TRANSPARENCY_NONE,0);
197                }
198            }
199            break;
190               code = videoram[offs];
191               drawgfx(bitmap,screen->machine->gfx[5],code,0,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
192            }
193         }
194         break;
200195
201196      case  4:
202197      case  5:
r2049r2050
205200          * 160x96 4bpp
206201          */
207202         for( y = 0; y < 96; y++ )
208            {
203         {
209204            offs = offs_0[y];
210205            for( x = 0; x < 80; x++, offs++ )
211                {
206            {
212207               int sx, sy, code;
213208               sy = BORDER_V/2 + y * 2;
214209               sx = BORDER_H/2 + x * 8;
215                    code = videoram[offs];
216               drawgfx(bitmap,screen->machine->gfx[6],code,0,0,0,sx,sy,
217                        cliprect,TRANSPARENCY_NONE,0);
218                }
219            }
220            break;
210               code = videoram[offs];
211               drawgfx(bitmap,screen->machine->gfx[6],code,0,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
212            }
213         }
214         break;
221215
222216      case  6:
223217         /*
224218          * GR 2
225219             * 320x192 1bpp
226220             */
227            for( y = 0; y < 192; y++ )
228            {
221         for( y = 0; y < 192; y++ )
222         {
229223            offs = offs_1[y];
230                for( x = 0; x < 40; x++, offs++ )
231                {
232                    int sx, sy, code, color = laser_two_color;
224            for( x = 0; x < 40; x++, offs++ )
225            {
226               int sx, sy, code, color = laser_two_color;
233227               sy = BORDER_V/2 + y;
234228               sx = BORDER_H/2 + x * 16;
235                    code = videoram[offs];
236               drawgfx(bitmap,screen->machine->gfx[3],code,color,0,0,sx,sy,
237                        cliprect,TRANSPARENCY_NONE,0);
238                }
239            }
240            break;
229               code = videoram[offs];
230               drawgfx(bitmap,screen->machine->gfx[3],code,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
231            }
232         }
233         break;
241234
242235      case  7:
243236         /*
244237          * GR 1
245238          * 160x192 1bpp with two colors per 8 pixels
246239          */
247            for( y = 0; y < 192; y++ )
248            {
240         for( y = 0; y < 192; y++ )
241         {
249242            offs = offs_1[y];
250243            for( x = 0; x < 20; x++, offs += 2 )
251                {
244            {
252245               int sx, sy, code, color;
253246               sy = BORDER_V/2 + y;
254247               sx = BORDER_H/2 + x * 32;
255                    code = videoram[offs];
248               code = videoram[offs];
256249               color = videoram[offs+1];
257               drawgfx(bitmap,screen->machine->gfx[4],code,color,0,0,sx,sy,
258                        cliprect,TRANSPARENCY_NONE,0);
259                }
260            }
261            break;
262        }
263    }
250               drawgfx(bitmap,screen->machine->gfx[4],code,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
251            }
252         }
253         break;
254      }
255   }
264256   else
265257   {
266258      /* text modes */
267        if (laser_bg_mode & 1)
268        {
269            /* 80 columns text mode */
270            for( y = 0; y < 24; y++ )
271            {
272                offs = ((y & 7) << 8) + ((y >> 3) * 80);
273                for( x = 0; x < 80; x++, offs++ )
274                {
259      if (laser_bg_mode & 1)
260      {
261         /* 80 columns text mode */
262         for( y = 0; y < 24; y++ )
263         {
264            offs = ((y & 7) << 8) + ((y >> 3) * 80);
265            for( x = 0; x < 80; x++, offs++ )
266            {
275267               int sx, sy, code, color = laser_two_color;
276268               sy = BORDER_V/2 + y * 8;
277269               sx = BORDER_H/2 + x * 8;
278                    code = videoram[0x3800+offs];
279               drawgfx(bitmap,screen->machine->gfx[0],code,color,0,0,sx,sy,
280                        cliprect,TRANSPARENCY_PEN,0);
281                }
282            }
283        }
284        else
285        {
286            /* 40 columns text mode */
287            for( y = 0; y < 24; y++ )
288            {
289                offs = ((y & 7) << 8) + ((y >> 3) * 80);
290                for( x = 0; x < 40; x++, offs += 2 )
291                {
292                    int sx, sy, code, color = 0;
270               code = videoram[0x3800+offs];
271               drawgfx(bitmap,screen->machine->gfx[0],code,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
272            }
273         }
274      }
275      else
276      {
277         /* 40 columns text mode */
278         for( y = 0; y < 24; y++ )
279         {
280            offs = ((y & 7) << 8) + ((y >> 3) * 80);
281            for( x = 0; x < 40; x++, offs += 2 )
282            {
283               int sx, sy, code, color = 0;
293284               sy = BORDER_V/2 + y * 8;
294285               sx = BORDER_H/2 + x * 16;
295                    code = videoram[0x3800+offs];
296                    color = videoram[0x3801+offs];
297               drawgfx(bitmap,screen->machine->gfx[1],code,color,0,0,sx,sy,
298                        cliprect,TRANSPARENCY_PEN,0);
299                }
300            }
301        }
302    }
286               code = videoram[0x3800+offs];
287               color = videoram[0x3801+offs];
288               drawgfx(bitmap,screen->machine->gfx[1],code,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
289            }
290         }
291      }
292   }
303293
304294   if( laser_frame_time > 0 )
305295   {
src/mess/drivers/vtech2.c
r2049r2050
410410GFXDECODE_END
411411
412412
413static const rgb_t vt_palette[] =
413static const rgb_t vt_colors[] =
414414{
415415   RGB_BLACK,
416416   MAKE_RGB(0x00, 0x00, 0x7f),  /* blue */
r2049r2050
434434/* Initialise the palette */
435435static PALETTE_INIT( vtech2 )
436436{
437   palette_set_colors(machine, 0, vt_palette, ARRAY_LENGTH(vt_palette));
437   int i;
438
439   machine->colortable = colortable_alloc(machine, 16);
440
441   for ( i = 0; i < 16; i++ )
442      colortable_palette_set_color(machine->colortable, i, vt_colors[i]);
443
444   for (i = 0; i < 256; i++)
445   {
446      colortable_entry_set_value(machine->colortable, 2*i, i&15);
447      colortable_entry_set_value(machine->colortable, 2*i+1, i>>4);
448   }
449
450   for (i = 0; i < 16; i++)
451      colortable_entry_set_value(machine->colortable, 512+i, i);
438452}
439453
440454static INTERRUPT_GEN( vtech2_interrupt )
r2049r2050
460474   MDRV_SCREEN_SIZE(88*8, 24*8+32)
461475   MDRV_SCREEN_VISIBLE_AREA(0*8, 88*8-1, 0*8, 24*8+32-1)
462476   MDRV_GFXDECODE( vtech2 )
463   MDRV_PALETTE_LENGTH(ARRAY_LENGTH(vt_palette))
477   MDRV_PALETTE_LENGTH(528)
464478   MDRV_PALETTE_INIT(vtech2)
465479
466480   MDRV_VIDEO_START(laser)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team