enable real NV2A transform-program. Fixes spy vs spy, metal slug 3 and other games

This commit is contained in:
izzy2lost
2026-03-20 05:20:28 -04:00
parent 8692c06df9
commit 3a58ffe0c8
4 changed files with 19 additions and 87 deletions
+18 -1
View File
@@ -78,6 +78,17 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(tomlplusplus)
# --- nv2a_vsh_cpu ---
set(NV2A_VSH_CPU_GIT_REV "1115255708c10c4841b65dcd2223262e7a316598")
set(nv2a_vsh_cpu_UNIT_TEST OFF CACHE BOOL "" FORCE)
FetchContent_Declare(
nv2a_vsh_cpu
GIT_REPOSITORY "https://github.com/xemu-project/nv2a_vsh_cpu.git"
GIT_TAG "${NV2A_VSH_CPU_GIT_REV}"
GIT_SHALLOW FALSE
)
FetchContent_MakeAvailable(nv2a_vsh_cpu)
# --- libslirp ---
set(LIBSLIRP_GIT_REV "26be815b86e8d49add8c9a8b320239b9594ff03d")
FetchContent_Declare(
@@ -716,7 +727,6 @@ list(APPEND XEMU_CORE_SOURCES
"${REPO_ROOT}/ui/vnc-stubs.c"
"${REPO_ROOT}/target/i386/kvm/hyperv-stub.c"
"${CMAKE_CURRENT_LIST_DIR}/kvmclock_stub.c"
"${CMAKE_CURRENT_LIST_DIR}/nv2a_vsh_emulator_stub.c"
"${CMAKE_CURRENT_LIST_DIR}/samplerate_stub.c"
"${CMAKE_CURRENT_LIST_DIR}/fast_hash_stub.c"
"${CMAKE_CURRENT_LIST_DIR}/libintl_stub.c"
@@ -968,6 +978,7 @@ target_compile_options(xemu_core PRIVATE -g0
)
target_include_directories(xemu_core PRIVATE
"${nv2a_vsh_cpu_SOURCE_DIR}/src"
"${REPO_ROOT}"
"${REPO_ROOT}/include"
"${REPO_ROOT}/ui"
@@ -994,6 +1005,12 @@ target_include_directories(xemu_core PRIVATE
add_dependencies(xemu_core glib_ep)
target_link_libraries(xemu_core PRIVATE
nv2a_vsh_emulator
nv2a_vsh_cpu
nv2a_vsh_disassembler
)
if(TARGET SDL2::SDL2)
target_link_libraries(xemu_core PRIVATE SDL2::SDL2)
endif()
@@ -1,36 +0,0 @@
#include "nv2a_vsh_emulator.h"
Nv2aVshParseResult nv2a_vsh_parse_program(Nv2aVshProgram *program,
const uint32_t *code,
uint32_t code_length)
{
(void)program;
(void)code;
(void)code_length;
return NV2AVPR_SUCCESS;
}
void nv2a_vsh_program_destroy(Nv2aVshProgram *program)
{
(void)program;
}
Nv2aVshExecutionState nv2a_vsh_emu_initialize_xss_execution_state(
Nv2aVshCPUXVSSExecutionState *linkage,
float *constants)
{
Nv2aVshExecutionState state;
state.linkage = linkage;
state.constants = constants;
return state;
}
void nv2a_vsh_emu_execute_track_context_writes(
Nv2aVshExecutionState *state,
const Nv2aVshProgram *program,
bool *constants_dirty)
{
(void)state;
(void)program;
(void)constants_dirty;
}
-48
View File
@@ -1,48 +0,0 @@
#ifndef NV2A_VSH_EMULATOR_H
#define NV2A_VSH_EMULATOR_H
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Nv2aVshProgram {
uint32_t placeholder;
} Nv2aVshProgram;
typedef enum Nv2aVshParseResult {
NV2AVPR_SUCCESS = 0,
NV2AVPR_ERROR = 1,
} Nv2aVshParseResult;
typedef struct Nv2aVshCPUXVSSExecutionState {
float input_regs[4];
} Nv2aVshCPUXVSSExecutionState;
typedef struct Nv2aVshExecutionState {
Nv2aVshCPUXVSSExecutionState *linkage;
float *constants;
} Nv2aVshExecutionState;
Nv2aVshParseResult nv2a_vsh_parse_program(Nv2aVshProgram *program,
const uint32_t *code,
uint32_t code_length);
void nv2a_vsh_program_destroy(Nv2aVshProgram *program);
Nv2aVshExecutionState nv2a_vsh_emu_initialize_xss_execution_state(
Nv2aVshCPUXVSSExecutionState *linkage,
float *constants);
void nv2a_vsh_emu_execute_track_context_writes(
Nv2aVshExecutionState *state,
const Nv2aVshProgram *program,
bool *constants_dirty);
#ifdef __cplusplus
}
#endif
#endif
+1 -2
View File
@@ -1,4 +1,3 @@
[wrap-git]
url=https://github.com/xemu-project/nv2a_vsh_cpu
revision=561fe80da57a881f89000256b459440c0178a7ce
depth=1
revision=1115255708c10c4841b65dcd2223262e7a316598