Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce QVM support #1182

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2d7593c
Add vm_arm.cpp, vm_interpreted.cpp, vm_local.h and vm_x86.c from mvde…
Daggolin Sep 26, 2023
324b6fd
Fix compiling with the jk2mv vm_* files.
Daggolin Sep 26, 2023
f57ce90
Add QVM loading.
Daggolin Sep 26, 2023
54b4990
Fix return values in nested system calls from QVMs
Daggolin Sep 30, 2023
1d3d3c4
Add support for ui.qvm on 64 bit engine builds.
Daggolin Sep 30, 2023
ccdc67e
Add extra memory to QVMs on load to use when the module doesn't provi…
Daggolin Sep 30, 2023
9002d28
Adjust the gameapi in a similar way to the uiapi for better QVM compa…
Daggolin Sep 30, 2023
39000e2
Replace sharedEntity_t with sharedEntityMapper_t in most places.
Daggolin Sep 30, 2023
b92fc59
Adjust gvm calls to use QVM extra memory where required.
Daggolin Oct 3, 2023
f981711
Adjust the cgameapi in a similar way to the uiapi and gameapi for bet…
Daggolin Oct 3, 2023
c249103
Cleanup for QVM related code.
Daggolin Oct 3, 2023
6fd6d78
Fix previously undefined behavior in SV_ClipMoveToEntities.
Daggolin Oct 6, 2023
73e46f9
Compile vm_legacy cvar into non-debug builds.
Daggolin Oct 28, 2023
9e3da12
Mark native libraries using the Legacy API in vminfo command output.
Daggolin Oct 28, 2023
db0a3d4
Fix developer and cl_shownet output accessing invalid memory when usi…
Daggolin Oct 28, 2023
bce0347
Use longjmp in Com_Error, because throwing an exception when the call…
Daggolin Oct 29, 2023
e02ac4a
Add com_dedicatedForceErrorsToFatal cvar.
Daggolin Oct 29, 2023
cf4fb13
Fix return value of GVM_ClientConnect when using QVM.
Daggolin Oct 31, 2023
cf10de6
Port file extension and character restrictions for vms from jk2mv.
Daggolin Nov 2, 2023
d3f43ad
Add win32/q3asm.asm from jk2mv for MSVC builds.
Daggolin Nov 2, 2023
4ab1db0
vm_x86.cpp: push and pop ebx in EmitCallDoSyscall.
Daggolin Nov 3, 2023
afa3d13
vm_x86.cpp: backup and restore registers r12, r13, r14 and r15 in Emi…
Daggolin Nov 3, 2023
2a74fa5
vm_x86.cpp: add workaround for x64 Windows in EmitCallDoSyscall.
Daggolin Nov 3, 2023
2626c38
Fix behaviorSet in sharedEntityMapper when using QVMs.
Daggolin Nov 6, 2023
9eb8502
Use new macros to fix double pointers in sharedEntityMapper reading 6…
Daggolin Nov 6, 2023
57cf72f
Add SV_EntityMapperReadGhoul2 to handle special case for ghoul2 handl…
Daggolin Nov 12, 2023
9292075
Fix VM_ExtraMemory_Claim using incorrect vm pointer.
Daggolin Apr 7, 2024
1271456
Fix CGVM_GetOrigin and CGVM_GetAngles not setting the out vec3_t when…
Daggolin Apr 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -102,6 +102,11 @@ list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake/Modules")
# ${Architecture} must match ARCH_STRING in q_platform.h,
# and is used in DLL names (jagamex86.dll, jagamex86.dylib, jagamei386.so).
if(WIN32)

if(MSVC)
enable_language(ASM_MASM)
endif()

set(X86 ON)
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(Architecture "x86_64")
Expand All @@ -116,6 +121,7 @@ else()
set(Architecture "arm64")
add_definitions(-DPNG_ARM_NEON_OPT=0)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
set(ARM32 ON)
set(Architecture "arm")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
set(X86 ON)
Expand Down Expand Up @@ -215,6 +221,8 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /safeseh:no")

# We don't try to control symbol visibility under MSVC.
set(OPENJK_VISIBILITY_FLAGS "")
elseif (("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang"))
Expand Down
19 changes: 19 additions & 0 deletions codemp/CMakeLists.txt
Expand Up @@ -254,10 +254,29 @@ if(BuildMPEngine OR BuildMPDed)
"${MPDir}/qcommon/tags.h"
"${MPDir}/qcommon/timing.h"
"${MPDir}/qcommon/vm.cpp"
"${MPDir}/qcommon/vm_local.h"
"${MPDir}/qcommon/vm_interpreted.cpp"
"${MPDir}/qcommon/z_memman_pc.cpp"

${SharedCommonFiles}
)

if(X86)
set(MPEngineAndDedCommonFiles ${MPEngineAndDedCommonFiles}
"${MPDir}/qcommon/vm_x86.cpp"
)
elseif(ARM32)
set(MPEngineAndDedCommonFiles ${MPEngineAndDedCommonFiles}
"${MPDir}/qcommon/vm_arm.cpp"
)
endif()

if(MSVC)
set(MPEngineAndDedCommonFiles ${MPEngineAndDedCommonFiles}
"${MPDir}/win32/q3asm.asm"
)
endif()

if(WIN32)
set(MPEngineAndDedCommonFiles ${MPEngineAndDedCommonFiles})
endif(WIN32)
Expand Down
375 changes: 275 additions & 100 deletions codemp/client/cl_cgameapi.cpp

Large diffs are not rendered by default.