HDC.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18: package xeij;
19:
20: import java.awt.event.*;
21: import java.io.*;
22: import java.lang.*;
23: import java.util.*;
24: import java.util.zip.*;
25: import javax.swing.*;
26:
27: public class HDC {
28:
29: public static final boolean HDC_DEBUG_TRACE = false;
30: public static final boolean HDC_DEBUG_COMMAND = false;
31: public static final boolean HDC_DEBUG_UNIMPLEMENTED_COMMAND = true;
32:
33: public static final int HDC_BASE = 0x00e96000;
34: public static final int HDC_DATA_PORT = 0x00e96001;
35: public static final int HDC_STATUS_PORT = 0x00e96003;
36: public static final int HDC_RESET_PORT = 0x00e96005;
37: public static final int HDC_SELECTION_PORT = 0x00e96007;
38:
39: public static final int HDC_STATUS_MESSAGE = 0b10000;
40: public static final int HDC_STATUS_C_D = 0b01000;
41: public static final int HDC_STATUS_COMMAND = 0b01000;
42: public static final int HDC_STATUS_DATA = 0b00000;
43: public static final int HDC_STATUS_I_O = 0b00100;
44: public static final int HDC_STATUS_OUTPUT = 0b00000;
45: public static final int HDC_STATUS_INPUT = 0b00100;
46: public static final int HDC_STATUS_BUSY = 0b00010;
47: public static final int HDC_STATUS_FREE = 0b00000;
48: public static final int HDC_STATUS_REQUEST = 0b00001;
49:
50: public static final String[] HDC_COMMAND_NAME = (
51: "TestDriveReady" + "," +
52: "Recalibrate" + "," +
53: "" + "," +
54: "RequestSenseStatus" + "," +
55: "FormatDrive" + "," +
56: "CheckTrackFormat" + "," +
57: "FormatBlock" + "," +
58: "BadTrackFormat" + "," +
59: "Read" + "," +
60: "" + "," +
61: "Write" + "," +
62: "Seek" + "," +
63: "InitializeDriveCharacteristic" + "," +
64: "LastCorrectedBurstLength" + "," +
65: "AssignTrack" + "," +
66: "WriteSectorBuffer" + "," +
67: "ReadSectorBuffer" + "," +
68:
69: ",,,,,,,,,,,,,,," +
70: ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," +
71: ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," +
72: ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," +
73: ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," +
74: ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," +
75: ",," +
76: "AssignDrive" + "," +
77: ",,,,,,,,,,,,,,,,,,,,,,,,,,,,," +
78: ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
79: ).split (",", 256);
80:
81:
82:
83: public static JMenu hdcMenu;
84:
85:
86: public static javax.swing.filechooser.FileFilter hdcFileFilter;
87:
88:
89: public static OpenDialog hdcOpenDialog;
90: public static int hdcOpenUnit;
91: public static ArrayList<File[]> hdcOpenHistory;
92:
93:
94: public static JDialog hdcFormatDialog;
95: public static JFileChooser2 hdcFormatFileChooser;
96: public static HDMedia hdcFormatMedia;
97: public static boolean hdcFormatCopySystemFiles;
98:
99:
100: public static final HDUnit[] hdcUnitArray = new HDUnit[16];
101: public static int hdcHDMax;
102:
103: public static int hdcSelectedID;
104: public static int hdcSelectedLUN;
105: public static HDUnit hdcTargetUnit;
106: public static int hdcBusStatus;
107:
108: public static byte[] hdcReadHandle;
109: public static byte[] hdcWriteHandle;
110: public static int hdcIndex;
111: public static int hdcLimit;
112: public static final byte[] hdcCommandBuffer = new byte[6];
113: public static final byte[] hdcStatusBuffer = new byte[1];
114: public static final byte[] hdcMessageBuffer = new byte[1];
115: public static final byte[] hdcSenseBuffer = new byte[4];
116: public static final byte[] hdcAssignDriveBuffer = new byte[10];
117:
118: public static int hdcLastFormatBlodkEnd;
119:
120: public static JCheckBoxMenuItem hdcSASIMenuItem;
121:
122:
123:
124: public static void hdcInit () {
125:
126:
127:
128:
129: hdcFileFilter = new javax.swing.filechooser.FileFilter () {
130: @Override public boolean accept (File file) {
131: if (file.isDirectory ()) {
132: return true;
133: }
134: if (!file.isFile ()) {
135: return false;
136: }
137: String path = file.getPath ();
138: if (hdcIsInserted (path)) {
139: return false;
140: }
141: long longLength = file.length ();
142: for (HDMedia media : HDMedia.HDM_ARRAY) {
143: if (media.humDiskEndByte == longLength) {
144: return true;
145: }
146: }
147: return false;
148: }
149: @Override public String getDescription () {
150: return (Multilingual.mlnJapanese ?
151: "SASI ハードディスクのイメージファイル (*.HDF)" :
152: "SASI hard disk image files (*.HDF)");
153: }
154: };
155:
156:
157: hdcOpenDialog = null;
158: hdcOpenUnit = 0;
159: hdcOpenHistory = new ArrayList<File[]> ();
160: for (int i = JFileChooser2.MAXIMUM_HISTORY_COUNT - 1; 0 <= i; i--) {
161: hdcAddHistory (JFileChooser2.pathsToFiles (Settings.sgsGetString ("sahistory" + i)));
162: }
163:
164:
165:
166:
167: hdcHDMax = 0;
168: for (int u = 0; u < 16; u++) {
169: HDUnit unit = hdcUnitArray[u] = new HDUnit (u);
170: if (u == 0) {
171: unit.connect (false);
172: }
173: String path = Settings.sgsGetString ("sa" + u);
174: String hdN = Settings.sgsGetString ("hd" + u);
175: if (!(hdN.equals ("") || hdN.equals ("none"))) {
176: String hdNWithoutR = hdN.endsWith (":R") || hdN.endsWith (":r") ? hdN.substring (0, hdN.length () - 2) : hdN;
177: int dotIndex = hdNWithoutR.lastIndexOf ('.');
178: String ext = dotIndex < 0 ? "" : hdNWithoutR.substring (dotIndex + 1);
179: if (ext.equalsIgnoreCase ("HDF") ||
180: HDMedia.hdmPathToMedia (hdNWithoutR, null) != null) {
181: path = hdN;
182: Settings.sgsPutString ("hd" + u, "");
183: }
184: }
185: boolean userWriteProtect = false;
186: if (path.toUpperCase ().endsWith (":R")) {
187: path = path.substring (0, path.length () - 2);
188: userWriteProtect = true;
189: }
190: boolean hostWriteProtect = !new File (path).canWrite ();
191: if (path.length () != 0) {
192: unit.connect (true);
193: if (unit.insert (path,
194: userWriteProtect || hostWriteProtect)) {
195: hdcAddHistory (new File (path).getAbsoluteFile ());
196: }
197: }
198: }
199:
200:
201: hdcFormatDialog = null;
202: hdcFormatFileChooser = null;
203: hdcFormatMedia = HDMedia.HDM_40MB;
204: hdcFormatCopySystemFiles = true;
205:
206: hdcSelectedID = -1;
207: hdcSelectedLUN = -1;
208: hdcTargetUnit = null;
209: hdcBusStatus = HDC_STATUS_FREE;
210:
211: hdcReadHandle = null;
212: hdcWriteHandle = null;
213: hdcIndex = 0;
214: hdcLimit = 0;
215:
216:
217:
218:
219:
220:
221: hdcLastFormatBlodkEnd = -1;
222:
223: }
224:
225:
226:
227: public static void hdcTini () {
228:
229:
230: for (HDUnit unit : hdcUnitArray) {
231: unit.hduTini ();
232: }
233:
234:
235:
236: if (hdcOpenDialog != null) {
237: Settings.sgsPutOnOff ("sareadonly", hdcOpenDialog.getReadOnly ());
238: Settings.sgsPutOnOff ("saappreboot", hdcOpenDialog.getReboot ());
239: ArrayList<String> pathsList = hdcOpenDialog.getHistory ();
240: int n = pathsList.size ();
241: for (int i = 0; i < n; i++) {
242: Settings.sgsPutString ("sahistory" + i, pathsList.get (i));
243: }
244: for (int i = n; i < 16; i++) {
245: Settings.sgsPutString ("sahistory" + i, "");
246: }
247: }
248:
249:
250: for (int u = 0; u < 16; u++) {
251: AbstractUnit unit = hdcUnitArray[u];
252: Settings.sgsPutString (
253: "sa" + u,
254: unit.abuConnected && unit.abuInserted ?
255: unit.abuWriteProtected ? unit.abuPath + ":R" : unit.abuPath :
256: "");
257: }
258:
259: }
260:
261: public static void hdcMakeMenu () {
262:
263:
264: ActionListener listener = new ActionListener () {
265: @Override public void actionPerformed (ActionEvent ae) {
266: Object source = ae.getSource ();
267: String command = ae.getActionCommand ();
268: switch (command) {
269: case "Create new SASI hard disk image files":
270: hdcOpenFormatDialog ();
271: break;
272: }
273: }
274: };
275:
276:
277: hdcMenu = ComponentFactory.createMenu ("SASI");
278: ComponentFactory.addComponents (
279: hdcMenu,
280: ComponentFactory.createHorizontalBox (
281: Multilingual.mlnText (
282: ComponentFactory.createLabel ("SASI hard disk"),
283: "ja", "SASI ハードディスク")),
284: ComponentFactory.createHorizontalSeparator ()
285: );
286: for (int u = 0; u < 16; u++) {
287: hdcMenu.add (hdcUnitArray[u].getMenuBox ());
288: }
289: ComponentFactory.addComponents (
290: hdcMenu,
291: ComponentFactory.createHorizontalSeparator (),
292: hdcSASIMenuItem = ComponentFactory.setEnabled (
293: Multilingual.mlnText (ComponentFactory.createCheckBoxMenuItem (!XEiJ.currentModel.isSCSI (), "Built-in SASI port", listener), "ja", "内蔵 SASI ポート"),
294: false),
295: ComponentFactory.createHorizontalSeparator (),
296: Multilingual.mlnText (ComponentFactory.createMenuItem ("Create new SASI hard disk image files", listener),
297: "ja", "SASI ハードディスクのイメージファイルの新規作成")
298: );
299:
300: }
301:
302:
303:
304: public static boolean hdcIsInserted (String path) {
305: for (HDUnit unit : hdcUnitArray) {
306: if (unit != null &&
307: unit.abuConnected &&
308: unit.abuInserted &&
309: unit.abuPath.equals (path)) {
310: return true;
311: }
312: }
313: return false;
314: }
315:
316: static class OpenDialog extends AbstractOpenDialog {
317: public OpenDialog () {
318: super (XEiJ.frmFrame,
319: "Open SASI hard disk image files",
320: "SASI ハードディスクのイメージファイルを開く",
321: false,
322: hdcFileFilter);
323: }
324: @Override public void openFiles (File[] files, boolean reboot) {
325: hdcOpenFiles (files, reboot);
326: }
327: }
328:
329:
330:
331: public static void hdcOpenFiles (File[] list, boolean reset) {
332: boolean success = true;
333: for (int u = hdcOpenUnit, k = 0; k < list.length; ) {
334: if (16 <= u) {
335: success = false;
336: break;
337: }
338: HDUnit unit = hdcUnitArray[u];
339: if (!unit.abuConnected) {
340: u++;
341: continue;
342: }
343: File file = list[k++];
344: if (!file.isFile ()) {
345: success = false;
346: continue;
347: }
348: if (!unit.insert (file.getPath (),
349: hdcOpenDialog.getReadOnly () || !file.canWrite ())) {
350: success = false;
351: continue;
352: }
353: u++;
354: }
355: if (success) {
356: hdcAddHistory (list);
357: if (reset) {
358: XEiJ.mpuReset (0x8000 | hdcOpenUnit << 8, -1);
359: }
360: }
361: }
362:
363:
364:
365:
366: public static void hdcMakeFormatDialog () {
367:
368:
369: ActionListener listener = new ActionListener () {
370: @Override public void actionPerformed (ActionEvent ae) {
371: switch (ae.getActionCommand ()) {
372: case JFileChooser.APPROVE_SELECTION:
373: case "Start formatting":
374: {
375: File[] list = hdcFormatFileChooser.getSelectedFiles ();
376: if (list.length > 0) {
377: hdcFormatDialog.setVisible (false);
378: if (!hdcFormatFiles (list)) {
379:
380: }
381: }
382: }
383: break;
384: case JFileChooser.CANCEL_SELECTION:
385: case "Cancel":
386: hdcFormatDialog.setVisible (false);
387: break;
388: case "10MB":
389: hdcFormatMedia = HDMedia.HDM_10MB;
390: break;
391: case "20MB":
392: hdcFormatMedia = HDMedia.HDM_20MB;
393: break;
394: case "40MB":
395: hdcFormatMedia = HDMedia.HDM_40MB;
396: break;
397: case "Copy system files":
398: hdcFormatCopySystemFiles = ((JCheckBox) ae.getSource ()).isSelected ();
399: break;
400: }
401: }
402: };
403:
404:
405: hdcMakeFormatFileChooser ();
406: hdcFormatFileChooser.setFileFilter (hdcFileFilter);
407: hdcFormatFileChooser.addActionListener (listener);
408:
409:
410: ButtonGroup mediaGroup = new ButtonGroup ();
411: hdcFormatDialog = Multilingual.mlnTitle (
412: ComponentFactory.createModalDialog (
413: XEiJ.frmFrame,
414: "Create new SASI hard disk image files",
415: ComponentFactory.createBorderPanel (
416: 0, 0,
417: ComponentFactory.createVerticalBox (
418: hdcFormatFileChooser,
419: ComponentFactory.createHorizontalBox (
420: Box.createHorizontalStrut (12),
421: Box.createHorizontalGlue (),
422: ComponentFactory.createRadioButtonMenuItem (mediaGroup, hdcFormatMedia == HDMedia.HDM_10MB, "10MB", listener),
423: ComponentFactory.createRadioButtonMenuItem (mediaGroup, hdcFormatMedia == HDMedia.HDM_20MB, "20MB", listener),
424: ComponentFactory.createRadioButtonMenuItem (mediaGroup, hdcFormatMedia == HDMedia.HDM_40MB, "40MB", listener),
425: Box.createHorizontalGlue (),
426: Box.createHorizontalStrut (12)
427: ),
428: Box.createVerticalStrut (12),
429: ComponentFactory.createHorizontalBox (
430: Box.createHorizontalStrut (12),
431: Box.createHorizontalGlue (),
432: Multilingual.mlnText (ComponentFactory.createCheckBox (hdcFormatCopySystemFiles, "Copy system files", listener), "ja", "システムファイルを転送する"),
433: Box.createHorizontalGlue (),
434: Box.createHorizontalStrut (12),
435: Multilingual.mlnText (ComponentFactory.createButton ("Start formatting", KeyEvent.VK_F, listener), "ja", "フォーマットを開始する"),
436: Box.createHorizontalStrut (12),
437: Multilingual.mlnText (ComponentFactory.createButton ("Cancel", KeyEvent.VK_C, listener), "ja", "キャンセル"),
438: Box.createHorizontalStrut (12)
439: ),
440: Box.createVerticalStrut (12)
441: )
442: )
443: ),
444: "ja", "SASI ハードディスクのイメージファイルの新規作成");
445:
446: }
447:
448:
449:
450: public static void hdcMakeFormatFileChooser () {
451: if (hdcFormatFileChooser == null) {
452: hdcFormatFileChooser = new JFileChooser2 ();
453:
454: hdcFormatFileChooser.setControlButtonsAreShown (false);
455: }
456: }
457:
458:
459:
460: public static void hdcOpenFormatDialog () {
461: if (hdcFormatDialog == null) {
462: hdcMakeFormatDialog ();
463: }
464: XEiJ.pnlExitFullScreen (true);
465: hdcFormatDialog.setVisible (true);
466: }
467:
468:
469:
470:
471: public static boolean hdcFormatFiles (File[] list) {
472: boolean success = true;
473: format:
474: {
475:
476: byte[] bb = new byte[(int) hdcFormatMedia.humDiskEndByte];
477: if (!hdcFormatMedia.hdmMakeFormatData (bb, hdcFormatCopySystemFiles)) {
478: success = false;
479: break format;
480: }
481:
482: int u = 0;
483: for (File file : list) {
484: String path = file.getPath ();
485: if (true) {
486: if (!path.toUpperCase ().endsWith (".HDF")) {
487: path += path.endsWith (".") ? "hdf" : ".hdf";
488: file = new File (path);
489: }
490: }
491: if (hdcIsInserted (path)) {
492: success = false;
493: break format;
494: }
495: if (!XEiJ.rscPutFile (path, bb, 0, bb.length)) {
496: success = false;
497: break format;
498: }
499:
500: while (u < 16) {
501: HDUnit unit = hdcUnitArray[u++];
502: if (unit.abuConnected &&
503: !unit.abuInserted &&
504: unit.insert (path,
505: false)) {
506:
507: break;
508: }
509: }
510: }
511: }
512: if (success) {
513: hdcAddHistory (list);
514: }
515: return success;
516: }
517:
518:
519:
520:
521: public static void hdcAddHistory (File file) {
522: hdcAddHistory (new File[] { file });
523: }
524:
525:
526:
527: public static void hdcAddHistory (File[] files) {
528: if (hdcOpenDialog == null) {
529: hdcOpenHistory.add (files);
530: } else {
531: hdcOpenDialog.addHistory (files);
532: }
533: hdcMakeFormatFileChooser ();
534: hdcFormatFileChooser.addHistory (files);
535: hdcFormatFileChooser.selectLastFiles ();
536: }
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
577:
578:
579:
580:
581:
582:
583:
584:
585:
586:
587:
588:
589:
590:
591:
592:
593: public static int hdcPeekStatus () {
594: return hdcBusStatus;
595: }
596:
597:
598:
599: public static int hdcReadStatus () {
600: int d = hdcBusStatus;
601: if (HDC_DEBUG_TRACE) {
602: System.out.printf ("%08x hdcReadStatus(%d,%d)=%02x\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, d);
603: }
604: return d;
605: }
606:
607:
608:
609: public static void hdcWriteSelect (int d) {
610: d &= 255;
611: if (HDC_DEBUG_TRACE) {
612: System.out.printf ("%08x hdcWriteSelect(%02x)\n", XEiJ.regPC0, d);
613: }
614: if (d == 0) {
615: return;
616: }
617:
618: hdcSelectedID = Integer.numberOfTrailingZeros (d);
619: hdcSelectedLUN = -1;
620: hdcBusStatus = HDC_STATUS_BUSY;
621: }
622:
623:
624:
625: public static void hdcWriteCommand (int d) {
626: d &= 255;
627: if (HDC_DEBUG_TRACE) {
628: System.out.printf ("%08x hdcWriteCommand(%d,%d,%02x)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, d);
629: }
630:
631: hdcWriteHandle = hdcCommandBuffer;
632: hdcIndex = 0;
633: hdcLimit = 6;
634: hdcBusStatus = HDC_STATUS_COMMAND | HDC_STATUS_OUTPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST;
635: HD63450.dmaFallPCL (1);
636: }
637:
638:
639:
640: public static void hdcWriteReset (int d) {
641: d &= 255;
642: if (HDC_DEBUG_TRACE) {
643: System.out.printf ("%08x hdcWriteReset(%d,%d,%02x)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, d);
644: }
645:
646: hdcBusFreePhase ();
647: }
648:
649:
650:
651: public static int hdcPeekData () {
652: return (hdcReadHandle == null ? 0 :
653: hdcReadHandle[hdcIndex] & 255);
654: }
655:
656:
657:
658: public static int hdcReadData () {
659: if (hdcReadHandle == null) {
660: if (HDC_DEBUG_TRACE) {
661: System.out.printf ("%08x hdcReadData(%d,%d)=%02x\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, 0);
662: }
663: return 0;
664: }
665: int d = hdcReadHandle[hdcIndex++] & 255;
666: if (HDC_DEBUG_TRACE) {
667: System.out.printf ("%08x hdcReadData(%d,%d)=%02x\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, d);
668: }
669: if (hdcIndex < hdcLimit) {
670: HD63450.dmaFallPCL (1);
671: } else if (hdcBusStatus == (HDC_STATUS_INPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST)) {
672:
673: hdcStatusPhase (0, 0);
674: } else if (hdcBusStatus == (HDC_STATUS_COMMAND | HDC_STATUS_INPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST)) {
675:
676: hdcReadHandle = hdcMessageBuffer;
677: hdcWriteHandle = null;
678: hdcIndex = 0;
679: hdcLimit = 1;
680: hdcBusStatus = HDC_STATUS_MESSAGE | HDC_STATUS_COMMAND | HDC_STATUS_INPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST;
681: HD63450.dmaFallPCL (1);
682: } else {
683:
684: hdcBusFreePhase ();
685: IOInterrupt.ioiHdcFall ();
686: IOInterrupt.ioiHdcRise ();
687: }
688: return d;
689: }
690:
691:
692:
693: public static void hdcWriteData (int d) {
694: d &= 255;
695: if (HDC_DEBUG_TRACE) {
696: System.out.printf ("%08x hdcWriteData(%d,%d,%02x)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, d);
697: }
698: if (hdcWriteHandle == null) {
699: return;
700: }
701: hdcWriteHandle[hdcIndex++] = (byte) d;
702: if (hdcIndex < hdcLimit) {
703: HD63450.dmaFallPCL (1);
704: } else if (hdcBusStatus == (HDC_STATUS_OUTPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST)) {
705: if (hdcWriteHandle == hdcAssignDriveBuffer) {
706: if (HDC_DEBUG_COMMAND) {
707: System.out.printf ("%08x SASI AssignDrive[", XEiJ.regPC0);
708: for (int i = 0; i < 10; i++) {
709: if (i > 0) {
710: System.out.print (',');
711: }
712: System.out.printf ("0x%02x", hdcAssignDriveBuffer[i] & 255);
713: }
714: System.out.println (']');
715: }
716:
717: }
718:
719: hdcStatusPhase (0, 0);
720: } else {
721: int cmd = hdcCommandBuffer[0] & 255;
722: if (HDC_DEBUG_COMMAND) {
723: String name = cmd < HDC_COMMAND_NAME.length ? HDC_COMMAND_NAME[cmd] : "";
724: if (name.length () == 0) {
725: name = "???";
726: }
727: System.out.printf ("%08x SASI %s(", XEiJ.regPC0, name);
728: for (int i = 0; i < hdcLimit; i++) {
729: if (i > 0) {
730: System.out.print (',');
731: }
732: System.out.printf ("0x%02x", hdcCommandBuffer[i] & 255);
733: }
734: System.out.println (')');
735: }
736: hdcSelectedLUN = hdcCommandBuffer[1] >> 5 & 7;
737: if (hdcSelectedLUN > 1) {
738:
739: hdcSenseBuffer[0] = 0x20;
740: hdcStatusPhase (2, 0);
741: return;
742: }
743: hdcTargetUnit = hdcUnitArray[hdcSelectedID << 1 | hdcSelectedLUN];
744: if (!hdcTargetUnit.abuInserted) {
745:
746: hdcSenseBuffer[0] = 0x20;
747: hdcStatusPhase (2, 0);
748: return;
749: }
750: if (hdcLastFormatBlodkEnd >= 0 && cmd != 0x06) {
751: HDMedia media = HDMedia.hdmLengthToMedia (hdcLastFormatBlodkEnd);
752: if (media != null) {
753: hdcTargetUnit.hduMedia = media;
754:
755: }
756: hdcLastFormatBlodkEnd = -1;
757: }
758: switch (cmd) {
759: case 0x00:
760: hdcDoTestDriveReady ();
761: break;
762: case 0x01:
763: hdcDoRecalibrate ();
764: break;
765: case 0x03:
766: hdcDoRequestSenseStatus ();
767: break;
768: case 0x04:
769: hdcDoFormatDrive ();
770: break;
771:
772: case 0x06:
773: hdcDoFormatBlock ();
774: break;
775:
776: case 0x08:
777: hdcDoRead ();
778: break;
779: case 0x0a:
780: hdcDoWrite ();
781: break;
782: case 0x0b:
783: hdcDoSeek ();
784: break;
785:
786:
787:
788:
789:
790: case 0xc2:
791: hdcDoAssignDrive ();
792: break;
793: default:
794: if (HDC_DEBUG_UNIMPLEMENTED_COMMAND) {
795: StringBuilder sb = new StringBuilder ();
796: String name = cmd < HDC_COMMAND_NAME.length ? HDC_COMMAND_NAME[cmd] : "";
797: if (name.length () == 0) {
798: name = "???";
799: }
800: sb.append (String.format ("%08x SASI %s(", XEiJ.regPC0, name));
801: for (int i = 0; i < hdcLimit; i++) {
802: if (i > 0) {
803: sb.append (',');
804: }
805: sb.append (String.format ("0x%02x", hdcCommandBuffer[i] & 255));
806: }
807: sb.append (')');
808: System.out.println (sb.toString ());
809: }
810:
811: hdcSenseBuffer[0] = 0x20;
812: hdcStatusPhase (2, 0);
813: }
814: }
815: }
816:
817:
818: public static void hdcDoTestDriveReady () {
819: if (HDC_DEBUG_TRACE) {
820: System.out.printf ("%08x hdcDoTestDriveReady(%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN);
821: }
822:
823: hdcStatusPhase (0, 0);
824: }
825:
826:
827: public static void hdcDoRecalibrate () {
828: if (HDC_DEBUG_TRACE) {
829: System.out.printf ("%08x hdcDoRecalibrate(%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN);
830: }
831:
832: hdcStatusPhase (0, 0);
833: }
834:
835:
836: public static void hdcDoRequestSenseStatus () {
837: if (HDC_DEBUG_TRACE) {
838: System.out.printf ("%08x hdcDoRequestSenseStatus(%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN);
839: }
840:
841: hdcReadHandle = hdcSenseBuffer;
842: hdcIndex = 0;
843: hdcLimit = 4;
844: hdcBusStatus = HDC_STATUS_INPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST;
845: HD63450.dmaFallPCL (1);
846: }
847:
848:
849: public static void hdcDoFormatDrive () {
850: if (HDC_DEBUG_TRACE) {
851: System.out.printf ("%08x hdcDoFormatDrive(%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN);
852: }
853: if (!hdcTargetUnit.abuInserted || hdcTargetUnit.hduMedia == null ||
854: hdcTargetUnit.abuWriteProtected) {
855:
856: hdcSenseBuffer[0] = 0x20;
857: hdcStatusPhase (2, 0);
858: return;
859: }
860: hdcTargetUnit.hduWritten = true;
861:
862: Arrays.fill (hdcTargetUnit.hduImage, 0, (int) hdcTargetUnit.hduMedia.humDiskEndByte, (byte) 0);
863:
864: hdcStatusPhase (0, 0);
865: }
866:
867:
868:
869: public static void hdcDoFormatBlock () {
870: int i = (hdcCommandBuffer[1] & 31) << 16 | (char) (hdcCommandBuffer[2] << 8 | hdcCommandBuffer[3] & 255);
871: int n = 33;
872: if (HDC_DEBUG_TRACE) {
873: System.out.printf ("%08x hdcDoFormatBlock(%d,%d,%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, i, n);
874: }
875: if (!hdcTargetUnit.abuInserted || hdcTargetUnit.hduMedia == null ||
876: hdcTargetUnit.abuWriteProtected) {
877:
878: hdcSenseBuffer[0] = 0x20;
879: hdcStatusPhase (2, 0);
880: return;
881: }
882: int l = i + n;
883: if (hdcTargetUnit.hduMedia.hdmDiskEndRecord < l) {
884:
885: hdcSenseBuffer[0] = 0x21;
886: hdcStatusPhase (2, 0);
887: return;
888: }
889: int begin = hdcTargetUnit.hduMedia.hdmBytesPerRecord * i;
890: int end = hdcTargetUnit.hduMedia.hdmBytesPerRecord * l;
891: hdcLastFormatBlodkEnd = end;
892: hdcTargetUnit.hduWritten = true;
893:
894: Arrays.fill (hdcTargetUnit.hduImage, begin, end, (byte) 0);
895:
896: hdcStatusPhase (0, 0);
897: }
898:
899:
900: public static void hdcDoRead () {
901: int i = (hdcCommandBuffer[1] & 31) << 16 | (char) (hdcCommandBuffer[2] << 8 | hdcCommandBuffer[3] & 255);
902: int n = hdcCommandBuffer[4] & 255;
903: if (n == 0) {
904: n = 256;
905: }
906: if (HDC_DEBUG_TRACE) {
907: System.out.printf ("%08x hdcDoRead(%d,%d,%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, i, n);
908: }
909: if (!hdcTargetUnit.abuInserted || hdcTargetUnit.hduMedia == null) {
910:
911: hdcSenseBuffer[0] = 0x20;
912: hdcStatusPhase (2, 0);
913: return;
914: }
915: int l = i + n;
916: if (hdcTargetUnit.hduMedia.hdmDiskEndRecord < l) {
917:
918: hdcSenseBuffer[0] = 0x21;
919: hdcStatusPhase (2, 0);
920: return;
921: }
922:
923: hdcReadHandle = hdcTargetUnit.hduImage;
924: hdcIndex = hdcTargetUnit.hduMedia.hdmBytesPerRecord * i;
925: hdcLimit = hdcTargetUnit.hduMedia.hdmBytesPerRecord * l;
926: hdcBusStatus = HDC_STATUS_INPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST;
927: HD63450.dmaFallPCL (1);
928: }
929:
930:
931: public static void hdcDoWrite () {
932: int i = (hdcCommandBuffer[1] & 31) << 16 | (char) (hdcCommandBuffer[2] << 8 | hdcCommandBuffer[3] & 255);
933: int n = hdcCommandBuffer[4] & 255;
934: if (n == 0) {
935: n = 256;
936: }
937: if (HDC_DEBUG_TRACE) {
938: System.out.printf ("%08x hdcDoWrite(%d,%d,%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, i, n);
939: }
940: if (!hdcTargetUnit.abuInserted || hdcTargetUnit.hduMedia == null ||
941: hdcTargetUnit.abuWriteProtected) {
942:
943: hdcSenseBuffer[0] = 0x20;
944: hdcStatusPhase (2, 0);
945: return;
946: }
947: int l = i + n;
948: if (hdcTargetUnit.hduMedia.hdmDiskEndRecord < l) {
949:
950: hdcSenseBuffer[0] = 0x21;
951: hdcStatusPhase (2, 0);
952: return;
953: }
954: hdcTargetUnit.hduWritten = true;
955:
956: hdcWriteHandle = hdcTargetUnit.hduImage;
957: hdcIndex = hdcTargetUnit.hduMedia.hdmBytesPerRecord * i;
958: hdcLimit = hdcTargetUnit.hduMedia.hdmBytesPerRecord * l;
959: hdcBusStatus = HDC_STATUS_OUTPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST;
960: HD63450.dmaFallPCL (1);
961: }
962:
963:
964: public static void hdcDoSeek () {
965: int i = (hdcCommandBuffer[1] & 31) << 16 | (char) (hdcCommandBuffer[2] << 8 | hdcCommandBuffer[3] & 255);
966: if (HDC_DEBUG_TRACE) {
967: System.out.printf ("%08x hdcDoSeek(%d,%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN, i);
968: }
969: if (!hdcTargetUnit.abuInserted || hdcTargetUnit.hduMedia == null) {
970:
971: hdcSenseBuffer[0] = 0x20;
972: hdcStatusPhase (2, 0);
973: return;
974: }
975: if (hdcTargetUnit.hduMedia.hdmDiskEndRecord <= i) {
976:
977: hdcSenseBuffer[0] = 0x21;
978: hdcStatusPhase (2, 0);
979: return;
980: }
981:
982: hdcStatusPhase (0, 0);
983: }
984:
985:
986: public static void hdcDoAssignDrive () {
987: if (HDC_DEBUG_TRACE) {
988: System.out.printf ("%08x hdcDoAssignDrive(%d,%d)\n", XEiJ.regPC0, hdcSelectedID, hdcSelectedLUN);
989: }
990:
991: hdcWriteHandle = hdcAssignDriveBuffer;
992: hdcIndex = 0;
993: hdcLimit = 10;
994: hdcBusStatus = HDC_STATUS_OUTPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST;
995: HD63450.dmaFallPCL (1);
996: }
997:
998:
999:
1000:
1001:
1002: public static void hdcStatusPhase (int status, int message) {
1003: hdcStatusBuffer[0] = (byte) status;
1004: hdcMessageBuffer[0] = (byte) message;
1005: hdcReadHandle = hdcStatusBuffer;
1006: hdcWriteHandle = null;
1007: hdcIndex = 0;
1008: hdcLimit = 1;
1009: hdcBusStatus = HDC_STATUS_COMMAND | HDC_STATUS_INPUT | HDC_STATUS_BUSY | HDC_STATUS_REQUEST;
1010: HD63450.dmaFallPCL (1);
1011: }
1012:
1013:
1014:
1015: public static void hdcBusFreePhase () {
1016: hdcSelectedID = -1;
1017: hdcSelectedLUN = -1;
1018: hdcTargetUnit = null;
1019: hdcBusStatus = HDC_STATUS_FREE;
1020: hdcReadHandle = null;
1021: hdcWriteHandle = null;
1022: hdcIndex = 0;
1023: hdcLimit = 0;
1024: HD63450.dmaRisePCL (1);
1025: }
1026:
1027:
1028:
1029:
1030:
1031:
1032:
1033:
1034:
1035:
1036:
1037:
1038:
1039:
1040:
1041:
1042:
1043:
1044:
1045:
1046:
1047:
1048:
1049:
1050:
1051:
1052:
1053:
1054:
1055:
1056:
1057:
1058:
1059:
1060:
1061:
1062:
1063:
1064:
1065:
1066:
1067:
1068:
1069:
1070:
1071:
1072:
1073:
1074:
1075:
1076:
1077:
1078:
1079:
1080:
1081:
1082:
1083:
1084:
1085:
1086:
1087:
1088:
1089:
1090:
1091:
1092:
1093:
1094:
1095:
1096:
1097:
1098:
1099:
1100:
1101:
1102:
1103:
1104:
1105: public static final byte[] HDC_DISK_IPL = "`\0\0\312\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32\33[6;32HX68000 HARD DISK IPL MENU\33[25;22H\203J\201[\203\\\203\213\203L\201[\202\305\221I\221\360\202\265\202\304\203\212\203^\201[\203\223\203L\201[\202\360\211\237\202\265\202\304\202\255\202\276\202\263\202\242\0\33[26;28H\221I\221\360\202\265\202\275\202\340\202\314\202\360\216\251\223\256\213N\223\256\202\306\202\265\202\304\223o\230^\202\265\202\334\202\267\0\0O\372\3772B\205 <\0\0\0\216NO\36\0\341Gt\4&<\0\0\1\0C\372\2\306a\0\0022J\0f\0\1jC\372\2\270G\372\377\n\f\221X68Kf\0\1lt\16BCBDB\206C\351\0\20J\21g\26RF&\311\20)\0\b\b\0\0\0f\bRCJ\0f\2RDQ\312\377\340JCg\0\1Br\np\4NO\b\0\0\4f\22JDg\16SDg\34C\372\376\364a\0\1\304`(C\372\376\352a\0\1\272C\372\377>a\0\1\262`\24G\372\376\234 [$(\0\bJ(\0\bf\364`\0\0\276z\2BCE\372\376\204\"R\20)\0\bg\n\260\5g\6r\2a\0\1va\0\1\26X\212RC\266Fe\342`*a\0\1\6a\0\0\362\260<\0\35g:\260<\0005g\f\260<\0<g\32\260<\0>f\344a\0\0\350RC\266Fe\2BCa\0\0\262f\362`\314a\0\0\324SCj\0046\6SCa\0\0\236f\362`\270G\372\376\30\345C s0\0$(\0\bJ\5g:C\372\1\270r\16C\351\0\20J)\377\370g\22 \21\b\0\0\30f\nB\21\264\200g\4\22\274\0\2Q\311\377\342/\2t\4&<\0\0\1\0C\372\1\200a\0\0\350$\37\304\274\0\377\377\377&<\0\0\4\0C\372\375\274\323\374\0\0\4\0a\0\0\320J\0f\b\f\21\0`f\"N\321E\372\0\332C\372\0\314a\0\0\256\"Ja\0\0\250`\376E\372\0\343`\352E\372\0\372`\344E\372\1\21`\336A\372\375\200 \3\345@ p\0\0\20(\0\b\260\5g\2J\0NuB\200NO\340H\260<\0Nf\2p\35NuaZC\372\375V0\3\345@C\361\0\0r$t\t\324Cp#NO\"Qr(aF$\tA\372\0\342\224\210\350\212\204\374\0\n\324\274\0000\0000r \264|\0000g\0022\2a&HB2\2a r)a\34r a\30t\7BA\22\31a\20Q\312\377\370r\3`\2r\13p\"NONup NONup!NONupE`\2pFH\347x@2\7NOL\337\2\36Nu\32\33[16;33H\0 \203n\201[\203h\203f\203B\203X\203N\202\252\223\307\202\337\202\334\202\271\202\361\0 \212\307\227\235\203u\203\215\203b\203N\202\252\211\363\202\352\202\304\202\242\202\334\202\267\0 \213N\223\256\211\302\224\\\202\310\227\314\210\346\202\252\202\240\202\350\202\334\202\271\202\361\0\202h\202o\202k\203u\203\215\203b\203N\202\314\223\340\227e\202\252\210\331\217\355\202\305\202\267\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".getBytes (XEiJ.ISO_8859_1);
1106:
1107:
1108:
1109:
1110:
1111:
1112:
1113:
1114:
1115:
1116:
1117:
1118:
1119:
1120:
1121:
1122:
1123:
1124:
1125:
1126:
1127:
1128:
1129:
1130:
1131:
1132:
1133:
1134:
1135:
1136:
1137:
1138:
1139:
1140:
1141:
1142:
1143:
1144:
1145:
1146:
1147:
1148:
1149:
1150:
1151:
1152:
1153:
1154:
1155:
1156:
1157:
1158:
1159:
1160:
1161:
1162:
1163:
1164:
1165:
1166:
1167:
1168:
1169:
1170:
1171:
1172:
1173:
1174:
1175:
1176:
1177:
1178:
1179: public static final byte[] HDC_PARTITION_IPL = "` Hudson soft 2.00\4\0\1\2\0\1\2\0\'r\370\24\0\0\0\0O\372\377\334C\372\0014a\0\1* <\0\0\0\216NO\22\0\341AB\202\24:\377\337B\200\20:\377\321\304\300B\2000:\377\312\324\200\345\202\324\272\377\312&<\0\0\4\0C\372\1\232a\0\0\310J\0f\0\0\320C\372\1\214<<\0\37$IG\372\1u~\n\20\32\200<\0 \260\33f\6Q\317\377\364`\24\323\374\0\0\0 Q\316\377\340C\372\0\310a\0\0\274`\376B\2000)\0\32\341XU@B\207\36:\377h\300\307\345\200\324\200B\2000:\377`\353\200\320\274\0\0\3\377\340\210\344\210\345\200\324\200H\347`\0C\372\1(&<\0\0\1\0aPL\337\0\6J\0fVC\372\1\24\fYHUfVT\211\f\231\0\0h\0fV/\31&\31\326\231/\3/\31\"|\0\0g\300\326\274\0\0\0@a\34\"\37$\37\"_J\0f A\371\0\0h\0\321\302S\201e\4B\30`\370N\321H\347x@pFNOL\337\2\36NuC\372\0Ha\30`\0\377\\C\372\0]a\16`\0\377RC\372\0ua\4`\0\377Hp!NONu\32\0\33[16;35HHuman.sys \202\252 \214\251\202\302\202\251\202\350\202\334\202\271\202\361\0\33[16;38H\203f\203B\203X\203N\202\252\201@\223\307\202\337\202\334\202\271\202\361\0\33[16;36HHuman.sys \202\252 \211\363\202\352\202\304\202\242\202\334\202\267\0\33[16;33HHuman.sys \202\314 \203A\203h\203\214\203X\202\252\210\331\217\355\202\305\202\267\0human sys\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".getBytes (XEiJ.ISO_8859_1);
1180:
1181:
1182:
1183:
1184:
1185:
1186: public static class HDUnit extends AbstractUnit {
1187:
1188: public HDMedia hduMedia;
1189: public byte[] hduImage;
1190: public boolean hduWritten;
1191:
1192:
1193:
1194: public HDUnit (int number) {
1195: super (number);
1196: hduImage = null;
1197: hduWritten = false;
1198: }
1199:
1200:
1201:
1202:
1203: public void hduTini () {
1204: if (abuInserted) {
1205: hduFlush ();
1206: }
1207: }
1208:
1209:
1210:
1211: public boolean hduFlush () {
1212: if (!hduWritten) {
1213: return true;
1214: }
1215: if (abuWriteProtected) {
1216: return false;
1217: }
1218: if (!XEiJ.rscPutFile (abuPath, hduImage, 0, (int) hduMedia.humDiskEndByte)) {
1219: return false;
1220: }
1221: hduWritten = false;
1222: return true;
1223: }
1224:
1225:
1226:
1227: @Override protected void connect (boolean disconnectable) {
1228: super.connect (disconnectable);
1229: hduImage = new byte[HDMedia.HDM_MAX_BYTES_PER_DISK];
1230: hduWritten = false;
1231: }
1232:
1233:
1234:
1235: @Override protected void disconnect () {
1236: super.disconnect ();
1237: hduImage = null;
1238: }
1239:
1240:
1241:
1242: @Override protected boolean eject () {
1243: if (!hduFlush ()) {
1244: return false;
1245: }
1246: String path = abuPath;
1247: if (!super.eject ()) {
1248: return false;
1249: }
1250: if (hduMedia != null) {
1251: hdcAddHistory (new File (path).getAbsoluteFile ());
1252: System.out.println (Multilingual.mlnJapanese ?
1253: path + " を sa" + abuNumber + " から切り離しました" :
1254: path + " was removed from sa" + abuNumber);
1255: }
1256: hduMedia = null;
1257:
1258: if (hdcHDMax == abuNumber - 1) {
1259: int u = abuNumber - 1;
1260: while (u >= 0 && !hdcUnitArray[u].abuInserted) {
1261: u--;
1262: }
1263: hdcHDMax = u + 1;
1264: }
1265: return true;
1266: }
1267:
1268:
1269:
1270: @Override protected boolean open () {
1271: if (!super.open ()) {
1272: return false;
1273: }
1274: hdcOpenUnit = abuNumber;
1275: if (hdcOpenDialog == null) {
1276: hdcOpenDialog = new OpenDialog ();
1277: hdcOpenDialog.setReadOnly (Settings.sgsGetOnOff ("sareadonly"));
1278: hdcOpenDialog.setReboot (Settings.sgsGetOnOff ("saappreboot"));
1279: for (File[] files : hdcOpenHistory) {
1280: hdcOpenDialog.addHistory (files);
1281: }
1282: hdcOpenHistory.clear ();
1283: }
1284: hdcOpenDialog.rescanCurrentDirectory ();
1285: XEiJ.pnlExitFullScreen (true);
1286: hdcOpenDialog.setVisible (true);
1287: return true;
1288: }
1289:
1290:
1291:
1292: @Override protected boolean insert (String path, boolean writeProtected) {
1293: if (hdcIsInserted (path)) {
1294: return false;
1295: }
1296: if (!super.insert (path, writeProtected)) {
1297: return false;
1298: }
1299:
1300: if (hdcHDMax <= abuNumber) {
1301: hdcHDMax = abuNumber + 1;
1302: }
1303: return true;
1304: }
1305:
1306:
1307:
1308: @Override protected boolean load (String path) {
1309: hduMedia = HDMedia.hdmPathToMedia (path, hduImage);
1310: if (hduMedia == null) {
1311: return false;
1312: }
1313: hduWritten = false;
1314: hdcAddHistory (new File (path).getAbsoluteFile ());
1315: System.out.println (Multilingual.mlnJapanese ?
1316: path + " を sa" + abuNumber + " に接続しました" :
1317: path + " was connected to sa" + abuNumber);
1318: return true;
1319: }
1320:
1321: }
1322:
1323:
1324:
1325: }
1326:
1327:
1328: