Skip to content

Conversation

@thecybermind
Copy link
Owner

Polyfills currently only exist in GetGameAPI games, as they have the game specific vmMain and syscall functions in game_X.cpp to handle such message interceptions before getting to the actual mod or engine.

vmMain games do not have these extra game-specific functions, so polyfills can't be done on a game-specific basis.

No vmMain game provides G_ARGS, and of GetGameAPI games, STVOYSP, JK2SP, and JASP do not have G_ARGS either.

For reference, G_ARGS returns a single string that contains G_ARGV for every arg above 0.

- removed g_gameinfo.api_info.orig_vmmain, and added g_gameinfo.pfnvmMain which stores the game-specific vmMain function for all games
- g_gameinfo.pfnsyscall stores the game-specific syscall function for all games
- g_mod.pfnvmMain now only stores the ACTUAL mod dll vmMain function (or s_mod_qvm_vmmain for QVM mods). it is null for GetGameAPI mods since there is no analogue
- renamed supportedgame_t.apientry to supportedgame_t.pfnGetGameAPI and also added supportedgame_t.pfndllEntry
- added game_q3a.h
- added Q3A_dllEntry, Q3A_syscall, and Q3A_vmMain functions in game_q3a.cpp
@thecybermind thecybermind merged commit 41c1508 into main Jan 6, 2026
2 checks passed
@thecybermind thecybermind deleted the dev_issue15 branch January 6, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add polyfill functionality to older games, and create G_ARGS polyfill

1 participant