Massive Code Re-organization

This commit is contained in:
Aaron Robinson 2003-04-02 02:23:30 +00:00
parent a799303442
commit 2bf9348ff2
62 changed files with 506 additions and 249 deletions

View File

@ -50,7 +50,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libc"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "Cxbe - Win32 Debug"
@ -74,7 +75,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF

View File

@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="Include,Include/Standard,Include/Standard/Cxbe,Include/Win32/"
AdditionalIncludeDirectories="Include,Include/Core/,Include/Standard,Include/Standard/Cxbe,Include/Win32/"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
@ -43,6 +43,7 @@
OutputFile=".\Bin/Cxbe.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libc"
ProgramDatabaseFile=".\Bin/Cxbe.pdb"
SubSystem="1"/>
<Tool
@ -74,7 +75,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="Include,Include/Standard,Include/Standard/Cxbe,Include/Win32/"
AdditionalIncludeDirectories="Include,Include/Core/,Include/Standard,Include/Standard/Cxbe,Include/Win32/"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
@ -97,6 +98,7 @@
OutputFile=".\Bin/Debug/Cxbe.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Bin/Debug/Cxbe.pdb"
SubSystem="1"/>
@ -140,6 +142,9 @@
<File
RelativePath=".\Doc\Changelog.txt">
</File>
<File
RelativePath=".\Doc\Input.txt">
</File>
<File
RelativePath=".\Doc\RemovedCode.txt">
</File>

View File

@ -153,6 +153,10 @@ SOURCE=.\Include\Win32\Cxbx\DlgControllerConfig.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\CxbxKrnl\Emu.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\Cxbx\EmuExe.h
# End Source File
# Begin Source File
@ -181,10 +185,6 @@ SOURCE=.\Include\Win32\Cxbx\Prolog.h
# End Source File
# Begin Source File
SOURCE=.\Resource\ResCxbx.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\Cxbx\Wnd.h
# End Source File
# Begin Source File

View File

@ -1,9 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbe", "Cxbe.vcproj", "{A797FF7B-F106-4442-856C-E5498D03C5C5}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbe", "Cxbe.vcproj", "{56B1499F-551E-4A54-8B6E-457E4C08F8F8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbx", "Cxbx.vcproj", "{F6581400-7F26-442F-BEEB-D8589452828F}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cxbx", "Cxbx.vcproj", "{85A8FD96-EF3D-4110-8AD1-05E89A8E4312}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CxbxKrnl", "CxbxKrnl.vcproj", "{09B2AF0D-F5C9-4AB4-887A-A9DDC38BF14F}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CxbxKrnl", "CxbxKrnl.vcproj", "{73E6903F-83A9-442D-AC49-6BAA79DE7B10}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
@ -11,21 +11,21 @@ Global
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{F6581400-7F26-442F-BEEB-D8589452828F}.0 = {09B2AF0D-F5C9-4AB4-887A-A9DDC38BF14F}
{85A8FD96-EF3D-4110-8AD1-05E89A8E4312}.0 = {73E6903F-83A9-442D-AC49-6BAA79DE7B10}
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{A797FF7B-F106-4442-856C-E5498D03C5C5}.Debug.ActiveCfg = Debug|Win32
{A797FF7B-F106-4442-856C-E5498D03C5C5}.Debug.Build.0 = Debug|Win32
{A797FF7B-F106-4442-856C-E5498D03C5C5}.Release.ActiveCfg = Release|Win32
{A797FF7B-F106-4442-856C-E5498D03C5C5}.Release.Build.0 = Release|Win32
{F6581400-7F26-442F-BEEB-D8589452828F}.Debug.ActiveCfg = Debug|Win32
{F6581400-7F26-442F-BEEB-D8589452828F}.Debug.Build.0 = Debug|Win32
{F6581400-7F26-442F-BEEB-D8589452828F}.Release.ActiveCfg = Release|Win32
{F6581400-7F26-442F-BEEB-D8589452828F}.Release.Build.0 = Release|Win32
{09B2AF0D-F5C9-4AB4-887A-A9DDC38BF14F}.Debug.ActiveCfg = Debug|Win32
{09B2AF0D-F5C9-4AB4-887A-A9DDC38BF14F}.Debug.Build.0 = Debug|Win32
{09B2AF0D-F5C9-4AB4-887A-A9DDC38BF14F}.Release.ActiveCfg = Release|Win32
{09B2AF0D-F5C9-4AB4-887A-A9DDC38BF14F}.Release.Build.0 = Release|Win32
{56B1499F-551E-4A54-8B6E-457E4C08F8F8}.Debug.ActiveCfg = Debug|Win32
{56B1499F-551E-4A54-8B6E-457E4C08F8F8}.Debug.Build.0 = Debug|Win32
{56B1499F-551E-4A54-8B6E-457E4C08F8F8}.Release.ActiveCfg = Release|Win32
{56B1499F-551E-4A54-8B6E-457E4C08F8F8}.Release.Build.0 = Release|Win32
{85A8FD96-EF3D-4110-8AD1-05E89A8E4312}.Debug.ActiveCfg = Debug|Win32
{85A8FD96-EF3D-4110-8AD1-05E89A8E4312}.Debug.Build.0 = Debug|Win32
{85A8FD96-EF3D-4110-8AD1-05E89A8E4312}.Release.ActiveCfg = Release|Win32
{85A8FD96-EF3D-4110-8AD1-05E89A8E4312}.Release.Build.0 = Release|Win32
{73E6903F-83A9-442D-AC49-6BAA79DE7B10}.Debug.ActiveCfg = Debug|Win32
{73E6903F-83A9-442D-AC49-6BAA79DE7B10}.Debug.Build.0 = Debug|Win32
{73E6903F-83A9-442D-AC49-6BAA79DE7B10}.Release.ActiveCfg = Release|Win32
{73E6903F-83A9-442D-AC49-6BAA79DE7B10}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

View File

@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="Include,Include/Win32/,Include/Win32/Cxbxkrnl,Include/Win32/Cxbx"
AdditionalIncludeDirectories="Include,Include/Core/,Include/Win32/,Include/Win32/Cxbxkrnl,Include/Win32/Cxbx"
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="0"
@ -40,7 +40,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
AdditionalDependencies="dinput8.lib dxguid.lib odbc32.lib odbccp32.lib"
OutputFile=".\Bin/Cxbx.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@ -83,7 +83,7 @@ upxCxbx.bat
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="Include,Include/Win32/,Include/Win32/Cxbxkrnl,Include/Win32/Cxbx"
AdditionalIncludeDirectories="Include,Include/Core/,Include/Win32/,Include/Win32/Cxbxkrnl,Include/Win32/Cxbx"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -102,10 +102,11 @@ upxCxbx.bat
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
AdditionalDependencies="dinput8.lib dxguid.lib odbc32.lib odbccp32.lib"
OutputFile=".\Bin\Debug/Cxbx.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Bin\Debug/Cxbx.pdb"
SubSystem="2"/>
@ -154,6 +155,9 @@ upxCxbx.bat
<File
RelativePath=".\Doc\Changelog.txt">
</File>
<File
RelativePath=".\Doc\Input.txt">
</File>
<File
RelativePath=".\Doc\RemovedCode.txt">
</File>
@ -176,9 +180,18 @@ upxCxbx.bat
<File
RelativePath=".\Include\Cxbx.h">
</File>
<File
RelativePath=".\Include\Win32\Cxbx\DlgControllerConfig.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\Emu.h">
</File>
<File
RelativePath=".\Include\Win32\Cxbx\EmuExe.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\EmuShared.h">
</File>
<File
RelativePath=".\Include\Core\Error.h">
</File>
@ -186,10 +199,13 @@ upxCxbx.bat
RelativePath=".\Include\Core\Exe.h">
</File>
<File
RelativePath=".\Include\Win32\Cxbx\Prolog.h">
RelativePath=".\Include\Win32\InputConfig.h">
</File>
<File
RelativePath=".\Resource\ResCxbx.h">
RelativePath=".\Include\Win32\Mutex.h">
</File>
<File
RelativePath=".\Include\Win32\Cxbx\Prolog.h">
</File>
<File
RelativePath=".\Include\Win32\Cxbx\Wnd.h">
@ -238,6 +254,9 @@ upxCxbx.bat
<Filter
Name="Source"
Filter="">
<File
RelativePath=".\Source\Win32\Cxbx\DlgControllerConfig.cpp">
</File>
<File
RelativePath=".\Source\Win32\Cxbx\EmuExe.cpp">
</File>
@ -247,6 +266,12 @@ upxCxbx.bat
<File
RelativePath=".\Source\Core\Exe.cpp">
</File>
<File
RelativePath=".\Source\Win32\InputConfig.cpp">
</File>
<File
RelativePath=".\Source\Win32\Mutex.cpp">
</File>
<File
RelativePath=".\Source\Core\OpenXDK.cpp">
</File>

View File

@ -79,7 +79,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 d3d8.lib dinput8.lib dxguid.lib ntdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:"Bin\Debug/Cxbx.pdb" /debug /machine:I386 /nodefaultlib:"libc" /implib:"Bin\Debug/Cxbx.lib" /pdbtype:sept /libpath:"Lib"
# ADD LINK32 d3d8.lib dinput8.lib dxguid.lib ntdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"Bin\Debug/Cxbx.dll" /pdbtype:sept /libpath:"Lib"
# SUBTRACT LINK32 /pdb:none
!ENDIF
@ -133,6 +133,18 @@ SOURCE=.\Doc\Todo.txt
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\Include\Win32\AlignPosfix1.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\AlignPrefix1.h
# End Source File
# Begin Source File
SOURCE=.\Include\Cxbx.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\CxbxKrnl\D3D8.1.0.3925.h
# End Source File
# Begin Source File
@ -149,7 +161,7 @@ SOURCE=.\Include\Win32\CxbxKrnl\Emu.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\CxbxKrnl\EmuD3D.h
SOURCE=.\Include\Win32\CxbxKrnl\EmuD3D8.h
# End Source File
# Begin Source File
@ -189,7 +201,7 @@ SOURCE=.\Include\Win32\CxbxKrnl\OOVPA.h
# End Source File
# Begin Source File
SOURCE=.\Resource\ResCxbxKrnl.h
SOURCE=.\Include\Win32\CxbxKrnl\ResCxbxDll.h
# End Source File
# Begin Source File
@ -205,6 +217,10 @@ SOURCE=.\Include\Win32\CxbxKrnl\Xapi.1.0.4627.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\CxbxKrnl\xd3d8.h
# End Source File
# Begin Source File
SOURCE=.\Include\Win32\CxbxKrnl\xntdll.h
# End Source File
# End Group
@ -241,7 +257,7 @@ SOURCE=.\Source\Win32\CxbxKrnl\Emu.cpp
# End Source File
# Begin Source File
SOURCE=.\Source\Win32\CxbxKrnl\EmuD3D.cpp
SOURCE=.\Source\Win32\CxbxKrnl\EmuD3D8.cpp
# End Source File
# Begin Source File

View File

@ -21,7 +21,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="Include,Include/Win32/,Include/Win32/Cxbx,Include/Win32/Cxbxkrnl"
AdditionalIncludeDirectories="Include,Include/Core/,Include/Win32/,Include/Win32/Cxbx,Include/Win32/Cxbxkrnl"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CXBXKRNL_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -45,6 +45,7 @@
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="Lib"
IgnoreDefaultLibraryNames="libc"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Bin\Debug/Cxbx.pdb"
ImportLibrary=".\Bin\Debug/Cxbx.lib"/>
@ -82,7 +83,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="Include,Include/Win32/,Include/Win32/Cxbxkrnl"
AdditionalIncludeDirectories="Include,Include/Core/,Include/Win32/,Include/Win32/Cxbxkrnl"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CXBXKRNL_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
@ -152,6 +153,9 @@
<File
RelativePath=".\Doc\Changelog.txt">
</File>
<File
RelativePath=".\Doc\Input.txt">
</File>
<File
RelativePath=".\Doc\RemovedCode.txt">
</File>
@ -165,6 +169,15 @@
<Filter
Name="Include"
Filter="">
<File
RelativePath=".\Include\Win32\AlignPosfix1.h">
</File>
<File
RelativePath=".\Include\Win32\AlignPrefix1.h">
</File>
<File
RelativePath=".\Include\Cxbx.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\D3D8.1.0.3925.h">
</File>
@ -178,7 +191,7 @@
RelativePath=".\Include\Win32\CxbxKrnl\Emu.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\EmuD3D.h">
RelativePath=".\Include\Win32\CxbxKrnl\EmuD3D8.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\EmuDInput.h">
@ -201,11 +214,14 @@
<File
RelativePath=".\Include\Win32\CxbxKrnl\HLEDataBase.h">
</File>
<File
RelativePath=".\Include\Win32\Mutex.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\OOVPA.h">
</File>
<File
RelativePath=".\Resource\ResCxbxKrnl.h">
RelativePath=".\Include\Win32\CxbxKrnl\ResCxbxDll.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\Xapi.1.0.3911.h">
@ -216,6 +232,9 @@
<File
RelativePath=".\Include\Win32\CxbxKrnl\Xapi.1.0.4627.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\xd3d8.h">
</File>
<File
RelativePath=".\Include\Win32\CxbxKrnl\xntdll.h">
</File>
@ -258,7 +277,7 @@
RelativePath=".\Source\Win32\CxbxKrnl\Emu.cpp">
</File>
<File
RelativePath=".\Source\Win32\CxbxKrnl\EmuD3D.cpp">
RelativePath=".\Source\Win32\CxbxKrnl\EmuD3D8.cpp">
</File>
<File
RelativePath=".\Source\Win32\CxbxKrnl\EmuDInput.cpp">

View File

@ -15,6 +15,8 @@ version: 0.7.0 (??/??/??)
- __declspec(thread) style TLS is working!!
- Massive code re-organization.
- Lots of random optimizations
version: 0.6.0-pre12 (02/23/03)

View File

@ -34,6 +34,8 @@
#ifndef ERROR_H
#define ERROR_H
#include "Cxbx.h"
// ******************************************************************
// * Inherited from this class for easy Error detection
// ******************************************************************

View File

@ -34,6 +34,8 @@
#ifndef EXE_H
#define EXE_H
#include "Error.h"
// ******************************************************************
// * Exe (PE) file object
// ******************************************************************

View File

@ -34,7 +34,9 @@
#ifndef XBE_H
#define XBE_H
#include <stdlib.h>
#include "Error.h"
#include <stdio.h>
// ******************************************************************
// * Xbe (Xbox Executable) file object
@ -250,7 +252,7 @@ class Xbe : public Error
// ******************************************************************
// * GetTLSData
// ******************************************************************
uint08 *GetTLSData() { return GetAddr(m_TLS->dwDataStartAddr); }
uint08 *GetTLSData() { if(m_TLS == 0) return 0; else return GetAddr(m_TLS->dwDataStartAddr); }
private:
// ******************************************************************

View File

@ -34,6 +34,15 @@
#ifndef CXBX_H
#define CXBX_H
// ******************************************************************
// * cxbxkrnl exports, others import
// ******************************************************************
#ifndef _CXBXKRNL_INTERNAL
#define CXBXKRNL_API __declspec(dllimport)
#else
#define CXBXKRNL_API __declspec(dllexport)
#endif
// ******************************************************************
// * Caustik's favorite typedefs
// ******************************************************************
@ -81,11 +90,4 @@ enum DebugMode
DM_FILE
};
// ******************************************************************
// * Core Components
// ******************************************************************
#include "Error.h"
#include "Exe.h"
#include "Xbe.h"
#endif

View File

@ -34,7 +34,7 @@
#ifndef EMUEXE_H
#define EMUEXE_H
#include "Cxbx.h"
#include "Exe.h"
// ******************************************************************
// * class : EmuExe

View File

@ -34,6 +34,8 @@
#ifndef PROLOG_H
#define PROLOG_H
#include "Cxbx.h"
// ******************************************************************
// * func : Prolog
// ******************************************************************

View File

@ -34,6 +34,8 @@
#ifndef WND_H
#define WND_H
#include "Error.h"
#undef FIELD_OFFSET // prevent macro redefinition warnings
#include <windows.h>

View File

@ -35,7 +35,8 @@
#define WNDMAIN_H
#include "Wnd.h"
#include "DlgControllerConfig.h"
#include "Exe.h"
#include "Xbe.h"
// ******************************************************************
// * constants

View File

@ -34,6 +34,8 @@
#ifndef D3D8_1_0_3925_H
#define D3D8_1_0_3925_H
#include "OOVPA.h"
extern OOVPATable D3D8_1_0_3925[];
extern uint32 D3D8_1_0_3925_SIZE;

View File

@ -34,6 +34,8 @@
#ifndef D3D8_1_0_4361_H
#define D3D8_1_0_4361_H
#include "OOVPA.h"
extern OOVPATable D3D8_1_0_4361[];
extern uint32 D3D8_1_0_4361_SIZE;

View File

@ -34,6 +34,8 @@
#ifndef D3D8_1_0_4627_H
#define D3D8_1_0_4627_H
#include "OOVPA.h"
extern OOVPATable D3D8_1_0_4627[];
extern uint32 D3D8_1_0_4627_SIZE;

View File

@ -34,15 +34,9 @@
#ifndef EMU_H
#define EMU_H
// ******************************************************************
// * cxbxkrnl exports, others import
// ******************************************************************
#ifndef _CXBXKRNL_INTERNAL
#define CXBXKRNL_API DECLSPEC_IMPORT
#else
#define CXBXKRNL_API DECLSPEC_EXPORT
#endif
#include "Xbe.h"
/*
// ******************************************************************
// * prevent name collisions
// ******************************************************************
@ -88,34 +82,28 @@ extern xboxkrnl::XINPUT_STATE g_EmuController1;
#include "EmuKrnl.h"
#include "EmuLDT.h"
#include "EmuFS.h"
*/
#if defined(__cplusplus)
extern "C"
{
#endif
#include <windows.h>
// ******************************************************************
// * func: EmuNoFunc
// ******************************************************************
CXBXKRNL_API void NTAPI EmuNoFunc();
extern "C" CXBXKRNL_API void NTAPI EmuNoFunc();
// ******************************************************************
// * func: EmuInit
// ******************************************************************
CXBXKRNL_API void NTAPI EmuInit(Xbe::LibraryVersion *LibraryVersion, DebugMode DebugConsole, char *DebugFilename, Xbe::Header *XbeHeader, uint32 XbeHeaderSize, void (*Entry)());
extern "C" CXBXKRNL_API void NTAPI EmuInit(Xbe::LibraryVersion *LibraryVersion, DebugMode DebugConsole, char *DebugFilename, Xbe::Header *XbeHeader, uint32 XbeHeaderSize, void (*Entry)());
// ******************************************************************
// * func: EmuPanic
// ******************************************************************
CXBXKRNL_API void NTAPI EmuPanic();
extern "C" CXBXKRNL_API void NTAPI EmuPanic();
// ******************************************************************
// * data: KernelThunkTable
// ******************************************************************
extern CXBXKRNL_API uint32 KernelThunkTable[367];
#if defined(__cplusplus)
}
#endif
extern "C" CXBXKRNL_API uint32 KernelThunkTable[367];
#endif

View File

@ -0,0 +1,53 @@
// ******************************************************************
// *
// * .,-::::: .,:: .::::::::. .,:: .:
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
// * $$$ Y$$$P $$""""Y$$ Y$$$P
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
// * Cxbx->Win32->CxbxKrnl->EmuD3D8.h
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them 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 recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2002-2003 Aaron Robinson <caustik@caustik.com>
// *
// * All rights reserved
// *
// ******************************************************************
#ifndef EMUD3D8_H
#define EMUD3D8_H
#include "Xbe.h"
#include <windows.h>
#define DIRECT3D_VERSION 0x0800
#include <d3d8.h>
// ******************************************************************
// * global exports
// ******************************************************************
extern HWND g_EmuWindow; // Rendering Window
// ******************************************************************
// * func: EmuInitD3D
// ******************************************************************
void EmuInitD3D(Xbe::Header *XbeHeader, uint32 XbeHeaderSize);
#endif

View File

@ -34,7 +34,18 @@
#ifndef EMUDINPUT_H
#define EMUDINPUT_H
#include "Emu.h"
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xapi
{
#include <EmuXapi.h>
};
// ******************************************************************
// * exported globals
// ******************************************************************
extern xapi::XINPUT_STATE g_EmuController1; // Input Controller
// ******************************************************************
// * func: EmuPollInput

View File

@ -34,6 +34,8 @@
#ifndef EMULDT_H
#define EMULDT_H
#include "Cxbx.h"
// ******************************************************************
// * func: EmuInitLDT
// ******************************************************************

View File

@ -34,17 +34,11 @@
#ifndef EMUSHARED_H
#define EMUSHARED_H
#include "Cxbx.h"
#include "Mutex.h"
#include "InputConfig.h"
// ******************************************************************
// * cxbxkrnl exports, others import
// ******************************************************************
#ifndef _CXBXKRNL_INTERNAL
#define CXBXKRNL_API DECLSPEC_IMPORT
#else
#define CXBXKRNL_API DECLSPEC_EXPORT
#endif
#include <memory.h>
// ******************************************************************
// * func: EmuSharedInit

View File

@ -34,22 +34,73 @@
#ifndef EMUXAPI_H
#define EMUXAPI_H
#include "Emu.h"
// ******************************************************************
// * calling conventions
// ******************************************************************
#define WINAPI __stdcall
// ******************************************************************
// * basic types
// * Basic types
// ******************************************************************
typedef char CHAR, CCHAR;
typedef short SHORT, CSHORT;
typedef long LONG;
typedef unsigned char UCHAR;
typedef unsigned char BYTE;
typedef unsigned char BOOLEAN;
typedef unsigned short USHORT;
typedef unsigned short WORD;
typedef unsigned long ULONG;
typedef unsigned long DWORD;
typedef unsigned long SIZE_T, *PSIZE_T;
typedef unsigned long ACCESS_MASK, *PACCESS_MASK;
typedef unsigned long PHYSICAL_ADDRESS;
typedef long INT_PTR;
typedef unsigned __int64 ULONGLONG;
// xapi
typedef int BOOL;
typedef int INT;
typedef unsigned int UINT;
typedef unsigned int *PUINT;
typedef LONG HRESULT;
// ******************************************************************
// * Pointer types
// ******************************************************************
typedef CHAR *PCHAR;
typedef CHAR *PCSZ;
typedef BYTE *PBYTE;
typedef BOOLEAN *PBOOLEAN;
typedef UCHAR *PUCHAR;
typedef USHORT *PUSHORT;
typedef ULONG *PULONG;
typedef DWORD *LPDWORD;
typedef ACCESS_MASK *PACCESS_MASK;
typedef LONG *LONG_PTR;
typedef ULONG *ULONG_PTR;
typedef INT_PTR *PINT_PTR;
#ifndef VOID
#define VOID void
#endif
typedef VOID *PVOID, *LPVOID;
typedef void *HANDLE;
typedef HANDLE *PHANDLE;
// ******************************************************************
// * documentation purposes only
// ******************************************************************
#define EXPORTNUM(a)
#define UNALIGNED
#define OPTIONAL
#define IN
#define OUT
// ******************************************************************
// * LPSECURITY_ATTRIBUTES
// ******************************************************************
typedef void* LPSECURITY_ATTRIBUTES;
// ******************************************************************
// * PTHREAD_START_ROUTINE / LPTHREAD_START_ROUTINE
// ******************************************************************
@ -228,7 +279,7 @@ VOID WINAPI EmuXapiInitProcess();
// ******************************************************************
// * func: EmuXapiBootDash
// ******************************************************************
VOID WINAPI EmuXapiBootDash(uint32 UnknownA, uint32 UnknownB, uint32 UnknownC);
VOID WINAPI EmuXapiBootDash(DWORD UnknownA, DWORD UnknownB, DWORD UnknownC);
// ******************************************************************
// * func: Emu__rtinit

View File

@ -34,6 +34,8 @@
#ifndef OOVPA_H
#define OOVPA_H
#include "Cxbx.h"
#pragma pack(1)
// ******************************************************************

View File

@ -34,6 +34,8 @@
#ifndef XAPI_1_0_3911_H
#define XAPI_1_0_3911_H
#include "OOVPA.h"
extern OOVPATable XAPI_1_0_3911[];
extern uint32 XAPI_1_0_3911_SIZE;

View File

@ -34,6 +34,8 @@
#ifndef XAPI_1_0_4361_H
#define XAPI_1_0_4361_H
#include "OOVPA.h"
extern OOVPATable XAPI_1_0_4361[];
extern uint32 XAPI_1_0_4361_SIZE;

View File

@ -34,6 +34,8 @@
#ifndef XAPI_1_0_4627_H
#define XAPI_1_0_4627_H
#include "OOVPA.h"
extern OOVPATable XAPI_1_0_4627[];
extern uint32 XAPI_1_0_4627_SIZE;

View File

@ -7,7 +7,7 @@
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
// * Cxbx->Win32->CxbxKrnl->EmuD3D.h
// * Cxbx->Win32->CxbxKrnl->xd3d8.h
// *
// * This file is part of the Cxbx project.
// *
@ -31,48 +31,43 @@
// * All rights reserved
// *
// ******************************************************************
#ifndef EMUD3D_H
#define EMUD3D_H
#ifndef XD3D8_H
#define XD3D8_H
#include "Emu.h"
// ******************************************************************
// * func: EmuInitD3D
// ******************************************************************
VOID EmuInitD3D(Xbe::Header *XbeHeader, uint32 XbeHeaderSize);
#include "d3d8.h"
// ******************************************************************
// * func: EmuIDirect3D8_CreateDevice
// ******************************************************************
win32::HRESULT WINAPI EmuIDirect3D8_CreateDevice
HRESULT WINAPI EmuIDirect3D8_CreateDevice
(
win32::UINT Adapter,
win32::D3DDEVTYPE DeviceType,
win32::HWND hFocusWindow,
win32::DWORD BehaviorFlags,
win32::D3DPRESENT_PARAMETERS *pPresentationParameters,
win32::IDirect3DDevice8 **ppReturnedDeviceInterface
UINT Adapter,
D3DDEVTYPE DeviceType,
HWND hFocusWindow,
DWORD BehaviorFlags,
D3DPRESENT_PARAMETERS *pPresentationParameters,
IDirect3DDevice8 **ppReturnedDeviceInterface
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_Clear
// ******************************************************************
win32::HRESULT WINAPI EmuIDirect3DDevice8_Clear
HRESULT WINAPI EmuIDirect3DDevice8_Clear
(
win32::DWORD Count,
CONST win32::D3DRECT *pRects,
win32::DWORD Flags,
win32::D3DCOLOR Color,
DWORD Count,
CONST D3DRECT *pRects,
DWORD Flags,
D3DCOLOR Color,
float Z,
win32::DWORD Stencil
DWORD Stencil
);
// ******************************************************************
// * func: EmuIDirect3DDevice8_Swap
// ******************************************************************
win32::HRESULT WINAPI EmuIDirect3DDevice8_Swap
HRESULT WINAPI EmuIDirect3DDevice8_Swap
(
win32::DWORD Flags
DWORD Flags
);
#endif

View File

@ -39,6 +39,8 @@ extern "C"
{
#endif
#include <ctype.h> // winnt ntndis
// ******************************************************************
// * fixes some compiler errors and warnings
// ******************************************************************
@ -117,7 +119,9 @@ typedef unsigned __int64 ULONGLONG;
// * calling conventions
// ******************************************************************
#define NTAPI __stdcall
#ifndef CDECL
#define CDECL __cdecl
#endif
#define INLINE __inline
#define DECLSPEC_NORETURN __declspec(noreturn)

View File

@ -34,8 +34,6 @@
#ifndef MUTEX_H
#define MUTEX_H
#include <windows.h>
// ******************************************************************
// * Mutex object (intended to be inherited from)
// ******************************************************************

View File

@ -31,7 +31,7 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Error.h"
#include <string.h>

View File

@ -31,7 +31,7 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Exe.h"
#include <stdio.h>
#include <memory.h>

View File

@ -31,7 +31,7 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Xbe.h"
// ******************************************************************
// * OpenXDK logo bitmap

View File

@ -31,11 +31,12 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Xbe.h"
#include "Exe.h"
#include <memory.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// ******************************************************************

View File

@ -31,10 +31,10 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Exe.h"
#include "Xbe.h"
#include <string.h>
#include <stdio.h>
// ******************************************************************
// * statics

View File

@ -31,9 +31,8 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "ResCxbx.h"
#include "DlgControllerConfig.h"
#include "ResCxbx.h"
#include "EmuShared.h"
#define DIRECTINPUT_VERSION 0x0800

View File

@ -31,13 +31,11 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "EmuExe.h"
#include "Prolog.h"
#include "Emu.h"
using namespace win32;
#include <stdio.h>
// ******************************************************************
// * constructor

View File

@ -31,7 +31,7 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Prolog.h"
// ******************************************************************
// * .cxbxplg

View File

@ -31,13 +31,9 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "EmuExe.h"
#include "WndMain.h"
#include "EmuShared.h"
#undef FIELD_OFFSET // prevent macro redefinition warnings
#include <windows.h>
#include "EmuExe.h"
// ******************************************************************
// * func : WinMain

View File

@ -31,9 +31,7 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Wnd.h"
#include "ResCxbx.h"
// ******************************************************************

View File

@ -31,9 +31,7 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "WndAbout.h"
#include "ResCxbx.h"
// ******************************************************************

View File

@ -31,13 +31,12 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "EmuExe.h"
#include "WndMain.h"
#include "WndAbout.h"
#include "DlgControllerConfig.h"
#include "ResCxbx.h"
#include "EmuExe.h"
#include <stdio.h>
#include <io.h>
// ******************************************************************

View File

@ -31,8 +31,6 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Emu.h"
// ******************************************************************
// * IDirect3D8_CreateDevice
@ -70,7 +68,7 @@ OOVPATable D3D8_1_0_3925[] =
{
(OOVPA*)&IDirect3D8_CreateDevice_1_0_3925,
xboxkrnl::EmuIDirect3D8_CreateDevice,
xd3d8::EmuIDirect3D8_CreateDevice,
#ifdef _DEBUG_TRACE
"EmuIDirect3D8_CreateDevice"

View File

@ -31,8 +31,6 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Emu.h"
// ******************************************************************
// * IDirect3D8_CreateDevice
@ -126,7 +124,7 @@ OOVPATable D3D8_1_0_4361[] =
{
(OOVPA*)&IDirect3D8_CreateDevice_1_0_4361,
xboxkrnl::EmuIDirect3D8_CreateDevice,
xd3d8::EmuIDirect3D8_CreateDevice,
#ifdef _DEBUG_TRACE
"EmuIDirect3D8_CreateDevice"
@ -136,7 +134,7 @@ OOVPATable D3D8_1_0_4361[] =
{
(OOVPA*)&IDirect3DDevice8_Clear_1_0_4361,
xboxkrnl::EmuIDirect3DDevice8_Clear,
xd3d8::EmuIDirect3DDevice8_Clear,
#ifdef _DEBUG_TRACE
"EmuIDirect3DDevice8_Clear"
@ -146,7 +144,7 @@ OOVPATable D3D8_1_0_4361[] =
{
(OOVPA*)&IDirect3DDevice8_Swap_1_0_4361,
xboxkrnl::EmuIDirect3DDevice8_Swap,
xd3d8::EmuIDirect3DDevice8_Swap,
#ifdef _DEBUG_TRACE
"EmuIDirect3DDevice8_Swap"

View File

@ -31,8 +31,6 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Emu.h"
// ******************************************************************
// * IDirect3D8_CreateDevice
@ -126,7 +124,7 @@ OOVPATable D3D8_1_0_4627[] =
{
(OOVPA*)&IDirect3D8_CreateDevice_1_0_4627,
xboxkrnl::EmuIDirect3D8_CreateDevice,
xd3d8::EmuIDirect3D8_CreateDevice,
#ifdef _DEBUG_TRACE
"EmuIDirect3D8_CreateDevice"
@ -136,7 +134,7 @@ OOVPATable D3D8_1_0_4627[] =
{
(OOVPA*)&IDirect3DDevice8_Clear_1_0_4627,
xboxkrnl::EmuIDirect3DDevice8_Clear,
xd3d8::EmuIDirect3DDevice8_Clear,
#ifdef _DEBUG_TRACE
"EmuIDirect3DDevice8_Clear"
@ -146,7 +144,7 @@ OOVPATable D3D8_1_0_4627[] =
{
(OOVPA*)&IDirect3DDevice8_Swap_1_0_4627,
xboxkrnl::EmuIDirect3DDevice8_Swap,
xd3d8::EmuIDirect3DDevice8_Swap,
#ifdef _DEBUG_TRACE
"EmuIDirect3DDevice8_Swap"

View File

@ -34,20 +34,19 @@
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
#include "Cxbx.h"
#include "Emu.h"
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xntdll
namespace xboxkrnl
{
#include "xntdll.h"
#include <xboxkrnl/xboxkrnl.h>
};
using namespace win32;
#include "Emu.h"
#include "EmuFS.h"
#include "EmuD3D8.h"
#include "EmuShared.h"
#include "HLEDataBase.h"
// ******************************************************************
// * global / static
@ -71,7 +70,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
// ******************************************************************
// * func: EmuNoFunc
// ******************************************************************
CXBXKRNL_API void NTAPI EmuNoFunc()
extern "C" CXBXKRNL_API void NTAPI EmuNoFunc()
{
EmuSwapFS(); // Win2k/XP FS
@ -83,7 +82,7 @@ CXBXKRNL_API void NTAPI EmuNoFunc()
// ******************************************************************
// * func: EmuInit
// ******************************************************************
CXBXKRNL_API void NTAPI EmuInit(Xbe::LibraryVersion *LibraryVersion, DebugMode DebugConsole, char *DebugFilename, Xbe::Header *XbeHeader, uint32 XbeHeaderSize, void (*Entry)())
extern "C" CXBXKRNL_API void NTAPI EmuInit(Xbe::LibraryVersion *LibraryVersion, DebugMode DebugConsole, char *DebugFilename, Xbe::Header *XbeHeader, uint32 XbeHeaderSize, void (*Entry)())
{
// ******************************************************************
// * debug console allocation (if configured)
@ -207,7 +206,7 @@ CXBXKRNL_API void NTAPI EmuInit(Xbe::LibraryVersion *LibraryVersion, DebugMode D
EmuGenerateFS();
xboxkrnl::EmuInitD3D(XbeHeader, XbeHeaderSize);
EmuInitD3D(XbeHeader, XbeHeaderSize);
}
printf("Emu (0x%.08X): Initial thread starting.\n", GetCurrentThreadId());
@ -233,7 +232,7 @@ CXBXKRNL_API void NTAPI EmuInit(Xbe::LibraryVersion *LibraryVersion, DebugMode D
// ******************************************************************
// * func: EmuPanic
// ******************************************************************
CXBXKRNL_API void NTAPI EmuPanic()
extern "C" CXBXKRNL_API void NTAPI EmuPanic()
{
EmuSwapFS(); // Win2k/XP FS

View File

@ -32,31 +32,43 @@
// *
// ******************************************************************
#define _CXBXKRNL_INTERNAL
#include "Cxbx.h"
#include "Emu.h"
#define _XBOXKRNL_LOCAL_
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace win32
namespace xboxkrnl
{
#include <process.h>
#include <locale.h>
}
#include <xboxkrnl/xboxkrnl.h>
};
#include "Emu.h"
#include "EmuFS.h"
#include "EmuDInput.h"
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xd3d8
{
#include "xd3d8.h"
};
#include "EmuD3D8.h"
#include "ResCxbxDll.h"
using namespace win32;
#include <process.h>
#include <locale.h>
// ******************************************************************
// * globals
// ******************************************************************
LPDIRECT3D8 g_pD3D8 = NULL; // Direct3D8
LPDIRECT3DDEVICE8 g_pD3D8Device = NULL; // Direct3D8 Device
xd3d8::LPDIRECT3D8 g_pD3D8 = NULL; // Direct3D8
xd3d8::LPDIRECT3DDEVICE8 g_pD3D8Device = NULL; // Direct3D8 Device
Xbe::Header *g_XbeHeader = NULL; // XbeHeader
uint32 g_XbeHeaderSize = 0; // XbeHeaderSize
HWND g_EmuWindow = NULL; // Rendering Window
D3DCAPS8 g_D3DCaps; // Direct3D8 Caps
xd3d8::D3DCAPS8 g_D3DCaps; // Direct3D8 Caps
// ******************************************************************
// * statics
@ -67,7 +79,7 @@ static void EmuRenderWindow(PVOID);
// ******************************************************************
// * func: EmuInitD3D
// ******************************************************************
VOID xboxkrnl::EmuInitD3D(Xbe::Header *XbeHeader, uint32 XbeHeaderSize)
VOID EmuInitD3D(Xbe::Header *XbeHeader, uint32 XbeHeaderSize)
{
// ******************************************************************
// * store XbeHeader and XbeHeaderSize for further use
@ -91,6 +103,7 @@ VOID xboxkrnl::EmuInitD3D(Xbe::Header *XbeHeader, uint32 XbeHeaderSize)
// * create Direct3D8 and retrieve caps
// ******************************************************************
{
using namespace xd3d8;
// xbox Direct3DCreate8 returns "1" always, so we need our own ptr
g_pD3D8 = Direct3DCreate8(D3D_SDK_VERSION);
@ -168,7 +181,7 @@ void EmuRenderWindow(PVOID)
// ******************************************************************
// * initialize direct input
// ******************************************************************
xboxkrnl::EmuInitDInput();
EmuInitDInput();
// ******************************************************************
// * message processing loop
@ -253,7 +266,7 @@ LRESULT WINAPI EmuMsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
// ******************************************************************
// * func: EmuIDirect3D8_CreateDevice
// ******************************************************************
HRESULT WINAPI xboxkrnl::EmuIDirect3D8_CreateDevice
HRESULT WINAPI xd3d8::EmuIDirect3D8_CreateDevice
(
UINT Adapter,
D3DDEVTYPE DeviceType,
@ -352,7 +365,7 @@ HRESULT WINAPI xboxkrnl::EmuIDirect3D8_CreateDevice
// ******************************************************************
// * func: EmuIDirect3DDevice8_Clear
// ******************************************************************
HRESULT WINAPI xboxkrnl::EmuIDirect3DDevice8_Clear
HRESULT WINAPI xd3d8::EmuIDirect3DDevice8_Clear
(
DWORD Count,
CONST D3DRECT *pRects,
@ -414,7 +427,7 @@ HRESULT WINAPI xboxkrnl::EmuIDirect3DDevice8_Clear
// ******************************************************************
// * func: EmuIDirect3DDevice8_Swap
// ******************************************************************
HRESULT WINAPI xboxkrnl::EmuIDirect3DDevice8_Swap
HRESULT WINAPI xd3d8::EmuIDirect3DDevice8_Swap
(
DWORD Flags
)

View File

@ -32,11 +32,22 @@
// *
// ******************************************************************
#define _CXBXKRNL_INTERNAL
#include "Cxbx.h"
#include "Emu.h"
#define _XBOXKRNL_LOCAL_
#include "EmuD3D8.h"
#include "EmuDInput.h"
#include "InputConfig.h"
using namespace win32;
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xapi
{
#include <EmuXapi.h>
};
// ******************************************************************
// * globals
@ -44,7 +55,7 @@ using namespace win32;
LPDIRECTINPUT8 g_pDirectInput8 = NULL;
LPDIRECTINPUTDEVICE8 g_pInputDev[MAX_INPUT_DEVICES] = {0};
int g_pInputCur = 0;
xboxkrnl::XINPUT_STATE g_EmuController1;
xapi::XINPUT_STATE g_EmuController1;
// ******************************************************************
@ -56,7 +67,7 @@ static BOOL CALLBACK EnumObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOI
// ******************************************************************
// * func: EmuInitDInput
// ******************************************************************
void xboxkrnl::EmuInitDInput()
void EmuInitDInput()
{
// ******************************************************************
// * Create DirectInput object
@ -165,7 +176,7 @@ static BOOL CALLBACK EnumObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOI
// ******************************************************************
// * func: EmuPollController
// ******************************************************************
void xboxkrnl::EmuPollController()
void EmuPollController()
{
/*
DIJOYSTATE ControllerState;

View File

@ -31,10 +31,21 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Emu.h"
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
using namespace win32;
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include "EmuFS.h"
#include "EmuLDT.h"
#include <windows.h>
// ******************************************************************
// * func: EmuInitFS

View File

@ -34,8 +34,15 @@
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
#include "Cxbx.h"
#include "Emu.h"
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <stdio.h>
// ******************************************************************
// * prevent name collisions
@ -45,7 +52,8 @@ namespace xntdll
#include "xntdll.h"
};
using namespace win32;
#include "Emu.h"
#include "EmuFS.h"
// ******************************************************************
// * Loaded at run-time to avoid linker conflicts
@ -601,9 +609,9 @@ XBSYSAPI EXPORTNUM(277) VOID NTAPI xboxkrnl::RtlEnterCriticalSection
// We have to initialize this because the Xbox software doesn't seem
// to always do it. Redundant initializations seem to be ok :/
InitializeCriticalSection((win32::PRTL_CRITICAL_SECTION)CriticalSection);
InitializeCriticalSection((::PRTL_CRITICAL_SECTION)CriticalSection);
EnterCriticalSection((win32::PRTL_CRITICAL_SECTION)CriticalSection);
EnterCriticalSection((::PRTL_CRITICAL_SECTION)CriticalSection);
EmuSwapFS(); // Xbox FS
}
@ -663,7 +671,7 @@ XBSYSAPI EXPORTNUM(291) VOID NTAPI xboxkrnl::RtlInitializeCriticalSection
}
#endif
InitializeCriticalSection((win32::PRTL_CRITICAL_SECTION)CriticalSection);
InitializeCriticalSection((::PRTL_CRITICAL_SECTION)CriticalSection);
EmuSwapFS(); // Xbox FS
@ -693,7 +701,7 @@ XBSYSAPI EXPORTNUM(294) VOID NTAPI xboxkrnl::RtlLeaveCriticalSection
}
#endif
LeaveCriticalSection((win32::PRTL_CRITICAL_SECTION)CriticalSection);
LeaveCriticalSection((::PRTL_CRITICAL_SECTION)CriticalSection);
EmuSwapFS(); // Xbox FS
}

View File

@ -31,8 +31,13 @@
// * All rights reserved
// *
// ******************************************************************
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
#include "Cxbx.h"
#include "Emu.h"
#include "EmuFS.h"
#include <windows.h>
// ******************************************************************
// * prevent name collisions
@ -42,8 +47,6 @@ namespace xntdll
#include "xntdll.h"
};
using namespace win32;
// ******************************************************************
// * Maximum number of threads this LDT system will handle
// ******************************************************************

View File

@ -34,13 +34,10 @@
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
#include "Cxbx.h"
#include "Emu.h"
using namespace win32;
#include "EmuShared.h"
#include <windows.h>
// ******************************************************************
// * shared memory
// ******************************************************************

View File

@ -31,10 +31,22 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Emu.h"
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
using namespace win32;
#include <windows.h>
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xapi
{
#include "EmuXapi.h"
};
#include "EmuFS.h"
#include "EmuD3D8.h"
#include "EmuDInput.h"
// ******************************************************************
// * EmuCreateThreadProxyParam
@ -89,7 +101,7 @@ static DWORD WINAPI EmuCreateThreadProxy
// ******************************************************************
// * func: EmuXInitDevices
// ******************************************************************
VOID WINAPI xboxkrnl::EmuXInitDevices
VOID WINAPI xapi::EmuXInitDevices
(
DWORD Unknown1,
PVOID Unknown2
@ -122,7 +134,7 @@ VOID WINAPI xboxkrnl::EmuXInitDevices
// ******************************************************************
// * func: EmuXGetDevices
// ******************************************************************
DWORD WINAPI xboxkrnl::EmuXGetDevices
DWORD WINAPI xapi::EmuXGetDevices
(
PXPP_DEVICE_TYPE DeviceType
)
@ -151,7 +163,7 @@ DWORD WINAPI xboxkrnl::EmuXGetDevices
// ******************************************************************
// * func: EmuXInputOpen
// ******************************************************************
HANDLE WINAPI xboxkrnl::EmuXInputOpen
HANDLE WINAPI xapi::EmuXInputOpen
(
IN PXPP_DEVICE_TYPE DeviceType,
IN DWORD dwPort,
@ -191,7 +203,7 @@ HANDLE WINAPI xboxkrnl::EmuXInputOpen
// ******************************************************************
// * func: EmuXInputGetCapabilities
// ******************************************************************
DWORD WINAPI xboxkrnl::EmuXInputGetCapabilities
DWORD WINAPI xapi::EmuXInputGetCapabilities
(
IN HANDLE hDevice,
OUT PXINPUT_CAPABILITIES pCapabilities
@ -234,7 +246,7 @@ DWORD WINAPI xboxkrnl::EmuXInputGetCapabilities
// ******************************************************************
// * func: EmuInputGetState
// ******************************************************************
DWORD WINAPI xboxkrnl::EmuXInputGetState
DWORD WINAPI xapi::EmuXInputGetState
(
IN HANDLE hDevice,
OUT PXINPUT_STATE pState
@ -278,7 +290,7 @@ DWORD WINAPI xboxkrnl::EmuXInputGetState
// ******************************************************************
// * func: EmuCreateThread
// ******************************************************************
HANDLE WINAPI xboxkrnl::EmuCreateThread
HANDLE WINAPI xapi::EmuCreateThread
(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
DWORD dwStackSize,
@ -332,7 +344,7 @@ HANDLE WINAPI xboxkrnl::EmuCreateThread
// ******************************************************************
// * func: EmuCloseHandle
// ******************************************************************
BOOL WINAPI xboxkrnl::EmuCloseHandle
BOOL WINAPI xapi::EmuCloseHandle
(
HANDLE hObject
)
@ -362,7 +374,7 @@ BOOL WINAPI xboxkrnl::EmuCloseHandle
// ******************************************************************
// * func: EmuXapiInitProcess
// ******************************************************************
VOID WINAPI xboxkrnl::EmuXapiInitProcess()
VOID WINAPI xapi::EmuXapiInitProcess()
{
EmuSwapFS(); // Win2k/XP FS
@ -386,7 +398,7 @@ VOID WINAPI xboxkrnl::EmuXapiInitProcess()
// ******************************************************************
// * func: EmuXapiBootDash
// ******************************************************************
VOID WINAPI xboxkrnl::EmuXapiBootDash(uint32 UnknownA, uint32 UnknownB, uint32 UnknownC)
VOID WINAPI xapi::EmuXapiBootDash(DWORD UnknownA, DWORD UnknownB, DWORD UnknownC)
{
EmuSwapFS(); // Win2k/XP FS
@ -416,7 +428,7 @@ VOID WINAPI xboxkrnl::EmuXapiBootDash(uint32 UnknownA, uint32 UnknownB, uint32 U
// ******************************************************************
// * func: Emu__rtinit
// ******************************************************************
VOID xboxkrnl::Emu__rtinit()
VOID xapi::Emu__rtinit()
{
EmuSwapFS(); // Win2k/XP FS
@ -435,7 +447,7 @@ VOID xboxkrnl::Emu__rtinit()
// ******************************************************************
// * func: Emu__cinit
// ******************************************************************
VOID xboxkrnl::Emu__cinit()
VOID xapi::Emu__cinit()
{
EmuSwapFS(); // Win2k/XP FS

View File

@ -31,8 +31,28 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "Emu.h"
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
#include <windows.h>
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xapi
{
#include "EmuXapi.h"
};
#include "HLEDataBase.h"
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xd3d8
{
#include "xd3d8.h"
};
#include "Xapi.1.0.3911.inl"
#include "Xapi.1.0.4361.inl"

View File

@ -31,11 +31,18 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#define _CXBXKRNL_INTERNAL
#define _XBOXKRNL_LOCAL_
#include "Emu.h"
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include "Cxbx.h"
// ******************************************************************
// * NOTE:
@ -55,7 +62,7 @@
// ******************************************************************
// * KernelThunkTable
// ******************************************************************
CXBXKRNL_API uint32 KernelThunkTable[367] =
extern "C" CXBXKRNL_API uint32 KernelThunkTable[367] =
{
(uint32)PANIC(0x0000), // 0x0000 (0)
(uint32)PANIC(0x0001), // 0x0001 (1)

View File

@ -181,7 +181,7 @@ OOVPATable XAPI_1_0_3911[] =
{
(OOVPA*)&CreateThread_1_0_3911,
xboxkrnl::EmuCreateThread,
xapi::EmuCreateThread,
#ifdef _DEBUG_TRACE
"EmuCreateThread"
@ -191,7 +191,7 @@ OOVPATable XAPI_1_0_3911[] =
{
(OOVPA*)&XapiInitProcess_1_0_3911,
xboxkrnl::EmuXapiInitProcess,
xapi::EmuXapiInitProcess,
#ifdef _DEBUG_TRACE
"EmuXapiInitProcess"
@ -201,7 +201,7 @@ OOVPATable XAPI_1_0_3911[] =
{
(OOVPA*)&XapiBootDash_1_0_3911,
xboxkrnl::EmuXapiBootDash,
xapi::EmuXapiBootDash,
#ifdef _DEBUG_TRACE
"EmuXapiBootDash"
@ -211,7 +211,7 @@ OOVPATable XAPI_1_0_3911[] =
{
(OOVPA*)&__rtinit_1_0_3911,
xboxkrnl::Emu__rtinit,
xapi::Emu__rtinit,
#ifdef _DEBUG_TRACE
"Emu__rtinit",
@ -221,7 +221,7 @@ OOVPATable XAPI_1_0_3911[] =
{
(OOVPA*)&__cinit_1_0_3911,
xboxkrnl::Emu__cinit,
xapi::Emu__cinit,
#ifdef _DEBUG_TRACE
"Emu__cinit",

View File

@ -291,7 +291,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&XInitDevices_1_0_4361,
xboxkrnl::EmuXInitDevices,
xapi::EmuXInitDevices,
#ifdef _DEBUG_TRACE
"EmuXInitDevices"
@ -301,7 +301,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&XGetDevices_1_0_4361,
xboxkrnl::EmuXGetDevices,
xapi::EmuXGetDevices,
#ifdef _DEBUG_TRACE
"EmuXGetDevices"
@ -311,7 +311,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&XInputOpen_1_0_4361,
xboxkrnl::EmuXInputOpen,
xapi::EmuXInputOpen,
#ifdef _DEBUG_TRACE
"EmuXInputOpen"
@ -321,7 +321,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&XInputGetCapabilities_1_0_4361,
xboxkrnl::EmuXInputGetCapabilities,
xapi::EmuXInputGetCapabilities,
#ifdef _DEBUG_TRACE
"EmuXInputGetCapabilities"
@ -331,7 +331,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&XInputGetState_1_0_4361,
xboxkrnl::EmuXInputGetState,
xapi::EmuXInputGetState,
#ifdef _DEBUG_TRACE
"EmuXInputGetState"
@ -341,7 +341,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&CreateThread_1_0_4361,
xboxkrnl::EmuCreateThread,
xapi::EmuCreateThread,
#ifdef _DEBUG_TRACE
"EmuCreateThread"
@ -351,7 +351,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&CloseHandle_1_0_4361,
xboxkrnl::EmuCloseHandle,
xapi::EmuCloseHandle,
#ifdef _DEBUG_TRACE
"EmuCloseHandle"
@ -361,7 +361,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&XapiInitProcess_1_0_4361,
xboxkrnl::EmuXapiInitProcess,
xapi::EmuXapiInitProcess,
#ifdef _DEBUG_TRACE
"EmuXapiInitProcess"
@ -371,7 +371,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&XapiBootDash_1_0_3911,
xboxkrnl::EmuXapiBootDash,
xapi::EmuXapiBootDash,
#ifdef _DEBUG_TRACE
"EmuXapiBootDash"
@ -381,7 +381,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&__rtinit_1_0_3911,
xboxkrnl::Emu__rtinit,
xapi::Emu__rtinit,
#ifdef _DEBUG_TRACE
"Emu__rtinit",
@ -391,7 +391,7 @@ OOVPATable XAPI_1_0_4361[] =
{
(OOVPA*)&__cinit_1_0_3911,
xboxkrnl::Emu__cinit,
xapi::Emu__cinit,
#ifdef _DEBUG_TRACE
"Emu__cinit",

View File

@ -41,7 +41,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&XInitDevices_1_0_4361,
xboxkrnl::EmuXInitDevices,
xapi::EmuXInitDevices,
#ifdef _DEBUG_TRACE
"EmuXInitDevices"
@ -51,7 +51,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&XGetDevices_1_0_4361,
xboxkrnl::EmuXGetDevices,
xapi::EmuXGetDevices,
#ifdef _DEBUG_TRACE
"EmuXGetDevices"
@ -61,7 +61,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&XInputOpen_1_0_4361,
xboxkrnl::EmuXInputOpen,
xapi::EmuXInputOpen,
#ifdef _DEBUG_TRACE
"EmuXInputOpen"
@ -71,7 +71,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&XInputGetCapabilities_1_0_4361,
xboxkrnl::EmuXInputGetCapabilities,
xapi::EmuXInputGetCapabilities,
#ifdef _DEBUG_TRACE
"EmuXInputGetCapabilities"
@ -81,7 +81,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&XInputGetState_1_0_4361,
xboxkrnl::EmuXInputGetState,
xapi::EmuXInputGetState,
#ifdef _DEBUG_TRACE
"EmuXInputGetState"
@ -91,7 +91,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&CreateThread_1_0_4361,
xboxkrnl::EmuCreateThread,
xapi::EmuCreateThread,
#ifdef _DEBUG_TRACE
"EmuCreateThread"
@ -101,7 +101,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&CloseHandle_1_0_4361,
xboxkrnl::EmuCloseHandle,
xapi::EmuCloseHandle,
#ifdef _DEBUG_TRACE
"EmuCloseHandle"
@ -111,7 +111,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&XapiInitProcess_1_0_4361,
xboxkrnl::EmuXapiInitProcess,
xapi::EmuXapiInitProcess,
#ifdef _DEBUG_TRACE
"EmuXapiInitProcess"
@ -121,7 +121,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&XapiBootDash_1_0_3911,
xboxkrnl::EmuXapiBootDash,
xapi::EmuXapiBootDash,
#ifdef _DEBUG_TRACE
"EmuXapiBootDash"
@ -131,7 +131,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&__rtinit_1_0_3911,
xboxkrnl::Emu__rtinit,
xapi::Emu__rtinit,
#ifdef _DEBUG_TRACE
"Emu__rtinit",
@ -141,7 +141,7 @@ OOVPATable XAPI_1_0_4627[] =
{
(OOVPA*)&__cinit_1_0_3911,
xboxkrnl::Emu__cinit,
xapi::Emu__cinit,
#ifdef _DEBUG_TRACE
"Emu__cinit",

View File

@ -31,7 +31,6 @@
// * All rights reserved
// *
// ******************************************************************
#include "Cxbx.h"
#include "InputConfig.h"
#include <windows.h>

View File

@ -33,6 +33,8 @@
// ******************************************************************
#include "Mutex.h"
#include <windows.h>
// ******************************************************************
// * Constructor
// ******************************************************************