Commit daea38b7 authored by Scott Duensing's avatar Scott Duensing

IIgs ASM code now supports drawing on any valid surface.

parent 76c46364
#!/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
#!/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/.
#!/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
OTHER_FILES += \
src/jBlank.c \
src/jST.c \
src/jAmiga.c \
src/jIIgs.c \
src/jIIgs.asm \
src/jIIgs.macro \
......
/*
* 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;
}
/*
* 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;