IIgs ASM code now supports drawing on any valid surface.
This commit is contained in:
parent
76c4636489
commit
daea38b790
13 changed files with 1079 additions and 432 deletions
|
@ -1,66 +0,0 @@
|
||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
OUT=${JOEY}/sdks/IIgs/ORCA/out/joey
|
|
||||||
|
|
||||||
if [ -d ${OUT} ]; then
|
|
||||||
rm -rf ${OUT}
|
|
||||||
fi
|
|
||||||
mkdir -p ${OUT}
|
|
||||||
|
|
||||||
pushd ${JOEY}/joeylib/joeylib/src
|
|
||||||
iix assemble +L jIIgs.asm keep=31:/out/joey/jIIgsasm > jIIgs.asm.dis
|
|
||||||
iix compile jIIgs.c keep=31:/out/joey/jIIgsc
|
|
||||||
iix compile joey.c keep=31:/out/joey/joey
|
|
||||||
|
|
||||||
iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsasm.A
|
|
||||||
iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsasm.ROOT
|
|
||||||
iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsc.a
|
|
||||||
iix makelib 31:/out/joey/joeylib +31:/out/joey/joey.a
|
|
||||||
|
|
||||||
iix compile test.c keep=31:/out/joey/test
|
|
||||||
iix -DKeepType=S16 link +L 31:/out/joey/test 31:/out/joey/joeylib keep=31:/out/joey/test > test.map
|
|
||||||
|
|
||||||
iix dumpobj +D 31:/out/joey/test &> test.dis || true
|
|
||||||
|
|
||||||
php ${JOEY}/sdks/IIgs/ntconverter/ntconverter.php *.mod
|
|
||||||
popd
|
|
||||||
|
|
||||||
mkdir -p ${JOEY}/dist/IIgs
|
|
||||||
cp -f ${OUT}/joeylib ${JOEY}/dist/IIgs/joeylib#b20000
|
|
||||||
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
|
|
||||||
cp -f ${JOEY}/joeylib/scripts/build-IIgs.helper.sh ${JOEY}/dist/IIgs/.
|
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
|
||||||
CADIUS=${JOEY}/sdks/IIgs/cadius/cadius
|
|
||||||
IMPORT=/tmp/IIgs/import.po
|
|
||||||
VOL=Import
|
|
||||||
|
|
||||||
mkdir -p `dirname ${IMPORT}`
|
|
||||||
rm /tmp/IIgs/JLSTATS#040000 2> /dev/null || true
|
|
||||||
rm ${IMPORT} 2> /dev/null || true
|
|
||||||
|
|
||||||
cp ${OUT}/test ${OUT}/Test#B30000
|
|
||||||
cp ${JOEY}/joeylib/joeylib/src/kanga.sta ${OUT}/kanga.sta#060000
|
|
||||||
cp ${JOEY}/joeylib/joeylib/src/font.sta ${OUT}/font.sta#060000
|
|
||||||
cp ${JOEY}/joeylib/joeylib/src/music ${OUT}/music#D50000
|
|
||||||
cp ${JOEY}/joeylib/joeylib/src/music.w ${OUT}/music.w#060000
|
|
||||||
|
|
||||||
${CADIUS} createvolume ${IMPORT} ${VOL} 32MB > /dev/null
|
|
||||||
${CADIUS} createfolder ${IMPORT} ${VOL}/data > /dev/null
|
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL} ${OUT}/Test#b30000 > /dev/null
|
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/kanga.sta#060000 > /dev/null
|
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/font.sta#060000 > /dev/null
|
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/music#D50000 > /dev/null
|
|
||||||
${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/music.w#060000 > /dev/null
|
|
||||||
|
|
||||||
pushd ${JOEY}/sdks/IIgs/gsplus
|
|
||||||
./GSplus -resizeable -config IIgsTest.cfg || true
|
|
||||||
popd
|
|
||||||
echo ""
|
|
||||||
${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS /tmp/IIgs/. > /dev/null
|
|
||||||
if [ -e /tmp/IIgs/JLSTATS#040000 ]; then
|
|
||||||
echo ""
|
|
||||||
cat /tmp/IIgs/JLSTATS#040000 | tr "\r" "\n" 2> /dev/null
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
fi
|
|
|
@ -1,101 +0,0 @@
|
||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
|
|
||||||
BUILD="${JOEY}/joeylib/joeylib/build"
|
|
||||||
SRC="${JOEY}/joeylib/joeylib/src"
|
|
||||||
|
|
||||||
|
|
||||||
function doBuild() {
|
|
||||||
|
|
||||||
G_CFLAGS="-Wall -D_REENTRANT_ -I${SRC} -c"
|
|
||||||
|
|
||||||
echo "*** Starting ${DIST}"
|
|
||||||
if [ -d "${BUILD}" ]; then
|
|
||||||
rm -rf "${BUILD}"
|
|
||||||
fi
|
|
||||||
mkdir -p "${BUILD}"
|
|
||||||
if [ -d "${DIST}" ]; then
|
|
||||||
rm -rf "${DIST}"
|
|
||||||
fi
|
|
||||||
mkdir -p "${DIST}"
|
|
||||||
|
|
||||||
pushd "${BUILD}"
|
|
||||||
${CC} ${CFLAGS} ${G_CFLAGS} -o jPC.o ${SRC}/jPC.c
|
|
||||||
${CC} ${CFLAGS} ${G_CFLAGS} -o joey.o ${SRC}/joey.c
|
|
||||||
|
|
||||||
ar x ${INSTALLED}/libSDL2.a
|
|
||||||
ar x ${INSTALLED}/libSDL2_mixer.a
|
|
||||||
ar x ${INSTALLED}/libmodplug.a
|
|
||||||
|
|
||||||
ar rcs ${DIST}/libjoeylib.a *.o
|
|
||||||
popd
|
|
||||||
|
|
||||||
if [ -d "${BUILD}" ]; then
|
|
||||||
rm -rf "${BUILD}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ARCH=$1
|
|
||||||
|
|
||||||
if [ "${ARCH}x" == "x" ]; then
|
|
||||||
echo "$0 [arch | \"all\"]"
|
|
||||||
echo '(Where "arch" is linux32, linux64, windows32, windows64, macos32, or macos64.)'
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux64x" ]; then
|
|
||||||
CC="gcc"
|
|
||||||
CFLAGS=""
|
|
||||||
LDFLAGS=""
|
|
||||||
DIST="${JOEY}/dist/linux/x64"
|
|
||||||
INSTALLED="${JOEY}/SDL2/installed/linux/x64/lib"
|
|
||||||
doBuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux32x" ]; then
|
|
||||||
CC="gcc"
|
|
||||||
CFLAGS="-m32"
|
|
||||||
LDFLAGS=""
|
|
||||||
DIST="${JOEY}/dist/linux/i386"
|
|
||||||
INSTALLED="${JOEY}/SDL2/installed/linux/i386/lib"
|
|
||||||
doBuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows64x" ]; then
|
|
||||||
CC="x86_64-w64-mingw32-gcc"
|
|
||||||
CFLAGS=""
|
|
||||||
LDFLAGS=""
|
|
||||||
DIST="${JOEY}/dist/windows/x64"
|
|
||||||
INSTALLED="${JOEY}/SDL2/installed/windows/x64/lib"
|
|
||||||
doBuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows32x" ]; then
|
|
||||||
CC="i686-w64-mingw32-gcc"
|
|
||||||
CFLAGS=""
|
|
||||||
LDFLAGS=""
|
|
||||||
DIST="${JOEY}/dist/windows/i386"
|
|
||||||
INSTALLED="${JOEY}/SDL2/installed/windows/i386/lib"
|
|
||||||
doBuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos32x" ]; then
|
|
||||||
CC="o32-clang"
|
|
||||||
CFLAGS=""
|
|
||||||
LDFLAGS=""
|
|
||||||
DIST="${JOEY}/dist/macos/i386"
|
|
||||||
INSTALLED="${JOEY}/SDL2/installed/macos/i386/lib"
|
|
||||||
doBuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos64x" ]; then
|
|
||||||
CC="o64-clang"
|
|
||||||
CFLAGS=""
|
|
||||||
LDFLAGS=""
|
|
||||||
DIST="${JOEY}/dist/macos/x64"
|
|
||||||
INSTALLED="${JOEY}/SDL2/installed/macos/x64/lib"
|
|
||||||
doBuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
|
|
||||||
cp -f ${JOEY}/joeylib/joeylib/joey.pri ${JOEY}/dist/.
|
|
264
joeylib/build.sh
Executable file
264
joeylib/build.sh
Executable file
|
@ -0,0 +1,264 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
# m68k-amigaos-gcc -idirafter /home/scott/joey/sdks/amiga/m68k-amigaos/sys-include/machine -c ../src/joey.c
|
||||||
|
# m68k-amigaos-gcc -idirafter /home/scott/joey/sdks/amiga/m68k-amigaos/sys-include/machine -c ../src/jAmiga.c
|
||||||
|
# m68k-amigaos-ar rcs libjoeylib.a *.o
|
||||||
|
|
||||||
|
# wget http://tho-otto.de/download/mint/m68k-atari-mint-base-20190606-linux.tar.xz
|
||||||
|
# xz -d m68k-atari-mint-base-20190606-linux.tar.xz
|
||||||
|
# tar --strip-components=1 -xf ../../stuff/m68k-atari-mint-base-20190606-linux.tar
|
||||||
|
# m68k-atari-mint-gcc -c ../src/joey.c
|
||||||
|
# m68k-atari-mint-gcc -c ../src/jST.c
|
||||||
|
# m68k-atari-ar rcs libjoeylib.a *.o
|
||||||
|
|
||||||
|
|
||||||
|
SRC="${JOEY}/joeylib/joeylib/src"
|
||||||
|
BUILD="${JOEY}/joeylib/joeylib/build"
|
||||||
|
OUT="${JOEY}/sdks/IIgs/ORCA/out/joey"
|
||||||
|
DEPS="${JOEY}/installerWork/deps/installed"
|
||||||
|
|
||||||
|
|
||||||
|
# Hackery for Scott's development system
|
||||||
|
if [[ `uname -n` == 'joey' && `whoami` == 'scott' ]]; then
|
||||||
|
DEPS="${JOEY}/installer/installerWork/deps/installed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
function doIIgsBuild() {
|
||||||
|
|
||||||
|
local CADIUS="${JOEY}/sdks/IIgs/cadius/cadius"
|
||||||
|
local IMPORT="/tmp/IIgs/import.po"
|
||||||
|
local VOL=Import
|
||||||
|
local RUNTEST=$1
|
||||||
|
|
||||||
|
echo "*** Starting ${DIST}"
|
||||||
|
if [[ -d "${OUT}" ]]; then
|
||||||
|
rm -rf "${OUT}"
|
||||||
|
fi
|
||||||
|
mkdir -p "${OUT}"
|
||||||
|
if [[ -d "${DIST}" ]]; then
|
||||||
|
rm -rf "${DIST}"
|
||||||
|
fi
|
||||||
|
mkdir -p "${DIST}"
|
||||||
|
|
||||||
|
pushd "${SRC}"
|
||||||
|
iix assemble +L jIIgs.asm keep=31:/out/joey/jIIgsasm > jIIgs.asm.dis
|
||||||
|
iix compile jIIgs.c keep=31:/out/joey/jIIgsc
|
||||||
|
iix compile joey.c keep=31:/out/joey/joey
|
||||||
|
|
||||||
|
iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsasm.A
|
||||||
|
iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsasm.ROOT
|
||||||
|
iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsc.a
|
||||||
|
iix makelib 31:/out/joey/joeylib +31:/out/joey/joey.a
|
||||||
|
|
||||||
|
iix compile test.c keep=31:/out/joey/test
|
||||||
|
iix -DKeepType=S16 link +L 31:/out/joey/test 31:/out/joey/joeylib keep=31:/out/joey/test > test.map
|
||||||
|
|
||||||
|
iix dumpobj +D 31:/out/joey/test &> test.dis || true
|
||||||
|
|
||||||
|
php "${JOEY}/sdks/IIgs/ntconverter/ntconverter.php" *.mod
|
||||||
|
popd
|
||||||
|
|
||||||
|
cp -f "${OUT}/joeylib" "${DIST}/joeylib#b20000"
|
||||||
|
cp -f "${JOEY}/sdks/IIgs/Tool221#ba0000" "${JOEY}/dist/IIgs/."
|
||||||
|
cp -f "${JOEY}/joeylib/scripts/build-IIgs.helper.sh" "${JOEY}/dist/."
|
||||||
|
|
||||||
|
if [[ ! -z ${RUNTEST} ]]; then
|
||||||
|
mkdir -p `dirname ${IMPORT}`
|
||||||
|
rm "/tmp/IIgs/JLSTATS#040000" 2> /dev/null || true
|
||||||
|
rm "${IMPORT}" 2> /dev/null || true
|
||||||
|
|
||||||
|
cp "${OUT}/test" "${OUT}/Test#B30000"
|
||||||
|
cp "${JOEY}/joeylib/joeylib/src/kanga.sta" "${OUT}/kanga.sta#060000"
|
||||||
|
cp "${JOEY}/joeylib/joeylib/src/font.sta" "${OUT}/font.sta#060000"
|
||||||
|
cp "${JOEY}/joeylib/joeylib/src/music" "${OUT}/music#D50000"
|
||||||
|
cp "${JOEY}/joeylib/joeylib/src/music.w" "${OUT}/music.w#060000"
|
||||||
|
|
||||||
|
"${CADIUS}" createvolume "${IMPORT}" ${VOL} 32MB > /dev/null
|
||||||
|
"${CADIUS}" createfolder "${IMPORT}" ${VOL}/data > /dev/null
|
||||||
|
"${CADIUS}" addfile "${IMPORT}" ${VOL} "${JOEY}/dist/IIgs/Tool221#ba0000" > /dev/null
|
||||||
|
"${CADIUS}" addfile "${IMPORT}" ${VOL} "${OUT}/Test#b30000" > /dev/null
|
||||||
|
"${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/kanga.sta#060000" > /dev/null
|
||||||
|
"${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/font.sta#060000" > /dev/null
|
||||||
|
"${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/music#D50000" > /dev/null
|
||||||
|
"${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/music.w#060000" > /dev/null
|
||||||
|
|
||||||
|
pushd "${JOEY}/sdks/IIgs/gsplus"
|
||||||
|
./GSplus -resizeable -config IIgsTest.cfg || true
|
||||||
|
popd
|
||||||
|
echo ""
|
||||||
|
"${CADIUS}" extractfile "${IMPORT}" ${VOL}/JLSTATS /tmp/IIgs/. > /dev/null
|
||||||
|
if [[ -e "/tmp/IIgs/JLSTATS#040000" ]]; then
|
||||||
|
echo ""
|
||||||
|
cat "/tmp/IIgs/JLSTATS#040000" | tr "\r" "\n" 2> /dev/null
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function doPCBuild() {
|
||||||
|
|
||||||
|
local G_CFLAGS="-Wall -D_REENTRANT_ -I${SRC} -c"
|
||||||
|
|
||||||
|
echo "*** Starting ${DIST}"
|
||||||
|
if [[ -d "${BUILD}" ]]; then
|
||||||
|
rm -rf "${BUILD}"
|
||||||
|
fi
|
||||||
|
mkdir -p "${BUILD}"
|
||||||
|
if [[ -d "${DIST}" ]]; then
|
||||||
|
rm -rf "${DIST}"
|
||||||
|
fi
|
||||||
|
mkdir -p "${DIST}"
|
||||||
|
|
||||||
|
pushd "${BUILD}"
|
||||||
|
"${CC}" ${CFLAGS} ${G_CFLAGS} -o jPC.o "${SRC}/jPC.c"
|
||||||
|
"${CC}" ${CFLAGS} ${G_CFLAGS} -o joey.o "${SRC}/joey.c"
|
||||||
|
|
||||||
|
ar x "${INSTALLED}/libSDL2.a"
|
||||||
|
ar x "${INSTALLED}/libSDL2_mixer.a"
|
||||||
|
ar x "${INSTALLED}/libmodplug.a"
|
||||||
|
|
||||||
|
ar rcs "${DIST}/libjoeylib.a" *.o
|
||||||
|
popd
|
||||||
|
|
||||||
|
if [[ -d "${BUILD}" ]]; then
|
||||||
|
rm -rf "${BUILD}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#***TODO*** Add optional test app execution for Windows (WINE) and Linux here
|
||||||
|
|
||||||
|
cp -f "${JOEY}/joeylib/joeylib/joey.pri" "${JOEY}/dist/."
|
||||||
|
cp -f "${JOEY}/joeylib/scripts/build-PC.helper.sh" "${JOEY}/dist/."
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function doVBCCBuild() {
|
||||||
|
|
||||||
|
local PLATFORM=
|
||||||
|
local CFILE=
|
||||||
|
local G_CFLAGS="-c99 -I${SRC} -speed -c"
|
||||||
|
|
||||||
|
if [[ "${ARCH}" == "st" ]]; then
|
||||||
|
PLATFORM=tos
|
||||||
|
CFILE="jST"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}" == "amiga" ]]; then
|
||||||
|
PLATFORM=aos68k
|
||||||
|
CFILE="jAmiga"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "*** Starting ${DIST}"
|
||||||
|
if [[ -d "${BUILD}" ]]; then
|
||||||
|
rm -rf "${BUILD}"
|
||||||
|
fi
|
||||||
|
mkdir -p "${BUILD}"
|
||||||
|
if [[ -d "${DIST}" ]]; then
|
||||||
|
rm -rf "${DIST}"
|
||||||
|
fi
|
||||||
|
mkdir -p "${DIST}"
|
||||||
|
|
||||||
|
pushd "${BUILD}"
|
||||||
|
vc +${PLATFORM} ${CFLAGS} ${G_CFLAGS} "${SRC}/joey.c" -o joey.o
|
||||||
|
vc +${PLATFORM} ${CFLAGS} ${G_CFLAGS} "${SRC}/${CFILE}.c" -o ${CFILE}.o
|
||||||
|
vlink ${LDFLAGS} joey.o ${CFILE}.o -o joeylib.lib
|
||||||
|
popd
|
||||||
|
|
||||||
|
#hatari -c "${JOEY}/sdks/st/hatari.cfg" -d out/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ARCH=$1
|
||||||
|
TEST=$2
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "x" ]]; then
|
||||||
|
echo "$0 [arch | \"all\"]"
|
||||||
|
echo '(Where "arch" is iigs, st, linux32, linux64, windows32, windows64, macos32, or macos64.)'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "iigsx" ]]; then
|
||||||
|
DIST="${JOEY}/dist/IIgs"
|
||||||
|
doIIgsBuild ${TEST}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "stx" ]]; then
|
||||||
|
SDK="${JOEY}/sdks/vbcc/targets/m68k-atari"
|
||||||
|
CFLAGS="-cpu=68000 -I${SDK}/includes"
|
||||||
|
#LDFLAGS="-bvobj-be -EB -L${JOEY}/sdks/vbcc/targets/m68k-atari/lib"
|
||||||
|
LDFLAGS="-baoutnull -EB -L${SDK}/lib -lvc"
|
||||||
|
DIST="${JOEY}/dist/ST"
|
||||||
|
doVBCCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "amigax" ]]; then
|
||||||
|
#SDK="${JOEY}/sdks/amiga"
|
||||||
|
#CFLAGS="-cpu=68000 -I${SDK}/NDK_3.9/Include/include_h -I${SDK}/PosixLib/include"
|
||||||
|
#LDFLAGS="-bamigahunk -EB -L${SDK}/NDK_3.9/Include/linker_libs -L${SDK}/PosixLib/AmigaOS3 -lposix -lamiga"
|
||||||
|
SDK="${JOEY}/sdks/vbcc/targets/m68k-amigaos"
|
||||||
|
SDK2="${JOEY}/sdks/amiga/PosixLib"
|
||||||
|
CFLAGS="-cpu=68000 -I${SDK}/includes -I${SDK2}/includes"
|
||||||
|
#LDFLAGS="-bamigahunk -Bshareable -Cvbcc -mrel ${SDK}/lib/startup.o -L${SDK}/lib -L${SDK2}/AmigaOS3 -lvc -lposix"
|
||||||
|
LDFLAGS="-bvobj-be -Bshareable -Cvbcc -mrel ${SDK}/lib/startup.o -L${SDK}/lib -L${SDK2}/AmigaOS3 -lvc -lposix"
|
||||||
|
DIST="${JOEY}/dist/Amiga"
|
||||||
|
doVBCCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "linux64x" ]]; then
|
||||||
|
CC="gcc"
|
||||||
|
CFLAGS=""
|
||||||
|
LDFLAGS=""
|
||||||
|
DIST="${JOEY}/dist/linux/x64"
|
||||||
|
INSTALLED="${DEPS}/linux/x64/lib"
|
||||||
|
doPCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "linux32x" ]]; then
|
||||||
|
CC="gcc"
|
||||||
|
CFLAGS="-m32"
|
||||||
|
LDFLAGS=""
|
||||||
|
DIST="${JOEY}/dist/linux/i386"
|
||||||
|
INSTALLED="${DEPS}/linux/i386/lib"
|
||||||
|
doPCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "windows64x" ]]; then
|
||||||
|
CC="x86_64-w64-mingw32-gcc"
|
||||||
|
CFLAGS=""
|
||||||
|
LDFLAGS=""
|
||||||
|
DIST="${JOEY}/dist/windows/x64"
|
||||||
|
INSTALLED="${DEPS}/windows/x64/lib"
|
||||||
|
doPCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "windows32x" ]]; then
|
||||||
|
CC="i686-w64-mingw32-gcc"
|
||||||
|
CFLAGS=""
|
||||||
|
LDFLAGS=""
|
||||||
|
DIST="${JOEY}/dist/windows/i386"
|
||||||
|
INSTALLED="${DEPS}/windows/i386/lib"
|
||||||
|
doPCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macos32x" ]]; then
|
||||||
|
CC="o32-clang"
|
||||||
|
CFLAGS=""
|
||||||
|
LDFLAGS=""
|
||||||
|
DIST="${JOEY}/dist/macos/i386"
|
||||||
|
INSTALLED="${DEPS}/macos/i386/lib"
|
||||||
|
doPCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macos64x" ]]; then
|
||||||
|
CC="o64-clang"
|
||||||
|
CFLAGS=""
|
||||||
|
LDFLAGS=""
|
||||||
|
DIST="${JOEY}/dist/macos/x64"
|
||||||
|
INSTALLED="${DEPS}/macos/x64/lib"
|
||||||
|
doPCBuild
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${JOEY}/dist"
|
||||||
|
cp -f "${SRC}/joey.h" "${JOEY}/dist/."
|
|
@ -20,6 +20,9 @@ SOURCES += \
|
||||||
src/test.c
|
src/test.c
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
|
src/jBlank.c \
|
||||||
|
src/jST.c \
|
||||||
|
src/jAmiga.c \
|
||||||
src/jIIgs.c \
|
src/jIIgs.c \
|
||||||
src/jIIgs.asm \
|
src/jIIgs.asm \
|
||||||
src/jIIgs.macro \
|
src/jIIgs.macro \
|
||||||
|
|
202
joeylib/src/jAmiga.c
Normal file
202
joeylib/src/jAmiga.c
Normal file
|
@ -0,0 +1,202 @@
|
||||||
|
/*
|
||||||
|
* JoeyLib
|
||||||
|
* Copyright (C) 2018-2019 Scott Duensing <scott@kangaroopunch.com>
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "joey.h"
|
||||||
|
|
||||||
|
|
||||||
|
void jlDisplayPresent(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2) {
|
||||||
|
(void)sta;
|
||||||
|
(void)cx1;
|
||||||
|
(void)cy1;
|
||||||
|
(void)cx2;
|
||||||
|
(void)cy2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlit8x8a(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte offset) {
|
||||||
|
(void)sta;
|
||||||
|
(void)cx1;
|
||||||
|
(void)cy1;
|
||||||
|
(void)cx2;
|
||||||
|
(void)cy2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlitMap(jint16 startX, jint16 startY, jint16 width, jint16 height, byte *mapData, juint16 stride, jlStaT *sta) {
|
||||||
|
(void)startX;
|
||||||
|
(void)startY;
|
||||||
|
(void)width;
|
||||||
|
(void)height;
|
||||||
|
(void)mapData;
|
||||||
|
(void)stride;
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawClear(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte jlDrawGetPixel(jint16 x, jint16 y) {
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawPoint(jint16 x, jint16 y) {
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
jint16 jlGameGetAxis(byte which) {
|
||||||
|
(void)which;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlGameGetButton(byte which) {
|
||||||
|
(void)which;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlKeyPressed(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char jlKeyRead(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSet(byte index, byte r, byte g, byte b) {
|
||||||
|
(void)index;
|
||||||
|
(void)r;
|
||||||
|
(void)g;
|
||||||
|
(void)b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSetFromSta(jlStaT *sta) {
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundFree(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlSoundIsPlaying(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool _jlSoundLoad(jlSoundT **sound, char *filename) {
|
||||||
|
(void)sound;
|
||||||
|
(void)filename;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicContinue(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlSoundMusicIsPlaying(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicPause(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicPlay(char *name) {
|
||||||
|
(void)name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicStop(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundPlay(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool _jlStaCreate(jlStaT **sta) {
|
||||||
|
(void)sta;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlStaDisplay(jlStaT *sta) {
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilIdle(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlUtilMustExit(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilNibbleSwap(byte *mem, jint16 count, byte old, byte new) {
|
||||||
|
(void)mem;
|
||||||
|
(void)count;
|
||||||
|
(void)old;
|
||||||
|
(void)new;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilShutdown(void) {
|
||||||
|
jlUtilDie("Clean Exit.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilStartup(char *appTitle) {
|
||||||
|
(void)appTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
juint16 jlUtilTimer(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
202
joeylib/src/jBlank.c
Normal file
202
joeylib/src/jBlank.c
Normal file
|
@ -0,0 +1,202 @@
|
||||||
|
/*
|
||||||
|
* JoeyLib
|
||||||
|
* Copyright (C) 2018-2019 Scott Duensing <scott@kangaroopunch.com>
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "joey.h"
|
||||||
|
|
||||||
|
|
||||||
|
void jlDisplayPresent(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2) {
|
||||||
|
(void)sta;
|
||||||
|
(void)cx1;
|
||||||
|
(void)cy1;
|
||||||
|
(void)cx2;
|
||||||
|
(void)cy2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlit8x8a(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte offset) {
|
||||||
|
(void)sta;
|
||||||
|
(void)cx1;
|
||||||
|
(void)cy1;
|
||||||
|
(void)cx2;
|
||||||
|
(void)cy2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlitMap(jint16 startX, jint16 startY, jint16 width, jint16 height, byte *mapData, juint16 stride, jlStaT *sta) {
|
||||||
|
(void)startX;
|
||||||
|
(void)startY;
|
||||||
|
(void)width;
|
||||||
|
(void)height;
|
||||||
|
(void)mapData;
|
||||||
|
(void)stride;
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawClear(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte jlDrawGetPixel(jint16 x, jint16 y) {
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawPoint(jint16 x, jint16 y) {
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
jint16 jlGameGetAxis(byte which) {
|
||||||
|
(void)which;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlGameGetButton(byte which) {
|
||||||
|
(void)which;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlKeyPressed(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char jlKeyRead(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSet(byte index, byte r, byte g, byte b) {
|
||||||
|
(void)index;
|
||||||
|
(void)r;
|
||||||
|
(void)g;
|
||||||
|
(void)b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSetFromSta(jlStaT *sta) {
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundFree(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlSoundIsPlaying(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool _jlSoundLoad(jlSoundT **sound, char *filename) {
|
||||||
|
(void)sound;
|
||||||
|
(void)filename;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicContinue(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlSoundMusicIsPlaying(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicPause(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicPlay(char *name) {
|
||||||
|
(void)name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicStop(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundPlay(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool _jlStaCreate(jlStaT **sta) {
|
||||||
|
(void)sta;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlStaDisplay(jlStaT *sta) {
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilIdle(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlUtilMustExit(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilNibbleSwap(byte *mem, jint16 count, byte old, byte new) {
|
||||||
|
(void)mem;
|
||||||
|
(void)count;
|
||||||
|
(void)old;
|
||||||
|
(void)new;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilShutdown(void) {
|
||||||
|
jlUtilDie("Clean Exit.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilStartup(char *appTitle) {
|
||||||
|
(void)appTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
juint16 jlUtilTimer(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -19,37 +19,36 @@
|
||||||
; 3. This notice may not be removed or altered from any source distribution.
|
; 3. This notice may not be removed or altered from any source distribution.
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
|
||||||
|
|
||||||
mcopy 13:ORCAInclude:m16.ORCA
|
mcopy 13:ORCAInclude:m16.ORCA
|
||||||
mcopy jIIgs.macro
|
mcopy jIIgs.macro
|
||||||
case on
|
case on
|
||||||
gen on
|
gen on
|
||||||
|
|
||||||
SHRShad gequ $012000
|
|
||||||
|
|
||||||
ScanTable data
|
GlobalData data
|
||||||
|
ScanTable entry
|
||||||
ds 400 ; 400 bytes for scanline offsets
|
ds 400 ; 400 bytes for scanline offsets
|
||||||
end
|
VblRate ds 2 ; Either 5 or 6 depending on PAL or NTSC.
|
||||||
|
|
||||||
VblRate data
|
|
||||||
ds 2 ; Either 5 or 6 depending on PAL or NTSC.
|
|
||||||
VblTime ds 2 ; Integer Counter
|
VblTime ds 2 ; Integer Counter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Blit an 8x8 block from off-screen to back buffer.
|
; Blit an 8x8 block. ***TODO*** Unroll loops
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
asmB88 start
|
asmB88 start
|
||||||
|
|
||||||
t equ 1
|
so equ 1 ; Source Pixels Offset
|
||||||
|
to equ 3 ; Target Pixels Offset
|
||||||
|
t equ 5 ; Temp
|
||||||
|
xc equ 7 ; X Counter
|
||||||
|
yc equ 9 ; Y Counter
|
||||||
|
|
||||||
jsubroutine (4:p,2:cx1,2:cy1,2:cx2,2:cy2),2
|
jsubroutine (4:surface,4:tiles,2:cx1,2:cy1,2:cx2,2:cy2),10
|
||||||
using ScanTable
|
using GlobalData
|
||||||
|
|
||||||
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
|
|
||||||
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)
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
|
@ -59,197 +58,110 @@ t equ 1
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a ; y1 is now in the accumulator
|
asl a ; y screen location is now in the accumulator
|
||||||
clc
|
|
||||||
tax
|
tax
|
||||||
lda >ScanTable,x
|
|
||||||
adc t ; Add t to scanline offset
|
|
||||||
tay ; Offset to start of tile
|
|
||||||
; Find offset into shadow SHR memory
|
|
||||||
clc
|
clc
|
||||||
lda cx2 ; Multiply cx1 by 4 to get offset (two pixels per byte)
|
lda >ScanTable,x ; Load byte offset of y position from table
|
||||||
|
adc t ; Add t to scanline offset
|
||||||
|
sta so ; Offset to start of source pixels
|
||||||
|
|
||||||
|
; Find offset into target surface memory
|
||||||
|
clc
|
||||||
|
lda cx2 ; Multiply cx2 by 4 to get offset (two pixels per byte)
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
sta t
|
sta t
|
||||||
clc
|
clc
|
||||||
lda cy2 ; Multiply cy1 by 16 to get index into scanline table
|
lda cy2 ; Multiply cy2 by 16 to get index into scanline table
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a ; y2 is now in the accumulator
|
asl a ; y screen location is now in the accumulator
|
||||||
clc
|
clc
|
||||||
tax
|
tax
|
||||||
lda >ScanTable,x
|
lda >ScanTable,x ; Load byte offset of y position from table
|
||||||
adc t ; Add t to scanline offset
|
adc t ; Add t to scanline offset
|
||||||
tax ; Offset to start of screen memory
|
sta to ; Offset to start of target pixels
|
||||||
|
|
||||||
sei ; Disable interrupts while we change data banks
|
lda #0 ; Load 0 into X and Y counters
|
||||||
pea $0101 ; Push Effective Address (our new data bank) always 16 bits
|
sta xc
|
||||||
plb ; Pull data bank from stack (data bank now $01)
|
sta yc
|
||||||
plb ; Do it twice because it's only an 8 bit operation
|
|
||||||
|
|
||||||
; Row 1
|
blitTop ldy so ; Load Y register with source pixel offset
|
||||||
lda [p],y ; Load 4 pixels from SHA data
|
lda [tiles],y ; Load 4 tile pixels
|
||||||
sta |SHRShad,x ; Store 4 pixels into screen
|
ldy to ; Load Y register with target pixel offset
|
||||||
inx ; Move to next pixel quad
|
sta [surface],y ; Store 4 pixels into screen
|
||||||
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
|
clc ; Increment to next pixel target quad
|
||||||
cli ; Restore interrupts
|
lda #2
|
||||||
|
adc to
|
||||||
|
sta to
|
||||||
|
clc ; Increment to next pixel source quad
|
||||||
|
lda #2
|
||||||
|
adc so
|
||||||
|
sta so
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda xc ; Increment X counter
|
||||||
|
adc #1
|
||||||
|
sta xc
|
||||||
|
cmp #2 ; End of X pixels?
|
||||||
|
bcc blitTop ; Nope!
|
||||||
|
|
||||||
|
lda #0 ; Reset X counter
|
||||||
|
sta xc
|
||||||
|
clc ; Increment target offset
|
||||||
|
lda #156
|
||||||
|
adc to
|
||||||
|
sta to
|
||||||
|
clc ; Increment source offset
|
||||||
|
lda #156
|
||||||
|
adc so
|
||||||
|
sta so
|
||||||
|
clc
|
||||||
|
lda yc ; Increment Y counter
|
||||||
|
adc #1
|
||||||
|
sta yc
|
||||||
|
cmp #8 ; End of Y pixels?
|
||||||
|
bcc blitTop ; Nope!
|
||||||
|
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Blit an 8x8 block from off-screen to back buffer with alpha.
|
; Blit an 8x8 block with alpha.
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
asmB88a start
|
asmB88a start
|
||||||
|
|
||||||
mo equ 1 ; Mask Offset
|
so equ 1 ; Source Pixels Offset
|
||||||
so equ 3 ; Source Pixels Offset
|
to equ 3 ; Target Pixels Offset
|
||||||
to equ 5 ; Target Pixels Offset
|
mo equ 5 ; Mask Offset
|
||||||
t equ 7 ; Temp
|
t equ 7 ; Temp
|
||||||
xc equ 9 ; X Counter
|
xc equ 9 ; X Counter
|
||||||
yc equ 11 ; Y Counter
|
yc equ 11 ; Y Counter
|
||||||
|
|
||||||
jsubroutine (4:p,2:cx1,2:cy1,2:cx2,2:cy2,2:offset),12
|
jsubroutine (4:surface,4:tiles,2:cx1,2:cy1,2:cx2,2:cy2,2:offset),12
|
||||||
using ScanTable
|
using GlobalData
|
||||||
|
|
||||||
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
|
||||||
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)
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
sta t
|
sta t
|
||||||
|
clc
|
||||||
lda cy1 ; Multiply cy1 by 16 to get index into scanline table
|
lda cy1 ; Multiply cy1 by 16 to get index into scanline table
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a ; y1 is now in the accumulator
|
asl a ; y screen location is now in the accumulator
|
||||||
tax
|
tax
|
||||||
clc
|
clc
|
||||||
lda >ScanTable,x
|
lda >ScanTable,x ; Load byte offset of y position from table
|
||||||
adc t ; Add t to scanline offset
|
adc t ; Add t to scanline offset
|
||||||
sta so ; Offset to start of source pixels
|
sta so ; Offset to start of source pixels
|
||||||
|
|
||||||
|
; Find offset into tile memory for mask data
|
||||||
lda offset ; Load offset
|
lda offset ; Load offset
|
||||||
asl a ; Multiply by 4
|
asl a ; Multiply by 4
|
||||||
asl a
|
asl a
|
||||||
|
@ -257,39 +169,36 @@ yc equ 11 ; Y Counter
|
||||||
adc so ; Add to source pixel offset
|
adc so ; Add to source pixel offset
|
||||||
sta mo ; Offset to start of mask pixels
|
sta mo ; Offset to start of mask pixels
|
||||||
|
|
||||||
; Find offset into shadow SHR memory
|
; Find offset into target surface memory
|
||||||
lda cx2 ; Multiply cx1 by 4 to get offset (two pixels per byte)
|
clc
|
||||||
|
lda cx2 ; Multiply cx2 by 4 to get offset (two pixels per byte)
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
sta t
|
sta t
|
||||||
lda cy2 ; Multiply cy1 by 16 to get index into scanline table
|
clc
|
||||||
|
lda cy2 ; Multiply cy2 by 16 to get index into scanline table
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a ; y2 is now in the accumulator
|
asl a ; y screen location is now in the accumulator
|
||||||
clc
|
clc
|
||||||
tax
|
tax
|
||||||
lda >ScanTable,x
|
lda >ScanTable,x ; Load byte offset of y position from table
|
||||||
adc t ; Add t to scanline offset
|
adc t ; Add t to scanline offset
|
||||||
sta to ; Offset to start of target pixels
|
sta to ; Offset to start of target pixels
|
||||||
|
|
||||||
sei ; Disable interrupts while we change data banks
|
lda #0 ; Load 0 into X and Y counters
|
||||||
pea $0101 ; Push Effective Address (our new data bank) always 16 bits
|
sta xc
|
||||||
plb ; Pull data bank from stack (data bank now $01)
|
|
||||||
plb ; Do it twice because it's only an 8 bit operation
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta xc ; Load 0 into X and Y counters
|
|
||||||
sta yc
|
sta yc
|
||||||
|
|
||||||
blitATop ldx to ; Load X and Y registers with target pixel offset
|
blitTop ldy to ; Load Y register with target pixel offset
|
||||||
ldy to
|
lda [surface],y ; Load target pixels
|
||||||
lda SHRShad,x ; Load 4 target pixels
|
ldy mo ; Load Y register with mask pixel offset
|
||||||
ldy mo ; Load Y register with pixel mask offset
|
and [tiles],y ; AND with mask
|
||||||
and [p],y ; AND with mask
|
|
||||||
ldy so ; Load Y register with source pixel offset
|
ldy so ; Load Y register with source pixel offset
|
||||||
ora [p],y ; OR with source pixels
|
ora [tiles],y ; OR with source pixels
|
||||||
sta |SHRShad,x ; Store 4 pixels into screen
|
ldy to ; Load Y register with target pixel offset
|
||||||
|
sta [surface],y ; Store 4 pixels into screen
|
||||||
|
|
||||||
clc ; Increment to next pixel target quad
|
clc ; Increment to next pixel target quad
|
||||||
lda #2
|
lda #2
|
||||||
|
@ -309,7 +218,7 @@ blitATop ldx to ; Load X and Y registers with target pixel offset
|
||||||
adc #1
|
adc #1
|
||||||
sta xc
|
sta xc
|
||||||
cmp #2 ; End of X pixels?
|
cmp #2 ; End of X pixels?
|
||||||
bcc blitATop ; Nope!
|
bcc blitTop ; Nope!
|
||||||
|
|
||||||
lda #0 ; Reset X counter
|
lda #0 ; Reset X counter
|
||||||
sta xc
|
sta xc
|
||||||
|
@ -330,28 +239,28 @@ blitATop ldx to ; Load X and Y registers with target pixel offset
|
||||||
adc #1
|
adc #1
|
||||||
sta yc
|
sta yc
|
||||||
cmp #8 ; End of Y pixels?
|
cmp #8 ; End of Y pixels?
|
||||||
bcc blitATop ; Nope!
|
bcc blitTop ; Nope!
|
||||||
|
|
||||||
plb ; Pull original data bank from stack
|
|
||||||
cli ; Restore interrupts
|
|
||||||
|
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Set Border Color
|
; Set Border Color
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
asmBorder start
|
asmBorder start
|
||||||
jsubroutine (2:c)
|
jsubroutine (2:color)
|
||||||
short m
|
short m
|
||||||
lda >$E0C034
|
lda >$E0C034
|
||||||
and #$F0
|
and #$F0
|
||||||
ora c
|
ora color
|
||||||
sta >$E0C034
|
sta >$E0C034
|
||||||
long m
|
long m
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Draw a block of tiles from a region of tile data
|
; Draw a block of tiles from a region of tile data
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
@ -363,7 +272,7 @@ offset equ 5
|
||||||
loopX equ 7
|
loopX equ 7
|
||||||
loopY equ 9
|
loopY equ 9
|
||||||
|
|
||||||
jsubroutine (2:startX,2:startY,2:width,2:height,4:mapData,2:stride,4:tiles),10
|
jsubroutine (4:surface,2:startX,2:startY,2:width,2:height,4:mapData,2:stride,4:tiles),10
|
||||||
|
|
||||||
lda #0 ; Zero some starting values
|
lda #0 ; Zero some starting values
|
||||||
sta offset
|
sta offset
|
||||||
|
@ -401,6 +310,7 @@ drawTop phy ; Keep Y for later
|
||||||
ph2 tileY
|
ph2 tileY
|
||||||
ph2 tileX
|
ph2 tileX
|
||||||
ph4 tiles
|
ph4 tiles
|
||||||
|
ph4 surface
|
||||||
jsl asmB88 ; Call tile drawing code
|
jsl asmB88 ; Call tile drawing code
|
||||||
|
|
||||||
ply ; Unclobber
|
ply ; Unclobber
|
||||||
|
@ -422,6 +332,7 @@ drawTop phy ; Keep Y for later
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;===============================================================================================
|
;===============================================================================================
|
||||||
|
|
||||||
;
|
;
|
||||||
|
@ -444,11 +355,11 @@ diff equ 15
|
||||||
even_c equ 17
|
even_c equ 17
|
||||||
odd_c equ 19
|
odd_c equ 19
|
||||||
|
|
||||||
jsubroutine (4:p,2:penColor,2:clpx0,2:clpy0,2:clpx1,2:clpy1),20
|
jsubroutine (4:surface,2:penColor,2:clpx0,2:clpy0,2:clpx1,2:clpy1),20
|
||||||
|
|
||||||
; Say p = $012000...
|
; Say surface = $012000...
|
||||||
|
|
||||||
lda #<p ; Should be $2000
|
lda #<surface ; Should be $2000
|
||||||
sta __e0 ; set "even" addresses
|
sta __e0 ; set "even" addresses
|
||||||
sta __e1
|
sta __e1
|
||||||
sta __e2
|
sta __e2
|
||||||
|
@ -481,7 +392,7 @@ odd_c equ 19
|
||||||
sta __o13
|
sta __o13
|
||||||
|
|
||||||
phb ; keep original bank
|
phb ; keep original bank
|
||||||
lda #>p ; Should be $0120
|
lda #>surface ; Should be $0120
|
||||||
pha ; switch to bank we're pointing into
|
pha ; switch to bank we're pointing into
|
||||||
plb ; B is now $20 - bad!
|
plb ; B is now $20 - bad!
|
||||||
plb ; B is now $01 - good!
|
plb ; B is now $01 - good!
|
||||||
|
@ -953,13 +864,12 @@ asmGetPoint start
|
||||||
|
|
||||||
temp1 equ 1
|
temp1 equ 1
|
||||||
|
|
||||||
jsubroutine (2:Xp,2:Yp),2
|
jsubroutine (4:surface,2:Xp,2:Yp),2
|
||||||
using ScanTable
|
|
||||||
|
|
||||||
lda Yp ; Load accumulator with Y location
|
lda Yp ; Load accumulator with Y location
|
||||||
asl a ; Shift accumulator left (multiply by 2) for word offset into table
|
asl a ; Shift accumulator left (multiply by 2) for word offset into table
|
||||||
tax ; Transfer accumulator to x register
|
tay ; Transfer accumulator to y register
|
||||||
lda >ScanTable,x ; Look up scan line address offset
|
lda ScanTable,y ; Look up scan line address offset
|
||||||
sta temp1 ; Store accumulator (row offset into SHR memory) into temp1
|
sta temp1 ; Store accumulator (row offset into SHR memory) into temp1
|
||||||
clc ; Clear carry flag
|
clc ; Clear carry flag
|
||||||
lda Xp ; Place X position in accumulator
|
lda Xp ; Place X position in accumulator
|
||||||
|
@ -968,8 +878,8 @@ temp1 equ 1
|
||||||
clc ; Clear carry
|
clc ; Clear carry
|
||||||
adc temp1 ; Add X position to SHR address with carry - a now contains address of color pair we want
|
adc temp1 ; Add X position to SHR address with carry - a now contains address of color pair we want
|
||||||
plp ; Restore our carry flag
|
plp ; Restore our carry flag
|
||||||
tax ; Transfer accumulator to x register
|
tay ; Transfer accumulator to y register
|
||||||
lda SHRShad,x ; Load pixel pair into accumulator
|
lda [surface],y ; Load pixel pair into accumulator
|
||||||
bcc GEven ; Branch if Carry Clear - Determines Even/Odd pixel
|
bcc GEven ; Branch if Carry Clear - Determines Even/Odd pixel
|
||||||
and #$F ; AND accumulator with $F to mask off unwanted pixel
|
and #$F ; AND accumulator with $F to mask off unwanted pixel
|
||||||
bra GBoth
|
bra GBoth
|
||||||
|
@ -985,15 +895,17 @@ GBoth sta temp1 ; Store accumulator in temp1
|
||||||
jreturn 2:temp1
|
jreturn 2:temp1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Return the current 1/10th second timer value
|
; Return the current 1/10th second timer value
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
asmGetVbl start
|
asmGetVbl start
|
||||||
using VblRate
|
using GlobalData
|
||||||
lda >VblTime
|
lda >VblTime
|
||||||
rtl
|
rtl
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Turns off SHR Graphics
|
; Turns off SHR Graphics
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
@ -1007,6 +919,7 @@ asmGrOff start
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Turns on SHR Graphics
|
; Turns on SHR Graphics
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
@ -1020,6 +933,7 @@ asmGrOn start
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Reads controller axis
|
; Reads controller axis
|
||||||
; Thank you to John Brooks for this code!
|
; Thank you to John Brooks for this code!
|
||||||
|
@ -1086,6 +1000,7 @@ gotpdl0 xba ; 3c
|
||||||
jreturn 2:pret0
|
jreturn 2:pret0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Swaps nibble values
|
; Swaps nibble values
|
||||||
;
|
;
|
||||||
|
@ -1096,16 +1011,16 @@ asmNSwap start
|
||||||
hnibo equ 1 ; High nibble old color value
|
hnibo equ 1 ; High nibble old color value
|
||||||
hnibn equ 2 ; High nibble new color value
|
hnibn equ 2 ; High nibble new color value
|
||||||
|
|
||||||
jsubroutine (4:P,2:C,2:O,2:N),2
|
jsubroutine (4:pointer,2:count,2:oldColor,2:newColor),2
|
||||||
|
|
||||||
short m ; Use 8 bit accumulator
|
short m ; Use 8 bit accumulator
|
||||||
lda N ; Load new color to use
|
lda newColor ; Load new color to use
|
||||||
asl a ; Shift it up a nibble
|
asl a ; Shift it up a nibble
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
sta hnibn ; Store it for later
|
sta hnibn ; Store it for later
|
||||||
lda O ; Load old color to use (16 bit argument)
|
lda oldColor ; Load old color to use (16 bit argument)
|
||||||
asl a ; Shift it up a nibble
|
asl a ; Shift it up a nibble
|
||||||
asl a
|
asl a
|
||||||
asl a
|
asl a
|
||||||
|
@ -1114,33 +1029,34 @@ hnibn equ 2 ; High nibble new color value
|
||||||
|
|
||||||
ldy #0 ; Load Y (our counter) with 0
|
ldy #0 ; Load Y (our counter) with 0
|
||||||
|
|
||||||
NSLow lda [P],y ; Get byte to check
|
NSLow lda [pointer],y ; Get byte to check
|
||||||
and #$0F ; Isolate low nibble
|
and #$0F ; Isolate low nibble
|
||||||
cmp O ; Compare to old value
|
cmp oldColor ; Compare to old value
|
||||||
bne NSHigh ; Not equal, skip to high nibble
|
bne NSHigh ; Not equal, skip to high nibble
|
||||||
lda [P],y ; Get byte to modify
|
lda [pointer],y ; Get byte to modify
|
||||||
and #$F0 ; Clear low nibble
|
and #$F0 ; Clear low nibble
|
||||||
ora N ; Set low nibble to new color
|
ora newColor ; Set low nibble to new color
|
||||||
sta [P],y ; Store it back
|
sta [pointer],y ; Store it back
|
||||||
|
|
||||||
NSHigh lda [P],y ; Get byte to check
|
NSHigh lda [pointer],y ; Get byte to check
|
||||||
and #$F0 ; Isolate high nibble
|
and #$F0 ; Isolate high nibble
|
||||||
cmp hnibo ; Compare to old color
|
cmp hnibo ; Compare to old color
|
||||||
bne NSEnd ; Not equal, skip to next byte
|
bne NSEnd ; Not equal, skip to next byte
|
||||||
lda [P],y ; Get byte to modify
|
lda [pointer],y ; Get byte to modify
|
||||||
and #$0F ; Clear high nibble
|
and #$0F ; Clear high nibble
|
||||||
ora hnibn ; Set high nibble to new color
|
ora hnibn ; Set high nibble to new color
|
||||||
sta [P],y ; Store it back
|
sta [pointer],y ; Store it back
|
||||||
|
|
||||||
NSEnd iny ; Increment Y
|
NSEnd iny ; Increment Y
|
||||||
clc ; Clear carry
|
clc ; Clear carry
|
||||||
cpy C ; Compare Y to number of bytes to modify
|
cpy count ; Compare Y to number of bytes to modify
|
||||||
bcc NSLow ; Keep going
|
bcc NSLow ; Keep going
|
||||||
|
|
||||||
long m ; Back to 16 bit accumulator
|
long m ; Back to 16 bit accumulator
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Plots a point in a given color
|
; Plots a point in a given color
|
||||||
;
|
;
|
||||||
|
@ -1152,41 +1068,41 @@ temp1 equ 1
|
||||||
temp2 equ 3
|
temp2 equ 3
|
||||||
temp3 equ 5
|
temp3 equ 5
|
||||||
|
|
||||||
jsubroutine (2:C,2:Xp,2:Yp),6
|
jsubroutine (4:surface,2:color,2:Xp,2:Yp),6
|
||||||
using ScanTable
|
using GlobalData
|
||||||
|
|
||||||
lda Xp ; Place X position in accumulator
|
lda Xp ; Place X position in accumulator
|
||||||
lsr a ; Logical Shift Right (divide by 2) - bit shifted off the end goes into carry flag
|
lsr a ; Logical Shift Right (divide by 2) - bit shifted off the end goes into carry flag
|
||||||
sta temp1 ; Store accumulator in temp1
|
sta temp1 ; Store accumulator in temp1
|
||||||
bcc PEven ; Branch if Carry Clear - Determines Even/Odd pixel
|
bcc PEven ; Branch if Carry Clear - Determines Even/Odd pixel
|
||||||
|
|
||||||
POdd lda #$FFF0 ; Load accumulator with pixel mask
|
POdd lda #$FFF0 ; Load accumulator with pixel mask
|
||||||
sta temp2 ; Store accumulator in temp2
|
sta temp2 ; Store accumulator in temp2
|
||||||
lda C ; Load accumulator with color
|
lda color ; Load accumulator with color
|
||||||
and #$F ; AND accumulator with $F
|
and #$F ; AND accumulator with $F
|
||||||
bra PBoth ; Branch Always to PBoth
|
bra PBoth ; Branch Always to PBoth
|
||||||
|
|
||||||
PEven lda #$FF0F ; Load accumulator with pixel mask
|
PEven lda #$FF0F ; Load accumulator with pixel mask
|
||||||
sta temp2 ; Store accumulator in temp2
|
sta temp2 ; Store accumulator in temp2
|
||||||
lda C ; Load accumulator with color
|
lda color ; Load accumulator with color
|
||||||
and #$F0 ; AND accumulator with $F0
|
and #$F0 ; AND accumulator with $F0
|
||||||
|
|
||||||
PBoth sta temp3 ; Store accumulator in temp3
|
PBoth sta temp3 ; Store accumulator in temp3
|
||||||
lda Yp ; Load accumulator with Y location
|
lda Yp ; Load accumulator with Y location
|
||||||
asl a ; Shift accumulator left (multiply by 2)
|
asl a ; Shift accumulator left (multiply by 2)
|
||||||
tax ; Transfer accumulator to x register
|
tay ; Transfer accumulator to y register
|
||||||
lda >ScanTable,x ; Look up scan line address offset
|
lda ScanTable,y ; Look up scan line address offset
|
||||||
adc temp1 ; Add X position to address with carry
|
adc temp1 ; Add X position to address with carry
|
||||||
tax ; Transfer accumulator to x
|
tay ; Transfer accumulator to y
|
||||||
|
|
||||||
lda >SHRShad,x ; Load existing pixels into accumulator
|
lda [surface],y ; Load existing pixels into accumulator
|
||||||
and temp2 ; AND accumulator with temp2
|
and temp2 ; AND accumulator with temp2
|
||||||
ora temp3 ; OR accumulator with temp3
|
ora temp3 ; OR accumulator with temp3
|
||||||
sta >SHRShad,x ; Store updated pixels back into memory
|
sta [surface],y ; Store updated pixels back into memory
|
||||||
|
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; "PEI Slam" shadowed SHR display to the
|
; "PEI Slam" shadowed SHR display to the
|
||||||
; actual display. Copies all 200 lines,
|
; actual display. Copies all 200 lines,
|
||||||
|
@ -1416,21 +1332,21 @@ StackPtr ds 2 ; Space for SP
|
||||||
; Builds a table of scanline offsets
|
; Builds a table of scanline offsets
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
asmStart start
|
asmStart start
|
||||||
jsubroutine (2:id,2:h)
|
jsubroutine (2:id,2:hertz)
|
||||||
using ScanTable
|
using GlobalData
|
||||||
using VblRate
|
|
||||||
|
|
||||||
ldx #0 ; Load 0 into x register
|
ldy #0 ; Load 0 into y register
|
||||||
lda #0 ; Load 0 into accumulator
|
lda #0 ; Load 0 into accumulator
|
||||||
clc ; Clear carry flag
|
clc ; Clear carry flag
|
||||||
STL sta >ScanTable,x ; Store accumulator in ScanTable+x
|
buildTable anop
|
||||||
|
sta ScanTable,y ; Store accumulator in ScanTable+x
|
||||||
adc #160 ; Add 160 to accumulator
|
adc #160 ; Add 160 to accumulator
|
||||||
inx ; Increment x
|
iny ; Increment y
|
||||||
inx ; Increment x
|
iny ; Increment y
|
||||||
cpx #400 ; Compare x to 400 (200 scanlines)
|
cpy #400 ; Compare y to 400 (200 scanlines)
|
||||||
bcc STL ; Repeat Scan Table Loop until we do all 200 lines
|
bcc buildTable ; Repeat Scan Table Loop until we do all 200 lines
|
||||||
|
|
||||||
lda h ; Store refresh rate / 10 in VblCount and VblRate
|
lda hertz ; Store refresh rate / 10 in VblCount and VblRate
|
||||||
sta >VblRate
|
sta >VblRate
|
||||||
|
|
||||||
lda #0 ; Reset timer
|
lda #0 ; Reset timer
|
||||||
|
@ -1447,6 +1363,7 @@ STL sta >ScanTable,x ; Store accumulator in ScanTable+x
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Shut down assembly routines
|
; Shut down assembly routines
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
@ -1460,6 +1377,7 @@ asmStop start
|
||||||
jreturn
|
jreturn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
; Increment time counter using VBLs every 1/10 second
|
; Increment time counter using VBLs every 1/10 second
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
@ -1467,7 +1385,9 @@ VblHdr start
|
||||||
dc i4'0' ; Space for task pointer
|
dc i4'0' ; Space for task pointer
|
||||||
VblCount dc i2'1' ; How many VBLs between calls (1 only on initial call)
|
VblCount dc i2'1' ; How many VBLs between calls (1 only on initial call)
|
||||||
dc i2'$A55A' ; Task signature
|
dc i2'$A55A' ; Task signature
|
||||||
using VblRate
|
|
||||||
|
using GlobalData
|
||||||
|
|
||||||
long m,i
|
long m,i
|
||||||
lda >VblRate ; Reset hearbeat counter
|
lda >VblRate ; Reset hearbeat counter
|
||||||
sta >VblCount
|
sta >VblCount
|
||||||
|
|
202
joeylib/src/jST.c
Normal file
202
joeylib/src/jST.c
Normal file
|
@ -0,0 +1,202 @@
|
||||||
|
/*
|
||||||
|
* JoeyLib
|
||||||
|
* Copyright (C) 2018-2019 Scott Duensing <scott@kangaroopunch.com>
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "joey.h"
|
||||||
|
|
||||||
|
|
||||||
|
void jlDisplayPresent(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2) {
|
||||||
|
(void)sta;
|
||||||
|
(void)cx1;
|
||||||
|
(void)cy1;
|
||||||
|
(void)cx2;
|
||||||
|
(void)cy2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlit8x8a(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte offset) {
|
||||||
|
(void)sta;
|
||||||
|
(void)cx1;
|
||||||
|
(void)cy1;
|
||||||
|
(void)cx2;
|
||||||
|
(void)cy2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawBlitMap(jint16 startX, jint16 startY, jint16 width, jint16 height, byte *mapData, juint16 stride, jlStaT *sta) {
|
||||||
|
(void)startX;
|
||||||
|
(void)startY;
|
||||||
|
(void)width;
|
||||||
|
(void)height;
|
||||||
|
(void)mapData;
|
||||||
|
(void)stride;
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawClear(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte jlDrawGetPixel(jint16 x, jint16 y) {
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlDrawPoint(jint16 x, jint16 y) {
|
||||||
|
(void)x;
|
||||||
|
(void)y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
jint16 jlGameGetAxis(byte which) {
|
||||||
|
(void)which;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlGameGetButton(byte which) {
|
||||||
|
(void)which;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlKeyPressed(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char jlKeyRead(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSet(byte index, byte r, byte g, byte b) {
|
||||||
|
(void)index;
|
||||||
|
(void)r;
|
||||||
|
(void)g;
|
||||||
|
(void)b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlPaletteSetFromSta(jlStaT *sta) {
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundFree(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlSoundIsPlaying(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool _jlSoundLoad(jlSoundT **sound, char *filename) {
|
||||||
|
(void)sound;
|
||||||
|
(void)filename;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicContinue(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlSoundMusicIsPlaying(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicPause(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicPlay(char *name) {
|
||||||
|
(void)name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundMusicStop(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlSoundPlay(jlSoundT *sound) {
|
||||||
|
(void)sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool _jlStaCreate(jlStaT **sta) {
|
||||||
|
(void)sta;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlStaDisplay(jlStaT *sta) {
|
||||||
|
(void)sta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilIdle(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool jlUtilMustExit(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilNibbleSwap(byte *mem, jint16 count, byte old, byte new) {
|
||||||
|
(void)mem;
|
||||||
|
(void)count;
|
||||||
|
(void)old;
|
||||||
|
(void)new;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilShutdown(void) {
|
||||||
|
jlUtilDie("Clean Exit.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilStartup(char *appTitle) {
|
||||||
|
(void)appTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
juint16 jlUtilTimer(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -627,6 +627,16 @@ void jlUtilRandomSeedSet(juint32 seed) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void jlUtilSleep(juint16 tenths) {
|
||||||
|
juint16 t = jlUtilTimer();
|
||||||
|
juint16 d = 0;
|
||||||
|
|
||||||
|
while ((d < tenths) && !jlUtilMustExit()) {
|
||||||
|
d = jlUtilTimeSpan(t, jlUtilTimer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void *_jlUtilStackPop(jlStackT **stack) {
|
void *_jlUtilStackPop(jlStackT **stack) {
|
||||||
void *d = NULL;
|
void *d = NULL;
|
||||||
jlStackT *s;
|
jlStackT *s;
|
||||||
|
@ -649,6 +659,15 @@ void _jlUtilStackPush(jlStackT **stack, void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
juint16 jlUtilTimeSpan(juint16 past, juint16 current) {
|
||||||
|
jint32 temp = current - past;
|
||||||
|
if (temp < 0) {
|
||||||
|
temp += 65536;
|
||||||
|
}
|
||||||
|
return (juint16)temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
|
void jlVecDisplay(jlVecT *vec, jint16 ox, jint16 oy) {
|
||||||
jint16 command;
|
jint16 command;
|
||||||
jint16 count;
|
jint16 count;
|
||||||
|
|
|
@ -282,13 +282,14 @@ juint16 jlUtilRandom(void);
|
||||||
juint32 jlUtilRandomSeedGet(void);
|
juint32 jlUtilRandomSeedGet(void);
|
||||||
void jlUtilRandomSeedSet(juint32 seed);
|
void jlUtilRandomSeedSet(juint32 seed);
|
||||||
void jlUtilShutdown(void) __attribute__((noreturn));
|
void jlUtilShutdown(void) __attribute__((noreturn));
|
||||||
|
void jlUtilSleep(juint16 tenths);
|
||||||
#define jlUtilStackPop(stack) _jlUtilStackPop((jlStackT **)&(stack)) // Syntatic Sugar
|
#define jlUtilStackPop(stack) _jlUtilStackPop((jlStackT **)&(stack)) // Syntatic Sugar
|
||||||
void *_jlUtilStackPop(jlStackT **stack);
|
void *_jlUtilStackPop(jlStackT **stack);
|
||||||
#define jlUtilStackPush(stack, data) _jlUtilStackPush((jlStackT **)&(stack), data) // Syntatic Sugar
|
#define jlUtilStackPush(stack, data) _jlUtilStackPush((jlStackT **)&(stack), data) // Syntatic Sugar
|
||||||
void _jlUtilStackPush(jlStackT **stack, void *data);
|
void _jlUtilStackPush(jlStackT **stack, void *data);
|
||||||
void jlUtilStartup(char *appTitle);
|
void jlUtilStartup(char *appTitle);
|
||||||
juint16 jlUtilTimer(void);
|
juint16 jlUtilTimer(void);
|
||||||
#define jlUtilTimeSpan(past, current) (past < current ? current - past : 65536 - past - current)
|
juint16 jlUtilTimeSpan(juint16 past, juint16 current);
|
||||||
|
|
||||||
void jlVecDisplay(jlVecT *vec, jint16 x, jint16 y);
|
void jlVecDisplay(jlVecT *vec, jint16 x, jint16 y);
|
||||||
void jlVecFree(jlVecT *vec);
|
void jlVecFree(jlVecT *vec);
|
||||||
|
@ -298,22 +299,22 @@ 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(juint32 surface, 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 asmB88a(juint32 surface, byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte alphaOffset);
|
||||||
extern void asmDrawBM(jint16 startX, jint16 startY, jint16 width, jint16 height, byte *mapData, juint16 stride, byte *sta);
|
extern void asmDrawBM(juint32 surface, jint16 startX, jint16 startY, jint16 width, jint16 height, byte *mapData, juint16 stride, byte *sta);
|
||||||
//extern void asmDrawLine(byte *p, jint16 color, jint16 x1, jint16 y1, jint16 x2, jint16 y2);
|
//extern void asmDrawLine(juint32 surface, jint16 color, jint16 x1, jint16 y1, jint16 x2, jint16 y2);
|
||||||
extern jint16 asmGetPoint(jint16 x, jint16 y);
|
extern jint16 asmGetPoint(juint32 surface, jint16 x, jint16 y);
|
||||||
extern juint16 asmGetVbl(void);
|
extern juint16 asmGetVbl(void);
|
||||||
extern void asmNSwap(byte *mem, jint16 count, jint16 old, jint16 new);
|
extern void asmNSwap(byte *mem, jint16 count, jint16 old, jint16 new);
|
||||||
extern void asmPoint(jint16 color, jint16 x, jint16 y);
|
extern void asmPoint(juint32 surface, jint16 color, jint16 x, jint16 y);
|
||||||
|
|
||||||
// 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(0x012000, (byte *)sta->pixels, cx1, cy1, cx2, cy2)
|
||||||
#define jlDrawBlit8x8a(sta, cx1, cy1, cx2, cy2, offset) asmB88a((byte *)sta->pixels, cx1, cy1, cx2, cy2, offset)
|
#define jlDrawBlit8x8a(sta, cx1, cy1, cx2, cy2, offset) asmB88a(0x012000, (byte *)sta->pixels, cx1, cy1, cx2, cy2, offset)
|
||||||
#define jlDrawBlitMap(startX, startY, width, height, mapData, stride, sta) asmDrawBM(startX, startY, width, height, (byte *)mapData, stride, (byte *)sta->pixels)
|
#define jlDrawBlitMap(startX, startY, width, height, mapData, stride, sta) asmDrawBM(0x012000, startX, startY, width, height, (byte *)mapData, stride, (byte *)sta->pixels)
|
||||||
#define jlDrawGetPixel(x, y) asmGetPoint(x, y)
|
#define jlDrawGetPixel(x, y) asmGetPoint(0x012000, x, y)
|
||||||
#define jlDrawPoint(x, y) asmPoint(_jlDrawColorNibbles, x, y)
|
#define jlDrawPoint(x, y) asmPoint(0x012000, _jlDrawColorNibbles, x, y)
|
||||||
//#define jlDrawLine(x1, y1, x2, y2) asmDrawLine((byte *)0x012000L, _jlDrawColor, x1, y1, x2, y2)
|
//#define jlDrawLine(x1, y1, x2, y2) asmDrawLine(0x012000, _jlDrawColor, x1, y1, x2, y2)
|
||||||
#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)
|
||||||
#define jlUtilTimer asmGetVbl
|
#define jlUtilTimer asmGetVbl
|
||||||
|
|
||||||
|
|
|
@ -70,9 +70,9 @@ int main(void) {
|
||||||
|
|
||||||
jlStaDisplay(kanga);
|
jlStaDisplay(kanga);
|
||||||
jlDrawColor(1);
|
jlDrawColor(1);
|
||||||
//jlDrawBox(0, 0, 319, 199);
|
jlDrawBox(0, 0, 319, 199);
|
||||||
|
|
||||||
//jlSoundMusicPlay("music");
|
jlSoundMusicPlay("music");
|
||||||
|
|
||||||
jlPaletteSet(15, 15, 15, 15);
|
jlPaletteSet(15, 15, 15, 15);
|
||||||
printAt(font, 1, 16, "X");
|
printAt(font, 1, 16, "X");
|
||||||
|
@ -82,13 +82,11 @@ int main(void) {
|
||||||
printAt(font, 1, y++, "Y = %d ", jlGameGetAxis(1));
|
printAt(font, 1, y++, "Y = %d ", jlGameGetAxis(1));
|
||||||
printAt(font, 1, y++, "T = %d ", jlUtilTimer());
|
printAt(font, 1, y++, "T = %d ", jlUtilTimer());
|
||||||
jlDrawColor((byte)color);
|
jlDrawColor((byte)color);
|
||||||
_jlDebugBorder(BORDER_GREEN);
|
|
||||||
jlDrawLine(0, y2, 319, 199-y2);
|
jlDrawLine(0, y2, 319, 199-y2);
|
||||||
_jlDebugBorder(BORDER_BROWN);
|
|
||||||
y2 += dy;
|
y2 += dy;
|
||||||
if (y2 == 199 || y2 == 0) dy = -dy;
|
if (y2 == 199 || y2 == 0) dy = -dy;
|
||||||
jlDisplayPresent();
|
jlDisplayPresent();
|
||||||
//jlUtilNibbleSwap((byte *)font->pixels, 32000, (byte)(color), (byte)(nextColor));
|
jlUtilNibbleSwap((byte *)font->pixels, 32000, (byte)(color), (byte)(nextColor));
|
||||||
color = nextColor;
|
color = nextColor;
|
||||||
nextColor++;
|
nextColor++;
|
||||||
if (nextColor > 15) nextColor = 1;
|
if (nextColor > 15) nextColor = 1;
|
||||||
|
|
|
@ -507,11 +507,11 @@ function installIIgs() {
|
||||||
|
|
||||||
mkdir -p "${JOEY}/dist/IIgs"
|
mkdir -p "${JOEY}/dist/IIgs"
|
||||||
|
|
||||||
if [[ ! -e "${JOEY}/dist/IIgs/Tool221#ba0000" ]]; then
|
if [[ ! -e "${IIGS}/Tool221#ba0000" ]]; then
|
||||||
purple "Installing Tool221"
|
purple "Installing Tool221"
|
||||||
download https://www.brutaldeluxe.fr/products/apple2gs/tool221/ninjatracker_tool221_v2.1.2mg
|
download https://www.brutaldeluxe.fr/products/apple2gs/tool221/ninjatracker_tool221_v2.1.2mg
|
||||||
"${IIGS}/cadius/cadius" extractfile ninjatracker_tool221_v2.1.2mg NT.TOOL221.V2.1/SYSTEM/TOOLS/TOOL221 .
|
"${IIGS}/cadius/cadius" extractfile ninjatracker_tool221_v2.1.2mg NT.TOOL221.V2.1/SYSTEM/TOOLS/TOOL221 .
|
||||||
cp -f TOOL221#BA0000 "${JOEY}/dist/IIgs/Tool221#ba0000"
|
cp -f TOOL221#BA0000 "${IIGS}/Tool221#ba0000"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
purple "Building JoeyLib"
|
purple "Building JoeyLib"
|
||||||
|
|
|
@ -17,6 +17,9 @@ export PATH="${JOEY}/sdks/IIgs:${PATH}"
|
||||||
export MACOSX_DEPLOYMENT_TARGET=10.6
|
export MACOSX_DEPLOYMENT_TARGET=10.6
|
||||||
export PATH="${JOEY}/sdks/macos/bin:${PATH}"
|
export PATH="${JOEY}/sdks/macos/bin:${PATH}"
|
||||||
|
|
||||||
|
# Amiga Cross Compiler
|
||||||
|
export PATH="${JOEY}/sdks/amiga/bin:${PATH}"
|
||||||
|
|
||||||
# Raspberry Pi Cross Compiler
|
# Raspberry Pi Cross Compiler
|
||||||
#export PATH="${JOEY}/sdks/pi/tools/arm-bcm2708/arm-bmc2708-linux-gnueabi/bin:${PATH}"
|
#export PATH="${JOEY}/sdks/pi/tools/arm-bcm2708/arm-bmc2708-linux-gnueabi/bin:${PATH}"
|
||||||
#export PATH="${JOEY}/sdks/pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:${PATH}"
|
#export PATH="${JOEY}/sdks/pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:${PATH}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue