From 8765f0a215dddc703d0f5e41aa4c6ec992b0b0fa Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 28 Aug 2006 19:18:05 +0000 Subject: [PATCH] Added some commands for getting the current compiled CON ptr and jumping to another location git-svn-id: https://svn.eduke32.com/eduke32@277 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/astub.c | 24 ++++++++++++------------ polymer/eduke32/source/gamedef.c | 7 +++++++ polymer/eduke32/source/gamedef.h | 2 ++ polymer/eduke32/source/gameexec.c | 20 ++++++++++++++++++++ polymer/eduke32/source/grpscan.c | 14 +++++++------- 5 files changed, 48 insertions(+), 19 deletions(-) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 664788d06..ece61cdef 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -1597,7 +1597,7 @@ void Keys3d(void) if (keystatus[0x4] > 0) /* 3 (toggle floor-over-floor (cduke3d only) */ { floor_over_floor = !floor_over_floor; - if (!floor_over_floor) ResetFOFSize(); + // if (!floor_over_floor) ResetFOFSize(); keystatus[0x4] = 0; } @@ -2834,19 +2834,19 @@ void Keys3d(void) Bsprintf(tempbuf,"LOCK"); if(tempbuf[0] != 0) { - i = (Bstrlen(tempbuf)<<3)+6; - if((searchx+i) < (xdim-1)) - i = 0; - else i = (searchx+i)-(xdim-1); - if((searchy+16) < (ydim-1)) - j = 0; - else j = (searchy+16)-(ydim-1); -// printext16(searchx+6-i,searchy+6-j,11,-1,tempbuf,0); + i = (Bstrlen(tempbuf)<<3)+6; + if((searchx+i) < (xdim-1)) + i = 0; + else i = (searchx+i)-(xdim-1); + if((searchy+16) < (ydim-1)) + j = 0; + else j = (searchy+16)-(ydim-1); + // printext16(searchx+6-i,searchy+6-j,11,-1,tempbuf,0); printext256(searchx+4+2-i,searchy+4+2-j,0,-1,tempbuf,!(xdimgame > 640)); printext256(searchx+4-i,searchy+4-j,whitecol,-1,tempbuf,!(xdimgame > 640)); -// printext256(searchx+4+2,searchy+4+2,0,-1,tempbuf,!(xdimgame > 640)); -// printext256(searchx+4,searchy+4,whitecol,-1,tempbuf,!(xdimgame > 640)); + // printext256(searchx+4+2,searchy+4+2,0,-1,tempbuf,!(xdimgame > 640)); + // printext256(searchx+4,searchy+4,whitecol,-1,tempbuf,!(xdimgame > 640)); } if(helpon==1) { @@ -4146,7 +4146,7 @@ int ExtInit(void) if(glusetexcache == -1 || glusetexcachecompression == -1) { - int i; + int i; i=wm_ynbox("Texture caching", "Would you like to enable the on-disk texture cache? " diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 91d5a729e..484e13f34 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -441,6 +441,8 @@ char *keyw[] = { "findnearspritezvar", // 294 "zshootvar", // 295 "ezshootvar", // 296 + "getcurraddress", // 297 + "jump", // 298 "" }; @@ -3464,6 +3466,10 @@ char parsecommand(void) break; } + case CON_GETCURRADDRESS: + transvartype(GAMEVAR_FLAG_READONLY); + return 0; + case CON_ESHOOTVAR: case CON_ESPAWNVAR: case CON_QSPAWNVAR: @@ -3477,6 +3483,7 @@ char parsecommand(void) case CON_SHOOTVAR: if(!CheckEventSync(current_event)) ReportError(WARNING_EVENTSYNC); + case CON_JUMP: case CON_SOUNDVAR: case CON_GLOBALSOUNDVAR: case CON_STOPSOUNDVAR: diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index c0e4fa106..95225879c 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -728,5 +728,7 @@ enum keywords { CON_FINDNEARSPRITEZVAR, // 294 CON_ZSHOOTVAR, // 295 CON_EZSHOOTVAR, // 296 + CON_GETCURRADDRESS, // 297 + CON_JUMP, // 298 END }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 7265b3eae..b92dea808 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -6662,6 +6662,26 @@ good: break; } + case CON_GETCURRADDRESS: + { + int i; + insptr++; + + i=*insptr++; + SetGameVarID(i, (long)insptr, g_i, g_p ); + break; + } + + case CON_JUMP: + { + int ptr; + + insptr++; + ptr = GetGameVarID(*insptr++, g_i, g_p); + insptr = (long *)ptr; + break; + } + default: Bsprintf(tempbuf,"fatal error: Default processing in parse(): %ld, %ld\ncurrent actor: %d %d",*insptr,*(insptr-1),g_i,g_sp->picnum); AddLog(tempbuf); diff --git a/polymer/eduke32/source/grpscan.c b/polymer/eduke32/source/grpscan.c index 1d8d709d8..9737573ee 100755 --- a/polymer/eduke32/source/grpscan.c +++ b/polymer/eduke32/source/grpscan.c @@ -9,13 +9,13 @@ #include "grpscan.h" struct grpfile grpfiles[numgrpfiles] = { - { "Registered Version 1.3d", 0xBBC9CE44, 26524524, GAMEDUKE, NULL }, - { "Registered Version 1.4", 0xF514A6AC, 44348015, GAMEDUKE, NULL }, - { "Registered Version 1.5", 0xFD3DCFF1, 44356548, GAMEDUKE, NULL }, - { "Shareware Version", 0x983AD923, 11035779, GAMEDUKE, NULL }, - { "Mac Shareware Version", 0xC5F71561, 10444391, GAMEDUKE, NULL }, - { "Mac Registered Version", 0x00000000, 0, GAMEDUKE, NULL }, - { "NAM", 0x75C1F07B, 43448927, GAMENAM, NULL }, + { "Duke Nukem 3D", 0xBBC9CE44, 26524524, GAMEDUKE, NULL }, + { "Duke Nukem 3D: Atomic Edition", 0xF514A6AC, 44348015, GAMEDUKE, NULL }, + { "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAMEDUKE, NULL }, + { "Duke Nukem 3D Shareware Version", 0x983AD923, 11035779, GAMEDUKE, NULL }, + { "Duke Nukem 3D Mac Shareware Version", 0xC5F71561, 10444391, GAMEDUKE, NULL }, + { "Duke Nukem 3D Mac", 0x00000000, 0, GAMEDUKE, NULL }, + { "NAM", 0x75C1F07B, 43448927, GAMENAM, NULL }, }; struct grpfile *foundgrps = NULL;