Game Audio decoder 1.10. An input plugin for Foobar2000 to play game files.
---------------------------------------------------------------------------

Foo_game (formerly foo_sc68) is a foobar2000 input/archive plugin. It allows
Foobar2000 to play files written in a number of formats used by commercial
games in the mid-90s. This includes Westwood's Aud file format, Sierra
Online's Resource.sfxs / Auds as well as the EA ADPCM format.

If you think the name "Game Audio decoder" resembles a certain player made
by Valery V. Anisimovsky you are correct. Much of this plugin is based on
the information that Valery made available with the Game Audio Player,
available here: <http://bim.km.ru/gap>.

Of course SC68 support hasn't gone away. Foo_Game still plays the SC68
files but also adds on Foobar subsong support and per-track metadata,
allowing you to change the order of playback in your lists.

Plugin status: Beta.
Any feedback on the plugin (including failure.txt) is appreciated.


Frequently Asked Questions
--------------------------

Q. Why should I keep this plugin other than to fill up hard disk space?

   This plugin allows you to play music formats created from Westwood Studios,
   Sierra Online, EA Games, Core Design, Timegate Studios, Funcom, Commodore
   and Atari. If you do not have any of these games or music files, then by
   all means remove this plugin.

   Supported formats are AUD, ISS, XARC, WAD, SC68, RWD, MUS, IDX/DAT,
   ASF (EA games), SFX, and BIG.


Q. How do I setup this plugin? I can't get the plugin to start. I get an error
   on startup.

   This plugin requires Foobar2000 0.9x, version 0.9.2 or higher is recommended,
   although this plugin still works in earlier 0.9x versions. The contents of
   the plugin archive need to be extracted into Foobar2000's Components folder,
   otherwise the plugins will fail to load.

   If that's not the problem, try enabling verbose logging in the preferences
   to see if that may shed any light.


Q. I add a file but nothing happens when I try to play it. I get a crash when
   I try to play this file.

   The required plugin may has been disabled in the preferences. Go to Input ->
   foo_game where you can toggle support for several formats. If debug logging
   is enabled you will also find info about disabled plugins in the log file.
   If you get a crash see the last question.


Q. What are the System Requirements for running the plugin?

   The WAD, ISS and AUD plugins should run in any system capable of running
   Foobar2000 0.9. The SFX, IDX, BIGF and RWD plugins may require a little more
   processing power, but if you can play MP3s you should have no trouble with
   these plugins either.

   The EA Decoder is a different story. The current code is rather slow and likely
   use up to 100% CPU cycles on a 450MHz CPU, even a 700MHz CPU may have trouble.


Q. Why didn't you merge your features into KarLKoX's plugin (foo_input_aud)?

   I emailed KarLKoX twice with the updated code but received no response, so
   I must assume that he stopped working on the plugin.


Q. Your plugin plays back too many formats. Is there a way I can disable some of
   the supported file extensions?

   In the preferences section under Input -> foo_game you can disable or enable any
   of the supported extensions. You can also choose to ignore the file extension
   so the plugin will attempt to play the file anyway.

   Note that some plugins are disabled by default. These can be enabled but may
   destabilize Foobar2000 if you are not careful.


Q. WAD, eh? Does that include Doom files?

   The plugin supports only the WADs from Core Design's Tomb Raider 3. Doom WADs
   are unsupported.


Q. I think I have found a new bug with your plugin that's not mentioned anywhere.

   Send me an email detailing as much of the following as you can:

   - Your OS version, foo_game version and Foobar2000 version
   - Which checkboxes you have selected in the plugin preferences
   - Console output with logging mode enabled (if available)
   - Foobar2000 crash log (if present)
   - Name of the music file that caused the bug
   - Online link to the music file that caused the crash (if available)
   - How to reproduce the crash

   Don't worry if you cannot provide all of this information, just send what you
   can. Post this info to the Foobar2000 forums, or if that's not an option send
   an email to: <shexec32@aol.com>


Feature Matrix
--------------

The table below gives an overview of the supported features for each plugin.

+----------+-------------+
|Name      |Gigo         |
+----------+-------------+
|SC68      |Yes (fixed?) |
|AUD       |No           |
|AUD (Old) |No           |
|ISS       |No           |
|SFX       |Unknown      |
|MUS       |Yes          |
|DCT       |Yes          |
+----------+-------------+

The following are implemented as archive plugins, and as such act more like ZIP files.

+----------+-------------+
|Name      |Gigo         |
+----------+-------------+
|WAD       |No           |
|RWD       |No           |
|IDX       |No           |
|BIGF      |No           |
+----------+-------------+

Key:

Name - The name of the input plugin.
Gigo - Whether the plugin has known security issues (or crashes on invalid files).

All plugins are seekable. All plugins are able to extract subsongs from larger files
(or multi track files). If a plugin causes instability, it can be disabled. For seeking
to work the files must be seekable, of known size and can report its position.


Known bugs
----------

- The current version of Game Audio Decoder doesn't work with Foobar2000 v0.8.3.
  The last release compatible with Foobar2000 0.8.3 was v1.04.

- WAD sounds from Doom cannot be played, it's a different format to the Tomb Raider III
  cdaudio.wad.

- None of the plugins support writing of any metadata tags. Probably a good idea as the
  games would stop working otherwise.

- After upgrading the Game Audio Decoder plugin, present songs in the playlist may cease
  to work. As a workaround delete the present songs and re-import them into the playlist.

- The EA decoder is a new plugin early in development. Error handling has not been added
  yet, therefore Foobar2000 may easily crash on EA files, particularly newer ones.

- Due to a change made in Game Audio Decoder v1.04, some low frequency AUDs may cease to
  play. If this happens to you please contact me.

- With the exception of the SC68, SOL and IMAADPCM auds all seeking uses a fast but
  inaccurate method to calculate song offsets, especially for VBR style tracks. Symptoms
  include files terminating too soon or playing beyond the end of track.

  The reason SC68, SOL and IMAADPCM auds don't exhibit this symptom is because these
  plugins use brute force decoding of the PCM data to seek to the exact location. That's
  also why seeking is slower with these files.


History
-------

v1.10, Dec 2008:
 - Compiled with updated SDKs/Libraries (Visual C++ 2008, Foobar 0.9.6, Libcurl 7.19.2, SC68 Dec 2006)
 - Added BIGF archive plugin for EA's BIG files
 - Minor updates to the SC68 plugin
 - The CRT runtimes are no longer included with the plugin. You may need to download the following
   package to get the plugin to run:
   <http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en>


v1.08, May 2006:
 - Got rid of that stupid foo_delegator crap
 - Foo_game is now licenced on a per-file basis. Although the component as a whole is still licenced
   under the GPL, portions of code are now available under a less restrictive licence.
 - Other misc cleanup (source organisation, using new 0.9 interfaces)


v1.07, Apr 2006:
 - Adding a track that is supposed to be handled by foo_game but is corrupted caused a 100% chance
   of a crash. This has been fixed.
 - The patched SC68 from XSC has been merged into the foo_game source tree
 - Relaxed some of the SC68 validation


v1.06, Apr 2006:
 - Added support for IDX/DAT format from Rome Total War
 - Finished seeking features, all formats are now seekable
 - Corrected bug where SC68 does not load unless you have Visual Studio 2005 installed


v1.05, Apr 2006:
 - The plugin now only works with Foobar2000 0.9x
 - SC68's replay files are now loaded from resources. You can now delete the replay directory
   if it exists in your components folder
 - Runtime DLLs are now packaged with the plugin. Extract the plugin archive with full paths.
 - For safety reasons the ignore file extensions option defaults to "disabled" now


v1.04, Nov 2005:
 - Updated the version numbers
 - Added preliminary support for EA's ADPCM format (slow, unstable, very buggy, security holes
   galore, crashes everywhere)
 - Improvements to the Sierra online plugin
 - Subsong indexing is now much faster
 - Implemented subsong indexing for AUD. If you want to play Blade Runner you will have to check
   the option "ignore file extensions (slow)".


