diff --git a/.gitignore b/.gitignore index 55120b422..1c7ed1ead 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ release/ t/ winbuild/ win32build/ +xpbuild/ macbuild/ linuxbuild/ *.swp diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e5d3afe6..47d7b3f94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -760,11 +760,15 @@ endif() if (WITH_RENDER_DX11) if (WIN32) - list(APPEND GUI_SOURCES src/gui/render/renderDX11.cpp) - list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_dx11.cpp) - list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_DX11) - list(APPEND DEPENDENCIES_LIBRARIES d3d11) - message(STATUS "UI render backend: DirectX 11") + if (SUPPORT_XP) + message(FATAL_ERROR "SUPPORT_XP is on. cannot enable DirectX 11 backend.") + else() + list(APPEND GUI_SOURCES src/gui/render/renderDX11.cpp) + list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_dx11.cpp) + list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_DX11) + list(APPEND DEPENDENCIES_LIBRARIES d3d11) + message(STATUS "UI render backend: DirectX 11") + endif() else() message(FATAL_ERROR "DirectX 11 render backend only for Windows!") endif() diff --git a/scripts/release-win32.sh b/scripts/release-win32.sh index 21595dc4b..b0c1c2ff6 100755 --- a/scripts/release-win32.sh +++ b/scripts/release-win32.sh @@ -15,7 +15,7 @@ fi cd win32build # TODO: potential Arch-ism? -i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type -Werror" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=ON -DWITH_RENDER_DX11=ON .. || exit 1 +i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-O2 -march=i686" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type -march=i686" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=OFF -DWITH_RENDER_DX11=ON .. || exit 1 make -j8 || exit 1 cd .. @@ -34,11 +34,6 @@ cp -r ../../wavetables wavetables || exit 1 i686-w64-mingw32-strip -s furnace.exe || exit 1 -# patch to remove GetTickCount64 -xxd -c 256 -ps furnace.exe | sed "s/4765745469636b436f756e743634/4765745469636b436f756e740000/g" | xxd -ps -r > furnace-patched.exe -rm furnace.exe -mv furnace-patched.exe furnace.exe - zip -r furnace.zip LICENSE.txt furnace.exe README.txt papers doc demos instruments wavetables furName=$(git describe --tags | sed "s/v0/0/") diff --git a/scripts/release-winxp.sh b/scripts/release-winxp.sh new file mode 100755 index 000000000..59604ea36 --- /dev/null +++ b/scripts/release-winxp.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# make Windows release +# this script shall be run from Arch Linux with MinGW installed! + +if [ ! -e /tmp/furnace ]; then + ln -s "$PWD" /tmp/furnace || exit 1 +fi + +cd /tmp/furnace + +if [ ! -e xpbuild ]; then + mkdir xpbuild || exit 1 +fi + +cd xpbuild + +# TODO: potential Arch-ism? +i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=ON -DWITH_RENDER_DX11=OFF .. || exit 1 +make -j8 || exit 1 + +cd .. + +mkdir -p release/winxp || exit 1 +cd release/winxp + +cp ../../LICENSE LICENSE.txt || exit 1 +cp ../../xpbuild/furnace.exe . || exit 1 +cp ../../README.md README.txt || exit 1 +cp -r ../../papers papers || exit 1 +cp -r ../../doc doc || exit 1 +cp -r ../../demos demos || exit 1 +cp -r ../../instruments instruments || exit 1 +cp -r ../../wavetables wavetables || exit 1 + +i686-w64-mingw32-strip -s furnace.exe || exit 1 + +# patch to remove GetTickCount64 +xxd -c 256 -ps furnace.exe | sed "s/4765745469636b436f756e743634/4765745469636b436f756e740000/g" | xxd -ps -r > furnace-patched.exe +rm furnace.exe +mv furnace-patched.exe furnace.exe + +zip -r furnace.zip LICENSE.txt furnace.exe README.txt papers doc demos instruments wavetables + +furName=$(git describe --tags | sed "s/v0/0/") + +mv furnace.zip furnace-"$furName"-win32-XP-ONLY.zip diff --git a/src/audio/sdlAudio.cpp b/src/audio/sdlAudio.cpp index 5d07921e9..ddbe85947 100644 --- a/src/audio/sdlAudio.cpp +++ b/src/audio/sdlAudio.cpp @@ -127,6 +127,7 @@ bool TAAudioSDL::init(TAAudioDesc& request, TAAudioDesc& response) { ac.callback=taSDLProcess; ac.userdata=this; + logV("opening audio device..."); ai=SDL_OpenAudioDevice(request.deviceName.empty()?NULL:request.deviceName.c_str(),0,&ac,&ar,0); if (ai==0) { logE("could not open audio device: %s",SDL_GetError()); @@ -147,6 +148,8 @@ bool TAAudioSDL::init(TAAudioDesc& request, TAAudioDesc& response) { desc.bufsize=ar.samples; desc.fragments=1; + logV("got info: %d channels, %d bufsize",desc.outChans,desc.bufsize); + if (desc.outChans>0) { outBufs=new float*[desc.outChans]; for (int i=0; ilistAudioDevices(); want.deviceName=getConfString("audioDevice",""); @@ -3352,8 +3355,10 @@ bool DivEngine::initAudioBackend() { if (want.outChans<1) want.outChans=1; if (want.outChans>16) want.outChans=16; + logV("setting callback"); output->setCallback(process,this); + logV("calling init"); if (!output->init(want,got)) { logE("error while initializing audio!"); delete output; @@ -3362,6 +3367,7 @@ bool DivEngine::initAudioBackend() { return false; } + logV("allocating oscBuf..."); for (int i=0; iinitMidi(false)) { midiIns=output->midiIn->listDevices(); midiOuts=output->midiOut->listDevices(); @@ -3400,6 +3407,7 @@ bool DivEngine::initAudioBackend() { } } + logV("initAudioBackend done"); return true; } @@ -3443,6 +3451,13 @@ void DivEngine::preInit() { logI("Furnace version " DIV_VERSION "."); loadConf(); + +#ifdef HAVE_SDL2 + String audioDriver=getConfString("sdlAudioDriver",""); + if (!audioDriver.empty()) { + SDL_SetHint("SDL_HINT_AUDIODRIVER",audioDriver.c_str()); + } +#endif } bool DivEngine::init() { @@ -3480,6 +3495,8 @@ bool DivEngine::init() { haveAudio=true; } + logV("creating blip_buf"); + samp_bb=blip_new(32768); if (samp_bb==NULL) { logE("not enough memory!"); @@ -3493,6 +3510,8 @@ bool DivEngine::init() { metroBuf=new float[8192]; metroBufLen=8192; + + logV("setting blip rate of samp_bb (%f)",got.rate); blip_set_rates(samp_bb,44100,got.rate); diff --git a/src/engine/platform/tx81z.cpp b/src/engine/platform/tx81z.cpp index 9de7262b3..52f71aedc 100644 --- a/src/engine/platform/tx81z.cpp +++ b/src/engine/platform/tx81z.cpp @@ -206,7 +206,7 @@ void DivPlatformTX81Z::tick(bool sysTick) { if (chan[i].std.alg.had) { chan[i].state.alg=chan[i].std.alg.val; - immWrite(chanOffs[i]+ADDR_LR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3)|(chan[i].active?0:0x40)|(chan[i].chVolR<<7)); + immWrite(chanOffs[i]+ADDR_LR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3)|(chan[i].active?0x40:0)|(chan[i].chVolR<<7)); if (!parent->song.algMacroBehavior) for (int j=0; j<4; j++) { unsigned short baseAddr=chanOffs[i]|opOffs[j]; DivInstrumentFM::Operator& op=chan[i].state.op[j]; @@ -223,7 +223,7 @@ void DivPlatformTX81Z::tick(bool sysTick) { } if (chan[i].std.fb.had) { chan[i].state.fb=chan[i].std.fb.val; - immWrite(chanOffs[i]+ADDR_LR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3)|(chan[i].active?0:0x40)|(chan[i].chVolR<<7)); + immWrite(chanOffs[i]+ADDR_LR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3)|(chan[i].active?0x40:0)|(chan[i].chVolR<<7)); } if (chan[i].std.fms.had) { chan[i].state.fms=chan[i].std.fms.val;