diff --git a/imgconvert/imgconvert.pro b/imgconvert/imgconvert.pro index beafe44..5ae1d93 100644 --- a/imgconvert/imgconvert.pro +++ b/imgconvert/imgconvert.pro @@ -14,18 +14,11 @@ JOEY_HEADERS = \ JOEY_LIBS = \ -L$$JOEY/dist/linux/x64 \ - -Wl,-rpath,$$JOEY/dist/linux/x64 \ - -Wl,--enable-new-dtags \ - -l:joeylib.a \ - -Wl,--no-undefined \ + -ljoeylib \ -ldl \ - -lsndio \ - -lpthread \ - -lrt \ - -lm + -lpthread JOEY_FLAGS = \ - -pthread \ -D_REENTRANT SDL_IMAGE_LIBS = \ diff --git a/imgconvert/main.c b/imgconvert/main.c index 7695ea7..e9eab35 100644 --- a/imgconvert/main.c +++ b/imgconvert/main.c @@ -125,6 +125,8 @@ int main(int argc, char *argv[]) { jlKeyWaitForAny(); } + jlStaFree(sta); + IMG_Quit(); jlUtilShutdown(); } diff --git a/installer.sh b/installer.sh new file mode 100755 index 0000000..a9cd5d5 --- /dev/null +++ b/installer.sh @@ -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 diff --git a/joeylib/build-IIgs.helper.sh b/joeylib/build-IIgs.helper.sh index a099682..59f6b6d 100755 --- a/joeylib/build-IIgs.helper.sh +++ b/joeylib/build-IIgs.helper.sh @@ -4,51 +4,69 @@ TARGET=${JOEY}/sdks/iix/IIgs/out/${PROJECT} GSTARGET=31:/out/${PROJECT} CADIUS=${JOEY}/sdks/iix/cadius-git/bin/release/cadius VOL=Import -IMPORT=/tmp/IIgs/import.po +WORK=/tmp/IIgs +IMPORT=${WORK}/import.po +# Clean up target and working directories if [ -d ${TARGET} ]; then rm -rf ${TARGET} fi mkdir -p ${TARGET} -rm /tmp/IIgs/_FileInformation.txt || true 2> /dev/null -rm /tmp/IIgs/JLSTATS#040000 || true 2> /dev/null -rm ${IMPORT} || true 2> /dev/null +if [ -d ${WORK} ]; then + rm -rf ${WORK} +fi +mkdir -p ${WORK} +# We temporarily need a local copy of the joey header cp -f ${JOEY}/dist/joey.h . + +# Make a list of files to compile, iterate over them CFILES=($(ls -1 *.c)) OFILES="" for F in "${CFILES[@]}"; do O=${F%.*} + # If this file is named 'main' we don't add it to the link list until later if [ "${O}" != "main" ]; then OFILES="${OFILES} ${GSTARGET}/${O}" fi echo "Compiling ${F}..." iix compile ${F} keep=${GSTARGET}/${O} done -rm joey.h -OFILES="${GSTARGET}/main ${OFILES} 13:joeylib" +# Be sure 'main' is first in the link list +OFILES="${GSTARGET}/main ${OFILES} ${GSTARGET}/joeylib" -cp -f ${JOEY}/dist/IIgs/joeylib#b20000 ${JOEY}/sdks/iix/IIgs/Libraries/joeylib -iix chtyp -t lib ${JOEY}/sdks/iix/IIgs/Libraries/joeylib +# Clean up +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 + +# Create a disassembly and linker input listing iix dumpobj +D ${GSTARGET}/${PROJECT}#b30000 &> ${PROJECT}.dis || true echo ${OFILES} > ${PROJECT}.lnk +# Did they ask for GSPlus to be executed? 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} createfolder ${IMPORT} ${VOL}/data > /dev/null ${CADIUS} addfile ${IMPORT} ${VOL} ${TARGET}/${PROJECT}#b30000 > /dev/null - mkdir -p /tmp/IIgs/data for F in "${DATA[@]}"; do - N=/tmp/IIgs/data/`basename ${F}`#060000 + N=${WORK}/data/`basename ${F}`#060000 cp -f ${F} ${N} ${CADIUS} addfile ${IMPORT} ${VOL}/data ${N} > /dev/null rm ${N} 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 F in `ls -1 ${S}`; do tr "\n" "\r" < ${F} > /tmp/IIgs/source/${F}#040000 @@ -57,13 +75,16 @@ if [ ! -z $1 ]; then done done + # Launch GSPlus pushd ${JOEY}/sdks/iix/gsplus - ./gsplus -config IIgsTest.cfg || true + ./gsplus -resizeable -config IIgsTest.cfg || true 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 "" - cat /tmp/IIgs/JLSTATS#040000 | tr "\r" "\n" 2> /dev/null + cat ${WORK}/JLSTATS#040000 | tr "\r" "\n" 2> /dev/null echo "" fi fi diff --git a/joeylib/build-IIgs.sh b/joeylib/build-IIgs.sh index 2a96df9..6a3259b 100755 --- a/joeylib/build-IIgs.sh +++ b/joeylib/build-IIgs.sh @@ -27,14 +27,16 @@ popd mkdir -p ${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 ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/. +cp -f ${JOEY}/joeylib/joeylib/build-IIgs.helper.sh ${JOEY}/dist/IIgs/. if [ ! -z $1 ]; then CADIUS=${JOEY}/sdks/iix/cadius-git/bin/release/cadius - IMPORT=/tmp/import.po + IMPORT=/tmp/IIgs/import.po VOL=Import + mkdir -p `dirname ${IMPORT}` rm ${OUT}/JLSTATS 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 pushd ${JOEY}/sdks/iix/gsplus - ./gsplus -config IIgsTest.cfg || true + ./gsplus -resizeable -config IIgsTest.cfg || true popd echo "" - ${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS ${OUT} > /dev/null - cat ${OUT}/JLSTATS#040000 2> /dev/null + ${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 diff --git a/joeylib/build-PC.sh b/joeylib/build-PC.sh index 7263f35..e28e2a5 100755 --- a/joeylib/build-PC.sh +++ b/joeylib/build-PC.sh @@ -42,7 +42,6 @@ DIST="${JOEY}/dist/linux/x64" INSTALLED="${JOEY}/SDL2/installed/linux/x64/lib" doBuild -:<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 clc lda cx1 ; Multiply cx1 by 4 to get offset (two pixels per byte) @@ -342,7 +524,7 @@ ptrig equ $00C070 gotpdl1 xba ; 3c chkpdl0 lda pdl0 ; 4c. Read pdl0. 10c until pdl1 read - bpl gotpdl0 ; 2/3c taken if pdl0 is done + bpl gotpdl0 ; 2/3c taken if pdl0 is done inx ; 2c inx ; 2c lda pdl1 ; 4c. Read pdl1. 12c until pdl0 read diff --git a/joeylib/src/jIIgs.c b/joeylib/src/jIIgs.c index ddc1277..acbcec0 100644 --- a/joeylib/src/jIIgs.c +++ b/joeylib/src/jIIgs.c @@ -66,14 +66,14 @@ extern pascal void NTContinueMusic(void) inline(0x14DD, dispatcher); char _jlKeyCheck(char key); -static byte *KEYBOARD = (byte *)0x00C000; -static byte *KEYSTROBE = (byte *)0x00C010; -static byte *BUTTON0 = (byte *)0x00C061; -static byte *BUTTON1 = (byte *)0x00C062; -static jlPixelPairT *SHRPIXELS = (jlPixelPairT *)0x012000; // Shadow of 0xE12000 -static byte *SHRSCB = (byte *)0x019D00; // Shadow of 0xE19D00 -static jlColorT *SHRCOLORS = (jlColorT *)0x019E00; // Shadow of 0xE19E00 -static byte *BORDER = (byte *)0xE0C034; +static byte *KEYBOARD = (byte *)0x00C000L; +static byte *KEYSTROBE = (byte *)0x00C010L; +static byte *BUTTON0 = (byte *)0x00C061L; +static byte *BUTTON1 = (byte *)0x00C062L; +static jlPixelPairT *SHRPIXELS = (jlPixelPairT *)0x012000L; // Shadow of 0xE12000 +static byte *SHRSCB = (byte *)0x019D00L; // Shadow of 0xE19D00 +static jlColorT *SHRCOLORS = (jlColorT *)0x019E00L; // Shadow of 0xE19E00 +static byte *BORDER = (byte *)0xE0C034L; static byte _jlBorderSaved; @@ -95,7 +95,6 @@ void _jlDieWithToolError(const char *what, int err) { void _jlDebugBorder(jlBorderColorsE color) { jlDisplayBorder(color); asmBorder(_jlBorderColor); - //*BORDER = *BORDER & 0xF0 | _jlBorderColor; } #else #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) { //***TODO*** } @@ -312,8 +316,6 @@ void jlUtilStartup(char *appTitle) { (void)appTitle; // Unused on IIgs - _jlDebugBorder(BORDER_DEEP_RED); - // Start up neded tools TLStartUp(); _jlMyID = MMStartUp(); @@ -325,6 +327,7 @@ void jlUtilStartup(char *appTitle) { // Reserve shadow area for SHR _jlSHRShadowHandle = NewHandle((LongWord)0x8000, (Word)_jlMemID, (Word)(attrLocked + attrFixed + attrBank + attrAddr), (Pointer)0x012000); + JOEY_CHECK_TOOL_ERROR("NewHandle") // Start assembly module _jlHertz = (int)ReadBParam((Word)0x1D) == 0 ? 60 : 50; // Is this a PAL or NTSC machine? diff --git a/joeylib/src/jPC.c b/joeylib/src/jPC.c index c4c1aaf..80659a1 100644 --- a/joeylib/src/jPC.c +++ b/joeylib/src/jPC.c @@ -160,7 +160,8 @@ void jlDrawBlit8x8(jlStaT *sta, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2) int x; 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); 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) { 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) { if (sound != NULL) { if (sound->data != NULL) { diff --git a/joeylib/src/joey.c b/joeylib/src/joey.c index a53a4a8..e9b6108 100644 --- a/joeylib/src/joey.c +++ b/joeylib/src/joey.c @@ -189,7 +189,7 @@ void jlDrawBlitMap(byte startX, byte startY, byte width, byte height, byte *mapD for (x=startX; x> 8) | (juint16)((twoBytes) << 8) + + void jlDisplayBorder(jlBorderColorsE color); void jlDisplayPresent(void); 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 jlDrawBox(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 jlPaletteSet(byte index, byte r, byte g, byte b); +void jlPaletteSetFromSta(jlStaT *sta); void jlSoundFree(jlSoundT *sound); bool jlSoundIsPlaying(jlSoundT *sound); @@ -277,17 +282,19 @@ bool _jlVecLoad(jlVecT **vec, char *filename); #ifdef JOEY_IIGS // Inlined functions - asm code 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 jint16 asmGetPoint(jint16 x, jint16 y); extern juint16 asmGetVbl(void); extern void asmNSwap(byte *mem, jint16 count, jint16 old, jint16 new); // Inlined functions -#define jlDrawBlit8x8(sta, cx1, cy1, cx2, cy2) asmB88((byte *)sta->pixels, cx1, cy1, cx2, cy2) -#define jlDrawGetPixel(x, y) asmGetPoint(x, y) -#define jlDrawPoint(x, y) asmPoint(_jlDrawColorNibbles, x, y) -#define jlUtilNibbleSwap(mem, count, old, new) asmNSwap(mem, count, (jint16)old, (jint16)new) -#define jlUtilTimer asmGetVbl +#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 jlDrawPoint(x, y) asmPoint(_jlDrawColorNibbles, x, y) +#define jlUtilNibbleSwap(mem, count, old, new) asmNSwap(mem, count, (jint16)old, (jint16)new) +#define jlUtilTimer asmGetVbl #ifdef JOEY_DEBUG void _jlDebugBorder(jlBorderColorsE color); diff --git a/joeylib/src/test.c b/joeylib/src/test.c index 61fb538..7257f85 100644 --- a/joeylib/src/test.c +++ b/joeylib/src/test.c @@ -25,6 +25,7 @@ #include +#define JOEY_MAIN #include "joey.h" @@ -32,7 +33,7 @@ segment "testapp"; #endif -/* + // Font hacking! __attribute__((__format__ (__printf__, 4, 0))) 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); } } -*/ + int main(void) { - /* jlStaT *kanga = NULL; jlStaT *font = NULL; jint16 y; jint16 color = 15; jint16 nextColor = 1; - */ jlUtilStartup("JoeyLib Test"); - /* if (!jlStaLoad(kanga, "kanga")) jlUtilDie("Unable to load kanga.sta!"); if (!jlStaLoad(font, "font")) jlUtilDie("Unable to load font.sta!"); @@ -95,7 +93,6 @@ int main(void) { jlStaFree(font); jlStaFree(kanga); - */ jlUtilShutdown(); }