Skip to content

Commit

Permalink
Support a working release with a binary distributable
Browse files Browse the repository at this point in the history
  • Loading branch information
gungwald committed Aug 25, 2021
1 parent 10705b5 commit c6b7528
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 16 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,34 @@ iterative constructs in the source code. Using these dramatically reduces the nu
needed in your code and makes the logic much easier to understand. The generated code automatically
uses the shortest branch/jump sequence needed. More documentation for about this is available here:

http://www.obelisk.me.uk/dev65/
http://www.obelisk.me.uk/dev65/

## Requirements

Runtime: Java 1.6 or greater
Compile: Java 1.6 to Java 11

Although the sources are written to Java 1.4, there is a 3rd party jar file that requires Java 1.6 at
runtime. So you must have Java 1.6 or greater to run it. It doesn't matter if you have the JRE or JDK.

Additionally, IzPack, the installer component, requires at least Java 1.6.

To support the oldest possible Java at runtime, the compile step specifies Java 1.6 bytecode for the
output. This will be the format of the class files in dev65.jar. This means that Java 1.6 will be
required to run the code. But, at most Java 11 is require to perform the compile step because it is
the last version to be able to generate bytecode as old as Java 1.6.

Why is support being provided for a version of Java as old as 1.6? Why not only support the latest
version of Java? To answer that, ask yourself why you want an assembler for a CPU as old as the 6502.
Additionally, the latest version of Java is only available for the latest versions of Linux, Mac,
and Windows on 64-bit AMD/Intel hardware. If you have older hardware, non-Intel hardware, and/or
an older operating system, you can't run the lastest version of Java. So, supporting the oldest
version of Java possible expands the types of systems this software will run on. To achieve,
"Write once, run anywhere" an older version of Java is required. For example,
it would be preferrable to support these older system which were supported until the most recent code
was added:

Mac G3 - can run MacOS 10.3 at most - Java 1.4 at most
Mac G4 - can run MacOS 10.4 at most - Java 1.5 at most
Solaris 8 - Java 1.5 at most

6 changes: 1 addition & 5 deletions build-installer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
</locale>

<guiprefs width="740" height="380" resizable="yes">
<!--
<modifier key="useHeadingPanel" value="yes" />
<modifier key="headingFontSize" value="1.5"/>
<modifier key="labelFontSize" value="1.5"/>
-->
</guiprefs>

<panels>
Expand Down Expand Up @@ -56,7 +52,7 @@
<os family="mac" />
<os family="windows" />
<args>
<arg value='"$INSTALL_PATH"/bin'/>
<arg value="$INSTALL_PATH/bin"/>
</args>
</executable>
</pack>
Expand Down
10 changes: 9 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<property name="app.installer.setup.dir" value="${build.dir}/${ant.project.name}-setup"/>
<property name="app.installer" value="${build.dir}/${ant.project.name}-setup.jar"/>
<property name="javac-1.4" value="${user.home}/Dropbox/opt/j2sdk1.4.2/j2sdk1.4.2_19/bin/javac"/>
<property name="javac-1.5" value="${user.home}/Dropbox/opt/jdk1.5.0/jdk1.5.0_22/bin/javac"/>

<path id="lib.path">
<fileset dir="${izpack.dist}" includes="**/*.jar"/>
Expand Down Expand Up @@ -67,7 +68,7 @@
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}"
destdir="${classes.dir}" includeantruntime="false"
fork="yes" executable="${javac-1.4}">
source="1.6" target="1.6">
<src path="src"/>
<src path="src-65016"/>
<classpath refid="dev65.classpath"/>
Expand Down Expand Up @@ -111,4 +112,11 @@
izPackDir="${izpack.dist}"/>
</target>

<target name="dist-zip" depends="installer">
<zip destfile="build/dev65-setup.zip">
<zipfileset dir="scripts" includes="dev65-setup.*"/>
<zipfileset dir="build" includes="dev65-setup.jar"/>
</zip>
</target>

</project>
20 changes: 12 additions & 8 deletions scripts/add-to-path
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#!/bin/sh

# Script: add-to-path.bat
# Script: add-to-path.sh
# Author: Bill Chatfield
# License: GPL2

findDotProfile()
{
for f in .bash_profile .profile
do
profile="$HOME"/"$f"
if [ -n "$SUDO_USER" ]
then
profile=/home/$SUDO_USER/$f
else
profile="$HOME"/"$f"
fi
if [ -f "$profile" ]
then
echo $profile
Expand All @@ -19,28 +23,28 @@ findDotProfile()

addSingleDirToPath()
{
if echo $PATH | grep -q "$1"
if grep -eq "^export PATH=.*:$1" "$2"
then
echo $1 is already in the PATH.
else
echo Run this: export PATH=\$PATH:$1
echo export PATH=\$PATH:$1 >> "$profile"
echo export PATH=\$PATH:$1 >> "$2"
fi
}

addToPath()
{
profile=`findDotProfile`
if [ $# -eq 0 ]
then
addSingleDirToPath `pwd`
addSingleDirToPath `pwd` "$profile"
else
for directory in "$@"
do
addSingleDirToPath "$directory"
addSingleDirToPath "$directory" "$profile"
done
fi
}

findDotProfile
addToPath "$@"

1 change: 0 additions & 1 deletion scripts/add-to-path.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ rem @echo off

rem Script: add-to-path.bat
rem Author: Bill Chatfield
rem License: GPL2

rem
rem Check for help argument.
Expand Down
1 change: 1 addition & 0 deletions scripts/dev65-setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@java -Dsun.java2d.uiScale=2 -Dsun.java2d.uiScale.enabled=true -jar %~dpn0.jar
18 changes: 18 additions & 0 deletions scripts/dev65-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

getAbsolutePath()
{
if [ -d "$1" ]
then
(cd "$1" && $(pwd) || exit)
else
(cd $(dirname "$1") && echo $(pwd)/$(basename "$1") || exit)
fi
}

SELF=$(getAbsolutePath "$0")
SELF_DIR=$(dirname "$SELF")
JAR="$SELF_DIR"/$(basename --suffix=.sh "$0").jar
JVM_OPTS="-Dsun.java2d.uiScale=2 -Dsun.java2d.uiScale.enabled=true"

java $JVM_OPTS -jar "$JAR"

0 comments on commit c6b7528

Please sign in to comment.