From: Holger Schemel Date: Sat, 19 Sep 2009 00:12:55 +0000 (+0200) Subject: rnd-20090919-1-src X-Git-Tag: 3.3.0.0^2~81 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=91c0172a97f1323e573684a456de436332c8ea34;p=rocksndiamonds.git rnd-20090919-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 4639ce8e..b0b6875e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-08-01 00:01" +#define COMPILE_DATE_STRING "2009-09-19 02:10" diff --git a/src/game_sp/ASM.c b/src/game_sp/ASM.c index 6f0484ae..24d4c2f6 100644 --- a/src/game_sp/ASM.c +++ b/src/game_sp/ASM.c @@ -69,7 +69,11 @@ int HighByte(int Var) int SgnHighByte(int Var) // extends the signum to 16 bit { +#if 1 + short SgnHighByte; +#else int SgnHighByte; +#endif if (Var & 0x8000) { diff --git a/src/game_sp/BugsTerminals.c b/src/game_sp/BugsTerminals.c index f31e6d8c..4847b92e 100644 --- a/src/game_sp/BugsTerminals.c +++ b/src/game_sp/BugsTerminals.c @@ -150,6 +150,15 @@ int subRandomize() if ((Tmp & 0x8000) != 0) RandomSeed = RandomSeed | 0x8000; +#if 0 + { + int i; + + for (i = 0; i < 10; i++) + printf("::: TEST random number: %d\n", subGetRandomNumber()); + } +#endif + return subRandomize; } // subRandomize @@ -175,6 +184,7 @@ int subGetRandomNumber() RandomSeed = RandomSeed | 0x8000; subGetRandomNumber = Tmp / 2; + // Mov ax, randomseed // Mov bx, &H5E5 // mul bx ' dx:ax = reg * ax diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index daade3fe..8bd2e450 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -326,6 +326,10 @@ int GetStretchY(int si) void ReadLevel() { +#if 1 + static char CurPathTEST[1024]; +#endif + // int FNum; FILE *FNum; long i; @@ -333,13 +337,22 @@ void ReadLevel() #if 1 // CurPath = "/home/aeglos/projects/rocksndiamonds/levels/TEST_supaplex/supaplex/levels.dat"; + +#if 0 CurPath = "/home/aeglos/projects/rocksndiamonds/supaplex_demo_JENS0001.sp"; LevelNumber = 1; +#else + sprintf(CurPathTEST, "/home/aeglos/projects/Level_Stuff/SUPAPLEX/SUPAPLEX_LEVELS/solve00/JENS%04d.SP", level_nr); + CurPath = CurPathTEST; + LevelNumber = level_nr; +#endif + #endif DemoAvailable = False; - if (STRING_IS_LIKE(CurPath, "*.mpx")) + if (STRING_IS_LIKE(CurPath, "*.mpx") || + STRING_IS_LIKE(CurPath, "*.MPX")) { printf("::: reading MPX file ...\n"); @@ -347,7 +360,8 @@ void ReadLevel() return; } - if (STRING_IS_LIKE(CurPath, "*.sp")) + if (STRING_IS_LIKE(CurPath, "*.sp") || + STRING_IS_LIKE(CurPath, "*.SP")) { printf("::: reading SP file ...\n"); @@ -462,6 +476,12 @@ static void ReadDemo() int i; // byte T; + int RecordNumber = LevelNumber; + +#if 1 + RecordNumber = 1; // always "1" for "*.sp" style one level/demo files +#endif + FieldWidth = 60; FieldHeight = 24; HeaderSize = 96; @@ -480,14 +500,14 @@ static void ReadDemo() FNum = fopen(CurPath, "rb"); - i = (LevelNumber - 1) * ((long)(FieldMax) + 1) + 1; + i = (RecordNumber - 1) * ((long)(FieldMax) + 1) + 1; #if 1 FILE_GET(FNum, i, PlayField8, FileMax + 1); #else FILE_GET(FNum, i, &PlayField8, sizeof(PlayField8)); #endif - i = (LevelNumber) * ((long)(FieldMax) + 1) + 1 - HeaderSize; + i = (RecordNumber) * ((long)(FieldMax) + 1) + 1 - HeaderSize; FILE_GET(FNum, i, &LInfo, sizeof(LInfo)); // store level info in an extra structure fclose(FNum); @@ -528,6 +548,27 @@ static void ReadDemo() RandomSeed = LInfo.DemoRandomSeed; +#if 1 + printf("::: RandomSeed == %d\n", RandomSeed); + +#if 1 + { + int i; + + for (i = 0; i < 10; i++) + printf("::: TEST random number: %d\n", subGetRandomNumber()); + + int buffer, value = -3; + + MovHighByte(&buffer, value); + value = SgnHighByte(buffer); + + printf("::: TEST: 0x%08x / %d\n", value, value); + } +#endif + +#endif + LevelLoaded = True; return; diff --git a/src/game_sp/vb_lib.c b/src/game_sp/vb_lib.c index fa1ef2c6..d88c8e36 100644 --- a/src/game_sp/vb_lib.c +++ b/src/game_sp/vb_lib.c @@ -179,7 +179,7 @@ int FileLen(char *a) long GetTickCount() { - return 0; + return random_linux_libc(RANDOM_SIMPLE); } int GetAttr(char *a) diff --git a/src/screens.c b/src/screens.c index 60bba456..884854e5 100644 --- a/src/screens.c +++ b/src/screens.c @@ -2637,8 +2637,15 @@ static void DrawInfoScreen_CreditsScreen(int screen_nr) "Thanks to"); DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "David Tritscher"); +#if 1 + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, + "for the code base used for the"); + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_2, + "native Emerald Mine engine"); +#else DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for the new Emerald Mine engine"); +#endif } else if (screen_nr == 7) {