Previous 199869 Revisions Next

r26313 Wednesday 20th November, 2013 at 19:18:30 UTC by Jürgen Buchmüller
Fix CRAM read/write issues and move everything CRAM related to a2ram.c/h. Now micro code writing games work again.
[/branches/alto2/src/emu/cpu]cpu.mak
[/branches/alto2/src/emu/cpu/alto2]a2disk.c a2disk.h a2dvt.h a2dwt.h a2emu.c a2emu.h a2ether.h a2jkff.c* a2jkff.h a2ksec.h a2kwd.h a2mem.c a2mem.h a2mrt.h a2part.h a2ram.c a2ram.h alto2cpu.c alto2cpu.h
[/branches/alto2/src/mess/drivers]alto2.c

branches/alto2/src/emu/cpu/cpu.mak
r26312r26313
22772277ifneq ($(filter ALTO2,$(CPUS)),)
22782278OBJDIRS += $(CPUOBJ)/alto2
22792279CPUOBJS += $(CPUOBJ)/alto2/alto2cpu.o \
2280   $(CPUOBJ)/alto2/a2jkff.o \
22802281   $(CPUOBJ)/alto2/a2disk.o \
22812282   $(CPUOBJ)/alto2/a2disp.o \
22822283   $(CPUOBJ)/alto2/a2curt.o \
r26312r26313
23022303$(CPUOBJ)/alto2/alto2cpu.o: $(CPUSRC)/alto2/alto2cpu.c \
23032304                     $(CPUSRC)/alto2/alto2cpu.h
23042305
2306$(CPUOBJ)/alto2/a2jkff.o:   $(CPUSRC)/alto2/a2jkff.c \
2307                     $(CPUSRC)/alto2/a2jkff.h \
2308                     $(CPUSRC)/alto2/alto2cpu.h
2309
23052310$(CPUOBJ)/alto2/a2disk.o:   $(CPUSRC)/alto2/a2disk.c \
23062311                     $(CPUSRC)/alto2/a2disk.h \
23072312                     $(CPUSRC)/alto2/alto2cpu.h
branches/alto2/src/emu/cpu/alto2/a2disk.c
r26312r26313
99 *****************************************************************************/
1010#include "alto2cpu.h"
1111
12
13#define   JKFF_FUNCTION   0   //!< define 1 to debug the JK flip-flops, 0 to use a lookup table
14
1512#define   GET_KADDR_SECTOR(kaddr)         X_RDBITS(kaddr,16, 0, 3)         //!< get sector number from address register
1613#define   PUT_KADDR_SECTOR(kaddr,val)      X_WRBITS(kaddr,16, 0, 3,val)      //!< put sector number into address register
1714#define   GET_KADDR_CYLINDER(kaddr)      X_RDBITS(kaddr,16, 4,12)         //!< get cylinder number from address register
r26312r26313
9693static const char *rwc_name[4] = {"read", "check", "write", "write2"};
9794#endif
9895
99#if   ALTO2_DEBUG
100static const char* raise_lower[2] = {"↗","↘"};
101static const char* jkff_name;
102/** @brief macro to set the name of a FF in DEBUG=1 builds only */
103#define   DEBUG_NAME(x)   jkff_name = x
104#else
105#define   DEBUG_NAME(x)
106#endif
107
108#if   JKFF_FUNCTION
109
11096/**
111 * @brief simulate a 74109 J-K flip-flop with set and reset inputs
112 *
113 * @param s0 is the previous state of the FF's in- and outputs
114 * @param s1 is the next state
115 * @return returns the next state and probably modified Q output
116 */
117jkff_t alto2_cpu_device::update_jkff(UINT8 s0, UINT8 s1)
118{
119   switch (s1 & (JKFF_C | JKFF_S)) {
120   case JKFF_C | JKFF_S:   /* C' is 1, and S' is 1 */
121      if (((s0 ^ s1) & s1) & JKFF_CLK) {
122         /* rising edge of the clock */
123         switch (s1 & (JKFF_J | JKFF_K)) {
124         case 0:
125            /* both J and K' are 0: set Q to 0, Q' to 1 */
126            s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
127            if (s0 & JKFF_Q) {
128               LOG((LOG_DISK,9,"%s J:0 K':0 → Q:0\n", jkff_name));
129            }
130            break;
131         case JKFF_J:
132            /* J is 1, and K' is 0: toggle Q */
133            if (s0 & JKFF_Q)
134               s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
135            else
136               s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
137            LOG((LOG_DISK,9,"%s J:0 K':1 flip-flop Q:%d\n", jkff_name, (s1 & JKFF_Q) ? 1 : 0));
138            break;
139         case JKFF_K:
140            if ((s0 ^ s1) & JKFF_Q) {
141               LOG((LOG_DISK,9,"%s J:0 K':1 keep Q:%d\n", jkff_name, (s1 & JKFF_Q) ? 1 : 0));
142            }
143            /* J is 0, and K' is 1: keep Q as is */
144            if (s0 & JKFF_Q)
145               s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
146            else
147               s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
148            break;
149         case JKFF_J | JKFF_K:
150            /* both J and K' are 1: set Q to 1 */
151            s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
152            if (!(s0 & JKFF_Q)) {
153               LOG((LOG_DISK,9,"%s J:1 K':1 → Q:1\n", jkff_name));
154            }
155            break;
156         }
157      } else {
158         /* keep Q */
159         s1 = (s1 & ~JKFF_Q) | (s0 & JKFF_Q);
160      }
161      break;
162   case JKFF_S:
163      /* S' is 1, C' is 0: set Q to 0, Q' to 1 */
164      s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
165      if (s0 & JKFF_Q) {
166         LOG((LOG_DISK,9,"%s C':0 → Q:0\n", jkff_name));
167      }
168      break;
169   case JKFF_C:
170      /* S' is 0, C' is 1: set Q to 1, Q' to 0 */
171      s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
172      if (!(s0 & JKFF_Q)) {
173         LOG((LOG_DISK,9,"%s S':0 → Q:1\n", jkff_name));
174      }
175      break;
176   case 0:
177   default:
178      /* unstable state (what to do?) */
179      s1 = s1 | JKFF_Q | JKFF_Q0;
180      LOG((LOG_DISK,9,"%s C':0 S':0 → Q:1 and Q':1 <unstable>\n", jkff_name));
181      break;
182   }
183   return static_cast<jkff_t>(s1);
184}
185
186#else
187
188/** @brief table constructed for update_jkff(s0,s1) */
189static UINT8 jkff_lookup[64][64] = {
190   {
191      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
192      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
193      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
194      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
195      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
196      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
197      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
198      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60
199   },{
200      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
201      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
202      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
203      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
204      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
205      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
206      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
207      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61
208   },{
209      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
210      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
211      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
212      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
213      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
214      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
215      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
216      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62
217   },{
218      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
219      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
220      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
221      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
222      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
223      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
224      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
225      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63
226   },{
227      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
228      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
229      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
230      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
231      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
232      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
233      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
234      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64
235   },{
236      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
237      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
238      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
239      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
240      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
241      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
242      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
243      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65
244   },{
245      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
246      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
247      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
248      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
249      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
250      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
251      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
252      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66
253   },{
254      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
255      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
256      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
257      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
258      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
259      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
260      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
261      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67
262   },{
263      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
264      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
265      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
266      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
267      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
268      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
269      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
270      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48
271   },{
272      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
273      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
274      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
275      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
276      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
277      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
278      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
279      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49
280   },{
281      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
282      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
283      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
284      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
285      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
286      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
287      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
288      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a
289   },{
290      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
291      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
292      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
293      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
294      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
295      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
296      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
297      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b
298   },{
299      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
300      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
301      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
302      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
303      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
304      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
305      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
306      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c
307   },{
308      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
309      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
310      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
311      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
312      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
313      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
314      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
315      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d
316   },{
317      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
318      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
319      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
320      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
321      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
322      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
323      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
324      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e
325   },{
326      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
327      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
328      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
329      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
330      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
331      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
332      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
333      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f
334   },{
335      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
336      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
337      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
338      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
339      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
340      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
341      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
342      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30
343   },{
344      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
345      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
346      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
347      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
348      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
349      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
350      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
351      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31
352   },{
353      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
354      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
355      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
356      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
357      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
358      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
359      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
360      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32
361   },{
362      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
363      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
364      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
365      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
366      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
367      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
368      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
369      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33
370   },{
371      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
372      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
373      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
374      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
375      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
376      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
377      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
378      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34
379   },{
380      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
381      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
382      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
383      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
384      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
385      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
386      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
387      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35
388   },{
389      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
390      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
391      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
392      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
393      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
394      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
395      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
396      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36
397   },{
398      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
399      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
400      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
401      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
402      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
403      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
404      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
405      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37
406   },{
407      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
408      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
409      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
410      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
411      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
412      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
413      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
414      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38
415   },{
416      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
417      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
418      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
419      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
420      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
421      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
422      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
423      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39
424   },{
425      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
426      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
427      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
428      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
429      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
430      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
431      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
432      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a
433   },{
434      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
435      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
436      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
437      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
438      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
439      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
440      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
441      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b
442   },{
443      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
444      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
445      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
446      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
447      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
448      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
449      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
450      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c
451   },{
452      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
453      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
454      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
455      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
456      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
457      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
458      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
459      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d
460   },{
461      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
462      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
463      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
464      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
465      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
466      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
467      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
468      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e
469   },{
470      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
471      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
472      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
473      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
474      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
475      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
476      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
477      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f
478   },{
479      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
480      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
481      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
482      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
483      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
484      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
485      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
486      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60
487   },{
488      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
489      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
490      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
491      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
492      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
493      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
494      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
495      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61
496   },{
497      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
498      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
499      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
500      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
501      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
502      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
503      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
504      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62
505   },{
506      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
507      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
508      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
509      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
510      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
511      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
512      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
513      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63
514   },{
515      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
516      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
517      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
518      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
519      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
520      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
521      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
522      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64
523   },{
524      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
525      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
526      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
527      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
528      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
529      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
530      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
531      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65
532   },{
533      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
534      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
535      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
536      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
537      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
538      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
539      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
540      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66
541   },{
542      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
543      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
544      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
545      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
546      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
547      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
548      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
549      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67
550   },{
551      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
552      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
553      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
554      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
555      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
556      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
557      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
558      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48
559   },{
560      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
561      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
562      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
563      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
564      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
565      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
566      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
567      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49
568   },{
569      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
570      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
571      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
572      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
573      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
574      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
575      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
576      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a
577   },{
578      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
579      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
580      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
581      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
582      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
583      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
584      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
585      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b
586   },{
587      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
588      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
589      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
590      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
591      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
592      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
593      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
594      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c
595   },{
596      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
597      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
598      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
599      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
600      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
601      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
602      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
603      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d
604   },{
605      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
606      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
607      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
608      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
609      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
610      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
611      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
612      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e
613   },{
614      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
615      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
616      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
617      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
618      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
619      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
620      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
621      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f
622   },{
623      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
624      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
625      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
626      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
627      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
628      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
629      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
630      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30
631   },{
632      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
633      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
634      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
635      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
636      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
637      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
638      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
639      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31
640   },{
641      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
642      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
643      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
644      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
645      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
646      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
647      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
648      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32
649   },{
650      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
651      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
652      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
653      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
654      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
655      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
656      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
657      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33
658   },{
659      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
660      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
661      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
662      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
663      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
664      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
665      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
666      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34
667   },{
668      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
669      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
670      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
671      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
672      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
673      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
674      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
675      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35
676   },{
677      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
678      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
679      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
680      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
681      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
682      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
683      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
684      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36
685   },{
686      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
687      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
688      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
689      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
690      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
691      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
692      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
693      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37
694   },{
695      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
696      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
697      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
698      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
699      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
700      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
701      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
702      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38
703   },{
704      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
705      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
706      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
707      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
708      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
709      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
710      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
711      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39
712   },{
713      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
714      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
715      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
716      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
717      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
718      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
719      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
720      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a
721   },{
722      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
723      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
724      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
725      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
726      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
727      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
728      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
729      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b
730   },{
731      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
732      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
733      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
734      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
735      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
736      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
737      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
738      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c
739   },{
740      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
741      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
742      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
743      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
744      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
745      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
746      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
747      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d
748   },{
749      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
750      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
751      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
752      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
753      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
754      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
755      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
756      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e
757   },{
758      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
759      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
760      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
761      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
762      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
763      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
764      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
765      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f
766   }
767};
768
769jkff_t alto2_cpu_device::update_jkff(UINT8 s0, UINT8 s1)
770{
771   UINT8 result = jkff_lookup[s1 & 63][ s0 & 63];
772#if   ALTO2_DEBUG
773   LOG((LOG_DISK,9,"%s : ", jkff_name));
774   if ((s0 ^ result) & JKFF_CLK)
775      LOG((LOG_DISK,9," CLK%s", raise_lower[result & 1]));
776   if ((s0 ^ result) & JKFF_J)
777      LOG((LOG_DISK,9," J%s", raise_lower[(result >> 1) & 1]));
778   if ((s0 ^ result) & JKFF_K)
779      LOG((LOG_DISK,9," K'%s", raise_lower[(result >> 2) & 1]));
780   if ((s0 ^ result) & JKFF_S)
781      LOG((LOG_DISK,9," S'%s", raise_lower[(result >> 3) & 1]));
782   if ((s0 ^ result) & JKFF_C)
783      LOG((LOG_DISK,9," C'%s", raise_lower[(result >> 4) & 1]));
784   if ((s0 ^ result) & JKFF_Q)
785      LOG((LOG_DISK,9," Q%s", raise_lower[(result >> 5) & 1]));
786   if ((s0 ^ result) & JKFF_Q0)
787      LOG((LOG_DISK,9," Q'%s", raise_lower[(result >> 6) & 1]));
788   LOG((LOG_DISK,9,"\n"));
789#endif
790   return static_cast<jkff_t>(result);
791}
792#endif
793
794/**
79597 * <PRE>
79698 * SECTOR, ERROR WAKEUPS
79799 *
branches/alto2/src/emu/cpu/alto2/a2kwd.h
r26312r26313
4444};
4545
4646void f1_early_kwd_block();                  //!< F1 func: disable the disk word task
47void init_kwd(int task);                  //!< initialize disk word task
47void init_kwd(int task = task_kwd);            //!< initialize disk word task
4848void exit_kwd();                        //!< deinitialize disk word task
4949#endif // _A2KWD_H_
5050#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2emu.h
r26312r26313
6464void f2_late_idisp();                     //!< F2 func: branch on: arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
6565void f2_early_acsource();                  //!< F2 func: modify RSELECT with SrcAC = (3 - IR[1-2])
6666void f2_late_acsource();                  //!< F2 func: branch on arithmetic IR_SH, others PROM ctl2k_u3[IR[1-7]]
67void init_emu(int task);                  //!< 000 initialize emulator task
67void init_emu(int task = task_emu);            //!< initialize emulator task
6868void exit_emu();                        //!< deinitialize emulator task
6969#endif // _A2EMU_H_
7070#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2disk.h
r26312r26313
7474jkff_t m_sysclka1[4];            //!< simulate current sysclka
7575jkff_t m_sysclkb0[4];            //!< simulate previous sysclkb
7676jkff_t m_sysclkb1[4];            //!< simulate current sysclkb
77//! lookup JK flip-flop state change from s0 to s1
78inline jkff_t update_jkff(UINT8 s0, UINT8 s1);
7977
8078void kwd_timing(int bitclk, int datin, int block);   //!< disk word timing
8179TIMER_CALLBACK_MEMBER( disk_seclate );         //!< timer callback to take away the SECLATE pulse (monoflop)
branches/alto2/src/emu/cpu/alto2/a2dwt.h
r26312r26313
2020
2121void f1_early_dwt_block();                  //!< F1 func: block the display word task
2222void f2_late_dwt_load_ddr();               //!< F2 func: load the display data register
23void init_dwt(int task);                  //!< 011 initialize display word task
23void init_dwt(int task = task_dwt);            //!< initialize display word task
2424void exit_dwt();                        //!< deinitialize display word task
2525#endif  // _A2DWT_H_
2626#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/alto2cpu.c
r26312r26313
12581258}
12591259
12601260//! direct read access to the microcode CROM
1261#define   RD_CROM(addr) (*reinterpret_cast<UINT32 *>(m_ucode_crom + addr * 4))
1262//! direct read access to the microcode CRAM
1263#define   RD_CRAM(addr) (*reinterpret_cast<UINT32 *>(m_ucode_cram + addr * 4))
1264//! direct write access to the microcode CRAM
1265#define   WR_CRAM(addr,data) do { \
1266   *reinterpret_cast<UINT32 *>(m_ucode_cram + addr * 4) = data; \
1267} while (0)
1261#define   RD_CROM(addr) (addr < ALTO2_UCODE_RAM_BASE ? \
1262   *reinterpret_cast<UINT32 *>(m_ucode_crom + addr * 4) : \
1263   *reinterpret_cast<UINT32 *>(m_ucode_cram + (addr - ALTO2_UCODE_RAM_BASE) * 4))
12681264
1265
12691266//! read constants PROM
12701267READ16_MEMBER ( alto2_cpu_device::const_r )
12711268{
r26312r26313
21502147   }
21512148}
21522149
2153/**
2154 * @brief read the microcode ROM/RAM halfword
2155 *
2156 * Note: HALFSEL is selecting the even (0) or odd (1) half of the
2157 * microcode RAM 32-bit word. Here's how the demultiplexers (74298)
2158 * u8, u18, u28 and u38 select the bits:
2159 *
2160 *           SN74298
2161 *         +---+-+---+
2162 *         |   +-+   |
2163 *    B2  -|1      16|-  Vcc
2164 *         |         |
2165 *    A2  -|2      15|-  QA
2166 *         |         |
2167 *    A1  -|3      14|-  QB
2168 *         |         |
2169 *    B1  -|4      13|-  QC
2170 *         |         |
2171 *    C2  -|5      12|-  QD
2172 *         |         |
2173 *    D2  -|6      11|-  CLK
2174 *         |         |
2175 *    D1  -|7      10|-  SEL
2176 *         |         |
2177 *   GND  -|8       9|-  C1
2178 *         |         |
2179 *         +---------+
2180 *
2181 *   chip  out pin  BUS in   pin HSEL=0      in   pin HSEL=1
2182 *   --------------------------------------------------------------
2183 *  u8    QA  15   0   A1   3   DRSEL(0)'   A2   2   DF2(0)
2184 *  u8    QB  14   1   B1   4   DRSEL(1)'   B2   1   DF2(1)'
2185 *  u8    QC  13   2   C1   9   DRSEL(2)'   C2   5   DF2(2)'
2186 *  u8    QD  12   3   D1   7   DRSEL(3)'   D2   6   DF2(3)'
2187 *
2188 *  u18   QA  15   4   A1   3   DRSEL(4)'   A2   2   LOADT'
2189 *  u18   QB  14   5   B1   4   DALUF(0)'   B2   1   LOADL
2190 *  u18   QC  13   6   C1   9   DALUF(1)'   C2   5   NEXT(00)'
2191 *  u18   QD  12   7   D1   7   DALUF(2)'   D2   6   NEXT(01)'
2192 *
2193 *  u28   QA  15   8   A1   3   DALUF(3)'   A2   2   NEXT(02)'
2194 *  u28   QB  14   9   B1   4   DBS(0)'     B2   1   NEXT(03)'
2195 *  u28   QC  13   10  C1   9   DBS(1)'     C2   5   NEXT(04)'
2196 *  u28   QD  12   11  D1   7   DBS(2)'     D2   6   NEXT(05)'
2197 *
2198 *  u38   QA  15   12  A1   3   DF1(0)      A2   2   NEXT(06)'
2199 *  u38   QB  14   13  B1   4   DF1(1)'     B2   1   NEXT(07)'
2200 *  u38   QC  13   14  C1   9   DF1(2)'     C2   5   NEXT(08)'
2201 *  u38   QD  12   15  D1   7   DF1(3)'     D2   6   NEXT(09)'
2202 *
2203 * The HALFSEL signal to the demultiplexers is the inverted bit BUS(5):
2204 * BUS(5)=1, HALFSEL=0, A1,B1,C1,D1 inputs, upper half of the 32-bit word
2205 * BUS(5)=0, HALFSEL=1, A2,B2,C2,D2 inputs, lower half of the 32-bit word
2206 */
2207void alto2_cpu_device::rdram()
2208{
2209   UINT32 addr, val;
2210   UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr) % ALTO2_UCODE_RAM_PAGES;
2211   UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr);
2212
2213   m_rdram_flag = false;
2214   if (GET_CRAM_RAMROM(m_cram_addr)) {
2215      /* read ROM 0 at current mpc */
2216      addr = m_mpc & 01777;
2217      LOG((LOG_CPU,0,"   rdram: ROM [%05o] ", addr));
2218   } else {
2219      /* read RAM 0,1,2 */
2220      addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr;
2221      LOG((LOG_CPU,0,"   rdram: RAM%d [%04o] ", bank, wordaddr));
2222   }
2223
2224   if (ALTO2_UCODE_RAM_BASE + addr >= ALTO2_UCODE_SIZE) {
2225      val = 0177777;   /* ??? */
2226      LOG((LOG_CPU,0,"invalid address (%06o)\n", val));
2227      return;
2228   }
2229   val = RD_CRAM(addr) ^ ALTO2_UCODE_INVERTED;
2230   if (GET_CRAM_HALFSEL(m_cram_addr)) {
2231      val = val >> 16;
2232      LOG((LOG_CPU,0,"upper:%06o\n", val));
2233      printf("RD RAM%d [%04o] upper:%06o\n", bank, wordaddr, val);
2234   } else {
2235      val = val & 0177777;
2236      LOG((LOG_CPU,0,"lower:%06o\n", val));
2237      printf("RD RAM%d [%04o] lower:%06o\n", bank, wordaddr, val);
2238   }
2239   m_bus &= val;
2240}
2241
2242/**
2243 * @brief write the microcode RAM from M register and ALU
2244 *
2245 * Note: M is a latch (MYL, i.e. memory L) on the CRAM board that latches
2246 * the ALU whenever LOADL and GOODTASK are met. GOODTASK is the Emulator
2247 * task and something I have not yet found out about: TASKA' and TASKB'.
2248 *
2249 * There's also an undumped PROM u21 which is addressed by GOODTASK and
2250 * 7 other signals...
2251 */
2252void alto2_cpu_device::wrtram()
2253{
2254   UINT32 addr;
2255   UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr) % ALTO2_UCODE_RAM_PAGES;
2256   UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr);
2257
2258   m_wrtram_flag = false;
2259
2260   /* write RAM 0,1,2 */
2261   addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr;
2262   LOG((LOG_CPU,0,"   wrtram: RAM%d [%04o] upper:%06o lower:%06o", bank, wordaddr, m_m, m_alu));
2263   printf("WR RAM%d [%04o] upper:%06o lower:%06o\n", bank, wordaddr, m_m, m_alu);
2264   if (ALTO2_UCODE_RAM_BASE + addr >= ALTO2_UCODE_SIZE) {
2265      LOG((LOG_CPU,0," invalid address\n"));
2266      return;
2267   }
2268   LOG((LOG_CPU,0,"\n"));
2269   WR_CRAM(addr, ((m_m << 16) | m_alu) ^ ALTO2_UCODE_INVERTED);
2270}
2271
22722150#if   USE_ALU_74181
22732151/**
22742152 * <PRE>
r26312r26313
30952973   init_mouse();
30962974   init_hw();
30972975
3098   init_emu(task_emu);
3099   init_ksec(task_ksec);
3100   init_ether(task_ether);
3101   init_mrt(task_mrt);
3102   init_dwt(task_dwt);
3103   init_curt(task_curt);
3104   init_dht(task_dht);
3105   init_dvt(task_dvt);
3106   init_part(task_part);
3107   init_kwd(task_kwd);
2976   init_emu();
2977   init_ksec();
2978   init_ether();
2979   init_mrt();
2980   init_dwt();
2981   init_curt();
2982   init_dht();
2983   init_dvt();
2984   init_part();
2985   init_kwd();
31082986
31092987   m_dsp_time = 0;               // reset the display state timing
31102988   m_dsp_state = 020;            // initial state
branches/alto2/src/emu/cpu/alto2/alto2cpu.h
r26312r26313
4646#define   ALTO2_DEBUG             0         //!< define to 1 to enable logerror() output
4747#endif
4848
49#ifndef   ALTO2_CRAM_CONFIG
50#define   ALTO2_CRAM_CONFIG         2           //!< use default CROM/CRAM configuration 2
51#endif
52
4953#define   USE_PRIO_F9318         0         //!< define to 1 to use the F9318 priority encoder code
5054#define   USE_ALU_74181         0         //!< define to 1 to use the SN74181 ALU code
5155#define   DEBUG_DISPLAY_TIMING   0         //!< define to 1 to debug the display timing
r26312r26313
6064#define   ALTO2_F2MAX            16         //!< 16 F2 functions
6165#define   ALTO2_UCYCLE         169542      //!< time in pico seconds for a CPU micro cycle: 29.4912MHz/5 -> 5.898240Hz ~= 169.542ns/clock
6266
63#ifndef   ALTO2_CRAM_CONFIG
64#define   ALTO2_CRAM_CONFIG   2               //!< use default configuration 2
65#endif
67#define   ALTO2_CONST_SIZE      256         //!< number words in the constant ROM
6668
67#if   (ALTO2_CRAM_CONFIG==1)
68#define   ALTO2_UCODE_ROM_PAGES   1         //!< number of microcode ROM pages
69#define   ALTO2_UCODE_RAM_PAGES   1         //!< number of microcode RAM pages
70#elif (ALTO2_CRAM_CONFIG==2)
71#define   ALTO2_UCODE_ROM_PAGES   2         //!< number of microcode ROM pages
72#define   ALTO2_UCODE_RAM_PAGES   1         //!< number of microcode RAM pages
73#elif (ALTO2_CRAM_CONFIG==3)
74#define   ALTO2_UCODE_ROM_PAGES   1         //!< number of microcode ROM pages
75#define   ALTO2_UCODE_RAM_PAGES   3         //!< number of microcode RAM pages
76#else
77#error "Undefined CROM/CRAM configuration"
78#endif
79
80/**
81 * \brief number of S register banks
82 * This depends on the number of RAM pages
83 *   8 pages in 3K CRAM configuration
84 *   1 page in 1K CRAM configurations
85 */
86#if   (ALTO2_UCODE_RAM_PAGES == 3)
87#define   ALTO2_SREG_BANKS   8
88#else
89#define   ALTO2_SREG_BANKS   1
90#endif
91
92#define   ALTO2_UCODE_PAGE_SIZE   1024                  //!< number of words of microcode
93#define   ALTO2_UCODE_PAGE_MASK   (ALTO2_UCODE_PAGE_SIZE-1)   //!< mask for microcode ROM/RAM address
94#define   ALTO2_UCODE_SIZE      ((ALTO2_UCODE_ROM_PAGES + ALTO2_UCODE_RAM_PAGES) * ALTO2_UCODE_PAGE_SIZE)   //!< total number of words of microcode
95#define   ALTO2_UCODE_RAM_BASE   (ALTO2_UCODE_ROM_PAGES * ALTO2_UCODE_PAGE_SIZE)   //!< base offset for the RAM page(s)
96#define   ALTO2_CONST_SIZE      256                     //!< number words in the constant ROM
97
9869//! inverted bits in the micro instruction 32 bit word
9970#define   ALTO2_UCODE_INVERTED   ((1 << 10) | (1 << 15) | (1 << 19))
10071
r26312r26313
129100// define constants from the sub-devices
130101//*******************************************
131102#define   ALTO2_DEFINE_CONSTANTS 1
103#include "a2jkff.h"
132104#include "a2ram.h"
133105#include "a2hw.h"
134106#include "a2kbd.h"
r26312r26313
149121#include "a2kwd.h"
150122#undef ALTO2_DEFINE_CONSTANTS
151123
152#include "a2jkff.h"
153
154124class alto2_cpu_device :  public cpu_device
155125{
156126public:
r26312r26313
944914   void rdram();                           //!< read the microcode ROM/RAM halfword
945915   void wrtram();                           //!< write the microcode RAM from M register and ALU
946916
917//*******************************************
918// inline the sub-devices
919//*******************************************
920#include "a2jkff.h"
947921#include "a2ram.h"
948922#include "a2hw.h"
949923#include "a2kbd.h"
branches/alto2/src/emu/cpu/alto2/a2ether.h
r26312r26313
136136void f2_late_ecbfct();                     //!< F2 func: Ethernet countdown branch function
137137void f2_late_eisfct();                     //!< F2 func: Ethernet input start function
138138void activate_eth();                     //!< called by the CPU when the Ethernet task becomes active
139void init_ether(int task);                  //!< 007 initialize ethernet task
139void init_ether(int task = task_ether);         //!< initialize ethernet task
140140void exit_ether();                        //!< deinitialize ethernet task
141141#endif // _A2ETHER_H_
142142#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2jkff.c
r0r26313
1/*****************************************************************************
2 *
3 *   Xerox AltoII Dual J/K flip-flop 74109 emulation
4 *
5 *   Copyright © Jürgen Buchmüller <pullmoll@t-online.de>
6 *
7 *   Licenses: MAME, GPLv2
8 *
9 *****************************************************************************/
10#include "alto2cpu.h"
11
12#if   JKFF_FUNCTION
13
14/**
15 * @brief simulate a 74109 J-K flip-flop with set and reset inputs
16 *
17 * @param s0 is the previous state of the FF's in- and outputs
18 * @param s1 is the next state
19 * @return returns the next state and probably modified Q output
20 */
21jkff_t alto2_cpu_device::update_jkff(UINT8 s0, UINT8 s1)
22{
23   switch (s1 & (JKFF_C | JKFF_S))
24   {
25   case JKFF_C | JKFF_S:   /* C' is 1, and S' is 1 */
26      if (((s0 ^ s1) & s1) & JKFF_CLK) {
27         /* rising edge of the clock */
28         switch (s1 & (JKFF_J | JKFF_K))
29         {
30         case 0:
31            /* both J and K' are 0: set Q to 0, Q' to 1 */
32            s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
33            if (s0 & JKFF_Q) {
34               LOG((LOG_DISK,9,"%s J:0 K':0 → Q:0\n", jkff_name));
35            }
36            break;
37         case JKFF_J:
38            /* J is 1, and K' is 0: toggle Q */
39            if (s0 & JKFF_Q)
40               s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
41            else
42               s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
43            LOG((LOG_DISK,9,"%s J:0 K':1 flip-flop Q:%d\n", jkff_name, (s1 & JKFF_Q) ? 1 : 0));
44            break;
45         case JKFF_K:
46            if ((s0 ^ s1) & JKFF_Q) {
47               LOG((LOG_DISK,9,"%s J:0 K':1 keep Q:%d\n", jkff_name, (s1 & JKFF_Q) ? 1 : 0));
48            }
49            /* J is 0, and K' is 1: keep Q as is */
50            if (s0 & JKFF_Q)
51               s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
52            else
53               s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
54            break;
55         case JKFF_J | JKFF_K:
56            /* both J and K' are 1: set Q to 1 */
57            s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
58            if (!(s0 & JKFF_Q)) {
59               LOG((LOG_DISK,9,"%s J:1 K':1 → Q:1\n", jkff_name));
60            }
61            break;
62         }
63      } else {
64         /* keep Q */
65         s1 = (s1 & ~JKFF_Q) | (s0 & JKFF_Q);
66      }
67      break;
68   case JKFF_S:
69      /* S' is 1, C' is 0: set Q to 0, Q' to 1 */
70      s1 = (s1 & ~JKFF_Q) | JKFF_Q0;
71      if (s0 & JKFF_Q) {
72         LOG((LOG_DISK,9,"%s C':0 → Q:0\n", jkff_name));
73      }
74      break;
75   case JKFF_C:
76      /* S' is 0, C' is 1: set Q to 1, Q' to 0 */
77      s1 = (s1 | JKFF_Q) & ~JKFF_Q0;
78      if (!(s0 & JKFF_Q)) {
79         LOG((LOG_DISK,9,"%s S':0 → Q:1\n", jkff_name));
80      }
81      break;
82   case 0:
83   default:
84      /* unstable state (what to do?) */
85      s1 = s1 | JKFF_Q | JKFF_Q0;
86      LOG((LOG_DISK,9,"%s C':0 S':0 → Q:1 and Q':1 <unstable>\n", jkff_name));
87      break;
88   }
89   return static_cast<jkff_t>(s1);
90}
91
92#else
93
94/** @brief table constructed for update_jkff(s0,s1) */
95static UINT8 jkff_lookup[64][64] = {
96   {
97      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
98      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
99      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
100      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
101      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
102      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
103      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
104      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60
105   },{
106      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
107      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
108      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
109      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
110      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
111      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
112      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
113      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61
114   },{
115      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
116      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
117      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
118      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
119      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
120      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
121      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
122      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62
123   },{
124      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
125      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
126      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
127      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
128      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
129      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
130      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
131      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63
132   },{
133      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
134      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
135      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
136      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
137      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
138      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
139      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
140      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64
141   },{
142      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
143      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
144      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
145      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
146      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
147      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
148      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
149      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65
150   },{
151      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
152      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
153      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
154      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
155      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
156      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
157      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
158      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66
159   },{
160      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
161      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
162      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
163      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
164      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
165      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
166      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
167      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67
168   },{
169      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
170      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
171      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
172      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
173      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
174      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
175      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
176      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48
177   },{
178      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
179      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
180      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
181      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
182      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
183      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
184      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
185      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49
186   },{
187      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
188      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
189      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
190      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
191      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
192      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
193      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
194      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a
195   },{
196      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
197      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
198      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
199      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
200      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
201      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
202      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
203      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b
204   },{
205      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
206      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
207      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
208      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
209      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
210      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
211      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
212      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c
213   },{
214      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
215      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
216      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
217      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
218      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
219      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
220      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
221      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d
222   },{
223      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
224      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
225      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
226      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
227      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
228      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
229      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
230      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e
231   },{
232      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
233      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
234      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
235      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
236      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
237      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
238      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
239      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f
240   },{
241      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
242      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
243      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
244      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
245      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
246      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
247      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
248      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30
249   },{
250      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
251      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
252      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
253      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
254      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
255      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
256      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
257      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31
258   },{
259      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
260      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
261      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
262      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
263      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
264      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
265      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
266      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32
267   },{
268      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
269      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
270      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
271      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
272      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
273      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
274      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
275      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33
276   },{
277      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
278      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
279      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
280      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
281      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
282      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
283      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
284      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34
285   },{
286      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
287      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
288      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
289      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
290      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
291      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
292      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
293      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35
294   },{
295      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
296      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
297      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
298      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
299      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
300      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
301      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
302      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36
303   },{
304      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
305      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
306      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
307      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
308      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
309      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
310      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
311      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37
312   },{
313      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
314      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
315      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
316      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
317      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
318      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
319      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
320      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38
321   },{
322      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
323      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
324      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
325      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
326      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
327      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
328      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
329      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39
330   },{
331      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
332      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
333      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
334      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
335      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
336      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
337      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
338      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a
339   },{
340      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
341      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
342      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
343      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
344      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
345      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
346      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
347      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b
348   },{
349      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
350      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
351      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
352      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
353      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
354      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
355      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
356      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c
357   },{
358      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
359      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
360      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
361      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
362      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
363      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
364      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
365      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d
366   },{
367      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
368      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
369      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
370      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
371      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
372      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
373      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
374      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e
375   },{
376      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
377      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
378      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
379      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
380      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
381      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
382      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
383      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f
384   },{
385      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
386      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
387      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
388      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
389      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
390      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
391      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
392      0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60
393   },{
394      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
395      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
396      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
397      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
398      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
399      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
400      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,
401      0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61
402   },{
403      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
404      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
405      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
406      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
407      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
408      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
409      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,
410      0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62
411   },{
412      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
413      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
414      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
415      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
416      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
417      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
418      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
419      0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63
420   },{
421      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
422      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
423      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
424      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
425      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
426      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
427      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,
428      0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64
429   },{
430      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
431      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
432      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
433      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
434      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
435      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
436      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65,
437      0x65,0x65,0x65,0x65,0x65,0x65,0x65,0x65
438   },{
439      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
440      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
441      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
442      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
443      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
444      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
445      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,
446      0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66
447   },{
448      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
449      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
450      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
451      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
452      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
453      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
454      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,
455      0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67
456   },{
457      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
458      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
459      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
460      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
461      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
462      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
463      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,
464      0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48
465   },{
466      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
467      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
468      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
469      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
470      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
471      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
472      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,
473      0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49
474   },{
475      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
476      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
477      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
478      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
479      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
480      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
481      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
482      0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a
483   },{
484      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
485      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
486      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
487      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
488      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
489      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
490      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,
491      0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b
492   },{
493      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
494      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
495      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
496      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
497      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
498      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
499      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,
500      0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c,0x4c
501   },{
502      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
503      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
504      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
505      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
506      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
507      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
508      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,
509      0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d
510   },{
511      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
512      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
513      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
514      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
515      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
516      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
517      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,
518      0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e,0x4e
519   },{
520      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
521      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
522      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
523      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
524      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
525      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
526      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,
527      0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f,0x4f
528   },{
529      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
530      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
531      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
532      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
533      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
534      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
535      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
536      0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30
537   },{
538      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
539      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
540      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
541      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
542      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
543      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
544      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,
545      0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31
546   },{
547      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
548      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
549      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
550      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
551      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
552      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
553      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,
554      0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32
555   },{
556      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
557      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
558      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
559      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
560      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
561      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
562      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
563      0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33
564   },{
565      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
566      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
567      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
568      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
569      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
570      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
571      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34,
572      0x34,0x34,0x34,0x34,0x34,0x34,0x34,0x34
573   },{
574      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
575      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
576      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
577      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
578      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
579      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
580      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
581      0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35
582   },{
583      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
584      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
585      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
586      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
587      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
588      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
589      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
590      0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36
591   },{
592      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
593      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
594      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
595      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
596      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
597      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
598      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
599      0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37
600   },{
601      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
602      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
603      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
604      0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
605      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
606      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
607      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
608      0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38
609   },{
610      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
611      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
612      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
613      0x59,0x19,0x59,0x19,0x59,0x19,0x59,0x19,
614      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
615      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
616      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39,
617      0x59,0x39,0x59,0x39,0x59,0x39,0x59,0x39
618   },{
619      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
620      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
621      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
622      0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,
623      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
624      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
625      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,
626      0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a,0x3a
627   },{
628      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
629      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
630      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
631      0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,0x3b,0x1b,
632      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
633      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
634      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,
635      0x5b,0x3b,0x5b,0x3b,0x5b,0x3b,0x5b,0x3b
636   },{
637      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
638      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
639      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
640      0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,
641      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
642      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
643      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
644      0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c
645   },{
646      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
647      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
648      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
649      0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,0x5d,0x1d,
650      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
651      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
652      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,
653      0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d,0x3d
654   },{
655      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
656      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
657      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
658      0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
659      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
660      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
661      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,
662      0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e
663   },{
664      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
665      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
666      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
667      0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,0x3f,0x1f,
668      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
669      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
670      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
671      0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f
672   }
673};
674
675jkff_t alto2_cpu_device::update_jkff(UINT8 s0, UINT8 s1)
676{
677   UINT8 result = jkff_lookup[s1 & 63][s0 & 63];
678#if   ALTO2_DEBUG
679   LOG((LOG_DISK,9,"%s : ", jkff_name));
680   if ((s0 ^ result) & JKFF_CLK)
681      LOG((LOG_DISK,9," CLK%s", raise_lower[result & 1]));
682   if ((s0 ^ result) & JKFF_J)
683      LOG((LOG_DISK,9," J%s", raise_lower[(result >> 1) & 1]));
684   if ((s0 ^ result) & JKFF_K)
685      LOG((LOG_DISK,9," K'%s", raise_lower[(result >> 2) & 1]));
686   if ((s0 ^ result) & JKFF_S)
687      LOG((LOG_DISK,9," S'%s", raise_lower[(result >> 3) & 1]));
688   if ((s0 ^ result) & JKFF_C)
689      LOG((LOG_DISK,9," C'%s", raise_lower[(result >> 4) & 1]));
690   if ((s0 ^ result) & JKFF_Q)
691      LOG((LOG_DISK,9," Q%s", raise_lower[(result >> 5) & 1]));
692   if ((s0 ^ result) & JKFF_Q0)
693      LOG((LOG_DISK,9," Q'%s", raise_lower[(result >> 6) & 1]));
694   LOG((LOG_DISK,9,"\n"));
695#endif
696   return static_cast<jkff_t>(result);
697}
698#endif
699
Property changes on: branches/alto2/src/emu/cpu/alto2/a2jkff.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
branches/alto2/src/emu/cpu/alto2/a2jkff.h
r26312r26313
77 *   Licenses: MAME, GPLv2
88 *
99 *****************************************************************************/
10#ifndef _A2JKFF_H_
11#define _A2JKFF_H_
10#ifdef  ALTO2_DEFINE_CONSTANTS
1211
12#define   JKFF_FUNCTION   0   //!< define 1 to debug the JK flip-flops, 0 to use a lookup table
13
1314/**
1415 * @brief enumeration of the inputs and outputs of a JK flip-flop type 74109
1516 * <PRE>
r26312r26313
4344   JKFF_Q0      = (1 << 6)   //!< Q' output
4445}   jkff_t;
4546
46#endif // A2JKFF_H
47#if   ALTO2_DEBUG
48static const char* raise_lower[2] = {"↗","↘"};
49static const char* jkff_name;
50/** @brief macro to set the name of a FF in DEBUG=1 builds only */
51#define   DEBUG_NAME(x)   jkff_name = x
52#else
53#define   DEBUG_NAME(x)
54#endif
55
56#else   // ALTO2_DEFINE_CONSTANTS
57
58#ifndef _A2JKFF_H_
59#define _A2JKFF_H_
60
61static jkff_t update_jkff(UINT8 s0, UINT8 s1);   //!< simulate a 74109 J-K flip-flop with set and reset inputs
62
63#endif   // _A2JKFF_H_
64#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2ksec.h
r26312r26313
4343};
4444
4545void f1_early_ksec_block(void);                 //!< block ksec task
46void init_ksec(int task);                  //!< 004 initialize disk sector task
47void exit_ksec();
46void init_ksec(int task = task_ksec);         //!< initialize disk sector task
47void exit_ksec();                        //!< deinitialize disk sector task
4848#endif // _A2KSEC_H_
4949#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2dvt.h
r26312r26313
2020
2121void f1_early_dvt_block();                  //!< F1 func: disable the display word task
2222void activate_dvt();                     //!< called by the CPU when the display vertical task becomes active
23void init_dvt(int task);                  //!< 014 initialize display vertical task
23void init_dvt(int task = task_dvt);            //!< initialize display vertical task
2424void exit_dvt();                        //!< deinitialize display vertical task
2525#endif  // _A2DVT_H_
2626#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2mrt.h
r26312r26313
1414#define _A2MRT_H_
1515void f1_early_mrt_block();                  //!< F1 func: block the display word task
1616void activate_mrt();                     //!< called by the CPU when MRT becomes active
17void init_mrt(int task);                  //!< 010 initialize memory refresh task
17void init_mrt(int task = task_mrt);            //!< initialize memory refresh task
1818void exit_mrt();                        //!< deinitialize memory refresh task
1919#endif // _A2MRT_H_
2020#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2part.h
r26312r26313
1313#ifndef _A2PART_H_
1414#define _A2PART_H_
1515void activate_part();
16void init_part(int task);                  //!< 015 initialize parity task
16void init_part(int task = task_part);         //!< initialize parity task
1717void exit_part();                        //!< deinitialize parity task
1818#endif // _A2PART_H_
1919#endif   // ALTO2_DEFINE_CONSTANTS
branches/alto2/src/emu/cpu/alto2/a2mem.c
r26312r26313
612612       * currently we don't do anything special
613613       */
614614      LOG((LOG_MEM,5, "   MAR←; refresh cycle @ %#o\n", addr));
615   } else if (addr < ALTO2_RAM_SIZE) {
615      return;
616   }
617
618   m_mem.mar = addr;
619   if (addr < m_mem.size) {
616620      LOG((LOG_MEM,2, "   MAR←; mar = %#o\n", addr));
617621      m_mem.access = ALTO2_MEM_RAM;
618      m_mem.mar = addr;
619622      /* fetch memory double-word to read/write latches */
620623      m_mem.rmdd = m_mem.wmdd = m_mem.ram[m_mem.mar/2];
621624      m_mem.cycle = cycle();
622625   } else {
623626      m_mem.access = ALTO2_MEM_NIRVANA;
624      m_mem.mar = addr;
625627      m_mem.rmdd = m_mem.wmdd = ~0;
626628   }
627629}
r26312r26313
647649   }
648650
649651   base_addr = m_mem.mar & 0177777;
650   if (base_addr >= ALTO2_IO_PAGE_BASE) {
652   if (base_addr >= ALTO2_IO_PAGE_BASE && m_mem.mar < ALTO2_RAM_SIZE) {
651653      m_mem.md = m_iomem->read_word(m_iomem->address_to_byte(base_addr));
652654      LOG((LOG_MEM,6,"   MD = MMIO[%#o] (%#o)\n", base_addr, m_mem.md));
653655      m_mem.access = ALTO2_MEM_NONE;
r26312r26313
701703   }
702704
703705   base_addr = m_mem.mar & 0177777;
704   if (base_addr >= ALTO2_IO_PAGE_BASE) {
706   if (base_addr >= ALTO2_IO_PAGE_BASE && m_mem.mar < ALTO2_RAM_SIZE) {
705707      m_iomem->write_word(m_iomem->address_to_byte(base_addr), m_mem.md);
706708      LOG((LOG_MEM,6, "   MMIO[%#o] = MD (%#o)\n", base_addr, m_mem.md));
707709      m_mem.access = ALTO2_MEM_NONE;
r26312r26313
744746{
745747   int base_addr = addr & 0177777;
746748   int data = 0177777;
747   if (base_addr >= ALTO2_IO_PAGE_BASE) {
749   if (base_addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
748750      data = m_iomem->read_word(m_iomem->address_to_byte(base_addr));
749751   } else {
750752      data = (addr & ALTO2_MEM_ODD) ? GET_ODD(m_mem.ram[addr/2]) : GET_EVEN(m_mem.ram[addr/2]);
r26312r26313
761763void alto2_cpu_device::debug_write_mem(UINT32 addr, UINT16 data)
762764{
763765   int base_addr = addr & 0177777;
764   if (base_addr >= ALTO2_IO_PAGE_BASE) {
766   if (base_addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) {
765767      m_iomem->write_word(m_iomem->address_to_byte(base_addr), data);
766768   } else if (addr & ALTO2_MEM_ODD) {
767769      PUT_ODD(m_mem.ram[addr/2], data);
r26312r26313
780782 */
781783void alto2_cpu_device::init_memory()
782784{
783   memset(&m_mem, 0, sizeof(m_mem));
785    memset(&m_mem, 0, sizeof(m_mem));
784786
785   // allocate 128KB of main memory
786   m_mem.ram = auto_alloc_array(machine(), UINT32, sizeof(UINT16)*ALTO2_RAM_SIZE);
787   memset(m_mem.ram, 0, sizeof(UINT32)*sizeof(UINT16)*ALTO2_RAM_SIZE);
788   m_mem.hpb = auto_alloc_array(machine(), UINT8,  sizeof(UINT16)*ALTO2_RAM_SIZE);
789   memset(m_mem.hpb, 0, sizeof(UINT8)*sizeof(UINT16)*ALTO2_RAM_SIZE);
787#if   0   // can't read ioport() at this time
788   // allocate 64KB or 128KB of main memory
789   m_mem.size = ioport("CONFIG")->read() & 1 ? ALTO2_RAM_SIZE : 2 * ALTO2_RAM_SIZE;
790#else
791   m_mem.size = 2 * ALTO2_RAM_SIZE;
792#endif
793   printf("main memory %u KB\n", m_mem.size / 1024);
794   m_mem.ram = auto_alloc_array_clear(machine(), UINT32, sizeof(UINT16) * m_mem.size);
795   m_mem.hpb = auto_alloc_array_clear(machine(), UINT8,  sizeof(UINT16) * m_mem.size);
790796
791797   /**
792798    * <PRE>
r26312r26313
845851
846852void alto2_cpu_device::exit_memory()
847853{
848   // nothing to do yet
854   if (m_mem.ram) {
855      auto_free(machine(), m_mem.ram);
856      m_mem.ram = 0;
857   }
858   if (m_mem.hpb) {
859      auto_free(machine(), m_mem.hpb);
860      m_mem.hpb = 0;
861   }
849862}
branches/alto2/src/emu/cpu/alto2/a2ram.c
r26312r26313
99 *****************************************************************************/
1010#include "alto2cpu.h"
1111
12#define DEBUG_WRTRAM        0       //!< define to 1 to printf disassembled CRAM writes
13
14//! direct read access to the microcode CRAM
15#define   RD_CRAM(addr) (*reinterpret_cast<UINT32 *>(m_ucode_cram + addr * 4))
16
17//! direct write access to the microcode CRAM
18#define   WR_CRAM(addr,data) do { \
19    *reinterpret_cast<UINT32 *>(m_ucode_cram + addr * 4) = data; \
20} while (0)
21
1222/**
23 * @brief read the microcode ROM/RAM halfword
24 *
25 * Note: HALFSEL is selecting the even (0) or odd (1) half of the
26 * microcode RAM 32-bit word. Here's how the demultiplexers (74298)
27 * u8, u18, u28 and u38 select the bits:
28 *
29 *           SN74298
30 *         +---+-+---+
31 *         |   +-+   |
32 *    B2  -|1      16|-  Vcc
33 *         |         |
34 *    A2  -|2      15|-  QA
35 *         |         |
36 *    A1  -|3      14|-  QB
37 *         |         |
38 *    B1  -|4      13|-  QC
39 *         |         |
40 *    C2  -|5      12|-  QD
41 *         |         |
42 *    D2  -|6      11|-  CLK
43 *         |         |
44 *    D1  -|7      10|-  SEL
45 *         |         |
46 *   GND  -|8       9|-  C1
47 *         |         |
48 *         +---------+
49 *
50 *   chip  out pin  BUS in   pin HSEL=0      in   pin HSEL=1
51 *   --------------------------------------------------------------
52 *  u8    QA  15   0   A1   3   DRSEL(0)'   A2   2   DF2(0)
53 *  u8    QB  14   1   B1   4   DRSEL(1)'   B2   1   DF2(1)'
54 *  u8    QC  13   2   C1   9   DRSEL(2)'   C2   5   DF2(2)'
55 *  u8    QD  12   3   D1   7   DRSEL(3)'   D2   6   DF2(3)'
56 *
57 *  u18   QA  15   4   A1   3   DRSEL(4)'   A2   2   LOADT'
58 *  u18   QB  14   5   B1   4   DALUF(0)'   B2   1   LOADL
59 *  u18   QC  13   6   C1   9   DALUF(1)'   C2   5   NEXT(00)'
60 *  u18   QD  12   7   D1   7   DALUF(2)'   D2   6   NEXT(01)'
61 *
62 *  u28   QA  15   8   A1   3   DALUF(3)'   A2   2   NEXT(02)'
63 *  u28   QB  14   9   B1   4   DBS(0)'     B2   1   NEXT(03)'
64 *  u28   QC  13   10  C1   9   DBS(1)'     C2   5   NEXT(04)'
65 *  u28   QD  12   11  D1   7   DBS(2)'     D2   6   NEXT(05)'
66 *
67 *  u38   QA  15   12  A1   3   DF1(0)      A2   2   NEXT(06)'
68 *  u38   QB  14   13  B1   4   DF1(1)'     B2   1   NEXT(07)'
69 *  u38   QC  13   14  C1   9   DF1(2)'     C2   5   NEXT(08)'
70 *  u38   QD  12   15  D1   7   DF1(3)'     D2   6   NEXT(09)'
71 *
72 * The HALFSEL signal to the demultiplexers is the inverted bit BUS(5):
73 * BUS(5)=1, HALFSEL=0, A1,B1,C1,D1 inputs, upper half of the 32-bit word
74 * BUS(5)=0, HALFSEL=1, A2,B2,C2,D2 inputs, lower half of the 32-bit word
75 */
76void alto2_cpu_device::rdram()
77{
78   UINT32 addr, value;
79   UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr);
80   UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr);
81
82   if (GET_CRAM_RAMROM(m_cram_addr)) {
83      /* read CROM 0 at current mpc */
84      addr = m_mpc & ALTO2_UCODE_PAGE_MASK;
85      LOG((LOG_CPU,0,"   rdram: ROM [%05o] ", addr));
86   } else {
87      /* read CRAM[bank] */
88      addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr;
89      LOG((LOG_CPU,0,"   rdram: RAM%d [%04o] ", bank, wordaddr));
90   }
91
92   m_rdram_flag = false;
93   if (ALTO2_UCODE_RAM_BASE + addr >= ALTO2_UCODE_SIZE) {
94      value = 0177777;   /* ??? */
95      LOG((LOG_CPU,0,"invalid address (%06o)\n", addr));
96      return;
97   }
98   value = RD_CRAM(addr) ^ ALTO2_UCODE_INVERTED;
99   if (GET_CRAM_HALFSEL(m_cram_addr)) {
100      value = value >> 16;
101      LOG((LOG_CPU,0,"upper:%06o\n", value & 0177777));
102   } else {
103      LOG((LOG_CPU,0,"lower:%06o\n", value & 0177777));
104   }
105   m_bus &= value;
106}
107
108/**
109 * @brief write the microcode RAM from M register and ALU
110 *
111 * Note: M is a latch (MYL, i.e. memory L) on the CRAM board that latches
112 * the ALU whenever LOADL and GOODTASK are met. GOODTASK is the Emulator
113 * task and something I have not yet found out about: TASKA' and TASKB'.
114 *
115 * There's also an undumped PROM u21 which is addressed by GOODTASK and
116 * 7 other signals...
117 */
118void alto2_cpu_device::wrtram()
119{
120   UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr);
121   UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr);
122   UINT32 value = ((m_m << 16) | m_alu) ^ ALTO2_UCODE_INVERTED;
123
124   UINT32 addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr;   // write RAM 0,1,2
125   LOG((LOG_CPU,0,"   wrtram: RAM%d [%04o] upper:%06o lower:%06o", bank, wordaddr, m_m, m_alu));
126
127#if   DEBUG_WRTRAM
128   char buff[128];
129   UINT8 oprom[4];
130   oprom[0] = m_m / 256;
131   oprom[1] = m_m % 256;
132   oprom[2] = m_m / 256;
133   oprom[3] = m_m % 256;
134   disasm_disassemble(buff, addr, oprom, oprom, 0);
135   printf("WR CRAM_BANKSEL=%d RAM%d [%04o] upper:%06o lower:%06o *** %s\n",
136         GET_CRAM_BANKSEL(m_cram_addr), bank, wordaddr, m_m, m_alu, buff);
137#endif
138
139   m_wrtram_flag = false;
140   if (ALTO2_UCODE_RAM_BASE + addr >= ALTO2_UCODE_SIZE) {
141      LOG((LOG_CPU,0," invalid address %06o\n", addr));
142      return;
143   }
144   LOG((LOG_CPU,0,"\n"));
145   WR_CRAM(addr, value);
146}
147
148/**
13149 * @brief bs_read_sreg early: drive bus by S register or M (MYL), if rsel is = 0
14150 *
15151 * Note: RSEL == 0 can't be read, because it is decoded as
r26312r26313
284420   set_f1(task, f1_ram_wrtram,         0, &alto2_cpu_device::f1_late_wrtram);
285421   set_f1(task, f1_ram_rdram,         0, &alto2_cpu_device::f1_late_rdram);
286422#if   (ALTO2_UCODE_RAM_PAGES == 3)
287   set_f1(task, f1_ram_load_rmr,      0, &alto2_cpu_device::f1_load_rmr_1);
423   set_f1(task, f1_ram_load_rmr,      0, &alto2_cpu_device::f1_late_load_rmr);
288424#else   // ALTO2_UCODE_RAM_PAGES != 3
289425   set_f1(task, f1_ram_load_srb,      0, &alto2_cpu_device::f1_late_load_srb);
290426#endif
branches/alto2/src/emu/cpu/alto2/a2mem.h
r26312r26313
1919//! memory access mode
2020enum {
2121   ALTO2_MEM_NONE,
22   ALTO2_MEM_ODD   = (1 << 0),
23   ALTO2_MEM_RAM   = (1 << 1),
22   ALTO2_MEM_ODD      = (1 << 0),
23   ALTO2_MEM_RAM      = (1 << 1),
2424   ALTO2_MEM_NIRVANA   = (1 << 2)
2525};
2626
2727struct {
28   UINT32 size;                  //!< main memory size (64K or 128K)
2829   UINT32* ram;                  //!< main memory organized as double-words
2930   UINT8* hpb;                     //!< Hamming Code bits (6) and Parity bits (1) per double word
3031   UINT32 mar;                     //!< memory address register
r26312r26313
4445    */
4546   int access;
4647   int error;                     //!< non-zero after a memory error was detected
47   int mear;                     //!< memory error address register
48   UINT32 mear;                  //!< memory error address register
4849   UINT16 mesr;                  //!< memory error status register
4950   UINT16 mecr;                  //!< memory error control register
5051}   m_mem;
r26312r26313
103104    return cycle() < m_mem.cycle+2;
104105}
105106
106//! memory error address register read
107DECLARE_READ16_MEMBER( mear_r );
108107
109//! memory error status register read
110DECLARE_READ16_MEMBER( mesr_r );
108DECLARE_READ16_MEMBER ( mear_r );       //!< memory error address register read
109DECLARE_READ16_MEMBER ( mesr_r );       //!< memory error status register read
110DECLARE_WRITE16_MEMBER( mesr_w );       //!< memory error status register write (clear)
111DECLARE_READ16_MEMBER ( mecr_r );       //!< memory error control register read
112DECLARE_WRITE16_MEMBER( mecr_w );       //!< memory error control register write
111113
112//! memory error status register write (clear)
113DECLARE_WRITE16_MEMBER( mesr_w );
114
115//! memory error control register read
116DECLARE_READ16_MEMBER( mecr_r );
117
118//! memory error control register write
119DECLARE_WRITE16_MEMBER( mecr_w );
120
121114//! read or write a memory double-word and caluclate its Hamming code
122115UINT32 hamming_code(int write, UINT32 dw_addr, UINT32 dw_data);
123116
branches/alto2/src/emu/cpu/alto2/a2ram.h
r26312r26313
99 *****************************************************************************/
1010#ifdef  ALTO2_DEFINE_CONSTANTS
1111
12#if   (ALTO2_CRAM_CONFIG==1)
13#define   ALTO2_UCODE_ROM_PAGES   1         //!< number of microcode ROM pages
14#define   ALTO2_UCODE_RAM_PAGES   1         //!< number of microcode RAM pages
15#elif (ALTO2_CRAM_CONFIG==2)
16#define   ALTO2_UCODE_ROM_PAGES   2         //!< number of microcode ROM pages
17#define   ALTO2_UCODE_RAM_PAGES   1         //!< number of microcode RAM pages
18#elif (ALTO2_CRAM_CONFIG==3)
19#define   ALTO2_UCODE_ROM_PAGES   1         //!< number of microcode ROM pages
20#define   ALTO2_UCODE_RAM_PAGES   3         //!< number of microcode RAM pages
21#else
22#error "Undefined CROM/CRAM configuration"
23#endif
24
25/**
26 * \brief number of S register banks
27 * This depends on the number of RAM pages
28 *   8 pages in 3K CRAM configuration
29 *   1 page in 1K CRAM configurations
30 */
31#if   (ALTO2_UCODE_RAM_PAGES == 3)
32#define   ALTO2_SREG_BANKS   8
33#else
34#define   ALTO2_SREG_BANKS   1
35#endif
36
37#define   ALTO2_UCODE_PAGE_SIZE   02000                  //!< number of words of microcode
38#define   ALTO2_UCODE_PAGE_MASK   (ALTO2_UCODE_PAGE_SIZE-1)   //!< mask for microcode ROM/RAM address
39#define   ALTO2_UCODE_SIZE      ((ALTO2_UCODE_ROM_PAGES + ALTO2_UCODE_RAM_PAGES) * ALTO2_UCODE_PAGE_SIZE)   //!< total number of words of microcode
40#define   ALTO2_UCODE_RAM_BASE   (ALTO2_UCODE_ROM_PAGES * ALTO2_UCODE_PAGE_SIZE)   //!< base offset for the RAM page(s)
41
1242#else   // ALTO2_DEFINE_CONSTANTS
1343#ifndef _A2RAM_H_
1444#define _A2RAM_H_
branches/alto2/src/emu/cpu/alto2/a2emu.c
r26312r26313
687687   set_f1(task, f1_emu_wrtram,         0, &alto2_cpu_device::f1_late_wrtram);
688688   set_f1(task, f1_emu_rdram,         0, &alto2_cpu_device::f1_late_rdram);
689689   set_f1(task, f1_emu_load_rmr,      0, &alto2_cpu_device::f1_late_emu_load_rmr);
690   /* F1 014 is undefined (?) */
691   set_f1(task, f1_task_14,         0, &alto2_cpu_device::f1_late_load_srb);
690   set_f1(task, f1_task_14,         0, 0);                              // F1 014 is undefined (?)
692691   set_f1(task, f1_emu_load_esrb,      0, &alto2_cpu_device::f1_late_emu_load_esrb);
693692   set_f1(task, f1_emu_rsnf,         &alto2_cpu_device::f1_early_rsnf, 0);
694693   set_f1(task, f1_emu_startf,         &alto2_cpu_device::f1_early_startf,   0);
branches/alto2/src/mess/drivers/alto2.c
r26312r26313
113113   PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(50) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CHANGED_MEMBER( ":maincpu", alto2_cpu_device, mouse_motion_y, 0 )
114114
115115   PORT_START("CONFIG")    /* Memory switch on AIM board */
116   PORT_CONFNAME( 1<<9, 1<<9, "Memory switch")
117   PORT_CONFSETTING( 0,    "on")
118   PORT_CONFSETTING( 1<<9, "off")
116   PORT_CONFNAME( 1, 1, "Memory switch")
117   PORT_CONFSETTING( 0, "on")
118   PORT_CONFSETTING( 1, "off")
119119INPUT_PORTS_END
120120
121121/* ROM */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team