First working installable version?

This commit is contained in:
Scott Duensing 2019-07-13 19:06:05 -05:00
parent 69b4aa5347
commit 18c53676a3
11 changed files with 704 additions and 333 deletions

View file

@ -22,17 +22,16 @@ iix -DKeepType=S16 link +L 31:/out/joey/test 31:/out/joey/joeylib keep=31:/out/j
iix dumpobj +D 31:/out/joey/test &> test.dis || true iix dumpobj +D 31:/out/joey/test &> test.dis || true
php ${JOEY}/sdks/IIgs/ntconverter.php *.mod php ${JOEY}/sdks/IIgs/ntconverter/ntconverter.php *.mod
popd popd
mkdir -p ${JOEY}/dist/IIgs mkdir -p ${JOEY}/dist/IIgs
cp -f ${JOEY}/joeylib/joeylib/lib/IIgs/Tool221#ba0000 ${JOEY}/dist/IIgs/.
cp -f ${OUT}/joeylib ${JOEY}/dist/IIgs/joeylib#b20000 cp -f ${OUT}/joeylib ${JOEY}/dist/IIgs/joeylib#b20000
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/. cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
cp -f ${JOEY}/joeylib/scripts/build-IIgs.helper.sh ${JOEY}/dist/IIgs/. cp -f ${JOEY}/joeylib/scripts/build-IIgs.helper.sh ${JOEY}/dist/IIgs/.
if [ ! -z $1 ]; then if [ ! -z $1 ]; then
CADIUS=${JOEY}/sdks/IIgs/cadius-git/bin/release/cadius CADIUS=${JOEY}/sdks/IIgs/cadius/cadius
IMPORT=/tmp/IIgs/import.po IMPORT=/tmp/IIgs/import.po
VOL=Import VOL=Import
@ -55,7 +54,7 @@ if [ ! -z $1 ]; then
${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/music.w#060000 > /dev/null ${CADIUS} addfile ${IMPORT} ${VOL}/data ${OUT}/music.w#060000 > /dev/null
pushd ${JOEY}/sdks/IIgs/gsplus pushd ${JOEY}/sdks/IIgs/gsplus
./gsplus -resizeable -config IIgsTest.cfg || true ./GSplus -resizeable -config IIgsTest.cfg || true
popd popd
echo "" echo ""
${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS /tmp/IIgs/. > /dev/null ${CADIUS} extractfile ${IMPORT} ${VOL}/JLSTATS /tmp/IIgs/. > /dev/null

View file

@ -56,8 +56,8 @@ if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux32x" ]; then
CC="gcc" CC="gcc"
CFLAGS="-m32" CFLAGS="-m32"
LDFLAGS="" LDFLAGS=""
DIST="${JOEY}/dist/linux/x86" DIST="${JOEY}/dist/linux/i386"
INSTALLED="${JOEY}/SDL2/installed/linux/x86/lib" INSTALLED="${JOEY}/SDL2/installed/linux/i386/lib"
doBuild doBuild
fi fi
@ -74,8 +74,8 @@ if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows32x" ]; then
CC="i686-w64-mingw32-gcc" CC="i686-w64-mingw32-gcc"
CFLAGS="" CFLAGS=""
LDFLAGS="" LDFLAGS=""
DIST="${JOEY}/dist/windows/x86" DIST="${JOEY}/dist/windows/i386"
INSTALLED="${JOEY}/SDL2/installed/windows/x86/lib" INSTALLED="${JOEY}/SDL2/installed/windows/i386/lib"
doBuild doBuild
fi fi
@ -83,8 +83,8 @@ if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos32x" ]; then
CC="o32-clang" CC="o32-clang"
CFLAGS="" CFLAGS=""
LDFLAGS="" LDFLAGS=""
DIST="${JOEY}/dist/macos/x86" DIST="${JOEY}/dist/macos/i386"
INSTALLED="${JOEY}/SDL2/installed/macos/x86/lib" INSTALLED="${JOEY}/SDL2/installed/macos/i386/lib"
doBuild doBuild
fi fi

View file

@ -422,6 +422,528 @@ drawTop phy ; Keep Y for later
jreturn jreturn
end end
;===============================================================================================
;
; Arc3D line-drawing code
; By Andy McFadden
; Adapted from code by the FTA.
;
; Draws from (clpx0,clpy0) to (clpx1,clpy1) (output of a clipping routine).
;
asmDrawLine start
x0 equ 1
y0 equ 3
x1 equ 5
y1 equ 7
offset equ 9
deltax equ 11
deltay equ 13
diff equ 15
even_c equ 17
odd_c equ 19
jsubroutine (4:p,2:penColor,2:clpx0,2:clpy0,2:clpx1,2:clpy1),20
; Say p = $012000...
lda #<p ; Should be $2000
sta __e0 ; set "even" addresses
sta __e1
sta __e2
sta __e3
sta __e4
sta __e5
sta __e6
sta __e7
sta __e8
sta __e9
sta __e10
sta __e11
sta __e12
sta __e13
dea ; Should be $1fff
sta __o0 ; set "odd" addresses
sta __o1
sta __o2
sta __o3
sta __o4
sta __o5
sta __o6
sta __o7
sta __o8
sta __o9
sta __o10
sta __o11
sta __o12
sta __o13
phb ; keep original bank
lda #>p ; Should be $0120
pha ; switch to bank we're pointing into
plb ; B is now $20 - bad!
plb ; B is now $01 - good!
DoDrawLine anop
lda <clpy1 ; 4 is y1 < y0?
cmp <clpy0 ; 4
blt in_order ; 2/3 yes, so leave alone
; lda <clpy1 ; we want y0 to be the largest,
sta y0 ; so switch
lda <clpx1
sta x0
lda <clpy0
sta y1
lda <clpx0
sta x1
bra copy_done
in_order anop
; lda <clpy1
sta y1
lda <clpx1
sta x1
lda <clpy0
sta y0
lda <clpx0
sta x0
; 39/41 cycles to here
; setup offset and deltas
copy_done anop
lda y1
asl A
asl A
adc y1
asl A
asl A
asl A
asl A
asl A
asl A
adc x1
sta offset ; 16+16=32
; penColor must be between 0 and 15
lda <penColor ; setup pixel images
sta even_c ; 0x000f
xba
asl A
asl A
asl A
asl A
and #$f000
sta odd_c ; 0xf000
lda y0
sec
sbc y1
sta deltay ; we know y0 is larger...
beq Horizontal ; +2 do as special case
lda x1
cmp x0
beq Vertical ; +2 do as special case
; bcc Rev ; x1 is smaller; go other way
bcs Forw
brl Rev
Forw sbc x0
sta deltax
cmp deltay
bcc Forw_bigy_j
brl Forw_bigx
Forw_bigy_j anop
brl Forw_bigy
;
; Handle special cases (horizontal/vertical/point)
;
; handle vertical (deltax=0) lines
Vertical lda deltay
tay ; count down
lda offset
lsr A
tax
bcc vf_odd2
clc
; bra vf_even2
; loop below
vf_even2 lda $dead,x
__e0 equ *-2
and #$fff0
ora even_c
sta $dead,x
__e1 equ *-2
txa
adc #160
tax
dey
bpl vf_even2
bra vf_done
vf_odd2 lda $beef,x
__o0 equ *-2
and #$0fff
ora odd_c
sta $beef,x
__o1 equ *-2
txa
adc #160
tax
dey
bpl vf_odd2
; bra vf_done
vf_done brl Exit
; handle horizontal (deltay=0) lines
Horizontal anop
lda x1
cmp x0
bcc h_rev ; x1 is smaller; go other way
sbc x0
sta deltax
; horizontal, moving forward
h_forw lda deltax
tay ; count down
lda offset
lsr A
tax
bcc hf_odd2
clc
; bra hf_even2
; loop below
hf_even2 lda $dead,x
__e2 equ *-2
and #$fff0
ora even_c
sta $dead,x
__e3 equ *-2
dey
bmi hf_done
hf_odd2 lda $beef,x
__o2 equ *-2
and #$0fff
ora odd_c
sta $beef,x
__o3 equ *-2
dex
dey
bpl hf_even2
hf_done brl Exit
; horizontal, reverse direction
h_rev sec
lda x0
sbc x1
sta deltax
lda deltax
tay ; count down
lda offset
lsr A
tax
bcc hr_odd2
clc
; bra hr_even2
; loop below
hr_even2 lda $dead,x
__e4 equ *-2
and #$fff0
ora even_c
sta $dead,x
__e5 equ *-2
dey
bmi hr_done
inx
hr_odd2 lda $beef,x
__o4 equ *-2
and #$0fff
ora odd_c
sta $beef,x
__o5 equ *-2
dey
bpl hr_even2
; bra hr_done
hr_done brl Exit
;
; Standard cases
;
; forward direction, deltay is bigger than deltax
Forw_bigy anop
lda deltay
tay ; count down
lsr A
eor #$ffff
inc A
sta diff
lda offset
lsr A
tax
bcc fy_odd2
clc
bra fy_even2
; loop below
fy_even1 sta diff
fy_even2 lda $dead,x
__e6 equ *-2
and #$fff0
ora even_c
sta $dead,x
__e7 equ *-2
dey
bmi fy_done
txa
adc #160
tax
lda deltax
adc diff
bmi fy_even1
sbc deltay
fy_odd1 sta diff
fy_odd2 lda $beef,x
__o6 equ *-2
and #$0fff
ora odd_c
sta $beef,x
__o7 equ *-2
dey
bmi fy_done
txa
adc #160
tax
lda deltax
adc diff
bmi fy_odd1
sbc deltay
dex
bra fy_even1
fy_done brl Exit
; reverse direction
Rev sec
lda x0
sbc x1
sta deltax
cmp deltay
bcs Rev_bigx
; reverse direction, deltay is bigger than deltax
Rev_bigy lda deltay
tay ; count down
inc A
lsr A
eor #$ffff
inc A
sta diff
lda offset
lsr A
tax
bcc ry_odd2
clc
bra ry_even2
; loop below
ry_even1 sta diff
ry_even2 lda $dead,x
__e8 equ *-2
and #$fff0
ora even_c
sta $dead,x
__e9 equ *-2
dey
bmi ry_done
txa
adc #160
tax
lda deltax
adc diff
bmi ry_even1
sbc deltay
inx
ry_odd1 sta diff
ry_odd2 lda $beef,x
__o8 equ *-2
and #$0fff
ora odd_c
sta $beef,x
__o9 equ *-2
dey
bmi ry_done
txa
adc #160
tax
lda deltax
adc diff
bmi ry_odd1
sbc deltay
bra ry_even1
ry_done brl Exit
; reverse direction, deltax is bigger than deltay
Rev_bigx lda deltax
tay ; count down
lsr A
eor #$ffff
inc A
sta diff
lda offset
lsr A
tax
bcc rx_odd2
clc
bra rx_even2
; loop below
rx_even1 sta diff
rx_even2 lda $dead,x
__e10 equ *-2
and #$fff0
ora even_c
sta $dead,x
__e11 equ *-2
dey
bmi rx_done
inx
lda deltay
adc diff
bmi rx_odd1
sbc deltax
sta diff
txa
adc #160
tax
bra rx_odd2
rx_odd1 sta diff
rx_odd2 lda $beef,x
__o10 equ *-2
and #$0fff
ora odd_c
; sta $beef,x
__o11 equ *-2
dey
bmi rx_done
lda deltay
adc diff
bmi rx_even1
sbc deltax
sta diff
txa
adc #160
tax
bra rx_even2
rx_done brl Exit
; forward direction, deltax is bigger than deltay
Forw_bigx anop
lda deltax
tay ; count down
lsr A
eor #$ffff
inc A
sta diff
lda offset
lsr A
tax
bcc fx_odd2
clc
bra fx_even2
; loop below
fx_even1 sta diff
fx_even2 lda $dead,x
__e12 equ *-2
and #$fff0
ora even_c
sta $dead,x
__e13 equ *-2
dey
bmi fx_done
lda deltay
adc diff
bmi fx_odd1
sbc deltax
sta diff
txa
adc #160
tax
bra fx_odd2
fx_odd1 sta diff
fx_odd2 lda $beef,x
__o12 equ *-2
and #$0fff
ora odd_c
sta $beef,x
__o13 equ *-2
dey
bmi fx_done
dex
lda deltay
adc diff
bmi fx_even1
sbc deltax
sta diff
txa
adc #160
tax
bra fx_even2
fx_done brl Exit
;
; common exit point
;
Exit plb ; return to original bank
jreturn
end
;---------------------------------------- ;----------------------------------------
; Returns the color of a given point ; Returns the color of a given point
; ;
@ -955,4 +1477,3 @@ VblCount dc i2'1' ; How many VBLs between calls (1 only on initial call)
short m,i short m,i
rtl rtl
end end

View file

@ -249,9 +249,7 @@ void jlDrawCircle(jint16 x0, jint16 y0, jint16 radius) {
y++; y++;
err += dy; err += dy;
dy += 2; dy += 2;
} } else {
if (err > 0) {
x--; x--;
dx += 2; dx += 2;
err += dx - (radius << 1); err += dx - (radius << 1);

View file

@ -284,6 +284,7 @@ bool _jlVecLoad(jlVecT **vec, char *filename);
extern void asmB88(byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2); extern void asmB88(byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2);
extern void asmB88a(byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte alpha); extern void asmB88a(byte *p, jint16 cx1, jint16 cy1, jint16 cx2, jint16 cy2, byte alpha);
extern void asmDrawBM(jint16 startX, jint16 startY, jint16 width, jint16 height, byte *mapData, juint16 stride, byte *sta); extern void asmDrawBM(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 jint16 asmGetPoint(jint16 x, jint16 y); extern jint16 asmGetPoint(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);
@ -295,6 +296,7 @@ extern void asmPoint(jint16 color, jint16 x, jint16 y);
#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(startX, startY, width, height, (byte *)mapData, stride, (byte *)sta->pixels)
#define jlDrawGetPixel(x, y) asmGetPoint(x, y) #define jlDrawGetPixel(x, y) asmGetPoint(x, y)
#define jlDrawPoint(x, y) asmPoint(_jlDrawColorNibbles, x, y) #define jlDrawPoint(x, y) asmPoint(_jlDrawColorNibbles, x, y)
//#define jlDrawLine(x1, y1, x2, y2) asmDrawLine((byte *)0x012000L, _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

View file

@ -60,6 +60,8 @@ int main(void) {
jlStaT *kanga = NULL; jlStaT *kanga = NULL;
jlStaT *font = NULL; jlStaT *font = NULL;
jint16 y; jint16 y;
jint16 y2 = 0;
jint16 dy = 1;
jint16 color = 15; jint16 color = 15;
jint16 nextColor = 1; jint16 nextColor = 1;
@ -70,9 +72,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");
@ -81,8 +83,14 @@ int main(void) {
printAt(font, 1, y++, "X = %d ", jlGameGetAxis(0)); printAt(font, 1, y++, "X = %d ", jlGameGetAxis(0));
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);
_jlDebugBorder(BORDER_GREEN);
jlDrawLine(0, y2, 319, 199-y2);
_jlDebugBorder(BORDER_BROWN);
y2 += 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;

View file

@ -3,7 +3,7 @@
function buildIIgs() { function buildIIgs() {
TARGET=${JOEY}/sdks/IIgs/ORCA/out/${PROJECT} TARGET=${JOEY}/sdks/IIgs/ORCA/out/${PROJECT}
GSTARGET=31:/out/${PROJECT} GSTARGET=31:/out/${PROJECT}
CADIUS=${JOEY}/sdks/IIgs/cadius-git/bin/release/cadius CADIUS=${JOEY}/sdks/IIgs/cadius/cadius
VOL=Import VOL=Import
WORK=/tmp/IIgs WORK=/tmp/IIgs
IMPORT=${WORK}/import.po IMPORT=${WORK}/import.po
@ -58,6 +58,7 @@ function buildIIgs() {
${CADIUS} createvolume ${IMPORT} ${VOL} 32MB > /dev/null ${CADIUS} createvolume ${IMPORT} ${VOL} 32MB > /dev/null
${CADIUS} createfolder ${IMPORT} ${VOL}/data > /dev/null ${CADIUS} createfolder ${IMPORT} ${VOL}/data > /dev/null
${CADIUS} addfile ${IMPORT} ${VOL} ${TARGET}/${PROJECT}#b30000 > /dev/null ${CADIUS} addfile ${IMPORT} ${VOL} ${TARGET}/${PROJECT}#b30000 > /dev/null
${CADIUS} addfile ${IMPORT} ${VOL} ${JOEY}/dist/IIgs/Tool221#ba0000 > /dev/null
for F in "${DATA[@]}"; do for F in "${DATA[@]}"; do
N=${WORK}/data/`basename ${F}`#060000 N=${WORK}/data/`basename ${F}`#060000
cp -f ${F} ${N} cp -f ${F} ${N}
@ -81,7 +82,7 @@ function buildIIgs() {
if [ ! -z $1 ]; then if [ ! -z $1 ]; then
# Launch GSPlus # Launch GSPlus
pushd ${JOEY}/sdks/IIgs/gsplus pushd ${JOEY}/sdks/IIgs/gsplus
./gsplus -resizeable -config IIgsTest.cfg || true ./GSplus -resizeable -config IIgsTest.cfg || true
popd popd
# Extract and display the results of the run # Extract and display the results of the run

View file

@ -52,7 +52,7 @@ function buildLinux32() {
CC="gcc" CC="gcc"
CFLAGS="-m32" CFLAGS="-m32"
LDFLAGS="-m32 -lstdc++ -lm -ldl -lpthread" LDFLAGS="-m32 -lstdc++ -lm -ldl -lpthread"
doPCBuild linux x86 '' doPCBuild linux i386 ''
} }
@ -68,7 +68,7 @@ function buildWindows32() {
CC="i686-w64-mingw32-gcc" CC="i686-w64-mingw32-gcc"
CFLAGS="" CFLAGS=""
LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi -static -lstdc++" LDFLAGS="-lgdi32 -lwinmm -limm32 -lversion -lole32 -loleaut32 -lsetupapi -static -lstdc++"
doPCBuild windows x86 '.exe' doPCBuild windows i386 '.exe'
} }
@ -84,7 +84,7 @@ function buildmacOS32() {
CC="o32-clang" CC="o32-clang"
CFLAGS="" CFLAGS=""
LDFLAGS="" LDFLAGS=""
doPCBuild macos x86 '' doPCBuild macos i386 ''
} }

View file

@ -1,184 +0,0 @@
#!/bin/bash -e
function clearBuild() {
if [ -d ${JOEY}/SDL2/build ]; then
rm -rf ${JOEY}/SDL2/build
fi
mkdir -p ${JOEY}/SDL2/build
}
function clearInstalled() {
if [ -d ${JOEY}/SDL2/installed ]; then
rm -rf ${JOEY}/SDL2/installed
fi
mkdir -p ${JOEY}/SDL2/installed
}
function checkFiles() {
if [ ! -d SDL ]; then
hg clone http://hg.libsdl.org/SDL
cd SDL
#hg up release-2.0.9
cd ..
fi
if [ ! -d libmodplug ]; then
git clone https://github.com/Konstanty/libmodplug.git
cd libmodplug
libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
cd ..
fi
if [ ! -d SDL_mixer ]; then
hg clone http://hg.libsdl.org/SDL_mixer
cd SDL_mixer
#hg up release-2.0.4
cd ..
fi
}
function doBuild() {
clearBuild
cd build
../SDL/configure \
--target="${CROSS}" \
--host="${CROSS}" \
--build=x86_64-linux \
--enable-static \
--disable-shared \
--prefix=${PREFIX}
make
make install
cd ..
clearBuild
cd build
../libmodplug/configure \
--target="${CROSS}" \
--host="${CROSS}" \
--build=x86_64-linux \
--enable-static \
--disable-shared \
--prefix=${PREFIX}
make
make install
cd ..
clearBuild
cd build
MODPLUG_CFLAGS="-I${PREFIX}/include -DMODPLUG_STATIC" \
MODPLUG_LIBS="-L${PREFIX}/lib -lmodplug -lstdc++ -lm" \
../SDL_mixer/configure \
--target="${CROSS}" \
--host="${CROSS}" \
--build=x86_64-linux \
--enable-static \
--disable-shared \
--prefix=${PREFIX} \
--with-sdl-prefix=${PREFIX} \
--disable-music-cmd \
--disable-music-wave \
--enable-music-mod-modplug \
--disable-music-mod-modplug-shared \
--disable-music-mod-mikmod \
--disable-music-midi \
--disable-music-ogg \
--disable-music-flac \
--disable-music-opus \
--disable-music-mp3 \
--disable-music-mp3-mpg123
make
make install
cd ..
}
ARCH=$1
if [ "${ARCH}x" == "x" ]; then
echo "$0 [arch | \"all\"] | [reset]"
echo '(Where "arch" is linux32, linux64, windows32, windows64, macos32, or macos64.)'
exit 0
fi
set -x
mkdir -p ${JOEY}/SDL2
pushd ${JOEY}/SDL2
checkFiles
if [ "${ARCH}x" == "resetx" ]; then
clearInstalled
fi
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux64x" ]; then
TARGET=${JOEY}/joeylib/joeylib/lib/linux/x64
PREFIX=${JOEY}/SDL2/installed/linux/x64
CROSS=x86_64-linux-gnu
export CC="${CROSS}-gcc"
export CXX="${CROSS}-g++"
doBuild
fi
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "linux32x" ]; then
TARGET=${JOEY}/joeylib/joeylib/lib/linux/x86
PREFIX=${JOEY}/SDL2/installed/linux/x86
CROSS=x86_64-linux-gnu
export CC="${CROSS}-gcc -m32"
export CXX="${CROSS}-g++ -m32"
doBuild
fi
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows64x" ]; then
TARGET=${JOEY}/joeylib/joeylib/lib/windows/x64
PREFIX=${JOEY}/SDL2/installed/windows/x64
CROSS=x86_64-w64-mingw32
export CC="${CROSS}-gcc -static-libgcc"
export CXX="${CROSS}-g++ -static-libstdc++"
doBuild
fi
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "windows32x" ]; then
TARGET=${JOEY}/joeylib/joeylib/lib/windows/x86
PREFIX=${JOEY}/SDL2/installed/windows/x86
CROSS=i686-w64-mingw32
export CC="${CROSS}-gcc -static-libgcc"
doBuild
fi
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos64x" ]; then
TARGET=${JOEY}/joeylib/joeylib/lib/macos/x64
PREFIX=${JOEY}/SDL2/installed/macos/x64
CROSS=x86_64-apple-darwin15
export CC="o64-clang"
doBuild
fi
if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "macos32x" ]; then
TARGET=${JOEY}/joeylib/joeylib/lib/macos/x86
PREFIX=${JOEY}/SDL2/installed/macos/x86
CROSS=i386-apple-darwin15
export CC="o32-clang"
doBuild
fi
#if [ "${ARCH}x" == "allx" ] || [ "${ARCH}x" == "raspbian" ]; then
#***FIX***
#TARGET=${JOEY}/joeylib/joeylib/pi/raspbian
#PREFIX=${JOEY}/SDL2/installed/pi/raspbian
#CROSS=arm-linux-gnueabihf
#export CC="${CROSS}-gcc -static-libgcc --sysroot=${JOEY}/sdks/pi/raspbian -I${PREFIX}/include -L${PREFIX}/lib"
#doBuild
#fi
export CXX=""
export CC=""
rm -rf build
popd
set +x

View file

@ -1,31 +0,0 @@
#!/bin/bash -e
pushd ${GOLDEN_GATE}
#find . -type d -exec chmod 755 {} \;
#find . -type f -exec chmod 644 {} \;
for x in etc/* ; do iix chtyp -t txt "$x" ; done
for x in lib/* ; do if [ -f "$x" ] ; then iix chtyp -t lib "$x" ; fi ; done
for x in usr/lib/lib* ; do iix chtyp -t lib "$x" ; done
for x in usr/lib/tmac/* ; do iix chtyp -t txt "$x" ; done
for x in bin/* ; do iix chtyp -t exe "$x" ; done
for x in usr/bin/* ; do iix chtyp -t exe "$x" ; done
for x in usr/local/bin/* ; do iix chtyp -t exe "$x" ; done
for f in Languages/* ; do if [ -f "$f" ] ; then iix chtyp -t exe "$f" ; fi ; done ;
for f in Utilities/Help/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ;
for f in Utilities/* ; do if [ -f "$f" ] ; then iix chtyp -t exe "$f" ; fi ; done ;
for f in Libraries/* ; do if [ -f "$f" ] ; then iix chtyp -t lib "$f" ; fi ; done ;
for f in Libraries/AInclude/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ;
for f in Libraries/APWCInclude/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ;
for f in Libraries/AppleUtil/* ; do if [ -f "$f" ] ; then iix chtyp -t txt "$f" ; fi ; done ;
for f in Libraries/ORCACDefs/* ; do if [ -f "$f" ] ; then iix chtyp -l cc "$f" ; fi ; done ;
for f in Libraries/ORCAInclude/* ; do if [ -f "$f" ] ; then iix chtyp -l asm "$f" ; fi ; done ;
for f in Libraries/RInclude/* ; do if [ -f "$f" ] ; then iix chtyp -l rez "$f" ; fi ; done ;
for f in Libraries/Tool.Interface/* ; do if [ -f "$f" ] ; then iix chtyp -l pascal "$f" ; fi ; done ;
for f in Libraries/GSoftDefs/* ; do if [ -f "$f" ] ; then iix chtyp -t 0x5e -a 0x8007 "$f" ; fi ; done ;
for f in Libraries/ORCAPascalDefs/* ; do if [ -f "$f" ] ; then iix chtyp -t 0x5e -a 0x8009 "$f" ; fi ; done ;
for f in Libraries/m2defs/* ; do if [ -f "$f" ] ; then iix chtyp -t 0x5e -a 0x8006 "$f" ; fi ; done ;
popd

View file

@ -29,6 +29,19 @@ G_TITLE="JoeyLib Installer"
G_PARENT= G_PARENT=
G_UID=$(id -ru) G_UID=$(id -ru)
G_GID=$(id -rg) G_GID=$(id -rg)
G_IS_INSTALLED=()
G_IIGS=0
#G_AMIGA=1
#G_ATARIST=2
G_LINUX32=1
G_LINUX64=2
G_WIN32=3
G_WIN64=4
#G_MAC32=7
#G_MAC64=8
#G_ANDROID=9
#G_IOS=10
G_HAS_IIGS=0 G_HAS_IIGS=0
@ -41,15 +54,11 @@ function buildPCDeps() {
local CC_OLD=$CC local CC_OLD=$CC
local CXX_OLD=$CXX local CXX_OLD=$CXX
local SRC="${G_PARENT}/joeylib/joeylib/src" local SRC="${G_PARENT}/joeylib/joeylib/src"
local G_CFLAGS="-Wall -D_REENTRANT_ -I${SRC} -c" local G_CFLAGS="-Wall -D_REENTRANT_ -I${SRC} -I${PREFIX}/include -c"
echo "" echo ""
tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!" tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!"
# Clear any existing built libraries
if [[ -d ${PREFIX} ]]; then
rm -rf ${PREFIX}
fi
mkdir -p ${PREFIX} mkdir -p ${PREFIX}
pushd deps &> /dev/null pushd deps &> /dev/null
@ -195,7 +204,7 @@ function configWrite() {
echo "fi" >> "${O}" echo "fi" >> "${O}"
echo "export PATH=\"\${JOEYPATH}\"" >> "${O}" echo "export PATH=\"\${JOEYPATH}\"" >> "${O}"
echo "export JOEY=\"${G_PARENT}\"" >> "${O}" echo "export JOEY=\"${G_PARENT}\"" >> "${O}"
if [[ ${G_HAS_IIGS} == 1 ]]; then if [[ ${G_IS_INSTALLED[$G_IIGS]} == 1 ]]; then
# IIgs Runtime & ORCA Compilers # IIgs Runtime & ORCA Compilers
echo "export GOLDEN_GATE=\"\${JOEY}/sdks/IIgs/ORCA\"" >> "${O}" echo "export GOLDEN_GATE=\"\${JOEY}/sdks/IIgs/ORCA\"" >> "${O}"
echo "export PATH=\"\${JOEY}/sdks/IIgs:\${PATH}\"" >> "${O}" echo "export PATH=\"\${JOEY}/sdks/IIgs:\${PATH}\"" >> "${O}"
@ -231,7 +240,7 @@ function installIIgs() {
local GGATE= local GGATE=
local IIGS="${G_PARENT}/sdks/IIgs" local IIGS="${G_PARENT}/sdks/IIgs"
G_HAS_IIGS=1 G_IS_INSTALLED[$G_IIGS] = 1
configWrite configWrite
configRead configRead
@ -518,30 +527,75 @@ function installWin64() {
function mainMenu() { function mainMenu() {
local ITEMS=( local ITEMS=(
"IIgs" "IIgs"
# "Amiga" "ST" # "Amiga"
"Linux32" "Linux64" # "ST"
"Win32" "Win64" "Linux32"
# "macOS32" "macOS64" "Linux64"
# "Android" "iOS" "Win32"
"Win64"
# "macOS32"
# "macOS64"
# "Android"
# "iOS"
) )
local DESC=( local DESC=(
"Apple IIgs 16" "Apple IIgs 16"
# "Commodore Amiga 16" "Atari ST 16" # "Commodore Amiga 16"
"Linux 32" "Linux 64" # "Atari ST 16"
"Windows 32" "Windows 64" "Linux 32"
# "macOS 32" "macOS 64" "Linux 64"
# "Android 32" "iOS 64" "Windows 32"
"Windows 64"
# "macOS 32"
# "macOS 64"
# "Android 32"
# "iOS 64"
)
local CHECK=(
"IIgs/joeylib#b20000"
# "Amiga"
# "ST"
"linux/i386/libjoeylib.a"
"linux/x64/libjoeylib.a"
"windows/i386/libjoeylib.a"
"windows/x64/libjoeylib.a"
# "macOS32"
# "macOS64"
# "Android"
# "iOS"
) )
local TOTAL=${#ITEMS[*]} local TOTAL=${#ITEMS[*]}
local MENU=() local MENU=()
local X= local X=
local WHAT=
local CHOICE="x" local CHOICE="x"
G_IS_INSTALLED=(
0
# 0
# 0
0
0
0
0
# 0
# 0
# 0
# 0
)
while [[ "${CHOICE}" != "" ]]; do while [[ "${CHOICE}" != "" ]]; do
MENU=() MENU=()
for (( X=0; X<=$(( ${TOTAL}-1 )); X++ )); do for (( X=0; X<=$(( ${TOTAL}-1 )); X++ )); do
MENU+=( "${ITEMS[$X]}" ) MENU+=( "${ITEMS[$X]}" )
MENU+=( "Install ${DESC[$X]} Bit JoeyLib Library" ) if [[ -e "${G_PARENT}/dist/${CHECK[$X]}" ]]; then
WHAT="Rebuild"
G_IS_INSTALLED[$X]=1
else
WHAT="Install"
G_IS_INSTALLED[$X]=0
fi
MENU+=( "${WHAT} ${DESC[$X]} Bit JoeyLib Library" )
done done
CHOICE=$( CHOICE=$(
set e+ set e+
@ -558,6 +612,8 @@ function mainMenu() {
# --- START # --- START
function start() {
sudo -v
mkdir -p installerWork mkdir -p installerWork
@ -581,7 +637,6 @@ G_PARENT=$(pwd)
# Don't change directories until Towel is loaded. # Don't change directories until Towel is loaded.
pushd installerWork &> /dev/null pushd installerWork &> /dev/null
:<<'SKIP'
# See if all the packages we need are installed # See if all the packages we need are installed
echo "" echo ""
tBoldBox tBLUE "Examining system..." tBoldBox tBLUE "Examining system..."
@ -589,12 +644,11 @@ tCheckPackages MISSING cmake ragel hfsplus hfsutils hfsprogs libreadline-dev lib
build-essential git mercurial texinfo libtool autoconf automake re2c \ build-essential git mercurial texinfo libtool autoconf automake re2c \
gcc-multilib g++-multilib mingw-w64 gdb-mingw-w64 clang llvm-dev libxml2-dev \ gcc-multilib g++-multilib mingw-w64 gdb-mingw-w64 clang llvm-dev libxml2-dev \
uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio \ uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio \
libpulse-dev{,:i386} libasound-dev{,:i386} \ libpulse-dev{,:i386} libasound2-dev{,:i386} \
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev \ libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev \
php-cli msitools php-cli msitools
if [[ "${MISSING}" != "" ]]; then if [[ "${MISSING}" != "" ]]; then
sudo -v
if (whiptail --title "${G_TITLE}" --yesno "Some required packages are missing.\n\nInstall them now?" 9 40); then if (whiptail --title "${G_TITLE}" --yesno "Some required packages are missing.\n\nInstall them now?" 9 40); then
TEMP=" ${MISSING//[^ ]}" TEMP=" ${MISSING//[^ ]}"
TOTAL=${#TEMP} TOTAL=${#TEMP}
@ -616,7 +670,6 @@ if [[ "${MISSING}" != "" ]]; then
exit 1 exit 1
fi fi
fi fi
SKIP
# Do we have JoeyLib yet? # Do we have JoeyLib yet?
if [[ ! -f ${G_PARENT}/joeylib/LICENSE ]]; then if [[ ! -f ${G_PARENT}/joeylib/LICENSE ]]; then
@ -634,3 +687,7 @@ echo ""
# --- EXIT # --- EXIT
popd &> /dev/null popd &> /dev/null
}
# At the very end so we can stream this script from a web server.
start