Re: [hatari-devel] SCC-B support

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 1/1/19 7:33 PM, Thomas Huth wrote:
While trying to implement separate options for SCC input and output, I
had to discover that SCC input is not working at all yet (at least it
does not work in the terminal program "Rufus"). Not sure what is
missing here yet, maybe the emulation of interrupts? Anyway, I don't
have time to work on the SCC in the upcoming weeks, so I limited the
emulation to output only now (with the "--scc-b-out" parameter). If
anybody feels like implementing input or channel A support, feel free
to do so - I won't touch this code in the upcoming month anymore, I
think.

Are the names now stable enough that I could add rest of
the configuration stuff?

Without configuration file support, e.g. TOS bootup tester
won't work with Falcon, as it cannot communicate through
serial without SCC-B output being configured.

(Attached patch lists things that need to be touched in addition
to the SDL & Mac GUIs.  I could e.g. commit SCC-B output part of
that for now and leave input until somebody has time to debug it.)


	- Eero

diff -r 4c4bd8970304 src/configuration.c
--- a/src/configuration.c	Tue Jan 01 18:25:30 2019 +0100
+++ b/src/configuration.c	Sat Jan 05 01:16:34 2019 +0200
@@ -546,6 +546,9 @@
 	{ "bEnableRS232", Bool_Tag, &ConfigureParams.RS232.bEnableRS232 },
 	{ "szOutFileName", String_Tag, ConfigureParams.RS232.szOutFileName },
 	{ "szInFileName", String_Tag, ConfigureParams.RS232.szInFileName },
+	{ "bEnableSccB", Bool_Tag, &ConfigureParams.RS232.bEnableSccB },
+	{ "sSccBOutFileName", String_Tag, ConfigureParams.RS232.sSccBOutFileName },
+	{ "sSccBInFileName", String_Tag, ConfigureParams.RS232.sSccBInFileName },
 	{ NULL , Error_Tag, NULL }
 };
 
@@ -778,10 +781,14 @@
 	sprintf(ConfigureParams.Printer.szPrintToFileName, "%s%chatari.prn",
 	        psHomeDir, PATHSEP);
 
-	/* Set defaults for RS232 */
+	/* Set defaults for MFP RS232 (ST/MegaST/STE/MegaSTE/TT) */
 	ConfigureParams.RS232.bEnableRS232 = false;
 	strcpy(ConfigureParams.RS232.szOutFileName, "/dev/modem");
 	strcpy(ConfigureParams.RS232.szInFileName, "/dev/modem");
+	/* Set defaults for SCC RS232 ( MegaSTE/TT/Falcon) */
+	ConfigureParams.RS232.bEnableSccB = false;
+	strcpy(ConfigureParams.RS232.sSccBOutFileName, "/dev/modem");
+	strcpy(ConfigureParams.RS232.sSccBInFileName, "/dev/modem");
 
 	/* Set defaults for MIDI */
 	ConfigureParams.Midi.bEnableMidi = false;
@@ -994,6 +1001,8 @@
 	File_MakeAbsoluteSpecialName(ConfigureParams.Log.sTraceFileName);
 	File_MakeAbsoluteSpecialName(ConfigureParams.RS232.szInFileName);
 	File_MakeAbsoluteSpecialName(ConfigureParams.RS232.szOutFileName);
+	File_MakeAbsoluteSpecialName(ConfigureParams.RS232.sSccBInFileName);
+	File_MakeAbsoluteSpecialName(ConfigureParams.RS232.sSccBOutFileName);
 	File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiInFileName);
 	File_MakeAbsoluteSpecialName(ConfigureParams.Midi.sMidiOutFileName);
 	File_MakeAbsoluteSpecialName(ConfigureParams.Printer.szPrintToFileName);
diff -r 4c4bd8970304 src/control.c
--- a/src/control.c	Tue Jan 01 18:25:30 2019 +0100
+++ b/src/control.c	Sat Jan 05 01:16:34 2019 +0200
@@ -37,6 +37,7 @@
 #include "midi.h"
 #include "printer.h"
 #include "rs232.h"
+#include "scc.h"
 #include "shortcut.h"
 #include "str.h"
 #include "screen.h"
@@ -178,6 +179,7 @@
 	} item[] = {
 		{ "printer", &ConfigureParams.Printer.bEnablePrinting, Printer_Init, Printer_UnInit },
 		{ "rs232",   &ConfigureParams.RS232.bEnableRS232, RS232_Init, RS232_UnInit },
+		{ "sccb",    &ConfigureParams.RS232.bEnableSccB, SCC_Init, SCC_UnInit },
 		{ "midi",    &ConfigureParams.Midi.bEnableMidi, Midi_Init, Midi_UnInit },
 		{ NULL, NULL, NULL, NULL }
 	};
@@ -237,6 +239,8 @@
 		{ "soundout", ConfigureParams.Sound.szYMCaptureFileName },
 		{ "rs232in",  ConfigureParams.RS232.szInFileName },
 		{ "rs232out", ConfigureParams.RS232.szOutFileName },
+		{ "sccbin",   ConfigureParams.RS232.sSccBInFileName },
+		{ "sccbout",  ConfigureParams.RS232.sSccBOutFileName },
 		{ NULL, NULL }
 	};
 	int i;
diff -r 4c4bd8970304 tests/tosboot/tos_tester.py
--- a/tests/tosboot/tos_tester.py	Tue Jan 01 18:25:30 2019 +0100
+++ b/tests/tosboot/tos_tester.py	Sat Jan 05 01:16:34 2019 +0200
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2012-2018 by Eero Tamminen <oak at helsinkinet fi>
+# Copyright (C) 2012-2019 by Eero Tamminen <oak at helsinkinet fi>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -486,7 +486,8 @@
         dummy.write("[HardDisk]\nbUseHardDiskDirectory = FALSE\n\n")
         dummy.write("[Floppy]\nszDiskAFileName = blank-a.st.gz\n\n")
         dummy.write("[Printer]\nbEnablePrinting = TRUE\nszPrintToFileName = %s\n\n" % self.printout)
-        dummy.write("[RS232]\nbEnableRS232 = TRUE\nszInFileName = \nszOutFileName = %s\n\n" % self.serialout)
+        dummy.write("[RS232]\nbEnableRS232 = TRUE\nszInFileName = \nszOutFileName = %s\n" % self.serialout)
+        dummy.write("bEnableSccB = TRUE\nsSccBInFileName = \nsSccBOutFileName = %s\n\n" % self.serialout)
         dummy.write("[Midi]\nbEnableMidi = TRUE\nsMidiInFileName = \nsMidiOutFileName = %s\n\n" % self.fifofile)
         dummy.close()
 
diff -r 4c4bd8970304 tools/hconsole/hconsole.py
--- a/tools/hconsole/hconsole.py	Tue Jan 01 18:25:30 2019 +0100
+++ b/tools/hconsole/hconsole.py	Sat Jan 05 01:16:34 2019 +0200
@@ -344,6 +344,8 @@
     "--midi-out",
     "--rs232-in",
     "--rs232-out",
+    "--scc-b-in",
+    "--scc-b-out",
     "--disk-a",
     "--disk-b",
     "--fastfdc",
@@ -415,7 +417,9 @@
     "printout",
     "soundout",
     "rs232in",
