Previous 199869 Revisions Next

r36814 Monday 30th March, 2015 at 22:09:07 UTC by hap
added support for always-on plates/leds
[src/mess/drivers]hh_hmcs40.c hh_pic16.c hh_tms1k.c hh_ucom4.c
[src/mess/includes]hh_tms1k.h

trunk/src/mess/drivers/hh_hmcs40.c
r245325r245326
8686   UINT32 m_grid;                      // VFD current row data
8787   UINT64 m_plate;                     // VFD current column data
8888
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)
9090   UINT16 m_display_segmask[0x20];     // if not 0, display matrix row is a digit, mask indicates connected segments
9191   UINT64 m_display_cache[0x20];       // (internal use)
9292   UINT8 m_display_decay[0x20][0x40];  // (internal use)
r245325r245326
216216   {
217217      active_state[y] = 0;
218218
219      for (int x = 0; x < m_display_maxx; x++)
219      for (int x = 0; x <= m_display_maxx; x++)
220220      {
221221         // turn on powered segments
222222         if (m_display_state[y] >> x & 1)
r245325r245326
236236            output_set_digit_value(y, active_state[y] & m_display_segmask[y]);
237237
238238         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++)
240240         {
241241            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);
248258         }
249259      }
250260
r245325r245326
255265{
256266   // slowly turn off unpowered segments
257267   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++)
259269         if (m_display_decay[y][x] != 0)
260270            m_display_decay[y][x]--;
261271
r245325r245326
275285   // update current state
276286   UINT64 mask = (1 << maxx) - 1;
277287   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;
279289
280290   display_update();
281291}
r245325r245326
736746void hh_hmcs40_state::cdkong_display()
737747{
738748   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
740749
741750   display_matrix(29, 11, plate, m_grid);
742751}
r245325r245326
953962   
954963   UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10);
955964   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
957965
958966   display_matrix(27, 11, plate, grid);
959967}
r245325r245326
10481056
10491057   // update display
10501058   //                   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
10521060   // 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
10531061   // 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
10541062   
10551063   UINT16 grid = BITSWAP16(m_grid,15,14,13,11,10,9,8,7,6,5,4,3,2,1,1,0);
10561064   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
10581065
10591066   display_matrix(33, 12, plate, grid);
10601067}
r245325r245326
11441151{
11451152   UINT16 grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14);
11461153   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
11481154
1149   display_matrix(24+1, 15, plate, grid);
1155   display_matrix(24, 15, plate, grid);
11501156}
11511157
11521158WRITE16_MEMBER(hh_hmcs40_state::egalaxn2_grid_w)
r245325r245326
13311337
13321338   // update display
13331339   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
13351340   
13361341   display_matrix(30, 8, plate, m_grid);
13371342}
trunk/src/mess/drivers/hh_pic16.c
r245325r245326
5858   int m_display_maxy;                 // display matrix number of rows
5959   int m_display_maxx;                 // display matrix number of columns
6060
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)
6262   UINT16 m_display_segmask[0x20];     // if not 0, display matrix row is a digit, mask indicates connected segments
6363   UINT32 m_display_cache[0x20];       // (internal use)
6464   UINT8 m_display_decay[0x20][0x20];  // (internal use)
r245325r245326
117117   {
118118      active_state[y] = 0;
119119
120      for (int x = 0; x < m_display_maxx; x++)
120      for (int x = 0; x <= m_display_maxx; x++)
121121      {
122122         // turn on powered segments
123123         if (m_display_state[y] >> x & 1)
r245325r245326
137137            output_set_digit_value(y, active_state[y] & m_display_segmask[y]);
138138
139139         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++)
141141         {
142142            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);
149159         }
150160      }
151161
r245325r245326
156166{
157167   // slowly turn off unpowered segments
158168   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++)
160170         if (m_display_decay[y][x] != 0)
161171            m_display_decay[y][x]--;
162172
r245325r245326
176186   // update current state
177187   UINT32 mask = (1 << maxx) - 1;
178188   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;
180190
181191   display_update();
182192}
trunk/src/mess/drivers/hh_tms1k.c
r245325r245326
152152   {
153153      active_state[y] = 0;
154154
155      for (int x = 0; x < m_display_maxx; x++)
155      for (int x = 0; x <= m_display_maxx; x++)
156156      {
157157         // turn on powered segments
158158         if (m_power_on && m_display_state[y] >> x & 1)
r245325r245326
172172            output_set_digit_value(y, active_state[y] & m_display_segmask[y]);
173173
174174         const int mul = (m_display_maxx <= 10) ? 10 : 100;
175         for (int x = 0; x < m_display_maxx; x++)
175         for (int x = 0; x <= m_display_maxx; x++)
176176         {
177177            int state = active_state[y] >> x & 1;
178            output_set_lamp_value(y * mul + x, state);
179
180            // bit coords for svg2lay
181            char buf[10];
182            sprintf(buf, "%d.%d", y, x);
183            output_set_value(buf, state);
178            char buf1[0x10]; // lampyx
179            char buf2[0x10]; // y.x
180           
181            if (x == m_display_maxx)
182            {
183               // always-on if selected
184               sprintf(buf1, "lamp%da", y);
185               sprintf(buf2, "%d.a", y);
186            }
187            else
188            {
189               sprintf(buf1, "lamp%d", y * mul + x);
190               sprintf(buf2, "%d.%d", y, x);
191            }
192            output_set_value(buf1, state);
193            output_set_value(buf2, state);
184194         }
185195      }
186196
r245325r245326
191201{
192202   // slowly turn off unpowered segments
193203   for (int y = 0; y < m_display_maxy; y++)
194      for (int x = 0; x < m_display_maxx; x++)
204      for (int x = 0; x <= m_display_maxx; x++)
195205         if (m_display_decay[y][x] != 0)
196206            m_display_decay[y][x]--;
197207
r245325r245326
211221   // update current state
212222   UINT32 mask = (1 << maxx) - 1;
213223   for (int y = 0; y < maxy; y++)
214      m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0;
224      m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
215225
216226   display_update();
217227}
trunk/src/mess/drivers/hh_ucom4.c
r245325r245326
6969   UINT32 m_grid;                      // VFD current row data
7070   UINT32 m_plate;                     // VFD current column data
7171
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)
7373   UINT16 m_display_segmask[0x20];     // if not 0, display matrix row is a digit, mask indicates connected segments
7474   UINT32 m_display_cache[0x20];       // (internal use)
7575   UINT8 m_display_decay[0x20][0x20];  // (internal use)
r245325r245326
162162   {
163163      active_state[y] = 0;
164164
165      for (int x = 0; x < m_display_maxx; x++)
165      for (int x = 0; x <= m_display_maxx; x++)
166166      {
167167         // turn on powered segments
168168         if (m_display_state[y] >> x & 1)
r245325r245326
182182            output_set_digit_value(y, active_state[y] & m_display_segmask[y]);
183183
184184         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++)
186186         {
187187            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);
194204         }
195205      }
196206
r245325r245326
201211{
202212   // slowly turn off unpowered segments
203213   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++)
205215         if (m_display_decay[y][x] != 0)
206216            m_display_decay[y][x]--;
207217
r245325r245326
221231   // update current state
222232   UINT32 mask = (1 << maxx) - 1;
223233   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;
225235
226236   display_update();
227237}
r245325r245326
625635   // E,F,G,H,I01: vfd matrix plate
626636   int shift = (offset - NEC_UCOM4_PORTE) * 4;
627637   m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
628   m_plate |= 1 << 18; // for always-on plates
629638
630   display_matrix(18+1, 8, m_plate, m_grid);
639   display_matrix(18, 8, m_plate, m_grid);
631640}
632641
633642
r245325r245326
839848{
840849   UINT16 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
841850   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
843851
844852   display_matrix(19, 8, plate, grid);
845853}
r245325r245326
951959      // E23,F,G,H,I: vfd matrix plate
952960      int shift = (offset - NEC_UCOM4_PORTE) * 4;
953961      m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2;
954      m_plate |= 1 << 17; // for always-on plates
955962   }
956963
957   display_matrix(17+1, 9, m_plate, m_grid);
964   display_matrix(17, 9, m_plate, m_grid);
958965}
959966
960967READ8_MEMBER(hh_ucom4_state::alnchase_input_r)
trunk/src/mess/includes/hh_tms1k.h
r245325r245326
4848   int m_display_maxy;                 // display matrix number of rows
4949   int m_display_maxx;                 // display matrix number of columns
5050
51   UINT32 m_display_state[0x20];       // display matrix rows data
51   UINT32 m_display_state[0x20];       // display matrix rows data (last bit is used for always-on)
5252   UINT16 m_display_segmask[0x20];     // if not 0, display matrix row is a digit, mask indicates connected segments
5353   UINT32 m_display_cache[0x20];       // (internal use)
5454   UINT8 m_display_decay[0x20][0x20];  // (internal use)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team