Just syncing for backup. Installer started.
This commit is contained in:
parent
1907191dcd
commit
51ebd46b1f
13 changed files with 483 additions and 58 deletions
|
@ -14,18 +14,11 @@ JOEY_HEADERS = \
|
||||||
|
|
||||||
JOEY_LIBS = \
|
JOEY_LIBS = \
|
||||||
-L$$JOEY/dist/linux/x64 \
|
-L$$JOEY/dist/linux/x64 \
|
||||||
-Wl,-rpath,$$JOEY/dist/linux/x64 \
|
-ljoeylib \
|
||||||
-Wl,--enable-new-dtags \
|
|
||||||
-l:joeylib.a \
|
|
||||||
-Wl,--no-undefined \
|
|
||||||
-ldl \
|
-ldl \
|
||||||
-lsndio \
|
-lpthread
|
||||||
-lpthread \
|
|
||||||
-lrt \
|
|
||||||
-lm
|
|
||||||
|
|
||||||
JOEY_FLAGS = \
|
JOEY_FLAGS = \
|
||||||
-pthread \
|
|
||||||
-D_REENTRANT
|
-D_REENTRANT
|
||||||
|
|
||||||
SDL_IMAGE_LIBS = \
|
SDL_IMAGE_LIBS = \
|
||||||
|
|
|
@ -125,6 +125,8 @@ int main(int argc, char *argv[]) {
|
||||||
jlKeyWaitForAny();
|
jlKeyWaitForAny();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jlStaFree(sta);
|
||||||
|
|
||||||
IMG_Quit();
|
IMG_Quit();
|
||||||
jlUtilShutdown();
|
jlUtilShutdown();
|
||||||
}
|
}
|
||||||
|
|
145
installer.sh
Executable file
145
installer.sh
Executable file
|
@ -0,0 +1,145 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
|
||||||
|
# --- COLLECT AND CHECK COMMAND LINE ARGUMENTS
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [-o PathToORCA.iso] [-i PathForInstall]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
while getopts ":o:i:" OPT; do
|
||||||
|
case ${OPT} in
|
||||||
|
o )
|
||||||
|
ORCA=${OPTARG}
|
||||||
|
;;
|
||||||
|
i )
|
||||||
|
INSTALL=${OPTARG}
|
||||||
|
;;
|
||||||
|
\? )
|
||||||
|
echo "Invalid option: ${OPTARG}"
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
: )
|
||||||
|
echo "Invalid option: ${OPTARG} requires an argument"
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND -1))
|
||||||
|
|
||||||
|
if [ -z "${ORCA}" ] || [ -z "${INSTALL}" ]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${ORCA}" ]; then
|
||||||
|
echo "Must specify the location of the ORCA ISO."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "${ORCA}" ]; then
|
||||||
|
echo "Unable to locate the ORCA ISO at \"${ORCA}\"."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ORCA=`realpath "${ORCA}"`
|
||||||
|
|
||||||
|
if [ -z "${INSTALL}" ]; then
|
||||||
|
echo "Must specify the location to install the JoeyLib SDK."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
INSTALL=`realpath "${INSTALL}"`
|
||||||
|
|
||||||
|
if [ -e "${INSTALL}" ]; then
|
||||||
|
echo "The specified installation path, \"${INSTALL}\" already exists."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# --- INSTALL NEEDED PACKAGES
|
||||||
|
|
||||||
|
getPackages() {
|
||||||
|
sudo dpkg --add-architecture i386
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install cmake ragel hfsplus hfsutils hfsprogs libreadline-dev libedit-dev
|
||||||
|
sudo apt-get -y install build-essential git mercurial texinfo libtool autoconf automake
|
||||||
|
sudo apt-get -y install gcc-multilib g++-multilib mingw-w64 gdb-mingw-w64 clang llvm-dev libxml2-dev
|
||||||
|
sudo apt-get -y install uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio
|
||||||
|
sudo apt-get -y install libpulse-dev{,:i386} libasound-dev{,:i386}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# --- INSTALL GOLDENGATE
|
||||||
|
|
||||||
|
installGG() {
|
||||||
|
#git clone git@gitlab.com:GoldenGate/GoldenGate.git
|
||||||
|
if [ ! -d GoldenGate ]; then
|
||||||
|
echo "Unable to clone the GoldenGate repository!"
|
||||||
|
echo "Must be a paying member of the GoldenGate project!"
|
||||||
|
echo "See: https://goldengate.gitlab.io/about/"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pushd GoldenGate
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
PREFIX=`pwd`/installed
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
#cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} .. | tee make.out
|
||||||
|
#make | tee -a make.out
|
||||||
|
if [ ! -e bin/iix ]; then
|
||||||
|
echo "Failed to build GoldenGate."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cp -f bin/{iix,dumpobj,opus-extractor} "${IIGS}/."
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# --- INSTALL ORCA SUITE ON HFS VOLUME
|
||||||
|
|
||||||
|
updateOrca() {
|
||||||
|
COMPONENT=$1
|
||||||
|
URL=`curl -s https://api.github.com/repos/byteworksinc/${COMPONENT}/releases \
|
||||||
|
| grep "browser_download_url.*2mg" \
|
||||||
|
| cut -d : -f 2,3 \
|
||||||
|
| tr -d \" \
|
||||||
|
| head -n 1`
|
||||||
|
FILE=${URL##*/}
|
||||||
|
wget ${URL}
|
||||||
|
${IIGS}/opus-extractor -v -s / ${FILE} ${IIGS}/ORCA
|
||||||
|
}
|
||||||
|
|
||||||
|
installOrca() {
|
||||||
|
fallocate -l 32M "${IIGS}/hfsDrive.img"
|
||||||
|
mkfs.hfs -v IIgs "${IIGS}/hfsDrive.img"
|
||||||
|
IIGSDISK=$(sudo losetup --partscan --find --show "${IIGS}/hfsDrive.img")
|
||||||
|
mkdir -p "${IIGS}/ORCA"
|
||||||
|
sudo mount ${IIGSDISK} "${IIGS}/ORCA"
|
||||||
|
sudo chown -R `id -ru`:`id -rg` "${IIGS}/ORCA"
|
||||||
|
isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORK.S
|
||||||
|
${IIGS}/opus-extractor -v BYTEWORK.S ${IIGS}/ORCA
|
||||||
|
updateOrca ORCA-C
|
||||||
|
sudo umount "${IIGS}/ORCA"
|
||||||
|
sudo losetup -d ${IIGSDISK}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# --- MAIN
|
||||||
|
|
||||||
|
mkdir -p installerWork
|
||||||
|
pushd installerWork
|
||||||
|
|
||||||
|
IIGS=${INSTALL}/sdks/IIgs
|
||||||
|
|
||||||
|
mkdir -p "${IIGS}"
|
||||||
|
|
||||||
|
#getPackages
|
||||||
|
installGG
|
||||||
|
installOrca
|
||||||
|
|
||||||
|
popd
|
|
@ -4,51 +4,69 @@ TARGET=${JOEY}/sdks/iix/IIgs/out/${PROJECT}
|
||||||
GSTARGET=31:/out/${PROJECT}
|
GSTARGET=31:/out/${PROJECT}
|
||||||
CADIUS=${JOEY}/sdks/iix/cadius-git/bin/release/cadius
|
CADIUS=${JOEY}/sdks/iix/cadius-git/bin/release/cadius
|
||||||
VOL=Import
|
VOL=Import
|
||||||
IMPORT=/tmp/IIgs/import.po
|
WORK=/tmp/IIgs
|
||||||
|
IMPORT=${WORK}/import.po
|
||||||
|
|
||||||
|
# Clean up target and working directories
|
||||||
if [ -d ${TARGET} ]; then
|
if [ -d ${TARGET} ]; then
|
||||||
rm -rf ${TARGET}
|
rm -rf ${TARGET}
|
||||||
fi
|
fi
|
||||||
mkdir -p ${TARGET}
|
mkdir -p ${TARGET}
|
||||||
|
|
||||||
rm /tmp/IIgs/_FileInformation.txt || true 2> /dev/null
|
if [ -d ${WORK} ]; then
|
||||||
rm /tmp/IIgs/JLSTATS#040000 || true 2> /dev/null
|
rm -rf ${WORK}
|
||||||
rm ${IMPORT} || true 2> /dev/null
|
fi
|
||||||
|
mkdir -p ${WORK}
|
||||||
|
|
||||||
|
# We temporarily need a local copy of the joey header
|
||||||
cp -f ${JOEY}/dist/joey.h .
|
cp -f ${JOEY}/dist/joey.h .
|
||||||
|
|
||||||
|
# Make a list of files to compile, iterate over them
|
||||||
CFILES=($(ls -1 *.c))
|
CFILES=($(ls -1 *.c))
|
||||||
OFILES=""
|
OFILES=""
|
||||||
for F in "${CFILES[@]}"; do
|
for F in "${CFILES[@]}"; do
|
||||||
O=${F%.*}
|
O=${F%.*}
|
||||||
|
# If this file is named 'main' we don't add it to the link list until later
|
||||||
if [ "${O}" != "main" ]; then
|
if [ "${O}" != "main" ]; then
|
||||||
OFILES="${OFILES} ${GSTARGET}/${O}"
|
OFILES="${OFILES} ${GSTARGET}/${O}"
|
||||||
fi
|
fi
|
||||||
echo "Compiling ${F}..."
|
echo "Compiling ${F}..."
|
||||||
iix compile ${F} keep=${GSTARGET}/${O}
|
iix compile ${F} keep=${GSTARGET}/${O}
|
||||||
done
|
done
|
||||||
rm joey.h
|
# Be sure 'main' is first in the link list
|
||||||
OFILES="${GSTARGET}/main ${OFILES} 13:joeylib"
|
OFILES="${GSTARGET}/main ${OFILES} ${GSTARGET}/joeylib"
|
||||||
|
|
||||||
cp -f ${JOEY}/dist/IIgs/joeylib#b20000 ${JOEY}/sdks/iix/IIgs/Libraries/joeylib
|
# Clean up
|
||||||
iix chtyp -t lib ${JOEY}/sdks/iix/IIgs/Libraries/joeylib
|
rm joey.h
|
||||||
|
|
||||||
|
# We need a local copy of joeylib to link
|
||||||
|
cp -f ${JOEY}/dist/IIgs/joeylib#b20000 ${TARGET}/joeylib
|
||||||
|
iix chtyp -t lib ${GSTARGET}/joeylib
|
||||||
|
|
||||||
|
# Link our program and create a map file
|
||||||
iix -DKeepType=S16 link +L ${OFILES} keep=${GSTARGET}/${PROJECT}#b30000 > ${PROJECT}.map
|
iix -DKeepType=S16 link +L ${OFILES} keep=${GSTARGET}/${PROJECT}#b30000 > ${PROJECT}.map
|
||||||
|
|
||||||
|
# Create a disassembly and linker input listing
|
||||||
iix dumpobj +D ${GSTARGET}/${PROJECT}#b30000 &> ${PROJECT}.dis || true
|
iix dumpobj +D ${GSTARGET}/${PROJECT}#b30000 &> ${PROJECT}.dis || true
|
||||||
echo ${OFILES} > ${PROJECT}.lnk
|
echo ${OFILES} > ${PROJECT}.lnk
|
||||||
|
|
||||||
|
# Did they ask for GSPlus to be executed?
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
mkdir -p /tmp/IIgs
|
# Be sure our work directories exists
|
||||||
|
mkdir -p ${WORK}/{data,source}
|
||||||
|
|
||||||
|
# Create disk image, setting known file types
|
||||||
${CADIUS} createvolume ${IMPORT} ${VOL} 32MB > /dev/null
|
${CADIUS} createvolume ${IMPORT} ${VOL} 32MB > /dev/null
|
||||||
${CADIUS} createfolder ${IMPORT} ${VOL}/data > /dev/null
|
${CADIUS} createfolder ${IMPORT} ${VOL}/data > /dev/null
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL} ${TARGET}/${PROJECT}#b30000 > /dev/null
|
${CADIUS} addfile ${IMPORT} ${VOL} ${TARGET}/${PROJECT}#b30000 > /dev/null
|
||||||
mkdir -p /tmp/IIgs/data
|
|
||||||
for F in "${DATA[@]}"; do
|
for F in "${DATA[@]}"; do
|
||||||
N=/tmp/IIgs/data/`basename ${F}`#060000
|
N=${WORK}/data/`basename ${F}`#060000
|
||||||
cp -f ${F} ${N}
|
cp -f ${F} ${N}
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL}/data ${N} > /dev/null
|
${CADIUS} addfile ${IMPORT} ${VOL}/data ${N} > /dev/null
|
||||||
rm ${N}
|
rm ${N}
|
||||||
done
|
done
|
||||||
|
|
||||||
mkdir -p /tmp/IIgs/source
|
# If they asked for source to be copied to the image, copy it and set the type
|
||||||
for S in "${SOURCE[@]}"; do
|
for S in "${SOURCE[@]}"; do
|
||||||
for F in `ls -1 ${S}`; do
|
for F in `ls -1 ${S}`; do
|
||||||
tr "\n" "\r" < ${F} > /tmp/IIgs/source/${F}#040000
|
tr "\n" "\r" < ${F} > /tmp/IIgs/source/${F}#040000
|
||||||
|
@ -57,13 +75,16 @@ if [ ! -z $1 ]; then
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Launch GSPlus
|
||||||
pushd ${JOEY}/sdks/iix/gsplus
|
pushd ${JOEY}/sdks/iix/gsplus
|
||||||
./gsplus -config IIgsTest.cfg || true
|
./gsplus -resizeable -config IIgsTest.cfg || true
|
||||||
popd
|
popd
|
||||||
${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS /tmp/IIgs/. > /dev/null
|
|
||||||
if [ -e /tmp/IIgs/JLSTATS#040000 ]; then
|
# Extract and display the results of the run
|
||||||
|
${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS ${WORK}/. > /dev/null
|
||||||
|
if [ -e ${WORK}/JLSTATS#040000 ]; then
|
||||||
echo ""
|
echo ""
|
||||||
cat /tmp/IIgs/JLSTATS#040000 | tr "\r" "\n" 2> /dev/null
|
cat ${WORK}/JLSTATS#040000 | tr "\r" "\n" 2> /dev/null
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -27,14 +27,16 @@ popd
|
||||||
|
|
||||||
mkdir -p ${JOEY}/dist/IIgs
|
mkdir -p ${JOEY}/dist/IIgs
|
||||||
cp -f ${JOEY}/joeylib/joeylib/lib/IIgs/Tool221#ba0000 ${JOEY}/dist/IIgs/.
|
cp -f ${JOEY}/joeylib/joeylib/lib/IIgs/Tool221#ba0000 ${JOEY}/dist/IIgs/.
|
||||||
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
|
|
||||||
cp -f ${OUT}/joeylib ${JOEY}/dist/IIgs/joeylib#b20000
|
cp -f ${OUT}/joeylib ${JOEY}/dist/IIgs/joeylib#b20000
|
||||||
|
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
|
||||||
|
cp -f ${JOEY}/joeylib/joeylib/build-IIgs.helper.sh ${JOEY}/dist/IIgs/.
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
CADIUS=${JOEY}/sdks/iix/cadius-git/bin/release/cadius
|
CADIUS=${JOEY}/sdks/iix/cadius-git/bin/release/cadius
|
||||||
IMPORT=/tmp/import.po
|
IMPORT=/tmp/IIgs/import.po
|
||||||
VOL=Import
|
VOL=Import
|
||||||
|
|
||||||
|
mkdir -p `dirname ${IMPORT}`
|
||||||
rm ${OUT}/JLSTATS 2> /dev/null || true
|
rm ${OUT}/JLSTATS 2> /dev/null || true
|
||||||
rm ${IMPORT} 2> /dev/null || true
|
rm ${IMPORT} 2> /dev/null || true
|
||||||
|
|
||||||
|
@ -53,9 +55,13 @@ if [ ! -z $1 ]; then
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/music.w#060000 > /dev/null
|
${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/music.w#060000 > /dev/null
|
||||||
|
|
||||||
pushd ${JOEY}/sdks/iix/gsplus
|
pushd ${JOEY}/sdks/iix/gsplus
|
||||||
./gsplus -config IIgsTest.cfg || true
|
./gsplus -resizeable -config IIgsTest.cfg || true
|
||||||
popd
|
popd
|
||||||
echo ""
|
echo ""
|
||||||
${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS ${OUT} > /dev/null
|
${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS /tmp/IIgs/. > /dev/null
|
||||||
cat ${OUT}/JLSTATS#040000 2> /dev/null
|
if [ -e /tmp/IIgs/JLSTATS#040000 ]; then
|
||||||
|
echo ""
|
||||||
|
cat /tmp/IIgs/JLSTATS#040000 | tr "\r" "\n" 2> /dev/null
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -42,7 +42,6 @@ DIST="${JOEY}/dist/linux/x64"
|
||||||
INSTALLED="${JOEY}/SDL2/installed/linux/x64/lib"
|
INSTALLED="${JOEY}/SDL2/installed/linux/x64/lib"
|
||||||
doBuild
|
doBuild
|
||||||
|
|
||||||
:<<SKIP
|
|
||||||
CC="gcc"
|
CC="gcc"
|
||||||
CFLAGS="-m32"
|
CFLAGS="-m32"
|
||||||
LDFLAGS=""
|
LDFLAGS=""
|
||||||
|
@ -77,6 +76,6 @@ LDFLAGS=""
|
||||||
DIST="${JOEY}/dist/macos/x64"
|
DIST="${JOEY}/dist/macos/x64"
|
||||||
INSTALLED="${JOEY}/SDL2/installed/macos/x64/lib"
|
INSTALLED="${JOEY}/SDL2/installed/macos/x64/lib"
|
||||||
doBuild
|
doBuild
|
||||||
SKIP
|
|
||||||
|
|
||||||
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
|
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
|
||||||
|
cp -f ${JOEY}/joeylib/joeylib/joey.pri ${JOEY}/dist/.
|
||||||
|
|
34
joeylib/joey.pri
Normal file
34
joeylib/joey.pri
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
CONFIG += console
|
||||||
|
CONFIG -= \
|
||||||
|
app_bundle \
|
||||||
|
qt
|
||||||
|
|
||||||
|
JOEY = /home/scott/joey
|
||||||
|
|
||||||
|
JOEY_INCLUDES = \
|
||||||
|
$$JOEY/dist
|
||||||
|
|
||||||
|
JOEY_HEADERS = \
|
||||||
|
$$JOEY/dist/joey.h
|
||||||
|
|
||||||
|
JOEY_LIBS = \
|
||||||
|
-L$$JOEY/dist/linux/x64 \
|
||||||
|
-ljoeylib \
|
||||||
|
-ldl \
|
||||||
|
-lpthread
|
||||||
|
|
||||||
|
JOEY_FLAGS = \
|
||||||
|
-D_REENTRANT
|
||||||
|
|
||||||
|
QMAKE_CFLAGS += \
|
||||||
|
$$JOEY_FLAGS
|
||||||
|
|
||||||
|
INCLUDEPATH += \
|
||||||
|
$$JOEY_INCLUDES
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
$$JOEY_HEADERS
|
||||||
|
|
||||||
|
LIBS += \
|
||||||
|
$$JOEY_LIBS
|
||||||
|
|
|
@ -46,6 +46,188 @@ t equ 1
|
||||||
|
|
||||||
phb ; Push our current data bank onto the stack
|
phb ; Push our current data bank onto the stack
|
||||||
|
|
||||||
|
; ***TODO*** Mask off unused bits so they can be used for other things elsewhere
|
||||||
|
; Find offset into tile memory
|
||||||
|
clc
|
||||||
|
lda cx1 ; Multiply cx1 by 4 to get offset (two pixels per byte)
|
||||||
|
asl a
|
||||||
|
asl a
|
||||||
|
sta t
|
||||||
|
clc
|
||||||
|
lda cy1 ; Multiply cy1 by 16 to get index into scanline table
|
||||||
|
asl a
|
||||||
|
asl a
|
||||||
|
asl a
|
||||||
|
asl a ; y1 is now in the accumulator
|
||||||
|
clc
|
||||||
|
tax
|
||||||
|
lda >ScanTable,x
|
||||||
|
adc t ; Add t to scanline offset
|
||||||
|
tay ; Offset to start of tile
|
||||||
|
; Find offset into shadow SHR memory
|
||||||
|
clc
|
||||||
|
lda cx2 ; Multiply cx1 by 4 to get offset (two pixels per byte)
|
||||||
|
asl a
|
||||||
|
asl a
|
||||||
|
sta t
|
||||||
|
clc
|
||||||
|
lda cy2 ; Multiply cy1 by 16 to get index into scanline table
|
||||||
|
asl a
|
||||||
|
asl a
|
||||||
|
asl a
|
||||||
|
asl a ; y2 is now in the accumulator
|
||||||
|
clc
|
||||||
|
tax
|
||||||
|
lda >ScanTable,x
|
||||||
|
adc t ; Add t to scanline offset
|
||||||
|
tax ; Offset to start of screen memory
|
||||||
|
|
||||||
|
sei ; Disable interrupts while we change data banks
|
||||||
|
pea $0101 ; Push Effective Address (our new data bank) always 16 bits
|
||||||
|
plb ; Pull data bank from stack (data bank now $01)
|
||||||
|
plb ; Do it twice because it's only an 8 bit operation
|
||||||
|
|
||||||
|
; Row 1
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
; Move to row 2
|
||||||
|
txa
|
||||||
|
adc #158 ; Next line
|
||||||
|
tax
|
||||||
|
tya
|
||||||
|
adc #158 ; Next line
|
||||||
|
tay
|
||||||
|
; Row 2
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
; Move to row 3
|
||||||
|
txa
|
||||||
|
adc #158 ; Next line
|
||||||
|
tax
|
||||||
|
tya
|
||||||
|
adc #158 ; Next line
|
||||||
|
tay
|
||||||
|
; Row 3
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
; Move to row 4
|
||||||
|
txa
|
||||||
|
adc #158 ; Next line
|
||||||
|
tax
|
||||||
|
tya
|
||||||
|
adc #158 ; Next line
|
||||||
|
tay
|
||||||
|
; Row 4
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
; Move to row 5
|
||||||
|
txa
|
||||||
|
adc #158 ; Next line
|
||||||
|
tax
|
||||||
|
tya
|
||||||
|
adc #158 ; Next line
|
||||||
|
tay
|
||||||
|
; Row 5
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
; Move to row 6
|
||||||
|
txa
|
||||||
|
adc #158 ; Next line
|
||||||
|
tax
|
||||||
|
tya
|
||||||
|
adc #158 ; Next line
|
||||||
|
tay
|
||||||
|
; Row 6
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
; Move to row 7
|
||||||
|
txa
|
||||||
|
adc #158 ; Next line
|
||||||
|
tax
|
||||||
|
tya
|
||||||
|
adc #158 ; Next line
|
||||||
|
tay
|
||||||
|
; Row 7
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
; Move to row 8
|
||||||
|
txa
|
||||||
|
adc #158 ; Next line
|
||||||
|
tax
|
||||||
|
tya
|
||||||
|
adc #158 ; Next line
|
||||||
|
tay
|
||||||
|
; Row 8
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
inx ; Move to next pixel quad
|
||||||
|
inx
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [p],y ; Load 4 pixels from SHA data
|
||||||
|
sta |SHRShad,x ; Store 4 pixels into screen
|
||||||
|
|
||||||
|
plb ; Pull original data bank from stack
|
||||||
|
cli ; Restore interrupts
|
||||||
|
|
||||||
|
jreturn
|
||||||
|
end
|
||||||
|
|
||||||
|
;----------------------------------------
|
||||||
|
; Blit an 8x8 block from off-screen to back buffer with alpha.
|
||||||
|
;----------------------------------------
|
||||||
|
asmB88a start
|
||||||
|
|
||||||
|
t equ 1
|
||||||
|
|
||||||
|
jsubroutine (4:p,2:cx1,2:cy1,2:cx2,2:cy2,2:alpha),2
|
||||||
|
using ScanTable
|
||||||
|
|
||||||
|
phb ; Push our current data bank onto the stack
|
||||||
|
|
||||||
|
; ***TODO*** Mask off unused bits so they can be used for other things elsewhere
|
||||||
; Find offset into tile memory
|
; Find offset into tile memory
|
||||||
clc
|
clc
|
||||||
lda cx1 ; Multiply cx1 by 4 to get offset (two pixels per byte)
|
lda cx1 ; Multiply cx1 by 4 to get offset (two pixels per byte)
|
||||||
|
|
|
@ -66,14 +66,14 @@ extern pascal void NTContinueMusic(void) inline(0x14DD, dispatcher);
|
||||||
char _jlKeyCheck(char key);
|
char _jlKeyCheck(char key);
|
||||||
|
|
||||||
|
|
||||||
static byte *KEYBOARD = (byte *)0x00C000;
|
static byte *KEYBOARD = (byte *)0x00C000L;
|
||||||
static byte *KEYSTROBE = (byte *)0x00C010;
|
static byte *KEYSTROBE = (byte *)0x00C010L;
|
||||||
static byte *BUTTON0 = (byte *)0x00C061;
|
static byte *BUTTON0 = (byte *)0x00C061L;
|
||||||
static byte *BUTTON1 = (byte *)0x00C062;
|
static byte *BUTTON1 = (byte *)0x00C062L;
|
||||||
static jlPixelPairT *SHRPIXELS = (jlPixelPairT *)0x012000; // Shadow of 0xE12000
|
static jlPixelPairT *SHRPIXELS = (jlPixelPairT *)0x012000L; // Shadow of 0xE12000
|
||||||
static byte *SHRSCB = (byte *)0x019D00; // Shadow of 0xE19D00
|
static byte *SHRSCB = (byte *)0x019D00L; // Shadow of 0xE19D00
|
||||||
static jlColorT *SHRCOLORS = (jlColorT *)0x019E00; // Shadow of 0xE19E00
|
static jlColorT *SHRCOLORS = (jlColorT *)0x019E00L; // Shadow of 0xE19E00
|
||||||
static byte *BORDER = (byte *)0xE0C034;
|
static byte *BORDER = (byte *)0xE0C034L;
|
||||||
|
|
||||||
|
|
||||||
static byte _jlBorderSaved;
|
static byte _jlBorderSaved;
|
||||||
|
@ -95,7 +95,6 @@ void _jlDieWithToolError(const char *what, int err) {
|
||||||
void _jlDebugBorder(jlBorderColorsE color) {
|
void _jlDebugBorder(jlBorderColorsE color) {
|
||||||
jlDisplayBorder(color);
|
jlDisplayBorder(color);
|
||||||
asmBorder(_jlBorderColor);
|
asmBorder(_jlBorderColor);
|
||||||
//*BORDER = *BORDER & 0xF0 | _jlBorderColor;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define JOEY_CHECK_TOOL_ERROR(w)
|
#define JOEY_CHECK_TOOL_ERROR(w)
|
||||||
|
@ -195,6 +194,11 @@ void jlPaletteSet(byte index, byte r, byte g, byte b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSetFromSta(jlStaT *sta) {
|
||||||
|
memcpy(SHRCOLORS, sta->palette, sizeof(sta->palette));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void jlSoundFree(jlSoundT *sound) {
|
void jlSoundFree(jlSoundT *sound) {
|
||||||
//***TODO***
|
//***TODO***
|
||||||
}
|
}
|
||||||
|
@ -312,8 +316,6 @@ void jlUtilStartup(char *appTitle) {
|
||||||
|
|
||||||
(void)appTitle; // Unused on IIgs
|
(void)appTitle; // Unused on IIgs
|
||||||
|
|
||||||
_jlDebugBorder(BORDER_DEEP_RED);
|
|
||||||
|
|
||||||
// Start up neded tools
|
// Start up neded tools
|
||||||
TLStartUp();
|
TLStartUp();
|
||||||
_jlMyID = MMStartUp();
|
_jlMyID = MMStartUp();
|
||||||
|
@ -325,6 +327,7 @@ void jlUtilStartup(char *appTitle) {
|
||||||
|
|
||||||
// Reserve shadow area for SHR
|
// Reserve shadow area for SHR
|
||||||
_jlSHRShadowHandle = NewHandle((LongWord)0x8000, (Word)_jlMemID, (Word)(attrLocked + attrFixed + attrBank + attrAddr), (Pointer)0x012000);
|
_jlSHRShadowHandle = NewHandle((LongWord)0x8000, (Word)_jlMemID, (Word)(attrLocked + attrFixed + attrBank + attrAddr), (Pointer)0x012000);
|
||||||
|
JOEY_CHECK_TOOL_ERROR("NewHandle")
|
||||||
|
|
||||||
// Start assembly module
|
// Start assembly module
|
||||||
_jlHertz = (int)ReadBParam((Word)0x1D) == 0 ? 60 : 50; // Is this a PAL or NTSC machine?
|
_jlHertz = (int)ReadBParam((Word)0x1D) == 0 ? 60 : 50; // Is this a PAL or NTSC machine?
|
||||||
|
|
|
@ -160,7 +160,8 @@ void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2)
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
o1 = (cy1 * 8 * 160) + (cx1 * 4);
|
// We mask off unused bits in the source tile location so they can be used to hold other data.
|
||||||
|
o1 = ((cy1 & 0x1f) * 8 * 160) + ((cx1 & 0x3f) * 4);
|
||||||
o2 = (cy2 * 8 * 160) + (cx2 * 4);
|
o2 = (cy2 * 8 * 160) + (cx2 * 4);
|
||||||
|
|
||||||
for (y=0; y<8; y++) {
|
for (y=0; y<8; y++) {
|
||||||
|
@ -173,6 +174,36 @@ void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlit8x8a(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte alpha) {
|
||||||
|
int o1;
|
||||||
|
int o2;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
jlPixelPairT p;
|
||||||
|
jlPixelPairT t;
|
||||||
|
|
||||||
|
// We mask off unused bits in the source tile location so they can be used to hold other data.
|
||||||
|
o1 = ((cy1 & 0x1f) * 8 * 160) + ((cx1 & 0x3f) * 4);
|
||||||
|
o2 = (cy2 * 8 * 160) + (cx2 * 4);
|
||||||
|
|
||||||
|
for (y=0; y<8; y++) {
|
||||||
|
for (x=0; x<4; x++) {
|
||||||
|
p = sta->pixels[o1++];
|
||||||
|
t = _jlBackingStore->pixels[o2];
|
||||||
|
if (p.l != alpha) {
|
||||||
|
t.l = p.l;
|
||||||
|
}
|
||||||
|
if (p.r != alpha) {
|
||||||
|
t.r = p.r;
|
||||||
|
}
|
||||||
|
_jlBackingStore->pixels[o2++] = t;
|
||||||
|
}
|
||||||
|
o1 += 156;
|
||||||
|
o2 += 156;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void jlDrawClear(void) {
|
void jlDrawClear(void) {
|
||||||
memset(_jlBackingStore->pixels, _jlDrawColorNibbles, 32000);
|
memset(_jlBackingStore->pixels, _jlDrawColorNibbles, 32000);
|
||||||
}
|
}
|
||||||
|
@ -269,6 +300,11 @@ void jlPaletteSet(byte index, byte r, byte g, byte b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSetFromSta(jlStaT *sta) {
|
||||||
|
memcpy(_jlBackingStore->palette, sta->palette, sizeof(sta->palette));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void jlSoundFree(jlSoundT *sound) {
|
void jlSoundFree(jlSoundT *sound) {
|
||||||
if (sound != NULL) {
|
if (sound != NULL) {
|
||||||
if (sound->data != NULL) {
|
if (sound->data != NULL) {
|
||||||
|
|
|
@ -189,7 +189,7 @@ void jlDrawBlitMap(byte startX, byte startY, byte width, byte height, byte *mapD
|
||||||
for (x=startX; x<width; x++) {
|
for (x=startX; x<width; x++) {
|
||||||
tileX = mapData[offset++];
|
tileX = mapData[offset++];
|
||||||
tileY = mapData[offset++];
|
tileY = mapData[offset++];
|
||||||
jlDrawBlit8x8(tiles, tileX & 0x3F, tileY & 0x1F, x, y); //***TODO*** Move masking into bliter code.
|
jlDrawBlit8x8(tiles, tileX, tileY, x, y);
|
||||||
}
|
}
|
||||||
offset += stride;
|
offset += stride;
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,7 @@ typedef struct {
|
||||||
// Memory Management
|
// Memory Management
|
||||||
#ifdef JOEY_DEBUG
|
#ifdef JOEY_DEBUG
|
||||||
|
|
||||||
#define JOEY_MEM_BLOCKS 64
|
#define JOEY_MEM_BLOCKS 128
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void *addr;
|
void *addr;
|
||||||
|
@ -203,10 +203,14 @@ void *_jlRealloc(void *pointer, size_t size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define jlByteSwap(twoBytes) ((juint16)((twoBytes) & 0xff) >> 8) | (juint16)((twoBytes) << 8)
|
||||||
|
|
||||||
|
|
||||||
void jlDisplayBorder(jlBorderColorsE color);
|
void jlDisplayBorder(jlBorderColorsE color);
|
||||||
void jlDisplayPresent(void);
|
void jlDisplayPresent(void);
|
||||||
|
|
||||||
void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2);
|
void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2);
|
||||||
|
void jlDrawBlit8x8a(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte alpha);
|
||||||
void jlDrawBlitMap(byte startX, byte startY, byte width, byte height, byte *mapData, juint16 stride, jlStaT *tiles);
|
void jlDrawBlitMap(byte startX, byte startY, byte width, byte height, byte *mapData, juint16 stride, jlStaT *tiles);
|
||||||
void jlDrawBox(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
|
void jlDrawBox(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
|
||||||
void jlDrawBoxFilled(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
|
void jlDrawBoxFilled(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
|
||||||
|
@ -230,6 +234,7 @@ void jlKeyWaitForAny(void);
|
||||||
|
|
||||||
void jlPaletteDefault(void);
|
void jlPaletteDefault(void);
|
||||||
void jlPaletteSet(byte index, byte r, byte g, byte b);
|
void jlPaletteSet(byte index, byte r, byte g, byte b);
|
||||||
|
void jlPaletteSetFromSta(jlStaT *sta);
|
||||||
|
|
||||||
void jlSoundFree(jlSoundT *sound);
|
void jlSoundFree(jlSoundT *sound);
|
||||||
bool jlSoundIsPlaying(jlSoundT *sound);
|
bool jlSoundIsPlaying(jlSoundT *sound);
|
||||||
|
@ -277,6 +282,7 @@ bool _jlVecLoad(jlVecT **vec, char *filename);
|
||||||
#ifdef JOEY_IIGS
|
#ifdef JOEY_IIGS
|
||||||
// Inlined functions - asm code
|
// Inlined functions - asm code
|
||||||
extern void asmB88(byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2);
|
extern void asmB88(byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2);
|
||||||
|
extern void asmB88a(byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte alpha);
|
||||||
extern void asmPoint(jint16 color, jint16 x, jint16 y);
|
extern void asmPoint(jint16 color, jint16 x, jint16 y);
|
||||||
extern jint16 asmGetPoint(jint16 x, jint16 y);
|
extern jint16 asmGetPoint(jint16 x, jint16 y);
|
||||||
extern juint16 asmGetVbl(void);
|
extern juint16 asmGetVbl(void);
|
||||||
|
@ -284,6 +290,7 @@ extern void asmNSwap(byte *mem, jint16 count, jint16 old, jint16 new);
|
||||||
|
|
||||||
// Inlined functions
|
// Inlined functions
|
||||||
#define jlDrawBlit8x8(sta, cx1, cy1, cx2, cy2) asmB88((byte *)sta->pixels, cx1, cy1, cx2, cy2)
|
#define jlDrawBlit8x8(sta, cx1, cy1, cx2, cy2) asmB88((byte *)sta->pixels, cx1, cy1, cx2, cy2)
|
||||||
|
#define jlDrawBlit8x8a(sta, cx1, cy1, cx2, cy2, alpha) asmB88a((byte *)sta->pixels, cx1, cy1, cx2, cy2, alpha)
|
||||||
#define jlDrawGetPixel(x, y) asmGetPoint(x, y)
|
#define jlDrawGetPixel(x, y) asmGetPoint(x, y)
|
||||||
#define jlDrawPoint(x, y) asmPoint(_jlDrawColorNibbles, x, y)
|
#define jlDrawPoint(x, y) asmPoint(_jlDrawColorNibbles, x, y)
|
||||||
#define jlUtilNibbleSwap(mem, count, old, new) asmNSwap(mem, count, (jint16)old, (jint16)new)
|
#define jlUtilNibbleSwap(mem, count, old, new) asmNSwap(mem, count, (jint16)old, (jint16)new)
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define JOEY_MAIN
|
||||||
#include "joey.h"
|
#include "joey.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
segment "testapp";
|
segment "testapp";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
// Font hacking!
|
// Font hacking!
|
||||||
__attribute__((__format__ (__printf__, 4, 0)))
|
__attribute__((__format__ (__printf__, 4, 0)))
|
||||||
void printAt(jlStaT *font, jint16 cx, jint16 cy, const char *what, ...) {
|
void printAt(jlStaT *font, jint16 cx, jint16 cy, const char *what, ...) {
|
||||||
|
@ -52,21 +53,18 @@ void printAt(jlStaT *font, jint16 cx, jint16 cy, const char *what, ...) {
|
||||||
jlDrawBlit8x8(font, x, y, counter + cx, cy);
|
jlDrawBlit8x8(font, x, y, counter + cx, cy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
|
||||||
/*
|
|
||||||
jlStaT *kanga = NULL;
|
jlStaT *kanga = NULL;
|
||||||
jlStaT *font = NULL;
|
jlStaT *font = NULL;
|
||||||
jint16 y;
|
jint16 y;
|
||||||
jint16 color = 15;
|
jint16 color = 15;
|
||||||
jint16 nextColor = 1;
|
jint16 nextColor = 1;
|
||||||
*/
|
|
||||||
|
|
||||||
jlUtilStartup("JoeyLib Test");
|
jlUtilStartup("JoeyLib Test");
|
||||||
|
|
||||||
/*
|
|
||||||
if (!jlStaLoad(kanga, "kanga")) jlUtilDie("Unable to load kanga.sta!");
|
if (!jlStaLoad(kanga, "kanga")) jlUtilDie("Unable to load kanga.sta!");
|
||||||
if (!jlStaLoad(font, "font")) jlUtilDie("Unable to load font.sta!");
|
if (!jlStaLoad(font, "font")) jlUtilDie("Unable to load font.sta!");
|
||||||
|
|
||||||
|
@ -95,7 +93,6 @@ int main(void) {
|
||||||
|
|
||||||
jlStaFree(font);
|
jlStaFree(font);
|
||||||
jlStaFree(kanga);
|
jlStaFree(kanga);
|
||||||
*/
|
|
||||||
|
|
||||||
jlUtilShutdown();
|
jlUtilShutdown();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue