[gamecode] Add PROG_V6P_VERSION and bump PROG_VERSION

This allows the VM to select the right execution loop and qfcc currently
still produces only the old IS (it doesn't know how to deal with the new
IS yet)
This commit is contained in:
Bill Currie 2022-01-03 13:56:43 +09:00
parent 925797b1d4
commit 8a2788c267
7 changed files with 233 additions and 228 deletions

View file

@ -693,7 +693,8 @@ typedef struct pr_va_list_s {
|(((0x##b) & 0xfff) << 12) \
|(((0x##c) & 0xfff) << 0) )
#define PROG_ID_VERSION 6
#define PROG_VERSION PROG_VERSION_ENCODE(0,fff,00a)
#define PROG_V6P_VERSION PROG_VERSION_ENCODE(0,fff,00a)
#define PROG_VERSION PROG_VERSION_ENCODE(0,fff,010)
typedef struct dprograms_s {
pr_uint_t version;

View file

@ -2650,7 +2650,7 @@ PR_ExecuteProgram (progs_t *pr, func_t fnum)
// called a builtin instead of progs code
goto exit_program;
}
if (1) {
if (pr->progs->version < PROG_VERSION) {
pr_exec_quakec (pr, exitdepth);
} else {
pr_exec_ruamoko (pr, exitdepth);

View file

@ -145,6 +145,7 @@ PR_LoadProgsFile (progs_t *pr, QFile *file, int size)
((int *) &progs)[i] = LittleLong (((int *) &progs)[i]);
if (progs.version != PROG_VERSION
&& progs.version != PROG_V6P_VERSION
&& progs.version != PROG_ID_VERSION) {
if (progs.version < 0x00fff000) {
PR_Error (pr, "%s has unrecognised version number (%u)",

File diff suppressed because it is too large Load diff

View file

@ -242,13 +242,16 @@ PR_LoadStrings (progs_t *pr)
while (str < end) {
count++;
if (*str == '@' && pr->progs->version == PROG_VERSION) {
if (*str == '@' && pr->progs->version == PROG_V6P_VERSION) {
if (!strcmp (str, "@float_promoted@")) {
pr->float_promoted = 1;
}
}
str += strlen (str) + 1;
}
if (pr->progs->version == PROG_VERSION) {
pr->float_promoted = 1;
}
res->ds_mem.alloc = pr_strings_alloc;
res->ds_mem.free = pr_strings_free;

View file

@ -398,7 +398,7 @@ DecodeArgs (int argc, char **argv)
case OPT_ADVANCED:
options.traditional = 0;
options.advanced = true;
options.code.progsversion = PROG_VERSION;
options.code.progsversion = PROG_V6P_VERSION;
options.code.const_initializers = false;
break;
case OPT_BLOCK_DOT:
@ -505,7 +505,7 @@ DecodeArgs (int argc, char **argv)
if (flag)
options.code.progsversion = PROG_ID_VERSION;
else
options.code.progsversion = PROG_VERSION;
options.code.progsversion = PROG_V6P_VERSION;
} else if (!(strcasecmp (temp, "const-initializers"))) {
options.code.const_initializers = flag;
}
@ -699,7 +699,7 @@ DecodeArgs (int argc, char **argv)
options.code.vector_components = true;
}
if (!options.code.progsversion)
options.code.progsversion = PROG_VERSION;
options.code.progsversion = PROG_V6P_VERSION;
if (!options.traditional) {
options.advanced = true;
add_cpp_def ("-D__RUAMOKO__=1");

View file

@ -65,7 +65,7 @@ set_traditional (int traditional)
case 0:
options.traditional = 0;
options.advanced = true;
options.code.progsversion = PROG_VERSION;
options.code.progsversion = PROG_V6P_VERSION;
type_default = &type_integer;
break;
case 1: