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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Feb 18 12:28:48 CET 2009


Revision: 38470
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38470&view=rev
Author:   thebluegr
Date:     2009-02-18 11:28:48 +0000 (Wed, 18 Feb 2009)

Log Message:
-----------
Add the rest of the removed tools

Added Paths:
-----------
    tools/trunk/sci/engine/
    tools/trunk/sci/engine/cfsml.pl
    tools/trunk/sci/scicore/
    tools/trunk/sci/scicore/huffmake.pl
    tools/trunk/sci/scicore/hufftree.1
    tools/trunk/sci/scicore/hufftree.2
    tools/trunk/sci/scicore/hufftree.3
    tools/trunk/sci/sfx/
    tools/trunk/sci/sfx/doc/
    tools/trunk/sci/sfx/doc/README
    tools/trunk/sci/sfx/doc/patch001.txt
    tools/trunk/sci/sfx/doc/sound01.txt
    tools/trunk/sci/sfx/lists/
    tools/trunk/sci/sfx/lists/GM.txt
    tools/trunk/sci/sfx/lists/gm_patches.c
    tools/trunk/sci/sfx/lists/mt32_timbres.c
    tools/trunk/sci/sfx/mt32_GM_mapping/
    tools/trunk/sci/sfx/mt32_GM_mapping/Makefile
    tools/trunk/sci/sfx/mt32_GM_mapping/README
    tools/trunk/sci/sfx/mt32_GM_mapping/gm_patches.c
    tools/trunk/sci/sfx/mt32_GM_mapping/lb2map.txt
    tools/trunk/sci/sfx/mt32_GM_mapping/main.c
    tools/trunk/sci/sfx/mt32_GM_mapping/mt32_timbres.c
    tools/trunk/sci/sfx/mt32_GM_mapping/pq1map.txt
    tools/trunk/sci/sfx/mt32_GM_mapping/qfg1map.txt
    tools/trunk/sci/sfx/tests/
    tools/trunk/sci/sfx/tests/stubs.c
    tools/trunk/sci/sfx/tests/tests.cpp
    tools/trunk/sci/sfx/tests/tests.vcproj

Added: tools/trunk/sci/engine/cfsml.pl
===================================================================
--- tools/trunk/sci/engine/cfsml.pl	                        (rev 0)
+++ tools/trunk/sci/engine/cfsml.pl	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,1182 @@
+#! /usr/bin/env perl
+# The C File Storage Meta Language "reference" implementation
+# This implementation is supposed to conform to version
+$version = "0.8.2";
+# of the spec. Please contact the maintainer if it doesn't.
+#
+# cfsml.pl Copyright (C) 1999, 2000, 2001 Christoph Reichenbach
+#
+#
+# This program may be modified and copied freely according to the terms of
+# the GNU general public license (GPL), as long as the above copyright
+# notice and the licensing information contained herein are preserved.
+#
+# Please refer to www.gnu.org for licensing details.
+#
+# This work is provided AS IS, without warranty of any kind, expressed or
+# implied, including but not limited to the warranties of merchantibility,
+# noninfringement, and fitness for a specific purpose. The author will not
+# be held liable for any damage caused by this work or derivatives of it.
+#
+# By using this source code, you agree to the licensing terms as stated
+# above.
+#
+#
+# Please contact the maintainer for bug reports or inquiries.
+#
+# Current Maintainer:
+#
+#    Christoph Reichenbach (CJR) [jameson at linuxgames.com]
+#
+#
+# Warning: This is still a "bit" messy. Sorry for that.
+#
+
+#$debug = 1;
+
+$write_lines = "true";
+$source_file = "CFSML source file";
+$type_integer = "integer";
+$type_string = "string";
+$type_record = "RECORD";
+$type_pointer = "POINTER";
+$type_abspointer = "ABSPOINTER";
+
+%types;      # Contains all type bindings
+%records;    # Contains all record bindings
+
+$mode = undef;
+while ($op = shift @ARGV) {
+    if ($mode eq undef) {
+	if ($op eq "-f") {
+	    $mode = "fname";
+	} elsif ($op eq "-l") {
+	    $write_lines = undef;
+	} elsif ($op eq "-v") {
+	    print "cfsml.pl, the CFSML code generator, version $version\n";
+	    print "This program is provided WITHOUT WARRANTY of any kind. It may be\n";
+	    print "copied and modified freely according to the terms of the GNU\n";
+	    print "General Public License.\n";
+	    exit(0);
+	} elsif ($op eq "-h") {
+	    print "CFSML help:\n";
+	    print "Usage: cat source | cfsml.pl [-v] [-h] [-l] [-f <filename>] > dest\n";
+	    print "  -h : help\n";
+	    print "  -v : print version\n";
+	    print "  -l : disable line number printing in dest file\n";
+	    print "  -f : specify file name for line number printing\n";
+	    exit(0);
+	} else {
+	    die "Unknown option '$op'\n";
+	}
+    } elsif ($mode eq "fname") {
+	$source_file = $op;
+	$mode = 0;
+    } else {
+	die "Invalid internal state '$mode'\n";
+    }
+}
+
+sub write_line_pp
+# write_line_pp(int line_nr, bool input_file?)
+{
+    my $line_nr = shift;
+    my $_file = shift;
+    my $filename = "cfsml.pl";
+
+    if (_file) {
+	$filename = $source_file;
+    }
+
+    if ($write_lines) {
+	print "#line $line_nr \"$filename\"\n";
+    }
+}
+
+sub create_string_functions
+  {
+    $firstline = __LINE__;
+    $firstline += 4;
+    write_line_pp($firstline, 0);
+    print <<'EOF';
+
+#include <stdarg.h> /* We need va_lists */
+#include <sci_memory.h>
+
+#ifdef CFSML_DEBUG_MALLOC
+/*
+#define free(p)        dbg_sci_free(p)
+#define malloc(s)      dbg_sci_malloc(s)
+#define calloc(n, s)   dbg_sci_calloc(n, s)
+#define realloc(p, s)  dbg_sci_realloc(p, s)
+*/
+#define free        dbg_sci_free
+#define malloc      dbg_sci_malloc
+#define calloc      dbg_sci_calloc
+#define realloc     dbg_sci_realloc
+#endif
+
+static void
+_cfsml_error(char *fmt, ...)
+{
+  va_list argp;
+
+  fprintf(stderr, "Error: ");
+  va_start(argp, fmt);
+  vfprintf(stderr, fmt, argp);
+  va_end(argp);
+
+}
+
+
+static struct _cfsml_pointer_refstruct {
+    struct _cfsml_pointer_refstruct *next;
+    void *ptr;
+} *_cfsml_pointer_references = NULL;
+
+static struct _cfsml_pointer_refstruct **_cfsml_pointer_references_current = &_cfsml_pointer_references;
+
+static char *_cfsml_last_value_retreived = NULL;
+static char *_cfsml_last_identifier_retreived = NULL;
+
+static void
+_cfsml_free_pointer_references_recursively(struct _cfsml_pointer_refstruct *refs, int free_pointers)
+{
+    if (!refs)
+	return;
+    #ifdef CFSML_DEBUG_MALLOC
+    SCI_MEMTEST;
+    #endif
+
+    _cfsml_free_pointer_references_recursively(refs->next, free_pointers);
+    #ifdef CFSML_DEBUG_MALLOC
+    SCI_MEMTEST;
+
+    fprintf(stderr,"Freeing ptrref %p [%p] %s\n", refs->ptr, refs, free_pointers?
+	    "ALL": "cleanup only");
+    #endif
+
+    if (free_pointers)
+	free(refs->ptr);
+
+    #ifdef CFSML_DEBUG_MALLOC
+    SCI_MEMTEST;
+    #endif
+    free(refs);
+    #ifdef CFSML_DEBUG_MALLOC
+    SCI_MEMTEST;
+    #endif
+}
+
+static void
+_cfsml_free_pointer_references(struct _cfsml_pointer_refstruct **meta_ref, int free_pointers)
+{
+    _cfsml_free_pointer_references_recursively(*meta_ref, free_pointers);
+    *meta_ref = NULL;
+    _cfsml_pointer_references_current = meta_ref;
+}
+
+static struct _cfsml_pointer_refstruct **
+_cfsml_get_current_refpointer()
+{
+    return _cfsml_pointer_references_current;
+}
+
+static void _cfsml_register_pointer(void *ptr)
+{
+    struct _cfsml_pointer_refstruct *newref = (struct _cfsml_pointer_refstruct*)sci_malloc(sizeof (struct _cfsml_pointer_refstruct));
+    #ifdef CFSML_DEBUG_MALLOC
+    SCI_MEMTEST;
+    fprintf(stderr,"Registering ptrref %p [%p]\n", ptr, newref);
+    #endif
+    newref->next = *_cfsml_pointer_references_current;
+    newref->ptr = ptr;
+    *_cfsml_pointer_references_current = newref;
+}
+
+
+static char *
+_cfsml_mangle_string(char *s)
+{
+  char *source = s;
+  char c;
+  char *target = (char *) sci_malloc(1 + strlen(s) * 2); /* We will probably need less than that */
+  char *writer = target;
+
+  while ((c = *source++)) {
+
+    if (c < 32) { /* Special character? */
+      *writer++ = '\\'; /* Escape... */
+      c += ('a' - 1);
+    } else if (c == '\\' || c == '"')
+      *writer++ = '\\'; /* Escape, but do not change */
+    *writer++ = c;
+
+  }
+  *writer = 0; /* Terminate string */
+
+  return (char *) sci_realloc(target, strlen(target) + 1);
+}
+
+
+static char *
+_cfsml_unmangle_string(char *s)
+{
+  char *target = (char *) sci_malloc(1 + strlen(s));
+  char *writer = target;
+  char *source = s;
+  char c;
+
+  while ((c = *source++) && (c > 31)) {
+    if (c == '\\') { /* Escaped character? */
+      c = *source++;
+      if ((c != '\\') && (c != '"')) /* Un-escape 0-31 only */
+	c -= ('a' - 1);
+    }
+    *writer++ = c;
+  }
+  *writer = 0; /* Terminate string */
+
+  return (char *) sci_realloc(target, strlen(target) + 1);
+}
+
+
+static char *
+_cfsml_get_identifier(FILE *fd, int *line, int *hiteof, int *assignment)
+{
+  int c;
+  int mem = 32;
+  int pos = 0;
+  int done = 0;
+  char *retval = (char *) sci_malloc(mem);
+
+  if (_cfsml_last_identifier_retreived) {
+      free(_cfsml_last_identifier_retreived);
+      _cfsml_last_identifier_retreived = NULL;
+  }
+
+  while (isspace(c = fgetc(fd)) && (c != EOF));
+  if (c == EOF) {
+    _cfsml_error("Unexpected end of file at line %d\n", *line);
+    free(retval);
+    *hiteof = 1;
+    return NULL;
+  }
+
+  ungetc(c, fd);
+
+  while (((c = fgetc(fd)) != EOF) && ((pos == 0) || (c != '\n')) && (c != '=')) {
+
+     if (pos == mem - 1) /* Need more memory? */
+       retval = (char *) sci_realloc(retval, mem *= 2);
+
+     if (!isspace(c)) {
+        if (done) {
+           _cfsml_error("Single word identifier expected at line %d\n", *line);
+           free(retval);
+           return NULL;
+        }
+        retval[pos++] = c;
+     } else
+        if (pos != 0)
+           done = 1; /* Finished the variable name */
+        else if (c == '\n')
+           ++(*line);
+  }
+
+  if (c == EOF) {
+    _cfsml_error("Unexpected end of file at line %d\n", *line);
+    free(retval);
+    *hiteof = 1;
+    return NULL;
+  }
+
+  if (c == '\n') {
+    ++(*line);
+    if (assignment)
+      *assignment = 0;
+  } else
+    if (assignment)
+      *assignment = 1;
+
+  if (pos == 0) {
+    _cfsml_error("Missing identifier in assignment at line %d\n", *line);
+    free(retval);
+    return NULL;
+  }
+
+  if (pos == mem - 1) /* Need more memory? */
+     retval = (char *) sci_realloc(retval, mem += 1);
+
+  retval[pos] = 0; /* Terminate string */
+EOF
+
+if ($debug) {
+    print "  printf(\"identifier is '%s'\\n\", retval);\n";
+}
+
+  $firstline = __LINE__;
+  $firstline += 4;
+  write_line_pp($firstline, 0);
+  print <<'EOF2';
+
+  return _cfsml_last_identifier_retreived = retval;
+}
+
+
+static char *
+_cfsml_get_value(FILE *fd, int *line, int *hiteof)
+{
+  int c;
+  int mem = 64;
+  int pos = 0;
+  char *retval = (char *) sci_malloc(mem);
+
+  if (_cfsml_last_value_retreived) {
+      free(_cfsml_last_value_retreived);
+      _cfsml_last_value_retreived = NULL;
+  }
+
+  while (((c = fgetc(fd)) != EOF) && (c != '\n')) {
+
+     if (pos == mem - 1) /* Need more memory? */
+       retval = (char *) sci_realloc(retval, mem *= 2);
+
+     if (pos || (!isspace(c)))
+        retval[pos++] = c;
+
+  }
+
+  while ((pos > 0) && (isspace(retval[pos - 1])))
+     --pos; /* Strip trailing whitespace */
+
+  if (c == EOF)
+    *hiteof = 1;
+
+  if (pos == 0) {
+    _cfsml_error("Missing value in assignment at line %d\n", *line);
+    free(retval);
+    return NULL;
+  }
+
+  if (c == '\n')
+     ++(*line);
+
+  if (pos == mem - 1) /* Need more memory? */
+    retval = (char *) sci_realloc(retval, mem += 1);
+
+  retval[pos] = 0; /* Terminate string */
+EOF2
+
+    if ($debug) {
+	print "  printf(\"value is '%s'\\n\", retval);\n";
+    }
+
+    $firstline = __LINE__;
+    $firstline += 4;
+    write_line_pp($firstline, 0);
+  print <<'EOF3';
+  return (_cfsml_last_value_retreived = (char *) sci_realloc(retval, strlen(retval) + 1));
+  /* Re-allocate; this value might be used for quite some while (if we are
+  ** restoring a string)
+  */
+}
+EOF3
+  }
+
+
+# Call with $expression as a simple expression, like "tos + 1".
+# Returns (in this case) ("tos", "-1").
+sub lvaluize
+  {
+    my @retval;
+#    print "//DEBUG: $expression [";
+    my @tokens = split (/([+-\/\*])/, $expression);
+#    print join(",", @tokens);
+    $retval[0] = $tokens[0];
+
+    my $rightvalue = "";
+    for ($i = 1; $tokens[$i]; $i++) {
+
+      if ($tokens[$i] eq "+") {
+	$rightvalue .= "-";
+      } elsif ($tokens[$i] eq "-") {
+	$rightvalue .= "+";
+      } elsif ($tokens[$i] eq "/") {
+	$rightvalue .= "*";
+      } elsif ($tokens[$i] eq "*") {
+	$rightvalue .= "/";
+      } else {
+	$rightvalue .= $tokens[$i];
+      }
+    }
+
+    $retval[1] = $rightvalue;
+
+#   print "] => ($retval[0];$retval[1])\n";
+
+    return @retval;
+  }
+
+
+
+sub create_declaration
+  {
+    $typename = $type;
+    $ctype = $types{$type}->{'ctype'};
+
+    if (not $types{$type}->{'external'}) {
+      $types{$type}{'writer'} = "_cfsml_write_" . $typename;
+      $types{$type}{'reader'} = "_cfsml_read_" . $typename;
+      write_line_pp(__LINE__, 0);
+      print "static void\n$types{$type}{'writer'}(FILE *fh, $ctype* save_struc);\n";
+      print "static int\n$types{$type}{'reader'}(FILE *fh, $ctype* save_struc, char *lastval,".
+	" int *line, int *hiteof);\n\n";
+    };
+
+  }
+
+sub create_writer
+  {
+    $typename = $type;
+    $ctype = $types{$type}{'ctype'};
+
+    write_line_pp(__LINE__, 0);
+    print "static void\n_cfsml_write_$typename(FILE *fh, $ctype* save_struc)\n{\n";
+    if ($types{$type}{'type'} eq $type_record) {
+        print "  int min, max, i;\n\n";
+    }
+
+    if ($types{$type}{'type'} eq $type_integer) {
+      print "  fprintf(fh, \"%li\", (long) *save_struc);\n";
+    }
+    elsif ($types{$type}{'type'} eq $type_string) {
+	write_line_pp(__LINE__, 0);
+	print "  if (!(*save_struc))\n";
+	print "    fprintf(fh, \"\\\\null\\\\\");\n";
+	print "  else {\n";
+	print "    char *token = _cfsml_mangle_string((char *) *save_struc);\n";
+	print "    fprintf(fh, \"\\\"%s\\\"\", token);\n";
+	print "    free(token);\n";
+	print "  }\n";
+    }
+    elsif ($types{$type}{'type'} eq $type_record) {
+	write_line_pp(__LINE__, 0);
+	print "  fprintf(fh, \"{\\n\");\n";
+
+	for $n (@{$records{$type}}) {
+
+	    print "  fprintf(fh, \"$n->{'name'} = \");\n";
+
+	    if ($n->{'array'}) { # Check for arrays
+
+		if ($n->{'array'} eq 'static' or $n->{'size'} * 2) { # fixed integer value?
+		    print "    min = max = $n->{'size'};\n";
+		}
+		else { # No, a variable
+		    print "    min = max = save_struc->$n->{'size'};\n";
+		}
+
+		if ($n->{'maxwrite'}) { # A write limit?
+		    print "    if (save_struc->$n->{'maxwrite'} < min)\n";
+		    print "       min = save_struc->$n->{'maxwrite'};\n";
+		}
+
+		if ($n->{'array'} eq 'dynamic') {
+		    print "    if (!save_struc->$n->{'name'})\n";
+		    print "       min = max = 0; /* Don't write if it points to NULL */\n";
+		}
+
+		write_line_pp(__LINE__, 0);
+		print "    fprintf(fh, \"[%d][\\n\", max);\n";
+		print "    for (i = 0; i < min; i++) {\n";
+		print "      $types{$n->{'type'}}{'writer'}";
+		my $subscribstr = "[i]"; # To avoid perl interpolation problems
+		print "(fh, &(save_struc->$n->{'name'}$subscribstr));\n";
+		print "      fprintf(fh, \"\\n\");\n";
+		print "    }\n";
+		print "    fprintf(fh, \"]\");\n";
+
+	} elsif ($n->{'type'} eq $type_pointer) { # Relative pointer
+
+	  print "    fprintf(fh, \"%d\", save_struc->$n->{'name'} - save_struc->$n->{'anchor'});" .
+	    " /* Relative pointer */\n";
+
+      } elsif ($n->{'type'} eq $type_abspointer) { # Absolute pointer
+
+	  print "    if (!save_struc->$n->{'name'})\n";
+	  print "      fprintf(fh, \"\\\\null\\\\\");\n";
+	  print "    else \n";
+	  print "      $types{$n->{'reftype'}}{'writer'}";
+	  print "(fh, save_struc->$n->{'name'});\n";
+
+	} else { # Normal record entry
+
+	  print "    $types{$n->{'type'}}{'writer'}";
+	  print "(fh, ($types{$n->{'type'}}{'ctype'}*) &(save_struc->$n->{'name'}));\n";
+
+	}
+
+	print "    fprintf(fh, \"\\n\");\n";
+      }
+
+      print "  fprintf(fh, \"}\");\n";
+    }
+    else {
+      print STDERR "Warning: Attempt to create_writer for invalid type '$types{$type}{'type'}'\n";
+    }
+    print "}\n\n";
+
+  }
+
+
+sub create_reader
+  {
+    $typename = $type;
+    $ctype = $types{$type}{'ctype'};
+
+    write_line_pp(__LINE__, 0);
+    print "static int\n_cfsml_read_$typename";
+    print "(FILE *fh, $ctype* save_struc, char *lastval, int *line, int *hiteof)\n{\n";
+
+    print "  char *token;\n";
+    if ($types{$type}{'type'} eq $type_record) {
+      print "int min, max, i;\n";
+    }
+    my $reladdress_nr = 0; # Number of relative addresses needed
+    my $reladdress = 0; # Current relative address number
+    my $reladdress_resolver = ""; # Relative addresses are resolved after the main while block
+
+    if ($types{$type}{'type'} eq $type_record) {
+
+      foreach $n (@{$records{$type}}) { # Count relative addresses we need
+	if ($n->{'type'} eq $type_pointer) {
+	  ++$reladdress_nr;
+	}
+      }
+
+      if ($reladdress_nr) { # Allocate stack space for all relative addresses needed
+	print "  int reladdresses[$reladdress_nr] = {0};\n";
+      }
+    }
+
+    if ($types{$type}{'type'} eq $type_integer) {
+	write_line_pp(__LINE__, 0);
+	print "\n  *save_struc = strtol(lastval, &token, 0);\n";
+	print "  if ( (*save_struc == 0) && (token == lastval) ) {\n";
+	print "     _cfsml_error(\"strtol failed at line %d\\n\", *line);\n";
+	print "     return CFSML_FAILURE;\n";
+	print "  }\n";
+	print "  if (*token != 0) {\n";
+	print "     _cfsml_error(\"Non-integer encountered while parsing int value at line %d\\n\",";
+	print " *line);\n";
+	print "     return CFSML_FAILURE;\n";
+	print "  }\n";
+	print "  return CFSML_SUCCESS;\n";
+    } elsif ($types{$type}{'type'} eq $type_string) {
+	write_line_pp(__LINE__, 0);
+	print "\n";
+	print "  if (strcmp(lastval, \"\\\\null\\\\\")) { /* null pointer? */\n";
+	print "    if (*lastval == '\"') { /* Quoted string? */\n";
+	print "      int seeker = strlen(lastval);\n\n";
+	print "      while (lastval[seeker] != '\"')\n";
+	print "        --seeker;\n\n";
+	print "      if (!seeker) { /* No matching double-quotes? */\n";
+	print "        _cfsml_error(\"Unbalanced quotes at line %d\\n\", *line);\n";
+	print "        return CFSML_FAILURE;\n";
+	print "      }\n\n";
+	print "      lastval[seeker] = 0; /* Terminate string at closing quotes... */\n";
+	print "      lastval++; /* ...and skip the opening quotes locally */\n";
+	print "    }\n";
+	print "    *save_struc = _cfsml_unmangle_string(lastval);\n";
+	print "    _cfsml_register_pointer(*save_struc);\n";
+	print "    return CFSML_SUCCESS;\n";
+	print "  } else {\n";
+	print "    *save_struc = NULL;\n";
+	print "    return CFSML_SUCCESS;\n";
+	print "  }\n";
+    } elsif ($types{$type}{'type'} eq $type_record) {
+	write_line_pp(__LINE__, 0);
+	print "  int assignment, closed, done;\n\n";
+	print "  if (strcmp(lastval, \"{\")) {\n";
+	print "     _cfsml_error(\"Reading record $type; expected opening braces in line %d, got \\\"%s\\\"\\n\",";
+	print "*line, lastval);\n";
+	print "     return CFSML_FAILURE;\n";
+	print "  };\n";
+	print "  closed = 0;\n";
+	print "  do {\n";
+	print "    char *value;\n";
+	print "    token = _cfsml_get_identifier(fh, line, hiteof, &assignment);\n\n";
+	print "    if (!token) {\n";
+	print "       _cfsml_error(\"Expected token at line %d\\n\", *line);\n";
+	print "       return CFSML_FAILURE;\n";
+	print "    }\n";
+	print "    if (!assignment) {\n";
+	print "      if (!strcmp(token, \"}\")) \n";
+	print "         closed = 1;\n";
+	print "      else {\n";
+	print "        _cfsml_error(\"Expected assignment or closing braces in line %d\\n\", *line);\n";
+	print "        return CFSML_FAILURE;\n";
+	print "      }\n";
+	print "    } else {\n";
+	print "      value = \"\";\n";
+	print "      while (!value || !strcmp(value, \"\"))\n";
+	print "        value = _cfsml_get_value(fh, line, hiteof);\n";
+	print "      if (!value) {\n";
+	print "        _cfsml_error(\"Expected token at line %d\\n\", *line);\n";
+	print "        return CFSML_FAILURE;\n";
+	print "      }\n";
+#	print "    }\n";
+
+
+      foreach $n (@{$records{$type}}) { # Now take care of all record elements
+
+	my $type = $n->{'type'};
+	my $reference = undef;
+	if ($type eq $type_abspointer) {
+	    $reference = 1;
+	    $type = $n->{'reftype'};
+	}
+	my $name = $n->{'name'};
+	my $reader = $types{$type}{'reader'};
+	my $size = $n->{'size'};
+
+	print "      if (!strcmp(token, \"$name\")) {\n";
+
+	if ($type eq $type_pointer) { # A relative pointer
+
+	  $reader = $types{'int'}{'reader'}; # Read relpointer as int
+
+	  write_line_pp(__LINE__, 0);
+	  print "         if ($reader(fh, &(reladdresses[$reladdress]), value, line, hiteof)) {\n";
+	  print "            _cfsml_error(\"Expected token at line %d\\n\", *line);\n";
+	  print "            return CFSML_FAILURE;\n";
+	  print "         }\n";
+
+	  # Make sure that the resulting variable is interpreted correctly
+	  $reladdress_resolver .= "  save_struc->$n->{'name'} =".
+	    " save_struc->$n->{'anchor'} + reladdresses[$reladdress];\n";
+
+	  ++$reladdress; # Prepare reladdress for next element
+
+	} elsif ($n->{'array'}) { # Is it an array?
+	    write_line_pp(__LINE__, 0);
+	    print "         if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) {\n";
+	    # The value must end with [, since we're starting array data, and it must also
+	    # begin with [, since this is either the only character in the line, or it starts
+	    # the "amount of memory to allocate" block
+	    print "            _cfsml_error(\"Opening brackets expected at line %d\\n\", *line);\n";
+	    print "            return CFSML_FAILURE;\n";
+	    print "         }\n";
+
+	  if ($n->{'array'} eq 'dynamic') {
+	      write_line_pp(__LINE__, 0);
+	    # We need to allocate the array first
+	    print "         /* Prepare to restore dynamic array */\n";
+	    # Read amount of memory to allocate
+	    print "         max = strtol(value + 1, NULL, 0);\n";
+	    print "         if (max < 0) {\n";
+	    print "            _cfsml_error(\"Invalid number of elements to allocate for dynamic ";
+	    print "array '%s' at line %d\\n\", token, *line);\n";
+	    print "            return CFSML_FAILURE;\n";
+	    print "         }\n\n";
+
+	    print "         if (max) {\n";
+	    print "           save_struc->$name = ($n->{'type'} *) sci_malloc(max * sizeof($type));\n";
+	    print "#ifdef SATISFY_PURIFY\n";
+            print "           memset(save_struc->$name, 0, max * sizeof($type));\n";
+	    print "#endif\n";
+	    print "           _cfsml_register_pointer(save_struc->$name);\n";
+	    print "         }\n";
+	    print "         else\n";
+	    print "           save_struc->$name = NULL;\n"
+
+	    } else { # static array
+		print "         /* Prepare to restore static array */\n";
+		print "         max = $size;\n";
+	    }
+
+	    write_line_pp(__LINE__, 0);
+	    print "         done = i = 0;\n";
+	    print "         do {\n";
+	    if ($type eq $type_record) {
+		print "           if (!(value = _cfsml_get_value(fh, line, hiteof))) {\n";
+	    } else {
+		print "           if (!(value = _cfsml_get_identifier(fh, line, hiteof, NULL))) {\n";
+	    }
+	    write_line_pp(__LINE__, 0);
+	    
+	    print "              _cfsml_error(\"Token expected at line %d\\n\", *line);\n";
+	    print "              return 1;\n";
+	    print "           }\n";
+	    print "           if (strcmp(value, \"]\")) {\n";
+	    print "             if (i == max) {\n";
+	    print "               _cfsml_error(\"More elements than space available (%d) in '%s' at ";
+	    print "line %d\\n\", max, token, *line);\n";
+	    print "               return CFSML_FAILURE;\n";
+	    print "             }\n";
+	    my $helper = "[i++]";
+	    print "             if ($reader(fh, &(save_struc->$name$helper), value, line, hiteof)) {\n";
+	    print "                _cfsml_error(\"Token expected by $reader() for $name$helper at line %d\\n\", *line);\n";
+	    print "                return CFSML_FAILURE;\n";
+	    print "             }\n";
+	    print "           } else done = 1;\n";
+	    print "         } while (!done);\n";
+
+	    if ($n->{'array'} eq "dynamic") {
+		my @xpr = lvaluize($expression = $n->{'size'});
+		print "         save_struc->$xpr[0] = max $xpr[1]; /* Set array size accordingly */\n";
+	    }
+
+	    if ($n->{'maxwrite'}) {
+		my @xpr = lvaluize($expression = $n->{'maxwrite'});
+		print "         save_struc->$xpr[0] = i $xpr[1]; /* Set number of elements */\n";
+	    }
+
+	}
+	elsif ($reference) {
+	    write_line_pp(__LINE__, 0);
+	    print "        if (strcmp(value, \"\\\\null\\\\\")) { /* null pointer? */\n";
+	    print "           save_struc->$name = sci_malloc(sizeof ($type));\n";
+	    print "           _cfsml_register_pointer(save_struc->$name);\n";
+	    print "           if ($reader(fh, save_struc->$name, value, line, hiteof)) {\n";
+	    print "              _cfsml_error(\"Token expected by $reader() for $name at line %d\\n\", *line);\n";
+	    print "              return CFSML_FAILURE;\n";
+	    print "           }\n";
+	    print "        } else save_struc->$name = NULL;\n";
+	}
+	else { # It's a simple variable or a struct
+	    write_line_pp(__LINE__, 0);
+	    print "         if ($reader(fh, ($types{$type}{'ctype'}*) &(save_struc->$name), value, line, hiteof)) {\n";
+	    print "            _cfsml_error(\"Token expected by $reader() for $name at line %d\\n\", *line);\n";
+	    print "            return CFSML_FAILURE;\n";
+	    print "         }\n";
+	}
+	print "      } else\n";
+
+      }
+	write_line_pp(__LINE__, 0);
+	print "       {\n";
+	print "          _cfsml_error(\"$type: Assignment to invalid identifier '%s' in line %d\\n\",";
+	print " token, *line);\n";
+	print "          return CFSML_FAILURE;\n";
+	print "       }\n";
+	print "     }\n";
+
+      print "  } while (!closed); /* Until closing braces are hit */\n";
+
+      print $reladdress_resolver; # Resolves any relative addresses
+
+      print "  return CFSML_SUCCESS;\n";
+    } else {
+      print STDERR "Warning: Attempt to create_reader for invalid type '$types{$type}{'type'}'\n";
+    }
+
+    print "}\n\n";
+  }
+
+# Built-in types
+
+%types = (
+	  'int' => {
+		    'type' => $type_integer,
+		    'ctype' => "int",
+		   },
+
+	  'string' => {
+		       'type' => $type_string,
+		       'ctype' => "char *",
+		      },
+	 );
+
+
+
+sub create_function_block {
+  print "\n/* Auto-generated CFSML declaration and function block */\n\n";
+  write_line_pp(__LINE__, 0);
+  print "#define CFSML_SUCCESS 0\n";
+  print "#define CFSML_FAILURE 1\n\n";
+  create_string_functions;
+
+  foreach $n ( keys %types ) {
+    create_declaration($type = $n);
+  }
+
+  foreach $n ( keys %types ) {
+    if (not $types{$n}->{'external'}) {
+      create_writer($type = $n);
+      create_reader($type = $n);
+    }
+  }
+  print "\n/* Auto-generated CFSML declaration and function block ends here */\n";
+  print "/* Auto-generation performed by cfsml.pl $version */\n";
+}
+
+
+# Gnerates code to read a data type
+# Parameters: $type: Type to read
+#             $datap: Pointer to the write destination
+#             $fh: Existing filehandle of an open file to use
+#             $eofvar: Variable to store _cfsml_eof into
+sub insert_reader_code {
+  print "/* Auto-generated CFSML data reader code */\n";
+  write_line_pp(__LINE__, 0);
+  print "  {\n";
+  if (!$linecounter) {
+      write_line_pp(__LINE__, 0);
+      print "    int _cfsml_line_ctr = 0;\n";
+      $linecounter = '_cfsml_line_ctr';
+  }
+  if ($atomic) {
+      write_line_pp(__LINE__, 0);
+      print "    struct _cfsml_pointer_refstruct **_cfsml_myptrrefptr = _cfsml_get_current_refpointer();\n";
+  }
+  write_line_pp(__LINE__, 0);
+  print "    int _cfsml_eof = 0, _cfsml_error;\n";
+  print "    int dummy;\n";
+
+  if ($firsttoken) {
+      write_line_pp(__LINE__, 0);
+      print "    char *_cfsml_inp = $firsttoken;\n";
+  } else {
+      write_line_pp(__LINE__, 0);
+      print "    char *_cfsml_inp =".
+	  " _cfsml_get_identifier($fh, &($linecounter), &_cfsml_eof, &dummy);\n\n";
+  }
+
+  write_line_pp(__LINE__, 0);
+  print "    _cfsml_error =".
+      " $types{$type}{'reader'}($fh, $datap, _cfsml_inp, &($linecounter), &_cfsml_eof);\n";
+
+  if ($eofvar) {
+      write_line_pp(__LINE__, 0);
+      print "    $eofvar = _cfsml_error;\n";
+  }
+  if ($atomic) {
+      write_line_pp(__LINE__, 0);
+      print "     _cfsml_free_pointer_references(_cfsml_myptrrefptr, _cfsml_error);\n";
+  }
+  write_line_pp(__LINE__, 0);
+  print "     if (_cfsml_last_value_retreived) {\n";
+  print "       free(_cfsml_last_value_retreived);\n";
+  print "       _cfsml_last_value_retreived = NULL;\n";
+  print "     }\n";
+  print "     if (_cfsml_last_identifier_retreived) {\n";
+  print "       free(_cfsml_last_identifier_retreived);\n";
+  print "       _cfsml_last_identifier_retreived = NULL;\n";
+  print "     }\n";
+  print "  }\n";
+  print "/* End of auto-generated CFSML data reader code */\n";
+}
+
+# Generates code to write a data type
+# Parameters: $type: Type to write
+#             $datap: Pointer to the write destination
+#             $fh: Existing filehandle of an open file to use
+sub insert_writer_code {
+    write_line_pp(__LINE__, 0);
+    print "/* Auto-generated CFSML data writer code */\n";
+    print "  $types{$type}{'writer'}($fh, $datap);\n";
+    print "  fprintf($fh, \"\\n\");\n";
+    print "/* End of auto-generated CFSML data writer code */\n";
+}
+
+
+################
+# Main program #
+################
+
+$parsing = 0;
+$struct = undef; # Not working on a struct
+$commentmode = undef;
+$line = 0;
+
+while (<STDIN>) {
+
+  $line++;
+
+  if ($parsing) {
+    ($data) = split "#"; # Remove shell-style comments
+    @_ = ($data);
+
+    s/\/\*.*\*\///g; # Remove C-style one-line comments
+
+    ($data) = split "\/\/"; # Remove C++-style comments
+    @_ = ($data);
+
+    if ($commentmode) {
+
+      if (grep /\*\//, $_) {
+	($empty, $_) = split /\*\//;
+      } else {
+	@_ = (); # Empty line
+      }
+
+    } else {
+      if (grep /\/\*/, $_) {
+	$commentmode = 1;
+	($_) = split /\/\*/;
+      }
+    }
+
+
+    # Now tokenize:
+    s/;//;
+    split /(\".*\"|[,\[\]\(\)\{\}])|\s+/;
+
+    @items = @_;
+
+    @tokens = ();
+
+    $tokens_nr = 0;
+    for ($n = 0; $n < scalar @items; $n++) { # Get rid of all undefs
+      if ($_[$n]) {
+	$_ = $items[$n];
+	s/\"//g;
+	$tokens[$tokens_nr++] = $_;
+      }
+    }
+
+    # Now all tokens are in @tokens, and we have $tokens_nr of them.
+
+#    print "//DEBUG: " . join ("|", @tokens) . "\n";
+
+    if ($tokens_nr) {
+      if ($tokens_nr == 2 && $tokens[0] eq "%END" && $tokens[1] eq "CFSML") {
+
+	$struct && die "Record $struct needs closing braces in intput file (line $line).";
+
+	$parsing = 0;
+	create_function_block;
+	my $linep = $line + 1;
+	write_line_pp($linep, 1);
+      } elsif ($struct) { # Parsing struct
+	if ($tokens_nr == 1) {
+	  if ($tokens[0] eq "}") {
+	    $struct = undef;
+	  } else { die "Invalid declaration of $token[0] in input file (line $line)\n";};
+	} else { # Must be a member declaration
+
+	  my @structrecs = (@{$records{$struct}});
+	  my $newidx = (scalar @structrecs) or "0";
+	  my %member = ();
+	  $member{'name'} = $tokens[1];
+	  $member{'type'} = $tokens[0];
+
+	  if ($tokens_nr == 3 && $tokens[1] == "*") {
+	      $tokens_nr = 2;
+	      $member{'name'} = $tokens[2];
+	      $member{'reftype'} = $tokens[0];
+	      $member{'type'} = $type_abspointer;
+	  }
+
+	  if ($tokens_nr == 4 and $tokens[0] eq $type_pointer) { # Relative pointer
+
+	    if (not $tokens[2] eq "RELATIVETO") {
+	      die "Invalid relative pointer declaration in input file (line $line)\n";
+	    }
+
+	    $member{'anchor'} = $tokens[3]; # RelPointer anchor
+
+	  } else { # Non-pointer
+
+	    if (not $types{$tokens[0]}) {
+	      die "Unknown type $tokens[0] used in input file (line $line)\n";
+	    }
+
+	    if ($tokens_nr > 2) { # Array
+
+	      if ($tokens[2] ne "[") {
+		die "Invalid token '$tokens[2]' in input file (line $line)\n";
+	      }
+
+	      $member{'array'} = "static";
+
+	      if ($tokens[$tokens_nr - 1] ne "]") {
+		die "Array declaration incorrectly terminated in input file (line $line)\n";
+	      }
+
+	      $parsepos = 3;
+
+	      while ($parsepos < $tokens_nr) {
+
+		if ($tokens[$parsepos] eq ",") {
+
+		  $parsepos++;
+
+		} elsif ($tokens[$parsepos] eq "STATIC") {
+
+		  $member{'array'} = "static";
+		  $parsepos++;
+
+		} elsif ($tokens[$parsepos] eq "DYNAMIC") {
+
+		  $member{'array'} = "dynamic";
+		  $parsepos++;
+
+		} elsif ($tokens[$parsepos] eq "MAXWRITE") {
+
+		  $member{'maxwrite'} = $tokens[$parsepos + 1];
+		  $parsepos += 2;
+
+		} elsif ($tokens[$parsepos] eq "]") {
+
+		  $parsepos++;
+		  if ($parsepos != $tokens_nr) {
+		    die "Error: Invalid tokens after array declaration in input file (line $line)\n";
+
+		  }
+		} else {
+
+		  if ($member{'size'}) {
+		    die "Attempt to use more than one array size in input file (line $line)\n" .
+		      "(Original size was \"$member->{'size'}\", new size is \"$tokens[$parsepos]\"\n";
+		  }
+
+		  $member{'size'} = $tokens[$parsepos];
+		  $parsepos++;
+		}
+	      }
+
+
+	      unless ($member{'size'}) {
+		die "Array declaration without size in input file (line $line)\n";
+	      }
+	    }
+	  }
+
+	  @{$records{$struct}}->[$newidx] = \%member;
+	}
+      } else { # not parsing struct; normal operation.
+
+	if ($tokens[0] eq "TYPE") { # Simple type declaration
+
+	  my $newtype = $tokens[1];
+
+	  $types{$newtype}->{'ctype'} = $tokens[2];
+
+	  if ($tokens_nr == 5) { # must be ...LIKE...
+
+	    unless ($tokens[3] eq "LIKE") {
+	      die "Invalid TYPE declaration in input file (line $line)\n";
+	    }
+
+	    $types{$newtype}->{'type'} = $types{$tokens[4]}->{'type'};
+	    $types{$newtype}->{'reader'} = $types{$tokens[4]}->{'reader'};
+	    $types{$newtype}->{'writer'} = $types{$tokens[4]}->{'writer'};
+
+	  } elsif ($tokens_nr == 6) { # must be ...USING...
+
+	    unless ($tokens[3] eq "USING") {
+	      die "Invalid TYPE declaration in input file (line $line)\n";
+	    }
+
+	    $types{$newtype}->{'writer'} = $tokens[4];
+	    $types{$newtype}->{'reader'} = $tokens[5];
+	    $types{$newtype}->{'external'} = 'T';
+
+	  } else {
+	    die "Invalid TYPE declaration in input file (line $line)\n";
+	  }
+
+	} elsif ($tokens[0] eq "RECORD") {
+
+	  $struct = $tokens[1];
+	  if ($types{$struct}) {
+	    die "Attempt to re-define existing type $struct as a struct in input file (line $line)";
+	  }
+	  $types{$struct}{'type'} = $type_record;
+	  if ($tokens_nr < 3 or $tokens_nr > 6 or $tokens[$tokens_nr - 1] ne "{") {
+	    die "Invalid record declaration in input file (line $line)";
+	  }
+
+	  my $extoffset = 2;
+
+	  if ($tokens_nr > 3) {
+	      if ($tokens[2] ne "EXTENDS") { # Record declaration with explicit c type
+		  $types{$struct}{'ctype'} = $tokens[2];
+		  $extoffset = 3;
+	      } else { # Record name is the same as the c type name
+		  $types{$struct}{'ctype'} = $struct;
+	      }
+	  } elsif ($tokens_nr == 3) {
+		  $types{$struct}{'ctype'} = $struct;
+	  }
+
+	  if (($tokens_nr > $extoffset + 1) && ($extoffset + 1 <= $tokens_nr)) {
+	      if ($tokens[$extoffset] ne "EXTENDS") {
+		  die "Invalid or improper keyword \"$tokens[$extoffset]\" in input file (line $line)";
+	      }
+	      if ($extoffset + 2 >= $tokens_nr) {
+		  die "RECORD \"$struct\" extends on unspecified type in input file (line $line)";
+	      }
+	      my $ext_type = $tokens[$extoffset + 1];
+
+	      if (!($types{$ext_type}{type} eq $type_record)) {
+		  print "$types{$ext_type}{type}";
+		  die "RECORD \"$struct\" attempts to extend non-existing or non-record type \"$ext_type\" in input file (line $line)";
+	      }
+
+	      (@{$records{$struct}}) = (@{$records{$ext_type}}); # Copy type information from super type
+	  }
+
+	} else {
+	  die "Invalid declaration \"$tokens[0]\" in line $line";
+	}
+      }
+    }
+
+
+  } else {
+
+    ($subtoken) = split ";"; # Get rid of trailing ;s
+    $tokens_nr = @tokens = split " ", $subtoken;
+
+    if ($tokens_nr == 1 && $tokens[0] eq "%CFSML") {
+
+      $parsing = 1;
+
+    } elsif ($tokens[0] eq "%CFSMLWRITE" and $tokens[3] eq "INTO" and $tokens_nr >= 5) {
+
+      insert_writer_code($type = $tokens[1], $datap = $tokens[2], $fh = $tokens[4]);
+      my $templine = $line + 1;
+      write_line_pp($templine, 1); # Yes, this sucks.
+
+    } elsif (($tokens[0] eq "%CFSMLREAD") or ($tokens[0] eq "%CFSMLREAD-ATOMIC") and $tokens[3] eq "FROM" and $tokens_nr >= 5) {
+
+      my $myeofvar = 0;
+      my $myfirsttoken = 0;
+      my $mylinecounter = 0;
+
+      my $idcounter = 5;
+
+      while ($idcounter < $tokens_nr) {
+	if ($tokens[$idcounter] eq "ERRVAR" and $tokens_nr >= $idcounter + 2) {
+	  $myeofvar = $tokens[$idcounter + 1];
+	  $idcounter += 2;
+	} elsif ($tokens[$idcounter] eq "FIRSTTOKEN" and $tokens_nr >= $idcounter + 2) {
+	  $myfirsttoken = $tokens[$idcounter + 1];
+	  $idcounter += 2;
+	} elsif ($tokens[$idcounter] eq "LINECOUNTER" and $tokens_nr >= $idcounter + 2) {
+	  $mylinecounter = $tokens[$idcounter + 1];
+	  $idcounter += 2;
+	} else {
+	  die "Unknown %CFSMLREAD operational token: $tokens[$idcounter]\n";
+	}
+      }
+      insert_reader_code($type = $tokens[1], $datap = $tokens[2],
+			 $fh = $tokens[4], $eofvar = $myeofvar, $firsttoken = $myfirsttoken,
+			$linecounter = $mylinecounter, $atomic = ($tokens[0] eq "%CFSMLREAD-ATOMIC"));
+      my $templine = $line + 1;
+      write_line_pp($templine, 1); # Yes, this sucks, too.
+
+    } else {
+      print;
+    }
+  }
+
+}
+
+if ($parsing) {
+  print <STDERR>, "Warning: Missing %END CFSML\n";
+}


Property changes on: tools/trunk/sci/engine/cfsml.pl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/scicore/huffmake.pl
===================================================================
--- tools/trunk/sci/scicore/huffmake.pl	                        (rev 0)
+++ tools/trunk/sci/scicore/huffmake.pl	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,157 @@
+#! /usr/bin/perl
+
+# Uncomment the following line to debug
+# $DEBUG=1;
+ at codes;
+
+$leaf_value = 0;
+while (<>) {
+    chop;
+    @tokens = split //;
+
+    if ($_ eq "-") {
+	calc_values();
+	print stderr "$leaf_value tokens processed; result is a huffman tree.\n";
+	exit(0);
+    }
+
+    $codes_len[$leaf_value] = scalar @tokens;
+
+    for ($i = 0; $i < scalar @tokens; $i++) {
+	$codes[$leaf_value][$i] = $tokens[$i];
+    }
+
+    $leaf_value++;
+}
+
+$nodes_counter = 0;
+ at unlinked;
+
+sub branch_node {
+    $left = shift;
+    $right = shift;
+    print ("\tBRANCH_NODE(", $nodes_counter || "0" , ", $left, $right)\n");
+    $nodes_counter++;
+}
+
+sub leaf_node {
+    $value = shift;
+    print ("\tLEAF_NODE  (", $nodes_counter || "0" ,", ", $value || "0" , ")\n");
+    $nodes_counter++;
+}
+
+sub intval {
+    my $nr = shift;
+    my $retval = sub_intval(0, $codes_len[$nr], $nr);
+    return $retval >> 1;
+}
+
+sub sub_intval {
+    my $lv = shift;
+    my $maxlv = shift;
+    my $nr = shift;
+
+    if ($maxlv >= 0) {
+	my $v = $codes[$nr][$maxlv];
+	my $retval = sub_intval($lv + 1, $maxlv-1, $nr) << 1;
+
+	if ($v == "1") {
+	    $retval |= 1;
+	}
+	return $retval || 0;
+    } else {
+	return 0;
+    }
+}
+
+sub calc_values() {
+
+    $depth = 1;
+    my $startdepth = 100000;
+
+    for ($i; $i < scalar @codes; $i++) {
+	if ($codes_len[$i] > $depth) {
+	    $depth = $codes_len[$i];
+	}
+
+	if ($codes_len[$i] < $startdepth) {
+	    $startdepth = $codes_len[$i];
+	}
+    }
+
+    branch_node(1, 2);
+
+    $level = 1;
+    $unlinked[0] = 1;
+    $unlinked[1] = 2;
+    $linkctr = 3;
+
+    for (; $level <= $depth; $level++) {
+	my $entries = 1 << $level;
+
+	for ($j = 0; $j < ($entries << 1); $j++) {
+	    $new_unlinked[$j] = -1;
+	}
+
+	for ($i = 0; $i < $entries; $i++) {
+	    if ($unlinked[$i] > -1) {
+		$match = -1;
+
+		if ($DEBUG) {
+		    print " Finding len=$level val=$i: ";
+		}
+		for ($j = 0; ($match == -1) && $j < $leaf_value; $j++) {
+		    if (($codes_len[$j] == $level)
+			&& (intval($j) == $i)) {
+			$match = $j;
+		    } else {
+			if ($DEBUG) {
+			    print "($j:$codes_len[$j],",intval($j),") ";
+			}
+		    }
+		}
+		if ($DEBUG) {
+		    print "\n";
+		}
+
+		if ($match == -1) {
+		    die "Expected $unlinked[$i], but counted $nodes_counter in $i at level $level" unless ($unlinked[$i] == $nodes_counter);
+		    my $lnr = $linkctr++;
+		    my $rnr = $linkctr++;
+		    $new_unlinked[$i << 1] = $lnr;
+		    $new_unlinked[1+($i << 1)] = $rnr;
+		    branch_node($lnr, $rnr);
+		} else {
+		    leaf_node($match);
+		    $new_unlinked[$i << 1] = -1;
+		    $new_unlinked[1+($i << 1)] = -1;
+		}
+		
+	    }
+	}
+
+	if ($DEBUG) {
+	    print "level $level: Copying ", ($entries << 1), "\n";
+	}
+	for ($j = 0; $j < ($entries << 1); $j++) {
+	    $unlinked[$j] = $new_unlinked[$j];
+	    if ($DEBUG) {
+		print $unlinked[$j], " ";
+	    }
+	}
+	if ($DEBUG) {
+	    print "\n";
+	}
+    }
+
+    my $ok = 1;
+    for ($j = 0; $j < ($entries << 1); $j++) {
+	if ($unlinked[$j] != -1) {
+	    $ok = 0;
+	}
+    }
+
+    print "#warning \"Tree is not a huffman tree!\"\n" unless $ok;
+}
+
+


Property changes on: tools/trunk/sci/scicore/huffmake.pl
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/scicore/hufftree.1
===================================================================
--- tools/trunk/sci/scicore/hufftree.1	                        (rev 0)
+++ tools/trunk/sci/scicore/hufftree.1	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,17 @@
+101
+11
+100
+011
+0101
+0100
+0011
+00101
+00100
+00011
+00010
+000011
+000010
+000001
+0000001
+0000000
+-


Property changes on: tools/trunk/sci/scicore/hufftree.1
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/scicore/hufftree.2
===================================================================
--- tools/trunk/sci/scicore/hufftree.2	                        (rev 0)
+++ tools/trunk/sci/scicore/hufftree.2	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,69 @@
+11
+1011
+1010
+10011
+10010
+10001
+10000
+011111
+011110
+011101
+011100
+011011
+011010
+011001
+011000
+010111
+010110
+010101
+010100
+010011
+010010
+010001
+0100001
+0100000
+0011111
+0011110
+0011101
+0011100
+0011011
+0011010
+0011001
+0011000
+0010111
+0010110
+0010101
+0010100
+0010011
+0010010
+0010001
+0010000
+0001111
+0001110
+0001101
+0001100
+0001011
+0001010
+0001001
+0001000
+00001111
+00001110
+00001101
+00001100
+00001011
+00001010
+00001001
+00001000
+00000111
+00000110
+00000101
+00000100
+00000011
+00000010
+00000001
+00000000
+-
+
+
+
+


Property changes on: tools/trunk/sci/scicore/hufftree.2
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/scicore/hufftree.3
===================================================================
--- tools/trunk/sci/scicore/hufftree.3	                        (rev 0)
+++ tools/trunk/sci/scicore/hufftree.3	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,257 @@
+00001001001
+000001111111
+000001111110
+000001111101
+000001111100
+000001111011
+000001111010
+000001111001
+000001111000
+00011101
+0100011
+000001110111
+000001110110
+0100010
+000001110101
+000001110100
+000001110011
+000001110010
+000001110001
+000001110000
+000001101111
+000001101110
+000001101101
+000001101100
+000001101011
+000001101010
+0000001001001
+000001101001
+000001101000
+000001100111
+000001100110
+000001100101
+1111
+0000101001
+00011100
+000001100100
+0000101000
+000001100011
+0000100111
+00011011
+0100001
+0100000
+00011010
+000011011
+0011111
+100101
+0011110
+00011001
+0011101
+100100
+0011100
+0011011
+0011010
+0011001
+00011000
+0011000
+0010111
+00010111
+00010110
+000001100010
+00001001000
+0010110
+000011010
+00001000111
+000001100001
+100011
+0010101
+100010
+100001
+11101
+0010100
+00010101
+00010100
+100000
+00001000110
+000011001
+011111
+0010011
+011110
+011101
+0010010
+00001000101
+011100
+011011
+011010
+0010001
+000011000
+00010011
+000010111
+000010110
+00001000100
+00010010
+00001000011
+000010101
+000001100000
+00010001
+000001011111
+11100
+011001
+011000
+010111
+11011
+010110
+010101
+010100
+11010
+00001000010
+0010000
+11001
+010011
+11000
+10111
+010010
+0000100110
+10110
+10101
+10100
+10011
+00010000
+0001111
+00001111
+00001110
+0000100101
+00001000001
+00001000000
+000001011110
+000001011101
+000001011100
+0000001001000
+0000001000111
+0000001000110
+0000001000101
+0000001000100
+0000001000011
+0000001000010
+0000001000001
+0000001000000
+0000000111111
+0000000111110
+0000000111101
+0000000111100
+0000000111011
+0000000111010
+0000000111001
+0000000111000
+0000000110111
+0000000110110
+0000000110101
+0000000110100
+0000000110011
+0000000110010
+0000000110001
+0000000110000
+0000000101111
+0000000101110
+0000000101101
+0000000101100
+0000000101011
+0000000101010
+0000000101001
+0000000101000
+0000000100111
+0000000100110
+0000000100101
+0000000100100
+0000000100011
+0000000100010
+0000000100001
+0000000100000
+0000000011111
+0000000011110
+0000000011101
+0000000011100
+0000000011011
+0000000011010
+0000000011001
+000001011011
+000001011010
+000001011001
+000001011000
+000001010111
+000001010110
+000001010101
+000001010100
+000001010011
+000001010010
+000001010001
+000001010000
+000001001111
+000001001110
+000001001101
+000001001100
+000001001011
+000001001010
+000001001001
+000001001000
+000001000111
+000001000110
+000001000101
+000001000100
+000001000011
+000001000010
+000001000001
+000001000000
+000000111111
+000000111110
+000000111101
+000000111100
+000000111011
+000000111010
+000000111001
+000000111000
+000000110111
+000000110110
+000000110101
+000000110100
+000000110011
+000000110010
+000000110001
+000000110000
+000000101111
+000000101110
+000000101101
+000000101100
+0000000011000
+000000101011
+0000000010111
+0000000010110
+0000000010101
+000000101010
+0000000010100
+0000000010011
+0000000010010
+000000101001
+0000000010001
+0000000010000
+0000000001111
+0000000001110
+000000101000
+0000000001101
+0000000001100
+0000000001011
+000000100111
+000000100110
+000000100101
+0000000001010
+0000000001001
+0000000001000
+0000000000111
+0000000000110
+0000000000101
+0000000000100
+0000000000011
+0000000000010
+0000000000001
+0000000000000
+-


Property changes on: tools/trunk/sci/scicore/hufftree.3
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/doc/README
===================================================================
--- tools/trunk/sci/sfx/doc/README	                        (rev 0)
+++ tools/trunk/sci/sfx/doc/README	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,7 @@
+The files in this direcory are a bit outdated. There are some small non
+critical errors in "patch.001", they are obvious if you bother to read
+the source (which is correct). "sound01.txt" is just meant to give you a
+basic understanding of the structures invovled in
+SCI01/SCI1/SCI1.1/SCI32 sound resources.
+
+Ravi has made some really good documentation for SCI0.


Property changes on: tools/trunk/sci/sfx/doc/README
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/doc/patch001.txt
===================================================================
--- tools/trunk/sci/sfx/doc/patch001.txt	                        (rev 0)
+++ tools/trunk/sci/sfx/doc/patch001.txt	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,118 @@
+SCI patch.001 Resource Format                                     Revision 0.1
+Rickard Lind                                                        1999-12-16
+
+The patch.001 file for Roland MT-32, MT-100, LAPC-1, CM-32L and CM-64.
+
+This specification will sometimes look very incomprehensible without some
+knowledge concerning the MT-32 MIDI implementation.
+Have a look at http://members.xoom.com/_XMCM/TomLewandowski/docs.html
+
+
+1. The header (494 bytes) which is always present.
+
+Offset Size Type Description
+----------------------------------------------------------------------------
+ 0x000   2       89 00 First Two Bytes
+ 0x002  20       ASCII String for MT-32 Display ("*It's Only A Model* ")
+ 0x016  20       ASCII String for MT-32 Display (" CAMELOT, CAMELOT!  ")
+ 0x02a  20       ASCII String for MT-32 Display ("Ham & Jam & SpamAlot")
+ 0x03e   2  word MT-32 Master Volume
+ 0x040   1       Index in Predefined reverb settings at 0x04c (0-10) 
+ 0x041  11       MT-32 SysEx block setting reverb
+                 (last 3 bytes are dummies)
+ 0x04c   3       Predefined reverb setting #1 (Mode, Time, Level)
+   :     :       :
+ 0x06a   3       Predefined reverb setting #11 
+ 0x06d   8       MT-32 Patch Memory #1 (see Patch Memory description below)
+   :     :       :
+ 0x1e5   8       MT-32 Patch Memory #48
+ 0x1ed   1       n = Number of Timbre Memory (0-64 userdefined instruments)
+----------------------------------------------------------------------------
+
+
+  Patch Memory description
+  
+  Offset Description
+  --------------------------------------------------------------------
+   0x00  Timbre Group (0 = Bank A, 1 = Bank B, 2 = Memory, 3 = Rythm)
+   0x01  Timbre Number (0 - 63)
+   0x02  Key Shift (0-48) [-24 - +24]
+   0x03  Fine Tune (0-100) [-50 - +50]
+   0x04  Bender Range (0-24)
+   0x05  Assign Mode (0 = Poly 1, 1 = Poly 2, 2 = Poly 3, 3 = Poly 4)
+   0x06  Reverb Switch (0 = OFF, 1 = ON)
+   0x07  Dummy
+  --------------------------------------------------------------------
+
+   Mapping MT-32 to GM instruments is done with Timbre Group and
+   Timbre Number.
+   
+   Instrument 0-63:   Bank A, 0-63
+   Instrument 64-127: Bank B, 0-63
+
+
+2. The Timbre Memory block (if n > 0), offset relative to 0x1ee
+
+Offset Size Type Description
+------------------------------------------------------------------------------
+ 0x000  246      MT-32 Timbre Memory #1 (see Timbre Memory description below)
+   :     :       :
+ 0x???  246      MT-32 Timbre Memory #n
+------------------------------------------------------------------------------
+
+
+  Timbre Memory description
+   
+  Offset Size Description
+  -----------------------------------------------------------------------
+   0x00   10  Timbre Name (ASCII String)
+   0x0a       See http://members.xoom.com/_XMCM/TomLewandowski/lapc1.txt
+  -----------------------------------------------------------------------
+
+
+3. Second MT-32 Patch Memory Block, offset realtive to 0x1ee + n * 246
+
+Offset Size Description
+---------------------------------------------------
+ 0x000   2  0xab 0xcd (if this this is not present
+                       there is no second block)
+ 0x002   8  MT-32 Patch Memory #49
+   :     :  :
+ 0x17a   8  MT-32 Patch Memory #96
+---------------------------------------------------
+
+
+4. Block for setting up Patch Temporary Area (rythm part) and
+   System Area - Partial Reserve, offset relative to 0x370 + n * 246
+
+Offset Size Description
+---------------------------------------------------     
+ 0x000   2  0xdc 0xba (if this this is not present
+                       this block is non existent)
+ 0x002   4  Rythm Setup for Key #24 (see below)
+   :     :  :     
+ 0x0fe   4  Rythm Setup for Key #87
+ 0x102   9  System Area - Partial Reserve
+---------------------------------------------------     
+
+  Rythm Setup description
+  See http://members.xoom.com/_XMCM/TomLewandowski/lapc1.txt
+
+
+TODO:
+
+  * Clearly describe which parts are interesting for a quick and dirty
+    GeneralMidi/patch.001/FreeSCI implementation
+
+  * Describe how the Sierra MT-32 driver uses patch.001
+
+  * Make this readable to someone who has not been reading reference
+    manuals since early childhood
+
+  * SGML
+
+
+Revision history
+
+   Revision 0.1 - 1999-12-16
+      - First pre-release of the specification


Property changes on: tools/trunk/sci/sfx/doc/patch001.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/doc/sound01.txt
===================================================================
--- tools/trunk/sci/sfx/doc/sound01.txt	                        (rev 0)
+++ tools/trunk/sci/sfx/doc/sound01.txt	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,213 @@
+The SCI01+ sound resource format
+
+Originally written by Rickard Lind, 2000-01-05
+Extensively rewritten by Lars Skovlund, 2002-10-27
+Again updated by Lars Skovlund, 2005-10-12
+
+Used in:
+Quest for Glory II: Trial by Fire (QfG2)
+Christmas greeting card 1990 (CC1990)
+
+The magic number (84 00) is left out, offset 0 is directly after these two
+bytes. 
+
+If you examine a SCI01 sound resource use "sciunpack --without-header" to
+get the pointers within the file correct for your hex viewer. 
+
+DESCRIPTION
+-----------
+
+The SCI01 sound resource consists of a number of track lists and the
+tracks themselves. There is one track list for (almost) every piece of
+sound hardware supported by the game. Each track either contains track
+data for one specific channel or a digital sample. 
+
+SCI1 resources are the same, except that sample chunks are no longer
+allowed (since they are now separate resources).
+
+  Optional Priority Header
+  ------------------------
+
+  Some SCI1 songs contain an 8-byte header before the track list. At
+  least on PC platforms, its data is mostly unused. The priority value
+  is used if the script does not override it.
+
+  offset   size         description
+    -------------------------------------------------------
+      0	   byte		0xf0 Priority header marker byte
+      1    byte		Recommended priority for this song
+      2    6 bytes	Apparently unused
+
+  Track List
+  ----------
+
+  The track list tells us which tracks are to be played on particular
+  hardware platforms. Each entry either terminates the previous list
+  or contains an entry for the current one.
+
+  List Termination
+  ----------------
+
+    offset size description
+    -----------------------
+      0    byte 0xff
+      1    byte Hardware ID of next list, 0xff if none
+
+  List Entry
+  ----------
+
+    offset size description
+    -----------------------
+      0	   byte 0
+      1    byte 0
+      2    word Data Chunk pointer
+      4    word Data Chunk size
+
+    The very first list in a file looks a little odd, in that it
+    starts with a single byte which tells us the hardware ID
+    associated with the first list (0 in all the cases I've seen)
+    followed by list entries as usual.
+
+    Known Hardware IDs
+    ------------------
+
+    Some of these are used by multiple drivers, probably because they
+    support the same number of polyphonic voices. Note that the
+    hardware ID does not necessarily tell us whether samples are
+    supported - thus, the list for Roland MT-32 also contains sample
+    tracks, because the user may also have a Sound Blaster card
+    connected. SCI1 most likely has more hardware IDs than these.
+
+    0x00 - Sound Blaster, Adlib
+    0x06 - MT-32 with Sound Blaster (for digital audio)
+    0x09 - CMS/Game Blaster
+    0x0c - Roland MT-32
+    0x12 - PC Speaker
+    0x13 - IBM PS/1, Tandy 3-voice
+
+  Data Chunks
+  -----------
+
+  In the sound resources of QfG2 and CC1990 I've seen two types of Data
+  Chunks, Sample and MIDI channel track.
+
+
+    Sample Chunk
+    ------------
+
+    offset size description
+    -----------------------
+      0    byte =0xfe
+      1    byte !=0xfe (always 0 in QfG2 and CC1990)
+      2    word Sample rate (Hz)
+      4    word Sample length
+      6    word Sample point 1 (begin?)
+      8    word Sample point 2 (end?)
+     10         Unsigned 8-bit mono sample data
+
+
+    MIDI channel track Chunk
+    ------------------------
+
+    This chunk begins with a 2 byte header. The low nibble of the
+    first byte indicates the channel number. The high nibble controls
+    certain aspects of (dynamic) track channel/hardware channel mapping.
+    
+    The second byte tells us how many notes will be
+    playing simultaneously in the channel. From the third byte onward
+    is the MIDI track data which looks just like normal SCI0 MIDI
+    track data, but all status bytes are targeted at one specific MIDI
+    channel.
+
+Example, sound.833 from QfG2 (--without-header)
+-----------------------------------------------
+
+offset  data description
+------------------------
+ 0000     00 Hardware ID for first track list
+ 0001     00 Track list continuation
+ 0002     00 Same hardware device
+ 0003   003F Data Chunk pointer (Little Endian)
+ 0005   0013 Data Chunk length (LE)  
+ 0007     00 Track list continuation
+ 0008     00 Same hardware device
+ 0009   006A Data Chunk pointer (LE)
+ 000B   0015 Data Chunk length (LE)
+ 000D     FF Next track list
+ 000E     09 for hardware device 0x09
+ 000F     00 Track list continuation
+ 0010     00 Same hardware device
+ 0011   003F Data Chunk pointer (LE)
+ 0013   0013 Data Chunk length (LE)
+ 0015     00 Track list continuation
+ 0016     00 Same hardware device
+ 0017   0052 Data Chunk pointer (LE)
+ 0019   0018 Data Chunk length (LE)
+ 001B     00 Track list continuation
+ 001C     00 Same hardware device
+ 001D   0094 Data Chunk pointer (LE)
+ 001F   0012 Data Chunk length (LE)
+ 0021     FF Next track list
+ 0022     0C for hardware device 0x0C
+ 0023     00 Track list continuation
+ 0024     00 Same hardware device
+ 0025   003F Data Chunk pointer (LE)
+ 0027   0013 Data Chunk length (LE)
+ 0029     00 Track list continuation
+ 002A     00 Same hardware device
+ 002B   0052 Data Chunk pointer (LE)
+ 002D   0018 Data Chunk length (LE)
+ 002F     FF Next track list
+ 0030     13 for hardware device 0x13
+ 0031     00 Track list continuation
+ 0032     00 Same hardware device
+ 0033   003F Data Chunk pointer (LE)
+ 0035   0013 Data Chunk length (LE)
+ 0037     00 Track list continuation
+ 0038     00 Same hardware device
+ 0039   007F Data Chunk pointer (LE)
+ 003B   0015 Data Chunk length (LE)
+
+ 003D  FF FF Sequence Control - End of Sequence Blocks
+ ------------------------------------------------------------
+ 003F     0F MIDI Track channel 15 (control channel)
+ 0040     01 One note playing on track (probably just to satisfy the
+	     MIDI engine)
+ 0041        MIDI Track data like SCI0
+ 0052     02 MIDI Track channel 2
+ 0053     02 Two notes playing on track
+ 0054        MIDI Track data like SCI0 
+ 006A	  03 MIDI Track channel 3
+ 006B	  01 One note playing on track
+ 006C	     MIDI Track data like SCI0
+ 007F	  0A MIDI Track channel 10
+ 0080	  01 One note playing on track
+ 0081	     MIDI Track data like SCI0
+ 0094	  02 MIDI Track channel 2
+ 0095	  01 One note playing on track
+ 0096	     MIDI Track data like SCI0
+
+Addendum (provided by Lars Skovlund)
+------------------------------------
+
+First of all, tracks do not loop individually. No loop signals are
+reported.
+
+Absolute cues are generally stored in the signal selector, and
+cumulative cues are generally stored in the dataInc selector, with
+some interesting twists: 
+
+1. The server's record of the absolute cue value is reset as part of
+   UPDATE_CUES.
+2. When a cumulative cue is reported to the VM object, it will be
+   placed in _both_ fields. In such a case, a constant of 0x7f will be
+   added to the _signal_ selector only, to be able to distinguish the
+   two kinds of cue (this has already been coded).
+3. The above only happens if the sound does not use absolute cues
+   (i.e. if the signal is 0 a priori). Note that, because of 1)
+   above, this does not cause problems neither with successive
+   cumulative cues nor with mixed cumulative/absolute cues.
+4. A signal of 0xff will stop the sound object playing. This may be
+   for purely internal purposes.
+5. There no longer is a field indicating the amount of increment for
+   a cue.


Property changes on: tools/trunk/sci/sfx/doc/sound01.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/lists/GM.txt
===================================================================
--- tools/trunk/sci/sfx/lists/GM.txt	                        (rev 0)
+++ tools/trunk/sci/sfx/lists/GM.txt	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,177 @@
+/*000 00*/ "Acoustic Grand Piano",
+/*001 01*/ "Bright Acoustic Piano",
+/*002 02*/ "Electric Grand Piano",
+/*003 03*/ "Honky-tonk Piano",
+/*004 04*/ "Electric Piano 1",
+/*005 05*/ "Electric Piano 2",
+/*006 06*/ "Harpsichord",
+/*007 07*/ "Clavinet",
+/*008 08*/ "Celesta",
+/*009 09*/ "Glockenspiel",
+/*010 0A*/ "Music Box",
+/*011 0B*/ "Vibraphone",
+/*012 0C*/ "Marimba",
+/*013 0D*/ "Xylophone",
+/*014 0E*/ "Tubular Bells",
+/*015 0F*/ "Dulcimer",
+/*016 10*/ "Drawbar Organ",
+/*017 11*/ "Percussive Organ",
+/*018 12*/ "Rock Organ",
+/*019 13*/ "Church Organ",
+/*020 14*/ "Reed Organ",
+/*021 15*/ "Accordion",
+/*022 16*/ "Harmonica",
+/*023 17*/ "Tango Accordion",
+/*024 18*/ "Acoustic Guitar (nylon)",
+/*025 19*/ "Acoustic Guitar (steel)",
+/*026 1A*/ "Electric Guitar (jazz)",
+/*027 1B*/ "Electric Guitar (clean)",
+/*028 1C*/ "Electric Guitar (muted)",
+/*029 1D*/ "Overdriven Guitar",
+/*030 1E*/ "Distortion Guitar",
+/*031 1F*/ "Guitar Harmonics",
+/*032 20*/ "Acoustic Bass",
+/*033 21*/ "Electric Bass (finger)",
+/*034 22*/ "Electric Bass (pick)",
+/*035 23*/ "Fretless Bass",
+/*036 24*/ "Slap Bass 1",
+/*037 25*/ "Slap Bass 2",
+/*038 26*/ "Synth Bass 1",
+/*039 27*/ "Synth Bass 2",
+/*040 28*/ "Violin",
+/*041 29*/ "Viola",
+/*042 2A*/ "Cello",
+/*043 2B*/ "Contrabass",
+/*044 2C*/ "Tremolo Strings",
+/*045 2D*/ "Pizzicato Strings",
+/*046 2E*/ "Orchestral Harp",
+/*047 2F*/ "Timpani",
+/*048 30*/ "String Ensemble 1",
+/*049 31*/ "String Ensemble 2",
+/*050 32*/ "SynthStrings 1",
+/*051 33*/ "SynthStrings 2",
+/*052 34*/ "Choir Aahs",
+/*053 35*/ "Voice Oohs",
+/*054 36*/ "Synth Voice",
+/*055 37*/ "Orchestra Hit",
+/*056 38*/ "Trumpet",
+/*057 39*/ "Trombone",
+/*058 3A*/ "Tuba",
+/*059 3B*/ "Muted Trumpet",
+/*060 3C*/ "French Horn",
+/*061 3D*/ "Brass Section",
+/*062 3E*/ "SynthBrass 1",
+/*063 3F*/ "SynthBrass 2",
+
+/*064 40*/ "Soprano Sax",
+/*065 41*/ "Alto Sax",
+/*066 42*/ "Tenor Sax",
+/*067 43*/ "Baritone Sax",
+/*068 44*/ "Oboe",
+/*069 45*/ "English Horn",
+/*070 46*/ "Bassoon",
+/*071 47*/ "Clarinet",
+/*072 48*/ "Piccolo",
+/*073 49*/ "Flute",
+/*074 4A*/ "Recorder",
+/*075 4B*/ "Pan Flute",
+/*076 4C*/ "Blown Bottle",
+/*077 4D*/ "Shakuhachi",
+/*078 4E*/ "Whistle",
+/*079 4F*/ "Ocarina",
+/*080 50*/ "Lead 1 (square)",
+/*081 51*/ "Lead 2 (sawtooth)",
+/*082 52*/ "Lead 3 (calliope)",
+/*083 53*/ "Lead 4 (chiff)",
+/*084 54*/ "Lead 5 (charang)",
+/*085 55*/ "Lead 6 (voice)",
+/*086 56*/ "Lead 7 (fifths)",
+/*087 57*/ "Lead 8 (bass+lead)",
+/*088 58*/ "Pad 1 (new age)",
+/*089 59*/ "Pad 2 (warm)",
+/*090 5A*/ "Pad 3 (polysynth)",
+/*091 5B*/ "Pad 4 (choir)",
+/*092 5C*/ "Pad 5 (bowed)",
+/*093 5D*/ "Pad 6 (metallic)",
+/*094 5E*/ "Pad 7 (halo)",
+/*095 5F*/ "Pad 8 (sweep)",
+/*096 60*/ "FX 1 (rain)",
+/*097 61*/ "FX 2 (soundtrack)",
+/*098 62*/ "FX 3 (crystal)",
+/*099 63*/ "FX 4 (atmosphere)",
+/*100 64*/ "FX 5 (brightness)",
+/*101 65*/ "FX 6 (goblins)",
+/*102 66*/ "FX 7 (echoes)",
+/*103 67*/ "FX 8 (sci-fi)",
+/*104 68*/ "Sitar",
+/*105 69*/ "Banjo",
+/*106 6A*/ "Shamisen",
+/*107 6B*/ "Koto",
+/*108 6C*/ "Kalimba",
+/*109 6D*/ "Bag pipe",
+/*110 6E*/ "Fiddle",
+/*111 6F*/ "Shannai",
+/*112 70*/ "Tinkle Bell",
+/*113 71*/ "Agogo",
+/*114 72*/ "Steel Drums",
+/*115 73*/ "Woodblock",
+/*116 74*/ "Taiko Drum",
+/*117 75*/ "Melodic Tom",
+/*118 76*/ "Synth Drum",
+/*119 77*/ "Reverse Cymbal",
+/*120 78*/ "Guitar Fret Noise",
+/*121 79*/ "Breath Noise",
+/*122 7A*/ "Seashore",
+/*123 7B*/ "Bird Tweet",
+/*124 7C*/ "Telephone Ring",
+/*125 7D*/ "Helicopter",
+/*126 7E*/ "Applause",
+/*127 7F*/ "Gunshot"
+
+/*035 23*/ "Acoustic Bass Drum",
+/*036 24*/ "Bass Drum 1",
+/*037 25*/ "Side Stick",
+/*038 26*/ "Acoustic Snare",
+/*039 27*/ "Hand Clap",
+/*040 28*/ "Electric Snare",
+/*041 29*/ "Low Floor Tom",
+/*042 2A*/ "Closed Hi-Hat",
+/*043 2B*/ "High Floor Tom",
+/*044 2C*/ "Pedal Hi-Hat",
+/*045 2D*/ "Low Tom",
+/*046 2E*/ "Open Hi-Hat",
+/*047 2F*/ "Low-Mid Tom",
+/*048 30*/ "Hi-Mid Tom",
+/*049 31*/ "Crash Cymbal 1",
+/*050 32*/ "High Tom",
+/*051 33*/ "Ride Cymbal 1",
+/*052 34*/ "Chinese Cymbal",
+/*053 35*/ "Ride Bell",
+/*054 36*/ "Tambourine",
+/*055 37*/ "Splash Cymbal",
+/*056 38*/ "Cowbell",
+/*057 39*/ "Crash Cymbal 2",
+/*058 3A*/ "Vibraslap",
+/*059 3B*/ "Ride Cymbal 2",
+/*060 3C*/ "Hi Bongo",
+/*061 3D*/ "Low Bongo",
+/*062 3E*/ "Mute Hi Conga",
+/*063 3F*/ "Open Hi Conga",
+/*064 40*/ "Low Conga",
+/*065 41*/ "High Timbale",
+/*066 42*/ "Low Timbale",
+/*067 43*/ "High Agogo",
+/*068 44*/ "Low Agogo",
+/*069 45*/ "Cabasa",
+/*070 46*/ "Maracas",
+/*071 47*/ "Short Whistle",
+/*072 48*/ "Long Whistle",
+/*073 49*/ "Short Guiro",
+/*074 4A*/ "Long Guiro",
+/*075 4B*/ "Claves",
+/*076 4C*/ "Hi Wood Block",
+/*077 4D*/ "Low Wood Block",
+/*078 4E*/ "Mute Cuica",
+/*079 4F*/ "Open Cuica",
+/*080 50*/ "Mute Triangle",
+/*081 51*/ "Open Triangle"


Property changes on: tools/trunk/sci/sfx/lists/GM.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/lists/gm_patches.c
===================================================================
--- tools/trunk/sci/sfx/lists/gm_patches.c	                        (rev 0)
+++ tools/trunk/sci/sfx/lists/gm_patches.c	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,198 @@
+/***************************************************************************
+ gm_patches.c Copyright (C) 2000 Rickard Lind
+
+
+ This program may be modified and copied freely according to the terms of
+ the GNU general public license (GPL), as long as the above copyright
+ notice and the licensing information contained herein are preserved.
+
+ Please refer to www.gnu.org for licensing details.
+
+ This work is provided AS IS, without warranty of any kind, expressed or
+ implied, including but not limited to the warranties of merchantibility,
+ noninfringement, and fitness for a specific purpose. The author will not
+ be held liable for any damage caused by this work or derivatives of it.
+
+ By using this source code, you agree to the licensing terms as stated
+ above.
+
+***************************************************************************/
+
+char *GM_Patch[128] = {
+/*000*/ "Acoustic Grand Piano",
+/*001*/ "Bright Acoustic Piano",
+/*002*/ "Electric Grand Piano",
+/*003*/ "Honky-tonk Piano",
+/*004*/ "Electric Piano 1",
+/*005*/ "Electric Piano 2",
+/*006*/ "Harpsichord",
+/*007*/ "Clavinet",
+/*008*/ "Celesta",
+/*009*/ "Glockenspiel",
+/*010*/ "Music Box",
+/*011*/ "Vibraphone",
+/*012*/ "Marimba",
+/*013*/ "Xylophone",
+/*014*/ "Tubular Bells",
+/*015*/ "Dulcimer",
+/*016*/ "Drawbar Organ",
+/*017*/ "Percussive Organ",
+/*018*/ "Rock Organ",
+/*019*/ "Church Organ",
+/*020*/ "Reed Organ",
+/*021*/ "Accordion",
+/*022*/ "Harmonica",
+/*023*/ "Tango Accordion",
+/*024*/ "Acoustic Guitar (nylon)",
+/*025*/ "Acoustic Guitar (steel)",
+/*026*/ "Electric Guitar (jazz)",
+/*027*/ "Electric Guitar (clean)",
+/*028*/ "Electric Guitar (muted)",
+/*029*/ "Overdriven Guitar",
+/*030*/ "Distortion Guitar",
+/*031*/ "Guitar Harmonics",
+/*032*/ "Acoustic Bass",
+/*033*/ "Electric Bass (finger)",
+/*034*/ "Electric Bass (pick)",
+/*035*/ "Fretless Bass",
+/*036*/ "Slap Bass 1",
+/*037*/ "Slap Bass 2",
+/*038*/ "Synth Bass 1",
+/*039*/ "Synth Bass 2",
+/*040*/ "Violin",
+/*041*/ "Viola",
+/*042*/ "Cello",
+/*043*/ "Contrabass",
+/*044*/ "Tremolo Strings",
+/*045*/ "Pizzicato Strings",
+/*046*/ "Orchestral Harp",
+/*047*/ "Timpani",
+/*048*/ "String Ensemble 1",
+/*049*/ "String Ensemble 2",
+/*050*/ "SynthStrings 1",
+/*051*/ "SynthStrings 2",
+/*052*/ "Choir Aahs",
+/*053*/ "Voice Oohs",
+/*054*/ "Synth Voice",
+/*055*/ "Orchestra Hit",
+/*056*/ "Trumpet",
+/*057*/ "Trombone",
+/*058*/ "Tuba",
+/*059*/ "Muted Trumpet",
+/*060*/ "French Horn",
+/*061*/ "Brass Section",
+/*062*/ "SynthBrass 1",
+/*063*/ "SynthBrass 2",
+/*064*/ "Soprano Sax",
+/*065*/ "Alto Sax",
+/*066*/ "Tenor Sax",
+/*067*/ "Baritone Sax",
+/*068*/ "Oboe",
+/*069*/ "English Horn",
+/*070*/ "Bassoon",
+/*071*/ "Clarinet",
+/*072*/ "Piccolo",
+/*073*/ "Flute",
+/*074*/ "Recorder",
+/*075*/ "Pan Flute",
+/*076*/ "Blown Bottle",
+/*077*/ "Shakuhachi",
+/*078*/ "Whistle",
+/*079*/ "Ocarina",
+/*080*/ "Lead 1 (square)",
+/*081*/ "Lead 2 (sawtooth)",
+/*082*/ "Lead 3 (calliope)",
+/*083*/ "Lead 4 (chiff)",
+/*084*/ "Lead 5 (charang)",
+/*085*/ "Lead 6 (voice)",
+/*086*/ "Lead 7 (fifths)",
+/*087*/ "Lead 8 (bass+lead)",
+/*088*/ "Pad 1 (new age)",
+/*089*/ "Pad 2 (warm)",
+/*090*/ "Pad 3 (polysynth)",
+/*091*/ "Pad 4 (choir)",
+/*092*/ "Pad 5 (bowed)",
+/*093*/ "Pad 6 (metallic)",
+/*094*/ "Pad 7 (halo)",
+/*095*/ "Pad 8 (sweep)",
+/*096*/ "FX 1 (rain)",
+/*097*/ "FX 2 (soundtrack)",
+/*098*/ "FX 3 (crystal)",
+/*099*/ "FX 4 (atmosphere)",
+/*100*/ "FX 5 (brightness)",
+/*101*/ "FX 6 (goblins)",
+/*102*/ "FX 7 (echoes)",
+/*103*/ "FX 8 (sci-fi)",
+/*104*/ "Sitar",
+/*105*/ "Banjo",
+/*106*/ "Shamisen",
+/*107*/ "Koto",
+/*108*/ "Kalimba",
+/*109*/ "Bag pipe",
+/*110*/ "Fiddle",
+/*111*/ "Shannai",
+/*112*/ "Tinkle Bell",
+/*113*/ "Agogo",
+/*114*/ "Steel Drums",
+/*115*/ "Woodblock",
+/*116*/ "Taiko Drum",
+/*117*/ "Melodic Tom",
+/*118*/ "Synth Drum",
+/*119*/ "Reverse Cymbal",
+/*120*/ "Guitar Fret Noise",
+/*121*/ "Breath Noise",
+/*122*/ "Seashore",
+/*123*/ "Bird Tweet",
+/*124*/ "Telephone Ring",
+/*125*/ "Helicopter",
+/*126*/ "Applause",
+/*127*/ "Gunshot" };
+
+char *GM_RhythmKey[47] = {
+/*035*/ "Acoustic Bass Drum",
+/*036*/ "Bass Drum 1",
+/*037*/ "Side Stick",
+/*038*/ "Acoustic Snare",
+/*039*/ "Hand Clap",
+/*040*/ "Electric Snare",
+/*041*/ "Low Floor Tom",
+/*042*/ "Closed Hi-Hat",
+/*043*/ "High Floor Tom",
+/*044*/ "Pedal Hi-Hat",
+/*045*/ "Low Tom",
+/*046*/ "Open Hi-Hat",
+/*047*/ "Low-Mid Tom",
+/*048*/ "Hi-Mid Tom",
+/*049*/ "Crash Cymbal 1",
+/*050*/ "High Tom",
+/*051*/ "Ride Cymbal 1",
+/*052*/ "Chinese Cymbal",
+/*053*/ "Ride Bell",
+/*054*/ "Tambourine",
+/*055*/ "Splash Cymbal",
+/*056*/ "Cowbell",
+/*057*/ "Crash Cymbal 2",
+/*058*/ "Vibraslap",
+/*059*/ "Ride Cymbal 2",
+/*060*/ "Hi Bongo",
+/*061*/ "Low Bongo",
+/*062*/ "Mute Hi Conga",
+/*063*/ "Open Hi Conga",
+/*064*/ "Low Conga",
+/*065*/ "High Timbale",
+/*066*/ "Low Timbale",
+/*067*/ "High Agogo",
+/*068*/ "Low Agogo",
+/*069*/ "Cabasa",
+/*070*/ "Maracas",
+/*071*/ "Short Whistle",
+/*072*/ "Long Whistle",
+/*073*/ "Short Guiro",
+/*074*/ "Long Guiro",
+/*075*/ "Claves",
+/*076*/ "Hi Wood Block",
+/*077*/ "Low Wood Block",
+/*078*/ "Mute Cuica",
+/*079*/ "Open Cuica",
+/*080*/ "Mute Triangle"
+/*081*/ "Open Triangle" };


Property changes on: tools/trunk/sci/sfx/lists/gm_patches.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/lists/mt32_timbres.c
===================================================================
--- tools/trunk/sci/sfx/lists/mt32_timbres.c	                        (rev 0)
+++ tools/trunk/sci/sfx/lists/mt32_timbres.c	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,181 @@
+/***************************************************************************
+ mt_32_timbres.c Copyright (C) 2000 Rickard Lind
+
+
+ This program may be modified and copied freely according to the terms of
+ the GNU general public license (GPL), as long as the above copyright
+ notice and the licensing information contained herein are preserved.
+
+ Please refer to www.gnu.org for licensing details.
+
+ This work is provided AS IS, without warranty of any kind, expressed or
+ implied, including but not limited to the warranties of merchantibility,
+ noninfringement, and fitness for a specific purpose. The author will not
+ be held liable for any damage caused by this work or derivatives of it.
+
+ By using this source code, you agree to the licensing terms as stated
+ above.
+
+***************************************************************************/
+
+char *MT32_Timbre[128] = {
+/*000*/ "AcouPiano1",
+/*001*/ "AcouPiano2",
+/*002*/ "AcouPiano3",
+/*003*/ "ElecPiano1",
+/*004*/ "ElecPiano2",
+/*005*/ "ElecPiano3",
+/*006*/ "ElecPiano4",
+/*007*/ "Honkytonk ",
+/*008*/ "Elec Org 1",
+/*009*/ "Elec Org 2",
+/*010*/ "Elec Org 3",
+/*011*/ "Elec Org 4",
+/*012*/ "Pipe Org 1",
+/*013*/ "Pipe Org 2",
+/*014*/ "Pipe Org 3",
+/*015*/ "Accordion ",
+/*016*/ "Harpsi 1  ",
+/*017*/ "Harpsi 2  ",
+/*018*/ "Harpsi 3  ",
+/*019*/ "Clavi 1   ",
+/*020*/ "Clavi 2   ",
+/*021*/ "Clavi 3   ",
+/*022*/ "Celesta 1 ",
+/*023*/ "Celesta 2 ",
+/*024*/ "Syn Brass1",
+/*025*/ "Syn Brass2",
+/*026*/ "Syn Brass3",
+/*027*/ "Syn Brass4",
+/*028*/ "Syn Bass 1",
+/*029*/ "Syn Bass 2",
+/*030*/ "Syn Bass 3",
+/*031*/ "Syn Bass 4",
+/*032*/ "Fantasy   ",
+/*033*/ "Harmo Pan ",
+/*034*/ "Chorale   ",
+/*035*/ "Glasses   ",
+/*036*/ "Soundtrack",
+/*037*/ "Atmosphere",
+/*038*/ "Warm Bell ",
+/*039*/ "Funny Vox ",
+/*040*/ "Echo Bell ",
+/*041*/ "Ice Rain  ",
+/*042*/ "Oboe 2001 ",
+/*043*/ "Echo Pan  ",
+/*044*/ "DoctorSolo",
+/*045*/ "Schooldaze",
+/*046*/ "BellSinger",
+/*047*/ "SquareWave",
+/*048*/ "Str Sect 1",
+/*049*/ "Str Sect 2",
+/*050*/ "Str Sect 3",
+/*051*/ "Pizzicato ",
+/*052*/ "Violin 1  ",
+/*053*/ "Violin 2  ",
+/*054*/ "Cello 1   ",
+/*055*/ "Cello 2   ",
+/*056*/ "Contrabass",
+/*057*/ "Harp 1    ",
+/*058*/ "Harp 2    ",
+/*059*/ "Guitar 1  ",
+/*060*/ "Guitar 2  ",
+/*061*/ "Elec Gtr 1",
+/*062*/ "Elec Gtr 2",
+/*063*/ "Sitar     ",
+/*064*/ "Acou Bass1",
+/*065*/ "Acou Bass2",
+/*066*/ "Elec Bass1",
+/*067*/ "Elec Bass2",
+/*068*/ "Slap Bass1",
+/*069*/ "Slap Bass2",
+/*070*/ "Fretless 1",
+/*071*/ "Fretless 2",
+/*072*/ "Flute 1   ",
+/*073*/ "Flute 2   ",
+/*074*/ "Piccolo 1 ",
+/*075*/ "Piccolo 2 ",
+/*076*/ "Recorder  ",
+/*077*/ "Panpipes  ",
+/*078*/ "Sax 1     ",
+/*079*/ "Sax 2     ",
+/*080*/ "Sax 3     ",
+/*081*/ "Sax 4     ",
+/*082*/ "Clarinet 1",
+/*083*/ "Clarinet 2",
+/*084*/ "Oboe      ",
+/*085*/ "Engl Horn ",
+/*086*/ "Bassoon   ",
+/*087*/ "Harmonica ",
+/*088*/ "Trumpet 1 ",
+/*089*/ "Trumpet 2 ",
+/*090*/ "Trombone 1",
+/*091*/ "Trombone 2",
+/*092*/ "Fr Horn 1 ",
+/*093*/ "Fr Horn 2 ",
+/*094*/ "Tuba      ",
+/*095*/ "Brs Sect 1",
+/*096*/ "Brs Sect 2",
+/*097*/ "Vibe 1    ",
+/*098*/ "Vibe 2    ",
+/*099*/ "Syn Mallet",
+/*100*/ "Wind Bell ",
+/*101*/ "Glock     ",
+/*102*/ "Tube Bell ",
+/*103*/ "Xylophone ",
+/*104*/ "Marimba   ",
+/*105*/ "Koto      ",
+/*106*/ "Sho       ",
+/*107*/ "Shakuhachi",
+/*108*/ "Whistle 1 ",
+/*109*/ "Whistle 2 ",
+/*110*/ "BottleBlow",
+/*111*/ "BreathPipe",
+/*112*/ "Timpani   ",
+/*113*/ "MelodicTom",
+/*114*/ "Deep Snare",
+/*115*/ "Elec Perc1",
+/*116*/ "Elec Perc2",
+/*117*/ "Taiko     ",
+/*118*/ "Taiko Rim ",
+/*119*/ "Cymbal    ",
+/*120*/ "Castanets ",
+/*121*/ "Triangle  ",
+/*122*/ "Orche Hit ",
+/*123*/ "Telephone ",
+/*124*/ "Bird Tweet",
+/*125*/ "OneNoteJam",
+/*126*/ "WaterBells",
+/*127*/ "JungleTune" };
+
+char *MT32_RhythmTimbre[30] = {
+/*00*/ "Acou BD   ",
+/*01*/ "Acou SD   ",
+/*02*/ "Acou HiTom",
+/*03*/ "AcouMidTom",
+/*04*/ "AcouLowTom",
+/*05*/ "Elec SD   ",
+/*06*/ "Clsd HiHat",
+/*07*/ "OpenHiHat1",
+/*08*/ "Crash Cym ",
+/*09*/ "Ride Cym  ",
+/*10*/ "Rim Shot  ",
+/*11*/ "Hand Clap ",
+/*12*/ "Cowbell   ",
+/*13*/ "Mt HiConga",
+/*14*/ "High Conga",
+/*15*/ "Low Conga ",
+/*16*/ "Hi Timbale",
+/*17*/ "LowTimbale",
+/*18*/ "High Bongo",
+/*19*/ "Low Bongo ",
+/*20*/ "High Agogo",
+/*21*/ "Low Agogo ",
+/*22*/ "Tambourine",
+/*23*/ "Claves    ",
+/*24*/ "Maracas   ",
+/*25*/ "SmbaWhis L",
+/*26*/ "SmbaWhis S",
+/*27*/ "Cabasa    ",
+/*28*/ "Quijada   ",
+/*29*/ "OpenHiHat2" };


Property changes on: tools/trunk/sci/sfx/lists/mt32_timbres.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/mt32_GM_mapping/Makefile
===================================================================
--- tools/trunk/sci/sfx/mt32_GM_mapping/Makefile	                        (rev 0)
+++ tools/trunk/sci/sfx/mt32_GM_mapping/Makefile	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,15 @@
+CC	=gcc
+CFLAGS	=-O2 -Wall
+objects =main.o
+
+mtgm: $(objects)
+	$(CC) -o mtgm $(objects)
+
+main.o: main.c
+	$(CC) $(CFLAGS) -c main.c
+
+.PHONY: clean distclean
+clean:
+	 rm -f mtgm $(objects)
+distclean:
+	 rm -f mtgm $(objects) *~


Property changes on: tools/trunk/sci/sfx/mt32_GM_mapping/Makefile
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/mt32_GM_mapping/README
===================================================================
--- tools/trunk/sci/sfx/mt32_GM_mapping/README	                        (rev 0)
+++ tools/trunk/sci/sfx/mt32_GM_mapping/README	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,2 @@
+The sourcecode in this directory is not intended to be included in FreeSCI.
+


Property changes on: tools/trunk/sci/sfx/mt32_GM_mapping/README
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/mt32_GM_mapping/gm_patches.c
===================================================================
--- tools/trunk/sci/sfx/mt32_GM_mapping/gm_patches.c	                        (rev 0)
+++ tools/trunk/sci/sfx/mt32_GM_mapping/gm_patches.c	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,198 @@
+/***************************************************************************
+ gm_patches.c Copyright (C) 2000 Rickard Lind
+
+
+ This program may be modified and copied freely according to the terms of
+ the GNU general public license (GPL), as long as the above copyright
+ notice and the licensing information contained herein are preserved.
+
+ Please refer to www.gnu.org for licensing details.
+
+ This work is provided AS IS, without warranty of any kind, expressed or
+ implied, including but not limited to the warranties of merchantibility,
+ noninfringement, and fitness for a specific purpose. The author will not
+ be held liable for any damage caused by this work or derivatives of it.
+
+ By using this source code, you agree to the licensing terms as stated
+ above.
+
+***************************************************************************/
+
+char *GM_Patch[128] = {
+/*000*/ "Acoustic Grand Piano",
+/*001*/ "Bright Acoustic Piano",
+/*002*/ "Electric Grand Piano",
+/*003*/ "Honky-tonk Piano",
+/*004*/ "Electric Piano 1",
+/*005*/ "Electric Piano 2",
+/*006*/ "Harpsichord",
+/*007*/ "Clavinet",
+/*008*/ "Celesta",
+/*009*/ "Glockenspiel",
+/*010*/ "Music Box",
+/*011*/ "Vibraphone",
+/*012*/ "Marimba",
+/*013*/ "Xylophone",
+/*014*/ "Tubular Bells",
+/*015*/ "Dulcimer",
+/*016*/ "Drawbar Organ",
+/*017*/ "Percussive Organ",
+/*018*/ "Rock Organ",
+/*019*/ "Church Organ",
+/*020*/ "Reed Organ",
+/*021*/ "Accordion",
+/*022*/ "Harmonica",
+/*023*/ "Tango Accordion",
+/*024*/ "Acoustic Guitar (nylon)",
+/*025*/ "Acoustic Guitar (steel)",
+/*026*/ "Electric Guitar (jazz)",
+/*027*/ "Electric Guitar (clean)",
+/*028*/ "Electric Guitar (muted)",
+/*029*/ "Overdriven Guitar",
+/*030*/ "Distortion Guitar",
+/*031*/ "Guitar Harmonics",
+/*032*/ "Acoustic Bass",
+/*033*/ "Electric Bass (finger)",
+/*034*/ "Electric Bass (pick)",
+/*035*/ "Fretless Bass",
+/*036*/ "Slap Bass 1",
+/*037*/ "Slap Bass 2",
+/*038*/ "Synth Bass 1",
+/*039*/ "Synth Bass 2",
+/*040*/ "Violin",
+/*041*/ "Viola",
+/*042*/ "Cello",
+/*043*/ "Contrabass",
+/*044*/ "Tremolo Strings",
+/*045*/ "Pizzicato Strings",
+/*046*/ "Orchestral Harp",
+/*047*/ "Timpani",
+/*048*/ "String Ensemble 1",
+/*049*/ "String Ensemble 2",
+/*050*/ "SynthStrings 1",
+/*051*/ "SynthStrings 2",
+/*052*/ "Choir Aahs",
+/*053*/ "Voice Oohs",
+/*054*/ "Synth Voice",
+/*055*/ "Orchestra Hit",
+/*056*/ "Trumpet",
+/*057*/ "Trombone",
+/*058*/ "Tuba",
+/*059*/ "Muted Trumpet",
+/*060*/ "French Horn",
+/*061*/ "Brass Section",
+/*062*/ "SynthBrass 1",
+/*063*/ "SynthBrass 2",
+/*064*/ "Soprano Sax",
+/*065*/ "Alto Sax",
+/*066*/ "Tenor Sax",
+/*067*/ "Baritone Sax",
+/*068*/ "Oboe",
+/*069*/ "English Horn",
+/*070*/ "Bassoon",
+/*071*/ "Clarinet",
+/*072*/ "Piccolo",
+/*073*/ "Flute",
+/*074*/ "Recorder",
+/*075*/ "Pan Flute",
+/*076*/ "Blown Bottle",
+/*077*/ "Shakuhachi",
+/*078*/ "Whistle",
+/*079*/ "Ocarina",
+/*080*/ "Lead 1 (square)",
+/*081*/ "Lead 2 (sawtooth)",
+/*082*/ "Lead 3 (calliope)",
+/*083*/ "Lead 4 (chiff)",
+/*084*/ "Lead 5 (charang)",
+/*085*/ "Lead 6 (voice)",
+/*086*/ "Lead 7 (fifths)",
+/*087*/ "Lead 8 (bass+lead)",
+/*088*/ "Pad 1 (new age)",
+/*089*/ "Pad 2 (warm)",
+/*090*/ "Pad 3 (polysynth)",
+/*091*/ "Pad 4 (choir)",
+/*092*/ "Pad 5 (bowed)",
+/*093*/ "Pad 6 (metallic)",
+/*094*/ "Pad 7 (halo)",
+/*095*/ "Pad 8 (sweep)",
+/*096*/ "FX 1 (rain)",
+/*097*/ "FX 2 (soundtrack)",
+/*098*/ "FX 3 (crystal)",
+/*099*/ "FX 4 (atmosphere)",
+/*100*/ "FX 5 (brightness)",
+/*101*/ "FX 6 (goblins)",
+/*102*/ "FX 7 (echoes)",
+/*103*/ "FX 8 (sci-fi)",
+/*104*/ "Sitar",
+/*105*/ "Banjo",
+/*106*/ "Shamisen",
+/*107*/ "Koto",
+/*108*/ "Kalimba",
+/*109*/ "Bag pipe",
+/*110*/ "Fiddle",
+/*111*/ "Shannai",
+/*112*/ "Tinkle Bell",
+/*113*/ "Agogo",
+/*114*/ "Steel Drums",
+/*115*/ "Woodblock",
+/*116*/ "Taiko Drum",
+/*117*/ "Melodic Tom",
+/*118*/ "Synth Drum",
+/*119*/ "Reverse Cymbal",
+/*120*/ "Guitar Fret Noise",
+/*121*/ "Breath Noise",
+/*122*/ "Seashore",
+/*123*/ "Bird Tweet",
+/*124*/ "Telephone Ring",
+/*125*/ "Helicopter",
+/*126*/ "Applause",
+/*127*/ "Gunshot" };
+
+char *GM_RhythmKey[47] = {
+/*035*/ "Acoustic Bass Drum",
+/*036*/ "Bass Drum 1",
+/*037*/ "Side Stick",
+/*038*/ "Acoustic Snare",
+/*039*/ "Hand Clap",
+/*040*/ "Electric Snare",
+/*041*/ "Low Floor Tom",
+/*042*/ "Closed Hi-Hat",
+/*043*/ "High Floor Tom",
+/*044*/ "Pedal Hi-Hat",
+/*045*/ "Low Tom",
+/*046*/ "Open Hi-Hat",
+/*047*/ "Low-Mid Tom",
+/*048*/ "Hi-Mid Tom",
+/*049*/ "Crash Cymbal 1",
+/*050*/ "High Tom",
+/*051*/ "Ride Cymbal 1",
+/*052*/ "Chinese Cymbal",
+/*053*/ "Ride Bell",
+/*054*/ "Tambourine",
+/*055*/ "Splash Cymbal",
+/*056*/ "Cowbell",
+/*057*/ "Crash Cymbal 2",
+/*058*/ "Vibraslap",
+/*059*/ "Ride Cymbal 2",
+/*060*/ "Hi Bongo",
+/*061*/ "Low Bongo",
+/*062*/ "Mute Hi Conga",
+/*063*/ "Open Hi Conga",
+/*064*/ "Low Conga",
+/*065*/ "High Timbale",
+/*066*/ "Low Timbale",
+/*067*/ "High Agogo",
+/*068*/ "Low Agogo",
+/*069*/ "Cabasa",
+/*070*/ "Maracas",
+/*071*/ "Short Whistle",
+/*072*/ "Long Whistle",
+/*073*/ "Short Guiro",
+/*074*/ "Long Guiro",
+/*075*/ "Claves",
+/*076*/ "Hi Wood Block",
+/*077*/ "Low Wood Block",
+/*078*/ "Mute Cuica",
+/*079*/ "Open Cuica",
+/*080*/ "Mute Triangle"
+/*081*/ "Open Triangle" };


Property changes on: tools/trunk/sci/sfx/mt32_GM_mapping/gm_patches.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/mt32_GM_mapping/lb2map.txt
===================================================================
--- tools/trunk/sci/sfx/mt32_GM_mapping/lb2map.txt	                        (rev 0)
+++ tools/trunk/sci/sfx/mt32_GM_mapping/lb2map.txt	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,118 @@
+  ----------------------------------------------------------------------
+  |  Dagger of Amon Ra   |  Boop boop be doop   |        Wahoo!        |
+--------------------------------------------------------------------------
+| ## | MT-32 Timbre | KSh FTn BR | General MIDI Patch      |  KSh VolA V |
+--------------------------------------------------------------------------
+| 04 |   AcouPiano3 |  00  00 12 | Acoustic Grand Piano    |  000  000 3 |
+| 05 |   Honkytonk  |  00  00 12 | Honky-tonk Piano        |  000  000 3 |
+| 06 | m ClarinetMS |  00  00 12 | Clarinet                |  000 -020 3 |
+| 07 |   Acou Bass1 |  00  00 12 | Acoustic Bass           |  000 -015 3 |
+| 08 |   Trombone 2 |  00  00 12 | Tuba                    |  000  005 3 |
+| 09 | m StrSect1MS |  00  00 12 | String Ensemble 1       |  000  020 3 |
+| 10 | m Fantasy2MS |  00  00 12 | Pad 1 (new age)         |  000  010 3 |
+| 11 |   Flute 2    |  00  00 12 | Flute                   |  000 -020 3 |
+| 12 |   Timpani    |  00  00 12 | Timpani                 |  000 -015 1 |
+| 13 |   Trumpet 1  |  00  00 12 | Trumpet                 |  000  030 3 |
+| 14 | m FrHorn1MS2 |  00  00 12 | French Horn             |  000  000 3 |
+| 15 | m Oboe    MS |  00  00 12 | Oboe                    |  000 -020 3 |
+| 16 | m Pizz    MS |  00  00 12 | Pizzicato Strings       |  000  000 3 |
+| 17 | m CymSwellMS |  00  00 12 | Reverse Cymbal          |  000  000 3 |
+| 18 |   Xylophone  |  00  00 12 | Xylophone               |  000  000 3 |
+| 19 |   Bassoon    |  00  00 12 | Bassoon                 |  000  020 3 |
+| 20 |   Accordion  |  00  00 12 | Accordion               |  000  000 3 |
+| 21 | m BanjoLB2   |  00  00 12 | Banjo                   |  000 -020 3 |
+| 22 |   Marimba    |  00  00 12 | Marimba                 |  000  000 3 |
+| 23 | m WarmPadStr |  00  00 12 | String Ensemble 2       |  000  015 3 |
+| 24 | m BassPizzMS |  00  00 12 | Pizzicato Strings       | -012  000 3 |
+| 25 | m WoodBlox   |  00  00 12 | Woodblock               |  000  000 3 |
+| 26 |   Vibe 1     |  00  00 00 | Vibraphone              |  000 -010 3 |
+| 27 |   Sax 4      |  00  00 12 | Tenor Sax               |  000  000 3 |
+| 28 | m Glock   MS |  00  00 12 | Glockenspiel            |  000  000 3 |
+| 29 |   Koto       |  00  00 12 | Koto                    |  000  000 3 |
+| 30 | m Taiko      |  00  00 12 | Taiko Drum              |  012 -010 1 |
+| 31 |   Guitar 1   |  00  00 12 | Acoustic Guitar (nylon) |  000 -035 3 |
+| 32 | m Bell Tree  |  00  00 12 | Glockenspiel            |  000  000 3 |
+| 33 |   Sitar      |  00  00 12 | Sitar                   |  000 -010 3 |
+| 34 |   Harp 1     |  00  00 12 | Orchestral Harp         |  000 -025 3 |
+| 45 | m Fantasy2MS |  00  00 12 | Tubular Bells           |  012  010 3 |
+| 46 | m Window     |  00  00 12 | Reverse Cymbal          | -048  000 3 |
+| 47 | m Snare      |  00  00 00 | Woodblock               |  000  000 0 |
+| 48 | m CracklesMS |  00  00 12 | Woodblock               |  000  000 0 |
+| 49 | m TireSqueal |  00  00 12 |                         |             |
+| 50 | m Gurgle     |  00  00 12 |                         |             |
+| 51 | m Toilet     |  00  00 12 |                         |             |
+| 52 | m hiss       |  00  00 12 |                         |             |
+| 53 | m IceBreakMS |  00  00 12 |                         |             |
+| 54 | m DoorSlamMS |  00  00 12 | Woodblock               | -012  000 0 |
+| 55 | m CreakyDLL1 |  00  00 12 |                         |             |
+| 56 | m Armor   MS |  00  00 12 | Agogo                   |  012 -020 0 |
+| 57 | m RatSqueek  |  00  00 12 | Guitar Fret Noise       |  012  000 3 |
+| 58 | m StoneDr MS |  00  00 12 | Reverse Cymbal          | -048  000 3 |
+| 59 | m NewSplatMS |  00  00 12 | Melodic Tom             |  000  000 2 |
+| 60 | m Splash  MS |  00  00 12 |                         |             |
+| 61 | m Bubbles    |  00  00 12 |                         |             |
+| 62 | m ChurchB MS |  00  00 12 | Tubular Bells           |  000  000 3 |
+| 63 | m Thud    MS |  00  00 12 | Taiko Drum              | -012  000 2 |
+| 64 | m TYPIMG     |  00  00 12 |                         |             |
+| 65 | m Lock    MS |  00  00 12 | Woodblock               |  000  000 0 |
+| 66 | m Window     |  00  00 12 | Reverse Cymbal          |  000  000 3 |
+| 67 | m CabEngine  |  00  00 12 | Tenor Sax               | -060  050 3 |
+| 68 | m Ocean   MS |  00  00 12 |                         |             |
+| 69 | m Wind    MS |  00  00 12 |                         |             |
+| 70 |   Telephone  |  00  00 12 | Telephone Ring          |  000  000 3 |
+| 71 |   Bird Tweet |  00  00 12 | Bird Tweet              |  000  000 3 |
+| 72 | m Explode MS |  00  00 12 | Gunshot                 | -012 -015 3 |
+| 73 | m SwmpBackgr |  00  00 12 |                         |             |
+| 74 | m Toing      |  00  00 12 |                         |             |
+| 75 | m  Lone Wolf |  00  00 12 |                         |             |
+| 76 |   Whistle 2  |  00  00 12 | Whistle                 |  000  000 3 |
+| 77 | m seagulls   |  00  00 12 | Bird Tweet              |  000  000 3 |
+| 78 | m Scrubin'MS |  00  00 12 | Reverse Cymbal          |  000  000 3 |
+| 79 | m SqurWaveMS |  00  00 12 | Lead 1 (square)         |  000  000 3 |
+| 80 | m InHale  MS |  00  00 12 | Breath Noise            |  000  025 3 |
+| 81 | m Arena2  MS |  00  00 12 | Applause                |  000  000 3 |
+| 82 | m ArenaNoSus |  00  00 12 | Applause                |  000  000 3 |
+| 92 |   AcouPiano1 |  00  00 02 |                         |             |
+| 93 |   AcouPiano1 |  00  00 02 |                         |             |
+| 94 |   AcouPiano1 |  00  00 02 |                         |             |
+| 95 |   AcouPiano1 |  00  00 02 |                         |             |
+--------------------------------------------------------------------------
+         | ## | MT-32 Timbre |  OL PP | General MIDI Rhythm Key |
+         --------------------------------------------------------
+         | 35 | r Acou BD    | 100 07 | Acoustic Bass Drum      |
+         | 36 | r Acou BD    | 100 07 | Acoustic Bass Drum      |
+         | 37 | r Rim Shot   | 100 06 | Side Stick              |
+         | 38 | r Acou SD    | 100 07 | Electric Snare          |
+         | 39 | r Hand Clap  | 100 08 | Hand Clap               |
+         | 40 | r Acou SD    | 100 06 | Electric Snare          |
+         | 41 | r AcouLowTom | 100 11 | Low Floor Tom           |
+         | 42 | r Clsd HiHat | 100 06 | Closed Hi-Hat           |
+         | 43 | r AcouLowTom | 100 11 | High Floor Tom          |
+         | 44 | r OpenHiHat2 | 100 06 | Pedal Hi-Hat            |
+         | 45 | r AcouMidTom | 100 08 | Low Tom                 |
+         | 46 | r OpenHiHat1 | 100 06 | Open Hi-Hat             |
+         | 47 | r AcouMidTom | 100 08 | Low-Mid Tom             |
+         | 48 | r Acou HiTom | 100 03 | Hi-Mid Tom              |
+         | 49 | r Crash Cym  | 100 06 | Crash Cymbal 1          |
+         | 50 | r Acou HiTom | 100 03 | High Tom                |
+         | 51 | r Ride Cym   | 100 08 | Ride Cymbal 1           |
+         | 52 | m CymSwellMS | 100 07 |                         |
+         | 54 | r Tambourine | 100 09 | Tambourine              |
+         | 55 | m ChokeCrash | 100 07 | Crash Cymbal 2          |
+         | 56 | r Cowbell    | 100 07 | Cowbell                 |
+         | 60 | r High Bongo | 100 02 | Hi Bongo                |
+         | 61 | r Low Bongo  | 100 04 | Low Bongo               |
+         | 62 | r Mt HiConga | 100 08 | Mute Hi Conga           |
+         | 63 | r High Conga | 100 09 | Open Hi Conga           |
+         | 64 | r Low Conga  | 100 10 | Low Conga               |
+         | 65 | r Hi Timbale | 100 07 | High Timbale            |
+         | 66 | r LowTimbale | 100 05 | Low Timbale             |
+         | 67 | r High Agogo | 100 02 | High Agogo              |
+         | 68 | r Low Agogo  | 100 02 | Low Agogo               |
+         | 69 | r Cabasa     | 100 09 | Cabasa                  |
+         | 70 | r Maracas    | 100 04 | Maracas                 |
+         | 71 | r SmbaWhis S | 100 09 | Short Whistle           |
+         | 72 | r SmbaWhis L | 100 09 | Long Whistle            |
+         | 73 | r Quijada    | 100 00 |                         |
+         | 75 | r Claves     | 100 12 | Claves                  |
+         --------------------------------------------------------


Property changes on: tools/trunk/sci/sfx/mt32_GM_mapping/lb2map.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/mt32_GM_mapping/main.c
===================================================================
--- tools/trunk/sci/sfx/mt32_GM_mapping/main.c	                        (rev 0)
+++ tools/trunk/sci/sfx/mt32_GM_mapping/main.c	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,157 @@
+/***************************************************************************
+ main.c Copyright (C) 2000 Rickard Lind
+
+
+ This program may be modified and copied freely according to the terms of
+ the GNU general public license (GPL), as long as the above copyright
+ notice and the licensing information contained herein are preserved.
+
+ Please refer to www.gnu.org for licensing details.
+
+ This work is provided AS IS, without warranty of any kind, expressed or
+ implied, including but not limited to the warranties of merchantibility,
+ noninfringement, and fitness for a specific purpose. The author will not
+ be held liable for any damage caused by this work or derivatives of it.
+
+ By using this source code, you agree to the licensing terms as stated
+ above.
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "mt32_timbres.c"
+#include "gm_patches.c"
+
+void analyze(unsigned char *patch001, unsigned int length001,
+	     unsigned char *patch004, unsigned int length004);
+
+int main(int argc, char **argv)
+{
+  int fd1, fd2;
+  unsigned char *patch001;
+  unsigned char *patch004;
+  unsigned int length001, length004;
+
+  if (argc < 2)
+    return -1;
+
+  if ((fd1 = open(argv[1], O_RDONLY)) < 0)
+    return -1;
+  if ((fd2 = open(argv[2], O_RDONLY)) < 0) {
+    close(fd1);
+    return -1;
+  }
+
+  patch001 = (unsigned char *)sci_malloc(65536);
+  length001 = read(fd1, patch001, 65536);
+  close(fd1);
+
+  patch004 = (unsigned char *)sci_malloc(65536);
+  length004 = read(fd2, patch004, 65536);
+  close(fd2);
+
+  if (patch001[0] == 0x89 && patch001[1] == 0x00)
+    if (patch004[0] == 0x89 && patch004[1] == 0x00)
+      analyze(patch001 + 2, length001 - 2, patch004 + 2, length004 - 2);
+    else
+      analyze(patch001 + 2, length001 - 2, patch004, length004);
+  else
+    if (patch004[0] == 0x89 && patch004[1] == 0x00)
+      analyze(patch001, length001, patch004 + 2, length004 - 2);
+    else
+      analyze(patch001, length001, patch004, length004);
+
+  free(patch001);
+  free(patch004);
+
+  return 0;
+}
+
+void analyze(unsigned char *patch001, unsigned int length001,
+	     unsigned char *patch004, unsigned int length004)
+{
+  int i;
+  unsigned char *mt32patch;
+  unsigned char *mt32rhythm;
+
+  printf("  ----------------------------------------------------------------------\n");
+  printf("  | %.20s | %.20s | %.20s |\n", patch001, patch001 + 20, patch001 + 40);
+  printf("--------------------------------------------------------------------------\n");
+  printf("| ## | MT-32 Timbre | KSh FTn BR | General MIDI Patch      |  KSh VolA V |\n");
+  printf("--------------------------------------------------------------------------\n");
+  for (i = 0; i < 96; i++) {
+    if (i < 48)
+      mt32patch = patch001 + 107 + i * 8;
+    else
+      mt32patch = patch001 + 110 + i * 8 + patch001[491] * 246;
+
+    if (!((mt32patch[0] == 0) &&
+	  (mt32patch[1] == 0) &&
+	  (mt32patch[2] == 0) &&
+	  (mt32patch[3] == 0) &&
+	  (mt32patch[4] == 0) &&
+	  (mt32patch[5] == 0) &&
+	  (mt32patch[6] == 0) &&
+	  (mt32patch[7] == 0))) {
+      printf("| %02i |", i);
+      if (mt32patch[0] < 2)
+	if (mt32patch[0] == 0)
+	  printf("   %.10s", MT32_Timbre[mt32patch[1]]);
+	else
+	  printf("   %.10s", MT32_Timbre[mt32patch[1] + 64]);
+      else if (mt32patch[0] == 2)
+	printf(" m %.10s", patch001 + 492 + mt32patch[1] * 246);
+      else if (mt32patch[0] == 3)
+	printf(" r %.10s", MT32_RhythmTimbre[mt32patch[1]]);
+      printf(" | % 03i % 03i %02i | ",
+	     mt32patch[2] - 24,
+	     mt32patch[3] - 50,
+	     mt32patch[4]);
+      if (patch004[i] != 0xFF) {
+	printf("%-23s ", GM_Patch[patch004[i]]);
+	printf("| % 04i % 04i %i |",
+	       *((signed char *)(patch004) + i + 128),
+	       *((signed char *)(patch004) + i + 256),
+	       patch004[i + 513]);
+      } else
+	printf("                        |             |");
+      printf("\n");
+    }
+  }
+  printf("--------------------------------------------------------------------------\n");
+  printf("         | ## | MT-32 Timbre |  OL PP | General MIDI Rhythm Key |\n");
+  printf("         --------------------------------------------------------\n");
+  for (i = 0; i < 64; i++)
+    {
+      mt32rhythm = patch001 + 880 + i * 4 + patch001[491] * 246;
+      if ((mt32rhythm[0] < 94) &&
+	  !((mt32rhythm[0] == 0) &&
+	    (mt32rhythm[1] == 0) &&
+	    (mt32rhythm[2] == 0) &&
+	    (mt32rhythm[3] == 0)) &&
+	  !((mt32rhythm[0] == 1) &&
+	    (mt32rhythm[1] == 1) &&
+	    (mt32rhythm[2] == 1) &&
+	    (mt32rhythm[3] == 1))) {
+	printf("         | %02i |", i + 24);
+	if (mt32rhythm[0] < 64)
+	  printf(" m %.10s", patch001 + 492 + mt32rhythm[0] * 246);
+	else
+	  printf(" r %.10s", MT32_RhythmTimbre[mt32rhythm[0] - 64]);
+	printf(" | %03i %02i | ", mt32rhythm[1], mt32rhythm[2]);
+	if (patch004[384 + i + 24] != 0xFF)
+	  printf("%-23s |", GM_RhythmKey[patch004[384 + i + 24] - 35]);
+	else
+	  printf("                        |");
+	printf("\n");
+      }
+    }
+  printf("         --------------------------------------------------------\n");
+  return;
+}


Property changes on: tools/trunk/sci/sfx/mt32_GM_mapping/main.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/mt32_GM_mapping/mt32_timbres.c
===================================================================
--- tools/trunk/sci/sfx/mt32_GM_mapping/mt32_timbres.c	                        (rev 0)
+++ tools/trunk/sci/sfx/mt32_GM_mapping/mt32_timbres.c	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,181 @@
+/***************************************************************************
+ mt32_timbres.c Copyright (C) 2000 Rickard Lind
+
+
+ This program may be modified and copied freely according to the terms of
+ the GNU general public license (GPL), as long as the above copyright
+ notice and the licensing information contained herein are preserved.
+
+ Please refer to www.gnu.org for licensing details.
+
+ This work is provided AS IS, without warranty of any kind, expressed or
+ implied, including but not limited to the warranties of merchantibility,
+ noninfringement, and fitness for a specific purpose. The author will not
+ be held liable for any damage caused by this work or derivatives of it.
+
+ By using this source code, you agree to the licensing terms as stated
+ above.
+
+***************************************************************************/
+
+char *MT32_Timbre[128] = {
+/*000*/ "AcouPiano1",
+/*001*/ "AcouPiano2",
+/*002*/ "AcouPiano3",
+/*003*/ "ElecPiano1",
+/*004*/ "ElecPiano2",
+/*005*/ "ElecPiano3",
+/*006*/ "ElecPiano4",
+/*007*/ "Honkytonk ",
+/*008*/ "Elec Org 1",
+/*009*/ "Elec Org 2",
+/*010*/ "Elec Org 3",
+/*011*/ "Elec Org 4",
+/*012*/ "Pipe Org 1",
+/*013*/ "Pipe Org 2",
+/*014*/ "Pipe Org 3",
+/*015*/ "Accordion ",
+/*016*/ "Harpsi 1  ",
+/*017*/ "Harpsi 2  ",
+/*018*/ "Harpsi 3  ",
+/*019*/ "Clavi 1   ",
+/*020*/ "Clavi 2   ",
+/*021*/ "Clavi 3   ",
+/*022*/ "Celesta 1 ",
+/*023*/ "Celesta 2 ",
+/*024*/ "Syn Brass1",
+/*025*/ "Syn Brass2",
+/*026*/ "Syn Brass3",
+/*027*/ "Syn Brass4",
+/*028*/ "Syn Bass 1",
+/*029*/ "Syn Bass 2",
+/*030*/ "Syn Bass 3",
+/*031*/ "Syn Bass 4",
+/*032*/ "Fantasy   ",
+/*033*/ "Harmo Pan ",
+/*034*/ "Chorale   ",
+/*035*/ "Glasses   ",
+/*036*/ "Soundtrack",
+/*037*/ "Atmosphere",
+/*038*/ "Warm Bell ",
+/*039*/ "Funny Vox ",
+/*040*/ "Echo Bell ",
+/*041*/ "Ice Rain  ",
+/*042*/ "Oboe 2001 ",
+/*043*/ "Echo Pan  ",
+/*044*/ "DoctorSolo",
+/*045*/ "Schooldaze",
+/*046*/ "BellSinger",
+/*047*/ "SquareWave",
+/*048*/ "Str Sect 1",
+/*049*/ "Str Sect 2",
+/*050*/ "Str Sect 3",
+/*051*/ "Pizzicato ",
+/*052*/ "Violin 1  ",
+/*053*/ "Violin 2  ",
+/*054*/ "Cello 1   ",
+/*055*/ "Cello 2   ",
+/*056*/ "Contrabass",
+/*057*/ "Harp 1    ",
+/*058*/ "Harp 2    ",
+/*059*/ "Guitar 1  ",
+/*060*/ "Guitar 2  ",
+/*061*/ "Elec Gtr 1",
+/*062*/ "Elec Gtr 2",
+/*063*/ "Sitar     ",
+/*064*/ "Acou Bass1",
+/*065*/ "Acou Bass2",
+/*066*/ "Elec Bass1",
+/*067*/ "Elec Bass2",
+/*068*/ "Slap Bass1",
+/*069*/ "Slap Bass2",
+/*070*/ "Fretless 1",
+/*071*/ "Fretless 2",
+/*072*/ "Flute 1   ",
+/*073*/ "Flute 2   ",
+/*074*/ "Piccolo 1 ",
+/*075*/ "Piccolo 2 ",
+/*076*/ "Recorder  ",
+/*077*/ "Panpipes  ",
+/*078*/ "Sax 1     ",
+/*079*/ "Sax 2     ",
+/*080*/ "Sax 3     ",
+/*081*/ "Sax 4     ",
+/*082*/ "Clarinet 1",
+/*083*/ "Clarinet 2",
+/*084*/ "Oboe      ",
+/*085*/ "Engl Horn ",
+/*086*/ "Bassoon   ",
+/*087*/ "Harmonica ",
+/*088*/ "Trumpet 1 ",
+/*089*/ "Trumpet 2 ",
+/*090*/ "Trombone 1",
+/*091*/ "Trombone 2",
+/*092*/ "Fr Horn 1 ",
+/*093*/ "Fr Horn 2 ",
+/*094*/ "Tuba      ",
+/*095*/ "Brs Sect 1",
+/*096*/ "Brs Sect 2",
+/*097*/ "Vibe 1    ",
+/*098*/ "Vibe 2    ",
+/*099*/ "Syn Mallet",
+/*100*/ "Wind Bell ",
+/*101*/ "Glock     ",
+/*102*/ "Tube Bell ",
+/*103*/ "Xylophone ",
+/*104*/ "Marimba   ",
+/*105*/ "Koto      ",
+/*106*/ "Sho       ",
+/*107*/ "Shakuhachi",
+/*108*/ "Whistle 1 ",
+/*109*/ "Whistle 2 ",
+/*110*/ "BottleBlow",
+/*111*/ "BreathPipe",
+/*112*/ "Timpani   ",
+/*113*/ "MelodicTom",
+/*114*/ "Deep Snare",
+/*115*/ "Elec Perc1",
+/*116*/ "Elec Perc2",
+/*117*/ "Taiko     ",
+/*118*/ "Taiko Rim ",
+/*119*/ "Cymbal    ",
+/*120*/ "Castanets ",
+/*121*/ "Triangle  ",
+/*122*/ "Orche Hit ",
+/*123*/ "Telephone ",
+/*124*/ "Bird Tweet",
+/*125*/ "OneNoteJam",
+/*126*/ "WaterBells",
+/*127*/ "JungleTune" };
+
+char *MT32_RhythmTimbre[30] = {
+/*00*/ "Acou BD   ",
+/*01*/ "Acou SD   ",
+/*02*/ "Acou HiTom",
+/*03*/ "AcouMidTom",
+/*04*/ "AcouLowTom",
+/*05*/ "Elec SD   ",
+/*06*/ "Clsd HiHat",
+/*07*/ "OpenHiHat1",
+/*08*/ "Crash Cym ",
+/*09*/ "Ride Cym  ",
+/*10*/ "Rim Shot  ",
+/*11*/ "Hand Clap ",
+/*12*/ "Cowbell   ",
+/*13*/ "Mt HiConga",
+/*14*/ "High Conga",
+/*15*/ "Low Conga ",
+/*16*/ "Hi Timbale",
+/*17*/ "LowTimbale",
+/*18*/ "High Bongo",
+/*19*/ "Low Bongo ",
+/*20*/ "High Agogo",
+/*21*/ "Low Agogo ",
+/*22*/ "Tambourine",
+/*23*/ "Claves    ",
+/*24*/ "Maracas   ",
+/*25*/ "SmbaWhis L",
+/*26*/ "SmbaWhis S",
+/*27*/ "Cabasa    ",
+/*28*/ "Quijada   ",
+/*29*/ "OpenHiHat2" };


Property changes on: tools/trunk/sci/sfx/mt32_GM_mapping/mt32_timbres.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: tools/trunk/sci/sfx/mt32_GM_mapping/pq1map.txt
===================================================================
--- tools/trunk/sci/sfx/mt32_GM_mapping/pq1map.txt	                        (rev 0)
+++ tools/trunk/sci/sfx/mt32_GM_mapping/pq1map.txt	2009-02-18 11:28:48 UTC (rev 38470)
@@ -0,0 +1,135 @@
+  ----------------------------------------------------------------------
+  |  ..THE DEATH ANGEL.. |    POLICE QUEST I    | <THANKS FOR PLAYING> |
+--------------------------------------------------------------------------
+| ## | MT-32 Timbre | KSh FTn BR | General MIDI Patch      |  KSh VolA V |
+--------------------------------------------------------------------------
+| 00 | m FEEDBAK AX |  00  00 12 | Distortion Guitar       | -012  065 3 |
+| 01 | m REV CYMBAL |  00  00 12 | Reverse Cymbal          |  000  000 0 |
+| 02 | m ANALOG SYN |  00  00 12 | Pad 3 (polysynth)       |  000  127 3 |
+| 03 | m STACKBASS  |  00  00 12 | Slap Bass 2             | -012  100 3 |
+| 04 | m ORGAN B    |  00  00 12 | Drawbar Organ           |  000  055 3 |
+| 05 |   Syn Mallet |  00  00 12 | Dulcimer                |  000  000 0 |
+| 06 | m HARD RIDE  |  00  00 12 |                         |             |
+| 07 |   Orche Hit  |  00  00 12 | Orchestra Hit           |  000  000 0 |
+| 08 | m HEFTY BASS |  00  00 12 | Electric Bass (finger)  | -024  100 3 |

@@ Diff output truncated at 100000 characters. @@

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