Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/game_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct supportedgame_funcs {
qvm_syscall pfnqvmsyscall; // pointer to a function that handles mod->engine calls from a QVM (NULL = not supported)
mod_dllEntry pfndllEntry; // pointer to a function that handles dllEntry entry for a game (NULL = not supported)
mod_GetGameAPI pfnGetGameAPI; // pointer to a function that handles GetGameAPI entry for a game (NULL = not supported)
bool(*pfnModLoad)(void*); // pointer to a function that handles mod loading logic after a DLL is loaded
bool(*pfnModLoad)(void*, bool); // pointer to a function that handles mod loading logic after a DLL is loaded
void(*pfnModUnload)(); // pointer to a function that handles mod unloading logic before a DLL is unloaded
};

Expand Down Expand Up @@ -76,7 +76,7 @@ static intptr_t game##_syscall(intptr_t cmd, ...); \
static intptr_t game##_vmMain(intptr_t cmd, ...); \
static int game##_qvmsyscall(uint8_t*, int, int*); \
static void game##_dllEntry(eng_syscall); \
static bool game##_mod_load(void*); \
static bool game##_mod_load(void*, bool); \
static void game##_mod_unload(); \
supportedgame_funcs game##_funcs = { \
game##_qmm_eng_msgs, game##_qmm_mod_msgs, game##_eng_msg_names, game##_mod_msg_names, \
Expand All @@ -92,7 +92,7 @@ static bool game##_autodetect(bool, supportedgame*); \
static intptr_t game##_syscall(intptr_t cmd, ...); \
static intptr_t game##_vmMain(intptr_t cmd, ...); \
static void game##_dllEntry(eng_syscall); \
static bool game##_mod_load(void*); \
static bool game##_mod_load(void*, bool); \
static void game##_mod_unload(); \
supportedgame_funcs game##_funcs = { \
game##_qmm_eng_msgs, game##_qmm_mod_msgs, game##_eng_msg_names, game##_mod_msg_names, \
Expand All @@ -108,7 +108,7 @@ static bool game##_autodetect(bool, supportedgame*); \
static intptr_t game##_syscall(intptr_t cmd, ...); \
static intptr_t game##_vmMain(intptr_t cmd, ...); \
static void* game##_GetGameAPI(void*, void*); \
static bool game##_mod_load(void*); \
static bool game##_mod_load(void*, bool); \
static void game##_mod_unload(); \
supportedgame_funcs game##_funcs = { \
game##_qmm_eng_msgs, game##_qmm_mod_msgs, game##_eng_msg_names, game##_mod_msg_names, \
Expand Down
5 changes: 5 additions & 0 deletions include/game_jamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Created By:
#ifndef QMM2_GAME_JAMP_H
#define QMM2_GAME_JAMP_H

// meh
enum {
G_FS_LISTFILES = G_FS_GETFILELIST,
};

// these import messages do not have an exact analogue in JAMP
enum {
G_ARGS = -100, // char* (void)
Expand Down
32 changes: 11 additions & 21 deletions src/game_cod11mp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,13 @@ Created By:
GEN_QMM_MSGS(COD11MP);
GEN_EXTS(COD11MP);

static const char* COD11MP_eng_msg_names(intptr_t);
static const char* COD11MP_mod_msg_names(intptr_t);
static void COD11MP_dllEntry(eng_syscall);
static bool COD11MP_mod_load(void*);
static void COD11MP_mod_unload();
supportedgame_funcs COD11MP_funcs = {
COD11MP_qmm_eng_msgs,
COD11MP_qmm_mod_msgs,
COD11MP_eng_msg_names,
COD11MP_mod_msg_names,
nullptr, // COD11MP_autodetect
nullptr, // COD11MP_qvmsyscall
COD11MP_dllEntry,
nullptr, // COD11MP_GetGameAPI
COD11MP_mod_load,
COD11MP_mod_unload
};
GEN_DLL(COD11MP);


// auto-detection logic for COD11MP (never auto-detect)
static bool COD11MP_autodetect(bool, supportedgame*) {
return false;
}


// original syscall pointer that comes from the game engine
Expand All @@ -45,7 +35,7 @@ static eng_syscall orig_syscall = nullptr;
// pointer to vmMain that comes from the mod
static mod_vmMain orig_vmMain = nullptr;

// wrapper syscall function that calls actual engine func from orig_import
// wrapper syscall function that calls actual engine func in orig_syscall
// this is how QMM and plugins will call into the engine
static intptr_t COD11MP_syscall(intptr_t cmd, ...) {
QMM_GET_SYSCALL_ARGS();
Expand All @@ -66,7 +56,7 @@ static intptr_t COD11MP_syscall(intptr_t cmd, ...) {
s = "";
int i = 1;
while (i < orig_syscall(G_ARGC)) {
orig_syscall(G_ARGV, buf, sizeof(buf));
orig_syscall(G_ARGV, i, buf, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
if (i != 1)
s += " ";
Expand All @@ -92,7 +82,7 @@ static intptr_t COD11MP_syscall(intptr_t cmd, ...) {
}


// wrapper vmMain function that calls actual mod func from orig_export
// wrapper vmMain function that calls actual mod func in orig_vmMain
// this is how QMM and plugins will call into the mod
static intptr_t COD11MP_vmMain(intptr_t cmd, ...) {
QMM_GET_VMMAIN_ARGS();
Expand Down Expand Up @@ -134,7 +124,7 @@ static void COD11MP_dllEntry(eng_syscall syscall) {
}


static bool COD11MP_mod_load(void* entry) {
static bool COD11MP_mod_load(void* entry, bool) {
orig_vmMain = (mod_vmMain)entry;

return !!orig_vmMain;
Expand Down
8 changes: 4 additions & 4 deletions src/game_codmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static eng_syscall orig_syscall = nullptr;
// pointer to vmMain that comes from the mod
static mod_vmMain orig_vmMain = nullptr;

// wrapper syscall function that calls actual engine func from orig_import
// wrapper syscall function that calls actual engine func in orig_syscall
// this is how QMM and plugins will call into the engine
static intptr_t CODMP_syscall(intptr_t cmd, ...) {
QMM_GET_SYSCALL_ARGS();
Expand All @@ -71,7 +71,7 @@ static intptr_t CODMP_syscall(intptr_t cmd, ...) {
s = "";
int i = 1;
while (i < orig_syscall(G_ARGC)) {
orig_syscall(G_ARGV, buf, sizeof(buf));
orig_syscall(G_ARGV, i, buf, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
if (i != 1)
s += " ";
Expand All @@ -97,7 +97,7 @@ static intptr_t CODMP_syscall(intptr_t cmd, ...) {
}


// wrapper vmMain function that calls actual mod func from orig_export
// wrapper vmMain function that calls actual mod func in orig_vmMain
// this is how QMM and plugins will call into the mod
static intptr_t CODMP_vmMain(intptr_t cmd, ...) {
QMM_GET_VMMAIN_ARGS();
Expand Down Expand Up @@ -139,7 +139,7 @@ static void CODMP_dllEntry(eng_syscall syscall) {
}


static bool CODMP_mod_load(void* entry) {
static bool CODMP_mod_load(void* entry, bool) {
orig_vmMain = (mod_vmMain)entry;

return !!orig_vmMain;
Expand Down
8 changes: 4 additions & 4 deletions src/game_coduomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static eng_syscall orig_syscall = nullptr;
// pointer to vmMain that comes from the mod
static mod_vmMain orig_vmMain = nullptr;

// wrapper syscall function that calls actual engine func from orig_import
// wrapper syscall function that calls actual engine func in orig_syscall
// this is how QMM and plugins will call into the engine
static intptr_t CODUOMP_syscall(intptr_t cmd, ...) {
QMM_GET_SYSCALL_ARGS();
Expand All @@ -71,7 +71,7 @@ static intptr_t CODUOMP_syscall(intptr_t cmd, ...) {
s = "";
int i = 1;
while (i < orig_syscall(G_ARGC)) {
orig_syscall(G_ARGV, buf, sizeof(buf));
orig_syscall(G_ARGV, i, buf, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
if (i != 1)
s += " ";
Expand All @@ -97,7 +97,7 @@ static intptr_t CODUOMP_syscall(intptr_t cmd, ...) {
}


// wrapper vmMain function that calls actual mod func from orig_export
// wrapper vmMain function that calls actual mod func in orig_vmMain
// this is how QMM and plugins will call into the mod
static intptr_t CODUOMP_vmMain(intptr_t cmd, ...) {
QMM_GET_VMMAIN_ARGS();
Expand Down Expand Up @@ -139,7 +139,7 @@ static void CODUOMP_dllEntry(eng_syscall syscall) {
}


static bool CODUOMP_mod_load(void* entry) {
static bool CODUOMP_mod_load(void* entry, bool) {
orig_vmMain = (mod_vmMain)entry;

return !!orig_vmMain;
Expand Down
Loading