Starting palette enhancements. Beginning of BeOS support.
This commit is contained in:
parent
fe87646e62
commit
db2b3ed749
3 changed files with 193 additions and 12 deletions
|
@ -262,6 +262,8 @@ static void _jlAudioCallback(void *userdata, Uint8 *buffer, int bytes) {
|
||||||
void jlDisplayPresent(void) {
|
void jlDisplayPresent(void) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
int pitch = 0;
|
int pitch = 0;
|
||||||
void *pixelData = NULL;
|
void *pixelData = NULL;
|
||||||
Uint32 *pixels = NULL;
|
Uint32 *pixels = NULL;
|
||||||
|
@ -273,8 +275,8 @@ void jlDisplayPresent(void) {
|
||||||
// This extra step preserves palette effects.
|
// This extra step preserves palette effects.
|
||||||
SDL_LockTexture(_jlTexture, NULL, &pixelData, &pitch);
|
SDL_LockTexture(_jlTexture, NULL, &pixelData, &pitch);
|
||||||
pixels = (Uint32 *)pixelData;
|
pixels = (Uint32 *)pixelData;
|
||||||
for (int y=0; y<200; y++) {
|
for (y=0; y<200; y++) {
|
||||||
for (int x=0; x<160; x++) {
|
for (x=0; x<160; x++) {
|
||||||
// We decode this R/L instead of L/R for some reason. NO idea why yet. Endians?
|
// We decode this R/L instead of L/R for some reason. NO idea why yet. Endians?
|
||||||
pixels[i++] = SDL_MapRGBA(_jlPixelFormat,
|
pixels[i++] = SDL_MapRGBA(_jlPixelFormat,
|
||||||
_jlBackingStore->palette[_jlBackingStore->pixels[j].r].r * 16,
|
_jlBackingStore->palette[_jlBackingStore->pixels[j].r].r * 16,
|
||||||
|
|
|
@ -451,9 +451,20 @@ void jlModPlay(jlModT *mod);
|
||||||
void jlModStop(void);
|
void jlModStop(void);
|
||||||
void jlModVolume(jbyte volume);
|
void jlModVolume(jbyte volume);
|
||||||
|
|
||||||
void jlPaletteDefault(void); //***TODO*** Treat palettes like we do "surfaces" - allow changing STAs or display
|
void jlPaletteDefault(void); // ***TODO*** Treat palettes like we do "surfaces" - allow changing STAs or display
|
||||||
void jlPaletteSet(jbyte index, jbyte r, jbyte g, jbyte b); //***TODO*** Really need a matching "get"
|
void jlPaletteSet(jbyte index, jbyte r, jbyte g, jbyte b); // ***TODO*** Really need a matching "get"
|
||||||
void jlPaletteSetFromImg(jlImgT *img);
|
void jlPaletteSetFromImg(jlImgT *img);
|
||||||
|
/*
|
||||||
|
void jlPaletteAssign(jbyte rowStart, jbyte rowEnd, jbyte palette);
|
||||||
|
void jlPaletteCopy(jbyte paletteTarget, jbyte paletteSource);
|
||||||
|
void jlPaletteDefault(jbyte palette);
|
||||||
|
void jlPaletteGet(jbyte palette, jbyte index, jbyte *r, jbyte *g, jbyte *b);
|
||||||
|
void jlPaletteLoad(char *file, juint16 mask);
|
||||||
|
void jlPaletteSave(char *file, juint16 mask);
|
||||||
|
void jlPaletteSet(jbyte palette, jbyte index, jbyte r, jbyte g, jbyte b);
|
||||||
|
void jlPaletteSetFromImg(jbyte palette, jlImgT *img);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
void jlSoundFree(jlSoundT *sound);
|
void jlSoundFree(jlSoundT *sound);
|
||||||
jbool jlSoundIsPlaying(jlSoundT *sound);
|
jbool jlSoundIsPlaying(jlSoundT *sound);
|
||||||
|
|
|
@ -48,6 +48,9 @@ OLD_PATH=${PATH}
|
||||||
#export CFLAGS=
|
#export CFLAGS=
|
||||||
#export LD_LIBRARY_PATH=
|
#export LD_LIBRARY_PATH=
|
||||||
#export LDFLAGS=
|
#export LDFLAGS=
|
||||||
|
#export WATCOM=
|
||||||
|
#export EDPATH=
|
||||||
|
#export INCLUDE=
|
||||||
|
|
||||||
export GOLDEN_GATE=${IIGS}/ORCA
|
export GOLDEN_GATE=${IIGS}/ORCA
|
||||||
|
|
||||||
|
@ -68,7 +71,48 @@ function addBuildUser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function buildIIgsSDK() {
|
function buildBeOSToolchain() {
|
||||||
|
|
||||||
|
[[ ! -d cross-compiler ]] && git clone --depth 1 https://github.com/jessicah/cross-compiler.git
|
||||||
|
|
||||||
|
# Build BeOS and Haiku cross-compilers.
|
||||||
|
pushd cross-compiler
|
||||||
|
./build-rootfs.sh x86_gcc2h --rootfsdir ${EHOME}/cross/beos
|
||||||
|
./build-rootfs.sh x86_gcc2h --rootfsdir ${EHOME}/cross/haiku32
|
||||||
|
./build-rootfs.sh x86_64 --rootfsdir ${EHOME}/cross/haiku64
|
||||||
|
popd
|
||||||
|
|
||||||
|
# ***TODO*** Need to download beos.tgz
|
||||||
|
|
||||||
|
# Add BeOS headers and libraries to BeOS toolchain folders.
|
||||||
|
pushd ${EHOME}/cross/beos
|
||||||
|
pushd generated/cross-tools-x86_gcc2/i586-pc-haiku
|
||||||
|
tar xzf ${EHOME}/beos.tgz
|
||||||
|
mv beos/headers/* include/.
|
||||||
|
mv beos/lib/x86/* lib/.
|
||||||
|
rm -rf beos
|
||||||
|
popd
|
||||||
|
rm -rf boot
|
||||||
|
rm -f fetch_packages.sh
|
||||||
|
rm -f package_extract.sh
|
||||||
|
popd
|
||||||
|
|
||||||
|
# Add Haiku 32 bit headers and libraries to Haiku toolchain folders.
|
||||||
|
pushd ${EHOME}/cross/haiku32
|
||||||
|
pushd generated/cross-tools-x86_gcc2/i586-pc-haiku
|
||||||
|
#mv ../../../boot/system/develop/headers/* include/.
|
||||||
|
#mv ../../../boot/system/develop/lib/x86/* lib/.
|
||||||
|
popd
|
||||||
|
rm -rf boot
|
||||||
|
rm -f fetch_packages.sh
|
||||||
|
rm -f package_extract.sh
|
||||||
|
popd
|
||||||
|
|
||||||
|
# ***TODO*** Haiku headers and libraries.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function buildIIgsToolchain() {
|
||||||
local GGATE=$1
|
local GGATE=$1
|
||||||
local ORCA=$2
|
local ORCA=$2
|
||||||
local PUBLIC=$3
|
local PUBLIC=$3
|
||||||
|
@ -250,6 +294,21 @@ function buildJoeyLib() {
|
||||||
cp -f "${IIGS}/Tool222#ba0000" .
|
cp -f "${IIGS}/Tool222#ba0000" .
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
SDL12)
|
||||||
|
export CFLAGS="${CFLAGS} -I${SRC} -I${INSTALLED}/include -c"
|
||||||
|
if [[ "${PASS}" == "debug" ]]; then
|
||||||
|
export CFLAGS="-DJOEY_DEBUG ${CFLAGS}"
|
||||||
|
fi
|
||||||
|
${CC} ${CFLAGS} -o jPixBuf.o ${SRC}/jPixBuf.c
|
||||||
|
${CC} ${CFLAGS} -o jSDL12.o ${SRC}/jSDL12.c
|
||||||
|
${CC} ${CFLAGS} -o joey.o ${SRC}/joey.c
|
||||||
|
${AR} x ${INSTALLED}/lib/libSDL.a
|
||||||
|
${AR} x ${INSTALLED}/lib/libSDLmain.a
|
||||||
|
${AR} rcs libjoeylib.a *.o
|
||||||
|
rm *.o
|
||||||
|
rm __.SYMDEF* || true
|
||||||
|
;;
|
||||||
|
|
||||||
SDL2)
|
SDL2)
|
||||||
export CFLAGS="${CFLAGS} -I${SRC} -I${INSTALLED}/include -c"
|
export CFLAGS="${CFLAGS} -I${SRC} -I${INSTALLED}/include -c"
|
||||||
if [[ "${PASS}" == "debug" ]]; then
|
if [[ "${PASS}" == "debug" ]]; then
|
||||||
|
@ -278,7 +337,7 @@ function buildJoeyLib() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function buildMacOSSDK() {
|
function buildMacOSXToolchain() {
|
||||||
local SDK=$1
|
local SDK=$1
|
||||||
local XCODE=$2
|
local XCODE=$2
|
||||||
local PLATFORM=$3
|
local PLATFORM=$3
|
||||||
|
@ -305,6 +364,43 @@ function buildMacOSSDK() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function buildSDL12() {
|
||||||
|
if [[ ! -d SDL-1.2 ]]; then
|
||||||
|
git clone https://skunkworks.kangaroopunch.com/mirrors/SDL-1.2.git
|
||||||
|
pushd SDL-1.2/include
|
||||||
|
cp SDL_config.h.default SDL_config.h
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "watcom" == *"${NAME}"* ]]; then
|
||||||
|
# ***TODO*** This does not work.
|
||||||
|
pushd SDL-1.2/watcom
|
||||||
|
wmake sdl tgt=static
|
||||||
|
mkdir -p ${INSTALLED}/lib
|
||||||
|
mkdir -p ${INSTALLED}/include
|
||||||
|
cp -f Release/SDL.lib ${INSTALLED}/lib/.
|
||||||
|
cp -f Release/SDLmain.lib ${INSTALLED}/lib/.
|
||||||
|
cp -f ../include/* ${INSTALLED}/include/.
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
rm -rf build || true
|
||||||
|
mkdir -p build
|
||||||
|
pushd build
|
||||||
|
../SDL-1.2/configure \
|
||||||
|
--target=${TRIPLE} \
|
||||||
|
--host=${TRIPLE} \
|
||||||
|
--build=x86_64-linux \
|
||||||
|
--enable-static \
|
||||||
|
--disable-shared \
|
||||||
|
--disable-loadso \
|
||||||
|
--prefix=${INSTALLED}
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function buildSDL2() {
|
function buildSDL2() {
|
||||||
local TAG=$1
|
local TAG=$1
|
||||||
|
|
||||||
|
@ -336,6 +432,18 @@ function buildSDL2() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function buildWatcomToolchain() {
|
||||||
|
local RESULT=
|
||||||
|
|
||||||
|
fetchGitHubRelease RESULT open-watcom open-watcom-v2 tar.xz
|
||||||
|
mkdir -p cross/watcom
|
||||||
|
pushd cross/watcom
|
||||||
|
tar xf ../../${RESULT}
|
||||||
|
unzip Watcom-Win32.zip
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function configureSFTP() {
|
function configureSFTP() {
|
||||||
if [[ ! -f /etc/ssh/sftponly_ready ]]; then
|
if [[ ! -f /etc/ssh/sftponly_ready ]]; then
|
||||||
sudo addgroup sftponly || true
|
sudo addgroup sftponly || true
|
||||||
|
@ -410,6 +518,14 @@ function doBuild() {
|
||||||
CFILES=($(ls -1 *.c))
|
CFILES=($(ls -1 *.c))
|
||||||
else
|
else
|
||||||
case ${LINE,,} in
|
case ${LINE,,} in
|
||||||
|
beos)
|
||||||
|
setCompiler beos i386
|
||||||
|
TARGET="${SOURCE}/temp"
|
||||||
|
EXT=
|
||||||
|
export CFLAGS="${CFLAGS} -Wall"
|
||||||
|
export LDFLAGS="-lGL -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
|
||||||
|
;;
|
||||||
|
|
||||||
iigs)
|
iigs)
|
||||||
setCompiler gsos 816
|
setCompiler gsos 816
|
||||||
TARGET="${GOLDEN_GATE}/out/build"
|
TARGET="${GOLDEN_GATE}/out/build"
|
||||||
|
@ -546,7 +662,7 @@ function doBuild() {
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
SDL2)
|
SDL12 | SDL2)
|
||||||
export CFLAGS="${CFLAGS} -I${DIST}"
|
export CFLAGS="${CFLAGS} -I${DIST}"
|
||||||
# Compile C files and generate object list.
|
# Compile C files and generate object list.
|
||||||
OFILES=""
|
OFILES=""
|
||||||
|
@ -587,9 +703,11 @@ function doInstall() {
|
||||||
updateSystem
|
updateSystem
|
||||||
configureSFTP
|
configureSFTP
|
||||||
|
|
||||||
buildIIgsSDK "Golden Gate.msi" "Opus ][ The Software.iso" id_rsa id_rsa.pub "${GGUSER}" "${GGPASS}"
|
buildIIgsToolchain "Golden Gate.msi" "Opus ][ The Software.iso" id_rsa id_rsa.pub "${GGUSER}" "${GGPASS}"
|
||||||
buildMacOSSDK MacOSX10.13.sdk.tar.xz Xcode_9.4.1.xip macos-intel
|
buildMacOSXToolchain MacOSX10.13.sdk.tar.xz Xcode_9.4.1.xip macos-intel
|
||||||
buildMacOSSDK MacOSX11.3.sdk.tar.xz Xcode_12.5.1.xip macos-apple
|
buildMacOSXToolchain MacOSX11.3.sdk.tar.xz Xcode_12.5.1.xip macos-apple
|
||||||
|
buildWatcomToolchain
|
||||||
|
buildBeOSToolchain
|
||||||
|
|
||||||
setCompiler linux i386
|
setCompiler linux i386
|
||||||
buildSDL2 ${SDL2_NEW}
|
buildSDL2 ${SDL2_NEW}
|
||||||
|
@ -612,6 +730,9 @@ function doInstall() {
|
||||||
setCompiler windows x86_64
|
setCompiler windows x86_64
|
||||||
buildSDL2 ${SDL2_NEW}
|
buildSDL2 ${SDL2_NEW}
|
||||||
|
|
||||||
|
setCompiler beos i386
|
||||||
|
buildSDL12
|
||||||
|
|
||||||
rebuildJoeyLib
|
rebuildJoeyLib
|
||||||
|
|
||||||
if [[ ! -f /etc/rc.local ]]; then
|
if [[ ! -f /etc/rc.local ]]; then
|
||||||
|
@ -681,6 +802,9 @@ function rebuildJoeyLib() {
|
||||||
setCompiler windows x86_64
|
setCompiler windows x86_64
|
||||||
buildJoeyLib
|
buildJoeyLib
|
||||||
|
|
||||||
|
setCompiler beos i386
|
||||||
|
buildJoeyLib
|
||||||
|
|
||||||
rm -f dist.tar.bz2 || true
|
rm -f dist.tar.bz2 || true
|
||||||
tar cJf dist.tar.bz2 dist
|
tar cJf dist.tar.bz2 dist
|
||||||
}
|
}
|
||||||
|
@ -689,8 +813,28 @@ function rebuildJoeyLib() {
|
||||||
function setCompiler() {
|
function setCompiler() {
|
||||||
local OS=$1
|
local OS=$1
|
||||||
local CPU=$2
|
local CPU=$2
|
||||||
|
local DIR=
|
||||||
|
local HEADERS=
|
||||||
|
|
||||||
case ${OS} in
|
case ${OS} in
|
||||||
|
beos)
|
||||||
|
case ${CPU} in
|
||||||
|
i386)
|
||||||
|
NAME="beos-intel"
|
||||||
|
ARCH=i386
|
||||||
|
TRIPLE="i586-pc-haiku"
|
||||||
|
DIR=${EHOME}/cross/beos/generated/cross-tools-x86_gcc2/bin
|
||||||
|
HEADERS=${EHOME}/cross/beos/generated/cross-tools-x86_gcc2/i586-pc-haiku/include
|
||||||
|
esac
|
||||||
|
BACKEND=SDL12
|
||||||
|
export CFLAGS="-I${HEADERS} -I${HEADERS}/be -I${HEADERS}/be/app -I${HEADERS}/be/kernel -I${HEADERS}/be/interface -I${HEADERS}/be/support -I${HEADERS}/be/storage -I${HEADERS}/be/game -I${HEADERS}/be/media -I${HEADERS}/be/device -I${HEADERS}/be/drivers -I${HEADERS}/be/opengl -I${HEADERS}/be/add-ons/graphics -I${HEADERS}/posix" \
|
||||||
|
export LDFLAGS=
|
||||||
|
export PATH=${DIR}:${OLD_PATH}
|
||||||
|
export LD_LIBRARY_PATH=
|
||||||
|
export CC=${TRIPLE}-gcc
|
||||||
|
export AR=${TRIPLE}-ar
|
||||||
|
;;
|
||||||
|
|
||||||
gsos)
|
gsos)
|
||||||
case ${CPU} in
|
case ${CPU} in
|
||||||
816)
|
816)
|
||||||
|
@ -763,6 +907,21 @@ function setCompiler() {
|
||||||
sudo ln -s ${EHOME}/cross/${NAME}/darwin /usr/lib/llvm-10/lib/clang/10.0.0/lib/.
|
sudo ln -s ${EHOME}/cross/${NAME}/darwin /usr/lib/llvm-10/lib/clang/10.0.0/lib/.
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
win32)
|
||||||
|
case ${CPU} in
|
||||||
|
i386)
|
||||||
|
NAME="win32-watcom"
|
||||||
|
ARCH="i386"
|
||||||
|
TRIPLE="win32-watcom-i386"
|
||||||
|
BACKEND=SDL12
|
||||||
|
export WATCOM=${EHOME}/cross/watcom
|
||||||
|
export PATH=${WATCOM}/binl64:${WATCOM}/binl:${OLD_PATH}
|
||||||
|
export EDPATH=${WATCOM}/eddat
|
||||||
|
export INCLUDE=${WATCOM}/lh
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
windows)
|
windows)
|
||||||
case ${CPU} in
|
case ${CPU} in
|
||||||
i386)
|
i386)
|
||||||
|
@ -923,12 +1082,16 @@ function updateSystem() {
|
||||||
sudo apt -y dist-upgrade
|
sudo apt -y dist-upgrade
|
||||||
sudo dpkg --add-architecture i386
|
sudo dpkg --add-architecture i386
|
||||||
sudo apt -y install \
|
sudo apt -y install \
|
||||||
|
attr \
|
||||||
autoconf \
|
autoconf \
|
||||||
|
bison \
|
||||||
build-essential \
|
build-essential \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
clang \
|
clang \
|
||||||
cmake \
|
cmake \
|
||||||
cpio \
|
cpio \
|
||||||
|
flex \
|
||||||
|
gawk \
|
||||||
gcc-multilib \
|
gcc-multilib \
|
||||||
gzip \
|
gzip \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
|
@ -937,6 +1100,8 @@ function updateSystem() {
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
llvm \
|
llvm \
|
||||||
mingw-w64 \
|
mingw-w64 \
|
||||||
|
mtools \
|
||||||
|
nasm \
|
||||||
patch \
|
patch \
|
||||||
php-cli \
|
php-cli \
|
||||||
sed \
|
sed \
|
||||||
|
@ -953,4 +1118,7 @@ function updateSystem() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scriptIsDownloaded "$1" "$2" "$3"
|
#scriptIsDownloaded "$1" "$2" "$3"
|
||||||
|
|
||||||
|
setCompiler beos i386
|
||||||
|
buildJoeyLib
|
||||||
|
|
Loading…
Add table
Reference in a new issue