diff --git a/code/asm/vm_x86_64.asm b/code/asm/vm_x86_64.asm index 87e04f4d..f84eb8f8 100644 --- a/code/asm/vm_x86_64.asm +++ b/code/asm/vm_x86_64.asm @@ -28,13 +28,35 @@ ; Call to compiled code after setting up the register environment for the VM ; prototype: ; uint8_t qvmcall64(int *programStack, int *opStack, intptr_t *instructionPointers, byte *dataBase); +; +; This call-stub has its own custom calling convention due to pushing all non-volatile registers +; to the stack. The game uses set/longjmp which on Windows uses "RtlUnwindEx" to unwind the callstack. +; This function cannot be unwound by default due to the custom calling convention. +; To allow unwinding, we need to add custom SEH unwind data to the function. -qvmcall64 PROC - push rsi ; push non-volatile registers to stack +qvmcall64 PROC FRAME + push r12 ; push all non-volatile registers to stack + .pushreg r12 + push r13 + .pushreg r13 + push r14 + .pushreg r14 + push r15 + .pushreg r15 push rdi + .pushreg rdi + push rsi + .pushreg rsi push rbx + .pushreg rbx + push rbp + .pushreg rbp + ; need to save pointer in rcx so we can write back the programData value to caller push rcx + .pushreg rcx + + .endprolog ; custom unwind data ends here ; registers r8 and r9 have correct value already thanx to __fastcall xor rbx, rbx ; opStackOfs starts out being 0 @@ -48,9 +70,14 @@ qvmcall64 PROC mov dword ptr [rcx], esi ; write back the programStack value mov al, bl ; return opStack offset + pop rbp ; restore all non-volatile registers after the call pop rbx - pop rdi pop rsi + pop rdi + pop r15 + pop r14 + pop r13 + pop r12 ret qvmcall64 ENDP diff --git a/code/game/ai_dmq3.c b/code/game/ai_dmq3.c index 30df7acb..3ecaccb7 100644 --- a/code/game/ai_dmq3.c +++ b/code/game/ai_dmq3.c @@ -3733,7 +3733,7 @@ void BotMapScripts(bot_state_t *bs) { shootbutton = qfalse; break; } - else if (bs->enemy == i) { + else if (gametype < GT_CTF || bs->enemy == i) { shootbutton = qtrue; } } diff --git a/code/renderergl1/tr_model_iqm.c b/code/renderergl1/tr_model_iqm.c index fe205ff4..5050eb10 100644 --- a/code/renderergl1/tr_model_iqm.c +++ b/code/renderergl1/tr_model_iqm.c @@ -1346,7 +1346,7 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) { vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10]; vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11]; - for( j = 1; j < 3; j++ ) { + for( j = 1; j < 4; j++ ) { if ( blendWeights[j] <= 0.0f ) { break; } diff --git a/code/renderergl2/tr_model_iqm.c b/code/renderergl2/tr_model_iqm.c index fc345a32..cc12faf4 100644 --- a/code/renderergl2/tr_model_iqm.c +++ b/code/renderergl2/tr_model_iqm.c @@ -1528,7 +1528,7 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) { vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10]; vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11]; - for( j = 1; j < 3; j++ ) { + for( j = 1; j < 4; j++ ) { if ( blendWeights[j] <= 0.0f ) { break; } diff --git a/code/sdl/sdl_snd.c b/code/sdl/sdl_snd.c index eb0dd58f..7696a515 100644 --- a/code/sdl/sdl_snd.c +++ b/code/sdl/sdl_snd.c @@ -281,12 +281,7 @@ qboolean SNDDMA_Init(void) #ifdef USE_SDL_AUDIO_CAPTURE // !!! FIXME: some of these SDL_OpenAudioDevice() values should be cvars. s_sdlCapture = Cvar_Get( "s_sdlCapture", "1", CVAR_ARCHIVE | CVAR_LATCH ); - // !!! FIXME: pulseaudio capture records audio the entire time the program is running. https://bugzilla.libsdl.org/show_bug.cgi?id=4087 - if (Q_stricmp(SDL_GetCurrentAudioDriver(), "pulseaudio") == 0) - { - Com_Printf("SDL audio capture support disabled for pulseaudio (https://bugzilla.libsdl.org/show_bug.cgi?id=4087)\n"); - } - else if (!s_sdlCapture->integer) + if (!s_sdlCapture->integer) { Com_Printf("SDL audio capture support disabled by user ('+set s_sdlCapture 1' to enable)\n"); }