Merge branch 'main' into vs2019
This commit is contained in:
commit
693264caf4
5 changed files with 34 additions and 12 deletions
|
@ -28,13 +28,35 @@
|
||||||
; Call to compiled code after setting up the register environment for the VM
|
; Call to compiled code after setting up the register environment for the VM
|
||||||
; prototype:
|
; prototype:
|
||||||
; uint8_t qvmcall64(int *programStack, int *opStack, intptr_t *instructionPointers, byte *dataBase);
|
; 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
|
qvmcall64 PROC FRAME
|
||||||
push rsi ; push non-volatile registers to stack
|
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
|
push rdi
|
||||||
|
.pushreg rdi
|
||||||
|
push rsi
|
||||||
|
.pushreg rsi
|
||||||
push rbx
|
push rbx
|
||||||
|
.pushreg rbx
|
||||||
|
push rbp
|
||||||
|
.pushreg rbp
|
||||||
|
|
||||||
; need to save pointer in rcx so we can write back the programData value to caller
|
; need to save pointer in rcx so we can write back the programData value to caller
|
||||||
push rcx
|
push rcx
|
||||||
|
.pushreg rcx
|
||||||
|
|
||||||
|
.endprolog ; custom unwind data ends here
|
||||||
|
|
||||||
; registers r8 and r9 have correct value already thanx to __fastcall
|
; registers r8 and r9 have correct value already thanx to __fastcall
|
||||||
xor rbx, rbx ; opStackOfs starts out being 0
|
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 dword ptr [rcx], esi ; write back the programStack value
|
||||||
mov al, bl ; return opStack offset
|
mov al, bl ; return opStack offset
|
||||||
|
|
||||||
|
pop rbp ; restore all non-volatile registers after the call
|
||||||
pop rbx
|
pop rbx
|
||||||
pop rdi
|
|
||||||
pop rsi
|
pop rsi
|
||||||
|
pop rdi
|
||||||
|
pop r15
|
||||||
|
pop r14
|
||||||
|
pop r13
|
||||||
|
pop r12
|
||||||
|
|
||||||
ret
|
ret
|
||||||
qvmcall64 ENDP
|
qvmcall64 ENDP
|
||||||
|
|
|
@ -3733,7 +3733,7 @@ void BotMapScripts(bot_state_t *bs) {
|
||||||
shootbutton = qfalse;
|
shootbutton = qfalse;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (bs->enemy == i) {
|
else if (gametype < GT_CTF || bs->enemy == i) {
|
||||||
shootbutton = qtrue;
|
shootbutton = qtrue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1346,7 +1346,7 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
|
||||||
vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
|
vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
|
||||||
vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11];
|
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 ) {
|
if ( blendWeights[j] <= 0.0f ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1528,7 +1528,7 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
|
||||||
vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
|
vtxMat[10] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 10];
|
||||||
vtxMat[11] = blendWeights[0] * poseMats[12 * data->influenceBlendIndexes[4*influence + 0] + 11];
|
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 ) {
|
if ( blendWeights[j] <= 0.0f ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,12 +281,7 @@ qboolean SNDDMA_Init(void)
|
||||||
#ifdef USE_SDL_AUDIO_CAPTURE
|
#ifdef USE_SDL_AUDIO_CAPTURE
|
||||||
// !!! FIXME: some of these SDL_OpenAudioDevice() values should be cvars.
|
// !!! FIXME: some of these SDL_OpenAudioDevice() values should be cvars.
|
||||||
s_sdlCapture = Cvar_Get( "s_sdlCapture", "1", CVAR_ARCHIVE | CVAR_LATCH );
|
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 (!s_sdlCapture->integer)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
Com_Printf("SDL audio capture support disabled by user ('+set s_sdlCapture 1' to enable)\n");
|
Com_Printf("SDL audio capture support disabled by user ('+set s_sdlCapture 1' to enable)\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue