# Makefile for system generation
# Targets
-export SUPER3_SYS=super3.sys
export SUPER2_SYS=super2.sys
-export SUPER3_SLST=super3.slst
export SUPER2_SLST=super2.slst
+
+export SUPER3_SYS=super3.sys
+export SUPER3_SLST=super3.slst
+
+export SUPER3_8K_SYS=super3_8k.sys
+export SUPER3_8K_SLST=super3_8k.slst
+
export DAP_SYS=dap.sys
export DAP_SLST=dap.slst
export SUPER_SIMPLE_SYS=super_simple.sys
export MAKE
-all: super3 super2 dap
+all: super3 super2 super3_8k dap
super2: $(SUPER2_SLST)
super3: $(SUPER3_SLST)
+super3_8k: $(SUPER3_8K_SLST)
+
dap: $(DAP_SLST)
$(SUPER_SIMPLE_SYS): $(LDR_APM_8K) $(PAL_AP) $(LDR_APM) $(LDR_DUMY)
$(CLEANUP2) $(BINAL) $(RESTART)
./build_super3.sh
+$(SUPER3_8K_SLST) $(SUPER3_8K_SYS): $(LDR_APM_8K) $(LDR_APM) $(LDR_DUMY) $(PRNTNZ)\
+ $(CLEANUP2) $(BINAL) $(RESTART)
+ ./build_super3_8k.sh
+
clean:
- @rm -f $(SUPER2_SLST) $(SUPER2_SYS) $(SUPER3_SLST) $(SUPER3_SYS) $(DAP_SYS) $(DAP_SLST)\
- $(SUPER_SIMPLE_SYS)
+ @rm -f $(SUPER2_SLST) $(SUPER2_SYS) $(SUPER3_SLST) $(SUPER3_8K_SLST)\
+ $(SUPER3_SYS) $(DAP_SYS) $(DAP_SLST)\
+ $(SUPER_SIMPLE_SYS)
+
+.PHONY: super3 super2 super3_8k super_simple
-.PHONY: super3
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+TARGET_SYS=$SUPER3_8K_SYS
+TARGET_SLST=$SUPER3_8K_SLST
+
+CORESIZE=8
+
+echo "TARGET_SYS --> $TARGET_SYS"
+echo "TARGET_SLST --> $TARGET_SLST"
+
+LAST_LOC=$((($CORESIZE*1024)-1))
+BASE=$(($CORESIZE*1024-010000))
+RESTART_BASE=$(($BASE+02000))
+
+SUPER_BASE=$RESTART_BASE
+LAST_USER_LOC=$(($SUPER_BASE-1))
+
+CLEANUP2_BASE=$(($BASE+02100))
+PRNTNZ_BASE=$(($BASE+02200))
+
+LOADER_BASE=$(($BASE+03000))
+LOADER_LAST_CLEAR_LOC=$(($LOADER_BASE+077))
+LOADER_LIMIT=$(($LOADER_BASE+02000))
+LOADER_START=$(($LOADER_BASE+03000))
+
+BINAL_BASE=$(($BASE+07000))
+PAL_AP_BASE=$BINAL_BASE
+PUNCH_BASE=$BINAL_BASE
+PUNCH_LAST_LOC=$(($BINAL_BASE+0577))
+
+LDR8_BASE=013000
+LDR8_START=016000
+LDR8_RESTART=016003
+LDR8_MAP=016002
+
+LOAD_LDR_APM=true
+LOAD_CLEANUP2=true
+LOAD_RESTART=true
+LOAD_PRNTNZ=true
+LOAD_PAL_AP=true
+LOAD_BINAL=
+
+DO_FILE=super3_8k.do
+
+octalize(){
+ for n in $*; do
+ eval "$n=\`printf \"0%o\" \$$n\`"
+ eval "printf \"%23s --> %05o\n\" $n \$$n"
+ done
+}
+
+FRESH_LOAD="true"
+
+load(){
+ printf "Load: %20s --> %o\n" $1 $2
+
+ ST=$LDR8_RESTART
+ if [ "$FRESH_LOAD" ]; then
+ ST=$LDR8_START
+ FRESH_LOAD=
+ fi
+
+ cat >>$DO_FILE <<EOF
+ echo *** Loading $1 --> $2 $ST
+ at ptr $1
+ d a $2
+ d p $ST
+ go
+ go
+EOF
+}
+
+boot(){
+ echo "Boot: $1"
+ cat > $DO_FILE <<EOF
+ at ptr $1
+ boot ptr
+EOF
+}
+
+process(){
+ for n in $*; do
+ cmd="if [ \"\$LOAD_$n\" ]; then load \"\$$n\" \$${n}_BASE; fi"
+# echo "Process command: " $cmd
+ eval $cmd
+ done
+}
+
+echo "\nAutomatic address generation:\n--------------"
+octalize BASE RESTART_BASE CLEANUP2_BASE PRNTNZ_BASE LOADER_BASE \
+ LOADER_START LOADER_LIMIT BINAL_BASE PAL_AP_BASE \
+ LDR8_BASE LDR8_START LDR8_RESTART LDR8_MAP \
+ LAST_USER_LOC LAST_LOC SUPER_BASE PUNCH_BASE PUNCH_LAST_LOC \
+ LOADER_LAST_CLEAR_LOC
+echo "--------------\n\n"
+
+
+# Determine if we have to load LDR-APM to somewhere else than
+# the default location where it comes from the original 8K tape. # This will load LDR-APM whenever something else than 8K memory is
+# requested.
+
+if [ $LOADER_BASE = $LDR8_BASE ]; then
+ echo "LDR-APM will be in the right place at once."
+ LOAD_LDR_APM=
+else
+ echo "LDR-APM will be loaded."
+ LOAD_LDR_APM=true
+fi
+
+if [ ! "$MAKE" ]; then
+ echo "Not run from within Makefile!"
+ exit 4
+fi
+
+rm -f $DO_FILE
+
+boot $LDR_APM_8K
+
+echo Patching loader for high memory load support...
+cat >> $DO_FILE <<EOF
+; enter high loader address for loading above itself
+d 15000 77777
+EOF
+
+process LDR_APM
+
+process RESTART CLEANUP2 PRNTNZ BINAL PAL_AP
+
+cat >> $DO_FILE <<EOF
+
+; Patching final loader.
+d $LOADER_LIMIT $LAST_USER_LOC
+
+; Print memory map
+go $LDR8_MAP
+
+; Clear memory
+d 20-$LAST_USER_LOC 0
+d $LOADER_BASE-$LOADER_LAST_CLEAR_LOC 0
+
+d a 0
+d b $LAST_LOC
+go $PRNTNZ_BASE
+
+; Settings for immediate load after sys restore
+r
+d p $LOADER_START
+
+save $TARGET_SYS
+
+at ptp $TARGET_SLST
+d a $0
+go $PUNCH_BASE
+d a $SUPER_BASE
+go
+d a $PUNCH_LAST_LOC
+go
+echo Complete.
+q
+EOF
+
+rm -f $TARGET_SLST
+h316 $DO_FILE
+#rm -f $DO_FILE