ScreenModeTest.java
     1: //========================================================================================
     2: //  ScreenModeTest.java
     3: //    en:Screen mode test
     4: //    ja:表示モードテスト
     5: //  Copyright (C) 2003-2023 Makoto Kamada
     6: //
     7: //  This file is part of the XEiJ (X68000 Emulator in Java).
     8: //  You can use, modify and redistribute the XEiJ if the conditions are met.
     9: //  Read the XEiJ License for more details.
    10: //  https://stdkmd.net/xeij/
    11: //========================================================================================
    12: 
    13: package xeij;
    14: 
    15: import java.awt.event.*;  //ActionEvent,ActionListener,ComponentAdapter,ComponentEvent,ComponentListener,FocusAdapter,FocusEvent,FocusListener,InputEvent,KeyAdapter,KeyEvent,KeyListener,MouseAdapter,MouseEvent,MouseListener,MouseMotionAdapter,MouseWheelEvent,WindowAdapter,WindowEvent,WindowListener,WindowStateListener
    16: import java.lang.*;  //Boolean,Character,Class,Comparable,Double,Exception,Float,IllegalArgumentException,Integer,Long,Math,Number,Object,Runnable,SecurityException,String,StringBuilder,System
    17: import java.util.*;  //ArrayList,Arrays,Calendar,GregorianCalendar,HashMap,Map,Map.Entry,Timer,TimerTask,TreeMap
    18: import javax.swing.*;  //AbstractSpinnerModel,Box,ButtonGroup,DefaultListModel,ImageIcon,JApplet,JButton,JCheckBox,JCheckBoxMenuItem,JDialog,JFileChooser,JFrame,JLabel,JList,JMenu,JMenuBar,JMenuItem,JPanel,JRadioButton,JScrollPane,JSpinner,JTextArea,JTextField,JTextPane,JViewport,ScrollPaneConstants,SpinnerListModel,SpinnerNumberModel,SwingConstants,SwingUtilities,UIManager,UIDefaults,UnsupportedLookAndFeelException
    19: import javax.swing.event.*;  //CaretListener,ChangeEvent,ChangeListener,DocumentEvent,DocumentListener,ListSelectionListener
    20: 
    21: public class ScreenModeTest {
    22: 
    23:   public static final boolean SMT_ON = true;  //true=表示モードテストを有効にする
    24: 
    25:   //ウインドウ
    26:   public static final int SMT_MARGIN = 4;  //周囲のマージン
    27:   public static final int SMT_ITEM_GAP = 4;  //アイテムの間隔
    28:   public static final int SMT_ITEM_GAP_2 = 8;  //アイテムの間隔2
    29:   public static final int SMT_ITEM_GAP_3 = 12;  //アイテムの間隔3
    30:   public static JFrame smtFrame;
    31: 
    32:   //周波数
    33:   public static JTextField smtFreqTextField;
    34:   public static String smtFreqLastText;  //前回表示した周波数
    35: 
    36:   //モード
    37:   public static JTextField smtModeTextField;
    38:   public static final int SMT_MODE_LIMIT = 6;  //モードを表示する数の上限
    39:   public static final int SMT_MODE_SPAN  = 5;  //モードを表示する時間(s)
    40:   public static final String[] smtModeName = new String[SMT_MODE_LIMIT];  //モードの名前のリスト。名前昇順
    41:   public static final long[] smtModeTime = new long[SMT_MODE_LIMIT];  //モードの時刻のリスト。名前昇順。時刻昇順ではない
    42:   public static int smtModeCount;  //リストの現在の長さ
    43: 
    44:   //アイテム
    45:   public static SMTItem[] smtItemArray;
    46: 
    47:   public static SMTGroup smtCRTItemGroup1;
    48:   public static SMTItem smtItemCrtHFEd;  //$E80000 R00 7-0
    49:   public static SMTItem smtItemCrtHSEd;  //$E80002 R01 7-0
    50:   public static SMTItem smtItemCrtHBEd;  //$E80004 R02 7-0
    51:   public static SMTItem smtItemCrtHDEd;  //$E80006 R03 7-0
    52:   public static SMTItem smtItemCrtVFEd;  //$E80008 R04 9-0
    53:   public static SMTItem smtItemCrtVSEd;  //$E8000A R05 9-0
    54:   public static SMTItem smtItemCrtVBEd;  //$E8000C R06 9-0
    55:   public static SMTItem smtItemCrtVDEd;  //$E8000E R07 9-0
    56: 
    57:   public static SMTGroup smtCRTItemGroup2;
    58:   public static SMTItem smtItemCrtIRQ;  //$E80012 R09 9-0
    59:   public static SMTItem smtItemCrtTxX;  //$E80014 R10 9-0
    60:   public static SMTItem smtItemCrtTxY;  //$E80016 R11 9-0
    61:   public static SMTItem smtItemCrtGrMM;  //$E80028 R20 10-8
    62:   public static SMTItem smtItemCrtHigh;  //$E80028 R20 4
    63:   public static SMTItem smtItemCrtVRes;  //$E80028 R20 3-2
    64:   public static SMTItem smtItemCrtHRes;  //$E80028 R20 1-0
    65:   public static SMTItem smtItemSysHRL;  //$E8E007 1
    66:   public static SMTItem smtItemSysCont;  //$E8E001 3-0
    67: 
    68:   public static SMTGroup smtCRTItemGroup3;
    69:   public static SMTItem smtItemCrtGr0X;  //$E80018 R12 9-0
    70:   public static SMTItem smtItemCrtGr0Y;  //$E8001A R13 9-0
    71:   public static SMTItem smtItemCrtGr1X;  //$E8001C R14 8-0
    72:   public static SMTItem smtItemCrtGr1Y;  //$E8001E R15 8-0
    73:   public static SMTItem smtItemCrtGr2X;  //$E80020 R16 8-0
    74:   public static SMTItem smtItemCrtGr2Y;  //$E80022 R17 8-0
    75:   public static SMTItem smtItemCrtGr3X;  //$E80024 R18 8-0
    76:   public static SMTItem smtItemCrtGr3Y;  //$E80026 R19 8-0
    77: 
    78:   public static SMTGroup smtVcnItemGroup1;
    79:   public static SMTItem smtItemVcnGrMM;  //$E82400 Reg1 2-0
    80:   public static SMTItem smtItemVcnSpPr;  //$E82500 Reg2 13-12
    81:   public static SMTItem smtItemVcnTxPr;  //$E82500 Reg2 11-10
    82:   public static SMTItem smtItemVcnGrPr;  //$E82500 Reg2 9-8
    83:   public static SMTItem smtItemVcnG4th;  //$E82500 Reg2 7-6
    84:   public static SMTItem smtItemVcnG3rd;  //$E82500 Reg2 5-4
    85:   public static SMTItem smtItemVcnG2nd;  //$E82500 Reg2 3-2
    86:   public static SMTItem smtItemVcnG1st;  //$E82500 Reg2 1-0
    87: 
    88:   public static SMTGroup smtVcnItemGroup2;
    89:   public static SMTItem smtItemVcnAHOn;  //$E82600 Reg3 14
    90:   public static SMTItem smtItemVcnExOn;  //$E82600 Reg3 12
    91:   public static SMTItem smtItemVcnHalf;  //$E82600 Reg3 11
    92:   public static SMTItem smtItemVcnPLSB;  //$E82600 Reg3 10
    93:   public static SMTItem smtItemVcnGrGr;  //$E82600 Reg3 9
    94:   public static SMTItem smtItemVcnGrST;  //$E82600 Reg3 8
    95:   public static SMTItem smtItemVcnSpOn;  //$E82600 Reg3 6
    96:   public static SMTItem smtItemVcnTxOn;  //$E82600 Reg3 5
    97:   public static SMTItem smtItemVcnGxOn;  //$E82600 Reg3 4
    98:   public static SMTItem smtItemVcnG4On;  //$E82600 Reg3 3
    99:   public static SMTItem smtItemVcnG3On;  //$E82600 Reg3 2
   100:   public static SMTItem smtItemVcnG2On;  //$E82600 Reg3 1
   101:   public static SMTItem smtItemVcnG1On;  //$E82600 Reg3 0
   102: 
   103:   public static SMTGroup smtSprItemGroup1;
   104:   public static SMTItem smtItemSprBg0X;  //$EB0800 Reg0 9-0
   105:   public static SMTItem smtItemSprBg0Y;  //$EB0802 Reg1 9-0
   106:   public static SMTItem smtItemSprBg1X;  //$EB0804 Reg2 9-0
   107:   public static SMTItem smtItemSprBg1Y;  //$EB0806 Reg3 9-0
   108:   public static SMTItem smtItemSprDisp;  //$EB0808 Reg4 9
   109:   public static SMTItem smtItemSprB1Tx;  //$EB0808 Reg4 5-4
   110:   public static SMTItem smtItemSprB1On;  //$EB0808 Reg4 3
   111:   public static SMTItem smtItemSprB0Tx;  //$EB0808 Reg4 2-1
   112:   public static SMTItem smtItemSprB0On;  //$EB0808 Reg4 0
   113: 
   114:   public static SMTGroup smtSprItemGroup2;
   115:   public static SMTItem smtItemSprHFEd;  //$EB080A Reg5 7-0
   116:   public static SMTItem smtItemSprHBEd;  //$EB080C Reg6 5-0
   117:   public static SMTItem smtItemSprVBEd;  //$EB080E Reg7 7-0
   118:   public static SMTItem smtItemSprHigh;  //$EB0810 Reg8 4
   119:   public static SMTItem smtItemSprVRes;  //$EB0810 Reg8 3-2
   120:   public static SMTItem smtItemSprHRes;  //$EB0810 Reg8 1-0
   121: 
   122:   //タイマー
   123:   public static final int SMT_INTERVAL = 10;
   124:   public static int smtTimer;
   125: 
   126:   //smtInit ()
   127:   //  初期化
   128:   public static void smtInit () {
   129: 
   130:     //ウインドウ
   131:     smtFrame = null;
   132: 
   133:     //周波数
   134:     smtFreqLastText = "";
   135: 
   136:     //モード
   137:     smtModeCount = 0;
   138: 
   139:     //タイマー
   140:     smtTimer = 0;
   141: 
   142:   }  //smtInit()
   143: 
   144:   //smtStart ()
   145:   public static void smtStart () {
   146:     if (RestorableFrame.rfmGetOpened (Settings.SGS_SMT_FRAME_KEY)) {
   147:       smtOpen ();
   148:     }
   149:   }  //smtStart()
   150: 
   151:   //smtOpen ()
   152:   //  表示モードテストを開く
   153:   public static void smtOpen () {
   154:     if (smtFrame == null) {
   155:       smtMakeFrame ();
   156:     } else {
   157:       smtUpdateFrame ();
   158:     }
   159:     XEiJ.dbgVisibleMask |= XEiJ.DBG_SMT_VISIBLE_MASK;
   160:     smtFrame.setVisible (true);
   161:   }  //smtOpen()
   162: 
   163:   //smtMakeFrame ()
   164:   //  表示モードテストを作る
   165:   //  ここでは開かない
   166:   public static void smtMakeFrame () {
   167: 
   168:     //アイテム
   169:     smtItemArray = new SMTItem[] {
   170: 
   171:       smtItemCrtHFEd = new SMTItem_CrtHFEd (),
   172:       smtItemCrtHSEd = new SMTItem_CrtHSEd (),
   173:       smtItemCrtHBEd = new SMTItem_CrtHBEd (),
   174:       smtItemCrtHDEd = new SMTItem_CrtHDEd (),
   175:       smtItemCrtVFEd = new SMTItem_CrtVFEd (),
   176:       smtItemCrtVSEd = new SMTItem_CrtVSEd (),
   177:       smtItemCrtVBEd = new SMTItem_CrtVBEd (),
   178:       smtItemCrtVDEd = new SMTItem_CrtVDEd (),
   179: 
   180:       smtItemCrtIRQ = new SMTItem_CrtIRQ (),
   181:       smtItemCrtTxX = new SMTItem_CrtTxX (),
   182:       smtItemCrtTxY = new SMTItem_CrtTxY (),
   183:       smtItemCrtGrMM = new SMTItem_CrtGrMM (),
   184:       smtItemCrtHigh = new SMTItem_CrtHigh (),
   185:       smtItemCrtVRes = new SMTItem_CrtVRes (),
   186:       smtItemCrtHRes = new SMTItem_CrtHRes (),
   187:       smtItemSysHRL = new SMTItem_SysHRL (),
   188:       smtItemSysCont = new SMTItem_SysCont (),
   189: 
   190:       smtItemCrtGr0X = new SMTItem_CrtGr0X (),
   191:       smtItemCrtGr0Y = new SMTItem_CrtGr0Y (),
   192:       smtItemCrtGr1X = new SMTItem_CrtGr1X (),
   193:       smtItemCrtGr1Y = new SMTItem_CrtGr1Y (),
   194:       smtItemCrtGr2X = new SMTItem_CrtGr2X (),
   195:       smtItemCrtGr2Y = new SMTItem_CrtGr2Y (),
   196:       smtItemCrtGr3X = new SMTItem_CrtGr3X (),
   197:       smtItemCrtGr3Y = new SMTItem_CrtGr3Y (),
   198: 
   199:       smtItemVcnGrMM = new SMTItem_VcnGrMM (),
   200:       smtItemVcnSpPr = new SMTItem_VcnSpPr (),
   201:       smtItemVcnTxPr = new SMTItem_VcnTxPr (),
   202:       smtItemVcnGrPr = new SMTItem_VcnGrPr (),
   203:       smtItemVcnG4th = new SMTItem_VcnG4th (),
   204:       smtItemVcnG3rd = new SMTItem_VcnG3rd (),
   205:       smtItemVcnG2nd = new SMTItem_VcnG2nd (),
   206:       smtItemVcnG1st = new SMTItem_VcnG1st (),
   207: 
   208:       smtItemVcnAHOn = new SMTItem_VcnAHOn (),
   209:       smtItemVcnExOn = new SMTItem_VcnExOn (),
   210:       smtItemVcnHalf = new SMTItem_VcnHalf (),
   211:       smtItemVcnPLSB = new SMTItem_VcnPLSB (),
   212:       smtItemVcnGrGr = new SMTItem_VcnGrGr (),
   213:       smtItemVcnGrST = new SMTItem_VcnGrST (),
   214:       smtItemVcnSpOn = new SMTItem_VcnSpOn (),
   215:       smtItemVcnTxOn = new SMTItem_VcnTxOn (),
   216:       smtItemVcnGxOn = new SMTItem_VcnGxOn (),
   217:       smtItemVcnG4On = new SMTItem_VcnG4On (),
   218:       smtItemVcnG3On = new SMTItem_VcnG3On (),
   219:       smtItemVcnG2On = new SMTItem_VcnG2On (),
   220:       smtItemVcnG1On = new SMTItem_VcnG1On (),
   221: 
   222:       smtItemSprBg0X = new SMTItem_SprBg0X (),
   223:       smtItemSprBg0Y = new SMTItem_SprBg0Y (),
   224:       smtItemSprBg1X = new SMTItem_SprBg1X (),
   225:       smtItemSprBg1Y = new SMTItem_SprBg1Y (),
   226:       smtItemSprDisp = new SMTItem_SprDisp (),
   227:       smtItemSprB1Tx = new SMTItem_SprB1Tx (),
   228:       smtItemSprB1On = new SMTItem_SprB1On (),
   229:       smtItemSprB0Tx = new SMTItem_SprB0Tx (),
   230:       smtItemSprB0On = new SMTItem_SprB0On (),
   231: 
   232:       smtItemSprHFEd = new SMTItem_SprHFEd (),
   233:       smtItemSprHBEd = new SMTItem_SprHBEd (),
   234:       smtItemSprVBEd = new SMTItem_SprVBEd (),
   235:       smtItemSprHigh = new SMTItem_SprHigh (),
   236:       smtItemSprVRes = new SMTItem_SprVRes (),
   237:       smtItemSprHRes = new SMTItem_SprHRes (),
   238: 
   239:     };
   240: 
   241:     //アイテムグループ
   242:     smtCRTItemGroup1 = new SMTGroup (
   243:       smtItemCrtHFEd,
   244:       smtItemCrtHSEd,
   245:       smtItemCrtHBEd,
   246:       smtItemCrtHDEd,
   247:       smtItemCrtVFEd,
   248:       smtItemCrtVSEd,
   249:       smtItemCrtVBEd,
   250:       smtItemCrtVDEd
   251:       );
   252:     smtCRTItemGroup2 = new SMTGroup (
   253:       smtItemCrtIRQ,
   254:       smtItemCrtTxX,
   255:       smtItemCrtTxY,
   256:       smtItemCrtGrMM,
   257:       smtItemCrtHigh,
   258:       smtItemCrtVRes,
   259:       smtItemCrtHRes,
   260:       smtItemSysHRL,
   261:       smtItemSysCont
   262:       );
   263:     smtCRTItemGroup3 = new SMTGroup (
   264:       smtItemCrtGr0X,
   265:       smtItemCrtGr0Y,
   266:       smtItemCrtGr1X,
   267:       smtItemCrtGr1Y,
   268:       smtItemCrtGr2X,
   269:       smtItemCrtGr2Y,
   270:       smtItemCrtGr3X,
   271:       smtItemCrtGr3Y
   272:       );
   273:     smtVcnItemGroup1 = new SMTGroup (
   274:       smtItemVcnGrMM,
   275:       smtItemVcnSpPr,
   276:       smtItemVcnTxPr,
   277:       smtItemVcnGrPr,
   278:       smtItemVcnG4th,
   279:       smtItemVcnG3rd,
   280:       smtItemVcnG2nd,
   281:       smtItemVcnG1st
   282:       );
   283:     smtVcnItemGroup2 = new SMTGroup (
   284:       smtItemVcnAHOn,
   285:       smtItemVcnExOn,
   286:       smtItemVcnHalf,
   287:       smtItemVcnPLSB,
   288:       smtItemVcnGrGr,
   289:       smtItemVcnGrST,
   290:       smtItemVcnSpOn,
   291:       smtItemVcnTxOn,
   292:       smtItemVcnGxOn,
   293:       smtItemVcnG4On,
   294:       smtItemVcnG3On,
   295:       smtItemVcnG2On,
   296:       smtItemVcnG1On
   297:       );
   298:     smtSprItemGroup1 = new SMTGroup (
   299:       smtItemSprBg0X,
   300:       smtItemSprBg0Y,
   301:       smtItemSprBg1X,
   302:       smtItemSprBg1Y,
   303:       smtItemSprDisp,
   304:       smtItemSprB1Tx,
   305:       smtItemSprB1On,
   306:       smtItemSprB0Tx,
   307:       smtItemSprB0On
   308:       );
   309:     smtSprItemGroup2 = new SMTGroup (
   310:       smtItemSprHFEd,
   311:       smtItemSprHBEd,
   312:       smtItemSprVBEd,
   313:       smtItemSprHigh,
   314:       smtItemSprVRes,
   315:       smtItemSprHRes
   316:       );
   317: 
   318:     //ウインドウ
   319:     smtFrame = Multilingual.mlnTitle (
   320:       ComponentFactory.createRestorableSubFrame (
   321:         Settings.SGS_SMT_FRAME_KEY,
   322:         "Screen Mode Test",
   323:         null,
   324:         ComponentFactory.createVerticalBox (
   325:           Box.createVerticalStrut (SMT_MARGIN),
   326: 
   327:           ComponentFactory.createHorizontalBox (
   328:             Box.createHorizontalStrut (SMT_MARGIN),
   329:             Multilingual.mlnTitledBorder (
   330:               ComponentFactory.setTitledLineBorder (
   331:                 ComponentFactory.createVerticalBox (
   332:                   ComponentFactory.createHorizontalBox (
   333:                     smtFreqTextField = ComponentFactory.setEditable (
   334:                       ComponentFactory.setHorizontalAlignment (
   335:                         ComponentFactory.createTextField ("", 30),
   336:                         JTextField.CENTER),
   337:                       false)
   338:                     ),
   339:                   ComponentFactory.createHorizontalBox (
   340:                     smtCRTItemGroup1.smgBox,
   341:                     Box.createHorizontalStrut (SMT_ITEM_GAP_2),
   342:                     smtItemCrtHFEd.smiBox,
   343:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   344:                     smtItemCrtHSEd.smiBox,
   345:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   346:                     smtItemCrtHBEd.smiBox,
   347:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   348:                     smtItemCrtHDEd.smiBox,
   349:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   350:                     smtItemCrtVFEd.smiBox,
   351:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   352:                     smtItemCrtVSEd.smiBox,
   353:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   354:                     smtItemCrtVBEd.smiBox,
   355:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   356:                     smtItemCrtVDEd.smiBox,
   357:                     Box.createHorizontalGlue ()
   358:                     ),
   359:                   ComponentFactory.createHorizontalBox (
   360:                     smtCRTItemGroup2.smgBox,
   361:                     Box.createHorizontalStrut (SMT_ITEM_GAP_2),
   362:                     smtItemCrtIRQ.smiBox,
   363:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   364:                     smtItemCrtTxX.smiBox,
   365:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   366:                     smtItemCrtTxY.smiBox,
   367:                     Box.createHorizontalStrut (SMT_ITEM_GAP_3),
   368:                     smtItemCrtGrMM.smiBox,
   369:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   370:                     smtItemCrtHigh.smiBox,
   371:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   372:                     smtItemCrtVRes.smiBox,
   373:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   374:                     smtItemCrtHRes.smiBox,
   375:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   376:                     smtItemSysHRL.smiBox,
   377:                     Box.createHorizontalStrut (SMT_ITEM_GAP_3),
   378:                     smtItemSysCont.smiBox,
   379:                     Box.createHorizontalGlue ()
   380:                     ),
   381:                   ComponentFactory.createHorizontalBox (
   382:                     smtCRTItemGroup3.smgBox,
   383:                     Box.createHorizontalStrut (SMT_ITEM_GAP_2),
   384:                     smtItemCrtGr0X.smiBox,
   385:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   386:                     smtItemCrtGr0Y.smiBox,
   387:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   388:                     smtItemCrtGr1X.smiBox,
   389:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   390:                     smtItemCrtGr1Y.smiBox,
   391:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   392:                     smtItemCrtGr2X.smiBox,
   393:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   394:                     smtItemCrtGr2Y.smiBox,
   395:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   396:                     smtItemCrtGr3X.smiBox,
   397:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   398:                     smtItemCrtGr3Y.smiBox,
   399:                     Box.createHorizontalGlue ()
   400:                     )
   401:                   ),
   402:                 "CRTC / System port"),  //setTitledLineBorder
   403:               "ja", "CRTC / システムポート"),  //Multilingual.mlnTitledBorder
   404:             Box.createHorizontalStrut (SMT_MARGIN)
   405:             ),
   406: 
   407:           ComponentFactory.createHorizontalBox (
   408:             Box.createHorizontalStrut (SMT_MARGIN),
   409:             Multilingual.mlnTitledBorder (
   410:               ComponentFactory.setTitledLineBorder (
   411:                 ComponentFactory.createVerticalBox (
   412:                   ComponentFactory.createHorizontalBox (
   413:                     smtModeTextField = ComponentFactory.setEditable (
   414:                       ComponentFactory.setHorizontalAlignment (
   415:                         ComponentFactory.createTextField ("", 30),
   416:                         JTextField.CENTER),
   417:                       false)
   418:                     ),
   419:                   ComponentFactory.createHorizontalBox (
   420:                     smtVcnItemGroup1.smgBox,
   421:                     Box.createHorizontalStrut (SMT_ITEM_GAP_2),
   422:                     smtItemVcnGrMM.smiBox,
   423:                     Box.createHorizontalStrut (SMT_ITEM_GAP_3),
   424:                     smtItemVcnSpPr.smiBox,
   425:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   426:                     smtItemVcnTxPr.smiBox,
   427:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   428:                     smtItemVcnGrPr.smiBox,
   429:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   430:                     smtItemVcnG4th.smiBox,
   431:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   432:                     smtItemVcnG3rd.smiBox,
   433:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   434:                     smtItemVcnG2nd.smiBox,
   435:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   436:                     smtItemVcnG1st.smiBox,
   437:                     Box.createHorizontalGlue ()
   438:                     ),
   439:                   ComponentFactory.createHorizontalBox (
   440:                     smtVcnItemGroup2.smgBox,
   441:                     Box.createHorizontalStrut (SMT_ITEM_GAP_2),
   442:                     smtItemVcnAHOn.smiBox,
   443:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   444:                     smtItemVcnExOn.smiBox,
   445:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   446:                     smtItemVcnHalf.smiBox,
   447:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   448:                     smtItemVcnPLSB.smiBox,
   449:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   450:                     smtItemVcnGrGr.smiBox,
   451:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   452:                     smtItemVcnGrST.smiBox,
   453:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   454:                     smtItemVcnSpOn.smiBox,
   455:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   456:                     smtItemVcnTxOn.smiBox,
   457:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   458:                     smtItemVcnGxOn.smiBox,
   459:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   460:                     smtItemVcnG4On.smiBox,
   461:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   462:                     smtItemVcnG3On.smiBox,
   463:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   464:                     smtItemVcnG2On.smiBox,
   465:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   466:                     smtItemVcnG1On.smiBox,
   467:                     Box.createHorizontalGlue ()
   468:                     )
   469:                   ),
   470:                 "Video Controller"),  //setTitledLineBorder
   471:               "ja", "ビデオコントローラ"),  //Multilingual.mlnTitledBorder
   472:             Box.createHorizontalStrut (SMT_MARGIN)
   473:             ),
   474: 
   475:           ComponentFactory.createHorizontalBox (
   476:             Box.createHorizontalStrut (SMT_MARGIN),
   477:             Multilingual.mlnTitledBorder (
   478:               ComponentFactory.setTitledLineBorder (
   479:                 ComponentFactory.createVerticalBox (
   480:                   ComponentFactory.createHorizontalBox (
   481:                     smtSprItemGroup1.smgBox,
   482:                     Box.createHorizontalStrut (SMT_ITEM_GAP_2),
   483:                     smtItemSprBg0X.smiBox,
   484:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   485:                     smtItemSprBg0Y.smiBox,
   486:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   487:                     smtItemSprBg1X.smiBox,
   488:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   489:                     smtItemSprBg1Y.smiBox,
   490:                     Box.createHorizontalStrut (SMT_ITEM_GAP_3),
   491:                     smtItemSprDisp.smiBox,
   492:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   493:                     smtItemSprB1Tx.smiBox,
   494:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   495:                     smtItemSprB1On.smiBox,
   496:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   497:                     smtItemSprB0Tx.smiBox,
   498:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   499:                     smtItemSprB0On.smiBox,
   500:                     Box.createHorizontalGlue ()
   501:                     ),
   502:                   ComponentFactory.createHorizontalBox (
   503:                     smtSprItemGroup2.smgBox,
   504:                     Box.createHorizontalStrut (SMT_ITEM_GAP_2),
   505:                     smtItemSprHFEd.smiBox,
   506:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   507:                     smtItemSprHBEd.smiBox,
   508:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   509:                     smtItemSprVBEd.smiBox,
   510:                     Box.createHorizontalStrut (SMT_ITEM_GAP_3),
   511:                     smtItemSprHigh.smiBox,
   512:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   513:                     smtItemSprVRes.smiBox,
   514:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   515:                     smtItemSprHRes.smiBox,
   516:                     Box.createHorizontalGlue (),
   517:                     ComponentFactory.createVerticalBox (
   518:                       Box.createVerticalGlue (),
   519:                       SpriteScreen.SPR_PATTEST_ON ?
   520:                       Multilingual.mlnText (ComponentFactory.createCheckBox (SpriteScreen.sprPatCurr == SpriteScreen.sprPatTest, "Pattern Test", new ActionListener () {
   521:                         @Override public void actionPerformed (ActionEvent ae) {
   522:                           if (((JCheckBox) ae.getSource ()).isSelected ()) {
   523:                             SpriteScreen.sprPatCurr = SpriteScreen.sprPatTest;
   524:                             SpriteScreen.sprColCurr = SpriteScreen.sprColTest;
   525:                             SpriteScreen.sprT0ColCurr = SpriteScreen.sprT0ColTest;
   526:                             SpriteScreen.sprT1ColCurr = SpriteScreen.sprT1ColTest;
   527:                           } else {
   528:                             SpriteScreen.sprPatCurr = SpriteScreen.sprPatPort;
   529:                             SpriteScreen.sprColCurr = SpriteScreen.sprColPort;
   530:                             SpriteScreen.sprT0ColCurr = SpriteScreen.sprT0ColPort;
   531:                             SpriteScreen.sprT1ColCurr = SpriteScreen.sprT1ColPort;
   532:                           }
   533:                           CRTC.crtAllStamp += 2;
   534:                           if (XEiJ.mpuTask == null) {  //停止中
   535:                             CRTC.crtRepaint ();
   536:                           }
   537:                         }
   538:                       }), "ja", "パターンテスト") :
   539:                       null,
   540:                       Box.createVerticalGlue ()
   541:                       )
   542:                     )
   543:                   ),
   544:                 "Sprite Controller"),  //setTitledLineBorder
   545:               "ja", "スプライトコントローラ"),  //Multilingual.mlnTitledBorder
   546:             Box.createHorizontalStrut (SMT_MARGIN)
   547:             ),
   548: 
   549:           Box.createVerticalStrut (SMT_MARGIN)
   550:           )
   551:         ),
   552:       "ja", "表示モードテスト");  //Multilingual.mlnTitle
   553: 
   554:     //  ウインドウリスナー
   555:     ComponentFactory.addListener (
   556:       smtFrame,
   557:       new WindowAdapter () {
   558:         @Override public void windowClosing (WindowEvent we) {
   559:           XEiJ.dbgVisibleMask &= ~XEiJ.DBG_SMT_VISIBLE_MASK;
   560:         }
   561:       });
   562: 
   563:   }  //smtMakeFrame()
   564: 
   565:   //smtUpdateFrame ()
   566:   //  表示モードテストを更新する
   567:   public static void smtUpdateFrame () {
   568: 
   569:     if (smtFrame == null) {
   570:       return;
   571:     }
   572: 
   573:     //周波数
   574:     smtUpdateFreq ();
   575: 
   576:     //モード
   577:     smtUpdateMode ();
   578: 
   579:     //アイテム
   580:     smtItemCrtHFEd.smiSetPortValue (CRTC.crtR00HFrontEndPort);
   581:     smtItemCrtHSEd.smiSetPortValue (CRTC.crtR01HSyncEndPort);
   582:     smtItemCrtHBEd.smiSetPortValue (CRTC.crtR02HBackEndPort);
   583:     smtItemCrtHDEd.smiSetPortValue (CRTC.crtR03HDispEndPort);
   584:     smtItemCrtVFEd.smiSetPortValue (CRTC.crtR04VFrontEndPort);
   585:     smtItemCrtVSEd.smiSetPortValue (CRTC.crtR05VSyncEndPort);
   586:     smtItemCrtVBEd.smiSetPortValue (CRTC.crtR06VBackEndPort);
   587:     smtItemCrtVDEd.smiSetPortValue (CRTC.crtR07VDispEndPort);
   588: 
   589:     smtItemCrtIRQ.smiSetPortValue (CRTC.crtR09IRQRasterPort);
   590:     smtItemCrtTxX.smiSetPortValue (CRTC.crtR10TxXPort);
   591:     smtItemCrtTxY.smiSetPortValue (CRTC.crtR11TxYPort);
   592:     smtItemCrtGrMM.smiSetPortValue (CRTC.crtMemoryModePort);
   593:     smtItemCrtHigh.smiSetPortValue (CRTC.crtHighResoPort);
   594:     smtItemCrtVRes.smiSetPortValue (CRTC.crtVResoPort);
   595:     smtItemCrtHRes.smiSetPortValue (CRTC.crtHResoPort);
   596:     smtItemSysHRL.smiSetPortValue (CRTC.crtHRLPort);
   597:     smtItemSysCont.smiSetPortValue (VideoController.vcnTargetContrastPort);
   598: 
   599:     smtItemCrtGr0X.smiSetPortValue (CRTC.crtR12GrXPort[0]);
   600:     smtItemCrtGr0Y.smiSetPortValue (CRTC.crtR13GrYPort[0]);
   601:     smtItemCrtGr1X.smiSetPortValue (CRTC.crtR12GrXPort[1]);
   602:     smtItemCrtGr1Y.smiSetPortValue (CRTC.crtR13GrYPort[1]);
   603:     smtItemCrtGr2X.smiSetPortValue (CRTC.crtR12GrXPort[2]);
   604:     smtItemCrtGr2Y.smiSetPortValue (CRTC.crtR13GrYPort[2]);
   605:     smtItemCrtGr3X.smiSetPortValue (CRTC.crtR12GrXPort[3]);
   606:     smtItemCrtGr3Y.smiSetPortValue (CRTC.crtR13GrYPort[3]);
   607: 
   608:     smtItemVcnGrMM.smiSetPortValue (VideoController.vcnReg1Port      );
   609:     smtItemVcnSpPr.smiSetPortValue (VideoController.vcnReg2Port >> 12);
   610:     smtItemVcnTxPr.smiSetPortValue (VideoController.vcnReg2Port >> 10);
   611:     smtItemVcnGrPr.smiSetPortValue (VideoController.vcnReg2Port >>  8);
   612:     smtItemVcnG4th.smiSetPortValue (VideoController.vcnReg2Port >>  6);
   613:     smtItemVcnG3rd.smiSetPortValue (VideoController.vcnReg2Port >>  4);
   614:     smtItemVcnG2nd.smiSetPortValue (VideoController.vcnReg2Port >>  2);
   615:     smtItemVcnG1st.smiSetPortValue (VideoController.vcnReg2Port      );
   616: 
   617:     smtItemVcnAHOn.smiSetPortValue (VideoController.vcnReg3Port >> 14);
   618:     smtItemVcnExOn.smiSetPortValue (VideoController.vcnReg3Port >> 12);
   619:     smtItemVcnHalf.smiSetPortValue (VideoController.vcnReg3Port >> 11);
   620:     smtItemVcnPLSB.smiSetPortValue (VideoController.vcnReg3Port >> 10);
   621:     smtItemVcnGrGr.smiSetPortValue (VideoController.vcnReg3Port >>  9);
   622:     smtItemVcnGrST.smiSetPortValue (VideoController.vcnReg3Port >>  8);
   623:     smtItemVcnSpOn.smiSetPortValue (VideoController.vcnReg3Port >>  6);
   624:     smtItemVcnTxOn.smiSetPortValue (VideoController.vcnReg3Port >>  5);
   625:     smtItemVcnGxOn.smiSetPortValue (VideoController.vcnReg3Port >>  4);
   626:     smtItemVcnG4On.smiSetPortValue (VideoController.vcnReg3Port >>  3);
   627:     smtItemVcnG3On.smiSetPortValue (VideoController.vcnReg3Port >>  2);
   628:     smtItemVcnG2On.smiSetPortValue (VideoController.vcnReg3Port >>  1);
   629:     smtItemVcnG1On.smiSetPortValue (VideoController.vcnReg3Port      );
   630: 
   631:     smtItemSprBg0X.smiSetPortValue (SpriteScreen.sprReg0Bg0XPort);
   632:     smtItemSprBg0Y.smiSetPortValue (SpriteScreen.sprReg1Bg0YPort);
   633:     smtItemSprBg1X.smiSetPortValue (SpriteScreen.sprReg2Bg1XPort);
   634:     smtItemSprBg1Y.smiSetPortValue (SpriteScreen.sprReg3Bg1YPort);
   635:     smtItemSprDisp.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 9);
   636:     smtItemSprB1Tx.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 4);
   637:     smtItemSprB1On.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 3);
   638:     smtItemSprB0Tx.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 1);
   639:     smtItemSprB0On.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort     );
   640: 
   641:     smtItemSprHFEd.smiSetPortValue (SpriteScreen.sprReg5HFrontEndPort);
   642:     smtItemSprHBEd.smiSetPortValue (SpriteScreen.sprReg6HBackEndPort);
   643:     smtItemSprVBEd.smiSetPortValue (SpriteScreen.sprReg7VBackEndPort);
   644:     smtItemSprHigh.smiSetPortValue (SpriteScreen.sprReg8ResoPort >> 4);
   645:     smtItemSprVRes.smiSetPortValue (SpriteScreen.sprReg8ResoPort >> 2);
   646:     smtItemSprHRes.smiSetPortValue (SpriteScreen.sprReg8ResoPort     );
   647: 
   648:     for (SMTItem item : smtItemArray) {
   649:       if (item.smiPending) {
   650:         item.smiPending = false;
   651:         item.smiControlled ();
   652:       }
   653:     }
   654: 
   655:   }  //smtUpdateFrame()
   656: 
   657:   //smtUpdateFreq ()
   658:   //  周波数の表示を更新する
   659:   public static void smtUpdateFreq () {
   660:     int htotal = CRTC.crtR00HFrontEndCurr + 1;
   661:     int vtotal = CRTC.crtR04VFrontEndCurr + 1;
   662:     if (0 < htotal && 0 < vtotal) {  //0除算を回避する
   663:       int k = CRTC.crtHRLCurr << 3 | CRTC.crtHighResoCurr << 2 | CRTC.crtHResoCurr;
   664:       double osc = (double) CRTC.crtFreqs[CRTC.CRT_OSCS[k]];
   665:       int ratio = CRTC.CRT_DIVS[k];
   666:       double hfreq = osc / (ratio * htotal << 3);
   667:       double vfreq = hfreq / vtotal;
   668:       int width = CRTC.crtR03HDispEndCurr - CRTC.crtR02HBackEndCurr << 3;
   669:       int height = CRTC.crtR07VDispEndCurr - CRTC.crtR06VBackEndCurr;
   670:       String option = "(normal)";
   671:       if (CRTC.crtDuplication) {  //ラスタ2度読み
   672:         height >>= 1;
   673:         option = "(double-scanning)";
   674:       } else if (CRTC.crtInterlace) {  //インターレース
   675:         height <<= 1;
   676:         option = "(interlace)";
   677:       } else if (CRTC.crtSlit) {  //スリット
   678:         option = "(slit)";
   679:       }
   680:       String freqText = String.format ("%dx%d%s, HSYNC:%.3fMHz/%d/8/%d=%.3fkHz, VSYNC:%.3fkHz/%d=%.3fHz",
   681:                                        width, height,
   682:                                        option,
   683:                                        osc * 1e-6, ratio, htotal, hfreq * 1e-3,
   684:                                        hfreq * 1e-3, vtotal, vfreq);
   685:       if (!freqText.equals (smtFreqLastText)) {  //前回と同じときは更新しない。内容が変わっていないのに更新し続けるとコピーできない
   686:         smtFreqLastText = freqText;
   687:         smtFreqTextField.setText (freqText);
   688:       }
   689:     }
   690:   }  //smtUpdateFreq()
   691: 
   692:   //smtUpdateMode ()
   693:   //  画面モードの表示を更新する
   694:   //  画面モードは頻繁に更新される場合があるが、表示が頻繁に更新されるとコピーできないので、最近使われた複数の画面モードを一定の順序で表示する
   695:   public static void smtUpdateMode () {
   696:     String name1 = VideoController.vcnMode.name ();  //分類
   697:     String name2 = VideoController.vcnGetName (new StringBuilder ()).toString ();  //詳細
   698:     String name = name1.equals (name2) ? name1 : new StringBuilder (name1).append ('(').append (name2).append (')').toString ();  //モードの名前
   699:     long time = XEiJ.mpuClockTime;  //現在の時刻
   700:     boolean update = false;  //true=更新する
   701:     //リストを走査する
   702:     //  今回のモードのとき時刻を更新する
   703:     //  時刻がSMT_MODE_SPAN秒前よりも古いレコードを捨てる
   704:     boolean f = false;  //true=リストに今回のモードがある
   705:     {
   706:       long t = time - XEiJ.TMR_FREQ * SMT_MODE_SPAN;  //SMT_MODE_SPAN秒前の時刻
   707:       int k = 0;  //残ったレコードの数。時刻がSMT_MODE_SPAN秒前よりも新しいレコードの数
   708:       for (int i = 0; i < smtModeCount; i++) {
   709:         if (name.compareTo (smtModeName[i]) == 0) {  //今回のモードのとき
   710:           f = true;  //リストに今回のモードがある
   711:           //レコードを残して時刻を更新する。k<iのとき詰める
   712:           smtModeName[k] = name;
   713:           smtModeTime[k] = time;
   714:           k++;
   715:         } else if (t < smtModeTime[i]) {  //今回のモードではなくて時刻がSMT_MODE_SPAN秒前よりも新しいとき
   716:           //レコードを残す。k<iのとき詰める
   717:           smtModeName[k] = smtModeName[i];
   718:           smtModeTime[k] = smtModeTime[i];
   719:           k++;
   720:         }
   721:       }
   722:       if (k < smtModeCount) {  //時刻がSMT_MODE_SPAN秒以上前のレコードを捨てて詰めたのでリストが短くなった
   723:         smtModeCount = k;
   724:         update = true;
   725:       }
   726:     }
   727:     if (!f) {  //リストに今回のモードがないとき
   728:       //リストが一杯のとき最も古いレコードを捨てる
   729:       if (smtModeCount == SMT_MODE_LIMIT) {
   730:         //最も古いレコードを探す
   731:         int o = -1;  //最も古いレコードのインデックス
   732:         long t = Long.MAX_VALUE;  //最も古いレコードの時刻
   733:         for (int i = 0; i < smtModeCount; i++) {
   734:           if (smtModeTime[i] < t) {
   735:             t = smtModeTime[i];
   736:             o = i;
   737:           }
   738:         }
   739:         //リストを詰める
   740:         for (int i = o + 1; i < SMT_MODE_LIMIT; i++) {
   741:           smtModeName[i - 1] = smtModeName[i];
   742:           smtModeTime[i - 1] = smtModeTime[i];
   743:         }
   744:         smtModeCount--;
   745:       }
   746:       //リストに今回のモードを追加する
   747:       {
   748:         int p = -1;  //今回のモードを挿入する位置。今回のモードよりも名前が大きいレコードの最小のインデックス。-1=今回のモードよりも名前が大きいレコードがない
   749:         for (int i = 0; i < smtModeCount; i++) {
   750:           if (name.compareTo (smtModeName[i]) < 0) {
   751:             p = i;  //今回のモードよりも名前が大きいレコードの最小のインデックス
   752:             break;
   753:           }
   754:         }
   755:         if (p < 0) {  //今回のモードよりも名前が大きいレコードがないとき
   756:           p = smtModeCount;  //末尾に追加する
   757:         }
   758:         for (int i = smtModeCount - 1; p <= i; i--) {
   759:           smtModeName[i + 1] = smtModeName[i];
   760:           smtModeTime[i + 1] = smtModeTime[i];
   761:         }
   762:         smtModeName[p] = name;
   763:         smtModeTime[p] = time;
   764:         smtModeCount++;
   765:       }
   766:       update = true;
   767:     }
   768:     //リストが変化したとき表示する
   769:     if (update) {
   770:       StringBuilder sb = new StringBuilder ();
   771:       for (int i = 0; i < smtModeCount; i++) {
   772:         if (0 < i) {
   773:           sb.append (", ");
   774:         }
   775:         sb.append (smtModeName[i]);
   776:       }
   777:       smtModeTextField.setText (sb.toString ());
   778:     }
   779:   }  //smtUpdateMode()
   780: 
   781: 
   782: 
   783:   //========================================================================================
   784:   //$$SMI 表示モードテストのアイテム
   785:   public static class SMTItem {
   786: 
   787:     public int smiBitWidth;  //bit幅
   788:     public int smiBitMask;  //bitマスク兼最大値。(1<<smiBitWidth)-1
   789:     public int smiDigits;  //最大値の10進桁数。(smiBitWidth*77>>8)+1
   790: 
   791:     public int smiPortValue;  //現在Portに表示されている値
   792:     public int smiMaskValue;  //現在Maskで選択されている値。0=Port,-1=Test
   793:     public int smiTestValue;  //現在Testに表示されている値
   794: 
   795:     public boolean smiPending;  //true=動作中に操作されたのでsmtUpdateFrame()でMaskとTestを取り込む
   796: 
   797:     public ButtonGroup smiButtonGroup;  //PortとTestを選択するラジオボタンのグループ
   798: 
   799:     public Box smiBox;  //ボックス
   800:     public JLabel smiNameLabel;  //名前のラベル
   801: 
   802:     public JRadioButton smiPortRadioButton;  //Portを選択するラジオボタン
   803:     public JCheckBox smiPortCheckBox;  //1bitのときPortで使うチェックボックス
   804:     public JTextField smiPortTextField;  //2bit以上あるときPortで使うテキストフィールド
   805: 
   806:     public JRadioButton smiTestRadioButton;  //Testを選択するラジオボタン
   807:     public JCheckBox smiTestCheckBox;  //1bitのときTestで使うチェックボックス
   808:     public DecimalSpinner smiTestSpinner;  //2bit以上あるときTestで使うスピナー
   809: 
   810:     public SMTGroup smiItemGroup;
   811: 
   812:     //  コンストラクタ
   813:     public SMTItem (String name, int portValue, int bitWidth) {
   814: 
   815:       smiBitWidth = bitWidth;
   816:       smiBitMask = (1 << bitWidth) - 1;
   817:       smiDigits = (bitWidth * 77 >> 8) + 1;
   818: 
   819:       portValue &= smiBitMask;
   820:       smiPortValue = portValue;
   821:       smiMaskValue = 0;
   822:       smiTestValue = portValue;
   823: 
   824:       smiPending = false;
   825: 
   826:       smiButtonGroup = new ButtonGroup ();
   827: 
   828:       smiBox = ComponentFactory.setFixedSize (
   829:         ComponentFactory.createVerticalBox (
   830:           Box.createVerticalGlue (),
   831:           ComponentFactory.createHorizontalBox (
   832:             Box.createHorizontalGlue (),
   833:             smiNameLabel = ComponentFactory.setFixedSize (ComponentFactory.createLabel (name), bitWidth == 1 ? 32 : 14 + 24 + 8 * smiDigits, 16),
   834:             Box.createHorizontalGlue ()
   835:             ),
   836:           ComponentFactory.createHorizontalBox (
   837:             Box.createHorizontalGlue (),
   838:             smiPortRadioButton = ComponentFactory.setFixedSize (ComponentFactory.createRadioButton (smiButtonGroup, smiMaskValue == 0, "", new ActionListener () {
   839:               @Override public void actionPerformed (ActionEvent ae) {
   840:                 smiPortSelected ();
   841:               }
   842:             }), 14, 16),  //ae -> this.smiPortSelected ()
   843:             bitWidth == 1 ?
   844:             (smiPortCheckBox = ComponentFactory.setEnabled (
   845:               ComponentFactory.setFixedSize (ComponentFactory.createCheckBox (smiPortValue != 0, "", null), 14, 16),
   846:               false)) :  //操作不可
   847:             (smiPortTextField = ComponentFactory.setFixedSize (
   848:               ComponentFactory.setEditable (
   849:                 ComponentFactory.setHorizontalAlignment (
   850:                   new JTextField (String.valueOf (smiPortValue)), //columnを指定すると幅を調節できなくなる
   851:                   JTextField.CENTER),  //中央寄せ
   852:                 false),  //編集不可
   853:               24 + 8 * smiDigits, 16)),
   854:             Box.createHorizontalGlue ()
   855:             ),
   856:           ComponentFactory.createHorizontalBox (
   857:             Box.createHorizontalGlue (),
   858:             smiTestRadioButton = ComponentFactory.setFixedSize (ComponentFactory.createRadioButton (smiButtonGroup, smiMaskValue != 0, "", new ActionListener () {
   859:               @Override public void actionPerformed (ActionEvent ae) {
   860:                 smiTestSelected ();
   861:               }
   862:             }), 14, 16),  //ae -> this.smiTestSelected ()
   863:             bitWidth == 1 ?
   864:             (smiTestCheckBox = ComponentFactory.setFixedSize (ComponentFactory.createCheckBox (smiTestValue != 0, "", new ActionListener () {
   865:               @Override public void actionPerformed (ActionEvent ae) {
   866:                 smiTestChanged ();
   867:               }
   868:             }), 14, 16)) :  //ae -> this.smiTestChanged ()
   869:             (smiTestSpinner = ComponentFactory.createDecimalSpinner (smiTestValue, 0, smiBitMask, 1, 0, new ChangeListener () {
   870:               @Override public void stateChanged (ChangeEvent ce) {
   871:                 smiTestChanged ();
   872:               }
   873:             })),  //ce -> this.smiTestChanged ()
   874:             Box.createHorizontalGlue ()
   875:             ),
   876:           Box.createVerticalGlue ()
   877:           ),
   878:         bitWidth == 1 ? 32 : 14 + 24 + 8 * smiDigits, 48);
   879: 
   880:       smiItemGroup = null;
   881: 
   882:     }  //new SMTItem(int,int,int)
   883: 
   884:     //smiSetPortValue (portValue)
   885:     //  Portの値を表示する
   886:     //  smtUpdateFrame()が呼び出す
   887:     public void smiSetPortValue (int portValue) {
   888:       portValue &= smiBitMask;
   889:       if (smiPortValue != portValue) {
   890:         smiPortValue = portValue;
   891:         if (smiBitWidth == 1) {
   892:           smiPortCheckBox.setSelected (portValue != 0);
   893:         } else {
   894:           smiPortTextField.setText (String.valueOf (portValue));
   895:         }
   896:       }
   897:     }  //smiSetPortValue(int)
   898: 
   899:     //smiPortSelected ()
   900:     //  Portが選択された
   901:     public void smiPortSelected () {
   902:       if (smiMaskValue != 0) {
   903:         smiMaskValue = 0;
   904:         if (XEiJ.mpuTask == null) {  //停止中
   905:           //停止中のときはすぐにsmiControlled()を呼び出す
   906:           smiControlled ();
   907:         } else {  //動作中
   908:           //動作中のときは次回のsmtUpdateFrame()でsmiControlled()を呼び出す
   909:           smiPending = true;
   910:         }
   911:         if (smiItemGroup != null) {
   912:           smiItemGroup.smgUpdate ();
   913:         }
   914:       }
   915:     }  //smiPortSelected()
   916: 
   917:     //smiTestSelected ()
   918:     //  Testが選択された
   919:     public void smiTestSelected () {
   920:       if (smiMaskValue == 0) {
   921:         smiMaskValue = -1;
   922:         if (XEiJ.mpuTask == null) {  //停止中
   923:           //停止中のときはすぐにsmiControlled()を呼び出す
   924:           smiControlled ();
   925:         } else {  //動作中
   926:           //動作中のときは次回のsmtUpdateFrame()でsmiControlled()を呼び出す
   927:           smiPending = true;
   928:         }
   929:         if (smiItemGroup != null) {
   930:           smiItemGroup.smgUpdate ();
   931:         }
   932:       }
   933:     }  //smiTestSelected()
   934: 
   935:     //smiTestChanged ()
   936:     //  Testの値が変更された
   937:     public void smiTestChanged () {
   938:       int testValue = (smiBitWidth == 1 ? smiTestCheckBox.isSelected () ? 1 : 0 :
   939:                        smiTestSpinner.getIntValue ());
   940:       if (smiTestValue != testValue) {
   941:         smiTestValue = testValue;
   942:         if (XEiJ.mpuTask == null) {  //停止中
   943:           //停止中のときはすぐにsmiControlled()を呼び出す
   944:           smiControlled ();
   945:         } else {  //動作中
   946:           //動作中のときは次回のsmtUpdateFrame()でsmiControlled()を呼び出す
   947:           smiPending = true;
   948:         }
   949:       }
   950:     }  //smiTestChanged()
   951: 
   952:     //smiControlled ()
   953:     //  MaskまたはTestが操作された
   954:     public void smiControlled () {
   955:       //オーバーライドする
   956:     }  //smiControlled()
   957: 
   958:   }  //class SMTItem
   959: 
   960: 
   961:   //----------------------------------------------------------------------------------------
   962:   //CRTC
   963: 
   964:   public static class SMTItem_CrtHFEd extends SMTItem {
   965:     public SMTItem_CrtHFEd () {
   966:       super ("HFEd", CRTC.crtR00HFrontEndPort, 8);
   967:       Multilingual.mlnToolTipText (smiNameLabel,
   968:                       "en", "$E80000.w 7-0 Horizontal front porch end column",
   969:                       "ja", "$E80000.w 7-0 水平フロントポーチ終了カラム");
   970:     }
   971:     @Override public void smiControlled () {
   972:       CRTC.crtR00HFrontEndMask = smiMaskValue;
   973:       CRTC.crtR00HFrontEndTest = smiTestValue;
   974:       int curr = CRTC.crtR00HFrontEndMask == 0 ? CRTC.crtR00HFrontEndPort : CRTC.crtR00HFrontEndTest;
   975:       if (CRTC.crtR00HFrontEndCurr != curr) {
   976:         CRTC.crtR00HFrontEndCurr = curr;
   977:         if (XEiJ.mpuTask != null) {  //動作中
   978:           CRTC.crtRestart ();
   979:         }
   980:       }
   981:     }
   982:   }  //class SMTItem_CrtHFEd
   983: 
   984:   public static class SMTItem_CrtHSEd extends SMTItem {
   985:     public SMTItem_CrtHSEd () {
   986:       super ("HSEd", CRTC.crtR01HSyncEndPort, 8);
   987:       Multilingual.mlnToolTipText (smiNameLabel,
   988:                       "en", "$E80002.w 7-0 Horizontal sync pulse end column",
   989:                       "ja", "$E80002.w 7-0 水平同期パルス終了カラム");
   990:     }
   991:     @Override public void smiControlled () {
   992:       CRTC.crtR01HSyncEndMask = smiMaskValue;
   993:       CRTC.crtR01HSyncEndTest = smiTestValue;
   994:       int curr = CRTC.crtR01HSyncEndMask == 0 ? CRTC.crtR01HSyncEndPort : CRTC.crtR01HSyncEndTest;
   995:       if (CRTC.crtR01HSyncEndCurr != curr) {
   996:         CRTC.crtR01HSyncEndCurr = curr;
   997:         if (XEiJ.mpuTask != null) {  //動作中
   998:           CRTC.crtRestart ();
   999:         }
  1000:       }
  1001:     }
  1002:   }  //class SMTItem_CrtHSEd
  1003: 
  1004:   public static class SMTItem_CrtHBEd extends SMTItem {
  1005:     public SMTItem_CrtHBEd () {
  1006:       super ("HBEd", CRTC.crtR02HBackEndPort, 8);
  1007:       Multilingual.mlnToolTipText (smiNameLabel,
  1008:                       "en", "$E80004.w 7-0 Horizontal back porch end column -4",
  1009:                       "ja", "$E80004.w 7-0 水平バックポーチ終了カラム -4");
  1010:     }
  1011:     @Override public void smiControlled () {
  1012:       CRTC.crtR02HBackEndMask = smiMaskValue;
  1013:       CRTC.crtR02HBackEndTest = smiTestValue;
  1014:       int curr = CRTC.crtR02HBackEndMask == 0 ? CRTC.crtR02HBackEndPort : CRTC.crtR02HBackEndTest;
  1015:       if (CRTC.crtR02HBackEndCurr != curr) {
  1016:         CRTC.crtR02HBackEndCurr = curr;
  1017:         if (XEiJ.mpuTask != null) {  //動作中
  1018:           CRTC.crtRestart ();
  1019:         }
  1020:       }
  1021:     }
  1022:   }  //class SMTItem_CrtHBEd
  1023: 
  1024:   public static class SMTItem_CrtHDEd extends SMTItem {
  1025:     public SMTItem_CrtHDEd () {
  1026:       super ("HDEd", CRTC.crtR03HDispEndPort, 8);
  1027:       Multilingual.mlnToolTipText (smiNameLabel,
  1028:                       "en", "$E80006.w 7-0 Horizontal display period end column -4",
  1029:                       "ja", "$E80006.w 7-0 水平映像期間終了カラム -4");
  1030:     }
  1031:     @Override public void smiControlled () {
  1032:       CRTC.crtR03HDispEndMask = smiMaskValue;
  1033:       CRTC.crtR03HDispEndTest = smiTestValue;
  1034:       int curr = CRTC.crtR03HDispEndMask == 0 ? CRTC.crtR03HDispEndPort : CRTC.crtR03HDispEndTest;
  1035:       if (CRTC.crtR03HDispEndCurr != curr) {
  1036:         CRTC.crtR03HDispEndCurr = curr;
  1037:         if (XEiJ.mpuTask != null) {  //動作中
  1038:           CRTC.crtRestart ();
  1039:         }
  1040:       }
  1041:     }
  1042:   }  //class SMTItem_CrtHDEd
  1043: 
  1044:   public static class SMTItem_CrtVFEd extends SMTItem {
  1045:     public SMTItem_CrtVFEd () {
  1046:       super ("VFEd", CRTC.crtR04VFrontEndPort, 10);
  1047:       Multilingual.mlnToolTipText (smiNameLabel,
  1048:                       "en", "$E80008.w 9-0 Vertical front porch end raster",
  1049:                       "ja", "$E80008.w 9-0 垂直フロントポーチ終了ラスタ");
  1050:     }
  1051:     @Override public void smiControlled () {
  1052:       CRTC.crtR04VFrontEndMask = smiMaskValue;
  1053:       CRTC.crtR04VFrontEndTest = smiTestValue;
  1054:       int curr = CRTC.crtR04VFrontEndMask == 0 ? CRTC.crtR04VFrontEndPort : CRTC.crtR04VFrontEndTest;
  1055:       if (CRTC.crtR04VFrontEndCurr != curr) {
  1056:         CRTC.crtR04VFrontEndCurr = curr;
  1057:         if (CRTC.CRT_RASTER_HASH_ON) {
  1058:           CRTC.crtUpdateRasterHash ();
  1059:         }
  1060:         if (XEiJ.mpuTask != null) {  //動作中
  1061:           CRTC.crtRestart ();
  1062:         }
  1063:       }
  1064:     }
  1065:   }  //class SMTItem_CrtVFEd
  1066: 
  1067:   public static class SMTItem_CrtVSEd extends SMTItem {
  1068:     public SMTItem_CrtVSEd () {
  1069:       super ("VSEd", CRTC.crtR05VSyncEndPort, 10);
  1070:       Multilingual.mlnToolTipText (smiNameLabel,
  1071:                       "en", "$E8000A.w 9-0 Vertical sync pulse end raster",
  1072:                       "ja", "$E8000A.w 9-0 垂直同期パルス終了ラスタ");
  1073:     }
  1074:     @Override public void smiControlled () {
  1075:       CRTC.crtR05VSyncEndMask = smiMaskValue;
  1076:       CRTC.crtR05VSyncEndTest = smiTestValue;
  1077:       int curr = CRTC.crtR05VSyncEndMask == 0 ? CRTC.crtR05VSyncEndPort : CRTC.crtR05VSyncEndTest;
  1078:       if (CRTC.crtR05VSyncEndCurr != curr) {
  1079:         CRTC.crtR05VSyncEndCurr = curr;
  1080:         if (XEiJ.mpuTask != null) {  //動作中
  1081:           CRTC.crtRestart ();
  1082:         }
  1083:       }
  1084:     }
  1085:   }  //class SMTItem_CrtVSEd
  1086: 
  1087:   public static class SMTItem_CrtVBEd extends SMTItem {
  1088:     public SMTItem_CrtVBEd () {
  1089:       super ("VBEd", CRTC.crtR06VBackEndPort, 10);
  1090:       Multilingual.mlnToolTipText (smiNameLabel,
  1091:                       "en", "$E8000C.w 9-0 Vertical back porch end raster",
  1092:                       "ja", "$E8000C.w 9-0 垂直バックポーチ終了ラスタ");
  1093:     }
  1094:     @Override public void smiControlled () {
  1095:       CRTC.crtR06VBackEndMask = smiMaskValue;
  1096:       CRTC.crtR06VBackEndTest = smiTestValue;
  1097:       int curr = CRTC.crtR06VBackEndMask == 0 ? CRTC.crtR06VBackEndPort : CRTC.crtR06VBackEndTest;
  1098:       if (CRTC.crtR06VBackEndCurr != curr) {
  1099:         CRTC.crtR06VBackEndCurr = curr;
  1100:         if (XEiJ.mpuTask != null) {  //動作中
  1101:           CRTC.crtRestart ();
  1102:         }
  1103:       }
  1104:     }
  1105:   }  //class SMTItem_CrtVBEd
  1106: 
  1107:   public static class SMTItem_CrtVDEd extends SMTItem {
  1108:     public SMTItem_CrtVDEd () {
  1109:       super ("VDEd", CRTC.crtR07VDispEndPort, 10);
  1110:       Multilingual.mlnToolTipText (smiNameLabel,
  1111:                       "en", "$E8000E.w 9-0 Vertical display period end raster",
  1112:                       "ja", "$E8000E.w 9-0 垂直映像期間終了ラスタ");
  1113:     }
  1114:     @Override public void smiControlled () {
  1115:       CRTC.crtR07VDispEndMask = smiMaskValue;
  1116:       CRTC.crtR07VDispEndTest = smiTestValue;
  1117:       int curr = CRTC.crtR07VDispEndMask == 0 ? CRTC.crtR07VDispEndPort : CRTC.crtR07VDispEndTest;
  1118:       if (CRTC.crtR07VDispEndCurr != curr) {
  1119:         CRTC.crtR07VDispEndCurr = curr;
  1120:         if (XEiJ.mpuTask != null) {  //動作中
  1121:           CRTC.crtRestart ();
  1122:         }
  1123:       }
  1124:     }
  1125:   }  //class SMTItem_CrtVDEd
  1126: 
  1127:   public static class SMTItem_CrtGrMM extends SMTItem {
  1128:     public SMTItem_CrtGrMM () {
  1129:       super ("GrMM", CRTC.crtMemoryModePort, 3);
  1130:       Multilingual.mlnToolTipText (smiNameLabel,
  1131:                       "en", "$E80028.w 10-8 Memory mode of graphic screen",
  1132:                       "ja", "$E80028.w 10-8 グラフィック画面のメモリモード");
  1133:     }
  1134:     @Override public void smiControlled () {
  1135:       CRTC.crtMemoryModeMask = smiMaskValue;
  1136:       CRTC.crtMemoryModeTest = smiTestValue;
  1137:       CRTC.crtSetMemoryMode (CRTC.crtTextStorage, CRTC.crtGraphicStorage, CRTC.crtMemoryModePort);
  1138:     }
  1139:   }  //class SMTItem_CrtGrMM
  1140: 
  1141:   public static class SMTItem_CrtHigh extends SMTItem {
  1142:     public SMTItem_CrtHigh () {
  1143:       super ("High", CRTC.crtHighResoPort, 1);
  1144:       Multilingual.mlnToolTipText (smiNameLabel,
  1145:                       "en", "$E80028.w 4 High-resolution",
  1146:                       "ja", "$E80028.w 4 高解像度");
  1147:     }
  1148:     @Override public void smiControlled () {
  1149:       CRTC.crtHighResoMask = smiMaskValue;
  1150:       CRTC.crtHighResoTest = smiTestValue;
  1151:       int curr = CRTC.crtHighResoMask == 0 ? CRTC.crtHighResoPort : CRTC.crtHighResoTest;
  1152:       if (CRTC.crtHighResoCurr != curr) {
  1153:         CRTC.crtHighResoCurr = curr;
  1154:         if (XEiJ.mpuTask != null) {  //動作中
  1155:           CRTC.crtRestart ();
  1156:         }
  1157:       }
  1158:     }
  1159:   }  //class SMTItem_CrtHigh
  1160: 
  1161:   public static class SMTItem_CrtVRes extends SMTItem {
  1162:     public SMTItem_CrtVRes () {
  1163:       super ("VRes", CRTC.crtVResoPort, 2);
  1164:       Multilingual.mlnToolTipText (smiNameLabel,
  1165:                       "en", "$E80028.w 3-2 Vertical resolution",
  1166:                       "ja", "$E80028.w 3-2 垂直解像度");
  1167:     }
  1168:     @Override public void smiControlled () {
  1169:       CRTC.crtVResoMask = smiMaskValue;
  1170:       CRTC.crtVResoTest = smiTestValue;
  1171:       int curr = CRTC.crtVResoMask == 0 ? CRTC.crtVResoPort : CRTC.crtVResoTest;
  1172:       if (CRTC.crtVResoCurr != curr) {
  1173:         CRTC.crtVResoCurr = curr;
  1174:         if (XEiJ.mpuTask != null) {  //動作中
  1175:           CRTC.crtRestart ();
  1176:         }
  1177:       }
  1178:     }
  1179:   }  //class SMTItem_CrtVRes
  1180: 
  1181:   public static class SMTItem_CrtHRes extends SMTItem {
  1182:     public SMTItem_CrtHRes () {
  1183:       super ("HRes", CRTC.crtHResoPort, 2);
  1184:       Multilingual.mlnToolTipText (smiNameLabel,
  1185:                       "en", "$E80028.w 1-0 Horizontal resolution",
  1186:                       "ja", "$E80028.w 1-0 水平解像度");
  1187:     }
  1188:     @Override public void smiControlled () {
  1189:       CRTC.crtHResoMask = smiMaskValue;
  1190:       CRTC.crtHResoTest = smiTestValue;
  1191:       int curr = CRTC.crtHResoMask == 0 ? CRTC.crtHResoPort : CRTC.crtHResoTest;
  1192:       if (CRTC.crtHResoCurr != curr) {
  1193:         CRTC.crtHResoCurr = curr;
  1194:         if (XEiJ.mpuTask != null) {  //動作中
  1195:           CRTC.crtRestart ();
  1196:         }
  1197:       }
  1198:     }
  1199:   }  //class SMTItem_CrtHRes
  1200: 
  1201:   public static class SMTItem_CrtIRQ extends SMTItem {
  1202:     public SMTItem_CrtIRQ () {
  1203:       super ("IRQ", CRTC.crtR09IRQRasterPort, 10);
  1204:       Multilingual.mlnToolTipText (smiNameLabel,
  1205:                       "en", "$E80012.w 9-0 IRQ raster number",
  1206:                       "ja", "$E80012.w 9-0 IRQ ラスタ番号");
  1207:     }
  1208:     @Override public void smiControlled () {
  1209:       CRTC.crtR09IRQRasterMask = smiMaskValue;
  1210:       CRTC.crtR09IRQRasterTest = smiTestValue;
  1211:       int curr = CRTC.crtR09IRQRasterMask == 0 ? CRTC.crtR09IRQRasterPort : CRTC.crtR09IRQRasterTest;
  1212:       if (CRTC.crtR09IRQRasterCurr != curr) {
  1213:         CRTC.crtR09IRQRasterCurr = curr;
  1214:         if (CRTC.CRT_RASTER_HASH_ON) {
  1215:           CRTC.crtUpdateRasterHash ();
  1216:         }
  1217:         if (RasterBreakPoint.RBP_ON) {
  1218:           RasterBreakPoint.rbpCheckIRQ ();
  1219:         }
  1220:       }
  1221:     }
  1222:   }  //class SMTItem_CrtIRQ
  1223: 
  1224:   public static class SMTItem_CrtTxX extends SMTItem {
  1225:     public SMTItem_CrtTxX () {
  1226:       super ("TxX", CRTC.crtR10TxXPort, 10);
  1227:       Multilingual.mlnToolTipText (smiNameLabel,
  1228:                       "en", "$E80014.w 9-0 Text screen x-direction scroll",
  1229:                       "ja", "$E80014.w 9-0 テキスト画面 x 方向スクロール");
  1230:     }
  1231:     @Override public void smiControlled () {
  1232:       CRTC.crtR10TxXMask = smiMaskValue;
  1233:       CRTC.crtR10TxXTest = smiTestValue;
  1234:       int curr = CRTC.crtR10TxXMask == 0 ? CRTC.crtR10TxXPort : CRTC.crtR10TxXTest;
  1235:       if (CRTC.crtR10TxXCurr != curr) {
  1236:         CRTC.crtR10TxXCurr = curr;
  1237:         CRTC.crtAllStamp += 2;
  1238:         if (XEiJ.mpuTask == null) {  //停止中
  1239:           CRTC.crtRepaint ();
  1240:         }
  1241:       }
  1242:     }
  1243:   }  //class SMTItem_CrtTxX
  1244: 
  1245:   public static class SMTItem_CrtTxY extends SMTItem {
  1246:     public SMTItem_CrtTxY () {
  1247:       super ("TxY", CRTC.crtR11TxYPort, 10);
  1248:       Multilingual.mlnToolTipText (smiNameLabel,
  1249:                       "en", "$E80016.w 9-0 Text screen y-direction scroll",
  1250:                       "ja", "$E80016.w 9-0 テキスト画面 y 方向スクロール");
  1251:     }
  1252:     @Override public void smiControlled () {
  1253:       CRTC.crtR11TxYMask = smiMaskValue;
  1254:       CRTC.crtR11TxYTest = smiTestValue;
  1255:       int curr = CRTC.crtR11TxYMask == 0 ? CRTC.crtR11TxYPort : CRTC.crtR11TxYTest;
  1256:       if (CRTC.crtR11TxYCurr != curr) {
  1257:         CRTC.crtR11TxYCurr = curr;
  1258:         CRTC.crtAllStamp += 2;
  1259:         if (XEiJ.mpuTask == null) {  //停止中
  1260:           CRTC.crtRepaint ();
  1261:         }
  1262:       }
  1263:     }
  1264:   }  //class SMTItem_CrtTxY
  1265: 
  1266:   public static class SMTItem_CrtGr0X extends SMTItem {
  1267:     public SMTItem_CrtGr0X () {
  1268:       super ("Gr0X", CRTC.crtR12GrXPort[0], 10);
  1269:       Multilingual.mlnToolTipText (smiNameLabel,
  1270:                       "en", "$E80018.w 9-0 graphic plane 0 x-direction scroll",
  1271:                       "ja", "$E80018.w 9-0 グラフィックプレーン 0 x 方向スクロール");
  1272:     }
  1273:     @Override public void smiControlled () {
  1274:       CRTC.crtR12GrXMask[0] = smiMaskValue;
  1275:       CRTC.crtR12GrXTest[0] = smiTestValue;
  1276:       int curr = CRTC.crtR12GrXMask[0] == 0 ? CRTC.crtR12GrXPort[0] : CRTC.crtR12GrXTest[0];
  1277:       if (CRTC.crtR12GrXCurr[0] != curr) {
  1278:         CRTC.crtR12GrXCurr[0] = curr;
  1279:         CRTC.crtAllStamp += 2;
  1280:         if (XEiJ.mpuTask == null) {  //停止中
  1281:           CRTC.crtRepaint ();
  1282:         }
  1283:       }
  1284:     }
  1285:   }  //class SMTItem_CrtGr0X
  1286: 
  1287:   public static class SMTItem_CrtGr0Y extends SMTItem {
  1288:     public SMTItem_CrtGr0Y () {
  1289:       super ("Gr0Y", CRTC.crtR13GrYPort[0], 10);
  1290:       Multilingual.mlnToolTipText (smiNameLabel,
  1291:                       "en", "$E8001A.w 9-0 graphic plane 0 y-direction scroll",
  1292:                       "ja", "$E8001A.w 9-0 グラフィックプレーン 0 y 方向スクロール");
  1293:     }
  1294:     @Override public void smiControlled () {
  1295:       CRTC.crtR13GrYMask[0] = smiMaskValue;
  1296:       CRTC.crtR13GrYTest[0] = smiTestValue;
  1297:       int curr = CRTC.crtR13GrYMask[0] == 0 ? CRTC.crtR13GrYPort[0] : CRTC.crtR13GrYTest[0];
  1298:       if (CRTC.crtR13GrYCurr[0] != curr) {
  1299:         CRTC.crtR13GrYCurr[0] = curr;
  1300:         CRTC.crtAllStamp += 2;
  1301:         if (XEiJ.mpuTask == null) {  //停止中
  1302:           CRTC.crtRepaint ();
  1303:         }
  1304:       }
  1305:     }
  1306:   }  //class SMTItem_CrtGr0Y
  1307: 
  1308:   public static class SMTItem_CrtGr1X extends SMTItem {
  1309:     public SMTItem_CrtGr1X () {
  1310:       super ("Gr1X", CRTC.crtR12GrXPort[1], 9);
  1311:       Multilingual.mlnToolTipText (smiNameLabel,
  1312:                       "en", "$E8001C.w 8-0 graphic plane 0 x-direction scroll",
  1313:                       "ja", "$E8001C.w 8-0 グラフィックプレーン 0 x 方向スクロール");
  1314:     }
  1315:     @Override public void smiControlled () {
  1316:       CRTC.crtR12GrXMask[1] = smiMaskValue;
  1317:       CRTC.crtR12GrXTest[1] = smiTestValue;
  1318:       int curr = CRTC.crtR12GrXMask[1] == 0 ? CRTC.crtR12GrXPort[1] : CRTC.crtR12GrXTest[1];
  1319:       if (CRTC.crtR12GrXCurr[1] != curr) {
  1320:         CRTC.crtR12GrXCurr[1] = curr;
  1321:         CRTC.crtAllStamp += 2;
  1322:         if (XEiJ.mpuTask == null) {  //停止中
  1323:           CRTC.crtRepaint ();
  1324:         }
  1325:       }
  1326:     }
  1327:   }  //class SMTItem_CrtGr1X
  1328: 
  1329:   public static class SMTItem_CrtGr1Y extends SMTItem {
  1330:     public SMTItem_CrtGr1Y () {
  1331:       super ("Gr1Y", CRTC.crtR13GrYPort[1], 9);
  1332:       Multilingual.mlnToolTipText (smiNameLabel,
  1333:                       "en", "$E8001E.w 8-0 graphic plane 0 y-direction scroll",
  1334:                       "ja", "$E8001E.w 8-0 グラフィックプレーン 0 y 方向スクロール");
  1335:     }
  1336:     @Override public void smiControlled () {
  1337:       CRTC.crtR13GrYMask[1] = smiMaskValue;
  1338:       CRTC.crtR13GrYTest[1] = smiTestValue;
  1339:       int curr = CRTC.crtR13GrYMask[1] == 0 ? CRTC.crtR13GrYPort[1] : CRTC.crtR13GrYTest[1];
  1340:       if (CRTC.crtR13GrYCurr[1] != curr) {
  1341:         CRTC.crtR13GrYCurr[1] = curr;
  1342:         CRTC.crtAllStamp += 2;
  1343:         if (XEiJ.mpuTask == null) {  //停止中
  1344:           CRTC.crtRepaint ();
  1345:         }
  1346:       }
  1347:     }
  1348:   }  //class SMTItem_CrtGr1Y
  1349: 
  1350:   public static class SMTItem_CrtGr2X extends SMTItem {
  1351:     public SMTItem_CrtGr2X () {
  1352:       super ("Gr2X", CRTC.crtR12GrXPort[2], 9);
  1353:       Multilingual.mlnToolTipText (smiNameLabel,
  1354:                       "en", "$E80020.w 8-0 graphic plane 0 x-direction scroll",
  1355:                       "ja", "$E80020.w 8-0 グラフィックプレーン 0 x 方向スクロール");
  1356:     }
  1357:     @Override public void smiControlled () {
  1358:       CRTC.crtR12GrXMask[2] = smiMaskValue;
  1359:       CRTC.crtR12GrXTest[2] = smiTestValue;
  1360:       int curr = CRTC.crtR12GrXMask[2] == 0 ? CRTC.crtR12GrXPort[2] : CRTC.crtR12GrXTest[2];
  1361:       if (CRTC.crtR12GrXCurr[2] != curr) {
  1362:         CRTC.crtR12GrXCurr[2] = curr;
  1363:         CRTC.crtAllStamp += 2;
  1364:         if (XEiJ.mpuTask == null) {  //停止中
  1365:           CRTC.crtRepaint ();
  1366:         }
  1367:       }
  1368:     }
  1369:   }  //class SMTItem_CrtGr2X
  1370: 
  1371:   public static class SMTItem_CrtGr2Y extends SMTItem {
  1372:     public SMTItem_CrtGr2Y () {
  1373:       super ("Gr2Y", CRTC.crtR13GrYPort[2], 9);
  1374:       Multilingual.mlnToolTipText (smiNameLabel,
  1375:                       "en", "$E80022.w 8-0 graphic plane 0 y-direction scroll",
  1376:                       "ja", "$E80022.w 8-0 グラフィックプレーン 0 y 方向スクロール");
  1377:     }
  1378:     @Override public void smiControlled () {
  1379:       CRTC.crtR13GrYMask[2] = smiMaskValue;
  1380:       CRTC.crtR13GrYTest[2] = smiTestValue;
  1381:       int curr = CRTC.crtR13GrYMask[2] == 0 ? CRTC.crtR13GrYPort[2] : CRTC.crtR13GrYTest[2];
  1382:       if (CRTC.crtR13GrYCurr[2] != curr) {
  1383:         CRTC.crtR13GrYCurr[2] = curr;
  1384:         CRTC.crtAllStamp += 2;
  1385:         if (XEiJ.mpuTask == null) {  //停止中
  1386:           CRTC.crtRepaint ();
  1387:         }
  1388:       }
  1389:     }
  1390:   }  //class SMTItem_CrtGr2Y
  1391: 
  1392:   public static class SMTItem_CrtGr3X extends SMTItem {
  1393:     public SMTItem_CrtGr3X () {
  1394:       super ("Gr3X", CRTC.crtR12GrXPort[3], 9);
  1395:       Multilingual.mlnToolTipText (smiNameLabel,
  1396:                       "en", "$E80024.w 8-0 graphic plane 3 x-direction scroll",
  1397:                       "ja", "$E80024.w 8-0 グラフィックプレーン 3 x 方向スクロール");
  1398:     }
  1399:     @Override public void smiControlled () {
  1400:       CRTC.crtR12GrXMask[3] = smiMaskValue;
  1401:       CRTC.crtR12GrXTest[3] = smiTestValue;
  1402:       int curr = CRTC.crtR12GrXMask[3] == 0 ? CRTC.crtR12GrXPort[3] : CRTC.crtR12GrXTest[3];
  1403:       if (CRTC.crtR12GrXCurr[3] != curr) {
  1404:         CRTC.crtR12GrXCurr[3] = curr;
  1405:         CRTC.crtAllStamp += 2;
  1406:         if (XEiJ.mpuTask == null) {  //停止中
  1407:           CRTC.crtRepaint ();
  1408:         }
  1409:       }
  1410:     }
  1411:   }  //class SMTItem_CrtGr3X
  1412: 
  1413:   public static class SMTItem_CrtGr3Y extends SMTItem {
  1414:     public SMTItem_CrtGr3Y () {
  1415:       super ("Gr3Y", CRTC.crtR13GrYPort[3], 9);
  1416:       Multilingual.mlnToolTipText (smiNameLabel,
  1417:                       "en", "$E80026.w 8-0 graphic plane 3 y-direction scroll",
  1418:                       "ja", "$E80026.w 8-0 グラフィックプレーン 3 y 方向スクロール");
  1419:     }
  1420:     @Override public void smiControlled () {
  1421:       CRTC.crtR13GrYMask[3] = smiMaskValue;
  1422:       CRTC.crtR13GrYTest[3] = smiTestValue;
  1423:       int curr = CRTC.crtR13GrYMask[3] == 0 ? CRTC.crtR13GrYPort[3] : CRTC.crtR13GrYTest[3];
  1424:       if (CRTC.crtR13GrYCurr[3] != curr) {
  1425:         CRTC.crtR13GrYCurr[3] = curr;
  1426:         CRTC.crtAllStamp += 2;
  1427:         if (XEiJ.mpuTask == null) {  //停止中
  1428:           CRTC.crtRepaint ();
  1429:         }
  1430:       }
  1431:     }
  1432:   }  //class SMTItem_CrtGr3Y
  1433: 
  1434: 
  1435:   //----------------------------------------------------------------------------------------
  1436:   //ビデオコントローラ
  1437: 
  1438:   public static class SMTItem_VcnGrMM extends SMTItem {
  1439:     public SMTItem_VcnGrMM () {
  1440:       super ("GrMM", VideoController.vcnReg1Port, 3);
  1441:       Multilingual.mlnToolTipText (smiNameLabel,
  1442:                       "en", "$E82400.w 2-0 Memory mode of graphic screen",
  1443:                       "ja", "$E82400.w 2-0 グラフィック画面のメモリモード");
  1444:     }
  1445:     @Override public void smiControlled () {
  1446:       VideoController.vcnReg1Mask = VideoController.vcnReg1Mask & ~7 | smiMaskValue & 7;
  1447:       VideoController.vcnReg1Test = VideoController.vcnReg1Test & ~7 | smiTestValue;
  1448:       int curr = VideoController.vcnReg1Port & ~VideoController.vcnReg1Mask | VideoController.vcnReg1Test & VideoController.vcnReg1Mask;
  1449:       if (VideoController.vcnReg1Curr != curr) {
  1450:         VideoController.vcnReg1Curr = curr;
  1451:         VideoController.vcnUpdateMode ();
  1452:         if (XEiJ.mpuTask == null) {  //停止中
  1453:           CRTC.crtRepaint ();
  1454:         }
  1455:       }
  1456:     }
  1457:   }  //class SMTItem_VcnGrMM
  1458: 
  1459:   public static class SMTItem_VcnSpPr extends SMTItem {
  1460:     public SMTItem_VcnSpPr () {
  1461:       super ("SpPr", VideoController.vcnReg2Port >> 12, 2);
  1462:       Multilingual.mlnToolTipText (smiNameLabel,
  1463:                       "en", "$E82500.w 13-12 Precedence of sprite screen",
  1464:                       "ja", "$E82500.w 13-12 スプライト画面の優先順位");
  1465:     }
  1466:     @Override public void smiControlled () {
  1467:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 12) | smiMaskValue & 3 << 12;
  1468:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 12) | smiTestValue     << 12;
  1469:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1470:       if (VideoController.vcnReg2Curr != curr) {
  1471:         VideoController.vcnReg2Curr = curr;
  1472:         VideoController.vcnUpdateMode ();
  1473:         if (XEiJ.mpuTask == null) {  //停止中
  1474:           CRTC.crtRepaint ();
  1475:         }
  1476:       }
  1477:     }
  1478:   }  //class SMTItem_VcnSpPr
  1479: 
  1480:   public static class SMTItem_VcnTxPr extends SMTItem {
  1481:     public SMTItem_VcnTxPr () {
  1482:       super ("TxPr", VideoController.vcnReg2Port >> 10, 2);
  1483:       Multilingual.mlnToolTipText (smiNameLabel,
  1484:                       "en", "$E82500.w 11-10 Precedence of text screen",
  1485:                       "ja", "$E82500.w 11-10 テキスト画面の優先順位");
  1486:     }
  1487:     @Override public void smiControlled () {
  1488:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 10) | smiMaskValue & 3 << 10;
  1489:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 10) | smiTestValue     << 10;
  1490:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1491:       if (VideoController.vcnReg2Curr != curr) {
  1492:         VideoController.vcnReg2Curr = curr;
  1493:         VideoController.vcnUpdateMode ();
  1494:         if (XEiJ.mpuTask == null) {  //停止中
  1495:           CRTC.crtRepaint ();
  1496:         }
  1497:       }
  1498:     }
  1499:   }  //class SMTItem_VcnTxPr
  1500: 
  1501:   public static class SMTItem_VcnGrPr extends SMTItem {
  1502:     public SMTItem_VcnGrPr () {
  1503:       super ("GrPr", VideoController.vcnReg2Port >> 8, 2);
  1504:       Multilingual.mlnToolTipText (smiNameLabel,
  1505:                       "en", "$E82500.w 9-8 Precedence of graphic screen",
  1506:                       "ja", "$E82500.w 9-8 グラフィック画面の優先順位");
  1507:     }
  1508:     @Override public void smiControlled () {
  1509:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 8) | smiMaskValue & 3 << 8;
  1510:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 8) | smiTestValue     << 8;
  1511:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1512:       if (VideoController.vcnReg2Curr != curr) {
  1513:         VideoController.vcnReg2Curr = curr;
  1514:         VideoController.vcnUpdateMode ();
  1515:         if (XEiJ.mpuTask == null) {  //停止中
  1516:           CRTC.crtRepaint ();
  1517:         }
  1518:       }
  1519:     }
  1520:   }  //class SMTItem_VcnGrPr
  1521: 
  1522:   public static class SMTItem_VcnG4th extends SMTItem {
  1523:     public SMTItem_VcnG4th () {
  1524:       super ("G4th", VideoController.vcnReg2Port >> 6, 2);
  1525:       Multilingual.mlnToolTipText (smiNameLabel,
  1526:                       "en", "$E82500.w 7-6 The farthest plane number of graphic screen",
  1527:                       "ja", "$E82500.w 7-6 グラフィック画面の一番奥のプレーンの番号");
  1528:     }
  1529:     @Override public void smiControlled () {
  1530:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 6) | smiMaskValue & 3 << 6;
  1531:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 6) | smiTestValue     << 6;
  1532:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1533:       if (VideoController.vcnReg2Curr != curr) {
  1534:         VideoController.vcnReg2Curr = curr;
  1535:         VideoController.vcnUpdateMode ();
  1536:         if (XEiJ.mpuTask == null) {  //停止中
  1537:           CRTC.crtRepaint ();
  1538:         }
  1539:       }
  1540:     }
  1541:   }  //class SMTItem_VcnG4th
  1542: 
  1543:   public static class SMTItem_VcnG3rd extends SMTItem {
  1544:     public SMTItem_VcnG3rd () {
  1545:       super ("G3rd", VideoController.vcnReg2Port >> 4, 2);
  1546:       Multilingual.mlnToolTipText (smiNameLabel,
  1547:                       "en", "$E82500.w 5-4 Second-farthest plane number of graphic screen",
  1548:                       "ja", "$E82500.w 5-4 グラフィック画面の奥から 2 番目のプレーンの番号");
  1549:     }
  1550:     @Override public void smiControlled () {
  1551:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 4) | smiMaskValue & 3 << 4;
  1552:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 4) | smiTestValue     << 4;
  1553:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1554:       if (VideoController.vcnReg2Curr != curr) {
  1555:         VideoController.vcnReg2Curr = curr;
  1556:         VideoController.vcnUpdateMode ();
  1557:         if (XEiJ.mpuTask == null) {  //停止中
  1558:           CRTC.crtRepaint ();
  1559:         }
  1560:       }
  1561:     }
  1562:   }  //class SMTItem_VcnG3rd
  1563: 
  1564:   public static class SMTItem_VcnG2nd extends SMTItem {
  1565:     public SMTItem_VcnG2nd () {
  1566:       super ("G2nd", VideoController.vcnReg2Port >> 2, 2);
  1567:       Multilingual.mlnToolTipText (smiNameLabel,
  1568:                       "en", "$E82500.w 3-2 Second-nearest plane number of graphic screen",
  1569:                       "ja", "$E82500.w 3-2 グラフィック画面の手前から 2 番目のプレーンの番号");
  1570:     }
  1571:     @Override public void smiControlled () {
  1572:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 2) | smiMaskValue & 3 << 2;
  1573:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 2) | smiTestValue     << 2;
  1574:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1575:       if (VideoController.vcnReg2Curr != curr) {
  1576:         VideoController.vcnReg2Curr = curr;
  1577:         VideoController.vcnUpdateMode ();
  1578:         if (XEiJ.mpuTask == null) {  //停止中
  1579:           CRTC.crtRepaint ();
  1580:         }
  1581:       }
  1582:     }
  1583:   }  //class SMTItem_VcnG2nd
  1584: 
  1585:   public static class SMTItem_VcnG1st extends SMTItem {
  1586:     public SMTItem_VcnG1st () {
  1587:       super ("G1st", VideoController.vcnReg2Port, 2);
  1588:       Multilingual.mlnToolTipText (smiNameLabel,
  1589:                       "en", "$E82500.w 1-0 The nearest plane number of graphic screen",
  1590:                       "ja", "$E82500.w 1-0 グラフィック画面の一番手前のプレーンの番号");
  1591:     }
  1592:     @Override public void smiControlled () {
  1593:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~3 | smiMaskValue & 3;
  1594:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~3 | smiTestValue;
  1595:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1596:       if (VideoController.vcnReg2Curr != curr) {
  1597:         VideoController.vcnReg2Curr = curr;
  1598:         VideoController.vcnUpdateMode ();
  1599:         if (XEiJ.mpuTask == null) {  //停止中
  1600:           CRTC.crtRepaint ();
  1601:         }
  1602:       }
  1603:     }
  1604:   }  //class SMTItem_VcnG1st
  1605: 
  1606:   public static class SMTItem_VcnAHOn extends SMTItem {
  1607:     public SMTItem_VcnAHOn () {
  1608:       super ("AHOn", VideoController.vcnReg3Port >> 14, 1);
  1609:       Multilingual.mlnToolTipText (smiNameLabel,
  1610:                       "en", "$E82600.w 14 Halftone with text palet 0",
  1611:                       "ja", "$E82600.w 14 テキストパレット 0 との半透明");
  1612:     }
  1613:     @Override public void smiControlled () {
  1614:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 14) | smiMaskValue & 1 << 14;
  1615:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 14) | smiTestValue     << 14;
  1616:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1617:       if (VideoController.vcnReg3Curr != curr) {
  1618:         VideoController.vcnReg3Curr = curr;
  1619:         VideoController.vcnUpdateMode ();
  1620:         if (XEiJ.mpuTask == null) {  //停止中
  1621:           CRTC.crtRepaint ();
  1622:         }
  1623:       }
  1624:     }
  1625:   }  //class SMTItem_VcnAHOn
  1626: 
  1627:   public static class SMTItem_VcnExOn extends SMTItem {
  1628:     public SMTItem_VcnExOn () {
  1629:       super ("ExOn", VideoController.vcnReg3Port >> 12, 1);
  1630:       Multilingual.mlnToolTipText (smiNameLabel,
  1631:                       "en", "$E82600.w 12 Extended (special priority or halftone)",
  1632:                       "ja", "$E82600.w 12 拡張 (特殊プライオリティまたは半透明)");
  1633:     }
  1634:     @Override public void smiControlled () {
  1635:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 12) | smiMaskValue & 1 << 12;
  1636:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 12) | smiTestValue     << 12;
  1637:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1638:       if (VideoController.vcnReg3Curr != curr) {
  1639:         VideoController.vcnReg3Curr = curr;
  1640:         VideoController.vcnUpdateMode ();
  1641:         if (XEiJ.mpuTask == null) {  //停止中
  1642:           CRTC.crtRepaint ();
  1643:         }
  1644:       }
  1645:     }
  1646:   }  //class SMTItem_VcnExOn
  1647: 
  1648:   public static class SMTItem_VcnHalf extends SMTItem {
  1649:     public SMTItem_VcnHalf () {
  1650:       super ("Half", VideoController.vcnReg3Port >> 11, 1);
  1651:       Multilingual.mlnToolTipText (smiNameLabel,
  1652:                       "en", "$E82600.w 11 Halftone",
  1653:                       "ja", "$E82600.w 11 半透明");
  1654:     }
  1655:     @Override public void smiControlled () {
  1656:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 11) | smiMaskValue & 1 << 11;
  1657:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 11) | smiTestValue     << 11;
  1658:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1659:       if (VideoController.vcnReg3Curr != curr) {
  1660:         VideoController.vcnReg3Curr = curr;
  1661:         VideoController.vcnUpdateMode ();
  1662:         if (XEiJ.mpuTask == null) {  //停止中
  1663:           CRTC.crtRepaint ();
  1664:         }
  1665:       }
  1666:     }
  1667:   }  //class SMTItem_VcnHalf
  1668: 
  1669:   public static class SMTItem_VcnPLSB extends SMTItem {
  1670:     public SMTItem_VcnPLSB () {
  1671:       super ("PLSB", VideoController.vcnReg3Port >> 10, 1);
  1672:       Multilingual.mlnToolTipText (smiNameLabel,
  1673:                       "en", "$E82600.w 10 Select area by LSB of palet code",
  1674:                       "ja", "$E82600.w 10 パレットコードの LSB で範囲を選択");
  1675:     }
  1676:     @Override public void smiControlled () {
  1677:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 10) | smiMaskValue & 1 << 10;
  1678:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 10) | smiTestValue     << 10;
  1679:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1680:       if (VideoController.vcnReg3Curr != curr) {
  1681:         VideoController.vcnReg3Curr = curr;
  1682:         VideoController.vcnUpdateMode ();
  1683:         if (XEiJ.mpuTask == null) {  //停止中
  1684:           CRTC.crtRepaint ();
  1685:         }
  1686:       }
  1687:     }
  1688:   }  //class SMTItem_VcnPLSB
  1689: 
  1690:   public static class SMTItem_VcnGrGr extends SMTItem {
  1691:     public SMTItem_VcnGrGr () {
  1692:       super ("GrGr", VideoController.vcnReg3Port >> 9, 1);
  1693:       Multilingual.mlnToolTipText (smiNameLabel,
  1694:                       "en", "$E82600.w 9 Halftone between the nearest graphic page and second-nearest graphic page",
  1695:                       "ja", "$E82600.w 9 一番手前のグラフィックページと手前から 2 番目のグラフィックページとの半透明");
  1696:     }
  1697:     @Override public void smiControlled () {
  1698:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 9) | smiMaskValue & 1 << 9;
  1699:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 9) | smiTestValue     << 9;
  1700:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1701:       if (VideoController.vcnReg3Curr != curr) {
  1702:         VideoController.vcnReg3Curr = curr;
  1703:         VideoController.vcnUpdateMode ();
  1704:         if (XEiJ.mpuTask == null) {  //停止中
  1705:           CRTC.crtRepaint ();
  1706:         }
  1707:       }
  1708:     }
  1709:   }  //class SMTItem_VcnGrGr
  1710: 
  1711:   public static class SMTItem_VcnGrST extends SMTItem {
  1712:     public SMTItem_VcnGrST () {
  1713:       super ("GrST", VideoController.vcnReg3Port >> 8, 1);
  1714:       Multilingual.mlnToolTipText (smiNameLabel,
  1715:                       "en", "$E82600.w 8 Halftone between the nearest graphic page and sprite/text screen in the back of graphic screen",
  1716:                       "ja", "$E82600.w 8 一番手前のグラフィックページとグラフィック画面の奥にあるスプライト/テキスト画面との半透明");
  1717:     }
  1718:     @Override public void smiControlled () {
  1719:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 8) | smiMaskValue & 1 << 8;
  1720:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 8) | smiTestValue     << 8;
  1721:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1722:       if (VideoController.vcnReg3Curr != curr) {
  1723:         VideoController.vcnReg3Curr = curr;
  1724:         VideoController.vcnUpdateMode ();
  1725:         if (XEiJ.mpuTask == null) {  //停止中
  1726:           CRTC.crtRepaint ();
  1727:         }
  1728:       }
  1729:     }
  1730:   }  //class SMTItem_VcnGrST
  1731: 
  1732:   public static class SMTItem_VcnSpOn extends SMTItem {
  1733:     public SMTItem_VcnSpOn () {
  1734:       super ("SpOn", VideoController.vcnReg3Port >> 6, 1);
  1735:       Multilingual.mlnToolTipText (smiNameLabel,
  1736:                       "en", "$E82600.w 6 Sprite screen",
  1737:                       "ja", "$E82600.w 6 スプライト画面");
  1738:     }
  1739:     @Override public void smiControlled () {
  1740:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 6) | smiMaskValue & 1 << 6;
  1741:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 6) | smiTestValue     << 6;
  1742:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1743:       if (VideoController.vcnReg3Curr != curr) {
  1744:         VideoController.vcnReg3Curr = curr;
  1745:         VideoController.vcnUpdateMode ();
  1746:         if (XEiJ.mpuTask == null) {  //停止中
  1747:           CRTC.crtRepaint ();
  1748:         }
  1749:       }
  1750:     }
  1751:   }  //class SMTItem_VcnSpOn
  1752: 
  1753:   public static class SMTItem_VcnTxOn extends SMTItem {
  1754:     public SMTItem_VcnTxOn () {
  1755:       super ("TxOn", VideoController.vcnReg3Port >> 5, 1);
  1756:       Multilingual.mlnToolTipText (smiNameLabel,
  1757:                       "en", "$E82600.w 5 Text screen",
  1758:                       "ja", "$E82600.w 5 テキスト画面");
  1759:     }
  1760:     @Override public void smiControlled () {
  1761:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 5) | smiMaskValue & 1 << 5;
  1762:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 5) | smiTestValue     << 5;
  1763:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1764:       if (VideoController.vcnReg3Curr != curr) {
  1765:         VideoController.vcnReg3Curr = curr;
  1766:         VideoController.vcnUpdateMode ();
  1767:         if (XEiJ.mpuTask == null) {  //停止中
  1768:           CRTC.crtRepaint ();
  1769:         }
  1770:       }
  1771:     }
  1772:   }  //class SMTItem_VcnTxOn
  1773: 
  1774:   public static class SMTItem_VcnGxOn extends SMTItem {
  1775:     public SMTItem_VcnGxOn () {
  1776:       super ("GxOn", VideoController.vcnReg3Port >> 4, 1);
  1777:       Multilingual.mlnToolTipText (smiNameLabel,
  1778:                       "en", "$E82600.w 4 1024x1024 graphic screen",
  1779:                       "ja", "$E82600.w 4 1024x1024 グラフィック画面");
  1780:     }
  1781:     @Override public void smiControlled () {
  1782:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 4) | smiMaskValue & 1 << 4;
  1783:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 4) | smiTestValue     << 4;
  1784:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1785:       if (VideoController.vcnReg3Curr != curr) {
  1786:         VideoController.vcnReg3Curr = curr;
  1787:         VideoController.vcnUpdateMode ();
  1788:         if (XEiJ.mpuTask == null) {  //停止中
  1789:           CRTC.crtRepaint ();
  1790:         }
  1791:       }
  1792:     }
  1793:   }  //class SMTItem_VcnGxOn
  1794: 
  1795:   public static class SMTItem_VcnG4On extends SMTItem {
  1796:     public SMTItem_VcnG4On () {
  1797:       super ("G4On", VideoController.vcnReg3Port >> 3, 1);
  1798:       Multilingual.mlnToolTipText (smiNameLabel,
  1799:                       "en", "$E82600.w 3 512x512 graphic plane 3",
  1800:                       "ja", "$E82600.w 3 512x512 グラフィックプレーン 3");
  1801:     }
  1802:     @Override public void smiControlled () {
  1803:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 3) | smiMaskValue & 1 << 3;
  1804:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 3) | smiTestValue     << 3;
  1805:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1806:       if (VideoController.vcnReg3Curr != curr) {
  1807:         VideoController.vcnReg3Curr = curr;
  1808:         VideoController.vcnUpdateMode ();
  1809:         if (XEiJ.mpuTask == null) {  //停止中
  1810:           CRTC.crtRepaint ();
  1811:         }
  1812:       }
  1813:     }
  1814:   }  //class SMTItem_VcnG4On
  1815: 
  1816:   public static class SMTItem_VcnG3On extends SMTItem {
  1817:     public SMTItem_VcnG3On () {
  1818:       super ("G3On", VideoController.vcnReg3Port >> 2, 1);
  1819:       Multilingual.mlnToolTipText (smiNameLabel,
  1820:                       "en", "$E82600.w 2 512x512 graphic plane 2",
  1821:                       "ja", "$E82600.w 2 512x512 グラフィックプレーン 2");
  1822:     }
  1823:     @Override public void smiControlled () {
  1824:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 2) | smiMaskValue & 1 << 2;
  1825:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 2) | smiTestValue     << 2;
  1826:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1827:       if (VideoController.vcnReg3Curr != curr) {
  1828:         VideoController.vcnReg3Curr = curr;
  1829:         VideoController.vcnUpdateMode ();
  1830:         if (XEiJ.mpuTask == null) {  //停止中
  1831:           CRTC.crtRepaint ();
  1832:         }
  1833:       }
  1834:     }
  1835:   }  //class SMTItem_VcnG3On
  1836: 
  1837:   public static class SMTItem_VcnG2On extends SMTItem {
  1838:     public SMTItem_VcnG2On () {
  1839:       super ("G2On", VideoController.vcnReg3Port >> 1, 1);
  1840:       Multilingual.mlnToolTipText (smiNameLabel,
  1841:                       "en", "$E82600.w 1 512x512 graphic plane 1",
  1842:                       "ja", "$E82600.w 1 512x512 グラフィックプレーン 1");
  1843:     }
  1844:     @Override public void smiControlled () {
  1845:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 1) | smiMaskValue & 1 << 1;
  1846:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 1) | smiTestValue     << 1;
  1847:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1848:       if (VideoController.vcnReg3Curr != curr) {
  1849:         VideoController.vcnReg3Curr = curr;
  1850:         VideoController.vcnUpdateMode ();
  1851:         if (XEiJ.mpuTask == null) {  //停止中
  1852:           CRTC.crtRepaint ();
  1853:         }
  1854:       }
  1855:     }
  1856:   }  //class SMTItem_VcnG2On
  1857: 
  1858:   public static class SMTItem_VcnG1On extends SMTItem {
  1859:     public SMTItem_VcnG1On () {
  1860:       super ("G1On", VideoController.vcnReg3Port, 1);
  1861:       Multilingual.mlnToolTipText (smiNameLabel,
  1862:                       "en", "$E82600.w 0 512x512 graphic plane 0",
  1863:                       "ja", "$E82600.w 0 512x512 グラフィックプレーン 0");
  1864:     }
  1865:     @Override public void smiControlled () {
  1866:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~1 | smiMaskValue & 1;
  1867:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~1 | smiTestValue;
  1868:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1869:       if (VideoController.vcnReg3Curr != curr) {
  1870:         VideoController.vcnReg3Curr = curr;
  1871:         VideoController.vcnUpdateMode ();
  1872:         if (XEiJ.mpuTask == null) {  //停止中
  1873:           CRTC.crtRepaint ();
  1874:         }
  1875:       }
  1876:     }
  1877:   }  //class SMTItem_VcnG1On
  1878: 
  1879: 
  1880:   //----------------------------------------------------------------------------------------
  1881:   //スプライトコントローラ
  1882: 
  1883:   public static class SMTItem_SprBg0X extends SMTItem {
  1884:     public SMTItem_SprBg0X () {
  1885:       super ("Bg0X", SpriteScreen.sprReg0Bg0XPort, 10);
  1886:       Multilingual.mlnToolTipText (smiNameLabel,
  1887:                       "en", "$EB0800.w 9-0 Background 0 x-direction scroll",
  1888:                       "ja", "$EB0800.w 9-0 バックグラウンド 0 x 方向スクロール");
  1889:     }
  1890:     @Override public void smiControlled () {
  1891:       SpriteScreen.sprReg0Bg0XMask = smiMaskValue;
  1892:       SpriteScreen.sprReg0Bg0XTest = smiTestValue;
  1893:       int curr = SpriteScreen.sprReg0Bg0XMask == 0 ? SpriteScreen.sprReg0Bg0XPort : SpriteScreen.sprReg0Bg0XTest;
  1894:       if (SpriteScreen.sprReg0Bg0XCurr != curr) {
  1895:         SpriteScreen.sprReg0Bg0XCurr = curr;
  1896:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1897:           CRTC.crtAllStamp += 2;
  1898:           if (XEiJ.mpuTask == null) {  //停止中
  1899:             CRTC.crtRepaint ();
  1900:           }
  1901:         }
  1902:       }
  1903:     }
  1904:   }  //class SMTItem_SprBg0X
  1905: 
  1906:   public static class SMTItem_SprBg0Y extends SMTItem {
  1907:     public SMTItem_SprBg0Y () {
  1908:       super ("Bg0Y", SpriteScreen.sprReg1Bg0YPort, 10);
  1909:       Multilingual.mlnToolTipText (smiNameLabel,
  1910:                       "en", "$EB0802.w 9-0 Background 0 y-direction scroll",
  1911:                       "ja", "$EB0802.w 9-0 バックグラウンド 0 y 方向スクロール");
  1912:     }
  1913:     @Override public void smiControlled () {
  1914:       SpriteScreen.sprReg1Bg0YMask = smiMaskValue;
  1915:       SpriteScreen.sprReg1Bg0YTest = smiTestValue;
  1916:       int curr = SpriteScreen.sprReg1Bg0YMask == 0 ? SpriteScreen.sprReg1Bg0YPort : SpriteScreen.sprReg1Bg0YTest;
  1917:       if (SpriteScreen.sprReg1Bg0YCurr != curr) {
  1918:         SpriteScreen.sprReg1Bg0YCurr = curr;
  1919:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1920:           CRTC.crtAllStamp += 2;
  1921:           if (XEiJ.mpuTask == null) {  //停止中
  1922:             CRTC.crtRepaint ();
  1923:           }
  1924:         }
  1925:       }
  1926:     }
  1927:   }  //class SMTItem_SprBg0Y
  1928: 
  1929:   public static class SMTItem_SprBg1X extends SMTItem {
  1930:     public SMTItem_SprBg1X () {
  1931:       super ("Bg1X", SpriteScreen.sprReg2Bg1XPort, 10);
  1932:       Multilingual.mlnToolTipText (smiNameLabel,
  1933:                       "en", "$EB0804.w 9-0 Background 1 x-direction scroll",
  1934:                       "ja", "$EB0804.w 9-0 バックグラウンド 1 x 方向スクロール");
  1935:     }
  1936:     @Override public void smiControlled () {
  1937:       SpriteScreen.sprReg2Bg1XMask = smiMaskValue;
  1938:       SpriteScreen.sprReg2Bg1XTest = smiTestValue;
  1939:       int curr = SpriteScreen.sprReg2Bg1XMask == 0 ? SpriteScreen.sprReg2Bg1XPort : SpriteScreen.sprReg2Bg1XTest;
  1940:       if (SpriteScreen.sprReg2Bg1XCurr != curr) {
  1941:         SpriteScreen.sprReg2Bg1XCurr = curr;
  1942:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1943:           CRTC.crtAllStamp += 2;
  1944:           if (XEiJ.mpuTask == null) {  //停止中
  1945:             CRTC.crtRepaint ();
  1946:           }
  1947:         }
  1948:       }
  1949:     }
  1950:   }  //class SMTItem_SprBg1X
  1951: 
  1952:   public static class SMTItem_SprBg1Y extends SMTItem {
  1953:     public SMTItem_SprBg1Y () {
  1954:       super ("Bg1Y", SpriteScreen.sprReg3Bg1YPort, 10);
  1955:       Multilingual.mlnToolTipText (smiNameLabel,
  1956:                       "en", "$EB0806.w 9-0 Background 1 y-direction scroll",
  1957:                       "ja", "$EB0806.w 9-0 バックグラウンド 1 y 方向スクロール");
  1958:     }
  1959:     @Override public void smiControlled () {
  1960:       SpriteScreen.sprReg3Bg1YMask = smiMaskValue;
  1961:       SpriteScreen.sprReg3Bg1YTest = smiTestValue;
  1962:       int curr = SpriteScreen.sprReg3Bg1YMask == 0 ? SpriteScreen.sprReg3Bg1YPort : SpriteScreen.sprReg3Bg1YTest;
  1963:       if (SpriteScreen.sprReg3Bg1YCurr != curr) {
  1964:         SpriteScreen.sprReg3Bg1YCurr = curr;
  1965:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1966:           CRTC.crtAllStamp += 2;
  1967:           if (XEiJ.mpuTask == null) {  //停止中
  1968:             CRTC.crtRepaint ();
  1969:           }
  1970:         }
  1971:       }
  1972:     }
  1973:   }  //class SMTItem_SprBg1Y
  1974: 
  1975:   public static class SMTItem_SprDisp extends SMTItem {
  1976:     public SMTItem_SprDisp () {
  1977:       super ("Disp", SpriteScreen.sprReg4BgCtrlPort >> 9, 1);
  1978:       Multilingual.mlnToolTipText (smiNameLabel,
  1979:                       "en", "$EB0808.w 9 Display sprite and background",
  1980:                       "ja", "$EB0808.w 9 スプライトとバックグラウンドを表示");
  1981:     }
  1982:     @Override public void smiControlled () {
  1983:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(1 << 9) | smiMaskValue & 1 << 9;
  1984:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(1 << 9) | smiTestValue     << 9;
  1985:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  1986:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  1987:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  1988:         if (VideoController.vcnReg3Curr << 31 - 6 < 0) {  //スプライト画面が表示されている。DispがON→OFFのときは再描画が必要
  1989:           CRTC.crtAllStamp += 2;
  1990:           if (XEiJ.mpuTask == null) {  //停止中
  1991:             CRTC.crtRepaint ();
  1992:           }
  1993:         }
  1994:       }
  1995:     }
  1996:   }  //class SMTItem_SprDisp
  1997: 
  1998:   public static class SMTItem_SprB1Tx extends SMTItem {
  1999:     public SMTItem_SprB1Tx () {
  2000:       super ("B1Tx", SpriteScreen.sprReg4BgCtrlPort >> 4, 2);
  2001:       Multilingual.mlnToolTipText (smiNameLabel,
  2002:                       "en", "$EB0808.w 5-4 Text page assigned to background 1",
  2003:                       "ja", "$EB0808.w 5-4 バックグラウンド 1 に割り当てるテキストページ");
  2004:     }
  2005:     @Override public void smiControlled () {
  2006:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(3 << 4) | smiMaskValue & 3 << 4;
  2007:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(3 << 4) | smiTestValue     << 4;
  2008:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2009:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2010:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2011:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2012:           CRTC.crtAllStamp += 2;
  2013:           if (XEiJ.mpuTask == null) {  //停止中
  2014:             CRTC.crtRepaint ();
  2015:           }
  2016:         }
  2017:       }
  2018:     }
  2019:   }  //class SMTItem_SprB1Tx
  2020: 
  2021:   public static class SMTItem_SprB1On extends SMTItem {
  2022:     public SMTItem_SprB1On () {
  2023:       super ("B1On", SpriteScreen.sprReg4BgCtrlPort >> 3, 1);
  2024:       Multilingual.mlnToolTipText (smiNameLabel,
  2025:                       "en", "$EB0808.w 3 Background 1",
  2026:                       "ja", "$EB0808.w 3 バックグラウンド 1");
  2027:     }
  2028:     @Override public void smiControlled () {
  2029:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(1 << 3) | smiMaskValue & 1 << 3;
  2030:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(1 << 3) | smiTestValue     << 3;
  2031:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2032:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2033:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2034:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2035:           CRTC.crtAllStamp += 2;
  2036:           if (XEiJ.mpuTask == null) {  //停止中
  2037:             CRTC.crtRepaint ();
  2038:           }
  2039:         }
  2040:       }
  2041:     }
  2042:   }  //class SMTItem_SprB1On
  2043: 
  2044:   public static class SMTItem_SprB0Tx extends SMTItem {
  2045:     public SMTItem_SprB0Tx () {
  2046:       super ("B0Tx", SpriteScreen.sprReg4BgCtrlPort >> 1, 2);
  2047:       Multilingual.mlnToolTipText (smiNameLabel,
  2048:                       "en", "$EB0808.w 2-1 Text page assigned to background 0",
  2049:                       "ja", "$EB0808.w 2-1 バックグラウンド 0 に割り当てるテキストページ");
  2050:     }
  2051:     @Override public void smiControlled () {
  2052:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(3 << 1) | smiMaskValue & 3 << 1;
  2053:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(3 << 1) | smiTestValue     << 1;
  2054:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2055:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2056:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2057:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2058:           CRTC.crtAllStamp += 2;
  2059:           if (XEiJ.mpuTask == null) {  //停止中
  2060:             CRTC.crtRepaint ();
  2061:           }
  2062:         }
  2063:       }
  2064:     }
  2065:   }  //class SMTItem_SprB0Tx
  2066: 
  2067:   public static class SMTItem_SprB0On extends SMTItem {
  2068:     public SMTItem_SprB0On () {
  2069:       super ("B0On", SpriteScreen.sprReg4BgCtrlPort, 1);
  2070:       Multilingual.mlnToolTipText (smiNameLabel,
  2071:                       "en", "$EB0808.w 0 Background 0",
  2072:                       "ja", "$EB0808.w 0 バックグラウンド 0");
  2073:     }
  2074:     @Override public void smiControlled () {
  2075:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~1 | smiMaskValue & 1;
  2076:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~1 | smiTestValue;
  2077:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2078:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2079:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2080:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2081:           CRTC.crtAllStamp += 2;
  2082:           if (XEiJ.mpuTask == null) {  //停止中
  2083:             CRTC.crtRepaint ();
  2084:           }
  2085:         }
  2086:       }
  2087:     }
  2088:   }  //class SMTItem_SprB0On
  2089: 
  2090:   public static class SMTItem_SprHFEd extends SMTItem {
  2091:     public SMTItem_SprHFEd () {
  2092:       super ("HFEd", SpriteScreen.sprReg5HFrontEndPort, 8);
  2093:       Multilingual.mlnToolTipText (smiNameLabel,
  2094:                       "en", "$EB080A.w 7-0 End character number of horizontal front porch",
  2095:                       "ja", "$EB080A.w 7-0 水平フロントポーチの終了キャラクタ番号");
  2096:     }
  2097:     @Override public void smiControlled () {
  2098:       SpriteScreen.sprReg5HFrontEndMask = smiMaskValue;
  2099:       SpriteScreen.sprReg5HFrontEndTest = smiTestValue;
  2100:       int curr = SpriteScreen.sprReg5HFrontEndMask == 0 ? SpriteScreen.sprReg5HFrontEndPort : SpriteScreen.sprReg5HFrontEndTest;
  2101:       if (SpriteScreen.sprReg5HFrontEndCurr != curr) {
  2102:         SpriteScreen.sprReg5HFrontEndCurr = curr;
  2103:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2104:           CRTC.crtAllStamp += 2;
  2105:           if (XEiJ.mpuTask == null) {  //停止中
  2106:             CRTC.crtRepaint ();
  2107:           }
  2108:         }
  2109:       }
  2110:     }
  2111:   }  //class SMTItem_SprHFEd
  2112: 
  2113:   public static class SMTItem_SprHBEd extends SMTItem {
  2114:     public SMTItem_SprHBEd () {
  2115:       super ("HBEd", SpriteScreen.sprReg6HBackEndPort, 6);
  2116:       Multilingual.mlnToolTipText (smiNameLabel,
  2117:                       "en", "$EB080C.w 5-0 End character number of horizontal back porch",
  2118:                       "ja", "$EB080C.w 5-0 水平バックポーチの終了キャラクタ番号");
  2119:     }
  2120:     @Override public void smiControlled () {
  2121:       SpriteScreen.sprReg6HBackEndMask = smiMaskValue;
  2122:       SpriteScreen.sprReg6HBackEndTest = smiTestValue;
  2123:       int curr = SpriteScreen.sprReg6HBackEndMask == 0 ? SpriteScreen.sprReg6HBackEndPort : SpriteScreen.sprReg6HBackEndTest;
  2124:       if (SpriteScreen.sprReg6HBackEndCurr != curr) {
  2125:         SpriteScreen.sprReg6HBackEndCurr = curr;
  2126:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2127:           CRTC.crtAllStamp += 2;
  2128:           if (XEiJ.mpuTask == null) {  //停止中
  2129:             CRTC.crtRepaint ();
  2130:           }
  2131:         }
  2132:       }
  2133:     }
  2134:   }  //class SMTItem_SprHBEd
  2135: 
  2136:   public static class SMTItem_SprVBEd extends SMTItem {
  2137:     public SMTItem_SprVBEd () {
  2138:       super ("VBEd", SpriteScreen.sprReg7VBackEndPort, 8);
  2139:       Multilingual.mlnToolTipText (smiNameLabel,
  2140:                       "en", "$EB080E.w 7-0 End raster number of vertical back porch",
  2141:                       "ja", "$EB080E.w 7-0 垂直バックポーチの終了ラスタ番号");
  2142:     }
  2143:     @Override public void smiControlled () {
  2144:       SpriteScreen.sprReg7VBackEndMask = smiMaskValue;
  2145:       SpriteScreen.sprReg7VBackEndTest = smiTestValue;
  2146:       int curr = SpriteScreen.sprReg7VBackEndMask == 0 ? SpriteScreen.sprReg7VBackEndPort : SpriteScreen.sprReg7VBackEndTest;
  2147:       if (SpriteScreen.sprReg7VBackEndCurr != curr) {
  2148:         SpriteScreen.sprReg7VBackEndCurr = curr;
  2149:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2150:           CRTC.crtAllStamp += 2;
  2151:           if (XEiJ.mpuTask == null) {  //停止中
  2152:             CRTC.crtRepaint ();
  2153:           }
  2154:         }
  2155:       }
  2156:     }
  2157:   }  //class SMTItem_SprVBEd
  2158: 
  2159:   public static class SMTItem_SprHigh extends SMTItem {
  2160:     public SMTItem_SprHigh () {
  2161:       super ("High", SpriteScreen.sprReg8ResoPort >> 4, 1);
  2162:       Multilingual.mlnToolTipText (smiNameLabel,
  2163:                       "en", "$EB0810.w 4 High-resolution",
  2164:                       "ja", "$EB0810.w 4 高解像度");
  2165:     }
  2166:     @Override public void smiControlled () {
  2167:       SpriteScreen.sprReg8ResoMask = SpriteScreen.sprReg8ResoMask & ~(1 << 4) | smiMaskValue & 1 << 4;
  2168:       SpriteScreen.sprReg8ResoTest = SpriteScreen.sprReg8ResoTest & ~(1 << 4) | smiTestValue     << 4;
  2169:       int curr = SpriteScreen.sprReg8ResoPort & ~SpriteScreen.sprReg8ResoMask | SpriteScreen.sprReg8ResoTest & SpriteScreen.sprReg8ResoMask;
  2170:       if (SpriteScreen.sprReg8ResoCurr != curr) {
  2171:         SpriteScreen.sprReg8ResoCurr = curr;
  2172:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2173:           CRTC.crtAllStamp += 2;
  2174:           if (XEiJ.mpuTask == null) {  //停止中
  2175:             CRTC.crtRepaint ();
  2176:           }
  2177:         }
  2178:       }
  2179:     }
  2180:   }  //class SMTItem_SprHigh
  2181: 
  2182:   public static class SMTItem_SprVRes extends SMTItem {
  2183:     public SMTItem_SprVRes () {
  2184:       super ("VRes", SpriteScreen.sprReg8ResoPort >> 2, 2);
  2185:       Multilingual.mlnToolTipText (smiNameLabel,
  2186:                       "en", "$EB0810.w 3-2 Vertical resolution",
  2187:                       "ja", "$EB0810.w 3-2 垂直解像度");
  2188:     }
  2189:     @Override public void smiControlled () {
  2190:       SpriteScreen.sprReg8ResoMask = SpriteScreen.sprReg8ResoMask & ~(3 << 2) | smiMaskValue & 3 << 2;
  2191:       SpriteScreen.sprReg8ResoTest = SpriteScreen.sprReg8ResoTest & ~(3 << 2) | smiTestValue     << 2;
  2192:       int curr = SpriteScreen.sprReg8ResoPort & ~SpriteScreen.sprReg8ResoMask | SpriteScreen.sprReg8ResoTest & SpriteScreen.sprReg8ResoMask;
  2193:       if (SpriteScreen.sprReg8ResoCurr != curr) {
  2194:         SpriteScreen.sprReg8ResoCurr = curr;
  2195:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2196:           CRTC.crtAllStamp += 2;
  2197:           if (XEiJ.mpuTask == null) {  //停止中
  2198:             CRTC.crtRepaint ();
  2199:           }
  2200:         }
  2201:       }
  2202:     }
  2203:   }  //class SMTItem_SprVRes
  2204: 
  2205:   public static class SMTItem_SprHRes extends SMTItem {
  2206:     public SMTItem_SprHRes () {
  2207:       super ("HRes", SpriteScreen.sprReg8ResoPort, 2);
  2208:       Multilingual.mlnToolTipText (smiNameLabel,
  2209:                       "en", "$EB0810.w 1-0 Horizontal resolution",
  2210:                       "ja", "$EB0810.w 1-0 水平解像度");
  2211:     }
  2212:     @Override public void smiControlled () {
  2213:       SpriteScreen.sprReg8ResoMask = SpriteScreen.sprReg8ResoMask & ~3 | smiMaskValue & 3;
  2214:       SpriteScreen.sprReg8ResoTest = SpriteScreen.sprReg8ResoTest & ~3 | smiTestValue;
  2215:       int curr = SpriteScreen.sprReg8ResoPort & ~SpriteScreen.sprReg8ResoMask | SpriteScreen.sprReg8ResoTest & SpriteScreen.sprReg8ResoMask;
  2216:       if (SpriteScreen.sprReg8ResoCurr != curr) {
  2217:         SpriteScreen.sprReg8ResoCurr = curr;
  2218:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2219:           CRTC.crtAllStamp += 2;
  2220:           if (XEiJ.mpuTask == null) {  //停止中
  2221:             CRTC.crtRepaint ();
  2222:           }
  2223:         }
  2224:       }
  2225:     }
  2226:   }  //class SMTItem_SprHRes
  2227: 
  2228: 
  2229:   //----------------------------------------------------------------------------------------
  2230:   //システムポート
  2231: 
  2232:   public static class SMTItem_SysHRL extends SMTItem {
  2233:     public SMTItem_SysHRL () {
  2234:       super ("HRL", CRTC.crtHRLPort, 1);
  2235:       Multilingual.mlnToolTipText (smiNameLabel,
  2236:                       "en", "$E8E007.b 1 HRL (dot clock selection)",
  2237:                       "ja", "$E8E007.b 1 HRL (ドットクロック選択)");
  2238:     }
  2239:     @Override public void smiControlled () {
  2240:       CRTC.crtHRLMask = smiMaskValue;
  2241:       CRTC.crtHRLTest = smiTestValue;
  2242:       int curr = CRTC.crtHRLMask == 0 ? CRTC.crtHRLPort : CRTC.crtHRLTest;
  2243:       if (CRTC.crtHRLCurr != curr) {
  2244:         CRTC.crtHRLCurr = curr;
  2245:         if (XEiJ.mpuTask != null) {  //動作中
  2246:           CRTC.crtRestart ();
  2247:         }
  2248:       }
  2249:     }
  2250:   }  //class SMTItem_SysHRL
  2251: 
  2252:   public static class SMTItem_SysCont extends SMTItem {
  2253:     public SMTItem_SysCont () {
  2254:       super ("Cont", VideoController.vcnTargetContrastPort, 4);
  2255:       Multilingual.mlnToolTipText (smiNameLabel,
  2256:                       "en", "$E8E001.b 3-0 Contrast",
  2257:                       "ja", "$E8E001.b 3-0 コントラスト");
  2258:     }
  2259:     @Override public void smiControlled () {
  2260:       VideoController.vcnTargetContrastMask = smiMaskValue;
  2261:       VideoController.vcnTargetContrastTest = smiTestValue;
  2262:       int curr = VideoController.vcnTargetContrastMask == 0 ? VideoController.vcnTargetContrastPort : VideoController.vcnTargetContrastTest;
  2263:       if (VideoController.vcnTargetContrastCurr != curr) {
  2264:         VideoController.vcnTargetContrastCurr = curr;
  2265:         VideoController.vcnTargetScaledContrast = VideoController.VCN_CONTRAST_SCALE * VideoController.vcnTargetContrastCurr;
  2266:         CRTC.crtContrastClock = XEiJ.mpuClockTime;
  2267:         CRTC.crtFrameTaskClock = Math.min (CRTC.crtContrastClock, CRTC.crtCaptureClock);
  2268:       }
  2269:     }
  2270:   }  //class SMTItem_SysCont
  2271: 
  2272: 
  2273: 
  2274:   //========================================================================================
  2275:   //$$SMG 表示モードテストのアイテムグループ
  2276:   //  コピーボタン
  2277:   //    ポートデータをテストデータにまとめてコピーする
  2278:   //  ポートラジオボタン
  2279:   //    まとめてポートを選択する
  2280:   //  テストラジオボタン
  2281:   //    まとめてテストを選択する
  2282:   public static class SMTGroup {
  2283: 
  2284:     public SMTItem[] smgItemArray;
  2285:     public ButtonGroup smgButtonGroup;
  2286:     public Box smgBox;
  2287:     public JRadioButton smgPortRadioButton;
  2288:     public JRadioButton smgTestRadioButton;
  2289: 
  2290:     //  コンストラクタ
  2291:     public SMTGroup (SMTItem... itemArray) {
  2292:       smgItemArray = itemArray;
  2293:       for (SMTItem item : smgItemArray) {
  2294:         item.smiItemGroup = this;
  2295:       }
  2296:       smgButtonGroup = new ButtonGroup ();
  2297:       smgBox = ComponentFactory.setFixedSize (
  2298:         ComponentFactory.createVerticalBox (
  2299:           Box.createVerticalStrut (16),
  2300:           ComponentFactory.createHorizontalBox (
  2301:             ComponentFactory.createVerticalBox (
  2302:               Box.createVerticalStrut (6),
  2303:               ComponentFactory.setFixedSize (
  2304:                 Multilingual.mlnToolTipText (
  2305:                   ComponentFactory.createImageButton (
  2306:                     XEiJ.createImage (
  2307:                       14, 18,
  2308:                       "11111111111111" +
  2309:                       "1............1" +
  2310:                       "1............1" +
  2311:                       "1............1" +
  2312:                       "1....1111....1" +
  2313:                       "1....1..1....1" +
  2314:                       "1....1..1....1" +
  2315:                       "1....1..1....1" +
  2316:                       "1....1..1....1" +
  2317:                       "1.1111..1111.1" +
  2318:                       "1..1......1..1" +
  2319:                       "1...1....1...1" +
  2320:                       "1....1..1....1" +
  2321:                       "1.....11.....1" +
  2322:                       "1............1" +
  2323:                       "1............1" +
  2324:                       "1............1" +
  2325:                       "11111111111111",
  2326:                       LnF.LNF_RGB[0],
  2327:                       LnF.LNF_RGB[12]),
  2328:                     "Copy port data to test data", new ActionListener () {
  2329:                       @Override public void actionPerformed (ActionEvent ae) {
  2330:                         smgCopyClicked ();
  2331:                       }
  2332:                     }),  //ae -> smgCopyClicked ()
  2333:                   "ja", "ポートデータをテストデータにコピーする"),
  2334:                 16, 20),
  2335:               Box.createVerticalStrut (6)
  2336:               ),
  2337:             Box.createHorizontalStrut (2),
  2338:             ComponentFactory.createVerticalBox (
  2339:               smgPortRadioButton = ComponentFactory.setFixedSize (
  2340:                 Multilingual.mlnToolTipText (
  2341:                   ComponentFactory.createRadioButton (smgButtonGroup, smgIsPortSelected (), "", new ActionListener () {
  2342:                     @Override public void actionPerformed (ActionEvent ae) {
  2343:                       smgPortSelected ();
  2344:                     }
  2345:                   }),  //ae -> smgPortSelected ()
  2346:                   "en", "Reflect port data", "ja", "ポートデータを反映させる"),
  2347:                 14, 16),
  2348:               smgTestRadioButton = ComponentFactory.setFixedSize (
  2349:                 Multilingual.mlnToolTipText (
  2350:                   ComponentFactory.createRadioButton (smgButtonGroup, smgIsTestSelected (), "", new ActionListener () {
  2351:                     @Override public void actionPerformed (ActionEvent ae) {
  2352:                       smgTestSelected ();
  2353:                     }
  2354:                   }),  //ae -> smgTestSelected ()
  2355:                   "en", "Reflect test data", "ja", "テストデータを反映させる"),
  2356:                 14, 16)
  2357:               )
  2358:             )
  2359:           ),
  2360:         32, 48);
  2361:     }  //new SMTGroup(SMTItem...)
  2362: 
  2363:     //smgIsPortSelected ()
  2364:     //  true=すべてPortが選択されている
  2365:     public final boolean smgIsPortSelected () {
  2366:       for (SMTItem item : smgItemArray) {
  2367:         if (item.smiMaskValue != 0) {  //Testが選択されている
  2368:           return false;
  2369:         }
  2370:       }
  2371:       return true;
  2372:     }  //smgIsPortSelected()
  2373: 
  2374:     //smgIsTestSelected ()
  2375:     //  true=すべてTestが選択されている
  2376:     public final boolean smgIsTestSelected () {
  2377:       for (SMTItem item : smgItemArray) {
  2378:         if (item.smiMaskValue == 0) {  //Portが選択されている
  2379:           return false;
  2380:         }
  2381:       }
  2382:       return true;
  2383:     }  //smgIsTestSelected()
  2384: 
  2385:     //smgCopyClicked ()
  2386:     //  コピーボタンが押された
  2387:     //  すべてのアイテムのPortをTestにコピーする
  2388:     public void smgCopyClicked () {
  2389:       for (SMTItem item : smgItemArray) {
  2390:         if (item.smiBitWidth == 1) {
  2391:           item.smiTestCheckBox.setSelected (item.smiPortValue != 0);
  2392:         } else {
  2393:           item.smiTestSpinner.setIntValue (item.smiPortValue);
  2394:         }
  2395:         item.smiTestChanged ();
  2396:       }
  2397:     }  //smgCopyClicked()
  2398: 
  2399:     //smgPortSelected ()
  2400:     //  Portが選択された
  2401:     public void smgPortSelected () {
  2402:       for (SMTItem item : smgItemArray) {
  2403:         item.smiPortRadioButton.setSelected (true);
  2404:         item.smiPortSelected ();
  2405:       }
  2406:     }  //smgPortSelected()
  2407: 
  2408:     //smgTestSelected ()
  2409:     //  Testが選択された
  2410:     public void smgTestSelected () {
  2411:       for (SMTItem item : smgItemArray) {
  2412:         item.smiTestRadioButton.setSelected (true);
  2413:         item.smiTestSelected ();
  2414:       }
  2415:     }  //smgTestSelected()
  2416: 
  2417:     //smgUpdate ()
  2418:     //  アイテム毎のPort/Testの選択が変化したときアイテムグループのPort/Testに反映させるためにアイテムが呼び出す
  2419:     public void smgUpdate () {
  2420:       if (smgIsPortSelected ()) {
  2421:         smgPortRadioButton.setSelected (true);
  2422:       } else if (smgIsTestSelected ()) {
  2423:         smgTestRadioButton.setSelected (true);
  2424:       } else {
  2425:         smgButtonGroup.clearSelection ();
  2426:       }
  2427:     }  //smgUpdate()
  2428: 
  2429:   }  //class SMTGroup
  2430: 
  2431: 
  2432: 
  2433: }  //class ScreenModeTest
  2434: 
  2435: 
  2436: