From: Holger Schemel Date: Thu, 18 Feb 2010 08:26:54 +0000 (+0100) Subject: rnd-20100218-2-src X-Git-Tag: 3.3.0.0^2~31 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4f9e14eb7715eb000d6a750f9734b8dcc521923f;p=rocksndiamonds.git rnd-20100218-2-src --- diff --git a/src/conftime.h b/src/conftime.h index 142df92d..04dec544 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-02-18 01:11" +#define COMPILE_DATE_STRING "2010-02-18 09:22" diff --git a/src/game_sp/file.c b/src/game_sp/file.c index bc828c0e..2ba322d7 100644 --- a/src/game_sp/file.c +++ b/src/game_sp/file.c @@ -55,20 +55,20 @@ void copyInternalEngineVars_SP() { char *preceding_playfield_memory[] = { - "95 89 95 89 95 89 95 89 95 89 3b 8a 3b 8a 3b 8a", // |..........;.;.;.| - "3b 8a 3b 8a 3b 8a 3b 8a 3b 8a e8 8a e8 8a e8 8a", // |;.;.;.;.;.è.è.è.| - "e8 8a e8 8a e8 8a e8 8a e8 8a b1 8b b1 8b b1 8b", // |è.è.è.è.è.±.±.±.| - "b1 8b b1 8b b1 8b b1 8b b1 8b 85 8c 85 8c 85 8c", // |±.±.±.±.±.......| - "85 8c 85 8c 85 8c 85 8c 85 8c 5b 8d 5b 8d 5b 8d", // |..........[.[.[.| - "5b 8d 5b 8d 5b 8d 5b 8d 5b 8d 06 8e 06 8e 06 8e", // |[.[.[.[.[.......| - "06 8e 06 8e 06 8e 06 8e 06 8e ac 8e ac 8e ac 8e", // |..........¬.¬.¬.| - "ac 8e ac 8e ac 8e ac 8e ac 8e 59 8f 59 8f 59 8f", // |¬.¬.¬.¬.¬.Y.Y.Y.| - "59 8f 59 8f 59 8f 59 8f 59 8f 00 00 70 13 00 00", // |Y.Y.Y.Y.Y...p...| - "00 00 e8 17 00 00 00 00 00 00 69 38 00 00 00 00", // |..è.......i8....| - "00 00 00 00 00 00 00 00 00 00 00 00 d0 86 00 00", // |............Ð...| - "b2 34 00 00 00 00 00 00 00 00 8f 8b 1d 34 00 00", // |²4...........4..| - "00 00 00 00 00 00 00 00 23 39 09 09 00 0c 00 08", // |........#9......| - "00 58 00 00 00 00 00 25 77 06 7f 00 00 00 01 00", // |.X.....%w.......| + "95 89 95 89 95 89 3b 8a 3b 8a 3b 8a 3b 8a 3b 8a", // |......;.;.;.;.;.| + "3b 8a 3b 8a 3b 8a e8 8a e8 8a e8 8a e8 8a e8 8a", // |;.;.;.è.è.è.è.è.| + "e8 8a e8 8a e8 8a b1 8b b1 8b b1 8b b1 8b b1 8b", // |è.è.è.±.±.±.±.±.| + "b1 8b b1 8b b1 8b 85 8c 85 8c 85 8c 85 8c 85 8c", // |±.±.±...........| + "85 8c 85 8c 85 8c 5b 8d 5b 8d 5b 8d 5b 8d 5b 8d", // |......[.[.[.[.[.| + "5b 8d 5b 8d 5b 8d 06 8e 06 8e 06 8e 06 8e 06 8e", // |[.[.[...........| + "06 8e 06 8e 06 8e ac 8e ac 8e ac 8e ac 8e ac 8e", // |......¬.¬.¬.¬.¬.| + "ac 8e ac 8e ac 8e 59 8f 59 8f 59 8f 59 8f 59 8f", // |¬.¬.¬.Y.Y.Y.Y.Y.| + "59 8f 59 8f 59 8f 00 00 70 13 00 00 00 00 e8 17", // |Y.Y.Y...p.....è.| + "00 00 00 00 00 00 69 38 00 00 00 00 00 00 00 00", // |......i8........| + "00 00 00 00 00 00 00 00 d0 86 00 00 b2 34 00 00", // |........Ð...²4..| + "00 00 00 00 00 00 8f 8b 1d 34 00 00 00 00 00 00", // |.........4......| + "00 00 00 00 23 39 09 09 00 0c 00 08 00 58 00 00", // |....#9.......X..| + "00 00 00 25 77 06 7f 00 00 00 01 00 00 00 00 00", // |...%w...........| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| @@ -77,20 +77,20 @@ void copyInternalEngineVars_SP() "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| - "00 00 00 00 00 00 00 00 00 00 00 00 00 ec 06 26", // |.............ì.&| - "05 00 00 00 00 00 00 01 00 00 00 00 31 32 33 34", // |............1234| - "35 36 37 38 39 30 2d 00 08 00 51 57 45 52 54 59", // |567890-...QWERTY| - "55 49 4f 50 00 00 0a 00 41 53 44 46 47 48 4a 4b", // |UIOP....ASDFGHJK| - "4c 00 00 00 00 00 5a 58 43 56 42 4e 4d 00 00 00", // |L.....ZXCVBNM...| - "00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00", // |... ............| + "00 00 00 00 00 00 00 00 00 ec 06 26 05 00 00 00", // |.........ì.&....| + "00 00 00 01 00 00 00 00 31 32 33 34 35 36 37 38", // |........12345678| + "39 30 2d 00 08 00 51 57 45 52 54 59 55 49 4f 50", // |90-...QWERTYUIOP| + "00 00 0a 00 41 53 44 46 47 48 4a 4b 4c 00 00 00", // |....ASDFGHJKL...| + "00 00 5a 58 43 56 42 4e 4d 00 00 00 00 00 00 20", // |..ZXCVBNM...... | "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| - "00 00 00 00 00 00 00 00 00 00 2e 00 1e 00 31 00", // |..............1.| - "14 00 39 00 1f 00 14 00 18 00 ff ff 01 00 01 4c", // |..9.......ÿÿ...L| - "45 56 45 4c 53 2e 44 41 54 00 00 00 00 00 00 00", // |EVELS.DAT.......| + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| + "00 00 00 00 00 00 2e 00 1e 00 31 00 14 00 39 00", // |..........1...9.| + "1f 00 14 00 18 00 ff ff 01 00 01 4c 45 56 45 4c", // |......ÿÿ...LEVEL| + "53 2e 44 41 54 00 00 00 00 00 00 00 00 00 00 00", // |S.DAT...........| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| @@ -98,12 +98,17 @@ void copyInternalEngineVars_SP() "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................| - "00 00 00 00", // |.... | NULL }; - int i, x, y; + int preceding_buffer_size = 0; int count; + int i, x, y; + +#if 1 + for (i = 0; preceding_playfield_memory[i] != NULL; i++) + preceding_buffer_size += 8; /* eight 16-bit integer values */ +#endif LInfo = native_sp_level.header; @@ -118,26 +123,51 @@ void copyInternalEngineVars_SP() PlayField8 = REDIM_1D(sizeof(byte), 0, FileMax + 1 - 1); DisPlayField = REDIM_1D(sizeof(byte), 0, FieldMax + 1 - 1); -#if 0 - PlayField16 = REDIM_1D(sizeof(int), -FieldWidth, FieldMax); +#if 1 + PlayField16 = REDIM_1D(sizeof(int), -preceding_buffer_size, FieldMax); #else - PlayField16 = REDIM_1D(sizeof(int), -FieldWidth * 2, FieldMax); + PlayField16 = REDIM_1D(sizeof(int), -FieldWidth, FieldMax); #endif #if 1 -#if 1 - /* fill preceding playfield buffer zone with (indestructible) "hardware" */ - for (i = -FieldWidth * 2; i < -FieldWidth; i++) - PlayField16[i] = 0x20; -#endif - #if 0 /* fill preceding playfield buffer zone with (indestructible) "hardware" */ for (i = -FieldWidth; i < 0; i++) PlayField16[i] = 0x20; #endif +#if 1 + count = 0; + for (i = 0; preceding_playfield_memory[i] != NULL; i++) + { + char *s = preceding_playfield_memory[i]; + boolean hi_byte = FALSE; /* little endian data => start with low byte */ + + while (s[0] != '\0' && s[1] != '\0') + { + int hi_nibble = s[0] - (s[0] > '9' ? 'a' - 10 : '0'); + int lo_nibble = s[1] - (s[1] > '9' ? 'a' - 10 : '0'); + int byte = (hi_nibble << 4) | lo_nibble; + + if (hi_byte) + byte <<= 8; + + PlayField16[-preceding_buffer_size + count] |= byte; + + if (hi_byte) + count++; + + hi_byte = !hi_byte; + + s += 2; + + while (*s == ' ') + s++; + } + } +#endif + count = 0; for (y = 0; y < native_sp_level.height; y++) for (x = 0; x < native_sp_level.width; x++) @@ -154,6 +184,28 @@ void copyInternalEngineVars_SP() PlayField8[i] = 0; } +#if 0 + { + static int x = 0; + + if (x == 1) + { + printf("++++++++"); + printf("----------\n"); + for (i = 0; i < preceding_buffer_size + FieldMax; i++) + { + int x = PlayField16[-preceding_buffer_size + i]; + + printf("%c%c", x & 0xff, x >> 8); + } + printf("----------\n"); + exit(0); + } + + x++; + } +#endif + #else for (i = 0; y = 0; y < native_sp_level.height; y++)