diff --git a/.classpath b/.classpath index 27fba6c4..8dfaf0ee 100644 --- a/.classpath +++ b/.classpath @@ -4,7 +4,8 @@ - + + diff --git a/build/BUILD.PROCESS b/build/BUILD.PROCESS index 5c383c7d..c5a9b3f1 100644 --- a/build/BUILD.PROCESS +++ b/build/BUILD.PROCESS @@ -1,5 +1,5 @@ For detailed build instructions, see: -http://adtpro.com/developing.html +https://adtpro.com/developing.html The ADTPro project is using the ca65 macro assembler from the cc65 project (http://www.cc65.org/). The file diff --git a/build/README b/build/README index 322606c5..18d014ba 100644 --- a/build/README +++ b/build/README @@ -8,16 +8,15 @@ The ADTPro distribution comes as a single file named something similar to ADTPro-v.r.m with an extension particular to the target platform: - * ADTPro-v.r.m.tar.gz - Linux or Solaris + * ADTPro-v.r.m.tar.gz - Linux * ADTPro-v.r.m.dmg - Mac OSX - * ADTPro-v.r.m.zip - Windows or OS/2 + * ADTPro-v.r.m.zip - Windows Your distribution should contain most of these, depending on platform: - * ADTPro-v.r.m.app - OSX server application for OSX 10.3 through OSX 10.10 - * adtpro.command - OSX server startup command file for OSX 10.11 and above + * ADTPro-v.r.m.app - OSX server application + * adtpro.command - OSX server startup command file * adtpro.bat - Windows server startup batch file - * adtpro.cmd - OS/2 server startup batch file * adtpro.sh - Linux/Solaris server startup shell script * ac.sh - AppleCommander command line shell script invoker @@ -41,7 +40,7 @@ Your distribution should contain most of these, depending on platform: (Apple 800K disk images) * lib/ADTPro-v.r.m.jar - ADTPro server-side software (a Java .jar file) - * lib/rxtx/... - Java serial library files + * lib/jssc/... - Java serial library files * lib/AppleCommander/AppleCommander-v.r.m.p-ac.jar - AppleCommander support Jar @@ -52,7 +51,7 @@ To get started, you will need a Java installation you can call from the host computer's command line. This means that if you type the command "java -version" from a terminal window it ought to produce output other than complaints. One place to get a downloadable -Java distribution is from Sun Microsystems: Sun JRE download. When +Java distribution is from Oracle JRE download. When you get there, look for a "Java Runtime Environment (JRE)" download for your platform and install it. @@ -61,10 +60,9 @@ unpack it using your operating system's native facilities. You can either run the server startup program from the command line or, in Windows and OSX, double-click on the icon of the startup program: -Linux, Solaris: adtpro.sh -OS/2: adtpro.cmd -OSX: ADTPro-v.r.m.app or adtpro.command -Windows: adtpro.bat +Linux: adtpro.sh +OSX: ADTPro-v.r.m.app or adtpro.command +Windows: adtpro.bat You can modify the startup program to suit your environment. Especially for the Unix variants - it may need a little tweaking to @@ -94,32 +92,3 @@ project's github issues tracker: https://github.com/ADTPro/adtpro/issues Good luck - and have fun! - -Unix RXTX Considerations ------------------------- - -The adtpro.sh file can be customized to suit your environment. -The main thing to do is to choose your platform for RXTX support. -You may need to tweak the check for what your operating system -returns from the uname command, and connect that to the -appropriate RXTX library directory. - -If you don't specify the right one, or if your platform is -unsupported by RXTX, you will get an error similar to the one below -on startup: - -java.lang.UnsatisfiedLinkError: Can't find library rxtxSerial - (librxtxSerial.so) in sun.boot.library.path or java.library.path -sun.boot.library.path=/opt/IBMJava2-142/jre/bin -java.library.path=/opt/IBMJava2-142/jre/bin: - /opt/IBMJava2-142/jre/bin/classic:/opt/IBMJava2-142/jre/bin:/usr/lib - thrown while loading gnu.io.RXTXCommDriver - -Keep working at your startup script or take a look at the RXTX install -instructions in the rxtx directory. Remember, you can always ask for -in a tracker: - -https://github.com/ADTPro/adtpro/issues - -RXTX binary build for 64-bit Windows provided as a courtesy of Cloudhopper. -Please see http://rxtx.cloudhopper.net/ for more info. \ No newline at end of file diff --git a/build/adtprobase.bat b/build/adtprobase.bat index 62c6ca2c..10469da6 100644 --- a/build/adtprobase.bat +++ b/build/adtprobase.bat @@ -1,40 +1,24 @@ -@echo off -REM -REM ADTPro - Windows startup batch file -REM -REM Note: -REM Invoke with the name of the communications button to push -REM in order to start with that mode active (i.e. 'adtpro ethernet') - -SET ADTPRO_HOME=%CD%\ - -REM You can set two variables here: -REM 1. %JAVA_HOME% - to pick a particular java to run under -REM 2. %ADTPRO_HOME% - to say where you installed ADTPro -REM -REM e.g. uncomment (remove the "REM" from in front of) and -REM customize the following SET statements. -REM Note: They must have a trailing backslash as in the examples! -REM -REM SET ADTPRO_HOME=C:\src\workspace\35\adtpro\build\ -REM SET MY_JAVA_HOME=C:\Progra~1\IBM\Java142\bin\ - -set RXTX_PATH=%RXTX_VERSION_OLD% -set RXTX_ARCH=%RXTX_PATH%\Windows\i368-mingw32 - -IF "%PROCESSOR_ARCHITECTURE%"=="x86" goto add_classpath - -:bit64 -REM Assume 64 bit Windows if not x86 -set RXTX_PATH=%RXTX_VERSION_WIN64% -set RXTX_ARCH=%RXTX_PATH% - -:add_classpath -SET CWD=%CD% -if "%ADTPRO_CLASSPATH_SET%" == "1" goto start -set ADTPRO_CLASSPATH_SET=1 -PATH=%PATH%;%ADTPRO_HOME%lib\rxtx\%RXTX_ARCH% - -:start -CD "%ADTPRO_HOME%" -start /min %MY_JAVA_HOME%java -Xms128m -Xmx256m %ADTPRO_EXTRA_JAVA_PARMS% -cp "%ADTPRO_HOME%lib\%ADTPRO_VERSION%";"%ADTPRO_HOME%lib\rxtx\%RXTX_PATH%\RXTXcomm.jar";"%ADTPRO_HOME%lib\AppleCommander\AppleCommander-%AC_VERSION%.jar" org.adtpro.ADTPro %* +@echo off +REM +REM ADTPro - Windows startup batch file +REM +REM Note: +REM Invoke with the name of the communications button to push +REM in order to start with that mode active (i.e. 'adtpro ethernet') + +SET ADTPRO_HOME=%CD%\ + +REM You can set two variables here: +REM 1. %JAVA_HOME% - to pick a particular java to run under +REM 2. %ADTPRO_HOME% - to say where you installed ADTPro +REM +REM e.g. uncomment (remove the "REM" from in front of) and +REM customize the following SET statements. +REM Note: They must have a trailing backslash as in the examples! +REM +REM SET ADTPRO_HOME=C:\src\workspace\35\adtpro\build\ +REM SET MY_JAVA_HOME=C:\Progra~1\IBM\Java142\bin\ + +:start +CD "%ADTPRO_HOME%" +start /min %MY_JAVA_HOME%java -Xms128m -Xmx256m %ADTPRO_EXTRA_JAVA_PARMS% -cp "%ADTPRO_HOME%lib\%ADTPRO_VERSION%";"%ADTPRO_HOME%lib\AppleCommander\AppleCommander-%AC_VERSION%.jar";"%ADTPRO_HOME%lib\jssc\jssc-%JSSC_VERSION%.jar";"%ADTPRO_HOME%lib\jssc\slf4j-nop-%SLF4J_VERSION%.jar" org.adtpro.ADTPro %* diff --git a/build/adtprobase.cmd b/build/adtprobase.cmd deleted file mode 100644 index 316f488b..00000000 --- a/build/adtprobase.cmd +++ /dev/null @@ -1,21 +0,0 @@ -@ECHO OFF -REM -REM ADTPro - OS/2 startup command file -REM -REM You can set two variables here: -REM 1. %JAVA_HOME% - to pick a particular java to run under -REM 2. %ADTPRO_HOME% - to say where you installed ADTPro -REM -REM e.g. uncomment (remove the "@REM" from in front) and customize -REM the following two SET statements. -REM Note: They must have a trailing backslash as in the examples! - -REM SET ADTPRO_HOME=C:\src\workspace\311\adtpro\build\%ADTPRO_VERSION%\ -REM SET MY_JAVA_HOME=E:\Java142\jre\bin\ - -SETLOCAL - -CD %ADTPRO_HOME% -%MY_JAVA_HOME%java -Xms128m -Xmx256m -cp %ADTPRO_HOME%lib\%ADTPRO_VERSION%;%ADTPRO_HOME%lib\rxtx\%RXTX_VERSION%\RXTXcomm.jar org.adtpro.ADTPro %* - -ENDLOCAL diff --git a/build/adtprobase.sh b/build/adtprobase.sh index 963a2442..c8c28e04 100644 --- a/build/adtprobase.sh +++ b/build/adtprobase.sh @@ -26,40 +26,6 @@ export ADTPRO_HOME="`pwd`/" OS=`uname` OS_ARCH=`uname -p` -# For Linux, use this: -if [ "$OS" = "Linux" ]; then - if [ -f /usr/bin/raspi-config ]; then - export RXTXLIB=lib/rxtx/%RXTX_VERSION%/arm - ADTPRO_EXTRA_JAVA_PARMS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyAMA0" - elif [ "$OS_ARCH" = "i686" ]; then - export RXTXLIB=lib/rxtx/%RXTX_VERSION%/i686-pc-linux-gnu - else - if [ "$OS_ARCH" = "i386" ]; then - export RXTXLIB=lib/rxtx/%RXTX_VERSION%/i686-pc-linux-gnu - else - export RXTXLIB=lib/rxtx/%RXTX_VERSION%/x86_64-unknown-linux-gnu - fi - fi -fi - -# For OSX, use this: -if [ "$OS" = "Darwin" ]; then - if [ "$OS_ARCH" = "powerpc" ]; then - export RXTXLIB=lib/rxtx/%RXTX_VERSION_OLD%/Mac_OS_X - else - export RXTXLIB=lib/rxtx/%RXTX_VERSION%/mac-10.5 - fi -fi - -# For Solaris, use this: -if [ "$OS" = "SunOS" ]; then - export RXTXLIB=lib/rxtx/%RXTX_VERSION%/sparc-sun-solaris2.10-32 -fi - -# Set up the library location. -export TWEAK1="-Djava.library.path=" -export TWEAK="$TWEAK1""$ADTPRO_HOME""$RXTXLIB" - if [ "$1x" = "headlessx" ]; then shift if [ "$1x" = "x" ] || [ ! -f /usr/bin/xvfb-run ]; then @@ -74,4 +40,4 @@ if [ "$1x" = "headlessx" ]; then fi fi -$HEADLESS"$MY_JAVA_HOME"java -Xms256m -Xmx512m "$TWEAK" $ADTPRO_EXTRA_JAVA_PARMS -cp "$ADTPRO_HOME"lib/%ADTPRO_VERSION%:"$ADTPRO_HOME""$RXTXLIB"/../RXTXcomm.jar:"$ADTPRO_HOME"lib/AppleCommander/AppleCommander-%AC_VERSION%.jar org.adtpro.ADTPro $* +$HEADLESS"$MY_JAVA_HOME"java -Xms256m -Xmx512m -cp "$ADTPRO_HOME"lib/%ADTPRO_VERSION%:"$ADTPRO_HOME"lib/AppleCommander/AppleCommander-%AC_VERSION%.jar:"$ADTPRO_HOME"lib/jssc/jssc-%JSSC_VERSION%.jar:"$ADTPRO_HOME"lib/jssc/slf4j-nop-%SLF4J_VERSION%.jar org.adtpro.ADTPro $* diff --git a/build/build.xml b/build/build.xml index 8ad35de5..9454ab54 100644 --- a/build/build.xml +++ b/build/build.xml @@ -50,7 +50,7 @@ all --> - + @@ -72,13 +72,12 @@ all - - - - - - - + + + + + + @@ -112,13 +111,9 @@ all includes="messages_it.native" ext=".properties" /> - - - + + @@ -136,7 +131,7 @@ all includes="**/*.sh"/> - + @@ -167,7 +162,6 @@ all - @@ -192,22 +186,18 @@ all - - - - + + - - - - + + diff --git a/build/lib/jssc/.gitignore b/build/lib/jssc/.gitignore new file mode 100644 index 00000000..2095d5d6 --- /dev/null +++ b/build/lib/jssc/.gitignore @@ -0,0 +1 @@ +/doc/ diff --git a/build/lib/jssc/jssc-2.9.2-javadoc.jar b/build/lib/jssc/jssc-2.9.2-javadoc.jar new file mode 100644 index 00000000..d3f7b0fc Binary files /dev/null and b/build/lib/jssc/jssc-2.9.2-javadoc.jar differ diff --git a/build/lib/jssc/jssc-2.9.2.jar b/build/lib/jssc/jssc-2.9.2.jar new file mode 100644 index 00000000..4679b8a5 Binary files /dev/null and b/build/lib/jssc/jssc-2.9.2.jar differ diff --git a/build/lib/jssc/slf4j-nop-1.7.9.jar b/build/lib/jssc/slf4j-nop-1.7.9.jar new file mode 100644 index 00000000..c4c08331 Binary files /dev/null and b/build/lib/jssc/slf4j-nop-1.7.9.jar differ diff --git a/build/lib/rxtx/RXTXcomm.jar b/build/lib/rxtx/RXTXcomm.jar deleted file mode 100644 index d9ec5cd1..00000000 Binary files a/build/lib/rxtx/RXTXcomm.jar and /dev/null differ diff --git a/build/lib/rxtx/ch-rxtx-2.2-20081207-win-x64.zip b/build/lib/rxtx/ch-rxtx-2.2-20081207-win-x64.zip deleted file mode 100644 index 37863733..00000000 Binary files a/build/lib/rxtx/ch-rxtx-2.2-20081207-win-x64.zip and /dev/null differ diff --git a/build/lib/rxtx/rxtx-2.1-7-bins-r2.zip b/build/lib/rxtx/rxtx-2.1-7-bins-r2.zip deleted file mode 100644 index d587443a..00000000 Binary files a/build/lib/rxtx/rxtx-2.1-7-bins-r2.zip and /dev/null differ diff --git a/build/lib/rxtx/rxtx-2.2pre2-local.zip b/build/lib/rxtx/rxtx-2.2pre2-local.zip deleted file mode 100644 index 99a82d5c..00000000 Binary files a/build/lib/rxtx/rxtx-2.2pre2-local.zip and /dev/null differ diff --git a/doc/buildit.bat b/doc/buildit.bat index 61a6aa63..14012590 100644 --- a/doc/buildit.bat +++ b/doc/buildit.bat @@ -6,7 +6,6 @@ call c:\dev\env rmdir /q /s target call mvn site cd target\site -perl -i.orig -p ..\..\htmlpassthrough.re webring.html perl -i.orig -p ..\..\htmlpassthrough.re index.html perl -i.orig -p ..\..\htmlpassthrough.re bootstrap.html perl -i.orig -p ..\..\htmlpassthrough.re bootstrapaudio.html diff --git a/doc/buildit.sh b/doc/buildit.sh index f8e88c78..550c30f9 100755 --- a/doc/buildit.sh +++ b/doc/buildit.sh @@ -2,7 +2,6 @@ rm -rf target mvn site cd target/site -perl -i.orig -p ../../htmlpassthrough.re webring.html perl -i.orig -p ../../htmlpassthrough.re index.html perl -i.orig -p ../../htmlpassthrough.re bootstrap.html perl -i.orig -p ../../htmlpassthrough.re bootstrapaudio.html diff --git a/doc/buildpost.bat b/doc/buildpost.bat index a2a2b162..ee04ed1c 100644 --- a/doc/buildpost.bat +++ b/doc/buildpost.bat @@ -28,7 +28,6 @@ perl -i.orig -p ..\..\removeMaven.re receiving.html perl -i.orig -p ..\..\removeMaven.re sending.html perl -i.orig -p ..\..\removeMaven.re starting.html perl -i.orig -p ..\..\removeMaven.re translations.html -perl -i.orig -p ..\..\removeMaven.re webring.html perl -i.orig -p ..\..\removeMaven.re vdrive.html erase *.orig cd ..\.. diff --git a/doc/buildpost.sh b/doc/buildpost.sh index 3ce86a3b..2a2dc643 100755 --- a/doc/buildpost.sh +++ b/doc/buildpost.sh @@ -28,6 +28,5 @@ perl -i.orig -p ../../removeMaven.re receiving.html perl -i.orig -p ../../removeMaven.re sending.html perl -i.orig -p ../../removeMaven.re starting.html perl -i.orig -p ../../removeMaven.re translations.html -perl -i.orig -p ../../removeMaven.re webring.html perl -i.orig -p ../../removeMaven.re vdrive.html cd ../.. diff --git a/doc/htmlpassthrough.re b/doc/htmlpassthrough.re index a4e44102..1a3f6358 100644 --- a/doc/htmlpassthrough.re +++ b/doc/htmlpassthrough.re @@ -1,4 +1,3 @@ -s@webringreplaced@Powered by WebRing.@ig; s@youtubereplaced@@ig; s@youtubereplace2@@ig; s@youtubereplace3@@ig; diff --git a/doc/pom.xml b/doc/pom.xml index 2840c53a..ee69a2e0 100644 --- a/doc/pom.xml +++ b/doc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.adtpro doc - 2.0.3 + 2.1.0 ADTPro https://adtpro.com 2006 diff --git a/doc/removeMaven.re b/doc/removeMaven.re index acc06ed1..0b198849 100644 --- a/doc/removeMaven.re +++ b/doc/removeMaven.re @@ -1,4 +1,4 @@ -s@v\.r\.m@2.0.3@ig; +s@v\.r\.m@2.1.0@ig; s@\@@ig; s@\Built by Maven@@ig; s@\@\Powered by WebRing.@ig; s@&#223;@ß@ig; diff --git a/doc/removeMavenOrig.re b/doc/removeMavenOrig.re index 7764fde5..0ead19d3 100644 --- a/doc/removeMavenOrig.re +++ b/doc/removeMavenOrig.re @@ -11,5 +11,4 @@ s@(href\=\"http://apple3.org)(.*)\"@\1\2" target\="_new"@ig; s@href="http://www.connectworld.net/cgi-bin/iec/05MCAOSerial.html"@href="http://www.connectworld.net/cgi-bin/iec/05MCAOSerial.html" target\="_new"@ig; s@href="http://seb.riot.org/appleII/aladt.sml"@href="http://seb.riot.org/appleII/aladt.sml" target\="_new"@ig; s@href="http://dreher.net/?s=projects/CFforAppleII&c=projects/CFforAppleII/main.php"@href="http://dreher.net/?s=projects/CFforAppleII&c=projects/CFforAppleII/main.php" target\="_new"@ig; -s@webringreplaced@Powered by WebRing.@ig; s@&#223;@ß@ig; diff --git a/doc/src/site/apt/bootstrap.apt b/doc/src/site/apt/bootstrap.apt index 80bcece2..e4d3d61f 100644 --- a/doc/src/site/apt/bootstrap.apt +++ b/doc/src/site/apt/bootstrap.apt @@ -415,15 +415,15 @@ all the way to making a bootable ADTPro floppy: [images/speedivsdrive.png] [[1]] Once the transfers complete successfully, You will be left in the - BASIC AppleSoft envrionment with ADTPro's Virtual.po image being served - as slot 2, drive 1: + BASIC AppleSoft environment with ADTPro's Virtual.po image being served + as slot 1, drive 1: * [images/speedivsbooted.png] [[1]] You are now ready to use your Apple, loading and saving programs - and files on slot 2, drive 1. Note that the virtual serial driver + and files on slot 1, drive 1. Note that the virtual serial driver booted this way takes the place of the Disk II driver, so Disk II drives will be unusable in your system if you have them. diff --git a/doc/src/site/apt/compatibility.apt b/doc/src/site/apt/compatibility.apt index 74cea346..bd31d478 100644 --- a/doc/src/site/apt/compatibility.apt +++ b/doc/src/site/apt/compatibility.apt @@ -20,7 +20,7 @@ DOS-ADT Compatibility *-----:-----:------:------:------:------+ || <> || <> || <> || <> || <> || <> *-----:-----:------:------:------:------+ - ADTPro | v.r.m | II,+,e,c,GS,Laser,/// | Linux, OS/2, OSX, Solaris, Windows (Java) | Serial, Uthernet, Audio | Nibble capable + ADTPro | v.r.m | II,+,e,c,GS,Laser,/// | Linux, OSX, Windows (Java) | Serial, Uthernet, Audio | Nibble capable *-----:-----:------:------:------:------+ ADT (Shipped with ADTPro v1) | 2.4 | II,+,e,c,GS,Laser,/// | ADTPro or Virtual ][ A2V2 on OSX | Serial (115.2k) | Nibble/half-track capable *-----:-----:------:------:------:------+ diff --git a/doc/src/site/apt/credits.apt b/doc/src/site/apt/credits.apt index 43253ed2..75a8980b 100644 --- a/doc/src/site/apt/credits.apt +++ b/doc/src/site/apt/credits.apt @@ -46,8 +46,7 @@ etc. with concepts and code from the CiderPress project: from the jSyncManager project: {{http://jsyncmanager.sourceforge.net/}} Hardware-level serial communications in Java comes from -the rxtx project: {{http://rxtx.qbang.org/wiki/index.php/Main_Page}}. - The RXTX binaries for 64-bit Windows are provided as a courtesy of Cloudhopper. +the jssc project: {{https://github.com/java-native/jssc}}. The routine to decide what kind of block device a particular slot/drive combination contains was generously donated by Mark Percival. It originates diff --git a/doc/src/site/apt/developing.apt b/doc/src/site/apt/developing.apt index 49074836..2a804301 100644 --- a/doc/src/site/apt/developing.apt +++ b/doc/src/site/apt/developing.apt @@ -11,19 +11,19 @@ that are not readily visible. The full list looks like this: * {{{https://ant.apache.org/}Apache Ant}} - orchestrates the build process - * {{{https://www.oracle.com/technetwork/java/javase/downloads/index.html}Java SDK}} - compiles Java-based server + * {{{https://jdk.java.net/}Java JDK}} - compiles Java-based server * {{{https://cc65.github.io/}cc65}} - a multiplatform toolchain with a nice 6502 macro assembler - * {{{http://rxtx.qbang.org/wiki/index.php/Main_Page}rxtx}} - multiplatform Java serial library + * {{{https://github.com/java-native/jssc}jssc}} - multiplatform Java serial library * {{{https://maven.apache.org/}Maven}} - optional; builds these web pages - * {{{https://github.com/david-schmidt/apple-iii-cffa3000-driver}Apple Pascal}} - optional project to build the Apple /// VSDRIVE driver + * {{{https://github.com/robjustice/a3driverutil}A3Driverutil}} - Rob Justice's project to assist in building the Apple /// VSDRIVE driver [] - The main Ant build.xml script in ADTPro's CVS repository calls upon these + The main Ant build.xml script in ADTPro's build tree calls upon these tools to go from source files to distributable packages. Well, with the exception of the Maven website stuff - that's not part of the main build script, mostly because that's a step most people wouldn't ever want to do, and if it were there - @@ -60,40 +60,66 @@ The minimum amount of work you'd go through to do so: * Download and install Eclipse from {{{https://www.eclipse.org/}https://www.eclipse.org/}} - * Download and install a full Java {{{https://www.oracle.com/technetwork/java/javase/overview/index.html}JDK}} if your Eclipse distribution doesn't come with one + * Download and install a full Java {{{https://jdk.java.net/}JDK}} if your Eclipse distribution doesn't come with one - * Download and install the cc65 toolchain from {{{https://cc65.github.io/}https://cc65.github.io/}} - you only need the one for your development platform (Windows, OS/2, Linux - not the 8-bit support modules) + * Download and install the cc65 toolchain from {{{https://cc65.github.io/}https://cc65.github.io/}} - you only need the one for your development platform (Windows, OSX, Linux - not the 8-bit support modules) + * Download a recent version of Apache ant from {{{http://ant.apache.org/}http://ant.apache.org/}} + [] * {Downloading}/Importing the ADTPro Project - Connect Eclipse to the ADTPro repository in GitHub by going through + Clone the ADTPro repository from GitHub by going through the next few configuration dialogs in Eclipse. * From the Eclipse IDE: <<Import->Project,>>> then: <<>> ** -[images/eclipse1.png] +[images/eclipse-import1.png] + + * Click on <<>>: + + ** + +[images/eclipse-import2.png] * Fill in the Git repository info: ** -[images/eclipse2.png] +[images/eclipse-import3.png] - * Pick, or type in, <<>> for the module name: + * Pick at least the <<>> branch to check out: ** -[images/eclipse3.png] +[images/eclipse-import4.png] * Check it out to the workspace: ** -[images/eclipse4.png] +[images/eclipse-import5.png] + + * The clone operation will proceed: + + ** + +[images/eclipse-import6.png] + + * Choose to import existing Eclipse projects: + + ** + +[images/eclipse-import7.png] + + * Search for nested projects, and hit <<>>: + + ** + +[images/eclipse-import8.png] [] @@ -208,7 +234,7 @@ the complete distribution package. If you would like to build ADTPro without the aid of an IDE at all, there are a few environmental things you will need to do by hand that they typically do for you automatically. -You will still need the toolsets listed at the top of the page (except Maven and the Apple /// build). +You will still need the toolsets listed at the top of the page (except Maven and the Apple /// driver build). Ant will marshal the tools and produce the build for you. In order to just type <<>> in the <<>> directory, though, there are a few things it needs to know: @@ -220,7 +246,7 @@ directory installed. The full line should look something like this, assuming you <<<\ >>> The value you specify in <<>> will override all others, -and is not checked in to CVS; so you can keep this local file to tailor your local build and +and is not checked in to GitHub; so you can keep this local file to tailor your local build and not affect other developers. * Your CLASSPATH environment variable must be configured to point to an <<>> diff --git a/doc/src/site/apt/index.apt b/doc/src/site/apt/index.apt index 75f43ec0..2292cd1f 100644 --- a/doc/src/site/apt/index.apt +++ b/doc/src/site/apt/index.apt @@ -34,7 +34,7 @@ compatible computer with 64k of memory or more. * Runs on any Apple II, Apple ///, or compatible with 64k of memory - * Runs on Linux, Mac OSX, OS/2, Windows, and probably Solaris + * Runs on Linux, Mac OSX, and Windows * Understands many digital disk image formats: .DSK, .SDK, .SHK, .BXY, .PO, .DO, .NIB, 2IMG diff --git a/doc/src/site/apt/install.apt b/doc/src/site/apt/install.apt index 6ae18888..15d3b7e5 100644 --- a/doc/src/site/apt/install.apt +++ b/doc/src/site/apt/install.apt @@ -29,16 +29,16 @@ ADTPro Installation The ADTPro distribution comes as a single file named something similar to <<>> with an extension particular to the target platform: - * <<>> - Linux or Solaris + * <<>> - Linux * <<>> - Mac OSX - * <<>> - Windows or OS/2 + * <<>> - Windows [] (The <<<"v.r.m">>> part signifies the Version, Release, and Modification - numbers of the particular distribution you're looking at.) + numbers of the particular version of ADTPro you're looking at.) Installation steps: @@ -60,62 +60,21 @@ ADTPro Installation Good luck - and have fun! -Unix RXTX {Considerations} - - For Unix variants other than Mac OSX, make sure the user that will be running - ADTPro is in the group <<>> or <<>> so that lockfiles can work. - - For Ubuntu, you will want to add the group <<>> to your user with the - following command from a terminal window: - <<>> - - The <<>> and <<>> files can be customized - to suit your environment. - The main thing to do is to choose your platform for RXTX support. - You may need to tweak the check for what your operating system returns - from the <<>> command, and connect that to the appropriate RXTX - library directory. - - If you don't specify the right one, or if your platform is unsupported - by RXTX, you will get an error similar to the one below on startup: - -+------- - -java.lang.UnsatisfiedLinkError: Can't find library rxtxSerial (librxtxSerial.so) - in sun.boot.library.path or java.library.path -sun.boot.library.path=/opt/IBMJava2-142/jre/bin -java.library.path=/opt/IBMJava2-142/jre/bin: - /opt/IBMJava2-142/jre/bin/classic:/opt/IBMJava2-142/jre/bin:/usr/lib - thrown while loading gnu.io.RXTXCommDriver -+------- - - Keep working at your startup script or just - {{{./forum.html}ask for help.}} - -OS/2 RXTX Considerations - - OS/2 doesn't have a native RXTX library. It would be a relatively easy - thing to snap in the original Sun/IBM serial library, but just hasn't been - done yet. Holler if you want it. Otherwise, the audio and UDP/Ethernet - versions work fine in OS/2. - Distribution contents The distribution should contain most of these files, depending on platform: <<>> - A Windows server startup batch file - <<>> - An OS/2 server startup command file - - <<>> - An OSX server application for OSX 10.3 and above + <<>> - An OSX server application for OSX 10.6 and above <<>> - An OSX server startup command file - <<>> - A Linux/Solaris server startup shell script + <<>> - A Linux server startup shell script <<>> - A Windows AppleCommander command line invoker batch file - <<>> - A Linux/Solaris AppleCommander command line invoker script + <<>> - A Linux AppleCommander command line invoker script <<>> - The GNU Public License file @@ -137,6 +96,6 @@ Distribution contents <<>> - AppleCommander support software (a Java .jar file) - <<>> - Java serial library files + <<>> - Java serial library files [] diff --git a/doc/src/site/apt/starting.apt b/doc/src/site/apt/starting.apt index 0f7dd3d9..727ce7ec 100644 --- a/doc/src/site/apt/starting.apt +++ b/doc/src/site/apt/starting.apt @@ -20,13 +20,11 @@ Starting ADTPro or by clicking on the startup program for your host operating system: - <<>> - Linux, Solaris (you downloaded the .tar.gz package, didn't you?) + <<>> - Linux (you downloaded the .tar.gz package, didn't you?) - <<>> - OSX 10.10 and below (you downloaded the .dmg package, didn't you?) + <<>> - OSX (you downloaded the .dmg package, didn't you?) - <<>> - OSX 10.11 and above (you downloaded the .dmg package, didn't you?) - - <<>> - OS/2 + <<>> - OSX (you downloaded the .dmg package, didn't you?) <<>> - Windows diff --git a/doc/src/site/apt/webring.apt b/doc/src/site/apt/webring.apt deleted file mode 100644 index 9590f8d4..00000000 --- a/doc/src/site/apt/webring.apt +++ /dev/null @@ -1,11 +0,0 @@ - ----- - Apple II WebRing - ----- - David Schmidt (1110325+david-schmidt@users.noreply.github.com) - ----- - -Apple II WebRing - - Visit other sites concerned with Apple II computing: - - webringreplaced \ No newline at end of file diff --git a/doc/src/site/resources/images/about.png b/doc/src/site/resources/images/about.png index 4730f046..f698f737 100644 Binary files a/doc/src/site/resources/images/about.png and b/doc/src/site/resources/images/about.png differ diff --git a/doc/src/site/resources/images/eclipse-import1.png b/doc/src/site/resources/images/eclipse-import1.png new file mode 100644 index 00000000..abc8fa0e Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import1.png differ diff --git a/doc/src/site/resources/images/eclipse-import2.png b/doc/src/site/resources/images/eclipse-import2.png new file mode 100644 index 00000000..8ed7e6c5 Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import2.png differ diff --git a/doc/src/site/resources/images/eclipse-import3.png b/doc/src/site/resources/images/eclipse-import3.png new file mode 100644 index 00000000..cc4cabbf Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import3.png differ diff --git a/doc/src/site/resources/images/eclipse-import4.png b/doc/src/site/resources/images/eclipse-import4.png new file mode 100644 index 00000000..02a63b0f Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import4.png differ diff --git a/doc/src/site/resources/images/eclipse-import5.png b/doc/src/site/resources/images/eclipse-import5.png new file mode 100644 index 00000000..60f22c1e Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import5.png differ diff --git a/doc/src/site/resources/images/eclipse-import6.png b/doc/src/site/resources/images/eclipse-import6.png new file mode 100644 index 00000000..e3ed652d Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import6.png differ diff --git a/doc/src/site/resources/images/eclipse-import7.png b/doc/src/site/resources/images/eclipse-import7.png new file mode 100644 index 00000000..9a195007 Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import7.png differ diff --git a/doc/src/site/resources/images/eclipse-import8.png b/doc/src/site/resources/images/eclipse-import8.png new file mode 100644 index 00000000..b5b67f99 Binary files /dev/null and b/doc/src/site/resources/images/eclipse-import8.png differ diff --git a/doc/src/site/resources/images/eclipse1.png b/doc/src/site/resources/images/eclipse1.png deleted file mode 100644 index b21ca2d5..00000000 Binary files a/doc/src/site/resources/images/eclipse1.png and /dev/null differ diff --git a/doc/src/site/resources/images/eclipse2.png b/doc/src/site/resources/images/eclipse2.png deleted file mode 100644 index 6fb02811..00000000 Binary files a/doc/src/site/resources/images/eclipse2.png and /dev/null differ diff --git a/doc/src/site/resources/images/eclipse3.png b/doc/src/site/resources/images/eclipse3.png deleted file mode 100644 index 0af9bf08..00000000 Binary files a/doc/src/site/resources/images/eclipse3.png and /dev/null differ diff --git a/doc/src/site/resources/images/eclipse4.png b/doc/src/site/resources/images/eclipse4.png deleted file mode 100644 index 608ca3a3..00000000 Binary files a/doc/src/site/resources/images/eclipse4.png and /dev/null differ diff --git a/doc/src/site/resources/images/speedivsbooted.png b/doc/src/site/resources/images/speedivsbooted.png index 0a66e83e..84aae727 100644 Binary files a/doc/src/site/resources/images/speedivsbooted.png and b/doc/src/site/resources/images/speedivsbooted.png differ diff --git a/doc/src/site/site.xml b/doc/src/site/site.xml index 9d6642a4..667415c0 100644 --- a/doc/src/site/site.xml +++ b/doc/src/site/site.xml @@ -90,7 +90,6 @@ - diff --git a/src/client/messagesOrig.asm b/src/client/messagesOrig.asm index c84116f5..a29b1f4e 100644 --- a/src/client/messagesOrig.asm +++ b/src/client/messagesOrig.asm @@ -1,6 +1,6 @@ ; ; ADTPro - Apple Disk Transfer ProDOS -; Copyright (C) 2008 - 2016 by David Schmidt +; Copyright (C) 2008 - 2020 by David Schmidt ; 1110325+david-schmidt@users.noreply.github.com ; ; This program is free software; you can redistribute it and/or modify it @@ -112,7 +112,7 @@ PHMMAX = $0a ; This must be two greater than the largest host message MSG17: asc "ADTPRO BY DAVID SCHMIDT. BASED ON WORKS " asc " BY PAUL GUERTIN AND MANY OTHERS. " - asc " VISIT: HTTP://ADTPRO.COM " + asc " VISIT: HTTPS://ADTPRO.COM " MSG17_END =* MSGSOU: asc " SELECT SOURCE VOLUME" diff --git a/src/client/prodos/serial/grub2/grub2main.asm b/src/client/prodos/serial/grub2/grub2main.asm index 3af99435..34fafe71 100644 --- a/src/client/prodos/serial/grub2/grub2main.asm +++ b/src/client/prodos/serial/grub2/grub2main.asm @@ -1,6 +1,6 @@ ; ; ADTPro - Apple Disk Transfer ProDOS -; Copyright (C) 2012 - 2014 by David Schmidt +; Copyright (C) 2012 - 2020 by David Schmidt ; 1110325+david-schmidt@users.noreply.github.com ; ; This program is free software; you can redistribute it and/or modify it @@ -107,15 +107,14 @@ ReadMLI: ; We got the magic signature; start reading data sta (b_p),y ; Save it sta mliupdateloc ; Print it in the status area iny - cpy size ; Is y equal to the LSB of our target? - bne :+ ; No... check for next pageness - lda size+1 ; LSB is equal; is MSB? - beq ReadMLIDone ; Yes... so done -: cpy #$00 - bne ReadMLI ; Check for page increment + cpy #$00 ; Check for page increment + bne :+ inc b_p+1 ; Increment another page dec size+1 - jmp ReadMLI ; Go back for more +: cpy size ; Is y equal to the LSB of our target? + bne ReadMLI ; No, loop around for more + lda size+1 ; LSB is equal; is MSB? + bne ReadMLI ; No; go back for more ReadMLIDone: lda #$01 @@ -163,15 +162,14 @@ ReadClient: ; We got the magic signature; start reading data sta (b_p),y ; Save it sta adtproupdateloc ; Print it in the status area iny - cpy size ; Is y equal to the LSB of our target? - bne :+ ; No... check for next pageness - lda size+1 ; LSB is equal; is MSB? - beq ReadClientDone ; Yes... so done -: cpy #$00 - bne ReadClient ; Check for page increment + cpy #$00 ; Check for page increment + bne :+ inc b_p+1 ; Increment another page dec size+1 - jmp ReadClient ; Go back for more +: cpy size ; Is y equal to the LSB of our target? + bne ReadClient ; No, loop around for more + lda size+1 ; LSB is equal; is MSB? + bne ReadClient ; Go back for more ReadClientDone: lda #$00 diff --git a/src/client/prodos/serial/grub2/grub_vsdrive_main.asm b/src/client/prodos/serial/grub2/grub_vsdrive_main.asm index 1cc857bd..c1a9611e 100644 --- a/src/client/prodos/serial/grub2/grub_vsdrive_main.asm +++ b/src/client/prodos/serial/grub2/grub_vsdrive_main.asm @@ -1,6 +1,6 @@ ; ; ADTPro - Apple Disk Transfer ProDOS -; Copyright (C) 2013 - 2014 by David Schmidt +; Copyright (C) 2013 - 2020 by David Schmidt ; 1110325+david-schmidt@users.noreply.github.com ; ; This program is free software; you can redistribute it and/or modify it @@ -142,15 +142,14 @@ ReadFile: ; We got the magic signature; start reading data UpdateLoc: ; Print it in the status area sta $0600 ; (self-modifying) iny - cpy size ; Is y equal to the LSB of our target? - bne :+ ; No... check for next pageness - lda size+1 ; LSB is equal; is MSB? - beq ReadDone ; Yes... so done -: cpy #$00 - bne ReadFile ; Check for page increment + cpy #$00 ; Check for page increment + bne :+ inc b_p+1 ; Increment another page dec size+1 - jmp ReadFile ; Go back for more +: cpy size ; Is y equal to the LSB of our target? + bne ReadFile ; No, loop around for more + lda size+1 ; LSB is equal; is MSB? + bne ReadFile ; No; go back for more ReadDone: inc NextTask ; Get ready for the next task when we swing back around diff --git a/src/client/sos/serial/kernel.asm b/src/client/sos/serial/kernel.asm index 84b278a7..cc0ae2e3 100644 --- a/src/client/sos/serial/kernel.asm +++ b/src/client/sos/serial/kernel.asm @@ -650,14 +650,14 @@ ReadInterp: ; We got the magic signature; start reading data sta (b_p),y ; Save it sta $07bd+8 ; Print throbber in the status area iny - cpy size ; Is y equal to the LSB of our target? - bne :+ ; No... check for next pageness - lda size+1 ; LSB is equal; is MSB? - beq ReadInterpDone ; Yes... so done -: cpy #$00 - bne ReadInterp ; Check for page incrementness + cpy #$00 ; Check for page increment + bne :+ ; inc b_p+1 ; Prepare for another page dec size+1 +: cpy size ; Is y equal to the LSB of our target? + bne ReadInterp ; No, loop around for more + lda size+1 ; LSB is equal; is MSB? + beq ReadInterpDone ; Yes... so done jmp ReadInterp ; Go back for more ReadInterpDone: diff --git a/src/client/sos/serial/loader.asm b/src/client/sos/serial/loader.asm index 0633e35c..ebec5deb 100644 --- a/src/client/sos/serial/loader.asm +++ b/src/client/sos/serial/loader.asm @@ -1,6 +1,6 @@ ; ; ADTPro - Apple Disk Transfer ProDOS -; Copyright (C) 2008 - 2014 by David Schmidt +; Copyright (C) 2008 - 2020 by David Schmidt ; 1110325+david-schmidt@users.noreply.github.com ; ; This program is free software; you can redistribute it and/or modify it @@ -94,18 +94,18 @@ LogoLoop: cpy #PMLOGO6+2 ; Stop at MLOGO6 message bne LogoLoop -; Set up our pointers - lda #$1e ; SOS.KERNEL initially occupies $1e00 to $73ff - sta BUF_P+1 - lda #$00 - sta BUF_P - ; Say we're active ldx # 0) - { - inputStream.read(); - } + Log.println(false, "SerialTransport.close() didn't think port was connected."); //$NON-NLS-1$ } /** * Returns an array of Strings representing the names of available ports. This - * method will return to the caller an array of strings representing the - * serial ports available on this system. + * method will return to the caller an array of strings representing the serial + * ports available on this system. * * @return an array of String representing the names of the available ports. */ public static String[] getPortNames() { - Vector v = new Vector(); - Enumeration enumeration = null; - - try - { - enumeration = CommPortIdentifier.getPortIdentifiers(); - } - catch (java.lang.NoClassDefFoundError ex) - { - Log.println(true, Messages.getString("SerialTransport.2")); //$NON-NLS-1$ - return null; - } + Vector v = new Vector(); - while (enumeration.hasMoreElements()) + String[] portNames = SerialPortList.getPortNames(); + for (int i = 0; i < portNames.length; i++) { - v.addElement(((CommPortIdentifier) enumeration.nextElement()).getName()); + v.addElement(portNames[i]); } String ret[] = new String[v.size()]; for (int j = 0; j < v.size(); j++) - ret[j] = (String) v.elementAt(j); + ret[j] = v.elementAt(j); return ret; } /** * Opens a read/write connection to the implemented transport. This method - * should open the transport device being implemented using default - * parameters. + * should open the transport device being implemented using default parameters. * * @exception IOException - * thrown when a problem occurs opening the stream. + * thrown when a problem occurs opening the stream. */ public void open() throws Exception @@ -187,14 +157,13 @@ public void open() throws Exception /** * Opens a read/write connection to the implemented transport. This method - * should open the transport device being implemented using default - * parameters. + * should open the transport device being implemented using default parameters. * * @exception IOException - * thrown when a problem occurs with opening the stream. + * thrown when a problem occurs with opening the + * stream. */ - public void open(String portName, int portSpeed, boolean hardware) - throws Exception + public void open(String portName, int portSpeed, boolean hardware) throws Exception { Log.println(false, "SerialTransport.open() entry."); if (connected) @@ -202,21 +171,20 @@ public void open(String portName, int portSpeed, boolean hardware) Log.println(false, "SerialTransport.open() was connected; closing."); close(); } - portId = CommPortIdentifier.getPortIdentifier(portName); - port = (RXTXPort) portId.open(Messages.getString("SerialTransport.3"), 100); //$NON-NLS-1$ - port.setSerialPortParams(portSpeed, 8, 1, 0); + port = new SerialPort(portName); + port.openPort(); + port.setParams(portSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); setHardwareHandshaking(hardware); - port.enableReceiveTimeout(250); - inputStream = new DataInputStream(port.getInputStream()); + port.purgePort(SerialPort.PURGE_RXCLEAR | SerialPort.PURGE_TXCLEAR); flushReceiveBuffer(); - outputStream = new DataOutputStream(port.getOutputStream()); connected = true; - Log.println(true,"SerialTransport opened port named " + portName + " at speed " + portSpeed + "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Log.println(true, "SerialTransport opened port named " + portName + " at speed " + portSpeed + "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return; } /** * Read a single byte from the Java COMM API port. + * @throws SerialPortException * * @throws IOException */ @@ -230,14 +198,20 @@ public byte readByte(int seconds) throws TransportTimeoutException { try { - oneByte = inputStream.readByte(); + oneByte = port.readBytes(1,seconds*1000)[0]; hasData = true; } - catch (java.io.IOException e) + catch (SerialPortTimeoutException e) { collectedTimeouts++; + //Log.printStackTrace(e); + } + catch (SerialPortException e) + { + Log.printStackTrace(e); } - if (collectedTimeouts / 4 > seconds) throw new TransportTimeoutException(); + if (collectedTimeouts / 4 > seconds) + throw new TransportTimeoutException(); } /* * if (hasData) Log.println(false, "SerialTransport.readByte() exit, byte: " + @@ -251,17 +225,17 @@ public byte readByte(int seconds) throws TransportTimeoutException * Sets the parameters of the underlying Java COMM API port. * * @param port - * The port to set the transport to. + * The port to set the parameters to. * @param speed - * The speed to set the transport to. + * The speed to set the transport to. * @param hardware - * Boolean to say if hardware handshaking should be used + * Boolean to say if hardware handshaking should be used. * @exception IOException - * thrown when a problem occurs with flushing the stream. + * thrown when a problem occurs with flushing the + * stream. */ - public void setParms(String newPort, int newSpeed, boolean newHardware) - throws Exception + public void setParms(String newPort, int newSpeed, boolean newHardware) throws Exception { if (!newPort.equals(_portName)) { @@ -274,20 +248,22 @@ public void setParms(String newPort, int newSpeed, boolean newHardware) setHardwareHandshaking(newHardware); if (_currentSpeed != newSpeed) { - flush(); + flushReceiveBuffer(); + flushSendBuffer(); _currentSpeed = newSpeed; - port.setSerialPortParams(newSpeed, 8, 1, 0); + port.setParams(newSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } } } /** - * Sets the speed of the underlying Java COMM API port. + * Sets the speed of the underlying Java COMM API rxtxPort. * * @param speed - * The speed to set the transport to. + * The speed to set the transrxtxPort to. * @exception IOException - * thrown when a problem occurs with flushing the stream. + * thrown when a problem occurs with flushing the + * stream. */ public void setSpeed(int speed) @@ -296,9 +272,10 @@ public void setSpeed(int speed) { try { - flush(); + flushReceiveBuffer(); + flushSendBuffer(); _currentSpeed = speed; - port.setSerialPortParams(speed, 8, 1, 0); + port.setParams(speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (Exception e) { @@ -311,16 +288,17 @@ public void setSpeed(int speed) * Writes an array of bytes to the Java COMM API port. * * @param data - * the bytes to be written to the serial port. + * the bytes to be written to the serial port. */ public void writeBytes(byte data[], String log) { - // Log.println(false,"SerialTransport.writeBytes() adding "+data.length+" bytes to the stream."); + Log.println(false, "SerialTransport.writeBytes() adding " + data.length + " bytes to the stream."); if (_outPacketPtr + data.length > _sendBuffer.length) { - Log.println(false, "SerialTransport.writeBytes() Re-allocating the send buffer: "+_sendBuffer.length+" bytes is the new size."); - byte newBuffer[] = new byte[_sendBuffer.length+data.length]; + Log.println(false, "SerialTransport.writeBytes() Re-allocating the send buffer: " + _sendBuffer.length + + " bytes is the new size."); + byte newBuffer[] = new byte[_sendBuffer.length + data.length]; for (int i = 0; i < _sendBuffer.length; i++) newBuffer[i] = _sendBuffer[i]; _sendBuffer = new byte[newBuffer.length * 2]; @@ -335,7 +313,10 @@ public void writeBytes(byte data[], String log) _sendBuffer[_outPacketPtr++] = data[i]; } if (_outPacketPtr > 255) + { + Log.println(false, "SerialTransport.writeBytes() has " + _outPacketPtr + " bytes to send."); pushBuffer(); + } } public void writeBytes(String str) @@ -386,7 +367,7 @@ public void writeByte(byte datum, String str) public void pullBuffer() { - // Serial port is byte-by-byte, no buffering + // Serial rxtxPort is byte-by-byte, no buffering } public void pushBuffer() @@ -394,60 +375,80 @@ public void pushBuffer() Log.println(false, "SerialTransport.pushBuffer() entry, pushing " + _outPacketPtr + " bytes."); if (_outPacketPtr > 0) { - Log.println(false, "SerialTransport.pushBuffer() pushing data:"); - for (int i = 0; i < _outPacketPtr; i++) - { - if (((i % 32) == 0) && (i != 0)) Log.println(false, ""); - Log.print(false, UnsignedByte.toString(_sendBuffer[i]) + " "); - } - Log.println(false, ""); + if (Log.getSingleton().isLogging()) + { + Log.println(false, "SerialTransport.pushBuffer() pushing data:"); + for (int i = 0; i < _outPacketPtr; i++) + { + if (((i % 32) == 0) && (i != 0)) + Log.println(false, ""); + Log.print(false, UnsignedByte.toString(_sendBuffer[i]) + " "); + } + Log.println(false, ""); + } try - { - outputStream.write(_sendBuffer, 0, _outPacketPtr); + { + while (port.getOutputBufferBytesCount() > 1) {} // Moderate buffer speed + if (_outPacketPtr == 1) + { + port.writeByte(_sendBuffer[0]); + } + else + { + byte newBuffer[] = new byte[_outPacketPtr]; + for (int i = 0; i < _outPacketPtr; i++) + newBuffer[i] = _sendBuffer[i]; + port.writeBytes(newBuffer); + } } - catch (IOException e) - { + catch (SerialPortException e) + { + Log.printStackTrace(e); e.printStackTrace(); } - _outPacketPtr = 0; + _outPacketPtr = 0; } - Log.println(false, "SerialTransport.pushBuffer() exit."); + Log.println(false, "SerialTransport.pushBuffer() exit."); } public void flushReceiveBuffer() { + // Actually flushing seems to be harmful; skip it + /* try { - flush(); + port.purgePort(SerialPort.PURGE_RXCLEAR); } - catch (IOException e) + catch (SerialPortException e) { - Log.println(false, - "SerialTransport.flushReceiveBuffer() failed to flush the stream."); + Log.println(false, "SerialTransport.flushReceiveBuffer() failed to purge the port."); } + */ } public void flushSendBuffer() { + // Actually flushing seems to be harmful; skip it + /* try { - outputStream.flush(); + port.purgePort(SerialPort.PURGE_TXCLEAR); } - catch (IOException e) + catch (SerialPortException e) { - Log.println(false, - "SerialTransport.flushSendBuffer() failed to flush the stream."); + Log.println(false, "SerialTransport.flushSendBuffer() failed to purge the port."); } + */ } public void setFullSpeed() { try { - port.setSerialPortParams(_currentSpeed, 8, 1, 0); + port.setParams(_currentSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } - catch (UnsupportedCommOperationException e) + catch (SerialPortException e) { Log.printStackTrace(e); } @@ -457,9 +458,9 @@ public void setFullSpeed(int speed) { try { - port.setSerialPortParams(speed, 8, 1, 0); + port.setParams(_currentSpeed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } - catch (UnsupportedCommOperationException e) + catch (SerialPortException e) { Log.printStackTrace(e); } @@ -467,13 +468,12 @@ public void setFullSpeed(int speed) public void setSlowSpeed(int speed) { - Log.println(false, "SerialTransport.setSlowSpeed() setting speed to " - + speed); + Log.println(false, "SerialTransport.setSlowSpeed() setting speed to " + speed); try { - port.setSerialPortParams(speed, 8, 1, 0); + port.setParams(speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } - catch (UnsupportedCommOperationException e) + catch (SerialPortException e) { Log.printStackTrace(e); } @@ -486,47 +486,49 @@ public boolean supportsBootstrap() public void pauseIncorrectCRC() { - // Only necessary for audio transport + // Only necessary for audio transport } - public void setHardwareHandshaking(boolean state) + public void setHardwareHandshaking(boolean state) throws SerialPortException { _hardware = state; - if (state) port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); - else + if (state) port.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); + else + port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); } public String getInstructionsDone(String guiString) { - Log.println(false,"SerialTransport.getInstructionsDone() getting instructions for: " + guiString); + Log.println(false, "SerialTransport.getInstructionsDone() getting instructions for: " + guiString); String ret = ""; - if ((guiString.equals(Messages.getString("Gui.BS.ProDOSFast"))) || (guiString.equals(Messages.getString("Gui.BS.ProDOSVSDrive")))) + if ((guiString.equals(Messages.getString("Gui.BS.ProDOSFast"))) + || (guiString.equals(Messages.getString("Gui.BS.ProDOSVSDrive")))) { _parent.setSerialSpeed(115200); // ret = Messages.getString("Gui.BS.DumpProDOSFastInstructionsDone"); } else if (guiString.equals(Messages.getString("Gui.BS.ProDOS"))) - { - ret = Messages.getString("Gui.BS.DumpProDOSInstructionsDone"); - } - else - if (guiString.equals(Messages.getString("Gui.BS.ProDOS2"))) { - ret = Messages.getString("Gui.BS.DumpProDOSInstructions2Done"); + ret = Messages.getString("Gui.BS.DumpProDOSInstructionsDone"); } else - if (guiString.equals(Messages.getString("Gui.BS.DOS"))) + if (guiString.equals(Messages.getString("Gui.BS.ProDOS2"))) { - ret = Messages.getString("Gui.BS.DumpDOSInstructionsDone"); + ret = Messages.getString("Gui.BS.DumpProDOSInstructions2Done"); } else - if (guiString.equals(Messages.getString("Gui.BS.SOS"))) + if (guiString.equals(Messages.getString("Gui.BS.DOS"))) { - //_parent.setSerialSpeed(9600); - /* ret = Messages.getString("Gui.BS.DumpSOSInstructionsDone"); */ + ret = Messages.getString("Gui.BS.DumpDOSInstructionsDone"); } + else + if (guiString.equals(Messages.getString("Gui.BS.SOS"))) + { + // _parent.setSerialSpeed(9600); + /* ret = Messages.getString("Gui.BS.DumpSOSInstructionsDone"); */ + } Log.println(false, "SerialTransport.getInstructionsDone() returning: " + ret); return ret; } @@ -534,36 +536,35 @@ public String getInstructionsDone(String guiString) public String getInstructions(String guiString, int fileSize, int speed) { String ret = "'SerialTransport.getInstructions() - returned null!'"; - if (guiString.equals(Messages.getString("Gui.BS.ProDOSFast"))) ret = Messages - .getString("Gui.BS.DumpProDOSFastInstructions"); - else - if (guiString.equals(Messages.getString("Gui.BS.ProDOSVSDrive"))) ret = Messages - .getString("Gui.BS.DumpProDOSVSDriveInstructions"); - else - if (guiString.equals(Messages.getString("Gui.BS.ProDOS"))) ret = Messages - .getString("Gui.BS.DumpProDOSInstructions"); + if (guiString.equals(Messages.getString("Gui.BS.ProDOSFast"))) + ret = Messages.getString("Gui.BS.DumpProDOSFastInstructions"); else - if (guiString.equals(Messages.getString("Gui.BS.ProDOS2"))) ret = Messages - .getString("Gui.BS.DumpProDOSInstructions2"); + if (guiString.equals(Messages.getString("Gui.BS.ProDOSVSDrive"))) + ret = Messages.getString("Gui.BS.DumpProDOSVSDriveInstructions"); else - if (guiString.equals(Messages.getString("Gui.BS.DOS"))) ret = Messages - .getString("Gui.BS.DumpDOSInstructions"); + if (guiString.equals(Messages.getString("Gui.BS.ProDOS"))) + ret = Messages.getString("Gui.BS.DumpProDOSInstructions"); else - if (guiString.equals(Messages.getString("Gui.BS.SOS"))) - ret = Messages.getString("Gui.BS.DumpSOSInstructions"); + if (guiString.equals(Messages.getString("Gui.BS.ProDOS2"))) + ret = Messages.getString("Gui.BS.DumpProDOSInstructions2"); else - if (guiString.equals(Messages.getString("Gui.BS.ADT"))) ret = Messages - .getString("Gui.BS.DumpADTInstructions"); + if (guiString.equals(Messages.getString("Gui.BS.DOS"))) + ret = Messages.getString("Gui.BS.DumpDOSInstructions"); else - if (guiString.equals(Messages.getString("Gui.BS.ADTPro"))) ret = Messages - .getString("Gui.BS.DumpProInstructions"); + if (guiString.equals(Messages.getString("Gui.BS.SOS"))) + ret = Messages.getString("Gui.BS.DumpSOSInstructions"); else - if (guiString.equals(Messages.getString("Gui.BS.ADTProAudio"))) ret = Messages - .getString("Gui.BS.DumpProAudioSerialInstructions"); + if (guiString.equals(Messages.getString("Gui.BS.ADT"))) + ret = Messages.getString("Gui.BS.DumpADTInstructions"); else - if (guiString.equals(Messages - .getString("Gui.BS.ADTProEthernet"))) ret = Messages - .getString("Gui.BS.DumpProEthernetInstructions"); + if (guiString.equals(Messages.getString("Gui.BS.ADTPro"))) + ret = Messages.getString("Gui.BS.DumpProInstructions"); + else + if (guiString.equals(Messages.getString("Gui.BS.ADTProAudio"))) + ret = Messages.getString("Gui.BS.DumpProAudioSerialInstructions"); + else + if (guiString.equals(Messages.getString("Gui.BS.ADTProEthernet"))) + ret = Messages.getString("Gui.BS.DumpProEthernetInstructions"); String baudCommand; switch (speed) { diff --git a/src/org/adtpro/utilities/Log.java b/src/org/adtpro/utilities/Log.java index 6d12f670..3b5e73ca 100644 --- a/src/org/adtpro/utilities/Log.java +++ b/src/org/adtpro/utilities/Log.java @@ -1,6 +1,6 @@ /* * ADTPro - Apple Disk Transfer ProDOS - * Copyright (C) 2007 by David Schmidt + * Copyright (C) 2007 - 2020 by David Schmidt * 1110325+david-schmidt@users.noreply.github.com * * This program is free software; you can redistribute it and/or modify it @@ -134,4 +134,9 @@ private synchronized static void allocateSingleton() if (null == _theSingleton) _theSingleton = new Log(); } + public boolean isLogging() + { + return _trace; + } + } \ No newline at end of file