-    "rs232out"
+    "rs232out",
+    "sccbin",
+    "sccbout"
     ]
     # use the long variants of the commands for clarity
     debugger_tokens = [
diff -r 4c4bd8970304 python-ui/dialogs.py
--- a/python-ui/dialogs.py	Tue Jan 01 18:25:30 2019 +0100
+++ b/python-ui/dialogs.py	Sat Jan 05 01:16:34 2019 +0200
@@ -598,7 +598,7 @@
 
 
 # ---------------------------------------
-# Peripherals (midi,printer,rs232) dialog
+# Peripherals (midi,printer,rs232,sccb) dialog
 
 class PeripheralDialog(HatariUIDialog):
     def _create_dialog(self, config):
@@ -611,6 +611,9 @@
         rs232 = Gtk.CheckButton("Enable RS232")
         rs232.set_active(config.get_rs232())
 
+        sccb = Gtk.CheckButton("Enable SCC-B")
+        sccb.set_active(config.get_sccb())
+
         dialog = Gtk.Dialog("Peripherals", self.parent,
             Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
             (Gtk.STOCK_APPLY,  Gtk.ResponseType.APPLY,
@@ -618,11 +621,13 @@
         dialog.vbox.add(midi)
         dialog.vbox.add(printer)
         dialog.vbox.add(rs232)
+        dialog.vbox.add(sccb)
         dialog.vbox.show_all()
 
         self.dialog = dialog
         self.printer = printer
         self.rs232 = rs232
+        self.sccb = sccb
         self.midi = midi
 
     def run(self, config):
@@ -637,6 +642,7 @@
             config.set_midi(self.midi.get_active())
             config.set_printer(self.printer.get_active())
             config.set_rs232(self.rs232.get_active())
+            config.set_sccb(self.sccb.get_active())
             config.flush_updates()
 
 
diff -r 4c4bd8970304 python-ui/hatari.py
--- a/python-ui/hatari.py	Tue Jan 01 18:25:30 2019 +0100
+++ b/python-ui/hatari.py	Sat Jan 05 01:16:34 2019 +0200
@@ -272,10 +272,12 @@
         "memsave": ("[Memory]", "szMemoryCaptureFileName", "Manual memory snapshot"),
         "midiin":  ("[Midi]", "sMidiInFileName", "Midi input"),
         "midiout": ("[Midi]", "sMidiOutFileName", "Midi output"),
-        "rs232in": ("[RS232]", "szInFileName", "RS232 I/O input"),
-        "rs232out": ("[RS232]", "szOutFileName", "RS232 I/O output"),
-        "printout": ("[Printer]", "szPrintToFileName", "Printer output"),
-        "soundout": ("[Sound]", "szYMCaptureFileName", "Sound output")
+        "rs232in": ("[RS232]", "szInFileName", "RS232 (MFP) I/O input"),
+        "rs232out":("[RS232]", "szOutFileName", "RS232 (MFP) I/O output"),
+        "sccbin":  ("[RS232]", "sSccBInFileName", "SCC-B I/O input"),
+        "sccbout": ("[RS232]", "sSccBOutFileName", "SCC-B I/O output"),
+        "printout":("[Printer]", "szPrintToFileName", "Printer output"),
+        "soundout":("[Sound]", "szYMCaptureFileName", "Sound output")
     }
     has_hd_sections = True # from v2.2 onwards separate ACSI/SCSI/IDE sections
     has_modeltype = True   # from v2.0 onwards
@@ -375,6 +377,13 @@
         self.set("[RS232]", "bEnableRS232", value)
         self._hatari.set_device("rs232", value)
 
+    def get_sccb(self):
+        return self.get("[RS232]", "bEnableSccB")
+
+    def set_sccb(self, value):
+        self.set("[RS232]", "bEnableSccB", value)
+        self._hatari.set_device("sccb", value)
+
     # ------------ machine ---------------
     def get_machine_types(self):
         if self.has_modeltype:
diff -r 4c4bd8970304 python-ui/hatariui.py
--- a/python-ui/hatariui.py	Tue Jan 01 18:25:30 2019 +0100
+++ b/python-ui/hatariui.py	Sat Jan 05 01:16:34 2019 +0200
@@ -426,7 +426,7 @@
         ("harddisk", Gtk.STOCK_HARDDISK, "Hard disks...", "<Ctrl>H", "Hard disk images and directories", cb.harddisk),
         ("joystick", Gtk.STOCK_CONNECT, "Joysticks...", "<Ctrl>J", "Joystick settings", cb.joystick),
         ("machine", Gtk.STOCK_HARDDISK, "Machine...", "<Ctrl>M", "Hatari st/e/tt/falcon configuration", cb.machine),
-        ("device", Gtk.STOCK_PRINT, "Peripherals...", "<Ctrl>V", "Toggle Midi, Printer, RS232 peripherals", cb.peripheral),
+        ("device", Gtk.STOCK_PRINT, "Peripherals...", "<Ctrl>V", "Toggle Midi, Printer, RS232, SCC-B peripherals", cb.peripheral),
         ("sound", Gtk.STOCK_PROPERTIES, "Sound...", "<Ctrl>O", "Sound settings", cb.sound),
 
         ("path", Gtk.STOCK_DIRECTORY, "Paths...", None, "Device & save file paths", cb.path),


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/