Still working on BeOS/Haiku support.

This commit is contained in:
Scott Duensing 2022-11-01 18:06:51 -05:00
parent 111b527f40
commit 35f437189e
4 changed files with 23 additions and 20 deletions

View file

@ -145,7 +145,7 @@ static int _pocketmod_clamp_volume(int x)
/* Zero out a block of memory */
static void _pocketmod_zero(void *data, int size)
{
char *byte = data, *end = byte + size;
char *byte = (char *)data, *end = byte + size;
while (byte != end) { *byte++ = 0; }
}
@ -584,12 +584,12 @@ static void _pocketmod_render_channel(pocketmod_context *c,
do {
/* Calculate how many samples we can write in one go */
num = (sample_end - chan->position) / chan->increment;
num = (int)((sample_end - chan->position) / chan->increment);
num = _pocketmod_min(num, samples_to_write);
/* Resample and write 'num' samples */
for (i = 0; i < num; i++) {
int x0 = chan->position;
int x0 = (int)chan->position;
#ifdef POCKETMOD_NO_INTERPOLATION
float s = sample->data[x0];
#else

View file

@ -202,8 +202,8 @@ static void _jlAudioCallback(void *userdata, Uint8 *buffer, int bytes) {
out = (int16_t *)buffer;
while (i < bytes) {
i += pocketmod_render(&_jlModContext, mod, sizeof(float[2]));
out[i] *= adjust;
out[i + 1] *= adjust;
out[i] = (int16_t)((float)out[i] * adjust);
out[i + 1] = (int16_t)((float)out[i + 1] * adjust);
}
}
@ -222,17 +222,17 @@ static void _jlAudioCallback(void *userdata, Uint8 *buffer, int bytes) {
out = (int16_t *)buffer;
for (i=0; i<(int)(length / sizeof(int16_t)); i+=2) {
// Combine channels into a mono sample.
work = (data[i] + data[i + 1]) * 0.5;
work = (int32_t)((data[i] + data[i + 1]) * 0.5);
// Determine channel.
// ***TODO*** These should be channel bits that can be ORed together!
isRight = (sound->channel & 0x01);
if (_jlSwapChannels) isRight = !isRight;
if (isRight) {
// Place sound in the right channel.
out[i + 1] += (work * adjust);
out[i + 1] += (int16_t)(work * adjust);
} else {
// Place sound in left channel.
out[i] += (work * adjust);
out[i] += (int16_t)(work * adjust);
}
}
sound->buffer += length;
@ -597,7 +597,7 @@ void jlSoundPlay(jlSoundT *sound, jlSoundChannelE channel, jbyte volume) {
sp = (jlSoundPlayingT *)jlMalloc(sizeof(jlSoundPlayingT));
if (sp) {
SDL_LockAudio();
sp->sound = sound;
sp->sound = (jlPlatformSoundT *)sound;
sp->channel = channel;
sp->volume = volume;
sp->buffer = sp->sound->data;
@ -638,8 +638,8 @@ void jlSoundStop(jlSoundT *sound) {
char _jlUtilIdleCheckKey(int sym) {
char key = 0;
SDLMod mod = 0;
char key;
SDLMod mod;
// Do we even care about this key?
if ((sym < 8) || (sym > 127)) {

View file

@ -483,7 +483,7 @@ void _jlDrawFill(jint16 x, jint16 y, jbool how) {
jlDrawPixelSet(x, y);
jlUtilStackPush(_jlFillStackTop, _jlDrawFillNewSegment(x, x+1, y, 0, jtrue, jtrue));
while ((r = jlUtilStackPop(_jlFillStackTop)) != NULL) {
while ((r = (_jlScanDataT *)jlUtilStackPop(_jlFillStackTop)) != NULL) {
startX = r->StartX;
endX = r->EndX;
if (r->ScanLeft) {

View file

@ -444,7 +444,7 @@ function buildWatcomToolchain() {
mkdir -p cross/watcom
pushd cross/watcom
tar xf ../../${RESULT}
unzip Watcom-Win32.zip
#unzip Watcom-Win32.zip
popd
}
@ -725,6 +725,9 @@ function doInstall() {
updateSystem
configureSFTP
git config --global user.email "no-reply@kangaroopunch.com"
git config --global user.name "JoeyBuild VM Installer"
buildIIgsToolchain "Golden Gate.msi" "Opus ][ The Software.iso" id_rsa id_rsa.pub "${GGUSER}" "${GGPASS}"
buildMacOSXToolchain MacOSX10.13.sdk.tar.xz Xcode_9.4.1.xip macos-intel
buildMacOSXToolchain MacOSX11.3.sdk.tar.xz Xcode_12.5.1.xip macos-apple
@ -901,11 +904,11 @@ function setCompiler() {
TRIPLE="x86_64-unknown-haiku"
DIR=${EHOME}/cross/haiku64/generated/cross-tools-x86_64/bin
HEADERS=${EHOME}/cross/haiku64/generated/cross-tools-x86_64/x86_64-unknown-haiku/include
export CFLAGS="-I${HEADERS}/c++/11.3.0"
export CFLAGS="-I${HEADERS}/c++/11.3.0 -I${HEADERS}/c++"
BACKEND=SDL2
;;
esac
export CFLAGS="${CFLAGS} -I${HEADERS} -I${HEADERS}/glibc -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 CFLAGS="${CFLAGS} -I${HEADERS} -I${HEADERS}/glibc -I${HEADERS}/be -I${HEADERS}/be/app -I${HEADERS}/be/locale -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=
@ -1163,6 +1166,7 @@ function updateSystem() {
liblzma-dev \
libssl-dev \
libxml2-dev \
libzstd-dev \
llvm \
mingw-w64 \
mtools \
@ -1184,4 +1188,3 @@ function updateSystem() {
scriptIsDownloaded "$1" "$2" "$3"