src/mess/video/advision.c
| r6479 | r6480 | |
| 5 | 5 | Routines to control the Adventurevision video hardware |
| 6 | 6 | |
| 7 | 7 | 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. |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| r6479 | r6480 | |
| 21 | 21 | { |
| 22 | 22 | advision_state *state = machine->driver_data; |
| 23 | 23 | |
| 24 | | state->video_hpos = 0; |
| 24 | state->video_hpos = 0; |
| 25 | 25 | state->display = auto_alloc_array(machine, UINT8, 8 * 8 * 256); |
| 26 | 26 | memset(state->display, 0, 8 * 8 * 256); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /*************************************************************************** |
| 30 | 30 | |
| 31 | | Stop the video hardware emulation. |
| 31 | Initialise the palette. |
| 32 | 32 | |
| 33 | 33 | ***************************************************************************/ |
| 34 | 34 | |
| r6479 | r6480 | |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | /*************************************************************************** |
| 47 | |
| 48 | Update the display data. |
| 49 | |
| 50 | ***************************************************************************/ |
| 51 | |
| 46 | 52 | void advision_vh_write(running_machine *machine, int data) |
| 47 | 53 | { |
| 48 | 54 | advision_state *state = machine->driver_data; |
| r6479 | r6480 | |
| 57 | 63 | { |
| 58 | 64 | advision_state *state = machine->driver_data; |
| 59 | 65 | |
| 60 | | UINT8 *dst = &state->display[x]; |
| 66 | UINT8 *dst = &state->display[x]; |
| 61 | 67 | int y; |
| 62 | 68 | |
| 63 | 69 | for( y = 0; y < 8; y++ ) |
| r6479 | r6480 | |
| 76 | 82 | state->led_latch[7-y] = 0xff; |
| 77 | 83 | |
| 78 | 84 | dst += 8 * 256; |
| 79 | | } |
| 85 | } |
| 80 | 86 | } |
| 81 | 87 | |
| 82 | 88 | |
| r6479 | r6480 | |
| 90 | 96 | { |
| 91 | 97 | advision_state *state = screen->machine->driver_data; |
| 92 | 98 | |
| 93 | | int x, y, bit; |
| 99 | int x, y; |
| 94 | 100 | |
| 95 | | static int framecount = 0; |
| 101 | static int framecount = 0; |
| 96 | 102 | |
| 97 | | if( (framecount++ % 8) == 0 ) |
| 103 | if( (framecount++ % 4) == 0 ) |
| 98 | 104 | { |
| 99 | 105 | state->frame_start = 1; |
| 100 | 106 | state->video_hpos = 0; |
| 101 | | } |
| 107 | } |
| 102 | 108 | |
| 103 | | for( x = (framecount % 2) * 128; x < (framecount % 2) * 128+128; x++ ) |
| 109 | for (x = 0; x < 150; x++) |
| 104 | 110 | { |
| 105 | 111 | UINT8 *led = &state->display[x]; |
| 106 | 112 | |
| 107 | | for( y = 0; y < 8; y++ ) |
| 113 | for( y = 0; y < 128; y+=2 ) |
| 108 | 114 | { |
| 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; |
| 113 | 119 | |
| 114 | | led += 256; |
| 115 | | } |
| 120 | led += 256; |
| 116 | 121 | } |
| 117 | 122 | } |
| 118 | 123 | return 0; |