src/mess/video/sapi1.c
| r3301 | r3302 | |
| 10 | 10 | #include "driver.h"
|
| 11 | 11 | #include "includes/sapi1.h"
|
| 12 | 12 | |
| 13 | UINT8 MHB2501[] = {
|
| 14 | 0x0c,0x11,0x13,0x15,0x17,0x10,0x0e,0x00, // @
|
| 15 | 0x04,0x0a,0x11,0x11,0x1f,0x11,0x11,0x00, // A
|
| 16 | 0x1e,0x11,0x11,0x1e,0x11,0x11,0x1e,0x00, // B
|
| 17 | 0x0e,0x11,0x10,0x10,0x10,0x11,0x0e,0x00, // C
|
| 18 | 0x1e,0x09,0x09,0x09,0x09,0x09,0x1e,0x00, // D
|
| 19 | 0x1f,0x10,0x10,0x1e,0x10,0x10,0x1f,0x00, // E
|
| 20 | 0x1f,0x10,0x10,0x1e,0x10,0x10,0x10,0x00, // F
|
| 21 | 0x0e,0x11,0x10,0x10,0x13,0x11,0x0f,0x00, // G
|
| 22 |
|
| 23 | 0x11,0x11,0x11,0x1f,0x11,0x11,0x11,0x00, // H
|
| 24 | 0x0e,0x04,0x04,0x04,0x04,0x04,0x0e,0x00, // I
|
| 25 | 0x01,0x01,0x01,0x01,0x11,0x11,0x0e,0x00, // J
|
| 26 | 0x11,0x12,0x14,0x18,0x14,0x12,0x11,0x00, // K
|
| 27 | 0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0x00, // L
|
| 28 | 0x11,0x1b,0x15,0x15,0x11,0x11,0x11,0x00, // M
|
| 29 | 0x11,0x11,0x19,0x15,0x13,0x11,0x11,0x00, // N
|
| 30 | 0x0e,0x11,0x11,0x11,0x11,0x11,0x0e,0x00, // O
|
| 31 |
|
| 32 | 0x1e,0x11,0x11,0x1e,0x10,0x10,0x10,0x00, // P
|
| 33 | 0x0e,0x11,0x11,0x11,0x15,0x12,0x0d,0x00, // Q
|
| 34 | 0x1e,0x11,0x11,0x1e,0x14,0x12,0x11,0x00, // R
|
| 35 | 0x0e,0x11,0x10,0x0e,0x01,0x11,0x0e,0x00, // S
|
| 36 | 0x1f,0x04,0x04,0x04,0x04,0x04,0x04,0x00, // T
|
| 37 | 0x11,0x11,0x11,0x11,0x11,0x11,0x0e,0x00, // U
|
| 38 | 0x11,0x11,0x11,0x0a,0x0a,0x04,0x04,0x00, // V
|
| 39 | 0x11,0x11,0x11,0x15,0x15,0x15,0x0a,0x00, // W
|
| 40 |
|
| 41 | 0x11,0x11,0x0a,0x04,0x0a,0x11,0x11,0x00, // X
|
| 42 | 0x11,0x11,0x0a,0x04,0x04,0x04,0x04,0x00, // Y
|
| 43 | 0x1f,0x01,0x02,0x04,0x08,0x10,0x1f,0x00, // Z
|
| 44 | 0x1c,0x10,0x10,0x10,0x10,0x10,0x1c,0x00, // [
|
| 45 | 0x00,0x10,0x08,0x04,0x02,0x01,0x00,0x00, // backslash
|
| 46 | 0x07,0x01,0x01,0x01,0x01,0x01,0x07,0x00, // ]
|
| 47 | 0x0e,0x11,0x00,0x00,0x00,0x00,0x00,0x00, // ^
|
| 48 | 0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00, // _
|
| 49 |
|
| 50 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // |
| 51 | 0x04,0x04,0x04,0x04,0x04,0x00,0x04,0x00, // !
|
| 52 | 0x0a,0x0a,0x0a,0x00,0x00,0x00,0x00,0x00, // "
|
| 53 | 0x0a,0x0a,0x1f,0x0a,0x1f,0x0a,0x0a,0x00, // #
|
| 54 | 0x00,0x11,0x0e,0x0a,0x0e,0x11,0x00,0x00, // |
| 55 | 0x18,0x19,0x02,0x04,0x08,0x13,0x03,0x00, // %
|
| 56 | 0x04,0x0a,0x0a,0x0c,0x15,0x12,0x0d,0x00, // &
|
| 57 | 0x04,0x04,0x08,0x00,0x00,0x00,0x00,0x00, // '
|
| 58 |
|
| 59 | 0x02,0x04,0x08,0x08,0x08,0x04,0x02,0x00, // (
|
| 60 | 0x08,0x04,0x02,0x02,0x02,0x04,0x08,0x00, // )
|
| 61 | 0x00,0x04,0x15,0x0e,0x15,0x04,0x00,0x00, // *
|
| 62 | 0x00,0x04,0x04,0x1f,0x04,0x04,0x00,0x00, // +
|
| 63 | 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, // ,
|
| 64 | 0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00, // -
|
| 65 | 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00, // .
|
| 66 | 0x00,0x01,0x02,0x04,0x08,0x10,0x00,0x00, // /
|
| 67 |
|
| 68 | 0x0e,0x11,0x13,0x15,0x19,0x11,0x0e,0x00, // 0
|
| 69 | 0x04,0x0c,0x04,0x04,0x04,0x04,0x0e,0x00, // 1
|
| 70 | 0x0e,0x11,0x01,0x06,0x08,0x10,0x1f,0x00, // 2
|
| 71 | 0x1f,0x01,0x02,0x06,0x01,0x11,0x0e,0x00, // 3
|
| 72 | 0x02,0x06,0x0a,0x12,0x1f,0x02,0x02,0x00, // 4
|
| 73 | 0x1f,0x10,0x1e,0x01,0x01,0x11,0x0e,0x00, // 5
|
| 74 | 0x07,0x08,0x10,0x1e,0x11,0x11,0x0e,0x00, // 6
|
| 75 | 0x1f,0x01,0x02,0x04,0x08,0x08,0x08,0x00, // 7
|
| 76 |
|
| 77 | 0x0e,0x11,0x11,0x0e,0x11,0x11,0x0e,0x00, // 8
|
| 78 | 0x0e,0x11,0x11,0x0f,0x01,0x02,0x1c,0x00, // 9
|
| 79 | 0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00, // :
|
| 80 | 0x00,0x00,0x04,0x00,0x04,0x04,0x08,0x00, // ;
|
| 81 | 0x02,0x04,0x08,0x10,0x08,0x04,0x02,0x00, // <
|
| 82 | 0x00,0x00,0x1f,0x00,0x1f,0x00,0x00,0x00, // =
|
| 83 | 0x08,0x04,0x02,0x01,0x02,0x04,0x08,0x00, // >
|
| 84 | 0x0e,0x11,0x01,0x02,0x04,0x00,0x04,0x00 // ?
|
| 85 | };
|
| 86 | |
| 87 | static UINT8 refresh_counter;
|
| 88 | |
| 13 | 89 | VIDEO_START( sapi1 )
|
| 14 | 90 | {
|
| 91 | refresh_counter = 0;
|
| 15 | 92 | }
|
| 16 | 93 | |
| 17 | 94 | VIDEO_UPDATE( sapi1 )
|
| 18 | 95 | {
|
| 19 | 96 | int x,y,j,b;
|
| 20 | | UINT8 *gfx = memory_region(screen->machine, "gfx1");
|
| 21 | | |
| 97 | UINT16 addr;
|
| 98 | int xpos;
|
| 99 | |
| 22 | 100 | for(y = 0; y < 24; y++ )
|
| 23 | 101 | {
|
| 102 | addr = 0x3800 + y*64;
|
| 103 | xpos = 0;
|
| 24 | 104 | for(x = 0; x < 40; x++ )
|
| 25 | 105 | {
|
| 26 | | int code = program_read_byte(0x3800+ x + y*64);
|
| 27 | | if (code<0x20) code |= 0x40;
|
| 28 | | if (code==0xa0) code = 0xc0;
|
| 29 | | for(j = 0; j < 12; j++ )
|
| 30 | | {
|
| 106 | UINT8 code = program_read_byte(addr + x);
|
| 107 | UINT8 attr = (code >> 6) & 3;
|
| 108 | code &= 0x3f; |
| 109 | for(j = 0; j < 9; j++ )
|
| 110 | { |
| 31 | 111 | for(b = 0; b < 6; b++ )
|
| 32 | 112 | {
|
| 33 | | *BITMAP_ADDR16(bitmap, y*12+j, x*6+b ) = (gfx[code*16+(11-j)] >> (7-b)) & 1;
|
| 34 | | }
|
| 113 | UINT8 val;
|
| 114 | if (j==8) {
|
| 115 | if (attr==2) {
|
| 116 | val = (refresh_counter & 0x20) ? 1 : 0;
|
| 117 | } else {
|
| 118 | val = 0;
|
| 119 | }
|
| 120 | } else {
|
| 121 | val = (MHB2501[code*8 + j] >> (5-b)) & 1;
|
| 122 | if (attr==1) {
|
| 123 | val = (refresh_counter & 0x20) ? val : 0;
|
| 124 | }
|
| 125 | }
|
| 126 | if(attr==3) {
|
| 127 | *BITMAP_ADDR16(bitmap, y*9+j, xpos+2*b ) = val;
|
| 128 | *BITMAP_ADDR16(bitmap, y*9+j, xpos+2*b+1 ) = val;
|
| 129 | } else {
|
| 130 | *BITMAP_ADDR16(bitmap, y*9+j, xpos+b ) = val;
|
| 131 | }
|
| 132 | } |
| 35 | 133 | }
|
| 134 | xpos+= (attr==3) ? 12 : 6;
|
| 135 | if (xpos>=6*40) break;
|
| 36 | 136 | }
|
| 37 | 137 | }
|
| 138 | refresh_counter++;
|
| 38 | 139 | return 0;
|
| 39 | 140 | }
|
| 40 | 141 | |