v1.03, Oct 2005:
 - Updated the SC68 library to the latest CVS
 - Enabled SC68 debug routines. This should fix the security bugs with SC68.
 - SC68 routines are now implemented in a separate DLL
 - The main package now contains a mini SC68 package
 - Switched to Chris Moeller's DLL manager for SC68 management. This should fix the multiple
   instance issues with SC68.
 - SC68 subsongs are now seekable (if somewhat slow)
 - Seeking Westwood AUDs should now be faster, especially for seekback.
 - Fixed seeking error in ISS plugin
 - Attempt to fix the Sierra related bugs
 - Added extra sanity checking for WADs
 - Re-enabled the RWD plugin
 - Fixed off-by-one error in a directory parsing routine


v1.02, Sep 2005:
 - Finished RWD support (format used by Timegate Studios). Now the plugin also supports RWDs.
 - WAD plugin is now an archive plugin, meaning it acts more like a ZIP than a custom OGG.
   The RWD plugin is also an archive plugin.
 - ISS plugin can now play tracks embedded in resources (XARC). XARC is now supported.
 - Fixed bug that caused the playlist to stop when seeking to the end of an AUD
 - Seeking the newer Westwood Auds should now be a little faster
 - Fixed SC68 regression that caused some music to be skipped at the start
 - You can now read info from an SC68 whilst playing another
 - Subsong support now detects if an excessive number of tracks are being added


v1.01, Sep 2005:
 - Plugin now also supports playback of ISS, WAD, AUD, SFX. Thus foo_sc68 has been renamed
   to foo_game.
 - Preliminary development on RWD started (incomplete).
 - If SC68 is not installed, the plugin no longer crashes on startup
 - SC68 plugin no longer slows down your playlist performance in Windows 2000 and earlier
 - Removed requirement for unicows.dll
 - Removed requirement for filenames to be named properly
 - Added a configuration dialog


v1.00, Jul 2005:
 - Foo_SC68 is a Foobar2000 input plugin that can play music from SC68 files
 - Initial release


v0.00, Jun 2005:
 - Development started


Acknowledgements
----------------

Valery V. Anisimovsky - Manufacturer of the Game Audio player (http://bim.km.ru/gap)
 Many thanks to Valery for giving away a wealth of information regarding the ADPCM
 formats for free (information which is worth millions to commercial companies).
 Without Valery's information, this plugin would not support any of the game musics
 it can play back (includes AUD SFX ISS WAD).

Ben Sashipa - Architect of the sc68 file format (http://sc68.atari.org)
 For the source code to the sc68 playback engine. Without him I wouldn't have any
 SC68 musics to play nor an SDK to play them back with.

Joe Schlimgen - author of RWD Extractor (macronx@comcast.net)
 For providing info on the RWD format by Timegate Studios.

Vercingetorix - author of IDX Extractor (http://www.twcenter.net)
 For deciphering the music format used by Creative Assembly and opening the source
 to his IDX extractor, which proved enormously useful.

The Foobar2000 team - Creators of Foobar2000 (http://www.foobar2000.org)
 For making the most comprehensive audio player in the world, and the SDK that
 allowed me to create this plugin.

Kode54 - Author of foo_sid (http://static.morbo.org/kode54)
 For showing me how to do subsong indexing in Foobar2000.

Googer - Author of foo_gym (http://pelit.koillismaa.fi/plugins/index.php)
 For providing me with a sample input plugin, so I could get off my feet.


Licence
-------

Although the component as a whole is licenced under the GNU General Public Licence
portions of this software are available for use under less restrictive licences.
Consult the top of each file to determine the exact licence.

http://www.gnu.org/copyleft/gpl.html.

		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

			    Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

		    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

			    NO WARRANTY

  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

		     END OF TERMS AND CONDITIONS

Oshah [shexec32]
http://shexec32.serveftp.net
December 2008