ScreenModeTest.java
     1: //========================================================================================
     2: //  ScreenModeTest.java
     3: //    en:Screen mode test
     4: //    ja:表示モードテスト
     5: //  Copyright (C) 2003-2017 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: //  http://stdkmd.com/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 smtItemSprHttl;  //$EB080A Reg5 7-0
   116:   public static SMTItem smtItemSprHsta;  //$EB080C Reg6 5-0
   117:   public static SMTItem smtItemSprVsta;  //$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:       smtItemSprHttl = new SMTItem_SprHttl (),
   233:       smtItemSprHsta = new SMTItem_SprHsta (),
   234:       smtItemSprVsta = new SMTItem_SprVsta (),
   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:       smtItemSprHttl,
   311:       smtItemSprHsta,
   312:       smtItemSprVsta,
   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:                     smtItemSprHttl.smiBox,
   506:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   507:                     smtItemSprHsta.smiBox,
   508:                     Box.createHorizontalStrut (SMT_ITEM_GAP),
   509:                     smtItemSprVsta.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:                       )
   541:                     )
   542:                   ),
   543:                 "Sprite Controller"),  //setTitledLineBorder
   544:               "ja", "スプライトコントローラ"),  //Multilingual.mlnTitledBorder
   545:             Box.createHorizontalStrut (SMT_MARGIN)
   546:             ),
   547: 
   548:           Box.createVerticalStrut (SMT_MARGIN)
   549:           )
   550:         ),
   551:       "ja", "表示モードテスト");  //Multilingual.mlnTitle
   552: 
   553:     //  ウインドウリスナー
   554:     ComponentFactory.addListener (
   555:       smtFrame,
   556:       new WindowAdapter () {
   557:         @Override public void windowClosing (WindowEvent we) {
   558:           XEiJ.dbgVisibleMask &= ~XEiJ.DBG_SMT_VISIBLE_MASK;
   559:         }
   560:       });
   561: 
   562:   }  //smtMakeFrame()
   563: 
   564:   //  R20Lに対応するオシレータの周波数(Hz)
   565:   public static final double[] SMT_R20L_OSC = {
   566:     38863632.0, 38863632.0, 38863632.0, 38863632.0,
   567:     38863632.0, 38863632.0, 38863632.0, 38863632.0,
   568:     38863632.0, 38863632.0, 38863632.0, 38863632.0,
   569:     38863632.0, 38863632.0, 38863632.0, 38863632.0,
   570:     69551900.0, 69551900.0, 69551900.0, 50349800.0,
   571:     69551900.0, 69551900.0, 69551900.0, 50349800.0,
   572:     69551900.0, 69551900.0, 69551900.0, 50349800.0,
   573:     69551900.0, 69551900.0, 69551900.0, 50349800.0,
   574:   };
   575:   //  HRL,R20Lに対応する分周比
   576:   public static final int[] SMT_HRL_R20L_RATIO = {
   577:     8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8,
   578:     6, 3, 2, 2, 6, 3, 2, 2, 6, 3, 2, 2, 6, 3, 2, 2,
   579:     8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8,
   580:     8, 4, 2, 2, 8, 4, 2, 2, 8, 4, 2, 2, 8, 4, 2, 2,
   581:   };
   582: 
   583:   //smtUpdateFrame ()
   584:   //  表示モードテストを更新する
   585:   public static void smtUpdateFrame () {
   586: 
   587:     if (smtFrame == null) {
   588:       return;
   589:     }
   590: 
   591:     //周波数
   592:     smtUpdateFreq ();
   593: 
   594:     //モード
   595:     smtUpdateMode ();
   596: 
   597:     //アイテム
   598:     smtItemCrtHFEd.smiSetPortValue (CRTC.crtR00HFrontEndPort);
   599:     smtItemCrtHSEd.smiSetPortValue (CRTC.crtR01HSyncEndPort);
   600:     smtItemCrtHBEd.smiSetPortValue (CRTC.crtR02HBackEndPort);
   601:     smtItemCrtHDEd.smiSetPortValue (CRTC.crtR03HDispEndPort);
   602:     smtItemCrtVFEd.smiSetPortValue (CRTC.crtR04VFrontEndPort);
   603:     smtItemCrtVSEd.smiSetPortValue (CRTC.crtR05VSyncEndPort);
   604:     smtItemCrtVBEd.smiSetPortValue (CRTC.crtR06VBackEndPort);
   605:     smtItemCrtVDEd.smiSetPortValue (CRTC.crtR07VDispEndPort);
   606: 
   607:     smtItemCrtIRQ.smiSetPortValue (CRTC.crtR09IRQRasterPort);
   608:     smtItemCrtTxX.smiSetPortValue (CRTC.crtR10TxXPort);
   609:     smtItemCrtTxY.smiSetPortValue (CRTC.crtR11TxYPort);
   610:     smtItemCrtGrMM.smiSetPortValue (CRTC.crtMemoryModePort);
   611:     smtItemCrtHigh.smiSetPortValue (CRTC.crtHighResoPort);
   612:     smtItemCrtVRes.smiSetPortValue (CRTC.crtVResoPort);
   613:     smtItemCrtHRes.smiSetPortValue (CRTC.crtHResoPort);
   614:     smtItemSysHRL.smiSetPortValue (CRTC.crtHRLPort);
   615:     smtItemSysCont.smiSetPortValue (VideoController.vcnTargetContrastPort);
   616: 
   617:     smtItemCrtGr0X.smiSetPortValue (CRTC.crtR12GrXPort[0]);
   618:     smtItemCrtGr0Y.smiSetPortValue (CRTC.crtR13GrYPort[0]);
   619:     smtItemCrtGr1X.smiSetPortValue (CRTC.crtR12GrXPort[1]);
   620:     smtItemCrtGr1Y.smiSetPortValue (CRTC.crtR13GrYPort[1]);
   621:     smtItemCrtGr2X.smiSetPortValue (CRTC.crtR12GrXPort[2]);
   622:     smtItemCrtGr2Y.smiSetPortValue (CRTC.crtR13GrYPort[2]);
   623:     smtItemCrtGr3X.smiSetPortValue (CRTC.crtR12GrXPort[3]);
   624:     smtItemCrtGr3Y.smiSetPortValue (CRTC.crtR13GrYPort[3]);
   625: 
   626:     smtItemVcnGrMM.smiSetPortValue (VideoController.vcnReg1Port      );
   627:     smtItemVcnSpPr.smiSetPortValue (VideoController.vcnReg2Port >> 12);
   628:     smtItemVcnTxPr.smiSetPortValue (VideoController.vcnReg2Port >> 10);
   629:     smtItemVcnGrPr.smiSetPortValue (VideoController.vcnReg2Port >>  8);
   630:     smtItemVcnG4th.smiSetPortValue (VideoController.vcnReg2Port >>  6);
   631:     smtItemVcnG3rd.smiSetPortValue (VideoController.vcnReg2Port >>  4);
   632:     smtItemVcnG2nd.smiSetPortValue (VideoController.vcnReg2Port >>  2);
   633:     smtItemVcnG1st.smiSetPortValue (VideoController.vcnReg2Port      );
   634: 
   635:     smtItemVcnAHOn.smiSetPortValue (VideoController.vcnReg3Port >> 14);
   636:     smtItemVcnExOn.smiSetPortValue (VideoController.vcnReg3Port >> 12);
   637:     smtItemVcnHalf.smiSetPortValue (VideoController.vcnReg3Port >> 11);
   638:     smtItemVcnPLSB.smiSetPortValue (VideoController.vcnReg3Port >> 10);
   639:     smtItemVcnGrGr.smiSetPortValue (VideoController.vcnReg3Port >>  9);
   640:     smtItemVcnGrST.smiSetPortValue (VideoController.vcnReg3Port >>  8);
   641:     smtItemVcnSpOn.smiSetPortValue (VideoController.vcnReg3Port >>  6);
   642:     smtItemVcnTxOn.smiSetPortValue (VideoController.vcnReg3Port >>  5);
   643:     smtItemVcnGxOn.smiSetPortValue (VideoController.vcnReg3Port >>  4);
   644:     smtItemVcnG4On.smiSetPortValue (VideoController.vcnReg3Port >>  3);
   645:     smtItemVcnG3On.smiSetPortValue (VideoController.vcnReg3Port >>  2);
   646:     smtItemVcnG2On.smiSetPortValue (VideoController.vcnReg3Port >>  1);
   647:     smtItemVcnG1On.smiSetPortValue (VideoController.vcnReg3Port      );
   648: 
   649:     smtItemSprBg0X.smiSetPortValue (SpriteScreen.sprReg0Bg0XPort);
   650:     smtItemSprBg0Y.smiSetPortValue (SpriteScreen.sprReg1Bg0YPort);
   651:     smtItemSprBg1X.smiSetPortValue (SpriteScreen.sprReg2Bg1XPort);
   652:     smtItemSprBg1Y.smiSetPortValue (SpriteScreen.sprReg3Bg1YPort);
   653:     smtItemSprDisp.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 9);
   654:     smtItemSprB1Tx.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 4);
   655:     smtItemSprB1On.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 3);
   656:     smtItemSprB0Tx.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort >> 1);
   657:     smtItemSprB0On.smiSetPortValue (SpriteScreen.sprReg4BgCtrlPort     );
   658: 
   659:     smtItemSprHttl.smiSetPortValue (SpriteScreen.sprReg5HTotalPort);
   660:     smtItemSprHsta.smiSetPortValue (SpriteScreen.sprReg6HStartPort);
   661:     smtItemSprVsta.smiSetPortValue (SpriteScreen.sprReg7VStartPort);
   662:     smtItemSprHigh.smiSetPortValue (SpriteScreen.sprReg8ResoPort >> 4);
   663:     smtItemSprVRes.smiSetPortValue (SpriteScreen.sprReg8ResoPort >> 2);
   664:     smtItemSprHRes.smiSetPortValue (SpriteScreen.sprReg8ResoPort     );
   665: 
   666:     for (SMTItem item : smtItemArray) {
   667:       if (item.smiPending) {
   668:         item.smiPending = false;
   669:         item.smiControlled ();
   670:       }
   671:     }
   672: 
   673:   }  //smtUpdateFrame()
   674: 
   675:   //smtUpdateFreq ()
   676:   //  周波数の表示を更新する
   677:   public static void smtUpdateFreq () {
   678:     int htotal = CRTC.crtR00HFrontEndCurr + 1;
   679:     int vtotal = CRTC.crtR04VFrontEndCurr + 1;
   680:     if (0 < htotal && 0 < vtotal) {  //0除算を回避する
   681:       int r20l = CRTC.crtHighResoCurr << 4 | CRTC.crtVResoCurr << 2 | CRTC.crtHResoCurr;
   682:       double osc = SMT_R20L_OSC[r20l];
   683:       int ratio = SMT_HRL_R20L_RATIO[CRTC.crtHRLCurr << 5 | r20l];
   684:       double hfreq = osc / (ratio * htotal << 3);
   685:       double vfreq = hfreq / vtotal;
   686:       int width = CRTC.crtR03HDispEndCurr - CRTC.crtR02HBackEndCurr << 3;
   687:       int height = CRTC.crtR07VDispEndCurr - CRTC.crtR06VBackEndCurr;
   688:       String option = "(normal)";
   689:       if (CRTC.crtDuplication) {  //ラスタ2度読み
   690:         height >>= 1;
   691:         option = "(double-scanning)";
   692:       } else if (CRTC.crtInterlace) {  //インターレース
   693:         height <<= 1;
   694:         option = "(interlace)";
   695:       } else if (CRTC.crtSlit) {  //スリット
   696:         option = "(slit)";
   697:       }
   698:       String freqText = String.format ("%dx%d%s, HSYNC:%.3fMHz/%d/8/%d=%.3fkHz, VSYNC:%.3fkHz/%d=%.3fHz",
   699:                                        width, height,
   700:                                        option,
   701:                                        osc * 1e-6, ratio, htotal, hfreq * 1e-3,
   702:                                        hfreq * 1e-3, vtotal, vfreq);
   703:       if (!freqText.equals (smtFreqLastText)) {  //前回と同じときは更新しない。内容が変わっていないのに更新し続けるとコピーできない
   704:         smtFreqLastText = freqText;
   705:         smtFreqTextField.setText (freqText);
   706:       }
   707:     }
   708:   }  //smtUpdateFreq()
   709: 
   710:   //smtUpdateMode ()
   711:   //  画面モードの表示を更新する
   712:   //  画面モードは頻繁に更新される場合があるが、表示が頻繁に更新されるとコピーできないので、最近使われた複数の画面モードを一定の順序で表示する
   713:   public static void smtUpdateMode () {
   714:     String name1 = VideoController.vcnMode.name ();  //分類
   715:     String name2 = VideoController.vcnGetName (new StringBuilder ()).toString ();  //詳細
   716:     String name = name1.equals (name2) ? name1 : new StringBuilder (name1).append ('(').append (name2).append (')').toString ();  //モードの名前
   717:     long time = XEiJ.mpuClockTime;  //現在の時刻
   718:     boolean update = false;  //true=更新する
   719:     //リストを走査する
   720:     //  今回のモードのとき時刻を更新する
   721:     //  時刻がSMT_MODE_SPAN秒前よりも古いレコードを捨てる
   722:     boolean f = false;  //true=リストに今回のモードがある
   723:     {
   724:       long t = time - XEiJ.TMR_FREQ * SMT_MODE_SPAN;  //SMT_MODE_SPAN秒前の時刻
   725:       int k = 0;  //残ったレコードの数。時刻がSMT_MODE_SPAN秒前よりも新しいレコードの数
   726:       for (int i = 0; i < smtModeCount; i++) {
   727:         if (name.compareTo (smtModeName[i]) == 0) {  //今回のモードのとき
   728:           f = true;  //リストに今回のモードがある
   729:           //レコードを残して時刻を更新する。k<iのとき詰める
   730:           smtModeName[k] = name;
   731:           smtModeTime[k] = time;
   732:           k++;
   733:         } else if (t < smtModeTime[i]) {  //今回のモードではなくて時刻がSMT_MODE_SPAN秒前よりも新しいとき
   734:           //レコードを残す。k<iのとき詰める
   735:           smtModeName[k] = smtModeName[i];
   736:           smtModeTime[k] = smtModeTime[i];
   737:           k++;
   738:         }
   739:       }
   740:       if (k < smtModeCount) {  //時刻がSMT_MODE_SPAN秒以上前のレコードを捨てて詰めたのでリストが短くなった
   741:         smtModeCount = k;
   742:         update = true;
   743:       }
   744:     }
   745:     if (!f) {  //リストに今回のモードがないとき
   746:       //リストが一杯のとき最も古いレコードを捨てる
   747:       if (smtModeCount == SMT_MODE_LIMIT) {
   748:         //最も古いレコードを探す
   749:         int o = -1;  //最も古いレコードのインデックス
   750:         long t = Long.MAX_VALUE;  //最も古いレコードの時刻
   751:         for (int i = 0; i < smtModeCount; i++) {
   752:           if (smtModeTime[i] < t) {
   753:             t = smtModeTime[i];
   754:             o = i;
   755:           }
   756:         }
   757:         //リストを詰める
   758:         for (int i = o + 1; i < SMT_MODE_LIMIT; i++) {
   759:           smtModeName[i - 1] = smtModeName[i];
   760:           smtModeTime[i - 1] = smtModeTime[i];
   761:         }
   762:         smtModeCount--;
   763:       }
   764:       //リストに今回のモードを追加する
   765:       {
   766:         int p = -1;  //今回のモードを挿入する位置。今回のモードよりも名前が大きいレコードの最小のインデックス。-1=今回のモードよりも名前が大きいレコードがない
   767:         for (int i = 0; i < smtModeCount; i++) {
   768:           if (name.compareTo (smtModeName[i]) < 0) {
   769:             p = i;  //今回のモードよりも名前が大きいレコードの最小のインデックス
   770:             break;
   771:           }
   772:         }
   773:         if (p < 0) {  //今回のモードよりも名前が大きいレコードがないとき
   774:           p = smtModeCount;  //末尾に追加する
   775:         }
   776:         for (int i = smtModeCount - 1; p <= i; i--) {
   777:           smtModeName[i + 1] = smtModeName[i];
   778:           smtModeTime[i + 1] = smtModeTime[i];
   779:         }
   780:         smtModeName[p] = name;
   781:         smtModeTime[p] = time;
   782:         smtModeCount++;
   783:       }
   784:       update = true;
   785:     }
   786:     //リストが変化したとき表示する
   787:     if (update) {
   788:       StringBuilder sb = new StringBuilder ();
   789:       for (int i = 0; i < smtModeCount; i++) {
   790:         if (0 < i) {
   791:           sb.append (", ");
   792:         }
   793:         sb.append (smtModeName[i]);
   794:       }
   795:       smtModeTextField.setText (sb.toString ());
   796:     }
   797:   }  //smtUpdateMode()
   798: 
   799: 
   800: 
   801:   //========================================================================================
   802:   //$$SMI 表示モードテストのアイテム
   803:   public static class SMTItem {
   804: 
   805:     public int smiBitWidth;  //bit幅
   806:     public int smiBitMask;  //bitマスク兼最大値。(1<<smiBitWidth)-1
   807:     public int smiDigits;  //最大値の10進桁数。(smiBitWidth*77>>8)+1
   808: 
   809:     public int smiPortValue;  //現在Portに表示されている値
   810:     public int smiMaskValue;  //現在Maskで選択されている値。0=Port,-1=Test
   811:     public int smiTestValue;  //現在Testに表示されている値
   812: 
   813:     public boolean smiPending;  //true=動作中に操作されたのでsmtUpdateFrame()でMaskとTestを取り込む
   814: 
   815:     public ButtonGroup smiButtonGroup;  //PortとTestを選択するラジオボタンのグループ
   816: 
   817:     public Box smiBox;  //ボックス
   818:     public JLabel smiNameLabel;  //名前のラベル
   819: 
   820:     public JRadioButton smiPortRadioButton;  //Portを選択するラジオボタン
   821:     public JCheckBox smiPortCheckBox;  //1bitのときPortで使うチェックボックス
   822:     public JTextField smiPortTextField;  //2bit以上あるときPortで使うテキストフィールド
   823: 
   824:     public JRadioButton smiTestRadioButton;  //Testを選択するラジオボタン
   825:     public JCheckBox smiTestCheckBox;  //1bitのときTestで使うチェックボックス
   826:     public DecimalSpinner smiTestSpinner;  //2bit以上あるときTestで使うスピナー
   827: 
   828:     public SMTGroup smiItemGroup;
   829: 
   830:     //  コンストラクタ
   831:     public SMTItem (String name, int portValue, int bitWidth) {
   832: 
   833:       smiBitWidth = bitWidth;
   834:       smiBitMask = (1 << bitWidth) - 1;
   835:       smiDigits = (bitWidth * 77 >> 8) + 1;
   836: 
   837:       portValue &= smiBitMask;
   838:       smiPortValue = portValue;
   839:       smiMaskValue = 0;
   840:       smiTestValue = portValue;
   841: 
   842:       smiPending = false;
   843: 
   844:       smiButtonGroup = new ButtonGroup ();
   845: 
   846:       smiBox = ComponentFactory.setFixedSize (
   847:         ComponentFactory.createVerticalBox (
   848:           Box.createVerticalGlue (),
   849:           ComponentFactory.createHorizontalBox (
   850:             Box.createHorizontalGlue (),
   851:             smiNameLabel = ComponentFactory.setFixedSize (ComponentFactory.createLabel (name), bitWidth == 1 ? 32 : 14 + 24 + 8 * smiDigits, 16),
   852:             Box.createHorizontalGlue ()
   853:             ),
   854:           ComponentFactory.createHorizontalBox (
   855:             Box.createHorizontalGlue (),
   856:             smiPortRadioButton = ComponentFactory.setFixedSize (ComponentFactory.createRadioButton (smiButtonGroup, smiMaskValue == 0, "", new ActionListener () {
   857:               @Override public void actionPerformed (ActionEvent ae) {
   858:                 smiPortSelected ();
   859:               }
   860:             }), 14, 16),  //ae -> this.smiPortSelected ()
   861:             bitWidth == 1 ?
   862:             (smiPortCheckBox = ComponentFactory.setEnabled (
   863:               ComponentFactory.setFixedSize (ComponentFactory.createCheckBox (smiPortValue != 0, "", null), 14, 16),
   864:               false)) :  //操作不可
   865:             (smiPortTextField = ComponentFactory.setFixedSize (
   866:               ComponentFactory.setEditable (
   867:                 ComponentFactory.setHorizontalAlignment (
   868:                   new JTextField (String.valueOf (smiPortValue)), //columnを指定すると幅を調節できなくなる
   869:                   JTextField.CENTER),  //中央寄せ
   870:                 false),  //編集不可
   871:               24 + 8 * smiDigits, 16)),
   872:             Box.createHorizontalGlue ()
   873:             ),
   874:           ComponentFactory.createHorizontalBox (
   875:             Box.createHorizontalGlue (),
   876:             smiTestRadioButton = ComponentFactory.setFixedSize (ComponentFactory.createRadioButton (smiButtonGroup, smiMaskValue != 0, "", new ActionListener () {
   877:               @Override public void actionPerformed (ActionEvent ae) {
   878:                 smiTestSelected ();
   879:               }
   880:             }), 14, 16),  //ae -> this.smiTestSelected ()
   881:             bitWidth == 1 ?
   882:             (smiTestCheckBox = ComponentFactory.setFixedSize (ComponentFactory.createCheckBox (smiTestValue != 0, "", new ActionListener () {
   883:               @Override public void actionPerformed (ActionEvent ae) {
   884:                 smiTestChanged ();
   885:               }
   886:             }), 14, 16)) :  //ae -> this.smiTestChanged ()
   887:             (smiTestSpinner = ComponentFactory.createDecimalSpinner (smiTestValue, 0, smiBitMask, 1, 0, new ChangeListener () {
   888:               @Override public void stateChanged (ChangeEvent ce) {
   889:                 smiTestChanged ();
   890:               }
   891:             })),  //ce -> this.smiTestChanged ()
   892:             Box.createHorizontalGlue ()
   893:             ),
   894:           Box.createVerticalGlue ()
   895:           ),
   896:         bitWidth == 1 ? 32 : 14 + 24 + 8 * smiDigits, 48);
   897: 
   898:       smiItemGroup = null;
   899: 
   900:     }  //new SMTItem(int,int,int)
   901: 
   902:     //smiSetPortValue (portValue)
   903:     //  Portの値を表示する
   904:     //  smtUpdateFrame()が呼び出す
   905:     public void smiSetPortValue (int portValue) {
   906:       portValue &= smiBitMask;
   907:       if (smiPortValue != portValue) {
   908:         smiPortValue = portValue;
   909:         if (smiBitWidth == 1) {
   910:           smiPortCheckBox.setSelected (portValue != 0);
   911:         } else {
   912:           smiPortTextField.setText (String.valueOf (portValue));
   913:         }
   914:       }
   915:     }  //smiSetPortValue(int)
   916: 
   917:     //smiPortSelected ()
   918:     //  Portが選択された
   919:     public void smiPortSelected () {
   920:       if (smiMaskValue != 0) {
   921:         smiMaskValue = 0;
   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:     }  //smiPortSelected()
   934: 
   935:     //smiTestSelected ()
   936:     //  Testが選択された
   937:     public void smiTestSelected () {
   938:       if (smiMaskValue == 0) {
   939:         smiMaskValue = -1;
   940:         if (XEiJ.mpuTask == null) {  //停止中
   941:           //停止中のときはすぐにsmiControlled()を呼び出す
   942:           smiControlled ();
   943:         } else {  //動作中
   944:           //動作中のときは次回のsmtUpdateFrame()でsmiControlled()を呼び出す
   945:           smiPending = true;
   946:         }
   947:         if (smiItemGroup != null) {
   948:           smiItemGroup.smgUpdate ();
   949:         }
   950:       }
   951:     }  //smiTestSelected()
   952: 
   953:     //smiTestChanged ()
   954:     //  Testの値が変更された
   955:     public void smiTestChanged () {
   956:       int testValue = (smiBitWidth == 1 ? smiTestCheckBox.isSelected () ? 1 : 0 :
   957:                        smiTestSpinner.getIntValue ());
   958:       if (smiTestValue != testValue) {
   959:         smiTestValue = testValue;
   960:         if (XEiJ.mpuTask == null) {  //停止中
   961:           //停止中のときはすぐにsmiControlled()を呼び出す
   962:           smiControlled ();
   963:         } else {  //動作中
   964:           //動作中のときは次回のsmtUpdateFrame()でsmiControlled()を呼び出す
   965:           smiPending = true;
   966:         }
   967:       }
   968:     }  //smiTestChanged()
   969: 
   970:     //smiControlled ()
   971:     //  MaskまたはTestが操作された
   972:     public void smiControlled () {
   973:       //オーバーライドする
   974:     }  //smiControlled()
   975: 
   976:   }  //class SMTItem
   977: 
   978: 
   979:   //----------------------------------------------------------------------------------------
   980:   //CRTC
   981: 
   982:   public static class SMTItem_CrtHFEd extends SMTItem {
   983:     public SMTItem_CrtHFEd () {
   984:       super ("HFEd", CRTC.crtR00HFrontEndPort, 8);
   985:       Multilingual.mlnToolTipText (smiNameLabel,
   986:                       "en", "$E80000.w 7-0 End character number of horizontal front porch",
   987:                       "ja", "$E80000.w 7-0 水平フロントポーチの終了キャラクタ番号");
   988:     }
   989:     @Override public void smiControlled () {
   990:       CRTC.crtR00HFrontEndMask = smiMaskValue;
   991:       CRTC.crtR00HFrontEndTest = smiTestValue;
   992:       int curr = CRTC.crtR00HFrontEndMask == 0 ? CRTC.crtR00HFrontEndPort : CRTC.crtR00HFrontEndTest;
   993:       if (CRTC.crtR00HFrontEndCurr != curr) {
   994:         CRTC.crtR00HFrontEndCurr = curr;
   995:         if (XEiJ.mpuTask != null) {  //動作中
   996:           CRTC.crtRestart ();
   997:         }
   998:       }
   999:     }
  1000:   }  //class SMTItem_CrtHFEd
  1001: 
  1002:   public static class SMTItem_CrtHSEd extends SMTItem {
  1003:     public SMTItem_CrtHSEd () {
  1004:       super ("HSEd", CRTC.crtR01HSyncEndPort, 8);
  1005:       Multilingual.mlnToolTipText (smiNameLabel,
  1006:                       "en", "$E80002.w 7-0 End character number of horizontal flyback Period",
  1007:                       "ja", "$E80002.w 7-0 水平帰線期間の終了キャラクタ番号");
  1008:     }
  1009:     @Override public void smiControlled () {
  1010:       CRTC.crtR01HSyncEndMask = smiMaskValue;
  1011:       CRTC.crtR01HSyncEndTest = smiTestValue;
  1012:       int curr = CRTC.crtR01HSyncEndMask == 0 ? CRTC.crtR01HSyncEndPort : CRTC.crtR01HSyncEndTest;
  1013:       if (CRTC.crtR01HSyncEndCurr != curr) {
  1014:         CRTC.crtR01HSyncEndCurr = curr;
  1015:         if (XEiJ.mpuTask != null) {  //動作中
  1016:           CRTC.crtRestart ();
  1017:         }
  1018:       }
  1019:     }
  1020:   }  //class SMTItem_CrtHSEd
  1021: 
  1022:   public static class SMTItem_CrtHBEd extends SMTItem {
  1023:     public SMTItem_CrtHBEd () {
  1024:       super ("HBEd", CRTC.crtR02HBackEndPort, 8);
  1025:       Multilingual.mlnToolTipText (smiNameLabel,
  1026:                       "en", "$E80004.w 7-0 End character number of horizontal back porch",
  1027:                       "ja", "$E80004.w 7-0 水平バックポーチの終了キャラクタ番号");
  1028:     }
  1029:     @Override public void smiControlled () {
  1030:       CRTC.crtR02HBackEndMask = smiMaskValue;
  1031:       CRTC.crtR02HBackEndTest = smiTestValue;
  1032:       int curr = CRTC.crtR02HBackEndMask == 0 ? CRTC.crtR02HBackEndPort : CRTC.crtR02HBackEndTest;
  1033:       if (CRTC.crtR02HBackEndCurr != curr) {
  1034:         CRTC.crtR02HBackEndCurr = curr;
  1035:         if (XEiJ.mpuTask != null) {  //動作中
  1036:           CRTC.crtRestart ();
  1037:         }
  1038:       }
  1039:     }
  1040:   }  //class SMTItem_CrtHBEd
  1041: 
  1042:   public static class SMTItem_CrtHDEd extends SMTItem {
  1043:     public SMTItem_CrtHDEd () {
  1044:       super ("HDEd", CRTC.crtR03HDispEndPort, 8);
  1045:       Multilingual.mlnToolTipText (smiNameLabel,
  1046:                       "en", "$E80006.w 7-0 End character number of horizontal display period",
  1047:                       "ja", "$E80006.w 7-0 水平映像期間の終了キャラクタ番号");
  1048:     }
  1049:     @Override public void smiControlled () {
  1050:       CRTC.crtR03HDispEndMask = smiMaskValue;
  1051:       CRTC.crtR03HDispEndTest = smiTestValue;
  1052:       int curr = CRTC.crtR03HDispEndMask == 0 ? CRTC.crtR03HDispEndPort : CRTC.crtR03HDispEndTest;
  1053:       if (CRTC.crtR03HDispEndCurr != curr) {
  1054:         CRTC.crtR03HDispEndCurr = curr;
  1055:         if (XEiJ.mpuTask != null) {  //動作中
  1056:           CRTC.crtRestart ();
  1057:         }
  1058:       }
  1059:     }
  1060:   }  //class SMTItem_CrtHDEd
  1061: 
  1062:   public static class SMTItem_CrtVFEd extends SMTItem {
  1063:     public SMTItem_CrtVFEd () {
  1064:       super ("VFEd", CRTC.crtR04VFrontEndPort, 10);
  1065:       Multilingual.mlnToolTipText (smiNameLabel,
  1066:                       "en", "$E80008.w 9-0 End raster number of vertical front porch",
  1067:                       "ja", "$E80008.w 9-0 垂直フロントポーチの終了ラスタ番号");
  1068:     }
  1069:     @Override public void smiControlled () {
  1070:       CRTC.crtR04VFrontEndMask = smiMaskValue;
  1071:       CRTC.crtR04VFrontEndTest = smiTestValue;
  1072:       int curr = CRTC.crtR04VFrontEndMask == 0 ? CRTC.crtR04VFrontEndPort : CRTC.crtR04VFrontEndTest;
  1073:       if (CRTC.crtR04VFrontEndCurr != curr) {
  1074:         CRTC.crtR04VFrontEndCurr = curr;
  1075:         if (CRTC.CRT_RASTER_HASH_ON) {
  1076:           CRTC.crtUpdateRasterHash ();
  1077:         }
  1078:         if (XEiJ.mpuTask != null) {  //動作中
  1079:           CRTC.crtRestart ();
  1080:         }
  1081:       }
  1082:     }
  1083:   }  //class SMTItem_CrtVFEd
  1084: 
  1085:   public static class SMTItem_CrtVSEd extends SMTItem {
  1086:     public SMTItem_CrtVSEd () {
  1087:       super ("VSEd", CRTC.crtR05VSyncEndPort, 10);
  1088:       Multilingual.mlnToolTipText (smiNameLabel,
  1089:                       "en", "$E8000A.w 9-0 End raster number of vertical flyback period",
  1090:                       "ja", "$E8000A.w 9-0 垂直帰線期間の終了ラスタ番号");
  1091:     }
  1092:     @Override public void smiControlled () {
  1093:       CRTC.crtR05VSyncEndMask = smiMaskValue;
  1094:       CRTC.crtR05VSyncEndTest = smiTestValue;
  1095:       int curr = CRTC.crtR05VSyncEndMask == 0 ? CRTC.crtR05VSyncEndPort : CRTC.crtR05VSyncEndTest;
  1096:       if (CRTC.crtR05VSyncEndCurr != curr) {
  1097:         CRTC.crtR05VSyncEndCurr = curr;
  1098:         if (XEiJ.mpuTask != null) {  //動作中
  1099:           CRTC.crtRestart ();
  1100:         }
  1101:       }
  1102:     }
  1103:   }  //class SMTItem_CrtVSEd
  1104: 
  1105:   public static class SMTItem_CrtVBEd extends SMTItem {
  1106:     public SMTItem_CrtVBEd () {
  1107:       super ("VBEd", CRTC.crtR06VBackEndPort, 10);
  1108:       Multilingual.mlnToolTipText (smiNameLabel,
  1109:                       "en", "$E8000C.w 9-0 End raster number of vertical back porch",
  1110:                       "ja", "$E8000C.w 9-0 垂直バックポーチの終了ラスタ番号");
  1111:     }
  1112:     @Override public void smiControlled () {
  1113:       CRTC.crtR06VBackEndMask = smiMaskValue;
  1114:       CRTC.crtR06VBackEndTest = smiTestValue;
  1115:       int curr = CRTC.crtR06VBackEndMask == 0 ? CRTC.crtR06VBackEndPort : CRTC.crtR06VBackEndTest;
  1116:       if (CRTC.crtR06VBackEndCurr != curr) {
  1117:         CRTC.crtR06VBackEndCurr = curr;
  1118:         if (XEiJ.mpuTask != null) {  //動作中
  1119:           CRTC.crtRestart ();
  1120:         }
  1121:       }
  1122:     }
  1123:   }  //class SMTItem_CrtVBEd
  1124: 
  1125:   public static class SMTItem_CrtVDEd extends SMTItem {
  1126:     public SMTItem_CrtVDEd () {
  1127:       super ("VDEd", CRTC.crtR07VDispEndPort, 10);
  1128:       Multilingual.mlnToolTipText (smiNameLabel,
  1129:                       "en", "$E8000E.w 9-0 End raster number of vertical display period",
  1130:                       "ja", "$E8000E.w 9-0 垂直表示期間の終了ラスタ番号");
  1131:     }
  1132:     @Override public void smiControlled () {
  1133:       CRTC.crtR07VDispEndMask = smiMaskValue;
  1134:       CRTC.crtR07VDispEndTest = smiTestValue;
  1135:       int curr = CRTC.crtR07VDispEndMask == 0 ? CRTC.crtR07VDispEndPort : CRTC.crtR07VDispEndTest;
  1136:       if (CRTC.crtR07VDispEndCurr != curr) {
  1137:         CRTC.crtR07VDispEndCurr = curr;
  1138:         if (XEiJ.mpuTask != null) {  //動作中
  1139:           CRTC.crtRestart ();
  1140:         }
  1141:       }
  1142:     }
  1143:   }  //class SMTItem_CrtVDEd
  1144: 
  1145:   public static class SMTItem_CrtGrMM extends SMTItem {
  1146:     public SMTItem_CrtGrMM () {
  1147:       super ("GrMM", CRTC.crtMemoryModePort, 3);
  1148:       Multilingual.mlnToolTipText (smiNameLabel,
  1149:                       "en", "$E80028.w 10-8 Memory mode of graphics screen",
  1150:                       "ja", "$E80028.w 10-8 グラフィックス画面のメモリモード");
  1151:     }
  1152:     @Override public void smiControlled () {
  1153:       CRTC.crtMemoryModeMask = smiMaskValue;
  1154:       CRTC.crtMemoryModeTest = smiTestValue;
  1155:       CRTC.crtSetMemoryMode (CRTC.crtMemoryModePort);
  1156:     }
  1157:   }  //class SMTItem_CrtGrMM
  1158: 
  1159:   public static class SMTItem_CrtHigh extends SMTItem {
  1160:     public SMTItem_CrtHigh () {
  1161:       super ("High", CRTC.crtHighResoPort, 1);
  1162:       Multilingual.mlnToolTipText (smiNameLabel,
  1163:                       "en", "$E80028.w 4 High-resolution",
  1164:                       "ja", "$E80028.w 4 高解像度");
  1165:     }
  1166:     @Override public void smiControlled () {
  1167:       CRTC.crtHighResoMask = smiMaskValue;
  1168:       CRTC.crtHighResoTest = smiTestValue;
  1169:       int curr = CRTC.crtHighResoMask == 0 ? CRTC.crtHighResoPort : CRTC.crtHighResoTest;
  1170:       if (CRTC.crtHighResoCurr != curr) {
  1171:         CRTC.crtHighResoCurr = curr;
  1172:         if (XEiJ.mpuTask != null) {  //動作中
  1173:           CRTC.crtRestart ();
  1174:         }
  1175:       }
  1176:     }
  1177:   }  //class SMTItem_CrtHigh
  1178: 
  1179:   public static class SMTItem_CrtVRes extends SMTItem {
  1180:     public SMTItem_CrtVRes () {
  1181:       super ("VRes", CRTC.crtVResoPort, 2);
  1182:       Multilingual.mlnToolTipText (smiNameLabel,
  1183:                       "en", "$E80028.w 3-2 Vertical resolution",
  1184:                       "ja", "$E80028.w 3-2 垂直解像度");
  1185:     }
  1186:     @Override public void smiControlled () {
  1187:       CRTC.crtVResoMask = smiMaskValue;
  1188:       CRTC.crtVResoTest = smiTestValue;
  1189:       int curr = CRTC.crtVResoMask == 0 ? CRTC.crtVResoPort : CRTC.crtVResoTest;
  1190:       if (CRTC.crtVResoCurr != curr) {
  1191:         CRTC.crtVResoCurr = curr;
  1192:         if (XEiJ.mpuTask != null) {  //動作中
  1193:           CRTC.crtRestart ();
  1194:         }
  1195:       }
  1196:     }
  1197:   }  //class SMTItem_CrtVRes
  1198: 
  1199:   public static class SMTItem_CrtHRes extends SMTItem {
  1200:     public SMTItem_CrtHRes () {
  1201:       super ("HRes", CRTC.crtHResoPort, 2);
  1202:       Multilingual.mlnToolTipText (smiNameLabel,
  1203:                       "en", "$E80028.w 1-0 Horizontal resolution",
  1204:                       "ja", "$E80028.w 1-0 水平解像度");
  1205:     }
  1206:     @Override public void smiControlled () {
  1207:       CRTC.crtHResoMask = smiMaskValue;
  1208:       CRTC.crtHResoTest = smiTestValue;
  1209:       int curr = CRTC.crtHResoMask == 0 ? CRTC.crtHResoPort : CRTC.crtHResoTest;
  1210:       if (CRTC.crtHResoCurr != curr) {
  1211:         CRTC.crtHResoCurr = curr;
  1212:         if (XEiJ.mpuTask != null) {  //動作中
  1213:           CRTC.crtRestart ();
  1214:         }
  1215:       }
  1216:     }
  1217:   }  //class SMTItem_CrtHRes
  1218: 
  1219:   public static class SMTItem_CrtIRQ extends SMTItem {
  1220:     public SMTItem_CrtIRQ () {
  1221:       super ("IRQ", CRTC.crtR09IRQRasterPort, 10);
  1222:       Multilingual.mlnToolTipText (smiNameLabel,
  1223:                       "en", "$E80012.w 9-0 IRQ raster number",
  1224:                       "ja", "$E80012.w 9-0 IRQ ラスタ番号");
  1225:     }
  1226:     @Override public void smiControlled () {
  1227:       CRTC.crtR09IRQRasterMask = smiMaskValue;
  1228:       CRTC.crtR09IRQRasterTest = smiTestValue;
  1229:       int curr = CRTC.crtR09IRQRasterMask == 0 ? CRTC.crtR09IRQRasterPort : CRTC.crtR09IRQRasterTest;
  1230:       if (CRTC.crtR09IRQRasterCurr != curr) {
  1231:         CRTC.crtR09IRQRasterCurr = curr;
  1232:         if (CRTC.CRT_RASTER_HASH_ON) {
  1233:           CRTC.crtUpdateRasterHash ();
  1234:         }
  1235:         if (RasterBreakPoint.RBP_ON) {
  1236:           RasterBreakPoint.rbpCheckIRQ ();
  1237:         }
  1238:       }
  1239:     }
  1240:   }  //class SMTItem_CrtIRQ
  1241: 
  1242:   public static class SMTItem_CrtTxX extends SMTItem {
  1243:     public SMTItem_CrtTxX () {
  1244:       super ("TxX", CRTC.crtR10TxXPort, 10);
  1245:       Multilingual.mlnToolTipText (smiNameLabel,
  1246:                       "en", "$E80014.w 9-0 Text screen x-direction scroll",
  1247:                       "ja", "$E80014.w 9-0 テキスト画面 x 方向スクロール");
  1248:     }
  1249:     @Override public void smiControlled () {
  1250:       CRTC.crtR10TxXMask = smiMaskValue;
  1251:       CRTC.crtR10TxXTest = smiTestValue;
  1252:       int curr = CRTC.crtR10TxXMask == 0 ? CRTC.crtR10TxXPort : CRTC.crtR10TxXTest;
  1253:       if (CRTC.crtR10TxXCurr != curr) {
  1254:         CRTC.crtR10TxXCurr = curr;
  1255:         CRTC.crtAllStamp += 2;
  1256:         if (XEiJ.mpuTask == null) {  //停止中
  1257:           CRTC.crtRepaint ();
  1258:         }
  1259:       }
  1260:     }
  1261:   }  //class SMTItem_CrtTxX
  1262: 
  1263:   public static class SMTItem_CrtTxY extends SMTItem {
  1264:     public SMTItem_CrtTxY () {
  1265:       super ("TxY", CRTC.crtR11TxYPort, 10);
  1266:       Multilingual.mlnToolTipText (smiNameLabel,
  1267:                       "en", "$E80016.w 9-0 Text screen y-direction scroll",
  1268:                       "ja", "$E80016.w 9-0 テキスト画面 y 方向スクロール");
  1269:     }
  1270:     @Override public void smiControlled () {
  1271:       CRTC.crtR11TxYMask = smiMaskValue;
  1272:       CRTC.crtR11TxYTest = smiTestValue;
  1273:       int curr = CRTC.crtR11TxYMask == 0 ? CRTC.crtR11TxYPort : CRTC.crtR11TxYTest;
  1274:       if (CRTC.crtR11TxYCurr != curr) {
  1275:         CRTC.crtR11TxYCurr = curr;
  1276:         CRTC.crtAllStamp += 2;
  1277:         if (XEiJ.mpuTask == null) {  //停止中
  1278:           CRTC.crtRepaint ();
  1279:         }
  1280:       }
  1281:     }
  1282:   }  //class SMTItem_CrtTxY
  1283: 
  1284:   public static class SMTItem_CrtGr0X extends SMTItem {
  1285:     public SMTItem_CrtGr0X () {
  1286:       super ("Gr0X", CRTC.crtR12GrXPort[0], 10);
  1287:       Multilingual.mlnToolTipText (smiNameLabel,
  1288:                       "en", "$E80018.w 9-0 Graphics plane 0 x-direction scroll",
  1289:                       "ja", "$E80018.w 9-0 グラフィックスプレーン 0 x 方向スクロール");
  1290:     }
  1291:     @Override public void smiControlled () {
  1292:       CRTC.crtR12GrXMask[0] = smiMaskValue;
  1293:       CRTC.crtR12GrXTest[0] = smiTestValue;
  1294:       int curr = CRTC.crtR12GrXMask[0] == 0 ? CRTC.crtR12GrXPort[0] : CRTC.crtR12GrXTest[0];
  1295:       if (CRTC.crtR12GrXCurr[0] != curr) {
  1296:         CRTC.crtR12GrXCurr[0] = curr;
  1297:         CRTC.crtAllStamp += 2;
  1298:         if (XEiJ.mpuTask == null) {  //停止中
  1299:           CRTC.crtRepaint ();
  1300:         }
  1301:       }
  1302:     }
  1303:   }  //class SMTItem_CrtGr0X
  1304: 
  1305:   public static class SMTItem_CrtGr0Y extends SMTItem {
  1306:     public SMTItem_CrtGr0Y () {
  1307:       super ("Gr0Y", CRTC.crtR13GrYPort[0], 10);
  1308:       Multilingual.mlnToolTipText (smiNameLabel,
  1309:                       "en", "$E8001A.w 9-0 Graphics plane 0 y-direction scroll",
  1310:                       "ja", "$E8001A.w 9-0 グラフィックスプレーン 0 y 方向スクロール");
  1311:     }
  1312:     @Override public void smiControlled () {
  1313:       CRTC.crtR13GrYMask[0] = smiMaskValue;
  1314:       CRTC.crtR13GrYTest[0] = smiTestValue;
  1315:       int curr = CRTC.crtR13GrYMask[0] == 0 ? CRTC.crtR13GrYPort[0] : CRTC.crtR13GrYTest[0];
  1316:       if (CRTC.crtR13GrYCurr[0] != curr) {
  1317:         CRTC.crtR13GrYCurr[0] = curr;
  1318:         CRTC.crtAllStamp += 2;
  1319:         if (XEiJ.mpuTask == null) {  //停止中
  1320:           CRTC.crtRepaint ();
  1321:         }
  1322:       }
  1323:     }
  1324:   }  //class SMTItem_CrtGr0Y
  1325: 
  1326:   public static class SMTItem_CrtGr1X extends SMTItem {
  1327:     public SMTItem_CrtGr1X () {
  1328:       super ("Gr1X", CRTC.crtR12GrXPort[1], 9);
  1329:       Multilingual.mlnToolTipText (smiNameLabel,
  1330:                       "en", "$E8001C.w 8-0 Graphics plane 0 x-direction scroll",
  1331:                       "ja", "$E8001C.w 8-0 グラフィックスプレーン 0 x 方向スクロール");
  1332:     }
  1333:     @Override public void smiControlled () {
  1334:       CRTC.crtR12GrXMask[1] = smiMaskValue;
  1335:       CRTC.crtR12GrXTest[1] = smiTestValue;
  1336:       int curr = CRTC.crtR12GrXMask[1] == 0 ? CRTC.crtR12GrXPort[1] : CRTC.crtR12GrXTest[1];
  1337:       if (CRTC.crtR12GrXCurr[1] != curr) {
  1338:         CRTC.crtR12GrXCurr[1] = curr;
  1339:         CRTC.crtAllStamp += 2;
  1340:         if (XEiJ.mpuTask == null) {  //停止中
  1341:           CRTC.crtRepaint ();
  1342:         }
  1343:       }
  1344:     }
  1345:   }  //class SMTItem_CrtGr1X
  1346: 
  1347:   public static class SMTItem_CrtGr1Y extends SMTItem {
  1348:     public SMTItem_CrtGr1Y () {
  1349:       super ("Gr1Y", CRTC.crtR13GrYPort[1], 9);
  1350:       Multilingual.mlnToolTipText (smiNameLabel,
  1351:                       "en", "$E8001E.w 8-0 Graphics plane 0 y-direction scroll",
  1352:                       "ja", "$E8001E.w 8-0 グラフィックスプレーン 0 y 方向スクロール");
  1353:     }
  1354:     @Override public void smiControlled () {
  1355:       CRTC.crtR13GrYMask[1] = smiMaskValue;
  1356:       CRTC.crtR13GrYTest[1] = smiTestValue;
  1357:       int curr = CRTC.crtR13GrYMask[1] == 0 ? CRTC.crtR13GrYPort[1] : CRTC.crtR13GrYTest[1];
  1358:       if (CRTC.crtR13GrYCurr[1] != curr) {
  1359:         CRTC.crtR13GrYCurr[1] = curr;
  1360:         CRTC.crtAllStamp += 2;
  1361:         if (XEiJ.mpuTask == null) {  //停止中
  1362:           CRTC.crtRepaint ();
  1363:         }
  1364:       }
  1365:     }
  1366:   }  //class SMTItem_CrtGr1Y
  1367: 
  1368:   public static class SMTItem_CrtGr2X extends SMTItem {
  1369:     public SMTItem_CrtGr2X () {
  1370:       super ("Gr2X", CRTC.crtR12GrXPort[2], 9);
  1371:       Multilingual.mlnToolTipText (smiNameLabel,
  1372:                       "en", "$E80020.w 8-0 Graphics plane 0 x-direction scroll",
  1373:                       "ja", "$E80020.w 8-0 グラフィックスプレーン 0 x 方向スクロール");
  1374:     }
  1375:     @Override public void smiControlled () {
  1376:       CRTC.crtR12GrXMask[2] = smiMaskValue;
  1377:       CRTC.crtR12GrXTest[2] = smiTestValue;
  1378:       int curr = CRTC.crtR12GrXMask[2] == 0 ? CRTC.crtR12GrXPort[2] : CRTC.crtR12GrXTest[2];
  1379:       if (CRTC.crtR12GrXCurr[2] != curr) {
  1380:         CRTC.crtR12GrXCurr[2] = curr;
  1381:         CRTC.crtAllStamp += 2;
  1382:         if (XEiJ.mpuTask == null) {  //停止中
  1383:           CRTC.crtRepaint ();
  1384:         }
  1385:       }
  1386:     }
  1387:   }  //class SMTItem_CrtGr2X
  1388: 
  1389:   public static class SMTItem_CrtGr2Y extends SMTItem {
  1390:     public SMTItem_CrtGr2Y () {
  1391:       super ("Gr2Y", CRTC.crtR13GrYPort[2], 9);
  1392:       Multilingual.mlnToolTipText (smiNameLabel,
  1393:                       "en", "$E80022.w 8-0 Graphics plane 0 y-direction scroll",
  1394:                       "ja", "$E80022.w 8-0 グラフィックスプレーン 0 y 方向スクロール");
  1395:     }
  1396:     @Override public void smiControlled () {
  1397:       CRTC.crtR13GrYMask[2] = smiMaskValue;
  1398:       CRTC.crtR13GrYTest[2] = smiTestValue;
  1399:       int curr = CRTC.crtR13GrYMask[2] == 0 ? CRTC.crtR13GrYPort[2] : CRTC.crtR13GrYTest[2];
  1400:       if (CRTC.crtR13GrYCurr[2] != curr) {
  1401:         CRTC.crtR13GrYCurr[2] = curr;
  1402:         CRTC.crtAllStamp += 2;
  1403:         if (XEiJ.mpuTask == null) {  //停止中
  1404:           CRTC.crtRepaint ();
  1405:         }
  1406:       }
  1407:     }
  1408:   }  //class SMTItem_CrtGr2Y
  1409: 
  1410:   public static class SMTItem_CrtGr3X extends SMTItem {
  1411:     public SMTItem_CrtGr3X () {
  1412:       super ("Gr3X", CRTC.crtR12GrXPort[3], 9);
  1413:       Multilingual.mlnToolTipText (smiNameLabel,
  1414:                       "en", "$E80024.w 8-0 Graphics plane 3 x-direction scroll",
  1415:                       "ja", "$E80024.w 8-0 グラフィックスプレーン 3 x 方向スクロール");
  1416:     }
  1417:     @Override public void smiControlled () {
  1418:       CRTC.crtR12GrXMask[3] = smiMaskValue;
  1419:       CRTC.crtR12GrXTest[3] = smiTestValue;
  1420:       int curr = CRTC.crtR12GrXMask[3] == 0 ? CRTC.crtR12GrXPort[3] : CRTC.crtR12GrXTest[3];
  1421:       if (CRTC.crtR12GrXCurr[3] != curr) {
  1422:         CRTC.crtR12GrXCurr[3] = curr;
  1423:         CRTC.crtAllStamp += 2;
  1424:         if (XEiJ.mpuTask == null) {  //停止中
  1425:           CRTC.crtRepaint ();
  1426:         }
  1427:       }
  1428:     }
  1429:   }  //class SMTItem_CrtGr3X
  1430: 
  1431:   public static class SMTItem_CrtGr3Y extends SMTItem {
  1432:     public SMTItem_CrtGr3Y () {
  1433:       super ("Gr3Y", CRTC.crtR13GrYPort[3], 9);
  1434:       Multilingual.mlnToolTipText (smiNameLabel,
  1435:                       "en", "$E80026.w 8-0 Graphics plane 3 y-direction scroll",
  1436:                       "ja", "$E80026.w 8-0 グラフィックスプレーン 3 y 方向スクロール");
  1437:     }
  1438:     @Override public void smiControlled () {
  1439:       CRTC.crtR13GrYMask[3] = smiMaskValue;
  1440:       CRTC.crtR13GrYTest[3] = smiTestValue;
  1441:       int curr = CRTC.crtR13GrYMask[3] == 0 ? CRTC.crtR13GrYPort[3] : CRTC.crtR13GrYTest[3];
  1442:       if (CRTC.crtR13GrYCurr[3] != curr) {
  1443:         CRTC.crtR13GrYCurr[3] = curr;
  1444:         CRTC.crtAllStamp += 2;
  1445:         if (XEiJ.mpuTask == null) {  //停止中
  1446:           CRTC.crtRepaint ();
  1447:         }
  1448:       }
  1449:     }
  1450:   }  //class SMTItem_CrtGr3Y
  1451: 
  1452: 
  1453:   //----------------------------------------------------------------------------------------
  1454:   //ビデオコントローラ
  1455: 
  1456:   public static class SMTItem_VcnGrMM extends SMTItem {
  1457:     public SMTItem_VcnGrMM () {
  1458:       super ("GrMM", VideoController.vcnReg1Port, 3);
  1459:       Multilingual.mlnToolTipText (smiNameLabel,
  1460:                       "en", "$E82400.w 2-0 Memory mode of graphics screen",
  1461:                       "ja", "$E82400.w 2-0 グラフィックス画面のメモリモード");
  1462:     }
  1463:     @Override public void smiControlled () {
  1464:       VideoController.vcnReg1Mask = VideoController.vcnReg1Mask & ~7 | smiMaskValue & 7;
  1465:       VideoController.vcnReg1Test = VideoController.vcnReg1Test & ~7 | smiTestValue;
  1466:       int curr = VideoController.vcnReg1Port & ~VideoController.vcnReg1Mask | VideoController.vcnReg1Test & VideoController.vcnReg1Mask;
  1467:       if (VideoController.vcnReg1Curr != curr) {
  1468:         VideoController.vcnReg1Curr = curr;
  1469:         VideoController.vcnUpdateMode ();
  1470:         if (XEiJ.mpuTask == null) {  //停止中
  1471:           CRTC.crtRepaint ();
  1472:         }
  1473:       }
  1474:     }
  1475:   }  //class SMTItem_VcnGrMM
  1476: 
  1477:   public static class SMTItem_VcnSpPr extends SMTItem {
  1478:     public SMTItem_VcnSpPr () {
  1479:       super ("SpPr", VideoController.vcnReg2Port >> 12, 2);
  1480:       Multilingual.mlnToolTipText (smiNameLabel,
  1481:                       "en", "$E82500.w 13-12 Precedence of sprite screen",
  1482:                       "ja", "$E82500.w 13-12 スプライト画面の優先順位");
  1483:     }
  1484:     @Override public void smiControlled () {
  1485:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 12) | smiMaskValue & 3 << 12;
  1486:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 12) | smiTestValue     << 12;
  1487:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1488:       if (VideoController.vcnReg2Curr != curr) {
  1489:         VideoController.vcnReg2Curr = curr;
  1490:         VideoController.vcnUpdateMode ();
  1491:         if (XEiJ.mpuTask == null) {  //停止中
  1492:           CRTC.crtRepaint ();
  1493:         }
  1494:       }
  1495:     }
  1496:   }  //class SMTItem_VcnSpPr
  1497: 
  1498:   public static class SMTItem_VcnTxPr extends SMTItem {
  1499:     public SMTItem_VcnTxPr () {
  1500:       super ("TxPr", VideoController.vcnReg2Port >> 10, 2);
  1501:       Multilingual.mlnToolTipText (smiNameLabel,
  1502:                       "en", "$E82500.w 11-10 Precedence of text screen",
  1503:                       "ja", "$E82500.w 11-10 テキスト画面の優先順位");
  1504:     }
  1505:     @Override public void smiControlled () {
  1506:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 10) | smiMaskValue & 3 << 10;
  1507:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 10) | smiTestValue     << 10;
  1508:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1509:       if (VideoController.vcnReg2Curr != curr) {
  1510:         VideoController.vcnReg2Curr = curr;
  1511:         VideoController.vcnUpdateMode ();
  1512:         if (XEiJ.mpuTask == null) {  //停止中
  1513:           CRTC.crtRepaint ();
  1514:         }
  1515:       }
  1516:     }
  1517:   }  //class SMTItem_VcnTxPr
  1518: 
  1519:   public static class SMTItem_VcnGrPr extends SMTItem {
  1520:     public SMTItem_VcnGrPr () {
  1521:       super ("GrPr", VideoController.vcnReg2Port >> 8, 2);
  1522:       Multilingual.mlnToolTipText (smiNameLabel,
  1523:                       "en", "$E82500.w 9-8 Precedence of graphics screen",
  1524:                       "ja", "$E82500.w 9-8 グラフィックス画面の優先順位");
  1525:     }
  1526:     @Override public void smiControlled () {
  1527:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 8) | smiMaskValue & 3 << 8;
  1528:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 8) | smiTestValue     << 8;
  1529:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1530:       if (VideoController.vcnReg2Curr != curr) {
  1531:         VideoController.vcnReg2Curr = curr;
  1532:         VideoController.vcnUpdateMode ();
  1533:         if (XEiJ.mpuTask == null) {  //停止中
  1534:           CRTC.crtRepaint ();
  1535:         }
  1536:       }
  1537:     }
  1538:   }  //class SMTItem_VcnGrPr
  1539: 
  1540:   public static class SMTItem_VcnG4th extends SMTItem {
  1541:     public SMTItem_VcnG4th () {
  1542:       super ("G4th", VideoController.vcnReg2Port >> 6, 2);
  1543:       Multilingual.mlnToolTipText (smiNameLabel,
  1544:                       "en", "$E82500.w 7-6 The farthest plane number of graphics screen",
  1545:                       "ja", "$E82500.w 7-6 グラフィックス画面の一番奥のプレーンの番号");
  1546:     }
  1547:     @Override public void smiControlled () {
  1548:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 6) | smiMaskValue & 3 << 6;
  1549:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 6) | smiTestValue     << 6;
  1550:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1551:       if (VideoController.vcnReg2Curr != curr) {
  1552:         VideoController.vcnReg2Curr = curr;
  1553:         VideoController.vcnUpdateMode ();
  1554:         if (XEiJ.mpuTask == null) {  //停止中
  1555:           CRTC.crtRepaint ();
  1556:         }
  1557:       }
  1558:     }
  1559:   }  //class SMTItem_VcnG4th
  1560: 
  1561:   public static class SMTItem_VcnG3rd extends SMTItem {
  1562:     public SMTItem_VcnG3rd () {
  1563:       super ("G3rd", VideoController.vcnReg2Port >> 4, 2);
  1564:       Multilingual.mlnToolTipText (smiNameLabel,
  1565:                       "en", "$E82500.w 5-4 Second-farthest plane number of graphics screen",
  1566:                       "ja", "$E82500.w 5-4 グラフィックス画面の奥から 2 番目のプレーンの番号");
  1567:     }
  1568:     @Override public void smiControlled () {
  1569:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 4) | smiMaskValue & 3 << 4;
  1570:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 4) | smiTestValue     << 4;
  1571:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1572:       if (VideoController.vcnReg2Curr != curr) {
  1573:         VideoController.vcnReg2Curr = curr;
  1574:         VideoController.vcnUpdateMode ();
  1575:         if (XEiJ.mpuTask == null) {  //停止中
  1576:           CRTC.crtRepaint ();
  1577:         }
  1578:       }
  1579:     }
  1580:   }  //class SMTItem_VcnG3rd
  1581: 
  1582:   public static class SMTItem_VcnG2nd extends SMTItem {
  1583:     public SMTItem_VcnG2nd () {
  1584:       super ("G2nd", VideoController.vcnReg2Port >> 2, 2);
  1585:       Multilingual.mlnToolTipText (smiNameLabel,
  1586:                       "en", "$E82500.w 3-2 Second-nearest plane number of graphics screen",
  1587:                       "ja", "$E82500.w 3-2 グラフィックス画面の手前から 2 番目のプレーンの番号");
  1588:     }
  1589:     @Override public void smiControlled () {
  1590:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~(3 << 2) | smiMaskValue & 3 << 2;
  1591:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~(3 << 2) | smiTestValue     << 2;
  1592:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1593:       if (VideoController.vcnReg2Curr != curr) {
  1594:         VideoController.vcnReg2Curr = curr;
  1595:         VideoController.vcnUpdateMode ();
  1596:         if (XEiJ.mpuTask == null) {  //停止中
  1597:           CRTC.crtRepaint ();
  1598:         }
  1599:       }
  1600:     }
  1601:   }  //class SMTItem_VcnG2nd
  1602: 
  1603:   public static class SMTItem_VcnG1st extends SMTItem {
  1604:     public SMTItem_VcnG1st () {
  1605:       super ("G1st", VideoController.vcnReg2Port, 2);
  1606:       Multilingual.mlnToolTipText (smiNameLabel,
  1607:                       "en", "$E82500.w 1-0 The nearest plane number of graphics screen",
  1608:                       "ja", "$E82500.w 1-0 グラフィックス画面の一番手前のプレーンの番号");
  1609:     }
  1610:     @Override public void smiControlled () {
  1611:       VideoController.vcnReg2Mask = VideoController.vcnReg2Mask & ~3 | smiMaskValue & 3;
  1612:       VideoController.vcnReg2Test = VideoController.vcnReg2Test & ~3 | smiTestValue;
  1613:       int curr = VideoController.vcnReg2Port & ~VideoController.vcnReg2Mask | VideoController.vcnReg2Test & VideoController.vcnReg2Mask;
  1614:       if (VideoController.vcnReg2Curr != curr) {
  1615:         VideoController.vcnReg2Curr = curr;
  1616:         VideoController.vcnUpdateMode ();
  1617:         if (XEiJ.mpuTask == null) {  //停止中
  1618:           CRTC.crtRepaint ();
  1619:         }
  1620:       }
  1621:     }
  1622:   }  //class SMTItem_VcnG1st
  1623: 
  1624:   public static class SMTItem_VcnAHOn extends SMTItem {
  1625:     public SMTItem_VcnAHOn () {
  1626:       super ("AHOn", VideoController.vcnReg3Port >> 14, 1);
  1627:       Multilingual.mlnToolTipText (smiNameLabel,
  1628:                       "en", "$E82600.w 14 Halftone with text palet 0",
  1629:                       "ja", "$E82600.w 14 テキストパレット 0 との半透明");
  1630:     }
  1631:     @Override public void smiControlled () {
  1632:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 14) | smiMaskValue & 1 << 14;
  1633:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 14) | smiTestValue     << 14;
  1634:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1635:       if (VideoController.vcnReg3Curr != curr) {
  1636:         VideoController.vcnReg3Curr = curr;
  1637:         VideoController.vcnUpdateMode ();
  1638:         if (XEiJ.mpuTask == null) {  //停止中
  1639:           CRTC.crtRepaint ();
  1640:         }
  1641:       }
  1642:     }
  1643:   }  //class SMTItem_VcnAHOn
  1644: 
  1645:   public static class SMTItem_VcnExOn extends SMTItem {
  1646:     public SMTItem_VcnExOn () {
  1647:       super ("ExOn", VideoController.vcnReg3Port >> 12, 1);
  1648:       Multilingual.mlnToolTipText (smiNameLabel,
  1649:                       "en", "$E82600.w 12 Extended (special priority or halftone)",
  1650:                       "ja", "$E82600.w 12 拡張 (特殊プライオリティまたは半透明)");
  1651:     }
  1652:     @Override public void smiControlled () {
  1653:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 12) | smiMaskValue & 1 << 12;
  1654:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 12) | smiTestValue     << 12;
  1655:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1656:       if (VideoController.vcnReg3Curr != curr) {
  1657:         VideoController.vcnReg3Curr = curr;
  1658:         VideoController.vcnUpdateMode ();
  1659:         if (XEiJ.mpuTask == null) {  //停止中
  1660:           CRTC.crtRepaint ();
  1661:         }
  1662:       }
  1663:     }
  1664:   }  //class SMTItem_VcnExOn
  1665: 
  1666:   public static class SMTItem_VcnHalf extends SMTItem {
  1667:     public SMTItem_VcnHalf () {
  1668:       super ("Half", VideoController.vcnReg3Port >> 11, 1);
  1669:       Multilingual.mlnToolTipText (smiNameLabel,
  1670:                       "en", "$E82600.w 11 Halftone",
  1671:                       "ja", "$E82600.w 11 半透明");
  1672:     }
  1673:     @Override public void smiControlled () {
  1674:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 11) | smiMaskValue & 1 << 11;
  1675:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 11) | smiTestValue     << 11;
  1676:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1677:       if (VideoController.vcnReg3Curr != curr) {
  1678:         VideoController.vcnReg3Curr = curr;
  1679:         VideoController.vcnUpdateMode ();
  1680:         if (XEiJ.mpuTask == null) {  //停止中
  1681:           CRTC.crtRepaint ();
  1682:         }
  1683:       }
  1684:     }
  1685:   }  //class SMTItem_VcnHalf
  1686: 
  1687:   public static class SMTItem_VcnPLSB extends SMTItem {
  1688:     public SMTItem_VcnPLSB () {
  1689:       super ("PLSB", VideoController.vcnReg3Port >> 10, 1);
  1690:       Multilingual.mlnToolTipText (smiNameLabel,
  1691:                       "en", "$E82600.w 10 Select area by LSB of palet code",
  1692:                       "ja", "$E82600.w 10 パレットコードの LSB で範囲を選択");
  1693:     }
  1694:     @Override public void smiControlled () {
  1695:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 10) | smiMaskValue & 1 << 10;
  1696:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 10) | smiTestValue     << 10;
  1697:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1698:       if (VideoController.vcnReg3Curr != curr) {
  1699:         VideoController.vcnReg3Curr = curr;
  1700:         VideoController.vcnUpdateMode ();
  1701:         if (XEiJ.mpuTask == null) {  //停止中
  1702:           CRTC.crtRepaint ();
  1703:         }
  1704:       }
  1705:     }
  1706:   }  //class SMTItem_VcnPLSB
  1707: 
  1708:   public static class SMTItem_VcnGrGr extends SMTItem {
  1709:     public SMTItem_VcnGrGr () {
  1710:       super ("GrGr", VideoController.vcnReg3Port >> 9, 1);
  1711:       Multilingual.mlnToolTipText (smiNameLabel,
  1712:                       "en", "$E82600.w 9 Halftone between the nearest graphics page and second-nearest graphics page",
  1713:                       "ja", "$E82600.w 9 一番手前のグラフィックスページと手前から 2 番目のグラフィックスページとの半透明");
  1714:     }
  1715:     @Override public void smiControlled () {
  1716:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 9) | smiMaskValue & 1 << 9;
  1717:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 9) | smiTestValue     << 9;
  1718:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1719:       if (VideoController.vcnReg3Curr != curr) {
  1720:         VideoController.vcnReg3Curr = curr;
  1721:         VideoController.vcnUpdateMode ();
  1722:         if (XEiJ.mpuTask == null) {  //停止中
  1723:           CRTC.crtRepaint ();
  1724:         }
  1725:       }
  1726:     }
  1727:   }  //class SMTItem_VcnGrGr
  1728: 
  1729:   public static class SMTItem_VcnGrST extends SMTItem {
  1730:     public SMTItem_VcnGrST () {
  1731:       super ("GrST", VideoController.vcnReg3Port >> 8, 1);
  1732:       Multilingual.mlnToolTipText (smiNameLabel,
  1733:                       "en", "$E82600.w 8 Halftone between the nearest graphics page and sprite/text screen in the back of graphics screen",
  1734:                       "ja", "$E82600.w 8 一番手前のグラフィックスページとグラフィックス画面の奥にあるスプライト/テキスト画面との半透明");
  1735:     }
  1736:     @Override public void smiControlled () {
  1737:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 8) | smiMaskValue & 1 << 8;
  1738:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 8) | smiTestValue     << 8;
  1739:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1740:       if (VideoController.vcnReg3Curr != curr) {
  1741:         VideoController.vcnReg3Curr = curr;
  1742:         VideoController.vcnUpdateMode ();
  1743:         if (XEiJ.mpuTask == null) {  //停止中
  1744:           CRTC.crtRepaint ();
  1745:         }
  1746:       }
  1747:     }
  1748:   }  //class SMTItem_VcnGrST
  1749: 
  1750:   public static class SMTItem_VcnSpOn extends SMTItem {
  1751:     public SMTItem_VcnSpOn () {
  1752:       super ("SpOn", VideoController.vcnReg3Port >> 6, 1);
  1753:       Multilingual.mlnToolTipText (smiNameLabel,
  1754:                       "en", "$E82600.w 6 Sprite screen",
  1755:                       "ja", "$E82600.w 6 スプライト画面");
  1756:     }
  1757:     @Override public void smiControlled () {
  1758:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 6) | smiMaskValue & 1 << 6;
  1759:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 6) | smiTestValue     << 6;
  1760:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1761:       if (VideoController.vcnReg3Curr != curr) {
  1762:         VideoController.vcnReg3Curr = curr;
  1763:         VideoController.vcnUpdateMode ();
  1764:         if (XEiJ.mpuTask == null) {  //停止中
  1765:           CRTC.crtRepaint ();
  1766:         }
  1767:       }
  1768:     }
  1769:   }  //class SMTItem_VcnSpOn
  1770: 
  1771:   public static class SMTItem_VcnTxOn extends SMTItem {
  1772:     public SMTItem_VcnTxOn () {
  1773:       super ("TxOn", VideoController.vcnReg3Port >> 5, 1);
  1774:       Multilingual.mlnToolTipText (smiNameLabel,
  1775:                       "en", "$E82600.w 5 Text screen",
  1776:                       "ja", "$E82600.w 5 テキスト画面");
  1777:     }
  1778:     @Override public void smiControlled () {
  1779:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 5) | smiMaskValue & 1 << 5;
  1780:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 5) | smiTestValue     << 5;
  1781:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1782:       if (VideoController.vcnReg3Curr != curr) {
  1783:         VideoController.vcnReg3Curr = curr;
  1784:         VideoController.vcnUpdateMode ();
  1785:         if (XEiJ.mpuTask == null) {  //停止中
  1786:           CRTC.crtRepaint ();
  1787:         }
  1788:       }
  1789:     }
  1790:   }  //class SMTItem_VcnTxOn
  1791: 
  1792:   public static class SMTItem_VcnGxOn extends SMTItem {
  1793:     public SMTItem_VcnGxOn () {
  1794:       super ("GxOn", VideoController.vcnReg3Port >> 4, 1);
  1795:       Multilingual.mlnToolTipText (smiNameLabel,
  1796:                       "en", "$E82600.w 4 1024x1024 graphics screen",
  1797:                       "ja", "$E82600.w 4 1024x1024 グラフィックス画面");
  1798:     }
  1799:     @Override public void smiControlled () {
  1800:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 4) | smiMaskValue & 1 << 4;
  1801:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 4) | smiTestValue     << 4;
  1802:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1803:       if (VideoController.vcnReg3Curr != curr) {
  1804:         VideoController.vcnReg3Curr = curr;
  1805:         VideoController.vcnUpdateMode ();
  1806:         if (XEiJ.mpuTask == null) {  //停止中
  1807:           CRTC.crtRepaint ();
  1808:         }
  1809:       }
  1810:     }
  1811:   }  //class SMTItem_VcnGxOn
  1812: 
  1813:   public static class SMTItem_VcnG4On extends SMTItem {
  1814:     public SMTItem_VcnG4On () {
  1815:       super ("G4On", VideoController.vcnReg3Port >> 3, 1);
  1816:       Multilingual.mlnToolTipText (smiNameLabel,
  1817:                       "en", "$E82600.w 3 512x512 graphics plane 3",
  1818:                       "ja", "$E82600.w 3 512x512 グラフィックスプレーン 3");
  1819:     }
  1820:     @Override public void smiControlled () {
  1821:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 3) | smiMaskValue & 1 << 3;
  1822:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 3) | smiTestValue     << 3;
  1823:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1824:       if (VideoController.vcnReg3Curr != curr) {
  1825:         VideoController.vcnReg3Curr = curr;
  1826:         VideoController.vcnUpdateMode ();
  1827:         if (XEiJ.mpuTask == null) {  //停止中
  1828:           CRTC.crtRepaint ();
  1829:         }
  1830:       }
  1831:     }
  1832:   }  //class SMTItem_VcnG4On
  1833: 
  1834:   public static class SMTItem_VcnG3On extends SMTItem {
  1835:     public SMTItem_VcnG3On () {
  1836:       super ("G3On", VideoController.vcnReg3Port >> 2, 1);
  1837:       Multilingual.mlnToolTipText (smiNameLabel,
  1838:                       "en", "$E82600.w 2 512x512 graphics plane 2",
  1839:                       "ja", "$E82600.w 2 512x512 グラフィックスプレーン 2");
  1840:     }
  1841:     @Override public void smiControlled () {
  1842:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 2) | smiMaskValue & 1 << 2;
  1843:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 2) | smiTestValue     << 2;
  1844:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1845:       if (VideoController.vcnReg3Curr != curr) {
  1846:         VideoController.vcnReg3Curr = curr;
  1847:         VideoController.vcnUpdateMode ();
  1848:         if (XEiJ.mpuTask == null) {  //停止中
  1849:           CRTC.crtRepaint ();
  1850:         }
  1851:       }
  1852:     }
  1853:   }  //class SMTItem_VcnG3On
  1854: 
  1855:   public static class SMTItem_VcnG2On extends SMTItem {
  1856:     public SMTItem_VcnG2On () {
  1857:       super ("G2On", VideoController.vcnReg3Port >> 1, 1);
  1858:       Multilingual.mlnToolTipText (smiNameLabel,
  1859:                       "en", "$E82600.w 1 512x512 graphics plane 1",
  1860:                       "ja", "$E82600.w 1 512x512 グラフィックスプレーン 1");
  1861:     }
  1862:     @Override public void smiControlled () {
  1863:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~(1 << 1) | smiMaskValue & 1 << 1;
  1864:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~(1 << 1) | smiTestValue     << 1;
  1865:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1866:       if (VideoController.vcnReg3Curr != curr) {
  1867:         VideoController.vcnReg3Curr = curr;
  1868:         VideoController.vcnUpdateMode ();
  1869:         if (XEiJ.mpuTask == null) {  //停止中
  1870:           CRTC.crtRepaint ();
  1871:         }
  1872:       }
  1873:     }
  1874:   }  //class SMTItem_VcnG2On
  1875: 
  1876:   public static class SMTItem_VcnG1On extends SMTItem {
  1877:     public SMTItem_VcnG1On () {
  1878:       super ("G1On", VideoController.vcnReg3Port, 1);
  1879:       Multilingual.mlnToolTipText (smiNameLabel,
  1880:                       "en", "$E82600.w 0 512x512 graphics plane 0",
  1881:                       "ja", "$E82600.w 0 512x512 グラフィックスプレーン 0");
  1882:     }
  1883:     @Override public void smiControlled () {
  1884:       VideoController.vcnReg3Mask = VideoController.vcnReg3Mask & ~1 | smiMaskValue & 1;
  1885:       VideoController.vcnReg3Test = VideoController.vcnReg3Test & ~1 | smiTestValue;
  1886:       int curr = VideoController.vcnReg3Port & ~VideoController.vcnReg3Mask | VideoController.vcnReg3Test & VideoController.vcnReg3Mask;
  1887:       if (VideoController.vcnReg3Curr != curr) {
  1888:         VideoController.vcnReg3Curr = curr;
  1889:         VideoController.vcnUpdateMode ();
  1890:         if (XEiJ.mpuTask == null) {  //停止中
  1891:           CRTC.crtRepaint ();
  1892:         }
  1893:       }
  1894:     }
  1895:   }  //class SMTItem_VcnG1On
  1896: 
  1897: 
  1898:   //----------------------------------------------------------------------------------------
  1899:   //スプライトコントローラ
  1900: 
  1901:   public static class SMTItem_SprBg0X extends SMTItem {
  1902:     public SMTItem_SprBg0X () {
  1903:       super ("Bg0X", SpriteScreen.sprReg0Bg0XPort, 10);
  1904:       Multilingual.mlnToolTipText (smiNameLabel,
  1905:                       "en", "$EB0800.w 9-0 Background 0 x-direction scroll",
  1906:                       "ja", "$EB0800.w 9-0 バックグラウンド 0 x 方向スクロール");
  1907:     }
  1908:     @Override public void smiControlled () {
  1909:       SpriteScreen.sprReg0Bg0XMask = smiMaskValue;
  1910:       SpriteScreen.sprReg0Bg0XTest = smiTestValue;
  1911:       int curr = SpriteScreen.sprReg0Bg0XMask == 0 ? SpriteScreen.sprReg0Bg0XPort : SpriteScreen.sprReg0Bg0XTest;
  1912:       if (SpriteScreen.sprReg0Bg0XCurr != curr) {
  1913:         SpriteScreen.sprReg0Bg0XCurr = curr;
  1914:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1915:           CRTC.crtAllStamp += 2;
  1916:           if (XEiJ.mpuTask == null) {  //停止中
  1917:             CRTC.crtRepaint ();
  1918:           }
  1919:         }
  1920:       }
  1921:     }
  1922:   }  //class SMTItem_SprBg0X
  1923: 
  1924:   public static class SMTItem_SprBg0Y extends SMTItem {
  1925:     public SMTItem_SprBg0Y () {
  1926:       super ("Bg0Y", SpriteScreen.sprReg1Bg0YPort, 10);
  1927:       Multilingual.mlnToolTipText (smiNameLabel,
  1928:                       "en", "$EB0802.w 9-0 Background 0 y-direction scroll",
  1929:                       "ja", "$EB0802.w 9-0 バックグラウンド 0 y 方向スクロール");
  1930:     }
  1931:     @Override public void smiControlled () {
  1932:       SpriteScreen.sprReg1Bg0YMask = smiMaskValue;
  1933:       SpriteScreen.sprReg1Bg0YTest = smiTestValue;
  1934:       int curr = SpriteScreen.sprReg1Bg0YMask == 0 ? SpriteScreen.sprReg1Bg0YPort : SpriteScreen.sprReg1Bg0YTest;
  1935:       if (SpriteScreen.sprReg1Bg0YCurr != curr) {
  1936:         SpriteScreen.sprReg1Bg0YCurr = curr;
  1937:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1938:           CRTC.crtAllStamp += 2;
  1939:           if (XEiJ.mpuTask == null) {  //停止中
  1940:             CRTC.crtRepaint ();
  1941:           }
  1942:         }
  1943:       }
  1944:     }
  1945:   }  //class SMTItem_SprBg0Y
  1946: 
  1947:   public static class SMTItem_SprBg1X extends SMTItem {
  1948:     public SMTItem_SprBg1X () {
  1949:       super ("Bg1X", SpriteScreen.sprReg2Bg1XPort, 10);
  1950:       Multilingual.mlnToolTipText (smiNameLabel,
  1951:                       "en", "$EB0804.w 9-0 Background 1 x-direction scroll",
  1952:                       "ja", "$EB0804.w 9-0 バックグラウンド 1 x 方向スクロール");
  1953:     }
  1954:     @Override public void smiControlled () {
  1955:       SpriteScreen.sprReg2Bg1XMask = smiMaskValue;
  1956:       SpriteScreen.sprReg2Bg1XTest = smiTestValue;
  1957:       int curr = SpriteScreen.sprReg2Bg1XMask == 0 ? SpriteScreen.sprReg2Bg1XPort : SpriteScreen.sprReg2Bg1XTest;
  1958:       if (SpriteScreen.sprReg2Bg1XCurr != curr) {
  1959:         SpriteScreen.sprReg2Bg1XCurr = curr;
  1960:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1961:           CRTC.crtAllStamp += 2;
  1962:           if (XEiJ.mpuTask == null) {  //停止中
  1963:             CRTC.crtRepaint ();
  1964:           }
  1965:         }
  1966:       }
  1967:     }
  1968:   }  //class SMTItem_SprBg1X
  1969: 
  1970:   public static class SMTItem_SprBg1Y extends SMTItem {
  1971:     public SMTItem_SprBg1Y () {
  1972:       super ("Bg1Y", SpriteScreen.sprReg3Bg1YPort, 10);
  1973:       Multilingual.mlnToolTipText (smiNameLabel,
  1974:                       "en", "$EB0806.w 9-0 Background 1 y-direction scroll",
  1975:                       "ja", "$EB0806.w 9-0 バックグラウンド 1 y 方向スクロール");
  1976:     }
  1977:     @Override public void smiControlled () {
  1978:       SpriteScreen.sprReg3Bg1YMask = smiMaskValue;
  1979:       SpriteScreen.sprReg3Bg1YTest = smiTestValue;
  1980:       int curr = SpriteScreen.sprReg3Bg1YMask == 0 ? SpriteScreen.sprReg3Bg1YPort : SpriteScreen.sprReg3Bg1YTest;
  1981:       if (SpriteScreen.sprReg3Bg1YCurr != curr) {
  1982:         SpriteScreen.sprReg3Bg1YCurr = curr;
  1983:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  1984:           CRTC.crtAllStamp += 2;
  1985:           if (XEiJ.mpuTask == null) {  //停止中
  1986:             CRTC.crtRepaint ();
  1987:           }
  1988:         }
  1989:       }
  1990:     }
  1991:   }  //class SMTItem_SprBg1Y
  1992: 
  1993:   public static class SMTItem_SprDisp extends SMTItem {
  1994:     public SMTItem_SprDisp () {
  1995:       super ("Disp", SpriteScreen.sprReg4BgCtrlPort >> 9, 1);
  1996:       Multilingual.mlnToolTipText (smiNameLabel,
  1997:                       "en", "$EB0808.w 9 Display sprite and background",
  1998:                       "ja", "$EB0808.w 9 スプライトとバックグラウンドを表示");
  1999:     }
  2000:     @Override public void smiControlled () {
  2001:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(1 << 9) | smiMaskValue & 1 << 9;
  2002:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(1 << 9) | smiTestValue     << 9;
  2003:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2004:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2005:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2006:         if (VideoController.vcnReg3Curr << 31 - 6 < 0) {  //スプライト画面が表示されている。DispがON→OFFのときは再描画が必要
  2007:           CRTC.crtAllStamp += 2;
  2008:           if (XEiJ.mpuTask == null) {  //停止中
  2009:             CRTC.crtRepaint ();
  2010:           }
  2011:         }
  2012:       }
  2013:     }
  2014:   }  //class SMTItem_SprDisp
  2015: 
  2016:   public static class SMTItem_SprB1Tx extends SMTItem {
  2017:     public SMTItem_SprB1Tx () {
  2018:       super ("B1Tx", SpriteScreen.sprReg4BgCtrlPort >> 4, 2);
  2019:       Multilingual.mlnToolTipText (smiNameLabel,
  2020:                       "en", "$EB0808.w 5-4 Text page assigned to background 1",
  2021:                       "ja", "$EB0808.w 5-4 バックグラウンド 1 に割り当てるテキストページ");
  2022:     }
  2023:     @Override public void smiControlled () {
  2024:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(3 << 4) | smiMaskValue & 3 << 4;
  2025:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(3 << 4) | smiTestValue     << 4;
  2026:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2027:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2028:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2029:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2030:           CRTC.crtAllStamp += 2;
  2031:           if (XEiJ.mpuTask == null) {  //停止中
  2032:             CRTC.crtRepaint ();
  2033:           }
  2034:         }
  2035:       }
  2036:     }
  2037:   }  //class SMTItem_SprB1Tx
  2038: 
  2039:   public static class SMTItem_SprB1On extends SMTItem {
  2040:     public SMTItem_SprB1On () {
  2041:       super ("B1On", SpriteScreen.sprReg4BgCtrlPort >> 3, 1);
  2042:       Multilingual.mlnToolTipText (smiNameLabel,
  2043:                       "en", "$EB0808.w 3 Background 1",
  2044:                       "ja", "$EB0808.w 3 バックグラウンド 1");
  2045:     }
  2046:     @Override public void smiControlled () {
  2047:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(1 << 3) | smiMaskValue & 1 << 3;
  2048:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(1 << 3) | smiTestValue     << 3;
  2049:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2050:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2051:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2052:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2053:           CRTC.crtAllStamp += 2;
  2054:           if (XEiJ.mpuTask == null) {  //停止中
  2055:             CRTC.crtRepaint ();
  2056:           }
  2057:         }
  2058:       }
  2059:     }
  2060:   }  //class SMTItem_SprB1On
  2061: 
  2062:   public static class SMTItem_SprB0Tx extends SMTItem {
  2063:     public SMTItem_SprB0Tx () {
  2064:       super ("B0Tx", SpriteScreen.sprReg4BgCtrlPort >> 1, 2);
  2065:       Multilingual.mlnToolTipText (smiNameLabel,
  2066:                       "en", "$EB0808.w 2-1 Text page assigned to background 0",
  2067:                       "ja", "$EB0808.w 2-1 バックグラウンド 0 に割り当てるテキストページ");
  2068:     }
  2069:     @Override public void smiControlled () {
  2070:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~(3 << 1) | smiMaskValue & 3 << 1;
  2071:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~(3 << 1) | smiTestValue     << 1;
  2072:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2073:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2074:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2075:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2076:           CRTC.crtAllStamp += 2;
  2077:           if (XEiJ.mpuTask == null) {  //停止中
  2078:             CRTC.crtRepaint ();
  2079:           }
  2080:         }
  2081:       }
  2082:     }
  2083:   }  //class SMTItem_SprB0Tx
  2084: 
  2085:   public static class SMTItem_SprB0On extends SMTItem {
  2086:     public SMTItem_SprB0On () {
  2087:       super ("B0On", SpriteScreen.sprReg4BgCtrlPort, 1);
  2088:       Multilingual.mlnToolTipText (smiNameLabel,
  2089:                       "en", "$EB0808.w 0 Background 0",
  2090:                       "ja", "$EB0808.w 0 バックグラウンド 0");
  2091:     }
  2092:     @Override public void smiControlled () {
  2093:       SpriteScreen.sprReg4BgCtrlMask = SpriteScreen.sprReg4BgCtrlMask & ~1 | smiMaskValue & 1;
  2094:       SpriteScreen.sprReg4BgCtrlTest = SpriteScreen.sprReg4BgCtrlTest & ~1 | smiTestValue;
  2095:       int curr = SpriteScreen.sprReg4BgCtrlPort & ~SpriteScreen.sprReg4BgCtrlMask | SpriteScreen.sprReg4BgCtrlTest & SpriteScreen.sprReg4BgCtrlMask;
  2096:       if (SpriteScreen.sprReg4BgCtrlCurr != curr) {
  2097:         SpriteScreen.sprReg4BgCtrlCurr = curr;
  2098:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2099:           CRTC.crtAllStamp += 2;
  2100:           if (XEiJ.mpuTask == null) {  //停止中
  2101:             CRTC.crtRepaint ();
  2102:           }
  2103:         }
  2104:       }
  2105:     }
  2106:   }  //class SMTItem_SprB0On
  2107: 
  2108:   public static class SMTItem_SprHttl extends SMTItem {
  2109:     public SMTItem_SprHttl () {
  2110:       super ("Httl", SpriteScreen.sprReg5HTotalPort, 8);
  2111:       Multilingual.mlnToolTipText (smiNameLabel,
  2112:                       "en", "$EB080A.w 7-0 Horizontal total",
  2113:                       "ja", "$EB080A.w 7-0 水平トータル");
  2114:     }
  2115:     @Override public void smiControlled () {
  2116:       SpriteScreen.sprReg5HTotalMask = smiMaskValue;
  2117:       SpriteScreen.sprReg5HTotalTest = smiTestValue;
  2118:       int curr = SpriteScreen.sprReg5HTotalMask == 0 ? SpriteScreen.sprReg5HTotalPort : SpriteScreen.sprReg5HTotalTest;
  2119:       if (SpriteScreen.sprReg5HTotalCurr != curr) {
  2120:         SpriteScreen.sprReg5HTotalCurr = curr;
  2121:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2122:           CRTC.crtAllStamp += 2;
  2123:           if (XEiJ.mpuTask == null) {  //停止中
  2124:             CRTC.crtRepaint ();
  2125:           }
  2126:         }
  2127:       }
  2128:     }
  2129:   }  //class SMTItem_SprHttl
  2130: 
  2131:   public static class SMTItem_SprHsta extends SMTItem {
  2132:     public SMTItem_SprHsta () {
  2133:       super ("Hsta", SpriteScreen.sprReg6HStartPort, 6);
  2134:       Multilingual.mlnToolTipText (smiNameLabel,
  2135:                       "en", "$EB080C.w 5-0 Horizontal display start position",
  2136:                       "ja", "$EB080C.w 5-0 水平表示開始位置");
  2137:     }
  2138:     @Override public void smiControlled () {
  2139:       SpriteScreen.sprReg6HStartMask = smiMaskValue;
  2140:       SpriteScreen.sprReg6HStartTest = smiTestValue;
  2141:       int curr = SpriteScreen.sprReg6HStartMask == 0 ? SpriteScreen.sprReg6HStartPort : SpriteScreen.sprReg6HStartTest;
  2142:       if (SpriteScreen.sprReg6HStartCurr != curr) {
  2143:         SpriteScreen.sprReg6HStartCurr = curr;
  2144:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2145:           CRTC.crtAllStamp += 2;
  2146:           if (XEiJ.mpuTask == null) {  //停止中
  2147:             CRTC.crtRepaint ();
  2148:           }
  2149:         }
  2150:       }
  2151:     }
  2152:   }  //class SMTItem_SprHsta
  2153: 
  2154:   public static class SMTItem_SprVsta extends SMTItem {
  2155:     public SMTItem_SprVsta () {
  2156:       super ("Vsta", SpriteScreen.sprReg7VStartPort, 8);
  2157:       Multilingual.mlnToolTipText (smiNameLabel,
  2158:                       "en", "$EB080E.w 7-0 Vertical display start position",
  2159:                       "ja", "$EB080E.w 7-0 垂直表示開始位置");
  2160:     }
  2161:     @Override public void smiControlled () {
  2162:       SpriteScreen.sprReg7VStartMask = smiMaskValue;
  2163:       SpriteScreen.sprReg7VStartTest = smiTestValue;
  2164:       int curr = SpriteScreen.sprReg7VStartMask == 0 ? SpriteScreen.sprReg7VStartPort : SpriteScreen.sprReg7VStartTest;
  2165:       if (SpriteScreen.sprReg7VStartCurr != curr) {
  2166:         SpriteScreen.sprReg7VStartCurr = curr;
  2167:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2168:           CRTC.crtAllStamp += 2;
  2169:           if (XEiJ.mpuTask == null) {  //停止中
  2170:             CRTC.crtRepaint ();
  2171:           }
  2172:         }
  2173:       }
  2174:     }
  2175:   }  //class SMTItem_SprVsta
  2176: 
  2177:   public static class SMTItem_SprHigh extends SMTItem {
  2178:     public SMTItem_SprHigh () {
  2179:       super ("High", SpriteScreen.sprReg8ResoPort >> 4, 1);
  2180:       Multilingual.mlnToolTipText (smiNameLabel,
  2181:                       "en", "$EB0810.w 4 High-resolution",
  2182:                       "ja", "$EB0810.w 4 高解像度");
  2183:     }
  2184:     @Override public void smiControlled () {
  2185:       SpriteScreen.sprReg8ResoMask = SpriteScreen.sprReg8ResoMask & ~(1 << 4) | smiMaskValue & 1 << 4;
  2186:       SpriteScreen.sprReg8ResoTest = SpriteScreen.sprReg8ResoTest & ~(1 << 4) | smiTestValue     << 4;
  2187:       int curr = SpriteScreen.sprReg8ResoPort & ~SpriteScreen.sprReg8ResoMask | SpriteScreen.sprReg8ResoTest & SpriteScreen.sprReg8ResoMask;
  2188:       if (SpriteScreen.sprReg8ResoCurr != curr) {
  2189:         SpriteScreen.sprReg8ResoCurr = curr;
  2190:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2191:           CRTC.crtAllStamp += 2;
  2192:           if (XEiJ.mpuTask == null) {  //停止中
  2193:             CRTC.crtRepaint ();
  2194:           }
  2195:         }
  2196:       }
  2197:     }
  2198:   }  //class SMTItem_SprHigh
  2199: 
  2200:   public static class SMTItem_SprVRes extends SMTItem {
  2201:     public SMTItem_SprVRes () {
  2202:       super ("VRes", SpriteScreen.sprReg8ResoPort >> 2, 2);
  2203:       Multilingual.mlnToolTipText (smiNameLabel,
  2204:                       "en", "$EB0810.w 3-2 Vertical resolution",
  2205:                       "ja", "$EB0810.w 3-2 垂直解像度");
  2206:     }
  2207:     @Override public void smiControlled () {
  2208:       SpriteScreen.sprReg8ResoMask = SpriteScreen.sprReg8ResoMask & ~(3 << 2) | smiMaskValue & 3 << 2;
  2209:       SpriteScreen.sprReg8ResoTest = SpriteScreen.sprReg8ResoTest & ~(3 << 2) | smiTestValue     << 2;
  2210:       int curr = SpriteScreen.sprReg8ResoPort & ~SpriteScreen.sprReg8ResoMask | SpriteScreen.sprReg8ResoTest & SpriteScreen.sprReg8ResoMask;
  2211:       if (SpriteScreen.sprReg8ResoCurr != curr) {
  2212:         SpriteScreen.sprReg8ResoCurr = curr;
  2213:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2214:           CRTC.crtAllStamp += 2;
  2215:           if (XEiJ.mpuTask == null) {  //停止中
  2216:             CRTC.crtRepaint ();
  2217:           }
  2218:         }
  2219:       }
  2220:     }
  2221:   }  //class SMTItem_SprVRes
  2222: 
  2223:   public static class SMTItem_SprHRes extends SMTItem {
  2224:     public SMTItem_SprHRes () {
  2225:       super ("HRes", SpriteScreen.sprReg8ResoPort, 2);
  2226:       Multilingual.mlnToolTipText (smiNameLabel,
  2227:                       "en", "$EB0810.w 1-0 Horizontal resolution",
  2228:                       "ja", "$EB0810.w 1-0 水平解像度");
  2229:     }
  2230:     @Override public void smiControlled () {
  2231:       SpriteScreen.sprReg8ResoMask = SpriteScreen.sprReg8ResoMask & ~3 | smiMaskValue & 3;
  2232:       SpriteScreen.sprReg8ResoTest = SpriteScreen.sprReg8ResoTest & ~3 | smiTestValue;
  2233:       int curr = SpriteScreen.sprReg8ResoPort & ~SpriteScreen.sprReg8ResoMask | SpriteScreen.sprReg8ResoTest & SpriteScreen.sprReg8ResoMask;
  2234:       if (SpriteScreen.sprReg8ResoCurr != curr) {
  2235:         SpriteScreen.sprReg8ResoCurr = curr;
  2236:         if (VideoController.vcnReg3Curr << 31 - 6 < 0 && SpriteScreen.sprReg4BgCtrlCurr << 31 - 9 < 0) {  //スプライト画面が表示されている
  2237:           CRTC.crtAllStamp += 2;
  2238:           if (XEiJ.mpuTask == null) {  //停止中
  2239:             CRTC.crtRepaint ();
  2240:           }
  2241:         }
  2242:       }
  2243:     }
  2244:   }  //class SMTItem_SprHRes
  2245: 
  2246: 
  2247:   //----------------------------------------------------------------------------------------
  2248:   //システムポート
  2249: 
  2250:   public static class SMTItem_SysHRL extends SMTItem {
  2251:     public SMTItem_SysHRL () {
  2252:       super ("HRL", CRTC.crtHRLPort, 1);
  2253:       Multilingual.mlnToolTipText (smiNameLabel,
  2254:                       "en", "$E8E007.b 1 HRL (dot clock selection)",
  2255:                       "ja", "$E8E007.b 1 HRL (ドットクロック選択)");
  2256:     }
  2257:     @Override public void smiControlled () {
  2258:       CRTC.crtHRLMask = smiMaskValue;
  2259:       CRTC.crtHRLTest = smiTestValue;
  2260:       int curr = CRTC.crtHRLMask == 0 ? CRTC.crtHRLPort : CRTC.crtHRLTest;
  2261:       if (CRTC.crtHRLCurr != curr) {
  2262:         CRTC.crtHRLCurr = curr;
  2263:         if (XEiJ.mpuTask != null) {  //動作中
  2264:           CRTC.crtRestart ();
  2265:         }
  2266:       }
  2267:     }
  2268:   }  //class SMTItem_SysHRL
  2269: 
  2270:   public static class SMTItem_SysCont extends SMTItem {
  2271:     public SMTItem_SysCont () {
  2272:       super ("Cont", VideoController.vcnTargetContrastPort, 4);
  2273:       Multilingual.mlnToolTipText (smiNameLabel,
  2274:                       "en", "$E8E001.b 3-0 Contrast",
  2275:                       "ja", "$E8E001.b 3-0 コントラスト");
  2276:     }
  2277:     @Override public void smiControlled () {
  2278:       VideoController.vcnTargetContrastMask = smiMaskValue;
  2279:       VideoController.vcnTargetContrastTest = smiTestValue;
  2280:       int curr = VideoController.vcnTargetContrastMask == 0 ? VideoController.vcnTargetContrastPort : VideoController.vcnTargetContrastTest;
  2281:       if (VideoController.vcnTargetContrastCurr != curr) {
  2282:         VideoController.vcnTargetContrastCurr = curr;
  2283:         VideoController.vcnTargetScaledContrast = VideoController.VCN_CONTRAST_SCALE * VideoController.vcnTargetContrastCurr;
  2284:         CRTC.crtContrastClock = XEiJ.mpuClockTime;
  2285:         CRTC.crtFrameTaskClock = Math.min (CRTC.crtContrastClock, CRTC.crtCaptureClock);
  2286:       }
  2287:     }
  2288:   }  //class SMTItem_SysCont
  2289: 
  2290: 
  2291: 
  2292:   //========================================================================================
  2293:   //$$SMG 表示モードテストのアイテムグループ
  2294:   //  コピーボタン
  2295:   //    ポートデータをテストデータにまとめてコピーする
  2296:   //  ポートラジオボタン
  2297:   //    まとめてポートを選択する
  2298:   //  テストラジオボタン
  2299:   //    まとめてテストを選択する
  2300:   public static class SMTGroup {
  2301: 
  2302:     public SMTItem[] smgItemArray;
  2303:     public ButtonGroup smgButtonGroup;
  2304:     public Box smgBox;
  2305:     public JRadioButton smgPortRadioButton;
  2306:     public JRadioButton smgTestRadioButton;
  2307: 
  2308:     //  コンストラクタ
  2309:     public SMTGroup (SMTItem... itemArray) {
  2310:       smgItemArray = itemArray;
  2311:       for (SMTItem item : smgItemArray) {
  2312:         item.smiItemGroup = this;
  2313:       }
  2314:       smgButtonGroup = new ButtonGroup ();
  2315:       smgBox = ComponentFactory.setFixedSize (
  2316:         ComponentFactory.createVerticalBox (
  2317:           Box.createVerticalStrut (16),
  2318:           ComponentFactory.createHorizontalBox (
  2319:             ComponentFactory.createVerticalBox (
  2320:               Box.createVerticalStrut (6),
  2321:               ComponentFactory.setFixedSize (
  2322:                 Multilingual.mlnToolTipText (
  2323:                   ComponentFactory.createImageButton (
  2324:                     XEiJ.createImage (
  2325:                       14, 18,
  2326:                       "11111111111111" +
  2327:                       "1............1" +
  2328:                       "1............1" +
  2329:                       "1............1" +
  2330:                       "1....1111....1" +
  2331:                       "1....1..1....1" +
  2332:                       "1....1..1....1" +
  2333:                       "1....1..1....1" +
  2334:                       "1....1..1....1" +
  2335:                       "1.1111..1111.1" +
  2336:                       "1..1......1..1" +
  2337:                       "1...1....1...1" +
  2338:                       "1....1..1....1" +
  2339:                       "1.....11.....1" +
  2340:                       "1............1" +
  2341:                       "1............1" +
  2342:                       "1............1" +
  2343:                       "11111111111111",
  2344:                       LnF.LNF_RGB[0],
  2345:                       LnF.LNF_RGB[12]),
  2346:                     "Copy port data to test data", new ActionListener () {
  2347:                       @Override public void actionPerformed (ActionEvent ae) {
  2348:                         smgCopyClicked ();
  2349:                       }
  2350:                     }),  //ae -> smgCopyClicked ()
  2351:                   "ja", "ポートデータをテストデータにコピーする"),
  2352:                 16, 20),
  2353:               Box.createVerticalStrut (6)
  2354:               ),
  2355:             Box.createHorizontalStrut (2),
  2356:             ComponentFactory.createVerticalBox (
  2357:               smgPortRadioButton = ComponentFactory.setFixedSize (
  2358:                 Multilingual.mlnToolTipText (
  2359:                   ComponentFactory.createRadioButton (smgButtonGroup, smgIsPortSelected (), "", new ActionListener () {
  2360:                     @Override public void actionPerformed (ActionEvent ae) {
  2361:                       smgPortSelected ();
  2362:                     }
  2363:                   }),  //ae -> smgPortSelected ()
  2364:                   "en", "Reflect port data", "ja", "ポートデータを反映させる"),
  2365:                 14, 16),
  2366:               smgTestRadioButton = ComponentFactory.setFixedSize (
  2367:                 Multilingual.mlnToolTipText (
  2368:                   ComponentFactory.createRadioButton (smgButtonGroup, smgIsTestSelected (), "", new ActionListener () {
  2369:                     @Override public void actionPerformed (ActionEvent ae) {
  2370:                       smgTestSelected ();
  2371:                     }
  2372:                   }),  //ae -> smgTestSelected ()
  2373:                   "en", "Reflect test data", "ja", "テストデータを反映させる"),
  2374:                 14, 16)
  2375:               )
  2376:             )
  2377:           ),
  2378:         32, 48);
  2379:     }  //new SMTGroup(SMTItem...)
  2380: 
  2381:     //smgIsPortSelected ()
  2382:     //  true=すべてPortが選択されている
  2383:     public boolean smgIsPortSelected () {
  2384:       for (SMTItem item : smgItemArray) {
  2385:         if (item.smiMaskValue != 0) {  //Testが選択されている
  2386:           return false;
  2387:         }
  2388:       }
  2389:       return true;
  2390:     }  //smgIsPortSelected()
  2391: 
  2392:     //smgIsTestSelected ()
  2393:     //  true=すべてTestが選択されている
  2394:     public boolean smgIsTestSelected () {
  2395:       for (SMTItem item : smgItemArray) {
  2396:         if (item.smiMaskValue == 0) {  //Portが選択されている
  2397:           return false;
  2398:         }
  2399:       }
  2400:       return true;
  2401:     }  //smgIsTestSelected()
  2402: 
  2403:     //smgCopyClicked ()
  2404:     //  コピーボタンが押された
  2405:     //  すべてのアイテムのPortをTestにコピーする
  2406:     public void smgCopyClicked () {
  2407:       for (SMTItem item : smgItemArray) {
  2408:         if (item.smiBitWidth == 1) {
  2409:           item.smiTestCheckBox.setSelected (item.smiPortValue != 0);
  2410:         } else {
  2411:           item.smiTestSpinner.setIntValue (item.smiPortValue);
  2412:         }
  2413:         item.smiTestChanged ();
  2414:       }
  2415:     }  //smgCopyClicked()
  2416: 
  2417:     //smgPortSelected ()
  2418:     //  Portが選択された
  2419:     public void smgPortSelected () {
  2420:       for (SMTItem item : smgItemArray) {
  2421:         item.smiPortRadioButton.setSelected (true);
  2422:         item.smiPortSelected ();
  2423:       }
  2424:     }  //smgPortSelected()
  2425: 
  2426:     //smgTestSelected ()
  2427:     //  Testが選択された
  2428:     public void smgTestSelected () {
  2429:       for (SMTItem item : smgItemArray) {
  2430:         item.smiTestRadioButton.setSelected (true);
  2431:         item.smiTestSelected ();
  2432:       }
  2433:     }  //smgTestSelected()
  2434: 
  2435:     //smgUpdate ()
  2436:     //  アイテム毎のPort/Testの選択が変化したときアイテムグループのPort/Testに反映させるためにアイテムが呼び出す
  2437:     public void smgUpdate () {
  2438:       if (smgIsPortSelected ()) {
  2439:         smgPortRadioButton.setSelected (true);
  2440:       } else if (smgIsTestSelected ()) {
  2441:         smgTestRadioButton.setSelected (true);
  2442:       } else {
  2443:         smgButtonGroup.clearSelection ();
  2444:       }
  2445:     }  //smgUpdate()
  2446: 
  2447:   }  //class SMTGroup
  2448: 
  2449: 
  2450: 
  2451: }  //class ScreenModeTest
  2452: 
  2453: 
  2454: