[Scummvm-cvs-logs] SF.net SVN: scummvm: [24390] tools/trunk

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Oct 19 13:52:41 CEST 2006


Revision: 24390
          http://svn.sourceforge.net/scummvm/?rev=24390&view=rev
Author:   kirben
Date:     2006-10-19 04:52:32 -0700 (Thu, 19 Oct 2006)

Log Message:
-----------
Rename 'extract_simon1_amiga' to 'extract_agos', to match engine name

Modified Paths:
--------------
    tools/trunk/Makefile
    tools/trunk/Makefile.mingw
    tools/trunk/README

Added Paths:
-----------
    tools/trunk/extract_agos.c

Removed Paths:
-------------
    tools/trunk/extract_simon1_amiga.c

Modified: tools/trunk/Makefile
===================================================================
--- tools/trunk/Makefile	2006-10-19 11:40:26 UTC (rev 24389)
+++ tools/trunk/Makefile	2006-10-19 11:52:32 UTC (rev 24390)
@@ -19,9 +19,9 @@
 	compress_kyra$(EXEEXT) \
 	compress_queen$(EXEEXT) \
 	compress_saga$(EXEEXT) \
+	compress_scumm_bun$(EXEEXT) \
 	compress_scumm_san$(EXEEXT) \
 	compress_scumm_sou$(EXEEXT) \
-	compress_scumm_bun$(EXEEXT) \
 	compress_simon$(EXEEXT) \
 	compress_sword1$(EXEEXT) \
 	compress_sword2$(EXEEXT) \
@@ -29,12 +29,12 @@
 	descumm$(EXEEXT) \
 	desword2$(EXEEXT) \
 	encode_dxa$(EXEEXT) \
+	extract_agos$(EXEEXT) \
 	extract_kyra$(EXEEXT) \
 	extract_loom_tg16$(EXEEXT) \
 	extract_mm_c64$(EXEEXT) \
 	extract_mm_nes$(EXEEXT) \
 	extract_scumm_mac$(EXEEXT) \
-	extract_simon1_amiga$(EXEEXT) \
 	extract_zak_c64$(EXEEXT)
 
 UTILS := \
@@ -47,67 +47,67 @@
 
 all: $(TARGETS)
 
-compress_scumm_san$(EXEEXT): compress_scumm_san.o compress.o util.o
-	$(CXX) $(LDFLAGS) -o $@ $+ -lz
-
-descumm$(EXEEXT): descumm-tool.o descumm.o descumm6.o descumm-common.o util.o
+compress_kyra$(EXEEXT): compress_kyra.o compress.o util.o
 	$(CXX) $(LDFLAGS) -o $@ $+
 
-desword2$(EXEEXT): desword2.o util.o
-	$(CXX) $(LDFLAGS) -o $@ $+
+compress_queen$(EXEEXT): compress_queen.o util.o
+	$(CC) $(LDFLAGS) -o $@ $+
 
-dekyra$(EXEEXT): dekyra.o dekyra_v1.o util.o
+compress_saga$(EXEEXT): compress_saga.o compress.o util.o $(UTILS)
 	$(CXX) $(LDFLAGS) -o $@ $+
 
-extract_kyra$(EXEEXT): extract_kyra.o util.o
-	$(CXX) $(LDFLAGS) -o $@ $+
-
-compress_scumm_sou$(EXEEXT): compress_scumm_sou.o compress.o util.o
-	$(CC) $(LDFLAGS) -o $@ $+
-
 compress_scumm_bun$(EXEEXT): compress_scumm_bun.o compress.o util.o
 	$(CXX) $(LDFLAGS) -o $@ $+
 
-encode_dxa$(EXEEXT): encode_dxa.o compress.o util.o
-	$(CXX) $(LDFLAGS) -o $@ $+ -lpng -lz
+compress_scumm_san$(EXEEXT): compress_scumm_san.o compress.o util.o
+	$(CXX) $(LDFLAGS) -o $@ $+ -lz
 
-extract_loom_tg16$(EXEEXT): extract_loom_tg16.o util.o
+compress_scumm_sou$(EXEEXT): compress_scumm_sou.o compress.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-extract_mm_c64$(EXEEXT): extract_mm_c64.o util.o
+compress_simon$(EXEEXT): compress_simon.o compress.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-extract_mm_nes$(EXEEXT): extract_mm_nes.o util.o
+compress_sword1$(EXEEXT): compress_sword1.o compress.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-compress_queen$(EXEEXT): compress_queen.o util.o
+compress_sword2$(EXEEXT): compress_sword2.o compress.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-extract_scumm_mac$(EXEEXT): extract_scumm_mac.o util.o
+dekyra$(EXEEXT): dekyra.o dekyra_v1.o util.o
+	$(CXX) $(LDFLAGS) -o $@ $+
+
+descumm$(EXEEXT): descumm-tool.o descumm.o descumm6.o descumm-common.o util.o
+	$(CXX) $(LDFLAGS) -o $@ $+
+
+desword2$(EXEEXT): desword2.o util.o
+	$(CXX) $(LDFLAGS) -o $@ $+
+
+encode_dxa$(EXEEXT): encode_dxa.o compress.o util.o
+	$(CXX) $(LDFLAGS) -o $@ $+ -lpng -lz
+
+extract_agos$(EXEEXT): extract_agos.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-compress_saga$(EXEEXT): compress_saga.o compress.o util.o $(UTILS)
+extract_kyra$(EXEEXT): extract_kyra.o util.o
 	$(CXX) $(LDFLAGS) -o $@ $+
 
-extract_simon1_amiga$(EXEEXT): extract_simon1_amiga.o
+extract_loom_tg16$(EXEEXT): extract_loom_tg16.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-extract_zak_c64$(EXEEXT): extract_zak_c64.o util.o
+extract_mm_c64$(EXEEXT): extract_mm_c64.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-compress_simon$(EXEEXT): compress_simon.o compress.o util.o
+extract_mm_nes$(EXEEXT): extract_mm_nes.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-compress_sword1$(EXEEXT): compress_sword1.o compress.o util.o
+extract_scumm_mac$(EXEEXT): extract_scumm_mac.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-compress_sword2$(EXEEXT): compress_sword2.o compress.o util.o
+extract_zak_c64$(EXEEXT): extract_zak_c64.o util.o
 	$(CC) $(LDFLAGS) -o $@ $+
 
-compress_kyra$(EXEEXT): compress_kyra.o compress.o util.o
-	$(CXX) $(LDFLAGS) -o $@ $+
 
-
 descumm.o descumm6.o descumm-common.o descumm-tool.o: descumm.h
 
 # Most compress_* tools (except for compress_queen) use compress.h

Modified: tools/trunk/Makefile.mingw
===================================================================
--- tools/trunk/Makefile.mingw	2006-10-19 11:40:26 UTC (rev 24389)
+++ tools/trunk/Makefile.mingw	2006-10-19 11:52:32 UTC (rev 24390)
@@ -14,9 +14,9 @@
 	strip compress_kyra.exe -o $(SCUMMVMPATH)/tools/compress_kyra.exe
 	strip compress_queen.exe -o $(SCUMMVMPATH)/tools/compress_queen.exe
 	strip compress_saga.exe -o $(SCUMMVMPATH)/tools/compress_saga.exe
+	strip compress_scumm_bun.exe -o $(SCUMMVMPATH)/tools/compress_scumm_bun.exe
 	strip compress_scumm_san.exe -o $(SCUMMVMPATH)/tools/compress_scumm_san.exe
 	strip compress_scumm_sou.exe -o $(SCUMMVMPATH)/tools/compress_scumm_sou.exe
-	strip compress_scumm_bun.exe -o $(SCUMMVMPATH)/tools/compress_scumm_bun.exe
 	strip compress_simon.exe -o $(SCUMMVMPATH)/tools/compress_simon.exe
 	strip compress_sword1.exe -o $(SCUMMVMPATH)/tools/compress_sword1.exe
 	strip compress_sword2.exe -o $(SCUMMVMPATH)/tools/compress_sword2.exe
@@ -24,12 +24,12 @@
 	strip descumm.exe -o $(SCUMMVMPATH)/tools/descumm.exe
 	strip desword2.exe -o $(SCUMMVMPATH)/tools/desword2.exe
 	strip encode_dxa.exe -o $(SCUMMVMPATH)/tools/encode_dxa.exe
+	strip extract_agos.exe -o $(SCUMMVMPATH)/tools/extract_agos.exe
 	strip extract_kyra.exe -o $(SCUMMVMPATH)/tools/extract_kyra.exe
 	strip extract_loom_tg16.exe -o $(SCUMMVMPATH)/tools/extract_loom_tg16.exe
 	strip extract_mm_c64.exe -o $(SCUMMVMPATH)/tools/extract_mm_c64.exe
 	strip extract_mm_nes.exe -o $(SCUMMVMPATH)/tools/extract_mm_nes.exe
 	strip extract_scumm_mac.exe -o $(SCUMMVMPATH)/tools/extract_scumm_mac.exe
-	strip extract_simon1_amiga.exe -o $(SCUMMVMPATH)/tools/extract_simon1_amiga.exe
 	strip extract_zak_c64.exe -o $(SCUMMVMPATH)/tools/extract_zak_c64.exe
 	cp COPYING $(SCUMMVMPATH)/tools/COPYING.txt
 	cp README $(SCUMMVMPATH)/tools/README.txt

Modified: tools/trunk/README
===================================================================
--- tools/trunk/README	2006-10-19 11:40:26 UTC (rev 24389)
+++ tools/trunk/README	2006-10-19 11:52:32 UTC (rev 24390)
@@ -7,6 +7,10 @@
 example.
 
 Extraction Tools:
+        extract_agos
+                Extracts the packed files used in the Amiga and AtariST
+                versions of Elvira 1/2, Waxworks and Simon the Sorcerer 1.
+
         extract_kyra
                 Unpacks .PAK files from Kyrandia games.
 
@@ -30,10 +34,6 @@
         extract_mm_nes
                 Extracts data files from the NES version of Maniac Mansion.
 
-        extract_simon1_amiga
-                Extracts the graphics or music files in AGA and ECS
-                versions of Simon the Sorcerer 1 for Amiga.
-
         extract_zak_c64
                 Extracts data files from the Commodore 64 version of Zak
                 McKracken.

