Previous 15994 Revisions Next

r6480 Sunday 29th November, 2009 at 14:25:55 UTC by Robbbert
[ADVISION] Improved the video display.
[src/mess/drivers]advision.c
[src/mess/video]advision.c

src/mess/video/advision.c
r6479r6480
55  Routines to control the Adventurevision video hardware
66
77  Video hardware is composed of a vertical array of 40 LEDs which is
8  reflected off a spinning mirror.
8  reflected off a spinning mirror, to give a resolution of 150 x 40 at 15 FPS.
99
1010***************************************************************************/
1111
r6479r6480
2121{
2222   advision_state *state = machine->driver_data;
2323
24    state->video_hpos = 0;
24   state->video_hpos = 0;
2525   state->display = auto_alloc_array(machine, UINT8, 8 * 8 * 256);
2626   memset(state->display, 0, 8 * 8 * 256);
2727}
2828
2929/***************************************************************************
3030
31  Stop the video hardware emulation.
31  Initialise the palette.
3232
3333***************************************************************************/
3434
r6479r6480
4343   }
4444}
4545
46/***************************************************************************
47
48  Update the display data.
49
50***************************************************************************/
51
4652void advision_vh_write(running_machine *machine, int data)
4753{
4854   advision_state *state = machine->driver_data;
r6479r6480
5763{
5864   advision_state *state = machine->driver_data;
5965
60    UINT8 *dst = &state->display[x];
66   UINT8 *dst = &state->display[x];
6167   int y;
6268
6369   for( y = 0; y < 8; y++ )
r6479r6480
7682      state->led_latch[7-y] = 0xff;
7783
7884      dst += 8 * 256;
79    }
85   }
8086}
8187
8288
r6479r6480
9096{
9197   advision_state *state = screen->machine->driver_data;
9298
93   int x, y, bit;
99   int x, y;
94100
95    static int framecount = 0;
101   static int framecount = 0;
96102
97    if( (framecount++ % 8) == 0 )
103   if( (framecount++ % 4) == 0 )
98104   {
99105      state->frame_start = 1;
100106      state->video_hpos = 0;
101    }
107   }
102108
103   for( x = (framecount % 2) * 128; x < (framecount % 2) * 128+128; x++ )
109   for (x = 0; x < 150; x++)
104110   {
105111      UINT8 *led = &state->display[x];
106112
107      for( y = 0; y < 8; y++ )
113      for( y = 0; y < 128; y+=2 )
108114      {
109         for( bit = 0; bit < 8; bit++ )
110         {
111            if( *led > 0 )
112               *BITMAP_ADDR16(bitmap, 30 + 2 *( y * 8 + bit), 85 + x) = --(*led);
115         if( *led > 0 )
116            *BITMAP_ADDR16(bitmap, 30 + y, 85 + x) = --(*led);
117         else
118            *BITMAP_ADDR16(bitmap, 30 + y, 85 + x) = 0;
113119
114            led += 256;
115         }
120         led += 256;
116121      }
117122   }
118123   return 0;
src/mess/drivers/advision.c
r6479r6480
8585
8686    /* video hardware */
8787   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
88   MDRV_SCREEN_REFRESH_RATE(8*15)
88   MDRV_SCREEN_REFRESH_RATE(4*15)
8989   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
9090   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
9191   MDRV_SCREEN_SIZE(320, 200)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team