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