Previous 15994 Revisions Next

r1922 Tuesday 11th March, 2008 at 20:31:18 UTC by Wilbert Pol
Removed deprecat.h dependency from video/vc4000.c
[src/mess/video]vc4000.c

src/mess/video/vc4000.c
r1921r1922
11#include <assert.h>
22#include "driver.h"
3#include "deprecat.h"
43
54#include "includes/vc4000.h"
65#include "cpu/s2650/s2650.h"
r1921r1922
255254   "iiiihhhhgggg"
256255};
257256
258static void vc4000_draw_digit(bitmap_t *bitmap, int x, int y, int d, int line)
257static void vc4000_draw_digit(running_machine *machine, bitmap_t *bitmap, int x, int y, int d, int line)
259258{
260259   static const int digit_to_segment[0x10]={
261260   0x0fff, 0x007c, 0x17df, 0x15ff, 0x1c7d, 0x1df7, 0x1ff7, 0x007f, 0x1fff, 0x1dff
r1921r1922
264263   i=line;
265264   for (j=0; j<sizeof(led[0]); j++) {
266265   if (digit_to_segment[d]&(1<<(led[i][j]-'a')) ) {
267       *BITMAP_ADDR16(bitmap, y+i, x+j) = Machine->pens[((vc4000_video.reg.d.background>>4)&7)^7];
266       *BITMAP_ADDR16(bitmap, y+i, x+j) = machine->pens[((vc4000_video.reg.d.background>>4)&7)^7];
268267   }
269268   }
270269}
r1921r1922
282281}
283282
284283
285static void vc4000_sprite_update(bitmap_t *bitmap, UINT8 *collision, SPRITE *This)
284static void vc4000_sprite_update(running_machine *machine, bitmap_t *bitmap, UINT8 *collision, SPRITE *This)
286285{
287286
288287   int i,j,m;
r1921r1922
315314               for (i=0; i<This->size; i++)
316315               {
317316                   *BITMAP_ADDR16(bitmap, vc4000_video.line, This->data->x1 + i + j*This->size) =
318                     Machine->pens[This->scolor];
317                     machine->pens[This->scolor];
319318               }
320319            }
321320         }
r1921r1922
371370               for (i=0; i<This->size; i++)
372371               {
373372                   *BITMAP_ADDR16(bitmap, vc4000_video.line, This->data->x2 + i + j*This->size) =
374                     Machine->pens[This->scolor];
373                     machine->pens[This->scolor];
375374               }
376375            }
377376         }
r1921r1922
389388   }
390389}
391390
392INLINE void vc4000_draw_grid(UINT8 *collision)
391INLINE void vc4000_draw_grid(running_machine *machine, UINT8 *collision)
393392{
394393   int i, j, m, x, line=vc4000_video.line-20;
395394   int w, k;
396395
397   if (vc4000_video.line>=Machine->screen[0].height) return;
396   if (vc4000_video.line>=machine->screen[0].height) return;
398397
399   plot_box(vc4000_video.bitmap, 0, vc4000_video.line, Machine->screen[0].width, 1, Machine->pens[(vc4000_video.reg.d.background)&7]);
398   plot_box(vc4000_video.bitmap, 0, vc4000_video.line, machine->screen[0].width, 1, machine->pens[(vc4000_video.reg.d.background)&7]);
400399
401400   if (line<0 || line>=200) return;
402401   if (!vc4000_video.reg.d.background&8) return;
r1921r1922
436435         for (l=0; l<w; l++) {
437436         collision[x+l]|=0x10;
438437         }
439         plot_box(vc4000_video.bitmap, x, vc4000_video.line, w, 1, Machine->pens[(vc4000_video.reg.d.background>>4)&7]);
438         plot_box(vc4000_video.bitmap, x, vc4000_video.line, w, 1, machine->pens[(vc4000_video.reg.d.background>>4)&7]);
440439      }
441440      if (j==7) m=0x100;
442441   }
r1921r1922
461460
462461   if (vc4000_video.line <= 270)
463462   {
464      vc4000_draw_grid(collision);
463      vc4000_draw_grid(machine, collision);
465464
466      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[0]);
467      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[1]);
468      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[2]);
469      vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[3]);
465      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[0]);
466      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[1]);
467      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[2]);
468      vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[3]);
470469
471470      for (i=0; i<256; i++)
472471      {
r1921r1922
479478      if ((vc4000_video.line>=y)&&(vc4000_video.line<y+20))
480479      {
481480         x = 58;
482         vc4000_draw_digit(vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[0]>>4, vc4000_video.line-y);
483         vc4000_draw_digit(vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[0]&0xf, vc4000_video.line-y);
481         vc4000_draw_digit(machine, vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[0]>>4, vc4000_video.line-y);
482         vc4000_draw_digit(machine, vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[0]&0xf, vc4000_video.line-y);
484483         x = 106;
485484         if (vc4000_video.reg.d.score_control&2)
486485            x += 16;
487         vc4000_draw_digit(vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[1]>>4, vc4000_video.line-y);
488         vc4000_draw_digit(vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[1]&0xf, vc4000_video.line-y);
486         vc4000_draw_digit(machine, vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[1]>>4, vc4000_video.line-y);
487         vc4000_draw_digit(machine, vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[1]&0xf, vc4000_video.line-y);
489488      }
490489   }
491490   if (vc4000_video.line==269) vc4000_video.reg.d.sprite_collision |=0x40;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team