Copied: tools/trunk/extract_agos.c (from rev 24389, tools/trunk/extract_simon1_amiga.c)
===================================================================
--- tools/trunk/extract_agos.c	                        (rev 0)
+++ tools/trunk/extract_agos.c	2006-10-19 11:52:32 UTC (rev 24390)
@@ -0,0 +1,140 @@
+/* extract_simon1_amiga - Extracts Simon the Sorcerer 1 Amiga (AGA/ECS) graphics or music files
+ * Copyright (C) 2004-2006  The ScummVM Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+typedef unsigned int ULONG;
+typedef unsigned char UBYTE;
+
+#define EndGetM32(a)  ((((a)[0])<<24)|(((a)[1])<<16)|(((a)[2])<<8)|((a)[3]))
+
+#define SD_GETBIT(var) do { \
+  if (!bits--) { s -= 4; if (s < src) return 0; bb=EndGetM32(s); bits=31; } \
+  (var) = bb & 1; bb >>= 1; \
+} while (0)
+
+#define SD_GETBITS(var, nbits) do { \
+  bc=(nbits); (var)=0; while (bc--) {(var)<<=1; SD_GETBIT(bit); (var)|=bit; } \
+} while (0)
+
+#define SD_TYPE_LITERAL (0)
+#define SD_TYPE_MATCH   (1)
+
+int simon_decr(UBYTE *src, UBYTE *dest, ULONG srclen) {
+  UBYTE *s = &src[srclen - 4];
+  ULONG destlen = EndGetM32(s), bb, x, y;
+  UBYTE *d = &dest[destlen], bc, bit, bits, type;
+
+  /* initialise bit buffer */
+  s -= 4; x = EndGetM32(s); bb = x;
+  bits = 0; do { x >>= 1; bits++; } while (x); bits--;
+
+  while (d > dest) {
+    SD_GETBIT(x);
+    if (x) {
+      SD_GETBITS(x, 2);
+           if (x == 0) { type = SD_TYPE_MATCH;   x = 9;  y = 2;            }
+      else if (x == 1) { type = SD_TYPE_MATCH;   x = 10; y = 3;            }
+      else if (x == 2) { type = SD_TYPE_MATCH;   x = 12; SD_GETBITS(y, 8); }
+      else             { type = SD_TYPE_LITERAL; x = 8;  y = 8;            }
+    }
+    else {
+      SD_GETBIT(x);
+      if (x)           { type = SD_TYPE_MATCH;   x = 8;  y = 1;            }
+      else             { type = SD_TYPE_LITERAL; x = 3;  y = 0;            }
+    }
+
+    if (type == SD_TYPE_LITERAL) {
+      SD_GETBITS(x, x); y += x;
+      if ((y + 1) > (d - dest)) return 0; /* overflow? */
+      do { SD_GETBITS(x, 8); *--d = x; } while (y-- > 0);
+    }
+    else {
+      if ((y + 1) > (d - dest)) return 0; /* overflow? */
+      SD_GETBITS(x, x);
+      if ((d + x) > (dest + destlen)) return 0; /* offset overflow? */
+      do { d--; *d = d[x]; } while (y-- > 0);
+    }
+  }
+  /* successful decrunch */
+  return 1;
+}
+
+ULONG simon_decr_length(UBYTE *src, ULONG srclen) {
+  return EndGetM32(&src[srclen - 4]);
+}
+
+
+/* - loadfile(filename) loads a file from disk, and returns a pointer to that
+ *   loaded file, or returns NULL on failure
+ * - call free() on ptr to free memory
+ * - size of loaded file is available in global var 'filelen'
+ */
+size_t filelen;
+void *loadfile(char *name) {
+  void *mem = NULL; FILE *fd;
+  if ((fd = fopen(name, "rb"))) {
+    if ((fseek(fd, 0, SEEK_END) == 0) && (filelen = ftell(fd))
+    &&  (fseek(fd, 0, SEEK_SET) == 0) && (mem = malloc(filelen))) {
+      if (fread(mem, 1, filelen, fd) < filelen) { free(mem); mem = NULL; }
+    }
+    fclose(fd);
+  }
+  return mem;
+}
+
+/* - savefile(filename, mem, length) saves [length] bytes from [mem] into
+ *   the file named by [filename]
+ * - returns zero if failed, or non-zero if successful
+ */
+int savefile(char *name, void *mem, size_t length) {
+  FILE *fd = fopen(name, "wb");
+  int ok = fd && (fwrite(mem, 1, length, fd) == length);
+  if (fd) fclose(fd);
+  return ok;
+}
+
+char filename[256];
+
+int main(int argc, char *argv[]) {
+  for (argv++; *argv; argv++) {
+    UBYTE *x = (UBYTE *) loadfile(*argv);
+    if (x) {
+      ULONG decrlen = simon_decr_length(x, (ULONG) filelen);
+      UBYTE *out = (UBYTE *) malloc(decrlen);
+      if (out) {
+        if (simon_decr(x, out, filelen)) {
+          strcpy(filename, *argv);
+          strcat(filename, ".out");
+          savefile(filename, out, decrlen);
+        }
+        else {
+          printf("%s: decrunch error\n", filename);
+        }
+        free((void *) x);
+      }
+    }
+  }
+  return 0;
+}

Deleted: tools/trunk/extract_simon1_amiga.c
===================================================================
--- tools/trunk/extract_simon1_amiga.c	2006-10-19 11:40:26 UTC (rev 24389)
+++ tools/trunk/extract_simon1_amiga.c	2006-10-19 11:52:32 UTC (rev 24390)
@@ -1,140 +0,0 @@
-/* extract_simon1_amiga - Extracts Simon the Sorcerer 1 Amiga (AGA/ECS) graphics or music files
- * Copyright (C) 2004-2006  The ScummVM Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-typedef unsigned int ULONG;
-typedef unsigned char UBYTE;
-
-#define EndGetM32(a)  ((((a)[0])<<24)|(((a)[1])<<16)|(((a)[2])<<8)|((a)[3]))
-
-#define SD_GETBIT(var) do { \
-  if (!bits--) { s -= 4; if (s < src) return 0; bb=EndGetM32(s); bits=31; } \
-  (var) = bb & 1; bb >>= 1; \
-} while (0)
-
-#define SD_GETBITS(var, nbits) do { \
-  bc=(nbits); (var)=0; while (bc--) {(var)<<=1; SD_GETBIT(bit); (var)|=bit; } \
-} while (0)
-
-#define SD_TYPE_LITERAL (0)
-#define SD_TYPE_MATCH   (1)
-
-int simon_decr(UBYTE *src, UBYTE *dest, ULONG srclen) {
-  UBYTE *s = &src[srclen - 4];
-  ULONG destlen = EndGetM32(s), bb, x, y;
-  UBYTE *d = &dest[destlen], bc, bit, bits, type;
-
-  /* initialise bit buffer */
-  s -= 4; x = EndGetM32(s); bb = x;
-  bits = 0; do { x >>= 1; bits++; } while (x); bits--;
-
-  while (d > dest) {
-    SD_GETBIT(x);
-    if (x) {
-      SD_GETBITS(x, 2);
-           if (x == 0) { type = SD_TYPE_MATCH;   x = 9;  y = 2;            }
-      else if (x == 1) { type = SD_TYPE_MATCH;   x = 10; y = 3;            }
-      else if (x == 2) { type = SD_TYPE_MATCH;   x = 12; SD_GETBITS(y, 8); }
-      else             { type = SD_TYPE_LITERAL; x = 8;  y = 8;            }
-    }
-    else {
-      SD_GETBIT(x);
-      if (x)           { type = SD_TYPE_MATCH;   x = 8;  y = 1;            }
-      else             { type = SD_TYPE_LITERAL; x = 3;  y = 0;            }
-    }
-
-    if (type == SD_TYPE_LITERAL) {
-      SD_GETBITS(x, x); y += x;
-      if ((y + 1) > (d - dest)) return 0; /* overflow? */
-      do { SD_GETBITS(x, 8); *--d = x; } while (y-- > 0);
-    }
-    else {
-      if ((y + 1) > (d - dest)) return 0; /* overflow? */
-      SD_GETBITS(x, x);
-      if ((d + x) > (dest + destlen)) return 0; /* offset overflow? */
-      do { d--; *d = d[x]; } while (y-- > 0);
-    }
-  }
-  /* successful decrunch */
-  return 1;
-}
-
-ULONG simon_decr_length(UBYTE *src, ULONG srclen) {
-  return EndGetM32(&src[srclen - 4]);
-}
-
-
-/* - loadfile(filename) loads a file from disk, and returns a pointer to that
- *   loaded file, or returns NULL on failure
- * - call free() on ptr to free memory
- * - size of loaded file is available in global var 'filelen'
- */
-size_t filelen;
-void *loadfile(char *name) {
-  void *mem = NULL; FILE *fd;
-  if ((fd = fopen(name, "rb"))) {
-    if ((fseek(fd, 0, SEEK_END) == 0) && (filelen = ftell(fd))
-    &&  (fseek(fd, 0, SEEK_SET) == 0) && (mem = malloc(filelen))) {
-      if (fread(mem, 1, filelen, fd) < filelen) { free(mem); mem = NULL; }
-    }
-    fclose(fd);
-  }
-  return mem;
-}
-
-/* - savefile(filename, mem, length) saves [length] bytes from [mem] into
- *   the file named by [filename]
- * - returns zero if failed, or non-zero if successful
- */
-int savefile(char *name, void *mem, size_t length) {
-  FILE *fd = fopen(name, "wb");
-  int ok = fd && (fwrite(mem, 1, length, fd) == length);
-  if (fd) fclose(fd);
-  return ok;
-}
-
-char filename[256];
-
-int main(int argc, char *argv[]) {
-  for (argv++; *argv; argv++) {
-    UBYTE *x = (UBYTE *) loadfile(*argv);
-    if (x) {
-      ULONG decrlen = simon_decr_length(x, (ULONG) filelen);
-      UBYTE *out = (UBYTE *) malloc(decrlen);
-      if (out) {
-        if (simon_decr(x, out, filelen)) {
-          strcpy(filename, *argv);
-          strcat(filename, ".out");
-          savefile(filename, out, decrlen);
-        }
-        else {
-          printf("%s: decrunch error\n", filename);
-        }
-        free((void *) x);
-      }
-    }
-  }
-  return 0;
-}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list