CRTC.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414: package xeij;
415:
416: import java.lang.*;
417: import java.util.*;
418:
419: public class CRTC {
420:
421:
422:
423:
424: public static final boolean CRT_EXTENDED_GRAPHIC = true;
425: public static boolean crtExtendedGraphicRequest;
426: public static boolean crtExtendedGraphicOn;
427:
428:
429: public static final long CRT_RESTART_DELAY = XEiJ.TMR_FREQ / 5;
430:
431:
432:
433:
434:
435: public static final int CRT_R00_H_FRONT_END = 0x00e80000;
436: public static final int CRT_R01_H_SYNC_END = 0x00e80002;
437: public static final int CRT_R02_H_BACK_END = 0x00e80004;
438: public static final int CRT_R03_H_DISP_END = 0x00e80006;
439: public static final int CRT_R04_V_FRONT_END = 0x00e80008;
440: public static final int CRT_R05_V_SYNC_END = 0x00e8000a;
441: public static final int CRT_R06_V_BACK_END = 0x00e8000c;
442: public static final int CRT_R07_V_DISP_END = 0x00e8000e;
443: public static final int CRT_R08_ADJUST = 0x00e80010;
444: public static final int CRT_R09_IRQ_RASTER = 0x00e80012;
445: public static final int CRT_R10_TX_X = 0x00e80014;
446: public static final int CRT_R11_TX_Y = 0x00e80016;
447: public static final int CRT_R12_GR_X_0 = 0x00e80018;
448: public static final int CRT_R13_GR_Y_0 = 0x00e8001a;
449: public static final int CRT_R14_GR_X_1 = 0x00e8001c;
450: public static final int CRT_R15_GR_Y_1 = 0x00e8001e;
451: public static final int CRT_R16_GR_X_2 = 0x00e80020;
452: public static final int CRT_R17_GR_Y_2 = 0x00e80022;
453: public static final int CRT_R18_GR_X_3 = 0x00e80024;
454: public static final int CRT_R19_GR_Y_3 = 0x00e80026;
455: public static final int CRT_R20_MODE = 0x00e80028;
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468: public static final int CRT_R21_SELECT = 0x00e8002a;
469:
470:
471:
472:
473:
474:
475:
476:
477:
478: public static final int CRT_R22_BLOCK = 0x00e8002c;
479:
480: public static final int CRT_R23_MASK = 0x00e8002e;
481: public static final int CRT_R24 = 0x00e80030;
482: public static final int CRT_ACTION = 0x00e80480;
483:
484:
485:
486:
487:
488:
489:
490: public static final int[] CRT_OSCS = { 0, 0, 0, 0, 1, 1, 1, 2, 0, 0, 0, 0, 1, 1, 1, 2 };
491: public static final int[] CRT_DIVS = { 8, 4, 8, 8, 6, 3, 2, 2, 8, 4, 8, 8, 8, 4, 2, 2 };
492: public static final int CRT_MIN_FREQ = 10000000;
493: public static final int CRT_MAX_FREQ = 400000000;
494: public static final int[] CRT_DEFAULT_FREQS = { 38863632, 69551900, 50349800 };
495: public static final int[] crtFreqsRequest = new int[3];
496: public static final int[] crtFreqs = new int[3];
497:
498:
499:
500: public static int crtR00HFrontEndPort;
501: public static int crtR00HFrontEndMask;
502: public static int crtR00HFrontEndTest;
503: public static int crtR00HFrontEndCurr;
504: public static int crtR01HSyncEndPort;
505: public static int crtR01HSyncEndMask;
506: public static int crtR01HSyncEndTest;
507: public static int crtR01HSyncEndCurr;
508: public static int crtR02HBackEndPort;
509: public static int crtR02HBackEndMask;
510: public static int crtR02HBackEndTest;
511: public static int crtR02HBackEndCurr;
512: public static int crtR03HDispEndPort;
513: public static int crtR03HDispEndMask;
514: public static int crtR03HDispEndTest;
515: public static int crtR03HDispEndCurr;
516: public static int crtR04VFrontEndPort;
517: public static int crtR04VFrontEndMask;
518: public static int crtR04VFrontEndTest;
519: public static int crtR04VFrontEndCurr;
520: public static int crtR05VSyncEndPort;
521: public static int crtR05VSyncEndMask;
522: public static int crtR05VSyncEndTest;
523: public static int crtR05VSyncEndCurr;
524: public static int crtR06VBackEndPort;
525: public static int crtR06VBackEndMask;
526: public static int crtR06VBackEndTest;
527: public static int crtR06VBackEndCurr;
528: public static int crtVDispStart;
529: public static int crtR07VDispEndPort;
530: public static int crtR07VDispEndMask;
531: public static int crtR07VDispEndTest;
532: public static int crtR07VDispEndCurr;
533: public static int crtVIdleStart;
534: public static int crtR08Adjust;
535: public static int crtR09IRQRasterPort;
536: public static int crtR09IRQRasterMask;
537: public static int crtR09IRQRasterTest;
538: public static int crtR09IRQRasterCurr;
539: public static int crtR10TxXPort;
540: public static int crtR10TxXMask;
541: public static int crtR10TxXTest;
542: public static int crtR10TxXCurr;
543: public static int crtR11TxYPort;
544: public static int crtR11TxYMask;
545: public static int crtR11TxYTest;
546: public static int crtR11TxYCurr;
547: public static int crtR11TxYZero;
548: public static int crtR11TxYZeroLast;
549: public static final int[] crtR12GrXPort = new int[4];
550:
551:
552:
553: public static final int[] crtR12GrXMask = new int[4];
554: public static final int[] crtR12GrXTest = new int[4];
555: public static final int[] crtR12GrXCurr = new int[4];
556: public static final int[] crtR13GrYPort = new int[4];
557:
558:
559:
560: public static final int[] crtR13GrYMask = new int[4];
561: public static final int[] crtR13GrYTest = new int[4];
562: public static final int[] crtR13GrYCurr = new int[4];
563: public static final int[] crtR13GrYZero = new int[4];
564: public static final int[] crtR13GrYZeroLast = new int[4];
565: public static int crtTextStorage;
566: public static int crtGraphicStorage;
567: public static int crtMemoryModePort;
568: public static int crtMemoryModeMask;
569: public static int crtMemoryModeTest;
570: public static int crtMemoryModeCurr;
571: public static int crtHighResoPort;
572: public static int crtHighResoMask;
573: public static int crtHighResoTest;
574: public static int crtHighResoCurr;
575: public static int crtVResoPort;
576: public static int crtVResoMask;
577: public static int crtVResoTest;
578: public static int crtVResoCurr;
579: public static int crtHResoPort;
580: public static int crtHResoMask;
581: public static int crtHResoTest;
582: public static int crtHResoCurr;
583: public static boolean crtCCPlane0;
584: public static boolean crtCCPlane1;
585: public static boolean crtCCPlane2;
586: public static boolean crtCCPlane3;
587: public static boolean crtSimPlane0;
588: public static boolean crtSimPlane1;
589: public static boolean crtSimPlane2;
590: public static boolean crtSimPlane3;
591: public static boolean crtSimAccess;
592: public static boolean crtBitMask;
593: public static int crtR22SrcBlock;
594: public static int crtR22DstBlock;
595: public static int crtR23Mask;
596: public static boolean crtRasterCopyOn;
597: public static boolean crtClearStandby;
598: public static int crtClearFrames;
599:
600: public static int crtHRLPort;
601: public static int crtHRLMask;
602: public static int crtHRLTest;
603: public static int crtHRLCurr;
604:
605: public static boolean crtDuplication;
606: public static boolean crtInterlace;
607: public static boolean crtSlit;
608: public static boolean crtDupExceptSp;
609: public static int crtColumnTime;
610: public static int crtHSyncLength;
611: public static int crtHBackLength;
612: public static int crtHDispLength;
613: public static int crtHFrontLength;
614: public static int crtHBackDispLength;
615:
616:
617:
618:
619:
620:
621:
622:
623:
624:
625:
626:
627:
628:
629:
630:
631:
632:
633:
634:
635:
636:
637:
638:
639:
640:
641:
642:
643:
644:
645:
646: public static int crtDirtyY0;
647: public static int crtDirtyY1;
648:
649: public static final int[] crtRasterStamp = new int[1024 + 15];
650: public static int crtAllStamp;
651:
652:
653:
654:
655:
656:
657:
658:
659:
660:
661:
662:
663:
664:
665:
666:
667:
668:
669:
670:
671:
672:
673:
674:
675:
676:
677:
678:
679:
680:
681:
682:
683:
684:
685:
686:
687:
688:
689:
690:
691:
692:
693:
694:
695:
696:
697:
698: public static int crtBeginningAllStamp;
699:
700: public static int crtRasterNumber;
701: public static int crtDataY;
702: public static int crtScreenY;
703: public static int crtFrameParity;
704:
705:
706:
707:
708:
709:
710:
711:
712:
713:
714:
715:
716:
717:
718:
719:
720:
721:
722:
723:
724:
725: public static final boolean CRT_RASTER_HASH_ON = true;
726: public static final long CRT_RASTER_HASH_ZERO = 0x0000000000000000L;
727: public static final long CRT_RASTER_HASH_MSB = 0x8000000000000000L;
728: public static long crtRasterHashIdle;
729: public static long crtRasterHashDisp;
730:
731:
732:
733:
734:
735: public static TickerQueue.Ticker crtTicker;
736: public static long crtClock;
737:
738: public static long crtContrastClock;
739: public static long crtCaptureClock;
740: public static long crtFrameTaskClock;
741:
742:
743:
744:
745:
746:
747:
748:
749:
750:
751:
752:
753:
754:
755:
756:
757:
758:
759:
760:
761:
762:
763:
764:
765:
766:
767: public static final boolean CRT_ENABLE_INTERMITTENT = true;
768: public static int crtIntermittentInterval;
769: public static int crtIntermittentCounter;
770:
771:
772: enum ScanlineEffect {
773: OFF {
774: @Override public void drawRaster (int screenY) {
775: int da = screenY << XEiJ.PNL_BM_OFFSET_BITS;
776: System.arraycopy (XEiJ.pnlBM, da - XEiJ.PNL_BM_WIDTH,
777: XEiJ.pnlBM, da,
778: XEiJ.pnlScreenWidth);
779: }
780: },
781: WEAK {
782: @Override public void drawRaster (int screenY) {
783: int da = screenY << XEiJ.PNL_BM_OFFSET_BITS;
784: int db = da + XEiJ.pnlScreenWidth;
785: while (da < db) {
786: int t;
787: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH )];
788: XEiJ.pnlBM[da ] = t - ((t >> 3) & 0x001f1f1f);
789: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 1)];
790: XEiJ.pnlBM[da + 1] = t - ((t >> 3) & 0x001f1f1f);
791: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 2)];
792: XEiJ.pnlBM[da + 2] = t - ((t >> 3) & 0x001f1f1f);
793: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 3)];
794: XEiJ.pnlBM[da + 3] = t - ((t >> 3) & 0x001f1f1f);
795: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 4)];
796: XEiJ.pnlBM[da + 4] = t - ((t >> 3) & 0x001f1f1f);
797: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 5)];
798: XEiJ.pnlBM[da + 5] = t - ((t >> 3) & 0x001f1f1f);
799: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 6)];
800: XEiJ.pnlBM[da + 6] = t - ((t >> 3) & 0x001f1f1f);
801: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 7)];
802: XEiJ.pnlBM[da + 7] = t - ((t >> 3) & 0x001f1f1f);
803: da += 8;
804: }
805: }
806: },
807: MEDIUM {
808: @Override public void drawRaster (int screenY) {
809: int da = screenY << XEiJ.PNL_BM_OFFSET_BITS;
810: int db = da + XEiJ.pnlScreenWidth;
811: while (da < db) {
812: int t;
813: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH )];
814: XEiJ.pnlBM[da ] = t - ((t >> 2) & 0x003f3f3f);
815: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 1)];
816: XEiJ.pnlBM[da + 1] = t - ((t >> 2) & 0x003f3f3f);
817: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 2)];
818: XEiJ.pnlBM[da + 2] = t - ((t >> 2) & 0x003f3f3f);
819: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 3)];
820: XEiJ.pnlBM[da + 3] = t - ((t >> 2) & 0x003f3f3f);
821: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 4)];
822: XEiJ.pnlBM[da + 4] = t - ((t >> 2) & 0x003f3f3f);
823: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 5)];
824: XEiJ.pnlBM[da + 5] = t - ((t >> 2) & 0x003f3f3f);
825: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 6)];
826: XEiJ.pnlBM[da + 6] = t - ((t >> 2) & 0x003f3f3f);
827: t = XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 7)];
828: XEiJ.pnlBM[da + 7] = t - ((t >> 2) & 0x003f3f3f);
829: da += 8;
830: }
831: }
832: },
833: STRONG {
834: @Override public void drawRaster (int screenY) {
835: int da = screenY << XEiJ.PNL_BM_OFFSET_BITS;
836: int db = da + XEiJ.pnlScreenWidth;
837: while (da < db) {
838: XEiJ.pnlBM[da ] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH )] >> 1) & 0xff7f7f7f;
839: XEiJ.pnlBM[da + 1] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 1)] >> 1) & 0xff7f7f7f;
840: XEiJ.pnlBM[da + 2] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 2)] >> 1) & 0xff7f7f7f;
841: XEiJ.pnlBM[da + 3] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 3)] >> 1) & 0xff7f7f7f;
842: XEiJ.pnlBM[da + 4] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 4)] >> 1) & 0xff7f7f7f;
843: XEiJ.pnlBM[da + 5] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 5)] >> 1) & 0xff7f7f7f;
844: XEiJ.pnlBM[da + 6] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 6)] >> 1) & 0xff7f7f7f;
845: XEiJ.pnlBM[da + 7] = (XEiJ.pnlBM[da - (XEiJ.PNL_BM_WIDTH - 7)] >> 1) & 0xff7f7f7f;
846: da += 8;
847: }
848: }
849: },
850: BLACK {
851: @Override public void drawRaster (int screenY) {
852: int da = screenY << XEiJ.PNL_BM_OFFSET_BITS;
853: int db = da + XEiJ.pnlScreenWidth;
854: Arrays.fill (XEiJ.pnlBM,
855: da,
856: db,
857: 0xff000000);
858: }
859: };
860: public abstract void drawRaster (int screenY);
861: }
862: public static ScanlineEffect crtScanlineEffect;
863:
864:
865:
866:
867: public static boolean crtEleventhBitRequest;
868: public static boolean crtEleventhBit;
869: public static int crtVerticalMask;
870:
871:
872:
873:
874:
875:
876: public static boolean crtSphericalScrolling;
877: public static int crtMask3;
878: public static int crtMaskMinus4;
879: public static int crtMask511;
880: public static void crtSetSphericalScrolling (boolean spherical) {
881: crtSphericalScrolling = spherical;
882: crtMask3 = spherical ? 0 : 3;
883: crtMaskMinus4 = ~crtMask3;
884: crtMask511 = crtMask3 << 7 | 127;
885: crtAllStamp += 2;
886: }
887:
888:
889: public static boolean crtR00Bit0Zero;
890:
891:
892:
893: public static void crtInit () {
894:
895:
896:
897:
898:
899:
900:
901:
902:
903:
904:
905:
906:
907:
908:
909:
910: switch (Settings.sgsGetString ("scanline").toLowerCase ()) {
911: case "off":
912: crtScanlineEffect = ScanlineEffect.OFF;
913: break;
914: case "weak":
915: crtScanlineEffect = ScanlineEffect.WEAK;
916: break;
917: case "medium":
918: crtScanlineEffect = ScanlineEffect.MEDIUM;
919: break;
920: case "strong":
921: crtScanlineEffect = ScanlineEffect.STRONG;
922: break;
923: case "black":
924: crtScanlineEffect = ScanlineEffect.BLACK;
925: break;
926: }
927:
928:
929: {
930: String[] a = (Settings.sgsGetString ("dotclock") + ",,,0").split (",");
931: for (int i = 0; i < 3; i++) {
932: int freq = -1;
933: try {
934: freq = Integer.parseInt (a[i], 10);
935: } catch (NumberFormatException nfe) {
936: }
937: crtFreqsRequest[i] = CRT_MIN_FREQ <= freq && freq <= CRT_MAX_FREQ ? freq : CRT_DEFAULT_FREQS[i];
938: }
939: }
940:
941:
942: crtEleventhBitRequest = Settings.sgsGetOnOff ("eleventhbit");
943:
944:
945: crtSphericalScrolling = Settings.sgsGetOnOff ("sphericalscrolling");
946: crtMask3 = 3;
947: crtMaskMinus4 = -4;
948: crtMask511 = 511;
949:
950:
951: crtR00Bit0Zero = Settings.sgsGetOnOff ("r00bit0zero");
952:
953: if (true) {
954: crtCCPlane0 = false;
955: crtCCPlane1 = false;
956: crtCCPlane2 = false;
957: crtCCPlane3 = false;
958: crtSimPlane0 = false;
959: crtSimPlane1 = false;
960: crtSimPlane2 = false;
961: crtSimPlane3 = false;
962: crtSimAccess = false;
963: crtBitMask = false;
964: }
965: crtReset ();
966: }
967:
968:
969:
970: public static void crtTini () {
971:
972:
973: Settings.sgsPutString ("scanline",
974: crtScanlineEffect == ScanlineEffect.OFF ? "off" :
975: crtScanlineEffect == ScanlineEffect.WEAK ? "weak" :
976: crtScanlineEffect == ScanlineEffect.MEDIUM ? "medium" :
977: crtScanlineEffect == ScanlineEffect.STRONG ? "strong" :
978: crtScanlineEffect == ScanlineEffect.BLACK ? "black" :
979: "");
980:
981:
982: {
983: StringBuilder sb = new StringBuilder ();
984: for (int i = 0; i < 3; i++) {
985: if (0 < i) {
986: sb.append (',');
987: }
988: if (crtFreqsRequest[i] != CRT_DEFAULT_FREQS[i]) {
989: sb.append (crtFreqsRequest[i]);
990: }
991: }
992: Settings.sgsPutString ("dotclock", sb.toString ());
993: }
994:
995:
996: Settings.sgsPutOnOff ("eleventhbit", crtEleventhBitRequest);
997:
998:
999: Settings.sgsPutOnOff ("sphericalscrolling", crtSphericalScrolling);
1000:
1001:
1002: Settings.sgsPutOnOff ("r00bit0zero", crtR00Bit0Zero);
1003:
1004: }
1005:
1006:
1007:
1008:
1009:
1010:
1011:
1012:
1013: public static void crtReset () {
1014: if (CRT_EXTENDED_GRAPHIC) {
1015: crtExtendedGraphicOn = crtExtendedGraphicRequest;
1016: if (crtExtendedGraphicOn) {
1017: System.out.println (Multilingual.mlnJapanese ?
1018: "拡張グラフィック画面が有効になりました" :
1019: "Extended graphic screen has been activated");
1020: }
1021: }
1022:
1023:
1024: for (int i = 0; i < 3; i++) {
1025: crtFreqs[i] = crtFreqsRequest[i];
1026: }
1027:
1028:
1029: crtEleventhBit = crtEleventhBitRequest;
1030: crtVerticalMask = crtEleventhBit ? 0x07ff : 0x03ff;
1031:
1032: crtR00HFrontEndPort = 0;
1033: crtR00HFrontEndMask = 0;
1034: crtR00HFrontEndTest = 0;
1035: crtR00HFrontEndCurr = 0;
1036: crtR01HSyncEndPort = 0;
1037: crtR01HSyncEndMask = 0;
1038: crtR01HSyncEndTest = 0;
1039: crtR01HSyncEndCurr = 0;
1040: crtR02HBackEndPort = 0;
1041: crtR02HBackEndMask = 0;
1042: crtR02HBackEndTest = 0;
1043: crtR02HBackEndCurr = 0;
1044: crtR03HDispEndPort = 0;
1045: crtR03HDispEndMask = 0;
1046: crtR03HDispEndTest = 0;
1047: crtR03HDispEndCurr = 0;
1048: crtR04VFrontEndPort = 0;
1049: crtR04VFrontEndMask = 0;
1050: crtR04VFrontEndTest = 0;
1051: crtR04VFrontEndCurr = 0;
1052: crtR05VSyncEndPort = 0;
1053: crtR05VSyncEndMask = 0;
1054: crtR05VSyncEndTest = 0;
1055: crtR05VSyncEndCurr = 0;
1056: crtR06VBackEndPort = 0;
1057: crtR06VBackEndMask = 0;
1058: crtR06VBackEndTest = 0;
1059: crtR06VBackEndCurr = 0;
1060: crtVDispStart = 0;
1061: crtR07VDispEndPort = 0;
1062: crtR07VDispEndMask = 0;
1063: crtR07VDispEndTest = 0;
1064: crtR07VDispEndCurr = 0;
1065: crtVIdleStart = 0;
1066: crtR08Adjust = 0;
1067: crtR09IRQRasterPort = 1023;
1068: crtR09IRQRasterMask = 0;
1069: crtR09IRQRasterTest = 1023;
1070: crtR09IRQRasterCurr = 1023;
1071: crtR10TxXPort = 0;
1072: crtR10TxXMask = 0;
1073: crtR10TxXTest = 0;
1074: crtR10TxXCurr = 0;
1075: crtR11TxYPort = 0;
1076: crtR11TxYMask = 0;
1077: crtR11TxYTest = 0;
1078: crtR11TxYCurr = 0;
1079: crtR11TxYZero = 0;
1080: crtR11TxYZeroLast = -1;
1081: for (int i = 0; i < 4; i++) {
1082: crtR12GrXPort[i] = 0;
1083: crtR12GrXMask[i] = 0;
1084: crtR12GrXTest[i] = 0;
1085: crtR12GrXCurr[i] = 0;
1086: crtR13GrYPort[i] = 0;
1087: crtR13GrYMask[i] = 0;
1088: crtR13GrYTest[i] = 0;
1089: crtR13GrYCurr[i] = 0;
1090: crtR13GrYZero[i] = 0;
1091: crtR13GrYZeroLast[i] = -1;
1092: }
1093: crtTextStorage = 0;
1094: crtGraphicStorage = 0;
1095: crtMemoryModePort = 0;
1096: crtMemoryModeMask = 0;
1097: crtMemoryModeTest = 0;
1098: crtMemoryModeCurr = 0;
1099: crtHighResoPort = 0;
1100: crtHighResoMask = 0;
1101: crtHighResoTest = 0;
1102: crtHighResoCurr = 0;
1103: crtVResoPort = 0;
1104: crtVResoMask = 0;
1105: crtVResoTest = 0;
1106: crtVResoCurr = 0;
1107: crtHResoPort = 0;
1108: crtHResoMask = 0;
1109: crtHResoTest = 0;
1110: crtHResoCurr = 0;
1111: if (false) {
1112: crtCCPlane0 = false;
1113: crtCCPlane1 = false;
1114: crtCCPlane2 = false;
1115: crtCCPlane3 = false;
1116: crtSimPlane0 = false;
1117: crtSimPlane1 = false;
1118: crtSimPlane2 = false;
1119: crtSimPlane3 = false;
1120: crtSimAccess = false;
1121: crtBitMask = false;
1122: }
1123: crtR22SrcBlock = 0;
1124: crtR22DstBlock = 0;
1125: crtR23Mask = 0x0000;
1126: crtRasterCopyOn = false;
1127: crtClearStandby = false;
1128: crtClearFrames = 0;
1129:
1130: crtHRLPort = 0;
1131: crtHRLMask = 0;
1132: crtHRLTest = 0;
1133: crtHRLCurr = 0;
1134: XEiJ.pnlStretchMode = 1.0F;
1135: XEiJ.pnlStereoscopicShutter = 0;
1136: crtDuplication = false;
1137: crtInterlace = false;
1138: crtSlit = false;
1139: crtDupExceptSp = false;
1140: crtColumnTime = 0;
1141: crtHSyncLength = 0;
1142: crtHBackLength = 0;
1143: crtHDispLength = 0;
1144: crtHFrontLength = 0;
1145: crtHBackDispLength = 0;
1146:
1147: crtDirtyY0 = -1;
1148: crtDirtyY1 = -1;
1149:
1150: Arrays.fill (crtRasterStamp, 0);
1151: crtAllStamp = 1;
1152:
1153: crtBeginningAllStamp = 1;
1154:
1155: crtRasterNumber = 0;
1156: crtDataY = 0;
1157: crtScreenY = 0;
1158: crtFrameParity = 0;
1159:
1160: crtRasterHashIdle = CRT_RASTER_HASH_ZERO;
1161: crtRasterHashDisp = CRT_RASTER_HASH_ZERO;
1162:
1163: crtContrastClock = XEiJ.FAR_FUTURE;
1164: crtCaptureClock = XEiJ.FAR_FUTURE;
1165: crtFrameTaskClock = Math.min (crtContrastClock, crtCaptureClock);
1166:
1167: if (CRT_ENABLE_INTERMITTENT) {
1168:
1169: crtIntermittentCounter = 0;
1170: }
1171:
1172: if (crtTicker != null) {
1173: TickerQueue.tkqRemove (crtTicker);
1174: crtTicker = null;
1175: }
1176: crtClock = XEiJ.FAR_FUTURE;
1177:
1178: }
1179:
1180:
1181:
1182: public static void crtRestart () {
1183: if (crtTicker != null) {
1184: TickerQueue.tkqRemove (crtTicker);
1185: }
1186: TickerQueue.tkqAdd (crtTicker = InitialStage, crtClock = XEiJ.mpuClockTime + CRT_RESTART_DELAY);
1187: }
1188:
1189:
1190:
1191: public static void crtStereoscopicStart () {
1192: XEiJ.pnlBM = (XEiJ.pnlStereoscopicShutter != 1 ? XEiJ.pnlBMLeft :
1193: XEiJ.pnlBMRight);
1194: crtAllStamp += 2;
1195: }
1196:
1197:
1198:
1199: public static void crtStereoscopicDrawRaster (int screenY) {
1200: if (XEiJ.pnlStereoscopicShutter == 0 ||
1201: XEiJ.pnlStereoscopicShutter == 3) {
1202: System.arraycopy (XEiJ.pnlBMLeft, screenY << XEiJ.PNL_BM_OFFSET_BITS,
1203: XEiJ.pnlBMRight, screenY << XEiJ.PNL_BM_OFFSET_BITS,
1204: XEiJ.pnlScreenWidth);
1205: }
1206: }
1207:
1208:
1209:
1210: public static void crtUpdateScreen () {
1211: if (XEiJ.pnlZoomRatioOut == 1 << 16) {
1212: XEiJ.pnlPanel.repaint (0L, XEiJ.pnlScreenX1, XEiJ.pnlScreenY1 + crtDirtyY0, XEiJ.pnlScreenX4 - XEiJ.pnlScreenX1, crtDirtyY1 - crtDirtyY0 + 1);
1213: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn && XEiJ.pnlStereoscopicMethod == XEiJ.PNL_TOP_AND_BOTTOM) {
1214: XEiJ.pnlPanel.repaint (0L, XEiJ.pnlScreenX1, XEiJ.pnlScreenY3 + crtDirtyY0, XEiJ.pnlScreenX4 - XEiJ.pnlScreenX1, crtDirtyY1 - crtDirtyY0 + 1);
1215: }
1216: } else {
1217: int y0 = (crtDirtyY0 - 1) * XEiJ.pnlZoomRatioOut >> 16;
1218: int y1 = (crtDirtyY1 + 2) * (XEiJ.pnlZoomRatioOut + 1) >> 16;
1219: XEiJ.pnlPanel.repaint (0L, XEiJ.pnlScreenX1, XEiJ.pnlScreenY1 + y0, XEiJ.pnlScreenX4 - XEiJ.pnlScreenX1, y1 - y0);
1220: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn && XEiJ.pnlStereoscopicMethod == XEiJ.PNL_TOP_AND_BOTTOM) {
1221: XEiJ.pnlPanel.repaint (0L, XEiJ.pnlScreenX1, XEiJ.pnlScreenY3 + y0, XEiJ.pnlScreenX4 - XEiJ.pnlScreenX1, y1 - y0);
1222: }
1223: }
1224: crtDirtyY0 = -1;
1225: }
1226:
1227:
1228:
1229:
1230:
1231:
1232: public static void crtRepaint () {
1233: crtBeginningAllStamp = crtAllStamp;
1234: int l = Math.max (0, Math.min (1024, crtR07VDispEndCurr - crtR06VBackEndCurr));
1235: if (crtDuplication) {
1236: for (int screenY = 0; screenY < l; screenY += 2) {
1237: if (SpriteScreen.SPR_THREE_STEPS) {
1238: SpriteScreen.sprStep1 (screenY >> 1);
1239: SpriteScreen.sprStep2 (screenY >> 1);
1240: }
1241: VideoController.vcnMode.drawRaster (screenY >> 1, screenY, false);
1242: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
1243: crtStereoscopicDrawRaster (screenY);
1244: }
1245:
1246: System.arraycopy (XEiJ.pnlBM, screenY << XEiJ.PNL_BM_OFFSET_BITS, XEiJ.pnlBM, screenY + 1 << XEiJ.PNL_BM_OFFSET_BITS, XEiJ.pnlScreenWidth);
1247: }
1248: } else if (crtSlit) {
1249: for (int screenY = 0; screenY < l; screenY += 2) {
1250: if (SpriteScreen.SPR_THREE_STEPS) {
1251: SpriteScreen.sprStep1 (screenY >> 1);
1252: SpriteScreen.sprStep2 (screenY >> 1);
1253: }
1254: VideoController.vcnMode.drawRaster (screenY >> 1, screenY, false);
1255: crtScanlineEffect.drawRaster (screenY + 1);
1256: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
1257: crtStereoscopicDrawRaster (screenY);
1258: crtStereoscopicDrawRaster (screenY + 1);
1259: }
1260: }
1261: } else if (crtDupExceptSp) {
1262: for (int screenY = 0; screenY < l; screenY++) {
1263: if (SpriteScreen.SPR_THREE_STEPS) {
1264: SpriteScreen.sprStep1 (screenY);
1265: SpriteScreen.sprStep2 (screenY);
1266: }
1267: VideoController.vcnMode.drawRaster (screenY >> 1, screenY, false);
1268: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
1269: crtStereoscopicDrawRaster (screenY);
1270: }
1271: }
1272: } else {
1273: for (int screenY = 0; screenY < l; screenY++) {
1274: if (SpriteScreen.SPR_THREE_STEPS) {
1275: SpriteScreen.sprStep1 (screenY);
1276: SpriteScreen.sprStep2 (screenY);
1277: }
1278: VideoController.vcnMode.drawRaster (screenY, screenY, false);
1279: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
1280: crtStereoscopicDrawRaster (screenY);
1281: }
1282: }
1283: }
1284: XEiJ.pnlPanel.repaint (0L, XEiJ.pnlScreenX1, XEiJ.pnlScreenY1, XEiJ.pnlScreenX4 - XEiJ.pnlScreenX1, l);
1285: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn && XEiJ.pnlStereoscopicMethod == XEiJ.PNL_TOP_AND_BOTTOM) {
1286: XEiJ.pnlPanel.repaint (0L, XEiJ.pnlScreenX1, XEiJ.pnlScreenY3, XEiJ.pnlScreenX4 - XEiJ.pnlScreenX1, l);
1287: }
1288: }
1289:
1290:
1291:
1292:
1293:
1294:
1295: public static void crtDoFrameTask () {
1296: if (XEiJ.mpuClockTime >= crtContrastClock) {
1297: VideoController.vcnCurrentScaledContrast += VideoController.vcnCurrentScaledContrast < VideoController.vcnTargetScaledContrast ? 1 : -1;
1298: VideoController.vcnSetContrast (VideoController.vcnCurrentScaledContrast);
1299: if (VideoController.vcnCurrentScaledContrast == VideoController.vcnTargetScaledContrast) {
1300: crtContrastClock = XEiJ.FAR_FUTURE;
1301: } else {
1302: crtContrastClock += VideoController.VCN_CONTRAST_DELAY;
1303: }
1304: }
1305: if (XEiJ.mpuClockTime >= crtCaptureClock) {
1306: GIFAnimation.gifCaptureFrame ();
1307: }
1308: crtFrameTaskClock = Math.min (crtContrastClock, crtCaptureClock);
1309: }
1310:
1311:
1312:
1313:
1314:
1315: public static void crtSetMemoryMode (int textStorage, int graphicStorage, int memoryMode) {
1316: boolean updateMemoryMap = false;
1317: textStorage &= 1;
1318: if (crtTextStorage != textStorage) {
1319: crtTextStorage = textStorage;
1320: }
1321: graphicStorage &= 1;
1322: if (crtGraphicStorage != graphicStorage) {
1323: crtGraphicStorage = graphicStorage;
1324: updateMemoryMap = true;
1325: }
1326: memoryMode &= 7;
1327: crtMemoryModePort = memoryMode;
1328: int curr = crtMemoryModeMask == 0 ? crtMemoryModePort : crtMemoryModeTest;
1329: if (crtMemoryModeCurr != curr) {
1330: crtMemoryModeCurr = curr;
1331: updateMemoryMap = true;
1332: }
1333: if (updateMemoryMap) {
1334: if (crtGraphicStorage != 0) {
1335: if (CRT_EXTENDED_GRAPHIC && crtExtendedGraphicOn &&
1336: (crtMemoryModeCurr == 5 || crtMemoryModeCurr == 7)) {
1337:
1338: XEiJ.busSuper (MemoryMappedDevice.MMD_GJ0, 0x00c00000, 0x00e00000);
1339: } else {
1340:
1341: XEiJ.busSuper (MemoryMappedDevice.MMD_GG0, 0x00c00000, 0x00c80000);
1342: XEiJ.busSuper (MemoryMappedDevice.MMD_NUL, 0x00c80000, 0x00e00000);
1343: }
1344: } else {
1345: switch (crtMemoryModeCurr) {
1346: case 0:
1347:
1348: XEiJ.busSuper (MemoryMappedDevice.MMD_GE0, 0x00c00000, 0x00c80000);
1349: XEiJ.busSuper (MemoryMappedDevice.MMD_GE1, 0x00c80000, 0x00d00000);
1350: XEiJ.busSuper (MemoryMappedDevice.MMD_GE2, 0x00d00000, 0x00d80000);
1351: XEiJ.busSuper (MemoryMappedDevice.MMD_GE3, 0x00d80000, 0x00e00000);
1352: break;
1353: case 1:
1354:
1355: XEiJ.busSuper (MemoryMappedDevice.MMD_GF0, 0x00c00000, 0x00c80000);
1356: XEiJ.busSuper (MemoryMappedDevice.MMD_GF1, 0x00c80000, 0x00d00000);
1357: XEiJ.busSuper (MemoryMappedDevice.MMD_NUL, 0x00d00000, 0x00e00000);
1358: break;
1359: case 2:
1360:
1361: XEiJ.busSuper (MemoryMappedDevice.MMD_GM2, 0x00c00000, 0x00e00000);
1362: break;
1363: case 3:
1364:
1365: XEiJ.busSuper (MemoryMappedDevice.MMD_GG0, 0x00c00000, 0x00c80000);
1366: XEiJ.busSuper (MemoryMappedDevice.MMD_NUL, 0x00c80000, 0x00e00000);
1367: break;
1368: case 4:
1369:
1370: XEiJ.busSuper (MemoryMappedDevice.MMD_GH0, 0x00c00000, 0x00e00000);
1371: break;
1372: case 5:
1373: if (CRT_EXTENDED_GRAPHIC && crtExtendedGraphicOn) {
1374:
1375: XEiJ.busSuper (MemoryMappedDevice.MMD_GI0, 0x00c00000, 0x00e00000);
1376: } else {
1377:
1378: XEiJ.busSuper (MemoryMappedDevice.MMD_GH0, 0x00c00000, 0x00e00000);
1379: }
1380: break;
1381: case 6:
1382:
1383: XEiJ.busSuper (MemoryMappedDevice.MMD_GH0, 0x00c00000, 0x00e00000);
1384: break;
1385: case 7:
1386: if (CRT_EXTENDED_GRAPHIC && crtExtendedGraphicOn) {
1387:
1388: XEiJ.busSuper (MemoryMappedDevice.MMD_GJ0, 0x00c00000, 0x00e00000);
1389: } else {
1390:
1391: XEiJ.busSuper (MemoryMappedDevice.MMD_GH0, 0x00c00000, 0x00e00000);
1392: }
1393: break;
1394: }
1395: }
1396: }
1397: }
1398:
1399:
1400:
1401:
1402:
1403:
1404:
1405:
1406:
1407:
1408:
1409: public static void crtUpdateRasterHash () {
1410: if (CRT_RASTER_HASH_ON) {
1411: long t = crtRasterCopyOn ? ~CRT_RASTER_HASH_ZERO : CRT_RASTER_HASH_ZERO;
1412:
1413: if (RasterBreakPoint.RBP_ON && RasterBreakPoint.rbpActiveBreakRaster >= 0) {
1414: t |= CRT_RASTER_HASH_MSB >>> RasterBreakPoint.rbpActiveBreakRaster;
1415: }
1416: if (crtR09IRQRasterCurr <= crtR04VFrontEndCurr) {
1417: t |= (CRT_RASTER_HASH_MSB >>> crtR09IRQRasterCurr |
1418: CRT_RASTER_HASH_MSB >>> (crtR09IRQRasterCurr < crtR04VFrontEndCurr ? crtR09IRQRasterCurr + 1 : 0));
1419: }
1420: crtRasterHashIdle = (t |
1421: CRT_RASTER_HASH_MSB >>> crtVDispStart |
1422: CRT_RASTER_HASH_MSB >>> crtR04VFrontEndCurr + 1);
1423: crtRasterHashDisp = (t |
1424: CRT_RASTER_HASH_MSB >>> crtVIdleStart);
1425: }
1426: }
1427:
1428:
1429:
1430:
1431: public static void crtRapidClear (int y) {
1432: if (crtMemoryModeCurr >= 4) {
1433: int a = 0x00c00000 | (y + crtR13GrYZero[0] & 1023) << 1 + 10;
1434: Arrays.fill (MainMemory.mmrM8, a, a + 2 * 1024, (byte) 0);
1435: } else {
1436: if (crtCCPlane0) {
1437: int a = 0x00c00000 | (y + crtR13GrYZero[0] & 511) << 1 + 9;
1438: Arrays.fill (MainMemory.mmrM8, a, a + 2 * 512, (byte) 0);
1439: }
1440: if (crtCCPlane1) {
1441: int a = 0x00c80000 | (y + crtR13GrYZero[1] & 511) << 1 + 9;
1442: Arrays.fill (MainMemory.mmrM8, a, a + 2 * 512, (byte) 0);
1443: }
1444: if (crtCCPlane2) {
1445: int a = 0x00d00000 | (y + crtR13GrYZero[2] & 511) << 1 + 9;
1446: Arrays.fill (MainMemory.mmrM8, a, a + 2 * 512, (byte) 0);
1447: }
1448: if (crtCCPlane3) {
1449: int a = 0x00d80000 | (y + crtR13GrYZero[3] & 511) << 1 + 9;
1450: Arrays.fill (MainMemory.mmrM8, a, a + 2 * 512, (byte) 0);
1451: }
1452: }
1453: }
1454:
1455:
1456:
1457: public static void crtDoRasterCopy () {
1458: int srcOffset = crtR22SrcBlock << 9;
1459: int dstOffset = crtR22DstBlock << 9;
1460: if (crtCCPlane0) {
1461: System.arraycopy (MainMemory.mmrM8, 0x00e00000 + srcOffset, MainMemory.mmrM8, 0x00e00000 + dstOffset, 512);
1462: }
1463: if (crtCCPlane1) {
1464: System.arraycopy (MainMemory.mmrM8, 0x00e20000 + srcOffset, MainMemory.mmrM8, 0x00e20000 + dstOffset, 512);
1465: }
1466: if (crtCCPlane2) {
1467: System.arraycopy (MainMemory.mmrM8, 0x00e40000 + srcOffset, MainMemory.mmrM8, 0x00e40000 + dstOffset, 512);
1468: }
1469: if (crtCCPlane3) {
1470: System.arraycopy (MainMemory.mmrM8, 0x00e60000 + srcOffset, MainMemory.mmrM8, 0x00e60000 + dstOffset, 512);
1471: }
1472: int y = (dstOffset >> 7) - crtR11TxYZero;
1473: crtRasterStamp[y & 1023] = 0;
1474: crtRasterStamp[y + 1 & 1023] = 0;
1475: crtRasterStamp[y + 2 & 1023] = 0;
1476: crtRasterStamp[y + 3 & 1023] = 0;
1477: }
1478:
1479:
1480:
1481:
1482:
1483:
1484:
1485:
1486:
1487:
1488:
1489:
1490:
1491:
1492:
1493:
1494:
1495:
1496:
1497:
1498:
1499:
1500:
1501:
1502:
1503:
1504:
1505:
1506:
1507:
1508:
1509:
1510:
1511:
1512:
1513:
1514:
1515:
1516:
1517:
1518:
1519:
1520:
1521:
1522:
1523:
1524:
1525:
1526:
1527:
1528:
1529:
1530:
1531:
1532:
1533:
1534:
1535:
1536:
1537:
1538:
1539:
1540:
1541:
1542:
1543:
1544:
1545:
1546:
1547:
1548:
1549:
1550:
1551:
1552:
1553:
1554:
1555:
1556:
1557:
1558:
1559:
1560:
1561:
1562:
1563:
1564:
1565:
1566:
1567:
1568:
1569:
1570:
1571:
1572:
1573:
1574:
1575:
1576:
1577:
1578:
1579:
1580:
1581:
1582:
1583:
1584:
1585:
1586:
1587:
1588:
1589:
1590:
1591:
1592:
1593:
1594:
1595:
1596:
1597:
1598:
1599:
1600:
1601:
1602:
1603:
1604:
1605:
1606:
1607:
1608:
1609:
1610:
1611:
1612:
1613:
1614:
1615:
1616:
1617:
1618:
1619:
1620:
1621:
1622:
1623:
1624:
1625:
1626:
1627:
1628:
1629:
1630:
1631:
1632:
1633:
1634:
1635:
1636:
1637:
1638:
1639:
1640:
1641:
1642:
1643:
1644:
1645:
1646:
1647:
1648:
1649:
1650:
1651:
1652:
1653:
1654:
1655:
1656:
1657:
1658:
1659:
1660:
1661:
1662:
1663:
1664:
1665:
1666:
1667:
1668:
1669:
1670:
1671:
1672:
1673:
1674:
1675:
1676:
1677:
1678:
1679:
1680:
1681:
1682:
1683:
1684:
1685:
1686:
1687:
1688:
1689:
1690:
1691:
1692:
1693:
1694:
1695:
1696:
1697:
1698:
1699:
1700:
1701:
1702:
1703:
1704:
1705:
1706:
1707:
1708:
1709:
1710:
1711:
1712:
1713:
1714:
1715:
1716:
1717:
1718:
1719:
1720:
1721:
1722:
1723:
1724:
1725:
1726:
1727:
1728:
1729:
1730:
1731:
1732:
1733:
1734:
1735:
1736:
1737:
1738:
1739:
1740:
1741:
1742:
1743:
1744:
1745: public static final TickerQueue.Ticker InitialStage = new TickerQueue.Ticker () {
1746: @Override protected void tick () {
1747: ret:
1748: {
1749:
1750:
1751:
1752:
1753:
1754: if (!(crtR02HBackEndCurr < crtR03HDispEndCurr && crtR03HDispEndCurr - crtR02HBackEndCurr <= 128 &&
1755: crtR07VDispEndCurr < crtR04VFrontEndCurr && crtR07VDispEndCurr - crtR06VBackEndCurr <= 1024 &&
1756: crtR05VSyncEndCurr < crtR06VBackEndCurr &&
1757: crtR06VBackEndCurr < crtR07VDispEndCurr)) {
1758: crtRestart ();
1759: break ret;
1760: }
1761:
1762: if (CRT_RASTER_HASH_ON) {
1763: crtUpdateRasterHash ();
1764: }
1765:
1766:
1767:
1768:
1769:
1770:
1771: int hSync = crtR01HSyncEndCurr + 1;
1772: int hBack = crtR02HBackEndCurr - crtR01HSyncEndCurr + 4;
1773: int hDisp = crtR03HDispEndCurr - crtR02HBackEndCurr;
1774: int hFront = crtR00HFrontEndCurr - crtR03HDispEndCurr - 4;
1775: if (hSync + hBack + hDisp + hFront < hDisp + 3) {
1776: hSync = hBack = hFront = 1;
1777: } else {
1778: if (hBack <= 0) {
1779: hFront -= 1 - hBack;
1780: hBack = 1;
1781: if (hFront <= 0) {
1782: hSync -= 1 - hFront;
1783: hFront = 1;
1784: }
1785: } else if (hFront <= 0) {
1786: hBack -= 1 - hFront;
1787: hFront = 1;
1788: if (hBack <= 0) {
1789: hSync -= 1 - hBack;
1790: hBack = 1;
1791: }
1792: }
1793: }
1794: int k = crtHRLCurr << 3 | crtHighResoCurr << 2 | crtHResoCurr;
1795: crtColumnTime = (int) ((double) (XEiJ.TMR_FREQ * 8 * CRT_DIVS[k]) / (double) crtFreqs[CRT_OSCS[k]] + 0.5);
1796: crtHSyncLength = crtColumnTime * hSync;
1797: crtHBackLength = crtColumnTime * hBack;
1798: crtHDispLength = crtColumnTime * hDisp;
1799: crtHFrontLength = crtColumnTime * hFront;
1800: crtHBackDispLength = crtColumnTime * (hBack + hDisp);
1801:
1802: crtDuplication = crtHighResoCurr == 1 && crtVResoCurr == 0 && ((SpriteScreen.sprReg8ResoCurr & 12) != 4);
1803: crtInterlace = crtHighResoCurr + 1 <= crtVResoCurr;
1804: crtSlit = crtHighResoCurr == 0 && crtVResoCurr == 0;
1805: crtDupExceptSp = crtHighResoCurr == 1 && crtVResoCurr == 0 && ((SpriteScreen.sprReg8ResoCurr & 12) == 4);
1806:
1807: XEiJ.pnlUpdateArrangement ();
1808:
1809: crtAllStamp += 2;
1810: (crtDuplication ? DuplicationStart :
1811: crtInterlace ? InterlaceStart :
1812: crtSlit ? SlitStart :
1813: crtDupExceptSp ? DupExceptSpStart :
1814: NormalStart).tick ();
1815: }
1816: }
1817: };
1818:
1819:
1820:
1821:
1822: public static final TickerQueue.Ticker NormalStart = new TickerQueue.Ticker () {
1823: @Override protected void tick () {
1824: if (MC68901.mfpGpipHsync != 0) {
1825: MC68901.mfpHsyncFall ();
1826: }
1827: int n = crtRasterNumber = crtVIdleStart;
1828: if (crtRasterCopyOn) {
1829: crtDoRasterCopy ();
1830: }
1831: if (RasterBreakPoint.RBP_ON) {
1832: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
1833: RasterBreakPoint.rbpFire ();
1834: }
1835: }
1836: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
1837: if (irq != MC68901.mfpGpipRint) {
1838: if (irq == 0) {
1839: if (RasterBreakPoint.RBP_ON) {
1840: if (RasterBreakPoint.rbpIRQBreakEnabled) {
1841: RasterBreakPoint.rbpFire ();
1842: }
1843: }
1844: MC68901.mfpRintFall ();
1845: } else {
1846: MC68901.mfpRintRise ();
1847: }
1848: }
1849: if (MC68901.mfpGpipVdisp != 0) {
1850: MC68901.mfpVdispFall ();
1851: }
1852: crtClearFrames = 0;
1853: if (CRT_ENABLE_INTERMITTENT) {
1854: crtIntermittentCounter = 0;
1855: }
1856: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
1857: crtDoFrameTask ();
1858: }
1859: TickerQueue.tkqAdd (crtTicker = NormalDrawIdleSync, crtClock += crtHFrontLength);
1860: }
1861: };
1862:
1863: public static final TickerQueue.Ticker NormalDrawIdleFront = new TickerQueue.Ticker () {
1864: @Override protected void tick () {
1865: int n = ++crtRasterNumber;
1866: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
1867: if (crtR04VFrontEndCurr < n) {
1868: n = crtRasterNumber = 0;
1869: }
1870: if (crtRasterCopyOn) {
1871: crtDoRasterCopy ();
1872: }
1873: if (RasterBreakPoint.RBP_ON) {
1874: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
1875: RasterBreakPoint.rbpFire ();
1876: }
1877: }
1878: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
1879: if (irq != MC68901.mfpGpipRint) {
1880: if (irq == 0) {
1881: if (RasterBreakPoint.RBP_ON) {
1882: if (RasterBreakPoint.rbpIRQBreakEnabled) {
1883: RasterBreakPoint.rbpFire ();
1884: }
1885: }
1886: MC68901.mfpRintFall ();
1887: } else {
1888: MC68901.mfpRintRise ();
1889: }
1890: }
1891: if (n != crtVDispStart) {
1892: TickerQueue.tkqAdd (crtTicker = NormalDrawIdleSync, crtClock += crtHFrontLength);
1893: } else {
1894: MC68901.mfpVdispRise ();
1895: crtR11TxYZero = crtR11TxYCurr;
1896: crtR13GrYZero[0] = crtR13GrYCurr[0];
1897: crtR13GrYZero[1] = crtR13GrYCurr[1];
1898: crtR13GrYZero[2] = crtR13GrYCurr[2];
1899: crtR13GrYZero[3] = crtR13GrYCurr[3];
1900: if (crtR11TxYZeroLast != crtR11TxYZero ||
1901: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
1902: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
1903: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
1904: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
1905: crtR11TxYZeroLast = crtR11TxYZero;
1906: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
1907: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
1908: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
1909: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
1910: crtAllStamp += 2;
1911: }
1912: crtDataY = 0;
1913: if (crtClearStandby) {
1914: crtClearStandby = false;
1915: crtClearFrames = 1;
1916: }
1917: crtScreenY = 0;
1918: crtDirtyY0 = -1;
1919: if (SpriteScreen.SPR_THREE_STEPS) {
1920: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
1921: if (SpriteScreen.sprActive) {
1922: crtAllStamp += 2;
1923:
1924: SpriteScreen.sprStep1 (0);
1925: SpriteScreen.sprSwap ();
1926:
1927:
1928: SpriteScreen.sprStep1 (1);
1929: SpriteScreen.sprSwap ();
1930: SpriteScreen.sprStep2 (0);
1931: }
1932: }
1933: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
1934: crtStereoscopicStart ();
1935: }
1936: TickerQueue.tkqAdd (crtTicker = NormalDrawDispSync, crtClock += crtHFrontLength);
1937: }
1938: } else {
1939:
1940: TickerQueue.tkqAdd (crtTicker = NormalDrawIdleSync, crtClock += crtHFrontLength);
1941: }
1942: }
1943: };
1944:
1945: public static final TickerQueue.Ticker NormalDrawIdleSync = new TickerQueue.Ticker () {
1946: @Override protected void tick () {
1947: MC68901.mfpHsyncRise ();
1948: TickerQueue.tkqAdd (crtTicker = NormalDrawIdleBackDisp, crtClock += crtHSyncLength);
1949: }
1950: };
1951:
1952: public static final TickerQueue.Ticker NormalDrawIdleBackDisp = new TickerQueue.Ticker () {
1953: @Override protected void tick () {
1954: MC68901.mfpHsyncFall ();
1955: TickerQueue.tkqAdd (crtTicker = NormalDrawIdleFront, crtClock += crtHBackDispLength);
1956: }
1957: };
1958:
1959: public static final TickerQueue.Ticker NormalDrawDispFront = new TickerQueue.Ticker () {
1960: @Override protected void tick () {
1961: int n = ++crtRasterNumber;
1962: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
1963: if (crtRasterCopyOn) {
1964: crtDoRasterCopy ();
1965: }
1966: if (RasterBreakPoint.RBP_ON) {
1967: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
1968: RasterBreakPoint.rbpFire ();
1969: }
1970: }
1971: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
1972: if (irq != MC68901.mfpGpipRint) {
1973: if (irq == 0) {
1974: if (RasterBreakPoint.RBP_ON) {
1975: if (RasterBreakPoint.rbpIRQBreakEnabled) {
1976: RasterBreakPoint.rbpFire ();
1977: }
1978: }
1979: MC68901.mfpRintFall ();
1980: } else {
1981: MC68901.mfpRintRise ();
1982: }
1983: }
1984: if (n != crtVIdleStart) {
1985: if (crtBeginningAllStamp != crtAllStamp) {
1986: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
1987: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
1988: crtStereoscopicDrawRaster (crtScreenY);
1989: }
1990: }
1991: crtScreenY++;
1992: crtDataY++;
1993: TickerQueue.tkqAdd (crtTicker = NormalDrawDispSync, crtClock += crtHFrontLength);
1994: } else {
1995: if (crtBeginningAllStamp != crtAllStamp) {
1996: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
1997: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
1998: crtStereoscopicDrawRaster (crtScreenY);
1999: }
2000: }
2001: MC68901.mfpVdispFall ();
2002: if (crtClearFrames != 0) {
2003: crtClearFrames--;
2004: }
2005: if (crtDirtyY0 >= 0) {
2006: crtUpdateScreen ();
2007: if (CRT_ENABLE_INTERMITTENT) {
2008: crtIntermittentCounter = crtIntermittentInterval;
2009: }
2010: }
2011: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2012: crtDoFrameTask ();
2013: }
2014: TickerQueue.tkqAdd (crtTicker = NormalDrawIdleSync, crtClock += crtHFrontLength);
2015: }
2016: } else {
2017:
2018: if (crtBeginningAllStamp != crtAllStamp) {
2019: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2020: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2021: crtStereoscopicDrawRaster (crtScreenY);
2022: }
2023: }
2024: crtScreenY++;
2025: crtDataY++;
2026: TickerQueue.tkqAdd (crtTicker = NormalDrawDispSync, crtClock += crtHFrontLength);
2027: }
2028: }
2029: };
2030:
2031: public static final TickerQueue.Ticker NormalDrawDispSync = new TickerQueue.Ticker () {
2032: @Override protected void tick () {
2033: MC68901.mfpHsyncRise ();
2034: if (crtClearFrames != 0) {
2035: crtRapidClear (crtDataY);
2036: crtRasterStamp[crtDataY] = 0;
2037: }
2038: TickerQueue.tkqAdd (crtTicker = NormalDrawDispBack, crtClock += crtHSyncLength);
2039: }
2040: };
2041:
2042: public static final TickerQueue.Ticker NormalDrawDispBack = new TickerQueue.Ticker () {
2043: @Override protected void tick () {
2044: MC68901.mfpHsyncFall ();
2045: TickerQueue.tkqAdd (crtTicker = NormalDrawDispDisp, crtClock += crtHBackLength);
2046: }
2047: };
2048:
2049: public static final TickerQueue.Ticker NormalDrawDispDisp = new TickerQueue.Ticker () {
2050: @Override protected void tick () {
2051: if (crtRasterStamp[crtDataY] != crtAllStamp) {
2052: crtRasterStamp[crtDataY] = crtAllStamp;
2053: crtBeginningAllStamp = crtAllStamp;
2054: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, false);
2055: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2056: crtStereoscopicDrawRaster (crtScreenY);
2057: }
2058: if (crtDirtyY0 < 0) {
2059: crtDirtyY0 = crtScreenY;
2060: }
2061: crtDirtyY1 = crtScreenY;
2062: }
2063: if (SpriteScreen.SPR_THREE_STEPS) {
2064: if (SpriteScreen.sprActive) {
2065:
2066:
2067: SpriteScreen.sprStep1 (crtDataY + 2);
2068: SpriteScreen.sprSwap ();
2069: SpriteScreen.sprStep2 (crtDataY + 1);
2070: }
2071: }
2072: TickerQueue.tkqAdd (crtTicker = NormalDrawDispFront, crtClock += crtHDispLength);
2073: }
2074: };
2075:
2076: public static final TickerQueue.Ticker NormalOmitIdleFront = new TickerQueue.Ticker () {
2077: @Override protected void tick () {
2078: int n = ++crtRasterNumber;
2079: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
2080: if (crtR04VFrontEndCurr < n) {
2081: n = crtRasterNumber = 0;
2082: }
2083: if (crtRasterCopyOn) {
2084: crtDoRasterCopy ();
2085: }
2086: if (RasterBreakPoint.RBP_ON) {
2087: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2088: RasterBreakPoint.rbpFire ();
2089: }
2090: }
2091: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2092: if (irq != MC68901.mfpGpipRint) {
2093: if (irq == 0) {
2094: if (RasterBreakPoint.RBP_ON) {
2095: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2096: RasterBreakPoint.rbpFire ();
2097: }
2098: }
2099: MC68901.mfpRintFall ();
2100: } else {
2101: MC68901.mfpRintRise ();
2102: }
2103: }
2104: if (n != crtVDispStart) {
2105: TickerQueue.tkqAdd (crtTicker = NormalOmitIdleSync, crtClock += crtHFrontLength);
2106: } else {
2107: MC68901.mfpVdispRise ();
2108: crtR11TxYZero = crtR11TxYCurr;
2109: crtR13GrYZero[0] = crtR13GrYCurr[0];
2110: crtR13GrYZero[1] = crtR13GrYCurr[1];
2111: crtR13GrYZero[2] = crtR13GrYCurr[2];
2112: crtR13GrYZero[3] = crtR13GrYCurr[3];
2113: if (crtR11TxYZeroLast != crtR11TxYZero ||
2114: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
2115: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
2116: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
2117: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
2118: crtR11TxYZeroLast = crtR11TxYZero;
2119: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
2120: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
2121: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
2122: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
2123: crtAllStamp += 2;
2124: }
2125: crtDataY = 0;
2126: if (crtClearStandby) {
2127: crtClearStandby = false;
2128: crtClearFrames = 1;
2129: }
2130: if (SpriteScreen.SPR_THREE_STEPS) {
2131: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
2132: if (SpriteScreen.sprActive) {
2133: crtAllStamp += 2;
2134:
2135: SpriteScreen.sprStep1 (0);
2136: SpriteScreen.sprSwap ();
2137:
2138:
2139: SpriteScreen.sprStep1 (1);
2140: SpriteScreen.sprSwap ();
2141: SpriteScreen.sprStep2 (0);
2142: }
2143: }
2144: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2145: crtStereoscopicStart ();
2146: }
2147: TickerQueue.tkqAdd (crtTicker = NormalOmitDispSync, crtClock += crtHFrontLength);
2148: }
2149: } else {
2150:
2151: TickerQueue.tkqAdd (crtTicker = NormalOmitIdleSync, crtClock += crtHFrontLength);
2152: }
2153: }
2154: };
2155:
2156: public static final TickerQueue.Ticker NormalOmitIdleSync = new TickerQueue.Ticker () {
2157: @Override protected void tick () {
2158: MC68901.mfpHsyncRise ();
2159: TickerQueue.tkqAdd (crtTicker = NormalOmitIdleBackDisp, crtClock += crtHSyncLength);
2160: }
2161: };
2162:
2163: public static final TickerQueue.Ticker NormalOmitIdleBackDisp = new TickerQueue.Ticker () {
2164: @Override protected void tick () {
2165: MC68901.mfpHsyncFall ();
2166: TickerQueue.tkqAdd (crtTicker = NormalOmitIdleFront, crtClock += crtHBackDispLength);
2167: }
2168: };
2169:
2170: public static final TickerQueue.Ticker NormalOmitDispFront = new TickerQueue.Ticker () {
2171: @Override protected void tick () {
2172: int n = ++crtRasterNumber;
2173: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
2174: if (crtRasterCopyOn) {
2175: crtDoRasterCopy ();
2176: }
2177: if (RasterBreakPoint.RBP_ON) {
2178: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2179: RasterBreakPoint.rbpFire ();
2180: }
2181: }
2182: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2183: if (irq != MC68901.mfpGpipRint) {
2184: if (irq == 0) {
2185: if (RasterBreakPoint.RBP_ON) {
2186: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2187: RasterBreakPoint.rbpFire ();
2188: }
2189: }
2190: MC68901.mfpRintFall ();
2191: } else {
2192: MC68901.mfpRintRise ();
2193: }
2194: }
2195: if (n != crtVIdleStart) {
2196: TickerQueue.tkqAdd (crtTicker = NormalOmitDispSync, crtClock += crtHFrontLength);
2197: } else {
2198: MC68901.mfpVdispFall ();
2199: if (crtClearFrames != 0) {
2200: crtClearFrames--;
2201: }
2202: if (CRT_ENABLE_INTERMITTENT) {
2203: crtIntermittentCounter--;
2204: }
2205: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2206: crtDoFrameTask ();
2207: }
2208: TickerQueue.tkqAdd (crtTicker = NormalOmitIdleSync, crtClock += crtHFrontLength);
2209: }
2210: } else {
2211:
2212: TickerQueue.tkqAdd (crtTicker = NormalOmitDispSync, crtClock += crtHFrontLength);
2213: }
2214: }
2215: };
2216:
2217: public static final TickerQueue.Ticker NormalOmitDispSync = new TickerQueue.Ticker () {
2218: @Override protected void tick () {
2219: MC68901.mfpHsyncRise ();
2220: if (crtClearFrames != 0) {
2221: crtRapidClear (crtDataY);
2222: crtRasterStamp[crtDataY] = 0;
2223: }
2224: TickerQueue.tkqAdd (crtTicker = NormalOmitDispBackDisp, crtClock += crtHSyncLength);
2225: }
2226: };
2227:
2228: public static final TickerQueue.Ticker NormalOmitDispBackDisp = new TickerQueue.Ticker () {
2229: @Override protected void tick () {
2230: MC68901.mfpHsyncFall ();
2231: TickerQueue.tkqAdd (crtTicker = NormalOmitDispFront, crtClock += crtHBackDispLength);
2232: }
2233: };
2234:
2235:
2236:
2237:
2238: public static final TickerQueue.Ticker DuplicationStart = new TickerQueue.Ticker () {
2239: @Override protected void tick () {
2240: if (MC68901.mfpGpipHsync != 0) {
2241: MC68901.mfpHsyncFall ();
2242: }
2243: int n = crtRasterNumber = crtVIdleStart;
2244: if (crtRasterCopyOn) {
2245: crtDoRasterCopy ();
2246: }
2247: if (RasterBreakPoint.RBP_ON) {
2248: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2249: RasterBreakPoint.rbpFire ();
2250: }
2251: }
2252: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2253: if (irq != MC68901.mfpGpipRint) {
2254: if (irq == 0) {
2255: if (RasterBreakPoint.RBP_ON) {
2256: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2257: RasterBreakPoint.rbpFire ();
2258: }
2259: }
2260: MC68901.mfpRintFall ();
2261: } else {
2262: MC68901.mfpRintRise ();
2263: }
2264: }
2265: if (MC68901.mfpGpipVdisp != 0) {
2266: MC68901.mfpVdispFall ();
2267: }
2268: crtClearFrames = 0;
2269: if (CRT_ENABLE_INTERMITTENT) {
2270: crtIntermittentCounter = 0;
2271: }
2272: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2273: crtDoFrameTask ();
2274: }
2275: TickerQueue.tkqAdd (crtTicker = DuplicationDrawIdleSync, crtClock += crtHFrontLength);
2276: }
2277: };
2278:
2279: public static final TickerQueue.Ticker DuplicationDrawIdleFront = new TickerQueue.Ticker () {
2280: @Override protected void tick () {
2281: int n = ++crtRasterNumber;
2282: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
2283: if (crtR04VFrontEndCurr < n) {
2284: n = crtRasterNumber = 0;
2285: }
2286: if (crtRasterCopyOn) {
2287: crtDoRasterCopy ();
2288: }
2289: if (RasterBreakPoint.RBP_ON) {
2290: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2291: RasterBreakPoint.rbpFire ();
2292: }
2293: }
2294: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2295: if (irq != MC68901.mfpGpipRint) {
2296: if (irq == 0) {
2297: if (RasterBreakPoint.RBP_ON) {
2298: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2299: RasterBreakPoint.rbpFire ();
2300: }
2301: }
2302: MC68901.mfpRintFall ();
2303: } else {
2304: MC68901.mfpRintRise ();
2305: }
2306: }
2307: if (n != crtVDispStart) {
2308: TickerQueue.tkqAdd (crtTicker = DuplicationDrawIdleSync, crtClock += crtHFrontLength);
2309: } else {
2310: MC68901.mfpVdispRise ();
2311: crtR11TxYZero = crtR11TxYCurr;
2312: crtR13GrYZero[0] = crtR13GrYCurr[0];
2313: crtR13GrYZero[1] = crtR13GrYCurr[1];
2314: crtR13GrYZero[2] = crtR13GrYCurr[2];
2315: crtR13GrYZero[3] = crtR13GrYCurr[3];
2316: if (crtR11TxYZeroLast != crtR11TxYZero ||
2317: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
2318: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
2319: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
2320: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
2321: crtR11TxYZeroLast = crtR11TxYZero;
2322: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
2323: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
2324: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
2325: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
2326: crtAllStamp += 2;
2327: }
2328: crtDataY = 0;
2329: if (crtClearStandby) {
2330: crtClearStandby = false;
2331: crtClearFrames = 1;
2332: }
2333: crtScreenY = 0;
2334: crtDirtyY0 = -1;
2335: if (SpriteScreen.SPR_THREE_STEPS) {
2336: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
2337: if (SpriteScreen.sprActive) {
2338: crtAllStamp += 2;
2339:
2340: SpriteScreen.sprStep1 (0);
2341: SpriteScreen.sprSwap ();
2342:
2343:
2344: SpriteScreen.sprStep1 (0);
2345: SpriteScreen.sprSwap ();
2346: SpriteScreen.sprStep2 (0);
2347: }
2348: }
2349: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2350: crtStereoscopicStart ();
2351: }
2352: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispEvenSync, crtClock += crtHFrontLength);
2353: }
2354: } else {
2355:
2356: TickerQueue.tkqAdd (crtTicker = DuplicationDrawIdleSync, crtClock += crtHFrontLength);
2357: }
2358: }
2359: };
2360:
2361: public static final TickerQueue.Ticker DuplicationDrawIdleSync = new TickerQueue.Ticker () {
2362: @Override protected void tick () {
2363: MC68901.mfpHsyncRise ();
2364: TickerQueue.tkqAdd (crtTicker = DuplicationDrawIdleBackDisp, crtClock += crtHSyncLength);
2365: }
2366: };
2367:
2368: public static final TickerQueue.Ticker DuplicationDrawIdleBackDisp = new TickerQueue.Ticker () {
2369: @Override protected void tick () {
2370: MC68901.mfpHsyncFall ();
2371: TickerQueue.tkqAdd (crtTicker = DuplicationDrawIdleFront, crtClock += crtHBackDispLength);
2372: }
2373: };
2374:
2375: public static final TickerQueue.Ticker DuplicationDrawDispEvenFront = new TickerQueue.Ticker () {
2376: @Override protected void tick () {
2377: int n = ++crtRasterNumber;
2378: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
2379: if (crtRasterCopyOn) {
2380: crtDoRasterCopy ();
2381: }
2382: if (RasterBreakPoint.RBP_ON) {
2383: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2384: RasterBreakPoint.rbpFire ();
2385: }
2386: }
2387: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2388: if (irq != MC68901.mfpGpipRint) {
2389: if (irq == 0) {
2390: if (RasterBreakPoint.RBP_ON) {
2391: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2392: RasterBreakPoint.rbpFire ();
2393: }
2394: }
2395: MC68901.mfpRintFall ();
2396: } else {
2397: MC68901.mfpRintRise ();
2398: }
2399: }
2400: if (n != crtVIdleStart) {
2401: if (crtBeginningAllStamp != crtAllStamp) {
2402: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2403: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2404: crtStereoscopicDrawRaster (crtScreenY);
2405: }
2406: }
2407: crtScreenY++;
2408: crtDataY++;
2409: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispEvenSync, crtClock += crtHFrontLength);
2410: } else {
2411: if (crtBeginningAllStamp != crtAllStamp) {
2412: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2413: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2414: crtStereoscopicDrawRaster (crtScreenY);
2415: }
2416: }
2417: MC68901.mfpVdispFall ();
2418: if (crtClearFrames != 0) {
2419: crtClearFrames--;
2420: }
2421: if (crtDirtyY0 >= 0) {
2422: crtUpdateScreen ();
2423: if (CRT_ENABLE_INTERMITTENT) {
2424: crtIntermittentCounter = crtIntermittentInterval;
2425: }
2426: }
2427: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2428: crtDoFrameTask ();
2429: }
2430: TickerQueue.tkqAdd (crtTicker = DuplicationDrawIdleSync, crtClock += crtHFrontLength);
2431: }
2432: } else {
2433:
2434: if (crtBeginningAllStamp != crtAllStamp) {
2435: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2436: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2437: crtStereoscopicDrawRaster (crtScreenY);
2438: }
2439: }
2440: crtScreenY++;
2441: crtDataY++;
2442: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispEvenSync, crtClock += crtHFrontLength);
2443: }
2444: }
2445: };
2446:
2447: public static final TickerQueue.Ticker DuplicationDrawDispOddFront = new TickerQueue.Ticker () {
2448: @Override protected void tick () {
2449: int n = ++crtRasterNumber;
2450: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
2451: if (crtRasterCopyOn) {
2452: crtDoRasterCopy ();
2453: }
2454: if (RasterBreakPoint.RBP_ON) {
2455: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2456: RasterBreakPoint.rbpFire ();
2457: }
2458: }
2459: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2460: if (irq != MC68901.mfpGpipRint) {
2461: if (irq == 0) {
2462: if (RasterBreakPoint.RBP_ON) {
2463: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2464: RasterBreakPoint.rbpFire ();
2465: }
2466: }
2467: MC68901.mfpRintFall ();
2468: } else {
2469: MC68901.mfpRintRise ();
2470: }
2471: }
2472: if (n != crtVIdleStart) {
2473: if (crtBeginningAllStamp != crtAllStamp) {
2474: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2475: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2476: crtStereoscopicDrawRaster (crtScreenY);
2477: }
2478: }
2479: crtScreenY++;
2480: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispOddSync, crtClock += crtHFrontLength);
2481: } else {
2482: if (crtBeginningAllStamp != crtAllStamp) {
2483: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2484: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2485: crtStereoscopicDrawRaster (crtScreenY);
2486: }
2487: }
2488: MC68901.mfpVdispFall ();
2489: if (crtClearFrames != 0) {
2490: crtClearFrames--;
2491: }
2492: if (crtDirtyY0 >= 0) {
2493: crtUpdateScreen ();
2494: if (CRT_ENABLE_INTERMITTENT) {
2495: crtIntermittentCounter = crtIntermittentInterval;
2496: }
2497: }
2498: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2499: crtDoFrameTask ();
2500: }
2501: TickerQueue.tkqAdd (crtTicker = DuplicationDrawIdleSync, crtClock += crtHFrontLength);
2502: }
2503: } else {
2504:
2505: if (crtBeginningAllStamp != crtAllStamp) {
2506: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2507: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2508: crtStereoscopicDrawRaster (crtScreenY);
2509: }
2510: }
2511: crtScreenY++;
2512: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispOddSync, crtClock += crtHFrontLength);
2513: }
2514: }
2515: };
2516:
2517: public static final TickerQueue.Ticker DuplicationDrawDispEvenSync = new TickerQueue.Ticker () {
2518: @Override protected void tick () {
2519: MC68901.mfpHsyncRise ();
2520: if (crtClearFrames != 0) {
2521: crtRapidClear (crtDataY);
2522: crtRasterStamp[crtDataY] = 0;
2523: }
2524: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispEvenBack, crtClock += crtHSyncLength);
2525: }
2526: };
2527:
2528: public static final TickerQueue.Ticker DuplicationDrawDispOddSync = new TickerQueue.Ticker () {
2529: @Override protected void tick () {
2530: MC68901.mfpHsyncRise ();
2531: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispOddBack, crtClock += crtHSyncLength);
2532: }
2533: };
2534:
2535: public static final TickerQueue.Ticker DuplicationDrawDispEvenBack = new TickerQueue.Ticker () {
2536: @Override protected void tick () {
2537: MC68901.mfpHsyncFall ();
2538: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispEvenDisp, crtClock += crtHBackLength);
2539: }
2540: };
2541:
2542: public static final TickerQueue.Ticker DuplicationDrawDispOddBack = new TickerQueue.Ticker () {
2543: @Override protected void tick () {
2544: MC68901.mfpHsyncFall ();
2545: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispOddDisp, crtClock += crtHBackLength);
2546: }
2547: };
2548:
2549: public static final TickerQueue.Ticker DuplicationDrawDispEvenDisp = new TickerQueue.Ticker () {
2550: @Override protected void tick () {
2551: if (crtRasterStamp[crtDataY] != crtAllStamp) {
2552: crtBeginningAllStamp = crtAllStamp;
2553: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, false);
2554: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2555: crtStereoscopicDrawRaster (crtScreenY);
2556: }
2557: if (crtDirtyY0 < 0) {
2558: crtDirtyY0 = crtScreenY;
2559: }
2560: crtDirtyY1 = crtScreenY;
2561: }
2562: if (SpriteScreen.SPR_THREE_STEPS) {
2563: if (SpriteScreen.sprActive) {
2564:
2565:
2566: SpriteScreen.sprStep1 (crtDataY + 1);
2567: SpriteScreen.sprSwap ();
2568: SpriteScreen.sprStep2 (crtDataY);
2569: }
2570: }
2571: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispOddFront, crtClock += crtHDispLength);
2572: }
2573: };
2574:
2575: public static final TickerQueue.Ticker DuplicationDrawDispOddDisp = new TickerQueue.Ticker () {
2576: @Override protected void tick () {
2577: if (crtRasterStamp[crtDataY] != crtAllStamp) {
2578: crtRasterStamp[crtDataY] = crtAllStamp;
2579: crtBeginningAllStamp = crtAllStamp;
2580: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, false);
2581: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2582: crtStereoscopicDrawRaster (crtScreenY);
2583: }
2584: if (crtDirtyY0 < 0) {
2585: crtDirtyY0 = crtScreenY;
2586: }
2587: crtDirtyY1 = crtScreenY;
2588: }
2589: if (SpriteScreen.SPR_THREE_STEPS) {
2590: if (SpriteScreen.sprActive) {
2591:
2592:
2593: SpriteScreen.sprStep1 (crtDataY + 1);
2594: SpriteScreen.sprSwap ();
2595: SpriteScreen.sprStep2 (crtDataY + 1);
2596: }
2597: }
2598: TickerQueue.tkqAdd (crtTicker = DuplicationDrawDispEvenFront, crtClock += crtHDispLength);
2599: }
2600: };
2601:
2602: public static final TickerQueue.Ticker DuplicationOmitIdleFront = new TickerQueue.Ticker () {
2603: @Override protected void tick () {
2604: int n = ++crtRasterNumber;
2605: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
2606: if (crtR04VFrontEndCurr < n) {
2607: n = crtRasterNumber = 0;
2608: }
2609: if (crtRasterCopyOn) {
2610: crtDoRasterCopy ();
2611: }
2612: if (RasterBreakPoint.RBP_ON) {
2613: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2614: RasterBreakPoint.rbpFire ();
2615: }
2616: }
2617: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2618: if (irq != MC68901.mfpGpipRint) {
2619: if (irq == 0) {
2620: if (RasterBreakPoint.RBP_ON) {
2621: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2622: RasterBreakPoint.rbpFire ();
2623: }
2624: }
2625: MC68901.mfpRintFall ();
2626: } else {
2627: MC68901.mfpRintRise ();
2628: }
2629: }
2630: if (n != crtVDispStart) {
2631: TickerQueue.tkqAdd (crtTicker = DuplicationOmitIdleSync, crtClock += crtHFrontLength);
2632: } else {
2633: MC68901.mfpVdispRise ();
2634: crtR11TxYZero = crtR11TxYCurr;
2635: crtR13GrYZero[0] = crtR13GrYCurr[0];
2636: crtR13GrYZero[1] = crtR13GrYCurr[1];
2637: crtR13GrYZero[2] = crtR13GrYCurr[2];
2638: crtR13GrYZero[3] = crtR13GrYCurr[3];
2639: if (crtR11TxYZeroLast != crtR11TxYZero ||
2640: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
2641: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
2642: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
2643: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
2644: crtR11TxYZeroLast = crtR11TxYZero;
2645: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
2646: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
2647: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
2648: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
2649: crtAllStamp += 2;
2650: }
2651: crtDataY = 0;
2652: if (crtClearStandby) {
2653: crtClearStandby = false;
2654: crtClearFrames = 1;
2655: }
2656: if (SpriteScreen.SPR_THREE_STEPS) {
2657: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
2658: if (SpriteScreen.sprActive) {
2659: crtAllStamp += 2;
2660:
2661: SpriteScreen.sprStep1 (0);
2662: SpriteScreen.sprSwap ();
2663:
2664:
2665: SpriteScreen.sprStep1 (0);
2666: SpriteScreen.sprSwap ();
2667: SpriteScreen.sprStep2 (0);
2668: }
2669: }
2670: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2671: crtStereoscopicStart ();
2672: }
2673: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispEvenSync, crtClock += crtHFrontLength);
2674: }
2675: } else {
2676:
2677: TickerQueue.tkqAdd (crtTicker = DuplicationOmitIdleSync, crtClock += crtHFrontLength);
2678: }
2679: }
2680: };
2681:
2682: public static final TickerQueue.Ticker DuplicationOmitIdleSync = new TickerQueue.Ticker () {
2683: @Override protected void tick () {
2684: MC68901.mfpHsyncRise ();
2685: TickerQueue.tkqAdd (crtTicker = DuplicationOmitIdleBackDisp, crtClock += crtHSyncLength);
2686: }
2687: };
2688:
2689: public static final TickerQueue.Ticker DuplicationOmitIdleBackDisp = new TickerQueue.Ticker () {
2690: @Override protected void tick () {
2691: MC68901.mfpHsyncFall ();
2692: TickerQueue.tkqAdd (crtTicker = DuplicationOmitIdleFront, crtClock += crtHBackDispLength);
2693: }
2694: };
2695:
2696: public static final TickerQueue.Ticker DuplicationOmitDispEvenFront = new TickerQueue.Ticker () {
2697: @Override protected void tick () {
2698: int n = ++crtRasterNumber;
2699: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
2700: if (crtRasterCopyOn) {
2701: crtDoRasterCopy ();
2702: }
2703: if (RasterBreakPoint.RBP_ON) {
2704: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2705: RasterBreakPoint.rbpFire ();
2706: }
2707: }
2708: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2709: if (irq != MC68901.mfpGpipRint) {
2710: if (irq == 0) {
2711: if (RasterBreakPoint.RBP_ON) {
2712: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2713: RasterBreakPoint.rbpFire ();
2714: }
2715: }
2716: MC68901.mfpRintFall ();
2717: } else {
2718: MC68901.mfpRintRise ();
2719: }
2720: }
2721: if (n != crtVIdleStart) {
2722: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispEvenSync, crtClock += crtHFrontLength);
2723: } else {
2724: MC68901.mfpVdispFall ();
2725: if (crtClearFrames != 0) {
2726: crtClearFrames--;
2727: }
2728: if (CRT_ENABLE_INTERMITTENT) {
2729: crtIntermittentCounter--;
2730: }
2731: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2732: crtDoFrameTask ();
2733: }
2734: TickerQueue.tkqAdd (crtTicker = DuplicationOmitIdleSync, crtClock += crtHFrontLength);
2735: }
2736: } else {
2737:
2738: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispEvenSync, crtClock += crtHFrontLength);
2739: }
2740: }
2741: };
2742:
2743: public static final TickerQueue.Ticker DuplicationOmitDispOddFront = new TickerQueue.Ticker () {
2744: @Override protected void tick () {
2745: int n = ++crtRasterNumber;
2746: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
2747: if (crtRasterCopyOn) {
2748: crtDoRasterCopy ();
2749: }
2750: if (RasterBreakPoint.RBP_ON) {
2751: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2752: RasterBreakPoint.rbpFire ();
2753: }
2754: }
2755: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2756: if (irq != MC68901.mfpGpipRint) {
2757: if (irq == 0) {
2758: if (RasterBreakPoint.RBP_ON) {
2759: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2760: RasterBreakPoint.rbpFire ();
2761: }
2762: }
2763: MC68901.mfpRintFall ();
2764: } else {
2765: MC68901.mfpRintRise ();
2766: }
2767: }
2768: if (n != crtVIdleStart) {
2769: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispOddSync, crtClock += crtHFrontLength);
2770: } else {
2771: MC68901.mfpVdispFall ();
2772: if (crtClearFrames != 0) {
2773: crtClearFrames--;
2774: }
2775: if (CRT_ENABLE_INTERMITTENT) {
2776: crtIntermittentCounter--;
2777: }
2778: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2779: crtDoFrameTask ();
2780: }
2781: TickerQueue.tkqAdd (crtTicker = DuplicationOmitIdleSync, crtClock += crtHFrontLength);
2782: }
2783: } else {
2784:
2785: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispOddSync, crtClock += crtHFrontLength);
2786: }
2787: }
2788: };
2789:
2790: public static final TickerQueue.Ticker DuplicationOmitDispEvenSync = new TickerQueue.Ticker () {
2791: @Override protected void tick () {
2792: MC68901.mfpHsyncRise ();
2793: if (crtClearFrames != 0) {
2794: crtRapidClear (crtDataY);
2795: crtRasterStamp[crtDataY] = 0;
2796: }
2797: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispEvenBackDisp, crtClock += crtHSyncLength);
2798: }
2799: };
2800:
2801: public static final TickerQueue.Ticker DuplicationOmitDispOddSync = new TickerQueue.Ticker () {
2802: @Override protected void tick () {
2803: MC68901.mfpHsyncRise ();
2804: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispOddBackDisp, crtClock += crtHSyncLength);
2805: }
2806: };
2807:
2808: public static final TickerQueue.Ticker DuplicationOmitDispEvenBackDisp = new TickerQueue.Ticker () {
2809: @Override protected void tick () {
2810: MC68901.mfpHsyncFall ();
2811: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispOddFront, crtClock += crtHBackDispLength);
2812: }
2813: };
2814:
2815: public static final TickerQueue.Ticker DuplicationOmitDispOddBackDisp = new TickerQueue.Ticker () {
2816: @Override protected void tick () {
2817: MC68901.mfpHsyncFall ();
2818: TickerQueue.tkqAdd (crtTicker = DuplicationOmitDispEvenFront, crtClock += crtHBackDispLength);
2819: }
2820: };
2821:
2822:
2823:
2824:
2825: public static final TickerQueue.Ticker InterlaceStart = new TickerQueue.Ticker () {
2826: @Override protected void tick () {
2827: if (MC68901.mfpGpipHsync != 0) {
2828: MC68901.mfpHsyncFall ();
2829: }
2830: int n = crtRasterNumber = crtVIdleStart;
2831: if (crtRasterCopyOn) {
2832: crtDoRasterCopy ();
2833: }
2834: if (RasterBreakPoint.RBP_ON) {
2835: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2836: RasterBreakPoint.rbpFire ();
2837: }
2838: }
2839: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2840: if (irq != MC68901.mfpGpipRint) {
2841: if (irq == 0) {
2842: if (RasterBreakPoint.RBP_ON) {
2843: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2844: RasterBreakPoint.rbpFire ();
2845: }
2846: }
2847: MC68901.mfpRintFall ();
2848: } else {
2849: MC68901.mfpRintRise ();
2850: }
2851: }
2852: if (MC68901.mfpGpipVdisp != 0) {
2853: MC68901.mfpVdispFall ();
2854: }
2855: crtFrameParity = 0;
2856: crtClearFrames = 0;
2857: if (CRT_ENABLE_INTERMITTENT) {
2858: crtIntermittentCounter = 0;
2859: }
2860: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
2861: crtDoFrameTask ();
2862: }
2863: TickerQueue.tkqAdd (crtTicker = InterlaceDrawIdleSync, crtClock += crtHFrontLength);
2864: }
2865: };
2866:
2867: public static final TickerQueue.Ticker InterlaceDrawIdleFront = new TickerQueue.Ticker () {
2868: @Override protected void tick () {
2869: int n = ++crtRasterNumber;
2870: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
2871: if (crtR04VFrontEndCurr < n) {
2872: n = crtRasterNumber = 0;
2873: }
2874: if (crtRasterCopyOn) {
2875: crtDoRasterCopy ();
2876: }
2877: if (RasterBreakPoint.RBP_ON) {
2878: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2879: RasterBreakPoint.rbpFire ();
2880: }
2881: }
2882: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2883: if (irq != MC68901.mfpGpipRint) {
2884: if (irq == 0) {
2885: if (RasterBreakPoint.RBP_ON) {
2886: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2887: RasterBreakPoint.rbpFire ();
2888: }
2889: }
2890: MC68901.mfpRintFall ();
2891: } else {
2892: MC68901.mfpRintRise ();
2893: }
2894: }
2895: if (n != crtVDispStart) {
2896: TickerQueue.tkqAdd (crtTicker = InterlaceDrawIdleSync, crtClock += crtHFrontLength);
2897: } else {
2898: MC68901.mfpVdispRise ();
2899: crtR11TxYZero = crtR11TxYCurr;
2900: crtR13GrYZero[0] = crtR13GrYCurr[0];
2901: crtR13GrYZero[1] = crtR13GrYCurr[1];
2902: crtR13GrYZero[2] = crtR13GrYCurr[2];
2903: crtR13GrYZero[3] = crtR13GrYCurr[3];
2904: if (crtR11TxYZeroLast != crtR11TxYZero ||
2905: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
2906: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
2907: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
2908: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
2909: crtR11TxYZeroLast = crtR11TxYZero;
2910: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
2911: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
2912: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
2913: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
2914: crtAllStamp += 2;
2915: }
2916: crtDataY = crtFrameParity;
2917: if (crtClearStandby) {
2918: crtClearStandby = false;
2919: crtClearFrames = 2;
2920: }
2921: crtScreenY = crtFrameParity;
2922: crtDirtyY0 = -1;
2923: if (SpriteScreen.SPR_THREE_STEPS) {
2924: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
2925: if (SpriteScreen.sprActive) {
2926: crtAllStamp += 2;
2927:
2928: SpriteScreen.sprStep1 (0);
2929: SpriteScreen.sprSwap ();
2930:
2931:
2932: SpriteScreen.sprStep1 (2);
2933: SpriteScreen.sprSwap ();
2934: SpriteScreen.sprStep2 (0);
2935: }
2936: }
2937: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2938: crtStereoscopicStart ();
2939: }
2940: TickerQueue.tkqAdd (crtTicker = InterlaceDrawDispSync, crtClock += crtHFrontLength);
2941: }
2942: } else {
2943:
2944: TickerQueue.tkqAdd (crtTicker = InterlaceDrawIdleSync, crtClock += crtHFrontLength);
2945: }
2946: }
2947: };
2948:
2949: public static final TickerQueue.Ticker InterlaceDrawIdleSync = new TickerQueue.Ticker () {
2950: @Override protected void tick () {
2951: MC68901.mfpHsyncRise ();
2952: TickerQueue.tkqAdd (crtTicker = InterlaceDrawIdleBackDisp, crtClock += crtHSyncLength);
2953: }
2954: };
2955:
2956: public static final TickerQueue.Ticker InterlaceDrawIdleBackDisp = new TickerQueue.Ticker () {
2957: @Override protected void tick () {
2958: MC68901.mfpHsyncFall ();
2959: TickerQueue.tkqAdd (crtTicker = InterlaceDrawIdleFront, crtClock += crtHBackDispLength);
2960: }
2961: };
2962:
2963: public static final TickerQueue.Ticker InterlaceDrawDispFront = new TickerQueue.Ticker () {
2964: @Override protected void tick () {
2965: int n = ++crtRasterNumber;
2966: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
2967: if (crtRasterCopyOn) {
2968: crtDoRasterCopy ();
2969: }
2970: if (RasterBreakPoint.RBP_ON) {
2971: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
2972: RasterBreakPoint.rbpFire ();
2973: }
2974: }
2975: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
2976: if (irq != MC68901.mfpGpipRint) {
2977: if (irq == 0) {
2978: if (RasterBreakPoint.RBP_ON) {
2979: if (RasterBreakPoint.rbpIRQBreakEnabled) {
2980: RasterBreakPoint.rbpFire ();
2981: }
2982: }
2983: MC68901.mfpRintFall ();
2984: } else {
2985: MC68901.mfpRintRise ();
2986: }
2987: }
2988: if (n != crtVIdleStart) {
2989: if (crtBeginningAllStamp != crtAllStamp) {
2990: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
2991: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
2992: crtStereoscopicDrawRaster (crtScreenY);
2993: }
2994: }
2995: crtScreenY += 2;
2996: crtDataY += 2;
2997: TickerQueue.tkqAdd (crtTicker = InterlaceDrawDispSync, crtClock += crtHFrontLength);
2998: } else {
2999: if (crtBeginningAllStamp != crtAllStamp) {
3000: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3001: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3002: crtStereoscopicDrawRaster (crtScreenY);
3003: }
3004: }
3005: MC68901.mfpVdispFall ();
3006: if (crtClearFrames != 0) {
3007: crtClearFrames--;
3008: }
3009: if (crtDirtyY0 >= 0) {
3010: crtUpdateScreen ();
3011: if (CRT_ENABLE_INTERMITTENT) {
3012: crtIntermittentCounter = crtIntermittentInterval;
3013: }
3014: }
3015: crtFrameParity ^= 1;
3016: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3017: crtDoFrameTask ();
3018: }
3019: TickerQueue.tkqAdd (crtTicker = InterlaceDrawIdleSync, crtClock += crtHFrontLength);
3020: }
3021: } else {
3022:
3023: if (crtBeginningAllStamp != crtAllStamp) {
3024: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3025: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3026: crtStereoscopicDrawRaster (crtScreenY);
3027: }
3028: }
3029: crtScreenY += 2;
3030: crtDataY += 2;
3031: TickerQueue.tkqAdd (crtTicker = InterlaceDrawDispSync, crtClock += crtHFrontLength);
3032: }
3033: }
3034: };
3035:
3036: public static final TickerQueue.Ticker InterlaceDrawDispSync = new TickerQueue.Ticker () {
3037: @Override protected void tick () {
3038: MC68901.mfpHsyncRise ();
3039: if (crtClearFrames != 0) {
3040: crtRapidClear (crtDataY);
3041: crtRasterStamp[crtDataY] = 0;
3042: }
3043: TickerQueue.tkqAdd (crtTicker = InterlaceDrawDispBack, crtClock += crtHSyncLength);
3044: }
3045: };
3046:
3047: public static final TickerQueue.Ticker InterlaceDrawDispBack = new TickerQueue.Ticker () {
3048: @Override protected void tick () {
3049: MC68901.mfpHsyncFall ();
3050: TickerQueue.tkqAdd (crtTicker = InterlaceDrawDispDisp, crtClock += crtHBackLength);
3051: }
3052: };
3053:
3054: public static final TickerQueue.Ticker InterlaceDrawDispDisp = new TickerQueue.Ticker () {
3055: @Override protected void tick () {
3056: if (crtRasterStamp[crtDataY] != crtAllStamp) {
3057: crtRasterStamp[crtDataY] = crtAllStamp;
3058: crtBeginningAllStamp = crtAllStamp;
3059: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, false);
3060: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3061: crtStereoscopicDrawRaster (crtScreenY);
3062: }
3063: if (crtDirtyY0 < 0) {
3064: crtDirtyY0 = crtScreenY;
3065: }
3066: crtDirtyY1 = crtScreenY;
3067: }
3068: if (SpriteScreen.SPR_THREE_STEPS) {
3069: if (SpriteScreen.sprActive) {
3070:
3071:
3072: SpriteScreen.sprStep1 (crtDataY + 4);
3073: SpriteScreen.sprSwap ();
3074: SpriteScreen.sprStep2 (crtDataY + 2);
3075: }
3076: }
3077: TickerQueue.tkqAdd (crtTicker = InterlaceDrawDispFront, crtClock += crtHDispLength);
3078: }
3079: };
3080:
3081: public static final TickerQueue.Ticker InterlaceOmitIdleFront = new TickerQueue.Ticker () {
3082: @Override protected void tick () {
3083: int n = ++crtRasterNumber;
3084: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
3085: if (crtR04VFrontEndCurr < n) {
3086: n = crtRasterNumber = 0;
3087: }
3088: if (crtRasterCopyOn) {
3089: crtDoRasterCopy ();
3090: }
3091: if (RasterBreakPoint.RBP_ON) {
3092: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3093: RasterBreakPoint.rbpFire ();
3094: }
3095: }
3096: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3097: if (irq != MC68901.mfpGpipRint) {
3098: if (irq == 0) {
3099: if (RasterBreakPoint.RBP_ON) {
3100: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3101: RasterBreakPoint.rbpFire ();
3102: }
3103: }
3104: MC68901.mfpRintFall ();
3105: } else {
3106: MC68901.mfpRintRise ();
3107: }
3108: }
3109: if (n != crtVDispStart) {
3110: TickerQueue.tkqAdd (crtTicker = InterlaceOmitIdleSync, crtClock += crtHFrontLength);
3111: } else {
3112: MC68901.mfpVdispRise ();
3113: crtR11TxYZero = crtR11TxYCurr;
3114: crtR13GrYZero[0] = crtR13GrYCurr[0];
3115: crtR13GrYZero[1] = crtR13GrYCurr[1];
3116: crtR13GrYZero[2] = crtR13GrYCurr[2];
3117: crtR13GrYZero[3] = crtR13GrYCurr[3];
3118: if (crtR11TxYZeroLast != crtR11TxYZero ||
3119: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
3120: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
3121: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
3122: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
3123: crtR11TxYZeroLast = crtR11TxYZero;
3124: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
3125: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
3126: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
3127: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
3128: crtAllStamp += 2;
3129: }
3130: crtDataY = crtFrameParity;
3131: if (crtClearStandby) {
3132: crtClearStandby = false;
3133: crtClearFrames = 2;
3134: }
3135: if (SpriteScreen.SPR_THREE_STEPS) {
3136: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
3137: if (SpriteScreen.sprActive) {
3138: crtAllStamp += 2;
3139:
3140: SpriteScreen.sprStep1 (0);
3141: SpriteScreen.sprSwap ();
3142:
3143:
3144: SpriteScreen.sprStep1 (2);
3145: SpriteScreen.sprSwap ();
3146: SpriteScreen.sprStep2 (0);
3147: }
3148: }
3149: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3150: crtStereoscopicStart ();
3151: }
3152: TickerQueue.tkqAdd (crtTicker = InterlaceOmitDispSync, crtClock += crtHFrontLength);
3153: }
3154: } else {
3155:
3156: TickerQueue.tkqAdd (crtTicker = InterlaceOmitIdleSync, crtClock += crtHFrontLength);
3157: }
3158: }
3159: };
3160:
3161: public static final TickerQueue.Ticker InterlaceOmitIdleSync = new TickerQueue.Ticker () {
3162: @Override protected void tick () {
3163: MC68901.mfpHsyncRise ();
3164: TickerQueue.tkqAdd (crtTicker = InterlaceOmitIdleBackDisp, crtClock += crtHSyncLength);
3165: }
3166: };
3167:
3168: public static final TickerQueue.Ticker InterlaceOmitIdleBackDisp = new TickerQueue.Ticker () {
3169: @Override protected void tick () {
3170: MC68901.mfpHsyncFall ();
3171: TickerQueue.tkqAdd (crtTicker = InterlaceOmitIdleFront, crtClock += crtHBackDispLength);
3172: }
3173: };
3174:
3175: public static final TickerQueue.Ticker InterlaceOmitDispFront = new TickerQueue.Ticker () {
3176: @Override protected void tick () {
3177: int n = ++crtRasterNumber;
3178: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
3179: if (crtRasterCopyOn) {
3180: crtDoRasterCopy ();
3181: }
3182: if (RasterBreakPoint.RBP_ON) {
3183: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3184: RasterBreakPoint.rbpFire ();
3185: }
3186: }
3187: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3188: if (irq != MC68901.mfpGpipRint) {
3189: if (irq == 0) {
3190: if (RasterBreakPoint.RBP_ON) {
3191: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3192: RasterBreakPoint.rbpFire ();
3193: }
3194: }
3195: MC68901.mfpRintFall ();
3196: } else {
3197: MC68901.mfpRintRise ();
3198: }
3199: }
3200: if (n != crtVIdleStart) {
3201: TickerQueue.tkqAdd (crtTicker = InterlaceOmitDispSync, crtClock += crtHFrontLength);
3202: } else {
3203: MC68901.mfpVdispFall ();
3204: if (crtClearFrames != 0) {
3205: crtClearFrames--;
3206: }
3207: if (CRT_ENABLE_INTERMITTENT) {
3208: crtIntermittentCounter--;
3209: }
3210: crtFrameParity ^= 1;
3211: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3212: crtDoFrameTask ();
3213: }
3214: TickerQueue.tkqAdd (crtTicker = InterlaceOmitIdleSync, crtClock += crtHFrontLength);
3215: }
3216: } else {
3217:
3218: TickerQueue.tkqAdd (crtTicker = InterlaceOmitDispSync, crtClock += crtHFrontLength);
3219: }
3220: }
3221: };
3222:
3223: public static final TickerQueue.Ticker InterlaceOmitDispSync = new TickerQueue.Ticker () {
3224: @Override protected void tick () {
3225: MC68901.mfpHsyncRise ();
3226: if (crtClearFrames != 0) {
3227: crtRapidClear (crtDataY);
3228: crtRasterStamp[crtDataY] = 0;
3229: }
3230: TickerQueue.tkqAdd (crtTicker = InterlaceOmitDispBackDisp, crtClock += crtHSyncLength);
3231: }
3232: };
3233:
3234: public static final TickerQueue.Ticker InterlaceOmitDispBackDisp = new TickerQueue.Ticker () {
3235: @Override protected void tick () {
3236: MC68901.mfpHsyncFall ();
3237: TickerQueue.tkqAdd (crtTicker = InterlaceOmitDispFront, crtClock += crtHBackDispLength);
3238: }
3239: };
3240:
3241:
3242:
3243:
3244: public static final TickerQueue.Ticker SlitStart = new TickerQueue.Ticker () {
3245: @Override protected void tick () {
3246: if (MC68901.mfpGpipHsync != 0) {
3247: MC68901.mfpHsyncFall ();
3248: }
3249: int n = crtRasterNumber = crtVIdleStart;
3250: if (crtRasterCopyOn) {
3251: crtDoRasterCopy ();
3252: }
3253: if (RasterBreakPoint.RBP_ON) {
3254: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3255: RasterBreakPoint.rbpFire ();
3256: }
3257: }
3258: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3259: if (irq != MC68901.mfpGpipRint) {
3260: if (irq == 0) {
3261: if (RasterBreakPoint.RBP_ON) {
3262: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3263: RasterBreakPoint.rbpFire ();
3264: }
3265: }
3266: MC68901.mfpRintFall ();
3267: } else {
3268: MC68901.mfpRintRise ();
3269: }
3270: }
3271: if (MC68901.mfpGpipVdisp != 0) {
3272: MC68901.mfpVdispFall ();
3273: }
3274: crtClearFrames = 0;
3275: if (CRT_ENABLE_INTERMITTENT) {
3276: crtIntermittentCounter = 0;
3277: }
3278: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3279: crtDoFrameTask ();
3280: }
3281: TickerQueue.tkqAdd (crtTicker = SlitDrawIdleSync, crtClock += crtHFrontLength);
3282: }
3283: };
3284:
3285: public static final TickerQueue.Ticker SlitDrawIdleFront = new TickerQueue.Ticker () {
3286: @Override protected void tick () {
3287: int n = ++crtRasterNumber;
3288: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
3289: if (crtR04VFrontEndCurr < n) {
3290: n = crtRasterNumber = 0;
3291: }
3292: if (crtRasterCopyOn) {
3293: crtDoRasterCopy ();
3294: }
3295: if (RasterBreakPoint.RBP_ON) {
3296: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3297: RasterBreakPoint.rbpFire ();
3298: }
3299: }
3300: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3301: if (irq != MC68901.mfpGpipRint) {
3302: if (irq == 0) {
3303: if (RasterBreakPoint.RBP_ON) {
3304: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3305: RasterBreakPoint.rbpFire ();
3306: }
3307: }
3308: MC68901.mfpRintFall ();
3309: } else {
3310: MC68901.mfpRintRise ();
3311: }
3312: }
3313: if (n != crtVDispStart) {
3314: TickerQueue.tkqAdd (crtTicker = SlitDrawIdleSync, crtClock += crtHFrontLength);
3315: } else {
3316: MC68901.mfpVdispRise ();
3317: crtR11TxYZero = crtR11TxYCurr;
3318: crtR13GrYZero[0] = crtR13GrYCurr[0];
3319: crtR13GrYZero[1] = crtR13GrYCurr[1];
3320: crtR13GrYZero[2] = crtR13GrYCurr[2];
3321: crtR13GrYZero[3] = crtR13GrYCurr[3];
3322: if (crtR11TxYZeroLast != crtR11TxYZero ||
3323: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
3324: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
3325: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
3326: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
3327: crtR11TxYZeroLast = crtR11TxYZero;
3328: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
3329: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
3330: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
3331: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
3332: crtAllStamp += 2;
3333: }
3334: crtDataY = 0;
3335: if (crtClearStandby) {
3336: crtClearStandby = false;
3337: crtClearFrames = 1;
3338: }
3339: crtScreenY = 0;
3340: crtDirtyY0 = -1;
3341: if (SpriteScreen.SPR_THREE_STEPS) {
3342: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
3343: if (SpriteScreen.sprActive) {
3344: crtAllStamp += 2;
3345:
3346: SpriteScreen.sprStep1 (0);
3347: SpriteScreen.sprSwap ();
3348:
3349:
3350: SpriteScreen.sprStep1 (1);
3351: SpriteScreen.sprSwap ();
3352: SpriteScreen.sprStep2 (0);
3353: }
3354: }
3355: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3356: crtStereoscopicStart ();
3357: }
3358: TickerQueue.tkqAdd (crtTicker = SlitDrawDispSync, crtClock += crtHFrontLength);
3359: }
3360: } else {
3361:
3362: TickerQueue.tkqAdd (crtTicker = SlitDrawIdleSync, crtClock += crtHFrontLength);
3363: }
3364: }
3365: };
3366:
3367: public static final TickerQueue.Ticker SlitDrawIdleSync = new TickerQueue.Ticker () {
3368: @Override protected void tick () {
3369: MC68901.mfpHsyncRise ();
3370: TickerQueue.tkqAdd (crtTicker = SlitDrawIdleBackDisp, crtClock += crtHSyncLength);
3371: }
3372: };
3373:
3374: public static final TickerQueue.Ticker SlitDrawIdleBackDisp = new TickerQueue.Ticker () {
3375: @Override protected void tick () {
3376: MC68901.mfpHsyncFall ();
3377: TickerQueue.tkqAdd (crtTicker = SlitDrawIdleFront, crtClock += crtHBackDispLength);
3378: }
3379: };
3380:
3381: public static final TickerQueue.Ticker SlitDrawDispFront = new TickerQueue.Ticker () {
3382: @Override protected void tick () {
3383: int n = ++crtRasterNumber;
3384: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
3385: if (crtRasterCopyOn) {
3386: crtDoRasterCopy ();
3387: }
3388: if (RasterBreakPoint.RBP_ON) {
3389: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3390: RasterBreakPoint.rbpFire ();
3391: }
3392: }
3393: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3394: if (irq != MC68901.mfpGpipRint) {
3395: if (irq == 0) {
3396: if (RasterBreakPoint.RBP_ON) {
3397: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3398: RasterBreakPoint.rbpFire ();
3399: }
3400: }
3401: MC68901.mfpRintFall ();
3402: } else {
3403: MC68901.mfpRintRise ();
3404: }
3405: }
3406: if (n != crtVIdleStart) {
3407: if (crtBeginningAllStamp != crtAllStamp) {
3408: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3409: crtScanlineEffect.drawRaster (crtScreenY + 1);
3410: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3411: crtStereoscopicDrawRaster (crtScreenY);
3412: crtStereoscopicDrawRaster (crtScreenY + 1);
3413: }
3414: }
3415: crtScreenY += 2;
3416: crtDataY++;
3417: TickerQueue.tkqAdd (crtTicker = SlitDrawDispSync, crtClock += crtHFrontLength);
3418: } else {
3419: if (crtBeginningAllStamp != crtAllStamp) {
3420: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3421: crtScanlineEffect.drawRaster (crtScreenY + 1);
3422: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3423: crtStereoscopicDrawRaster (crtScreenY);
3424: crtStereoscopicDrawRaster (crtScreenY + 1);
3425: }
3426: }
3427: MC68901.mfpVdispFall ();
3428: if (crtClearFrames != 0) {
3429: crtClearFrames--;
3430: }
3431: if (crtDirtyY0 >= 0) {
3432: crtUpdateScreen ();
3433: if (CRT_ENABLE_INTERMITTENT) {
3434: crtIntermittentCounter = crtIntermittentInterval;
3435: }
3436: }
3437: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3438: crtDoFrameTask ();
3439: }
3440: TickerQueue.tkqAdd (crtTicker = SlitDrawIdleSync, crtClock += crtHFrontLength);
3441: }
3442: } else {
3443:
3444: if (crtBeginningAllStamp != crtAllStamp) {
3445: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3446: crtScanlineEffect.drawRaster (crtScreenY + 1);
3447: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3448: crtStereoscopicDrawRaster (crtScreenY);
3449: crtStereoscopicDrawRaster (crtScreenY + 1);
3450: }
3451: }
3452: crtScreenY += 2;
3453: crtDataY++;
3454: TickerQueue.tkqAdd (crtTicker = SlitDrawDispSync, crtClock += crtHFrontLength);
3455: }
3456: }
3457: };
3458:
3459: public static final TickerQueue.Ticker SlitDrawDispSync = new TickerQueue.Ticker () {
3460: @Override protected void tick () {
3461: MC68901.mfpHsyncRise ();
3462: if (crtClearFrames != 0) {
3463: crtRapidClear (crtDataY);
3464: crtRasterStamp[crtDataY] = 0;
3465: }
3466: TickerQueue.tkqAdd (crtTicker = SlitDrawDispBack, crtClock += crtHSyncLength);
3467: }
3468: };
3469:
3470: public static final TickerQueue.Ticker SlitDrawDispBack = new TickerQueue.Ticker () {
3471: @Override protected void tick () {
3472: MC68901.mfpHsyncFall ();
3473: TickerQueue.tkqAdd (crtTicker = SlitDrawDispDisp, crtClock += crtHBackLength);
3474: }
3475: };
3476:
3477: public static final TickerQueue.Ticker SlitDrawDispDisp = new TickerQueue.Ticker () {
3478: @Override protected void tick () {
3479: if (crtRasterStamp[crtDataY] != crtAllStamp) {
3480: crtRasterStamp[crtDataY] = crtAllStamp;
3481: crtBeginningAllStamp = crtAllStamp;
3482: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, false);
3483: crtScanlineEffect.drawRaster (crtScreenY + 1);
3484: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3485: crtStereoscopicDrawRaster (crtScreenY);
3486: crtStereoscopicDrawRaster (crtScreenY + 1);
3487: }
3488: if (crtDirtyY0 < 0) {
3489: crtDirtyY0 = crtScreenY;
3490: }
3491: crtDirtyY1 = crtScreenY + 1;
3492: }
3493: if (SpriteScreen.SPR_THREE_STEPS) {
3494: if (SpriteScreen.sprActive) {
3495:
3496:
3497: SpriteScreen.sprStep1 (crtDataY + 2);
3498: SpriteScreen.sprSwap ();
3499: SpriteScreen.sprStep2 (crtDataY + 1);
3500: }
3501: }
3502: TickerQueue.tkqAdd (crtTicker = SlitDrawDispFront, crtClock += crtHDispLength);
3503: }
3504: };
3505:
3506: public static final TickerQueue.Ticker SlitOmitIdleFront = new TickerQueue.Ticker () {
3507: @Override protected void tick () {
3508: int n = ++crtRasterNumber;
3509: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
3510: if (crtR04VFrontEndCurr < n) {
3511: n = crtRasterNumber = 0;
3512: }
3513: if (crtRasterCopyOn) {
3514: crtDoRasterCopy ();
3515: }
3516: if (RasterBreakPoint.RBP_ON) {
3517: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3518: RasterBreakPoint.rbpFire ();
3519: }
3520: }
3521: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3522: if (irq != MC68901.mfpGpipRint) {
3523: if (irq == 0) {
3524: if (RasterBreakPoint.RBP_ON) {
3525: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3526: RasterBreakPoint.rbpFire ();
3527: }
3528: }
3529: MC68901.mfpRintFall ();
3530: } else {
3531: MC68901.mfpRintRise ();
3532: }
3533: }
3534: if (n != crtVDispStart) {
3535: TickerQueue.tkqAdd (crtTicker = SlitOmitIdleSync, crtClock += crtHFrontLength);
3536: } else {
3537: MC68901.mfpVdispRise ();
3538: crtR11TxYZero = crtR11TxYCurr;
3539: crtR13GrYZero[0] = crtR13GrYCurr[0];
3540: crtR13GrYZero[1] = crtR13GrYCurr[1];
3541: crtR13GrYZero[2] = crtR13GrYCurr[2];
3542: crtR13GrYZero[3] = crtR13GrYCurr[3];
3543: if (crtR11TxYZeroLast != crtR11TxYZero ||
3544: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
3545: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
3546: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
3547: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
3548: crtR11TxYZeroLast = crtR11TxYZero;
3549: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
3550: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
3551: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
3552: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
3553: crtAllStamp += 2;
3554: }
3555: crtDataY = 0;
3556: if (crtClearStandby) {
3557: crtClearStandby = false;
3558: crtClearFrames = 1;
3559: }
3560: if (SpriteScreen.SPR_THREE_STEPS) {
3561: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
3562: if (SpriteScreen.sprActive) {
3563: crtAllStamp += 2;
3564:
3565: SpriteScreen.sprStep1 (0);
3566: SpriteScreen.sprSwap ();
3567:
3568:
3569: SpriteScreen.sprStep1 (1);
3570: SpriteScreen.sprSwap ();
3571: SpriteScreen.sprStep2 (0);
3572: }
3573: }
3574: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3575: crtStereoscopicStart ();
3576: }
3577: TickerQueue.tkqAdd (crtTicker = SlitOmitDispSync, crtClock += crtHFrontLength);
3578: }
3579: } else {
3580:
3581: TickerQueue.tkqAdd (crtTicker = SlitOmitIdleSync, crtClock += crtHFrontLength);
3582: }
3583: }
3584: };
3585:
3586: public static final TickerQueue.Ticker SlitOmitIdleSync = new TickerQueue.Ticker () {
3587: @Override protected void tick () {
3588: MC68901.mfpHsyncRise ();
3589: TickerQueue.tkqAdd (crtTicker = SlitOmitIdleBackDisp, crtClock += crtHSyncLength);
3590: }
3591: };
3592:
3593: public static final TickerQueue.Ticker SlitOmitIdleBackDisp = new TickerQueue.Ticker () {
3594: @Override protected void tick () {
3595: MC68901.mfpHsyncFall ();
3596: TickerQueue.tkqAdd (crtTicker = SlitOmitIdleFront, crtClock += crtHBackDispLength);
3597: }
3598: };
3599:
3600: public static final TickerQueue.Ticker SlitOmitDispFront = new TickerQueue.Ticker () {
3601: @Override protected void tick () {
3602: int n = ++crtRasterNumber;
3603: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
3604: if (crtRasterCopyOn) {
3605: crtDoRasterCopy ();
3606: }
3607: if (RasterBreakPoint.RBP_ON) {
3608: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3609: RasterBreakPoint.rbpFire ();
3610: }
3611: }
3612: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3613: if (irq != MC68901.mfpGpipRint) {
3614: if (irq == 0) {
3615: if (RasterBreakPoint.RBP_ON) {
3616: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3617: RasterBreakPoint.rbpFire ();
3618: }
3619: }
3620: MC68901.mfpRintFall ();
3621: } else {
3622: MC68901.mfpRintRise ();
3623: }
3624: }
3625: if (n != crtVIdleStart) {
3626: TickerQueue.tkqAdd (crtTicker = SlitOmitDispSync, crtClock += crtHFrontLength);
3627: } else {
3628: MC68901.mfpVdispFall ();
3629: if (crtClearFrames != 0) {
3630: crtClearFrames--;
3631: }
3632: if (CRT_ENABLE_INTERMITTENT) {
3633: crtIntermittentCounter--;
3634: }
3635: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3636: crtDoFrameTask ();
3637: }
3638: TickerQueue.tkqAdd (crtTicker = SlitOmitIdleSync, crtClock += crtHFrontLength);
3639: }
3640: } else {
3641:
3642: TickerQueue.tkqAdd (crtTicker = SlitOmitDispSync, crtClock += crtHFrontLength);
3643: }
3644: }
3645: };
3646:
3647: public static final TickerQueue.Ticker SlitOmitDispSync = new TickerQueue.Ticker () {
3648: @Override protected void tick () {
3649: MC68901.mfpHsyncRise ();
3650: if (crtClearFrames != 0) {
3651: crtRapidClear (crtDataY);
3652: crtRasterStamp[crtDataY] = 0;
3653: }
3654: TickerQueue.tkqAdd (crtTicker = SlitOmitDispBackDisp, crtClock += crtHSyncLength);
3655: }
3656: };
3657:
3658: public static final TickerQueue.Ticker SlitOmitDispBackDisp = new TickerQueue.Ticker () {
3659: @Override protected void tick () {
3660: MC68901.mfpHsyncFall ();
3661: TickerQueue.tkqAdd (crtTicker = SlitOmitDispFront, crtClock += crtHBackDispLength);
3662: }
3663: };
3664:
3665:
3666:
3667:
3668: public static final TickerQueue.Ticker DupExceptSpStart = new TickerQueue.Ticker () {
3669: @Override protected void tick () {
3670: if (MC68901.mfpGpipHsync != 0) {
3671: MC68901.mfpHsyncFall ();
3672: }
3673: int n = crtRasterNumber = crtVIdleStart;
3674: if (crtRasterCopyOn) {
3675: crtDoRasterCopy ();
3676: }
3677: if (RasterBreakPoint.RBP_ON) {
3678: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3679: RasterBreakPoint.rbpFire ();
3680: }
3681: }
3682: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3683: if (irq != MC68901.mfpGpipRint) {
3684: if (irq == 0) {
3685: if (RasterBreakPoint.RBP_ON) {
3686: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3687: RasterBreakPoint.rbpFire ();
3688: }
3689: }
3690: MC68901.mfpRintFall ();
3691: } else {
3692: MC68901.mfpRintRise ();
3693: }
3694: }
3695: if (MC68901.mfpGpipVdisp != 0) {
3696: MC68901.mfpVdispFall ();
3697: }
3698: crtClearFrames = 0;
3699: if (CRT_ENABLE_INTERMITTENT) {
3700: crtIntermittentCounter = 0;
3701: }
3702: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3703: crtDoFrameTask ();
3704: }
3705: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawIdleSync, crtClock += crtHFrontLength);
3706: }
3707: };
3708:
3709: public static final TickerQueue.Ticker DupExceptSpDrawIdleFront = new TickerQueue.Ticker () {
3710: @Override protected void tick () {
3711: int n = ++crtRasterNumber;
3712: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
3713: if (crtR04VFrontEndCurr < n) {
3714: n = crtRasterNumber = 0;
3715: }
3716: if (crtRasterCopyOn) {
3717: crtDoRasterCopy ();
3718: }
3719: if (RasterBreakPoint.RBP_ON) {
3720: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3721: RasterBreakPoint.rbpFire ();
3722: }
3723: }
3724: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3725: if (irq != MC68901.mfpGpipRint) {
3726: if (irq == 0) {
3727: if (RasterBreakPoint.RBP_ON) {
3728: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3729: RasterBreakPoint.rbpFire ();
3730: }
3731: }
3732: MC68901.mfpRintFall ();
3733: } else {
3734: MC68901.mfpRintRise ();
3735: }
3736: }
3737: if (n != crtVDispStart) {
3738: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawIdleSync, crtClock += crtHFrontLength);
3739: } else {
3740: MC68901.mfpVdispRise ();
3741: crtR11TxYZero = crtR11TxYCurr;
3742: crtR13GrYZero[0] = crtR13GrYCurr[0];
3743: crtR13GrYZero[1] = crtR13GrYCurr[1];
3744: crtR13GrYZero[2] = crtR13GrYCurr[2];
3745: crtR13GrYZero[3] = crtR13GrYCurr[3];
3746: if (crtR11TxYZeroLast != crtR11TxYZero ||
3747: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
3748: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
3749: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
3750: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
3751: crtR11TxYZeroLast = crtR11TxYZero;
3752: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
3753: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
3754: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
3755: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
3756: crtAllStamp += 2;
3757: }
3758: crtDataY = 0;
3759: if (crtClearStandby) {
3760: crtClearStandby = false;
3761: crtClearFrames = 1;
3762: }
3763: crtScreenY = 0;
3764: crtDirtyY0 = -1;
3765: if (SpriteScreen.SPR_THREE_STEPS) {
3766: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
3767: if (SpriteScreen.sprActive) {
3768: crtAllStamp += 2;
3769:
3770: SpriteScreen.sprStep1 (0);
3771: SpriteScreen.sprSwap ();
3772:
3773:
3774: SpriteScreen.sprStep1 (1);
3775: SpriteScreen.sprSwap ();
3776: SpriteScreen.sprStep2 (0);
3777: }
3778: }
3779: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3780: crtStereoscopicStart ();
3781: }
3782: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispEvenSync, crtClock += crtHFrontLength);
3783: }
3784: } else {
3785:
3786: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawIdleSync, crtClock += crtHFrontLength);
3787: }
3788: }
3789: };
3790:
3791: public static final TickerQueue.Ticker DupExceptSpDrawIdleSync = new TickerQueue.Ticker () {
3792: @Override protected void tick () {
3793: MC68901.mfpHsyncRise ();
3794: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawIdleBackDisp, crtClock += crtHSyncLength);
3795: }
3796: };
3797:
3798: public static final TickerQueue.Ticker DupExceptSpDrawIdleBackDisp = new TickerQueue.Ticker () {
3799: @Override protected void tick () {
3800: MC68901.mfpHsyncFall ();
3801: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawIdleFront, crtClock += crtHBackDispLength);
3802: }
3803: };
3804:
3805: public static final TickerQueue.Ticker DupExceptSpDrawDispEvenFront = new TickerQueue.Ticker () {
3806: @Override protected void tick () {
3807: int n = ++crtRasterNumber;
3808: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
3809: if (crtRasterCopyOn) {
3810: crtDoRasterCopy ();
3811: }
3812: if (RasterBreakPoint.RBP_ON) {
3813: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3814: RasterBreakPoint.rbpFire ();
3815: }
3816: }
3817: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3818: if (irq != MC68901.mfpGpipRint) {
3819: if (irq == 0) {
3820: if (RasterBreakPoint.RBP_ON) {
3821: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3822: RasterBreakPoint.rbpFire ();
3823: }
3824: }
3825: MC68901.mfpRintFall ();
3826: } else {
3827: MC68901.mfpRintRise ();
3828: }
3829: }
3830: if (n != crtVIdleStart) {
3831: if (crtBeginningAllStamp != crtAllStamp) {
3832: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3833: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3834: crtStereoscopicDrawRaster (crtScreenY);
3835: }
3836: }
3837: crtScreenY++;
3838: crtDataY++;
3839: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispEvenSync, crtClock += crtHFrontLength);
3840: } else {
3841: if (crtBeginningAllStamp != crtAllStamp) {
3842: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3843: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3844: crtStereoscopicDrawRaster (crtScreenY);
3845: }
3846: }
3847: MC68901.mfpVdispFall ();
3848: if (crtClearFrames != 0) {
3849: crtClearFrames--;
3850: }
3851: if (crtDirtyY0 >= 0) {
3852: crtUpdateScreen ();
3853: if (CRT_ENABLE_INTERMITTENT) {
3854: crtIntermittentCounter = crtIntermittentInterval;
3855: }
3856: }
3857: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3858: crtDoFrameTask ();
3859: }
3860: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawIdleSync, crtClock += crtHFrontLength);
3861: }
3862: } else {
3863:
3864: if (crtBeginningAllStamp != crtAllStamp) {
3865: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3866: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3867: crtStereoscopicDrawRaster (crtScreenY);
3868: }
3869: }
3870: crtScreenY++;
3871: crtDataY++;
3872: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispEvenSync, crtClock += crtHFrontLength);
3873: }
3874: }
3875: };
3876:
3877: public static final TickerQueue.Ticker DupExceptSpDrawDispOddFront = new TickerQueue.Ticker () {
3878: @Override protected void tick () {
3879: int n = ++crtRasterNumber;
3880: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
3881: if (crtRasterCopyOn) {
3882: crtDoRasterCopy ();
3883: }
3884: if (RasterBreakPoint.RBP_ON) {
3885: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
3886: RasterBreakPoint.rbpFire ();
3887: }
3888: }
3889: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
3890: if (irq != MC68901.mfpGpipRint) {
3891: if (irq == 0) {
3892: if (RasterBreakPoint.RBP_ON) {
3893: if (RasterBreakPoint.rbpIRQBreakEnabled) {
3894: RasterBreakPoint.rbpFire ();
3895: }
3896: }
3897: MC68901.mfpRintFall ();
3898: } else {
3899: MC68901.mfpRintRise ();
3900: }
3901: }
3902: if (n != crtVIdleStart) {
3903: if (crtBeginningAllStamp != crtAllStamp) {
3904: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3905: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3906: crtStereoscopicDrawRaster (crtScreenY);
3907: }
3908: }
3909: crtScreenY++;
3910: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispOddSync, crtClock += crtHFrontLength);
3911: } else {
3912: if (crtBeginningAllStamp != crtAllStamp) {
3913: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3914: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3915: crtStereoscopicDrawRaster (crtScreenY);
3916: }
3917: }
3918: MC68901.mfpVdispFall ();
3919: if (crtClearFrames != 0) {
3920: crtClearFrames--;
3921: }
3922: if (crtDirtyY0 >= 0) {
3923: crtUpdateScreen ();
3924: if (CRT_ENABLE_INTERMITTENT) {
3925: crtIntermittentCounter = crtIntermittentInterval;
3926: }
3927: }
3928: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
3929: crtDoFrameTask ();
3930: }
3931: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawIdleSync, crtClock += crtHFrontLength);
3932: }
3933: } else {
3934:
3935: if (crtBeginningAllStamp != crtAllStamp) {
3936: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, true);
3937: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3938: crtStereoscopicDrawRaster (crtScreenY);
3939: }
3940: }
3941: crtScreenY++;
3942: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispOddSync, crtClock += crtHFrontLength);
3943: }
3944: }
3945: };
3946:
3947: public static final TickerQueue.Ticker DupExceptSpDrawDispEvenSync = new TickerQueue.Ticker () {
3948: @Override protected void tick () {
3949: MC68901.mfpHsyncRise ();
3950: if (crtClearFrames != 0) {
3951: crtRapidClear (crtDataY);
3952: crtRasterStamp[crtDataY] = 0;
3953: }
3954: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispEvenBack, crtClock += crtHSyncLength);
3955: }
3956: };
3957:
3958: public static final TickerQueue.Ticker DupExceptSpDrawDispOddSync = new TickerQueue.Ticker () {
3959: @Override protected void tick () {
3960: MC68901.mfpHsyncRise ();
3961: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispOddBack, crtClock += crtHSyncLength);
3962: }
3963: };
3964:
3965: public static final TickerQueue.Ticker DupExceptSpDrawDispEvenBack = new TickerQueue.Ticker () {
3966: @Override protected void tick () {
3967: MC68901.mfpHsyncFall ();
3968: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispEvenDisp, crtClock += crtHBackLength);
3969: }
3970: };
3971:
3972: public static final TickerQueue.Ticker DupExceptSpDrawDispOddBack = new TickerQueue.Ticker () {
3973: @Override protected void tick () {
3974: MC68901.mfpHsyncFall ();
3975: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispOddDisp, crtClock += crtHBackLength);
3976: }
3977: };
3978:
3979: public static final TickerQueue.Ticker DupExceptSpDrawDispEvenDisp = new TickerQueue.Ticker () {
3980: @Override protected void tick () {
3981: if (crtRasterStamp[crtDataY] != crtAllStamp) {
3982: crtBeginningAllStamp = crtAllStamp;
3983: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, false);
3984: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
3985: crtStereoscopicDrawRaster (crtScreenY);
3986: }
3987: if (crtDirtyY0 < 0) {
3988: crtDirtyY0 = crtScreenY;
3989: }
3990: crtDirtyY1 = crtScreenY;
3991: }
3992: if (SpriteScreen.SPR_THREE_STEPS) {
3993: if (SpriteScreen.sprActive) {
3994:
3995:
3996: SpriteScreen.sprStep1 (crtScreenY + 2);
3997: SpriteScreen.sprSwap ();
3998: SpriteScreen.sprStep2 (crtScreenY + 1);
3999: }
4000: }
4001: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispOddFront, crtClock += crtHDispLength);
4002: }
4003: };
4004:
4005: public static final TickerQueue.Ticker DupExceptSpDrawDispOddDisp = new TickerQueue.Ticker () {
4006: @Override protected void tick () {
4007: if (crtRasterStamp[crtDataY] != crtAllStamp) {
4008: crtRasterStamp[crtDataY] = crtAllStamp;
4009: crtBeginningAllStamp = crtAllStamp;
4010: VideoController.vcnMode.drawRaster (crtDataY, crtScreenY, false);
4011: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
4012: crtStereoscopicDrawRaster (crtScreenY);
4013: }
4014: if (crtDirtyY0 < 0) {
4015: crtDirtyY0 = crtScreenY;
4016: }
4017: crtDirtyY1 = crtScreenY;
4018: }
4019: if (SpriteScreen.SPR_THREE_STEPS) {
4020: if (SpriteScreen.sprActive) {
4021:
4022:
4023: SpriteScreen.sprStep1 (crtScreenY + 2);
4024: SpriteScreen.sprSwap ();
4025: SpriteScreen.sprStep2 (crtScreenY + 1);
4026: }
4027: }
4028: TickerQueue.tkqAdd (crtTicker = DupExceptSpDrawDispEvenFront, crtClock += crtHDispLength);
4029: }
4030: };
4031:
4032: public static final TickerQueue.Ticker DupExceptSpOmitIdleFront = new TickerQueue.Ticker () {
4033: @Override protected void tick () {
4034: int n = ++crtRasterNumber;
4035: if (!CRT_RASTER_HASH_ON || crtRasterHashIdle << n < CRT_RASTER_HASH_ZERO) {
4036: if (crtR04VFrontEndCurr < n) {
4037: n = crtRasterNumber = 0;
4038: }
4039: if (crtRasterCopyOn) {
4040: crtDoRasterCopy ();
4041: }
4042: if (RasterBreakPoint.RBP_ON) {
4043: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
4044: RasterBreakPoint.rbpFire ();
4045: }
4046: }
4047: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
4048: if (irq != MC68901.mfpGpipRint) {
4049: if (irq == 0) {
4050: if (RasterBreakPoint.RBP_ON) {
4051: if (RasterBreakPoint.rbpIRQBreakEnabled) {
4052: RasterBreakPoint.rbpFire ();
4053: }
4054: }
4055: MC68901.mfpRintFall ();
4056: } else {
4057: MC68901.mfpRintRise ();
4058: }
4059: }
4060: if (n != crtVDispStart) {
4061: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitIdleSync, crtClock += crtHFrontLength);
4062: } else {
4063: MC68901.mfpVdispRise ();
4064: crtR11TxYZero = crtR11TxYCurr;
4065: crtR13GrYZero[0] = crtR13GrYCurr[0];
4066: crtR13GrYZero[1] = crtR13GrYCurr[1];
4067: crtR13GrYZero[2] = crtR13GrYCurr[2];
4068: crtR13GrYZero[3] = crtR13GrYCurr[3];
4069: if (crtR11TxYZeroLast != crtR11TxYZero ||
4070: crtR13GrYZeroLast[0] != crtR13GrYZero[0] ||
4071: crtR13GrYZeroLast[1] != crtR13GrYZero[1] ||
4072: crtR13GrYZeroLast[2] != crtR13GrYZero[2] ||
4073: crtR13GrYZeroLast[3] != crtR13GrYZero[3]) {
4074: crtR11TxYZeroLast = crtR11TxYZero;
4075: crtR13GrYZeroLast[0] = crtR13GrYZero[0];
4076: crtR13GrYZeroLast[1] = crtR13GrYZero[1];
4077: crtR13GrYZeroLast[2] = crtR13GrYZero[2];
4078: crtR13GrYZeroLast[3] = crtR13GrYZero[3];
4079: crtAllStamp += 2;
4080: }
4081: crtDataY = 0;
4082: if (crtClearStandby) {
4083: crtClearStandby = false;
4084: crtClearFrames = 1;
4085: }
4086: if (SpriteScreen.SPR_THREE_STEPS) {
4087: SpriteScreen.sprActive = (SpriteScreen.sprReg8ResoCurr & 10) == 0;
4088: if (SpriteScreen.sprActive) {
4089: crtAllStamp += 2;
4090:
4091: SpriteScreen.sprStep1 (0);
4092: SpriteScreen.sprSwap ();
4093:
4094:
4095: SpriteScreen.sprStep1 (1);
4096: SpriteScreen.sprSwap ();
4097: SpriteScreen.sprStep2 (0);
4098: }
4099: }
4100: if (XEiJ.PNL_STEREOSCOPIC_ON && XEiJ.pnlStereoscopicOn) {
4101: crtStereoscopicStart ();
4102: }
4103: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispEvenSync, crtClock += crtHFrontLength);
4104: }
4105: } else {
4106:
4107: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitIdleSync, crtClock += crtHFrontLength);
4108: }
4109: }
4110: };
4111:
4112: public static final TickerQueue.Ticker DupExceptSpOmitIdleSync = new TickerQueue.Ticker () {
4113: @Override protected void tick () {
4114: MC68901.mfpHsyncRise ();
4115: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitIdleBackDisp, crtClock += crtHSyncLength);
4116: }
4117: };
4118:
4119: public static final TickerQueue.Ticker DupExceptSpOmitIdleBackDisp = new TickerQueue.Ticker () {
4120: @Override protected void tick () {
4121: MC68901.mfpHsyncFall ();
4122: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitIdleFront, crtClock += crtHBackDispLength);
4123: }
4124: };
4125:
4126: public static final TickerQueue.Ticker DupExceptSpOmitDispEvenFront = new TickerQueue.Ticker () {
4127: @Override protected void tick () {
4128: int n = ++crtRasterNumber;
4129: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
4130: if (crtRasterCopyOn) {
4131: crtDoRasterCopy ();
4132: }
4133: if (RasterBreakPoint.RBP_ON) {
4134: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
4135: RasterBreakPoint.rbpFire ();
4136: }
4137: }
4138: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
4139: if (irq != MC68901.mfpGpipRint) {
4140: if (irq == 0) {
4141: if (RasterBreakPoint.RBP_ON) {
4142: if (RasterBreakPoint.rbpIRQBreakEnabled) {
4143: RasterBreakPoint.rbpFire ();
4144: }
4145: }
4146: MC68901.mfpRintFall ();
4147: } else {
4148: MC68901.mfpRintRise ();
4149: }
4150: }
4151: if (n != crtVIdleStart) {
4152: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispEvenSync, crtClock += crtHFrontLength);
4153: } else {
4154: MC68901.mfpVdispFall ();
4155: if (crtClearFrames != 0) {
4156: crtClearFrames--;
4157: }
4158: if (CRT_ENABLE_INTERMITTENT) {
4159: crtIntermittentCounter--;
4160: }
4161: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
4162: crtDoFrameTask ();
4163: }
4164: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitIdleSync, crtClock += crtHFrontLength);
4165: }
4166: } else {
4167:
4168: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispEvenSync, crtClock += crtHFrontLength);
4169: }
4170: }
4171: };
4172:
4173: public static final TickerQueue.Ticker DupExceptSpOmitDispOddFront = new TickerQueue.Ticker () {
4174: @Override protected void tick () {
4175: int n = ++crtRasterNumber;
4176: if (!CRT_RASTER_HASH_ON || crtRasterHashDisp << n < CRT_RASTER_HASH_ZERO) {
4177: if (crtRasterCopyOn) {
4178: crtDoRasterCopy ();
4179: }
4180: if (RasterBreakPoint.RBP_ON) {
4181: if (n == RasterBreakPoint.rbpActiveBreakRaster) {
4182: RasterBreakPoint.rbpFire ();
4183: }
4184: }
4185: int irq = n == crtR09IRQRasterCurr ? 0 : MC68901.MFP_GPIP_RINT_MASK;
4186: if (irq != MC68901.mfpGpipRint) {
4187: if (irq == 0) {
4188: if (RasterBreakPoint.RBP_ON) {
4189: if (RasterBreakPoint.rbpIRQBreakEnabled) {
4190: RasterBreakPoint.rbpFire ();
4191: }
4192: }
4193: MC68901.mfpRintFall ();
4194: } else {
4195: MC68901.mfpRintRise ();
4196: }
4197: }
4198: if (n != crtVIdleStart) {
4199: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispOddSync, crtClock += crtHFrontLength);
4200: } else {
4201: MC68901.mfpVdispFall ();
4202: if (crtClearFrames != 0) {
4203: crtClearFrames--;
4204: }
4205: if (CRT_ENABLE_INTERMITTENT) {
4206: crtIntermittentCounter--;
4207: }
4208: if (XEiJ.mpuClockTime >= crtFrameTaskClock) {
4209: crtDoFrameTask ();
4210: }
4211: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitIdleSync, crtClock += crtHFrontLength);
4212: }
4213: } else {
4214:
4215: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispOddSync, crtClock += crtHFrontLength);
4216: }
4217: }
4218: };
4219:
4220: public static final TickerQueue.Ticker DupExceptSpOmitDispEvenSync = new TickerQueue.Ticker () {
4221: @Override protected void tick () {
4222: MC68901.mfpHsyncRise ();
4223: if (crtClearFrames != 0) {
4224: crtRapidClear (crtDataY);
4225: crtRasterStamp[crtDataY] = 0;
4226: }
4227: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispEvenBackDisp, crtClock += crtHSyncLength);
4228: }
4229: };
4230:
4231: public static final TickerQueue.Ticker DupExceptSpOmitDispOddSync = new TickerQueue.Ticker () {
4232: @Override protected void tick () {
4233: MC68901.mfpHsyncRise ();
4234: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispOddBackDisp, crtClock += crtHSyncLength);
4235: }
4236: };
4237:
4238: public static final TickerQueue.Ticker DupExceptSpOmitDispEvenBackDisp = new TickerQueue.Ticker () {
4239: @Override protected void tick () {
4240: MC68901.mfpHsyncFall ();
4241: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispOddFront, crtClock += crtHBackDispLength);
4242: }
4243: };
4244:
4245: public static final TickerQueue.Ticker DupExceptSpOmitDispOddBackDisp = new TickerQueue.Ticker () {
4246: @Override protected void tick () {
4247: MC68901.mfpHsyncFall ();
4248: TickerQueue.tkqAdd (crtTicker = DupExceptSpOmitDispEvenFront, crtClock += crtHBackDispLength);
4249: }
4250: };
4251:
4252:
4253:
4254: }
4255:
4256:
4257: