Index: dists/msvc9/scummvm-tfmx.sln
===================================================================
--- dists/msvc9/scummvm-tfmx.sln	(Revision 0)
+++ dists/msvc9/scummvm-tfmx.sln	(Revision 0)
@@ -0,0 +1,20 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scummvm", "scummvm-tfmx.vcproj", "{8434CB15-D08F-427D-9E6D-581AE5B28440}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{8434CB15-D08F-427D-9E6D-581AE5B28440}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8434CB15-D08F-427D-9E6D-581AE5B28440}.Debug|Win32.Build.0 = Debug|Win32
+		{8434CB15-D08F-427D-9E6D-581AE5B28440}.Release|Win32.ActiveCfg = Release|Win32
+		{8434CB15-D08F-427D-9E6D-581AE5B28440}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: dists/msvc9/scummvm-tfmx.vcproj
===================================================================
--- dists/msvc9/scummvm-tfmx.vcproj	(Revision 0)
+++ dists/msvc9/scummvm-tfmx.vcproj	(Revision 0)
@@ -0,0 +1,1778 @@
+<?xml version="1.0" encoding="windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="scummvm"
+	ProjectGUID="{8434CB15-D08F-427D-9E6D-581AE5B28440}"
+	RootNamespace="scummvm"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(SolutionName)-$(ConfigurationName)"
+			IntermediateDirectory="$(SolutionDir)$(SolutionName)-$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702 /wd4996"
+				Optimization="0"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="../../;../../engines"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				BufferSecurityCheck="true"
+				EnableFunctionLevelLinking="true"
+				DisableLanguageExtensions="false"
+				ForceConformanceInForLoopScope="true"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				SuppressStartupBanner="false"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4505"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="winmm.lib sdl.lib"
+				OutputFile="$(OutDir)\$(ProjectName)-tfmx.exe"
+				LinkIncremental="2"
+				IgnoreDefaultLibraryNames="libc.lib;libcmt.lib"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/scummvm.pdb"
+				SubSystem="1"
+				EntryPointSymbol="WinMainCRTStartup"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(SolutionName)-$(ConfigurationName)"
+			IntermediateDirectory="$(SolutionDir)$(SolutionName)-$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702 /wd4996"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="../../;../../engines"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="true"
+				MinimalRebuild="false"
+				ExceptionHandling="1"
+				RuntimeLibrary="0"
+				BufferSecurityCheck="false"
+				EnableFunctionLevelLinking="false"
+				DisableLanguageExtensions="false"
+				ForceConformanceInForLoopScope="true"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				WarnAsError="true"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="winmm.lib sdl.lib"
+				OutputFile="$(OutDir)\$(ProjectName)-tfmx.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				IgnoreDefaultLibraryNames="libc.lib"
+				GenerateDebugInformation="false"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				EntryPointSymbol="WinMainCRTStartup"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="base"
+			>
+			<File
+				RelativePath="..\..\base\commandLine.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\commandLine.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\internal_version.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\main.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\main.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\plugins.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\plugins.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\version.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\base\version.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="common"
+			>
+			<File
+				RelativePath="..\..\common\algorithm.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\archive.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\archive.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\array.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\backends\base-backend.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\config-file.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\config-file.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\config-manager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\config-manager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\debug.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\debug.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\endian.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\error.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\events.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\file.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\file.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\frac.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\fs.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\fs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\func.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\hash-str.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\hashmap.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\hashmap.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\iff_container.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\keyboard.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\list.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\list_intern.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\md5.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\md5.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\memorypool.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\memorypool.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\mutex.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\mutex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\noncopyable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\pack-end.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\pack-start.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\ptr.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\queue.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\rect.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\savefile.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\scummsys.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\serializer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\singleton.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\stack.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\str.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\str.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\stream.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\stream.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\system.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\system.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\timer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\unarj.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\unarj.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\unzip.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\unzip.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\util.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\util.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\xmlparser.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\xmlparser.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\zlib.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\zlib.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="sound"
+			>
+			<File
+				RelativePath="..\..\sound\adpcm.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\adpcm.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\aiff.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\aiff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\audiocd.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\audiocd.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\audiostream.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\audiostream.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\flac.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\flac.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\fmopl.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\fmopl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\iff.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\$(InputName)1.obj"
+						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\$(InputName)1.obj"
+						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\sound\iff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mididrv.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mididrv.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\midiparser.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\midiparser.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\midiparser_smf.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\midiparser_xmidi.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mixer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mixer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mixer_intern.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mp3.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mp3.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mpu401.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\mpu401.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\musicplugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\musicplugin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\null.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\rate.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\rate.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\shorten.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\shorten.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\timestamp.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\timestamp.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\vag.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\vag.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\voc.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\voc.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\vorbis.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\vorbis.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\wave.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\sound\wave.h"
+				>
+			</File>
+			<Filter
+				Name="softhsynth"
+				>
+				<File
+					RelativePath="..\..\sound\softsynth\adlib.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)/$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)/$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)/$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)/$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\sound\softsynth\emumidi.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\softsynth\fluidsynth.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\softsynth\mt32.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)/$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)/$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)/$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)/$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\sound\softsynth\pcspk.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\softsynth\pcspk.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\softsynth\ym2612.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)/$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)/$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)/$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)/$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\sound\softsynth\ym2612.h"
+					>
+				</File>
+				<Filter
+					Name="mt32"
+					>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\freeverb.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\freeverb.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\i386.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\i386.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\mt32_file.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\mt32_file.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\mt32emu.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\part.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\part.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\partial.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\partial.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\partialManager.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\partialManager.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\structures.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\synth.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\synth.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\tables.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\mt32\tables.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="opl"
+					>
+					<File
+						RelativePath="..\..\sound\softsynth\opl\dosbox.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\opl\dosbox.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\opl\mame.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\opl\mame.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\opl\opl_impl.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\sound\softsynth\opl\opl_inc.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="mods"
+				>
+				<File
+					RelativePath="..\..\sound\mods\infogrames.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\infogrames.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\module.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\module.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\paula.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\paula.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\protracker.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\protracker.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\rjp1.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\rjp1.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\soundfx.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\soundfx.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\tfmx.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\sound\mods\tfmx.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="txt"
+			>
+			<File
+				RelativePath="..\..\COPYING"
+				>
+			</File>
+			<File
+				RelativePath="..\..\NEWS"
+				>
+			</File>
+			<File
+				RelativePath="..\..\README"
+				>
+			</File>
+			<File
+				RelativePath="..\..\TODO"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="rsc"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+			<File
+				RelativePath="..\..\icons\scummvm.ico"
+				>
+			</File>
+			<File
+				RelativePath="..\..\dists\scummvm.rc"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="backends"
+			>
+			<File
+				RelativePath="..\..\backends\base-backend.cpp"
+				>
+			</File>
+			<Filter
+				Name="sdl"
+				>
+				<File
+					RelativePath="..\..\backends\platform\sdl\events.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\platform\sdl\graphics.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\platform\sdl\hardwarekeys.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\platform\sdl\main.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)\$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)\$(InputName)1.obj"
+							XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\backends\platform\sdl\sdl.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\platform\sdl\sdl.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="fs"
+				>
+				<File
+					RelativePath="..\..\backends\fs\abstract-fs.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\fs\abstract-fs.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\fs\fs-factory.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\fs\stdiostream.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\fs\stdiostream.h"
+					>
+				</File>
+				<Filter
+					Name="windows"
+					>
+					<File
+						RelativePath="..\..\backends\fs\windows\windows-fs-factory.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\backends\fs\windows\windows-fs-factory.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="midi"
+				>
+				<File
+					RelativePath="..\..\backends\midi\windows.cpp"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="timer"
+				>
+				<File
+					RelativePath="..\..\backends\timer\default\default-timer.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\timer\default\default-timer.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="saves"
+				>
+				<File
+					RelativePath="..\..\backends\saves\default\default-saves.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\saves\default\default-saves.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\saves\savefile.cpp"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="events"
+				>
+				<Filter
+					Name="default"
+					>
+					<File
+						RelativePath="..\..\backends\events\default\default-events.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\backends\events\default\default-events.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="keymapper"
+				>
+				<File
+					RelativePath="..\..\backends\keymapper\action.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\action.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\hardware-key.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\keymap.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\keymap.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\keymapper.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\keymapper.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\remap-dialog.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\remap-dialog.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\keymapper\types.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="vkeybd"
+				>
+				<File
+					RelativePath="..\..\backends\vkeybd\image-map.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\image-map.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\keycode-descriptions.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\polygon.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\polygon.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\virtual-keyboard-gui.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\virtual-keyboard-gui.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\virtual-keyboard-parser.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\virtual-keyboard-parser.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\virtual-keyboard.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\backends\vkeybd\virtual-keyboard.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="gui"
+			>
+			<File
+				RelativePath="..\..\gui\about.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\about.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\browser.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\browser.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\chooser.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\chooser.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\console.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\console.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\credits.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\debugger.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\debugger.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\dialog.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\dialog.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\editable.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\editable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\EditTextWidget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\EditTextWidget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\GuiManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\GuiManager.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\Key.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\Key.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\launcher.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\launcher.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ListWidget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ListWidget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\massadd.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\massadd.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\message.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\message.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\object.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\object.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\options.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\options.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\PopUpWidget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\PopUpWidget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\saveload.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\saveload.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ScrollBarWidget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ScrollBarWidget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\TabWidget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\TabWidget.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\themebrowser.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\themebrowser.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ThemeEngine.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ThemeEngine.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ThemeEval.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ThemeLayout.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ThemeLayout.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ThemeParser.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\ThemeParser.h"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCustomBuildTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\gui\widget.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\gui\widget.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="graphics"
+			>
+			<File
+				RelativePath="..\..\graphics\colormasks.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\cursorman.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\cursorman.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\dither.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\dither.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\font.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\font.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\fontman.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\fontman.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\iff.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\iff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\imagedec.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\imagedec.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\primitives.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\primitives.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\scaler.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\scaler.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\surface.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\surface.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\thumbnail.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\thumbnail.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\VectorRenderer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\VectorRenderer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\VectorRendererSpec.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\graphics\VectorRendererSpec.h"
+				>
+			</File>
+			<Filter
+				Name="scaler"
+				>
+				<File
+					RelativePath="..\..\graphics\scaler\2xsai.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\aspect.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\hq2x.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\hq2x.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\hq2x_i386.asm"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCustomBuildTool"
+							CommandLine="nasm.exe -f win32 -g -o &quot;$(OutDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+							Outputs="$(OutDir)\$(InputName).obj"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCustomBuildTool"
+							CommandLine="nasm.exe  -f win32 -o &quot;$(OutDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+							Outputs="$(OutDir)\$(InputName).obj"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\hq3x.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\hq3x.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\hq3x_i386.asm"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCustomBuildTool"
+							CommandLine="nasm.exe -f win32 -g -o &quot;$(OutDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+							Outputs="$(OutDir)\$(InputName).obj"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCustomBuildTool"
+							CommandLine="nasm.exe -f win32 -o &quot;$(OutDir)\$(InputName).obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+							Outputs="$(OutDir)\$(InputName).obj"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\intern.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\scale2x.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\scale2x.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\scale3x.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\scale3x.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\scalebit.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\scalebit.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\scaler\thumbnail_intern.cpp"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="fonts"
+				>
+				<File
+					RelativePath="..\..\graphics\fonts\consolefont.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\fonts\newfont.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\fonts\newfont_big.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\fonts\scummfont.cpp"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="video"
+				>
+				<File
+					RelativePath="..\..\graphics\video\dxa_decoder.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\dxa_decoder.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\flic_decoder.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\flic_decoder.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\mpeg_player.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\mpeg_player.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\smk_decoder.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\smk_decoder.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\video_player.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\graphics\video\video_player.h"
+					>
+				</File>
+				<Filter
+					Name="coktelvideo"
+					>
+					<File
+						RelativePath="..\..\graphics\video\coktelvideo\coktelvideo.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\graphics\video\coktelvideo\coktelvideo.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\graphics\video\coktelvideo\indeo3.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\graphics\video\coktelvideo\indeo3.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="engines"
+			>
+			<File
+				RelativePath="..\..\engines\advancedDetector.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\advancedDetector.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\dialogs.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\dialogs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\engine.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\engine.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\game.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\game.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\engines\metaengine.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="TFMX"
+			>
+			<File
+				RelativePath="..\..\TFMX\README.txt"
+				>
+			</File>
+			<File
+				RelativePath="..\..\TFMX\tfmxplayer.cpp"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: sound/module.mk
===================================================================
--- sound/module.mk	(Revision 40857)
+++ sound/module.mk	(Arbeitskopie)
@@ -29,6 +29,7 @@
 	mods/paula.o \
 	mods/rjp1.o \
 	mods/soundfx.o \
+	mods/tfmx.o \
 	softsynth/adlib.o \
 	softsynth/opl/dosbox.o \
 	softsynth/opl/mame.o \
Index: sound/mods/tfmx.cpp
===================================================================
--- sound/mods/tfmx.cpp	(Revision 0)
+++ sound/mods/tfmx.cpp	(Revision 0)
@@ -0,0 +1,217 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/debug.h"
+#include "common/stream.h"
+#include "common/util.h"
+
+#include "sound/mods/paula.h"
+#include "sound/mods/tfmx.h"
+
+
+namespace Audio {
+
+class Tfmx : public Paula {
+public:
+	Tfmx(int rate, bool stereo);
+	virtual ~Tfmx();
+
+	void interrupt();
+
+	bool load(Common::SeekableReadStream &musicData, Common::SeekableReadStream *sampleData);
+
+private:
+	struct Subsong {
+		uint16 songstart;	//!< Index in Trackstep-Table
+		uint16 songend;		//!< Last index in Trackstep-Table
+		uint16 tempo;
+	} _subsong[32];
+
+	uint32 _patternOffset[128];	//!< Offset in mdat
+	uint32 _macroOffset[128];	//!< Offset in mdat
+
+	byte *_mdatData;  	//!< Currently the whole mdat-File
+	uint32 _mdatLen;  
+	byte *_sampleData;	//!< Currently the whole sample-File
+	uint32 _sampleLen;
+
+	uint32 _trackstepOffset;	//!< Offset in mdat
+};
+
+Tfmx::Tfmx(int rate, bool stereo)
+: Paula(stereo, rate, rate / 50), _mdatData(), _mdatLen(), _sampleData(), _sampleLen() {
+}
+
+Tfmx::~Tfmx() {
+	delete[] _mdatData;
+	delete[] _sampleData;
+}
+
+void Tfmx::interrupt() {
+}
+
+
+bool tfmxload(Common::SeekableReadStream &musicData, Common::SeekableReadStream *sampleData) {
+	Tfmx player(441000, true);
+	return player.load(musicData, sampleData);
+}
+
+bool Tfmx::load(Common::SeekableReadStream &musicData, Common::SeekableReadStream *sampleData) {
+	enum {OFFSET_TRACKSTEP=0x600, OFFSET_PATTERNP=0x200, OFFSET_MACROP=0x400};
+
+	bool res;
+	// TODO lose verbose debug output later
+	char buf[41];
+	int32 d1,d2;
+
+	assert(0==_mdatData);
+	assert(0==_sampleData);
+
+	// TODO: Sanity checks if we have a valid TFMX-Module
+	// TODO: check for Stream-Errors (other than using asserts)
+
+	// 0x0000: 10 Bytes Header "TFMX-SONG "
+	// 0x000A: int16 ?
+	// 0x000C: int32 ?
+	musicData.read(buf, 10);
+	buf[10] = '\0';
+	d1 = musicData.readUint16BE();
+	d2 = (int32)musicData.readUint32BE();
+	debug("Header: \"%s\", %02X %04X", buf, d1, d2);
+
+	// 0x0010: 6*40 Textfield
+	for (int i = 0; i < 6; ++i)
+	{
+		musicData.read(buf,40);
+		buf[40] = '\0';
+		debug("%s", buf);
+	}
+
+	/* 0x0100: Songstart x 32*/
+	for (int i = 0; i < 32; ++i)
+		_subsong[i].songstart = musicData.readUint16BE();
+
+	/* 0x0140: Songend x 32*/
+	for (int i = 0; i < 32; ++i)
+		_subsong[i].songend = musicData.readUint16BE();
+
+	/* 0x0180: Tempo x 32*/
+	for (int i = 0; i<32; ++i)
+		_subsong[i].tempo  = musicData.readUint16BE();
+
+	debug("\nSubSongs");
+	for(int i = 0; i<32; ++i)
+	{
+		debug("% 3d - % 3d, tempo %d", _subsong[i].songstart, _subsong[i].songend, _subsong[i].tempo);
+	}
+
+	/* 0x01c0: unused ? */
+	musicData.skip(16);
+
+	debug("\n\nTrackstep, Pattern Data P, Macro Data P");
+	/* 0x01d0: trackstep, pattern data p, macro data p */
+	uint32 offTrackstep = musicData.readUint32BE();
+	uint32 offPatternP = musicData.readUint32BE();
+	uint32 offMacroP = musicData.readUint32BE();
+
+	// This is how MI`s TFMX-Player tests for unpacked Modules.
+	if ( offTrackstep == 0)
+	{ 
+		debug("unpacked");
+		offTrackstep	= OFFSET_TRACKSTEP;
+		offPatternP		= OFFSET_PATTERNP;
+		offMacroP		= OFFSET_MACROP;
+	}
+	debug("%08X, %08X, %08X", offTrackstep, offPatternP, offMacroP);
+
+	// All offsets relative to 0x200, so just skip remaining Bytes
+	// (would be possible to use an unseekable Readstream with a bit of work)
+	musicData.skip(4+16);
+
+	_trackstepOffset = offTrackstep + 0x200;
+
+	// Read in pattern starting offsets
+	musicData.seek(offPatternP + 0x200);
+	for (int i = 0; i < ARRAYSIZE(_patternOffset); ++i)
+		_patternOffset[i] = musicData.readUint32BE();
+	res = musicData.err();
+	assert(!res);
+
+	// Read in macro starting offsets
+	musicData.seek(offMacroP + 0x200);
+	for (int i = 0; i < ARRAYSIZE(_macroOffset); ++i)
+		_macroOffset[i] = musicData.readUint32BE();
+	res = musicData.err();
+	assert(!res);
+
+	// Read in whole mdat-file
+	int32 size = musicData.size();
+	assert(size != -1);
+	// TODO: special routine if size = -1?
+
+	_mdatData = new byte[size];
+	assert(_mdatData);
+	_mdatLen = size;
+	musicData.seek(0);
+	musicData.read(_mdatData, _mdatLen);
+	
+	res = musicData.err();
+	assert(!res);
+	musicData.readByte();
+	res = musicData.eos();
+	assert(res);
+
+
+
+	// TODO: It would be possible to analyze the pointers and be able to
+	// seperate the file in trackstep, patterns and macro blocks
+	// Modules could do weird stuff like having those blocks mixed though.
+	// TODO: Analyze pointers if they are correct offsets,
+	// so that accesses can be unchecked later
+
+	// Read in whole sample-file
+	if (0 != sampleData) { 
+		size = sampleData->size();
+		assert(size != -1);
+		// TODO: special routine if size = -1?
+
+		_sampleData = new byte[size];
+		assert(_sampleData);
+		_sampleLen = size;
+		sampleData->seek(0);
+		sampleData->read(_sampleData, _sampleLen);
+		
+		res = sampleData->err();
+		assert(!res);
+		sampleData->readByte();
+		res = sampleData->eos();
+		assert(res);
+	}
+
+
+	return true;
+}
+
+}
Index: sound/mods/tfmx.h
===================================================================
--- sound/mods/tfmx.h	(Revision 0)
+++ sound/mods/tfmx.h	(Revision 0)
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SOUND_MODS_TFMX_H
+#define SOUND_MODS_TFMX_H
+
+namespace Audio {
+
+bool tfmxload(Common::SeekableReadStream &musicData, Common::SeekableReadStream *sampleData);
+
+
+
+}
+
+#endif
Index: Makefile.common
===================================================================
--- Makefile.common	(Revision 40857)
+++ Makefile.common	(Arbeitskopie)
@@ -27,6 +27,7 @@
 	graphics \
 	sound \
 	backends \
+	TFMX \
 	common \
 
 ifdef USE_MT32EMU
Index: base/main.cpp
===================================================================
--- base/main.cpp	(Revision 40857)
+++ base/main.cpp	(Arbeitskopie)
@@ -288,6 +288,9 @@
 
 }
 
+#if 1
+void tfmxmain(int argc, const char * const argv[]);
+
 extern "C" int scummvm_main(int argc, const char * const argv[]) {
 	Common::String specialDebug;
 	Common::String command;
@@ -299,6 +302,37 @@
 	// Register config manager defaults
 	Base::registerDefaults();
 
+	// Load the plugins.
+	PluginManager::instance().loadPlugins();
+
+	// Init the backend. Must take place after all config data (including
+	// the command line params) was read.
+	system.initBackend();
+
+	// pass control to my own main-function, including arguments
+	tfmxmain(argc,argv);
+
+	PluginManager::instance().unloadPlugins();
+	PluginManager::destroy();
+	Common::ConfigManager::destroy();
+	Common::SearchManager::destroy();
+	GUI::GuiManager::destroy();
+
+	return 0;
+}
+#else
+
+extern "C" int scummvm_main(int argc, const char * const argv[]) {
+	Common::String specialDebug;
+	Common::String command;
+
+	// Verify that the backend has been initialized (i.e. g_system has been set).
+	assert(g_system);
+	OSystem &system = *g_system;
+
+	// Register config manager defaults
+	Base::registerDefaults();
+
 	// Parse the command line
 	Common::StringMap settings;
 	command = Base::parseCommandLine(settings, argc, argv);
@@ -408,3 +442,5 @@
 
 	return 0;
 }
+
+#endif
Index: TFMX/module.mk
===================================================================
--- TFMX/module.mk	(Revision 0)
+++ TFMX/module.mk	(Revision 0)
@@ -0,0 +1,7 @@
+MODULE := TFMX
+
+MODULE_OBJS := \
+	tfmxplayer.o \
+
+# Include common rules
+include $(srcdir)/rules.mk
Index: TFMX/tfmxplayer.cpp
===================================================================
--- TFMX/tfmxplayer.cpp	(Revision 0)
+++ TFMX/tfmxplayer.cpp	(Revision 0)
@@ -0,0 +1,84 @@
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/stream.h"
+#include "common/file.h"
+#include "common/fs.h"
+#include "common/debug.h"
+
+#include "sound/mixer.h"
+#include "sound/mods/protracker.h"
+#include "sound/mods/tfmx.h"
+
+#define FILEDIR "" 
+
+using namespace Common;
+
+
+void simplePlaybacktest(int argc, const char * const argv[]) {
+	const char *modFilename = "mod.protracker";
+	if (argc == 2)
+		modFilename = argv[1];
+
+
+	// get Mixer, assume this never fails 
+	Audio::Mixer *mixer = g_system->getMixer();
+
+	FSNode fileDir(FILEDIR);
+	debug( "searching for Files in Directory: %s", fileDir.getPath().c_str());
+
+	FSNode musicFile = fileDir.getChild(modFilename);
+
+	SeekableReadStream *fileIn = musicFile.createReadStream();
+	if (0 == fileIn) {
+		debug( "cant open File %s", musicFile.getName().c_str());
+		return;
+	}
+
+	Audio::AudioStream *stream = Audio::makeProtrackerStream( fileIn );
+	delete fileIn;
+	if (0 == stream) {
+		debug( "cant open File %s as Protacker-Stream", musicFile.getName().c_str());
+		return;
+	}
+
+	Audio::SoundHandle soundH;
+
+	mixer->playInputStream( Audio::Mixer::kMusicSoundType, &soundH, stream );
+	while (mixer->isSoundHandleActive(soundH))
+		g_system->delayMillis(1*1000);
+	
+
+	//mixer->stopAll();
+}
+
+#define MUSICFILE "music.dat"
+#define SAMPLEFILE "sample.dat"
+
+void tfmxmain(int argc, const char * const argv[]) {
+	// simplePlaybacktest(argc, argv);
+
+	FSNode fileDir(FILEDIR);
+	FSNode musicNode = fileDir.getChild(MUSICFILE);
+	FSNode sampleNode = fileDir.getChild(SAMPLEFILE);
+	SeekableReadStream *musicIn = musicNode.createReadStream();
+	if (0 == musicIn) {
+		debug("Couldnt load file %s", MUSICFILE);
+		return;
+	}
+
+	SeekableReadStream *sampleIn = sampleNode.createReadStream();
+	if (0 == musicIn) {
+		debug("Couldnt load file %s", SAMPLEFILE);
+	}
+
+
+
+
+	Audio::tfmxload(*musicIn, sampleIn);
+	delete musicIn;
+	delete sampleIn;
+
+
+	printf("press a key");
+	getc(stdin);
+}
