Model.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13: package xeij;
14:
15: public class Model {
16:
17:
18: public static final int CODE_X68000 = 0b00000000;
19: public static final int CODE_X68030 = 0b10000000;
20: public static final int CODE_SHODAI = 0b00000000;
21: public static final int CODE_ACE = 0b00010000;
22: public static final int CODE_EXPERT = 0b00100000;
23: public static final int CODE_PRO = 0b00110000;
24: public static final int CODE_SUPER = 0b01000000;
25: public static final int CODE_XVI = 0b01010000;
26: public static final int CODE_COMPACT = 0b01100000;
27: public static final int CODE_II = 0b00001000;
28: public static final int CODE_HD = 0b00000100;
29: public static final int CODE_OFFICE_GRAY = 0b00000000;
30: public static final int CODE_GRAY = 0b00000001;
31: public static final int CODE_TITAN_BLACK = 0b00000010;
32: public static final int CODE_BLACK = 0b00000011;
33: public static final String[] COLOR_NAMES = {
34: "Office Gray",
35: "Gray",
36: "Titan Black",
37: "Black",
38: };
39:
40:
41: public static final int MPU_MC68000 = 1;
42: public static final int MPU_MC68010 = 2;
43: public static final int MPU_MC68020 = 3;
44: public static final int MPU_MC68EC030 = 4;
45: public static final int MPU_MC68030 = 5;
46: public static final int MPU_MC68LC040 = 6;
47: public static final int MPU_MC68040 = 7;
48: public static final int MPU_MC68LC060 = 8;
49: public static final int MPU_MC68060 = 9;
50: public static final String[] MPU_NAMES = {
51: "",
52: "MC68000",
53: "MC68010",
54: "MC68020",
55: "MC68EC030",
56: "MC68030",
57: "MC68LC040",
58: "MC68040",
59: "MC68LC060",
60: "MC68060",
61: };
62:
63:
64: public static final int FPU_MC68881 = 1;
65: public static final int FPU_MC68882 = 2;
66: public static final int FPU_MC68040 = 3;
67: public static final int FPU_MC68060 = 4;
68: public static final String[] FPU_NAMES = {
69: "",
70: "MC68881",
71: "MC68882",
72: "MC68040",
73: "MC68060",
74: };
75:
76:
77:
78: public static final Model CZ_600CE = new Model ("CZ-600CE",
79: CODE_X68000 + CODE_OFFICE_GRAY,
80: false,
81: 1,
82: MPU_MC68000,
83: 10.0,
84: 100,
85: "Shodai"
86: );
87:
88: public static final Model CZ_600CB = new Model ("CZ-600CB",
89: CODE_X68000 + CODE_BLACK,
90: false,
91: 1,
92: MPU_MC68000,
93: 10.0,
94: 101,
95: null
96: );
97:
98: public static final Model CZ_601C_BK = new Model ("CZ-601C-BK",
99: CODE_X68000 + CODE_ACE + CODE_BLACK,
100: false,
101: 1,
102: MPU_MC68000,
103: 10.0,
104: 102,
105: null
106: );
107:
108: public static final Model CZ_601C_GY = new Model ("CZ-601C-GY",
109: CODE_X68000 + CODE_ACE + CODE_GRAY,
110: false,
111: 1,
112: MPU_MC68000,
113: 10.0,
114: 102,
115: "ACE"
116: );
117:
118: public static final Model CZ_611C_BK = new Model ("CZ-611C-BK",
119: CODE_X68000 + CODE_ACE + CODE_HD + CODE_BLACK,
120: false,
121: 1,
122: MPU_MC68000,
123: 10.0,
124: 102,
125: null
126: );
127:
128: public static final Model CZ_611C_GY = new Model ("CZ-611C-GY",
129: CODE_X68000 + CODE_ACE + CODE_HD + CODE_GRAY,
130: false,
131: 1,
132: MPU_MC68000,
133: 10.0,
134: 102,
135: null
136: );
137:
138: public static final Model CZ_602C_BK = new Model ("CZ-602C-BK",
139: CODE_X68000 + CODE_EXPERT + CODE_BLACK,
140: false,
141: 2,
142: MPU_MC68000,
143: 10.0,
144: 102,
145: "EXPERT"
146: );
147:
148: public static final Model CZ_602C_GY = new Model ("CZ-602C-GY",
149: CODE_X68000 + CODE_EXPERT + CODE_GRAY,
150: false,
151: 2,
152: MPU_MC68000,
153: 10.0,
154: 102,
155: null
156: );
157:
158: public static final Model CZ_612C_BK = new Model ("CZ-612C-BK",
159: CODE_X68000 + CODE_EXPERT + CODE_HD + CODE_BLACK,
160: false,
161: 2,
162: MPU_MC68000,
163: 10.0,
164: 102,
165: null
166: );
167:
168: public static final Model CZ_652C_BK = new Model ("CZ-652C-BK",
169: CODE_X68000 + CODE_PRO + CODE_BLACK,
170: false,
171: 1,
172: MPU_MC68000,
173: 10.0,
174: 102,
175: null
176: );
177:
178: public static final Model CZ_652C_GY = new Model ("CZ-652C-GY",
179: CODE_X68000 + CODE_PRO + CODE_GRAY,
180: false,
181: 1,
182: MPU_MC68000,
183: 10.0,
184: 102,
185: "PRO"
186: );
187:
188: public static final Model CZ_662C_BK = new Model ("CZ-662C-BK",
189: CODE_X68000 + CODE_PRO + CODE_HD + CODE_BLACK,
190: false,
191: 1,
192: MPU_MC68000,
193: 10.0,
194: 102,
195: null
196: );
197:
198: public static final Model CZ_662C_GY = new Model ("CZ-662C-GY",
199: CODE_X68000 + CODE_PRO + CODE_HD + CODE_GRAY,
200: false,
201: 1,
202: MPU_MC68000,
203: 10.0,
204: 102,
205: null
206: );
207:
208: public static final Model CZ_603C_BK = new Model ("CZ-603C-BK",
209: CODE_X68000 + CODE_EXPERT + CODE_II + CODE_BLACK,
210: false,
211: 2,
212: MPU_MC68000,
213: 10.0,
214: 102,
215: "EXPERTII"
216: );
217:
218: public static final Model CZ_603C_GY = new Model ("CZ-603C-GY",
219: CODE_X68000 + CODE_EXPERT + CODE_II + CODE_GRAY,
220: false,
221: 2,
222: MPU_MC68000,
223: 10.0,
224: 102,
225: null
226: );
227:
228: public static final Model CZ_613C_BK = new Model ("CZ-613C-BK",
229: CODE_X68000 + CODE_EXPERT + CODE_II + CODE_HD + CODE_BLACK,
230: false,
231: 2,
232: MPU_MC68000,
233: 10.0,
234: 102,
235: null
236: );
237:
238: public static final Model CZ_653C_BK = new Model ("CZ-653C-BK",
239: CODE_X68000 + CODE_PRO + CODE_II + CODE_BLACK,
240: false,
241: 1,
242: MPU_MC68000,
243: 10.0,
244: 102,
245: null
246: );
247:
248: public static final Model CZ_653C_GY = new Model ("CZ-653C-GY",
249: CODE_X68000 + CODE_PRO + CODE_II + CODE_GRAY,
250: false,
251: 1,
252: MPU_MC68000,
253: 10.0,
254: 102,
255: "PROII"
256: );
257:
258: public static final Model CZ_663C_BK = new Model ("CZ-663C-BK",
259: CODE_X68000 + CODE_PRO + CODE_II + CODE_HD + CODE_BLACK,
260: false,
261: 1,
262: MPU_MC68000,
263: 10.0,
264: 102,
265: null
266: );
267:
268: public static final Model CZ_663C_GY = new Model ("CZ-663C-GY",
269: CODE_X68000 + CODE_PRO + CODE_II + CODE_HD + CODE_GRAY,
270: false,
271: 1,
272: MPU_MC68000,
273: 10.0,
274: 102,
275: null
276: );
277:
278: public static final Model CZ_623C_TN = new Model ("CZ-623C-TN",
279: CODE_X68000 + CODE_SUPER + CODE_HD + CODE_TITAN_BLACK,
280: true,
281: 2,
282: MPU_MC68000,
283: 10.0,
284: 103,
285: null
286: );
287:
288: public static final Model CZ_604C_TN = new Model ("CZ-604C-TN",
289: CODE_X68000 + CODE_SUPER + CODE_TITAN_BLACK,
290: true,
291: 2,
292: MPU_MC68000,
293: 10.0,
294: 103,
295: "SUPER"
296: );
297:
298: public static final Model CZ_634C_TN = new Model ("CZ-634C-TN",
299: CODE_X68000 + CODE_XVI + CODE_TITAN_BLACK,
300: true,
301: 2,
302: MPU_MC68000,
303: 50.0 / 3.0,
304: 110,
305: "XVI"
306: );
307:
308: public static final Model CZ_644C_TN = new Model ("CZ-644C-TN",
309: CODE_X68000 + CODE_XVI + CODE_HD + CODE_TITAN_BLACK,
310: true,
311: 2,
312: MPU_MC68000,
313: 50.0 / 3.0,
314: 110,
315: null
316: );
317:
318: public static final Model CZ_674C_H = new Model ("CZ-674C-H",
319: CODE_X68000 + CODE_COMPACT + CODE_GRAY,
320: true,
321: 2,
322: MPU_MC68000,
323: 50.0 / 3.0,
324: 120,
325: "Compact"
326: );
327:
328: public static final Model CZ_500C_B = new Model ("CZ-500C-B",
329: CODE_X68030 + CODE_TITAN_BLACK,
330: true,
331: 4,
332: MPU_MC68EC030,
333: 25.0,
334: 130,
335: "X68030"
336: );
337:
338: public static final Model CZ_510C_B = new Model ("CZ-510C-B",
339: CODE_X68030 + CODE_HD + CODE_TITAN_BLACK,
340: true,
341: 4,
342: MPU_MC68EC030,
343: 25.0,
344: 130,
345: null
346: );
347:
348: public static final Model CZ_300C_B = new Model ("CZ-300C-B",
349: CODE_X68030 + CODE_COMPACT + CODE_TITAN_BLACK,
350: true,
351: 4,
352: MPU_MC68EC030,
353: 25.0,
354: 130,
355: "030Compact"
356: );
357:
358: public static final Model CZ_310C_B = new Model ("CZ-310C-B",
359: CODE_X68030 + CODE_COMPACT + CODE_HD + CODE_TITAN_BLACK,
360: true,
361: 4,
362: MPU_MC68EC030,
363: 25.0,
364: 130,
365: null
366: );
367:
368:
369: public static final Model SHODAI = CZ_600CE;
370: public static final Model ACE = CZ_601C_GY;
371: public static final Model EXPERT = CZ_602C_BK;
372: public static final Model PRO = CZ_652C_GY;
373: public static final Model EXPERTII = CZ_603C_BK;
374: public static final Model PROII = CZ_653C_GY;
375: public static final Model SUPER = CZ_604C_TN;
376: public static final Model XVI = CZ_634C_TN;
377: public static final Model COMPACT = CZ_674C_H;
378: public static final Model X68030 = CZ_500C_B;
379: public static final Model X68030COMPACT = CZ_300C_B;
380:
381:
382: public static final Model[] MODELS = {
383: CZ_600CE,
384: CZ_600CB,
385: CZ_601C_BK,
386: CZ_601C_GY,
387: CZ_611C_BK,
388: CZ_611C_GY,
389: CZ_602C_BK,
390: CZ_602C_GY,
391: CZ_612C_BK,
392: CZ_652C_BK,
393: CZ_652C_GY,
394: CZ_662C_BK,
395: CZ_662C_GY,
396: CZ_603C_BK,
397: CZ_603C_GY,
398: CZ_613C_BK,
399: CZ_653C_BK,
400: CZ_653C_GY,
401: CZ_663C_BK,
402: CZ_663C_GY,
403: CZ_623C_TN,
404: CZ_604C_TN,
405: CZ_634C_TN,
406: CZ_644C_TN,
407: CZ_674C_H,
408: CZ_500C_B,
409: CZ_510C_B,
410: CZ_300C_B,
411: CZ_310C_B,
412: };
413:
414:
415: public static Model fromTypeOrSynonym (String typeOrSynonym) {
416: for (Model model : MODELS) {
417: if (model.type.equalsIgnoreCase (typeOrSynonym) ||
418: (model.synonym != null && model.synonym.equalsIgnoreCase (typeOrSynonym))) {
419: return model;
420: }
421: }
422: return null;
423: }
424:
425:
426: public static String mpuNameOf (int mpu) {
427: return MPU_NAMES[mpu];
428: }
429:
430:
431: public static String fpuNameOf (int fpu) {
432: return FPU_NAMES[fpu];
433: }
434:
435:
436: private String type;
437: private int code;
438: private boolean scsi;
439: private int memory;
440: private int mpu;
441: private double clock;
442: private int iplrom;
443: private String synonym;
444:
445:
446: private Model (String type, int code, boolean scsi, int memory, int mpu, double clock, int iplrom, String synonym) {
447: this.type = type;
448: this.code = code;
449: this.scsi = scsi;
450: this.memory = memory;
451: this.mpu = mpu;
452: this.clock = clock;
453: this.iplrom = iplrom;
454: this.synonym = synonym;
455: }
456:
457:
458: public String getType () {
459: return type;
460: }
461:
462:
463: public int getCode () {
464: return code;
465: }
466:
467:
468: public boolean isSCSI () {
469: return scsi;
470: }
471:
472:
473: public int getMemory () {
474: return memory;
475: }
476:
477:
478: public int getMPU () {
479: return mpu;
480: }
481:
482:
483: public double getClock () {
484: return clock;
485: }
486:
487:
488: public int getIPLROM () {
489: return iplrom;
490: }
491:
492:
493: public String getSynonym () {
494: return synonym;
495: }
496:
497:
498: public String getName () {
499: StringBuilder sb = new StringBuilder ();
500: switch (code & 0b10000000) {
501: case CODE_X68000:
502: sb.append ("X68000");
503: break;
504: case CODE_X68030:
505: sb.append ("X68030");
506: break;
507: }
508: switch (code & 0b01110000) {
509: case CODE_ACE:
510: sb.append (" ACE");
511: break;
512: case CODE_EXPERT:
513: sb.append (" EXPERT");
514: break;
515: case CODE_PRO:
516: sb.append (" PRO");
517: break;
518: case CODE_SUPER:
519: sb.append (" SUPER");
520: break;
521: case CODE_XVI:
522: sb.append (" XVI");
523: break;
524: case CODE_COMPACT:
525: sb.append (" Compact");
526: break;
527: }
528: if ((code & CODE_II) != 0) {
529: sb.append ("II");
530: }
531: if ((code & CODE_HD) != 0) {
532: sb.append (" HD");
533: }
534: return sb.toString ();
535: }
536:
537:
538: public boolean isX68030 () {
539: return (code & CODE_X68030) != 0;
540: }
541:
542:
543: public boolean isShodai () {
544: return (code & 0b11110000) == CODE_X68000 + CODE_SHODAI;
545: }
546:
547:
548: public boolean isACE () {
549: return (code & 0b01110000) == CODE_ACE;
550: }
551:
552:
553: public boolean isEXPERT () {
554: return (code & 0b01110000) == CODE_EXPERT;
555: }
556:
557:
558: public boolean isPRO () {
559: return (code & 0b01110000) == CODE_PRO;
560: }
561:
562:
563: public boolean isSUPER () {
564: return (code & 0b01110000) == CODE_SUPER;
565: }
566:
567:
568: public boolean isXVI () {
569: return (code & 0b01110000) == CODE_XVI;
570: }
571:
572:
573: public boolean isCompact () {
574: return (code & 0b01110000) == CODE_COMPACT;
575: }
576:
577:
578: public int getColorCode () {
579: return code & 0b00000011;
580: }
581:
582:
583: public String getColorName () {
584: return COLOR_NAMES[code & 0b00000011];
585: }
586:
587: }