trunk/src/mess/drivers/hh_hmcs40.c
r245325 | r245326 | |
86 | 86 | UINT32 m_grid; // VFD current row data |
87 | 87 | UINT64 m_plate; // VFD current column data |
88 | 88 | |
89 | | UINT64 m_display_state[0x20]; // display matrix rows data |
| 89 | UINT64 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) |
90 | 90 | UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments |
91 | 91 | UINT64 m_display_cache[0x20]; // (internal use) |
92 | 92 | UINT8 m_display_decay[0x20][0x40]; // (internal use) |
r245325 | r245326 | |
216 | 216 | { |
217 | 217 | active_state[y] = 0; |
218 | 218 | |
219 | | for (int x = 0; x < m_display_maxx; x++) |
| 219 | for (int x = 0; x <= m_display_maxx; x++) |
220 | 220 | { |
221 | 221 | // turn on powered segments |
222 | 222 | if (m_display_state[y] >> x & 1) |
r245325 | r245326 | |
236 | 236 | output_set_digit_value(y, active_state[y] & m_display_segmask[y]); |
237 | 237 | |
238 | 238 | const int mul = (m_display_maxx <= 10) ? 10 : 100; |
239 | | for (int x = 0; x < m_display_maxx; x++) |
| 239 | for (int x = 0; x <= m_display_maxx; x++) |
240 | 240 | { |
241 | 241 | int state = active_state[y] >> x & 1; |
242 | | output_set_lamp_value(y * mul + x, state); |
243 | | |
244 | | // bit coords for svg2lay |
245 | | char buf[10]; |
246 | | sprintf(buf, "%d.%d", y, x); |
247 | | output_set_value(buf, state); |
| 242 | char buf1[0x10]; // lampyx |
| 243 | char buf2[0x10]; // y.x |
| 244 | |
| 245 | if (x == m_display_maxx) |
| 246 | { |
| 247 | // always-on if selected |
| 248 | sprintf(buf1, "lamp%da", y); |
| 249 | sprintf(buf2, "%d.a", y); |
| 250 | } |
| 251 | else |
| 252 | { |
| 253 | sprintf(buf1, "lamp%d", y * mul + x); |
| 254 | sprintf(buf2, "%d.%d", y, x); |
| 255 | } |
| 256 | output_set_value(buf1, state); |
| 257 | output_set_value(buf2, state); |
248 | 258 | } |
249 | 259 | } |
250 | 260 | |
r245325 | r245326 | |
255 | 265 | { |
256 | 266 | // slowly turn off unpowered segments |
257 | 267 | for (int y = 0; y < m_display_maxy; y++) |
258 | | for (int x = 0; x < m_display_maxx; x++) |
| 268 | for (int x = 0; x <= m_display_maxx; x++) |
259 | 269 | if (m_display_decay[y][x] != 0) |
260 | 270 | m_display_decay[y][x]--; |
261 | 271 | |
r245325 | r245326 | |
275 | 285 | // update current state |
276 | 286 | UINT64 mask = (1 << maxx) - 1; |
277 | 287 | for (int y = 0; y < maxy; y++) |
278 | | m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; |
| 288 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
279 | 289 | |
280 | 290 | display_update(); |
281 | 291 | } |
r245325 | r245326 | |
736 | 746 | void hh_hmcs40_state::cdkong_display() |
737 | 747 | { |
738 | 748 | UINT32 plate = BITSWAP32(m_plate,31,30,29,24,0,16,8,1,23,17,9,2,18,10,25,27,26,3,15,27,11,11,14,22,6,13,21,5,19,12,20,4); |
739 | | plate |= 0x800800; // plates 11,23 are always on |
740 | 749 | |
741 | 750 | display_matrix(29, 11, plate, m_grid); |
742 | 751 | } |
r245325 | r245326 | |
953 | 962 | |
954 | 963 | UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10); |
955 | 964 | UINT32 plate = BITSWAP32(m_plate,31,30,29,28,27,0,1,2,3,8,9,10,11,16,17,18,19,25,26,23,22,21,20,24,15,14,13,12,4,5,6,7); |
956 | | plate |= 0x2000; // plate 13(maze) is always on |
957 | 965 | |
958 | 966 | display_matrix(27, 11, plate, grid); |
959 | 967 | } |
r245325 | r245326 | |
1048 | 1056 | |
1049 | 1057 | // update display |
1050 | 1058 | // 22,17 18,13 |
1051 | | // 31,30,29,28,27,26, 6,11,23,21,20,19,15, 2, 1, 0,32,31,30,29,12, 9, 4, 8,25,26,27,28,16,10, 3, 5 |
| 1059 | // 6,11,23,21,20,19,15, 2, 1, 0,32,31,30,29,12, 9, 4, 8,25,26,27,28,16,10, 3, 5 |
1052 | 1060 | // 31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 |
1053 | 1061 | // 14,13,12, 4, 5, 6, 7,24,23,25,22,21,20,13,24, 3,19,14,12,11,24, 2,10, 8, 7,25, 0, 9, 1,18,17,16 |
1054 | 1062 | |
1055 | 1063 | UINT16 grid = BITSWAP16(m_grid,15,14,13,11,10,9,8,7,6,5,4,3,2,1,1,0); |
1056 | 1064 | UINT64 plate = BIT(m_plate,15)<<32 | BITSWAP32(m_plate,14,13,12,4,5,6,7,24,23,25,22,21,20,13,24,3,19,14,12,11,24,2,10,8,7,25,0,9,1,18,17,16); |
1057 | | plate |= 0x1004080; // plates 7,14,24 are always on |
1058 | 1065 | |
1059 | 1066 | display_matrix(33, 12, plate, grid); |
1060 | 1067 | } |
r245325 | r245326 | |
1144 | 1151 | { |
1145 | 1152 | UINT16 grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); |
1146 | 1153 | UINT32 plate = BITSWAP24(m_plate,23,22,21,20,15,14,13,12,7,6,5,4,3,2,1,0,19,18,17,16,11,10,9,8); |
1147 | | plate |= 1 << 24; // for always-on plates |
1148 | 1154 | |
1149 | | display_matrix(24+1, 15, plate, grid); |
| 1155 | display_matrix(24, 15, plate, grid); |
1150 | 1156 | } |
1151 | 1157 | |
1152 | 1158 | WRITE16_MEMBER(hh_hmcs40_state::egalaxn2_grid_w) |
r245325 | r245326 | |
1331 | 1337 | |
1332 | 1338 | // update display |
1333 | 1339 | UINT32 plate = BITSWAP32(m_plate,31,30,24,25,26,27,28,15,14,29,13,12,11,10,9,8,7,6,5,4,3,2,1,0,16,17,18,19,20,21,22,23); |
1334 | | plate |= 0x400000; // plate 22 is always on |
1335 | 1340 | |
1336 | 1341 | display_matrix(30, 8, plate, m_grid); |
1337 | 1342 | } |
trunk/src/mess/drivers/hh_pic16.c
r245325 | r245326 | |
58 | 58 | int m_display_maxy; // display matrix number of rows |
59 | 59 | int m_display_maxx; // display matrix number of columns |
60 | 60 | |
61 | | UINT32 m_display_state[0x20]; // display matrix rows data |
| 61 | UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) |
62 | 62 | UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments |
63 | 63 | UINT32 m_display_cache[0x20]; // (internal use) |
64 | 64 | UINT8 m_display_decay[0x20][0x20]; // (internal use) |
r245325 | r245326 | |
117 | 117 | { |
118 | 118 | active_state[y] = 0; |
119 | 119 | |
120 | | for (int x = 0; x < m_display_maxx; x++) |
| 120 | for (int x = 0; x <= m_display_maxx; x++) |
121 | 121 | { |
122 | 122 | // turn on powered segments |
123 | 123 | if (m_display_state[y] >> x & 1) |
r245325 | r245326 | |
137 | 137 | output_set_digit_value(y, active_state[y] & m_display_segmask[y]); |
138 | 138 | |
139 | 139 | const int mul = (m_display_maxx <= 10) ? 10 : 100; |
140 | | for (int x = 0; x < m_display_maxx; x++) |
| 140 | for (int x = 0; x <= m_display_maxx; x++) |
141 | 141 | { |
142 | 142 | int state = active_state[y] >> x & 1; |
143 | | output_set_lamp_value(y * mul + x, state); |
144 | | |
145 | | // bit coords for svg2lay |
146 | | char buf[10]; |
147 | | sprintf(buf, "%d.%d", y, x); |
148 | | output_set_value(buf, state); |
| 143 | char buf1[0x10]; // lampyx |
| 144 | char buf2[0x10]; // y.x |
| 145 | |
| 146 | if (x == m_display_maxx) |
| 147 | { |
| 148 | // always-on if selected |
| 149 | sprintf(buf1, "lamp%da", y); |
| 150 | sprintf(buf2, "%d.a", y); |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | sprintf(buf1, "lamp%d", y * mul + x); |
| 155 | sprintf(buf2, "%d.%d", y, x); |
| 156 | } |
| 157 | output_set_value(buf1, state); |
| 158 | output_set_value(buf2, state); |
149 | 159 | } |
150 | 160 | } |
151 | 161 | |
r245325 | r245326 | |
156 | 166 | { |
157 | 167 | // slowly turn off unpowered segments |
158 | 168 | for (int y = 0; y < m_display_maxy; y++) |
159 | | for (int x = 0; x < m_display_maxx; x++) |
| 169 | for (int x = 0; x <= m_display_maxx; x++) |
160 | 170 | if (m_display_decay[y][x] != 0) |
161 | 171 | m_display_decay[y][x]--; |
162 | 172 | |
r245325 | r245326 | |
176 | 186 | // update current state |
177 | 187 | UINT32 mask = (1 << maxx) - 1; |
178 | 188 | for (int y = 0; y < maxy; y++) |
179 | | m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; |
| 189 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
180 | 190 | |
181 | 191 | display_update(); |
182 | 192 | } |
trunk/src/mess/drivers/hh_ucom4.c
r245325 | r245326 | |
69 | 69 | UINT32 m_grid; // VFD current row data |
70 | 70 | UINT32 m_plate; // VFD current column data |
71 | 71 | |
72 | | UINT32 m_display_state[0x20]; // display matrix rows data |
| 72 | UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) |
73 | 73 | UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments |
74 | 74 | UINT32 m_display_cache[0x20]; // (internal use) |
75 | 75 | UINT8 m_display_decay[0x20][0x20]; // (internal use) |
r245325 | r245326 | |
162 | 162 | { |
163 | 163 | active_state[y] = 0; |
164 | 164 | |
165 | | for (int x = 0; x < m_display_maxx; x++) |
| 165 | for (int x = 0; x <= m_display_maxx; x++) |
166 | 166 | { |
167 | 167 | // turn on powered segments |
168 | 168 | if (m_display_state[y] >> x & 1) |
r245325 | r245326 | |
182 | 182 | output_set_digit_value(y, active_state[y] & m_display_segmask[y]); |
183 | 183 | |
184 | 184 | const int mul = (m_display_maxx <= 10) ? 10 : 100; |
185 | | for (int x = 0; x < m_display_maxx; x++) |
| 185 | for (int x = 0; x <= m_display_maxx; x++) |
186 | 186 | { |
187 | 187 | int state = active_state[y] >> x & 1; |
188 | | output_set_lamp_value(y * mul + x, state); |
189 | | |
190 | | // bit coords for svg2lay |
191 | | char buf[10]; |
192 | | sprintf(buf, "%d.%d", y, x); |
193 | | output_set_value(buf, state); |
| 188 | char buf1[0x10]; // lampyx |
| 189 | char buf2[0x10]; // y.x |
| 190 | |
| 191 | if (x == m_display_maxx) |
| 192 | { |
| 193 | // always-on if selected |
| 194 | sprintf(buf1, "lamp%da", y); |
| 195 | sprintf(buf2, "%d.a", y); |
| 196 | } |
| 197 | else |
| 198 | { |
| 199 | sprintf(buf1, "lamp%d", y * mul + x); |
| 200 | sprintf(buf2, "%d.%d", y, x); |
| 201 | } |
| 202 | output_set_value(buf1, state); |
| 203 | output_set_value(buf2, state); |
194 | 204 | } |
195 | 205 | } |
196 | 206 | |
r245325 | r245326 | |
201 | 211 | { |
202 | 212 | // slowly turn off unpowered segments |
203 | 213 | for (int y = 0; y < m_display_maxy; y++) |
204 | | for (int x = 0; x < m_display_maxx; x++) |
| 214 | for (int x = 0; x <= m_display_maxx; x++) |
205 | 215 | if (m_display_decay[y][x] != 0) |
206 | 216 | m_display_decay[y][x]--; |
207 | 217 | |
r245325 | r245326 | |
221 | 231 | // update current state |
222 | 232 | UINT32 mask = (1 << maxx) - 1; |
223 | 233 | for (int y = 0; y < maxy; y++) |
224 | | m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; |
| 234 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
225 | 235 | |
226 | 236 | display_update(); |
227 | 237 | } |
r245325 | r245326 | |
625 | 635 | // E,F,G,H,I01: vfd matrix plate |
626 | 636 | int shift = (offset - NEC_UCOM4_PORTE) * 4; |
627 | 637 | m_plate = (m_plate & ~(0xf << shift)) | (data << shift); |
628 | | m_plate |= 1 << 18; // for always-on plates |
629 | 638 | |
630 | | display_matrix(18+1, 8, m_plate, m_grid); |
| 639 | display_matrix(18, 8, m_plate, m_grid); |
631 | 640 | } |
632 | 641 | |
633 | 642 | |
r245325 | r245326 | |
839 | 848 | { |
840 | 849 | UINT16 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); |
841 | 850 | UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,16,17,18,11,10,9,8,0,2,3,1,4,5,6,7,12,13,14,15); |
842 | | plate |= 0x100; // plate 8(maze) is always on |
843 | 851 | |
844 | 852 | display_matrix(19, 8, plate, grid); |
845 | 853 | } |
r245325 | r245326 | |
951 | 959 | // E23,F,G,H,I: vfd matrix plate |
952 | 960 | int shift = (offset - NEC_UCOM4_PORTE) * 4; |
953 | 961 | m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2; |
954 | | m_plate |= 1 << 17; // for always-on plates |
955 | 962 | } |
956 | 963 | |
957 | | display_matrix(17+1, 9, m_plate, m_grid); |
| 964 | display_matrix(17, 9, m_plate, m_grid); |
958 | 965 | } |
959 | 966 | |
960 | 967 | READ8_MEMBER(hh_ucom4_state::alnchase_input_r) |