summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-05-31 19:18:18 +0200
committerGitHub <noreply@github.com>2019-05-31 19:18:18 +0200
commit7eee450a698cf3cee5e21da45477d7a308668e1c (patch)
tree392a32b7c35ad574879564487f52ed14d6d4ea5c /src
parentmore high level functions (diff)
parentrw skeleton (diff)
downloadre3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.gz
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.bz2
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.lz
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.xz
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.zst
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.zip
Diffstat (limited to 'src')
-rw-r--r--src/ControllerConfig.cpp11
-rw-r--r--src/ControllerConfig.h79
-rw-r--r--src/Game.cpp4
-rw-r--r--src/Game.h4
-rw-r--r--src/Pad.cpp38
-rw-r--r--src/Pad.h69
-rw-r--r--src/Timer.cpp21
-rw-r--r--src/audio/DMAudio.cpp3
-rw-r--r--src/audio/DMAudio.h2
-rw-r--r--src/common.h25
-rw-r--r--src/main.cpp183
-rw-r--r--src/re3.cpp2
-rw-r--r--src/rw.cpp696
-rw-r--r--src/skel/events.cpp845
-rw-r--r--src/skel/events.h7
-rw-r--r--src/skel/platform.h36
-rw-r--r--src/skel/skeleton.cpp454
-rw-r--r--src/skel/skeleton.h276
18 files changed, 2422 insertions, 333 deletions
diff --git a/src/ControllerConfig.cpp b/src/ControllerConfig.cpp
new file mode 100644
index 00000000..30f3e144
--- /dev/null
+++ b/src/ControllerConfig.cpp
@@ -0,0 +1,11 @@
+#include "common.h"
+#include "patcher.h"
+#include "ControllerConfig.h"
+
+CControllerConfigManager &ControlsManager = *(CControllerConfigManager*)0x8F43A4;
+
+WRAPPER void CControllerConfigManager::UpdateJoyButtonState(int padnumber) { EAXJMP(0x58F5B0); }
+WRAPPER void CControllerConfigManager::UpdateJoyInConfigMenus_ButtonDown(int button, int padnumber) { EAXJMP(0x58C5E0); }
+WRAPPER void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int button, eControllerType type) { EAXJMP(0x58C730); }
+WRAPPER void CControllerConfigManager::UpdateJoyInConfigMenus_ButtonUp(int button, int padnumber) { EAXJMP(0x58CE80); }
+WRAPPER void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int button, int padnumber) { EAXJMP(0x58CFD0); } \ No newline at end of file
diff --git a/src/ControllerConfig.h b/src/ControllerConfig.h
new file mode 100644
index 00000000..a439e09b
--- /dev/null
+++ b/src/ControllerConfig.h
@@ -0,0 +1,79 @@
+#pragma once
+
+// dinput.h
+typedef struct DIJOYSTATE2 {
+ LONG lX; /* x-axis position */
+ LONG lY; /* y-axis position */
+ LONG lZ; /* z-axis position */
+ LONG lRx; /* x-axis rotation */
+ LONG lRy; /* y-axis rotation */
+ LONG lRz; /* z-axis rotation */
+ LONG rglSlider[2]; /* extra axes positions */
+ DWORD rgdwPOV[4]; /* POV directions */
+ BYTE rgbButtons[128]; /* 128 buttons */
+ LONG lVX; /* x-axis velocity */
+ LONG lVY; /* y-axis velocity */
+ LONG lVZ; /* z-axis velocity */
+ LONG lVRx; /* x-axis angular velocity */
+ LONG lVRy; /* y-axis angular velocity */
+ LONG lVRz; /* z-axis angular velocity */
+ LONG rglVSlider[2]; /* extra axes velocities */
+ LONG lAX; /* x-axis acceleration */
+ LONG lAY; /* y-axis acceleration */
+ LONG lAZ; /* z-axis acceleration */
+ LONG lARx; /* x-axis angular acceleration */
+ LONG lARy; /* y-axis angular acceleration */
+ LONG lARz; /* z-axis angular acceleration */
+ LONG rglASlider[2]; /* extra axes accelerations */
+ LONG lFX; /* x-axis force */
+ LONG lFY; /* y-axis force */
+ LONG lFZ; /* z-axis force */
+ LONG lFRx; /* x-axis torque */
+ LONG lFRy; /* y-axis torque */
+ LONG lFRz; /* z-axis torque */
+ LONG rglFSlider[2]; /* extra axes forces */
+} DIJOYSTATE2, *LPDIJOYSTATE2;
+
+
+// based on x-gtasa
+
+enum eControllerType
+{
+ KEYBOARD,
+ OPTIONAL_EXTRA,
+ MOUSE,
+ JOYSTICK,
+};
+
+class CControllerConfigManager
+{
+public:
+ struct tControllerConfigBind
+ {
+ RsKeyCodes m_Key;
+ Int32 m_ContSetOrder;
+ };
+
+ Bool field_0;
+ char _pad0[3];
+ DIJOYSTATE2 m_OldState;
+ DIJOYSTATE2 m_NewState;
+ WChar m_aActionNames[41][40];
+ Bool m_aButtonStates[17];
+ char _pad1[3];
+ tControllerConfigBind m_aSettings[41][4];
+ UInt8 m_aSimCheckers[4][4];
+ Bool m_bMouseAssociated;
+ char _pad2[3];
+
+ void UpdateJoyButtonState(int padnumber);
+ void UpdateJoyInConfigMenus_ButtonDown(int button, int padnumber);
+ void AffectControllerStateOn_ButtonDown(int button, eControllerType type);
+ void UpdateJoyInConfigMenus_ButtonUp(int button, int padnumber);
+ void AffectControllerStateOn_ButtonUp(int button, int padnumber);
+
+};
+
+VALIDATE_SIZE(CControllerConfigManager, 0x143C);
+
+extern CControllerConfigManager &ControlsManager; \ No newline at end of file
diff --git a/src/Game.cpp b/src/Game.cpp
index 2cac69ea..aab7cf7b 100644
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -7,3 +7,7 @@ bool &CGame::bDemoMode = *(bool*)0x5F4DD0;
bool &CGame::nastyGame = *(bool*)0x5F4DD4;
WRAPPER void CGame::Process(void) { EAXJMP(0x48C850); }
+WRAPPER Bool CGame::InitialiseOnceBeforeRW(void) { EAXJMP(0x48BB80); }
+WRAPPER Bool CGame::InitialiseRenderWare(void) { EAXJMP(0x48BBA0); }
+WRAPPER void CGame::ShutdownRenderWare(void) { EAXJMP(0x48BCB0); }
+WRAPPER void CGame::FinalShutdown(void) { EAXJMP(0x48BEC0); }
diff --git a/src/Game.h b/src/Game.h
index 19a85a47..11e193e4 100644
--- a/src/Game.h
+++ b/src/Game.h
@@ -16,4 +16,8 @@ public:
static bool &nastyGame;
static void Process(void);
+ static Bool InitialiseOnceBeforeRW(void);
+ static Bool InitialiseRenderWare(void);
+ static void ShutdownRenderWare(void);
+ static void FinalShutdown(void);
};
diff --git a/src/Pad.cpp b/src/Pad.cpp
index f27954e8..3d2e9bce 100644
--- a/src/Pad.cpp
+++ b/src/Pad.cpp
@@ -4,14 +4,17 @@
CPad *CPad::Pads = (CPad*)0x6F0360;
-uint16 *CPad::OldKeyState = (uint16*)0x6F1E70;
-uint16 *CPad::NewKeyState = (uint16*)0x6E60D0;
-uint16 *CPad::TempKeyState = (uint16*)0x774DE8;
+CKeyboardState &CPad::OldKeyState = *(CKeyboardState*)0x6F1E70;
+CKeyboardState &CPad::NewKeyState = *(CKeyboardState*)0x6E60D0;
+CKeyboardState &CPad::TempKeyState = *(CKeyboardState*)0x774DE8;
CMouseControllerState &CPad::OldMouseControllerState = *(CMouseControllerState*)0x8472A0;
CMouseControllerState &CPad::NewMouseControllerState = *(CMouseControllerState*)0x8809F0;
CMouseControllerState &CPad::PCTempMouseControllerState = *(CMouseControllerState*)0x6F1E60;
+Bool &CPad::m_bMapPadOneToPadTwo = *(Bool *)0x95CD48;
+
+WRAPPER void CPad::AddToPCCheatString(Char c) { EAXJMP(0x492450); }
WRAPPER void CPad::UpdatePads(void) { EAXJMP(0x492720); }
WRAPPER void CPad::PrintErrorMessage(void) { EAXJMP(0x4942B0); }
@@ -41,6 +44,35 @@ CControllerState::Clear(void)
NetworkTalk = 0;
}
+void CKeyboardState::Clear()
+{
+ for ( Int32 i = 0; i < 12; i++ )
+ F[i] = 0;
+
+ for ( Int32 i = 0; i < 256; i++ )
+ VK_KEYS[i] = 0;
+
+ ESC = INS = DEL = HOME = END = PGUP = PGDN = 0;
+
+ UP = DOWN = LEFT = RIGHT = 0;
+
+ NUMLOCK = 0;
+
+ DIV = MUL = SUB = ADD = 0;
+
+ DECIMAL = NUM1 = NUM2 = NUM3 = NUM4 = 0;
+
+ NUM5 = NUM6 = NUM7 = NUM8 = 0;
+
+ NUM9 = NUM0 = SCROLLLOCK = PAUSE = 0;
+
+ BACKSP = TAB = CAPSLOCK = EXTENTER = 0;
+
+ LSHIFT = SHIFT = RSHIFT = LCTRL = RCTRL = LALT = RALT = 0;
+
+ LWIN = RWIN = APPS = 0;
+}
+
bool
CPad::ForceCameraBehindPlayer(void)
{
diff --git a/src/Pad.h b/src/Pad.h
index 195a20d4..fee06f90 100644
--- a/src/Pad.h
+++ b/src/Pad.h
@@ -1,6 +1,7 @@
#pragma once
// same as RW skeleton
+/*
enum Key
{
// ascii...
@@ -46,8 +47,9 @@ enum Key
KEY_RALT = 177,
KEY_NULL, // unused
- KEY_NUMKEYS,
+ KEY_NUMKEYS
};
+*/
class CControllerState
@@ -77,6 +79,61 @@ struct CMouseControllerState
int x, y;
};
+class CKeyboardState
+{
+public:
+ Int16 F[12];
+ Int16 VK_KEYS[256];
+ Int16 ESC;
+ Int16 INS;
+ Int16 DEL;
+ Int16 HOME;
+ Int16 END;
+ Int16 PGUP;
+ Int16 PGDN;
+ Int16 UP;
+ Int16 DOWN;
+ Int16 LEFT;
+ Int16 RIGHT;
+ Int16 SCROLLLOCK;
+ Int16 PAUSE;
+ Int16 NUMLOCK;
+ Int16 DIV;
+ Int16 MUL;
+ Int16 SUB;
+ Int16 ADD;
+ Int16 ENTER;
+ Int16 DECIMAL;
+ Int16 NUM1;
+ Int16 NUM2;
+ Int16 NUM3;
+ Int16 NUM4;
+ Int16 NUM5;
+ Int16 NUM6;
+ Int16 NUM7;
+ Int16 NUM8;
+ Int16 NUM9;
+ Int16 NUM0;
+ Int16 BACKSP;
+ Int16 TAB;
+ Int16 CAPSLOCK;
+ Int16 EXTENTER;
+ Int16 LSHIFT;
+ Int16 RSHIFT;
+ Int16 SHIFT;
+ Int16 LCTRL;
+ Int16 RCTRL;
+ Int16 LALT;
+ Int16 RALT;
+ Int16 LWIN;
+ Int16 RWIN;
+ Int16 APPS;
+
+ void Clear();
+};
+
+VALIDATE_SIZE(CKeyboardState, 0x270);
+
class CPad
{
public:
@@ -101,12 +158,14 @@ public:
int32 AverageEntries;
static CPad *Pads; //[2];
- static uint16 *OldKeyState; //[KEY_NUMKEYS];
- static uint16 *NewKeyState; //[KEY_NUMKEYS];
- static uint16 *TempKeyState; //[KEY_NUMKEYS];
+ static CKeyboardState &OldKeyState;
+ static CKeyboardState &NewKeyState;
+ static CKeyboardState &TempKeyState;
static CMouseControllerState &OldMouseControllerState;
static CMouseControllerState &NewMouseControllerState;
static CMouseControllerState &PCTempMouseControllerState;
+
+ static Bool &m_bMapPadOneToPadTwo;
int GetLeftShoulder1(void) { return NewState.LeftShoulder1; }
int GetLeftShoulder2(void) { return NewState.LeftShoulder2; }
@@ -123,6 +182,8 @@ public:
static void UpdatePads(void);
static CPad *GetPad(int n) { return &Pads[n]; }
static void PrintErrorMessage(void);
+
+ void AddToPCCheatString(Char c);
};
static_assert(sizeof(CPad) == 0xFC, "CPad: error");
diff --git a/src/Timer.cpp b/src/Timer.cpp
index 69dd2881..c4609d7f 100644
--- a/src/Timer.cpp
+++ b/src/Timer.cpp
@@ -26,13 +26,6 @@ LARGE_INTEGER perfSuspendCounter;
UInt32 suspendDepth;
-_TODO("We need skeleton.c for RsTimer()");
-
-RwUInt32 RsTimer(void)
-{
- return ((RwUInt32 (__cdecl *)())0x584890)();
-}
-
void CTimer::Initialise(void)
{
debug("Initialising CTimer...\n");
@@ -86,7 +79,7 @@ void CTimer::Update(void)
LARGE_INTEGER pc;
QueryPerformanceCounter(&pc);
- Int64 updInCycles = (pc.LowPart - _oldPerfCounter.LowPart) & 0x7FFFFFFF;
+ Int32 updInCycles = (pc.LowPart - _oldPerfCounter.LowPart) & 0x7FFFFFFF;
_oldPerfCounter = pc;
@@ -94,14 +87,14 @@ void CTimer::Update(void)
Double upd = updInCyclesScaled / (Double)_nCyclesPerMS;
- m_snTimeInMillisecondsPauseMode += Int64(upd);
+ m_snTimeInMillisecondsPauseMode = (Int64)(m_snTimeInMillisecondsPauseMode + upd);
if ( GetIsPaused() )
ms_fTimeStep = 0.0f;
else
{
- m_snTimeInMilliseconds = Int64(upd);
- m_snTimeInMillisecondsNonClipped += Int64(upd);
+ m_snTimeInMilliseconds = (Int64)(m_snTimeInMilliseconds + upd);
+ m_snTimeInMillisecondsNonClipped = (Int64)(m_snTimeInMillisecondsNonClipped + upd);
ms_fTimeStep = updInCyclesScaled / (Double)_nCyclesPerMS / 20.0;
}
}
@@ -115,14 +108,14 @@ void CTimer::Update(void)
oldPcTimer = timer;
- m_snTimeInMillisecondsPauseMode += Int64(upd);
+ m_snTimeInMillisecondsPauseMode = (Int64)(m_snTimeInMillisecondsPauseMode + upd);
if ( GetIsPaused() )
ms_fTimeStep = 0.0f;
else
{
- m_snTimeInMilliseconds += Int64(upd);
- m_snTimeInMillisecondsNonClipped += Int64(upd);
+ m_snTimeInMilliseconds = (Int64)(m_snTimeInMilliseconds + upd);
+ m_snTimeInMillisecondsNonClipped = (Int64)(m_snTimeInMillisecondsNonClipped + upd);
ms_fTimeStep = upd / 1000.0f * 50.0f;
}
}
diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp
index a1165110..019089e7 100644
--- a/src/audio/DMAudio.cpp
+++ b/src/audio/DMAudio.cpp
@@ -4,6 +4,9 @@
cDMAudio &DMAudio = *(cDMAudio*)0x95CDBE;
+WRAPPER void cDMAudio::ReleaseDigitalHandle(void) { EAXJMP(0x57CA10); }
+WRAPPER void cDMAudio::ReacquireDigitalHandle(void) { EAXJMP(0x57CA30); }
+
WRAPPER void cDMAudio::Service(void) { EAXJMP(0x57C7A0); }
WRAPPER void cDMAudio::ReportCollision(CEntity *A, CEntity *B, uint8 surfA, uint8 surfB, float impulse, float speed) { EAXJMP(0x57CBE0); }
WRAPPER void cDMAudio::ResetTimers(UInt32 timerval) { EAXJMP(0x57CCD0); }
diff --git a/src/audio/DMAudio.h b/src/audio/DMAudio.h
index fb341d82..50616289 100644
--- a/src/audio/DMAudio.h
+++ b/src/audio/DMAudio.h
@@ -5,6 +5,8 @@ class CEntity;
class cDMAudio
{
public:
+ void ReleaseDigitalHandle(void);
+ void ReacquireDigitalHandle(void);
void Service(void);
void ReportCollision(CEntity *A, CEntity *B, uint8 surfA, uint8 surfB, float impulse, float speed);
void ResetTimers(UInt32 timerval);
diff --git a/src/common.h b/src/common.h
index 47dd13f2..90244580 100644
--- a/src/common.h
+++ b/src/common.h
@@ -45,6 +45,7 @@ typedef float Float;
typedef double Double;
typedef bool Bool;
typedef char Char;
+typedef wchar_t WChar;
#define nil NULL
@@ -56,29 +57,7 @@ typedef char Char;
extern void **rwengine;
#define RwEngineInstance (*rwengine)
-// TODO
-struct RsInputDevice
-{
- int inputDeviceType;
- int used;
- void *inputEventHandler;
-};
-
-struct RsGlobalType
-{
- const char *appName;
- int width;
- int height;
- int maximumWidth;
- int maximumHeight;
- int maxFPS;
- int quit;
- void *ps;
- RsInputDevice keyboard;
- RsInputDevice mouse;
- RsInputDevice pad;
-};
-extern RsGlobalType &RsGlobal;
+#include "skel\skeleton.h"
#define SCREENW (RsGlobal.maximumWidth)
#define SCREENH (RsGlobal.maximumHeight)
diff --git a/src/main.cpp b/src/main.cpp
index 07463402..ab0b94d7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -41,12 +41,22 @@
#include "TimeCycle.h"
#include "Frontend.h"
+#define DEFAULT_VIEWWINDOW (tan(CDraw::GetFOV() * (360.0f / PI)))
+
+#ifdef WIDE_SCREEN
+#define DEFAULT_ASPECTRATIO (16.0f/9.0f)
+#else
+#define DEFAULT_ASPECTRATIO (4.0f/3.0f)
+#endif
+
WRAPPER int psCameraBeginUpdate(RwCamera *camera) { EAXJMP(0x580C70); }
WRAPPER void psCameraShowRaster(RwCamera *camera) { EAXJMP(0x580CA0); }
-WRAPPER void CameraSize(RwCamera *camera, CRect *rect, float viewWindow, float aspectRatio) { EAXJMP(0x527170); }
-int RsCameraBeginUpdate(RwCamera *camera) { return psCameraBeginUpdate(camera); } // argument actually ignored
-void RsCameraShowRaster(RwCamera *camera) { psCameraShowRaster(camera); }
+WRAPPER void CameraSize(RwCamera *camera, void *rect, float viewWindow, float aspectRatio) { EAXJMP(0x527170); }
+
+WRAPPER RwBool RpAnimBlendPluginAttach() { EAXJMP(0x4052D0); }
+WRAPPER RwBool NodeNamePluginAttach() { EAXJMP(0x527100); }
+
bool &b_FoundRecentSavedGameWantToLoad = *(bool*)0x95CDA8;
@@ -413,6 +423,168 @@ Render2dStuffAfterFade(void)
CFont::DrawFonts();
}
+#include "rwcore.h"
+#include "rpworld.h"
+#include "rpmatfx.h"
+#include "rpskin.h"
+#include "rphanim.h"
+#include "rtbmp.h"
+
+_TODO("temp, move this includes out of here")
+
+static RwBool
+PluginAttach(void)
+{
+ if( !RpWorldPluginAttach() )
+ {
+ printf("Couldn't attach world plugin\n");
+
+ return FALSE;
+ }
+
+ if( !RpSkinPluginAttach() )
+ {
+ printf("Couldn't attach RpSkin plugin\n");
+
+ return FALSE;
+ }
+
+ if( !RpHAnimPluginAttach() )
+ {
+ printf("Couldn't attach RpHAnim plugin\n");
+
+ return FALSE;
+ }
+
+ if( !NodeNamePluginAttach() )
+ {
+ printf("Couldn't attach node name plugin\n");
+
+ return FALSE;
+ }
+
+ if( !CVisibilityPlugins::PluginAttach() )
+ {
+ printf("Couldn't attach visibility plugins\n");
+
+ return FALSE;
+ }
+
+ if( !RpAnimBlendPluginAttach() )
+ {
+ printf("Couldn't attach RpAnimBlend plugin\n");
+
+ return FALSE;
+ }
+
+ if( !RpMatFXPluginAttach() )
+ {
+ printf("Couldn't attach RpMatFX plugin\n");
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static RwBool
+Initialise3D(void *param)
+{
+ if (RsRwInitialise(param))
+ {
+ return CGame::InitialiseRenderWare();
+ }
+
+ return (FALSE);
+}
+
+
+static void
+Terminate3D(void)
+{
+ CGame::ShutdownRenderWare();
+
+ RsRwTerminate();
+
+ return;
+}
+
+RsEventStatus
+AppEventHandler(RsEvent event, void *param)
+{
+ switch( event )
+ {
+ case rsINITIALISE:
+ {
+ CGame::InitialiseOnceBeforeRW();
+ return RsInitialise() ? rsEVENTPROCESSED : rsEVENTERROR;
+ }
+
+ case rsCAMERASIZE:
+ {
+ CameraSize(Scene.camera, param, DEFAULT_VIEWWINDOW, DEFAULT_ASPECTRATIO);
+
+ return rsEVENTPROCESSED;
+ }
+
+ case rsRWINITIALISE:
+ {
+ return Initialise3D(param) ? rsEVENTPROCESSED : rsEVENTERROR;
+ }
+
+ case rsRWTERMINATE:
+ {
+ Terminate3D();
+
+ return rsEVENTPROCESSED;
+ }
+
+ case rsTERMINATE:
+ {
+ CGame::FinalShutdown();
+
+ return rsEVENTPROCESSED;
+ }
+
+ case rsPLUGINATTACH:
+ {
+ return PluginAttach() ? rsEVENTPROCESSED : rsEVENTERROR;
+ }
+
+ case rsINPUTDEVICEATTACH:
+ {
+ AttachInputDevices();
+
+ return rsEVENTPROCESSED;
+ }
+
+ case rsIDLE:
+ {
+ Idle(param);
+
+ return rsEVENTPROCESSED;
+ }
+
+ case rsFRONTENDIDLE:
+ {
+ FrontendIdle();
+
+ return rsEVENTPROCESSED;
+ }
+
+ case rsACTIVATE:
+ {
+ param ? DMAudio.ReacquireDigitalHandle() : DMAudio.ReleaseDigitalHandle();
+
+ return rsEVENTPROCESSED;
+ }
+
+ default:
+ {
+ return rsEVENTNOTPROCESSED;
+ }
+ }
+}
STARTPATCHES
InjectHook(0x48E480, Idle, PATCH_JUMP);
@@ -426,4 +598,9 @@ STARTPATCHES
InjectHook(0x48E450, RenderMenus, PATCH_JUMP);
InjectHook(0x48D120, DoFade, PATCH_JUMP);
InjectHook(0x48E470, Render2dStuffAfterFade, PATCH_JUMP);
+
+ InjectHook(0x48D470, PluginAttach, PATCH_JUMP);
+ InjectHook(0x48D520, Initialise3D, PATCH_JUMP);
+ InjectHook(0x48D540, Terminate3D, PATCH_JUMP);
+ InjectHook(0x48E800, AppEventHandler, PATCH_JUMP);
ENDPATCHES
diff --git a/src/re3.cpp b/src/re3.cpp
index 08d02d12..b3484c60 100644
--- a/src/re3.cpp
+++ b/src/re3.cpp
@@ -9,8 +9,6 @@
void **rwengine = *(void***)0x5A10E1;
-RsGlobalType &RsGlobal = *(RsGlobalType*)0x8F4360;
-
GlobalScene &Scene = *(GlobalScene*)0x726768;
DebugMenuAPI gDebugMenuAPI;
diff --git a/src/rw.cpp b/src/rw.cpp
index d202b2ce..52bcf5bb 100644
--- a/src/rw.cpp
+++ b/src/rw.cpp
@@ -1,287 +1,415 @@
#include "common.h"
#include "patcher.h"
-#include <rwcore.h>
-#include <rpworld.h>
-#include <rpmatfx.h>
-
-//
- // ADDRESS
-//
-
-int gtaversion = -1;
-
-WRAPPER RwTexDictionary *RwTexDictionaryCreate(void) { EAXJMP(0x5A7160); }
-WRAPPER RwBool RwTexDictionaryDestroy(RwTexDictionary*) { EAXJMP(0x5A7200); }
-static uint32_t RwTexDictionaryFindNamedTexture_A = AddressByVersion<uint32_t>(0x5A74D0, 0, 0, 0x64E060, 0, 0);
-WRAPPER RwTexture *RwTexDictionaryFindNamedTexture(RwTexDictionary*, const RwChar*) { VARJMP(RwTexDictionaryFindNamedTexture_A); }
-static uint32_t RwTextureRead_A = AddressByVersion<uint32_t>(0x5A7580, 0x5A7840, 0x5A8E00, 0x64E110, 0, 0);
-WRAPPER RwTexture *RwTextureRead(const RwChar*, const RwChar*) { VARJMP(RwTextureRead_A); }
-static uint32_t RwTexDictionaryGetCurrent_A = AddressByVersion<uint32_t>(0x5A7570, 0x5A7830, 0x5A8DA0, 0x64E100, 0, 0);
-WRAPPER RwTexDictionary *RwTexDictionaryGetCurrent(void) { VARJMP(RwTexDictionaryGetCurrent_A); }
-static uint32_t RwTexDictionarySetCurrent_A = AddressByVersion<uint32_t>(0x5A7550, 0x5A7810, 0x5A8D80, 0x64E0E0, 0, 0);
-WRAPPER RwTexDictionary *RwTexDictionarySetCurrent(RwTexDictionary * dict) { VARJMP(RwTexDictionarySetCurrent_A); }
-static uint32_t RwTexDictionaryForAllTextures_A = AddressByVersion<uint32_t>(0, 0, 0, 0x64DE20, 0, 0);
-WRAPPER const RwTexDictionary *RwTexDictionaryForAllTextures(const RwTexDictionary*, RwTextureCallBack, void*) { VARJMP(RwTexDictionaryForAllTextures_A); }
-
-static uint32_t RwV3dLength_A = AddressByVersion<uint32_t>(0x5A36A0, 0, 0, 0x647030, 0, 0);
-WRAPPER RwReal RwV3dLength(const RwV3d*) { VARJMP(RwV3dLength_A); }
-WRAPPER RwV3d *RwV3dTransformPoints(RwV3d*, const RwV3d*, RwInt32, const RwMatrix*) { EAXJMP(0x5A37D0); }
-
-static uint32_t D3D8AtomicDefaultInstanceCallback_A = AddressByVersion<uint32_t>(0x5DB450, 0x5DB710, 0x5EC520, 0x67BAE0, 0, 0);
-WRAPPER RwBool D3D8AtomicDefaultInstanceCallback(void*, RxD3D8InstanceData*, RwBool) { VARJMP(D3D8AtomicDefaultInstanceCallback_A); }
-static uint32_t D3D8AtomicDefaultReinstanceCallback_A = AddressByVersion<uint32_t>(0x5DBFB0, 0, 0, 0x67C640, 0, 0);
-WRAPPER RwBool D3D8AtomicDefaultReinstanceCallback(void*, RwResEntry*, const RpMeshHeader*, RxD3D8AllInOneInstanceCallBack) { VARJMP(D3D8AtomicDefaultReinstanceCallback_A); }
-
-static uint32_t rwD3D8RWGetRasterStage_A = AddressByVersion<uint32_t>(0x5B5390, 0x5B5650, 0x5BA2C0, 0x659840, 0x659890, 0x6587F0);
-WRAPPER int rwD3D8RWGetRasterStage(int) { VARJMP(rwD3D8RWGetRasterStage_A); }
-
-static uint32_t RpWorldAddCamera_A = AddressByVersion<uint32_t>(0x5AFB80, 0, 0, 0x654460, 0, 0);
-WRAPPER RpWorld *RpWorldAddCamera(RpWorld*, RwCamera*) { VARJMP(RpWorldAddCamera_A); }
-
-static uint32_t RpMaterialRegisterPlugin_A = AddressByVersion<uint32_t>(0x5ADD40, 0, 0, 0x6558C0, 0, 0);
-WRAPPER RwInt32 RpMaterialRegisterPlugin(RwInt32, RwUInt32, RwPluginObjectConstructor, RwPluginObjectDestructor, RwPluginObjectCopy) { VARJMP(RpMaterialRegisterPlugin_A); }
-WRAPPER RpMaterial *RpMaterialSetTexture(RpMaterial*, RwTexture*) { EAXJMP(0x5ADD10); }
-
-//
- //
-//
-
-static uint32_t RwMatrixCreate_A = AddressByVersion<uint32_t>(0x5A3330, 0x5A35F0, 0x5A3FA0, 0x644620, 0x644670, 0x6435D0);
-WRAPPER RwMatrix *RwMatrixCreate(void) { VARJMP(RwMatrixCreate_A); }
-static uint32_t RwMatrixDestroy_A = AddressByVersion<uint32_t>(0x5A3300, 0x5A35C0, 0x5A3F70, 0x6445F0, 0x644640, 0x6435A0);
-WRAPPER RwBool RwMatrixDestroy(RwMatrix*) { VARJMP(RwMatrixDestroy_A); }
-static uint32_t RwMatrixMultiply_A = AddressByVersion<uint32_t>(0x5A28F0, 0x5A2BB0, 0x5A2E10, 0x6437C0, 0x643810, 0x642770);
-WRAPPER RwMatrix *RwMatrixMultiply(RwMatrix*, const RwMatrix*, const RwMatrix*) { VARJMP(RwMatrixMultiply_A); }
-static uint32_t RwMatrixInvert_A = AddressByVersion<uint32_t>(0x5A2C90, 0x5A2F50, 0x5A35A0, 0x643F40, 0x643F90, 0x642EF0);
-WRAPPER RwMatrix *RwMatrixInvert(RwMatrix*, const RwMatrix*) { VARJMP(RwMatrixInvert_A); }
-static uint32_t RwMatrixUpdate_A = AddressByVersion<uint32_t>(0x5A28E0, 0x5A2BA0, 0x5A2DF0, 0x6437B0, 0x643800, 0x642760);
-WRAPPER RwMatrix *RwMatrixUpdate(RwMatrix*) { VARJMP(RwMatrixUpdate_A); }
-static uint32_t RwMatrixRotate_A = AddressByVersion<uint32_t>(0x5A2BF0, 0x5A2EB0, 0x5A3510, 0x643EA0, 0x643EF0, 0x642E50);
-WRAPPER RwMatrix *RwMatrixRotate(RwMatrix*, const RwV3d*, RwReal, RwOpCombineType) { VARJMP(RwMatrixRotate_A); }
-static uint32_t RwMatrixOptimize_A = AddressByVersion<uint32_t>(0x5A2820, 0, 0, 0x6436F0, 0, 0);
-WRAPPER RwMatrix *RwMatrixOptimize(RwMatrix *matrix, const RwMatrixTolerance *tolerance) { VARJMP(RwMatrixOptimize_A); }
-WRAPPER RwMatrix *RwMatrixTransform(RwMatrix*, const RwMatrix*, RwOpCombineType) { EAXJMP(0x5A31C0); }
-WRAPPER RwFrame *RwFrameForAllObjects(RwFrame*, RwObjectCallBack, void*) { EAXJMP(0x5A2340); }
-
-static uint32_t RwFrameCreate_A = AddressByVersion<uint32_t>(0x5A1A00, 0x5A1CC0, 0x5A2270, 0x644AA0, 0x644AF0, 0x643A50);
-WRAPPER RwFrame *RwFrameCreate(void) { VARJMP(RwFrameCreate_A); }
-static uint32_t RwFrameUpdateObjects_A = AddressByVersion<uint32_t>(0x5A1C60, 0x5A1F20, 0x5A23B4, 0x644D00, 0x644D50, 0x643CB0);
-WRAPPER RwFrame *RwFrameUpdateObjects(RwFrame* a1)
-{
- if (gtaversion != III_STEAM)
- VARJMP(RwFrameUpdateObjects_A);
-
- __asm
- {
- mov eax, a1
- jmp RwFrameUpdateObjects_A
- }
-}
-static uint32_t RwFrameGetLTM_A = AddressByVersion<uint32_t>(0x5A1CE0, 0x5A1FA0, 0x5A2430, 0x644D80, 0x644DD0, 0x643D30);
-WRAPPER RwMatrix *RwFrameGetLTM(RwFrame*) { VARJMP(RwFrameGetLTM_A); }
-static uint32_t RwFrameTransform_A = AddressByVersion<uint32_t>(0x5A2140, 0x5A2400, 0x5A26E0, 0x6451E0, 0x645230, 0x644190);
-WRAPPER RwFrame *RwFrameTransform(RwFrame*, const RwMatrix*, RwOpCombineType) { VARJMP(RwFrameTransform_A); }
-WRAPPER RwBool RwFrameDestroy(RwFrame*) { EAXJMP(0x5A1A30); }
-WRAPPER RwInt32 RwFrameRegisterPlugin(RwInt32, RwUInt32,RwPluginObjectConstructor,RwPluginObjectDestructor, RwPluginObjectCopy) { EAXJMP(0x5A2380); }
-WRAPPER RwFrame *RwFrameForAllChildren(RwFrame*, RwFrameCallBack, void*) { EAXJMP(0x5A1FC0); }
-WRAPPER RwFrame *RwFrameAddChild(RwFrame*, RwFrame*) { EAXJMP(0x5A1D00); }
-WRAPPER RwFrame *RwFrameRemoveChild(RwFrame*) { EAXJMP(0x5A1ED0); }
-WRAPPER RwFrame *RwFrameScale(RwFrame*, const RwV3d*, RwOpCombineType) { EAXJMP(0x5A20A0); }
-
-static uint32_t RwCameraCreate_A = AddressByVersion<uint32_t>(0x5A5360, 0x5A5620, 0x5A74E0, 0x64AB50, 0x64ABA0, 0x649B00);
-WRAPPER RwCamera *RwCameraCreate(void) { VARJMP(RwCameraCreate_A); }
-static uint32_t RwCameraBeginUpdate_A = AddressByVersion<uint32_t>(0x5A5030, 0x5A52F0, 0x5A7220, 0x64A820, 0x64A870, 0x6497D0);
-WRAPPER RwCamera *RwCameraBeginUpdate(RwCamera*) { VARJMP(RwCameraBeginUpdate_A); }
-static uint32_t RwCameraEndUpdate_A = AddressByVersion<uint32_t>(0x5A5020, 0x5A52E0, 0x5A7200, 0x64A810, 0x64A860, 0x6497C0);
-WRAPPER RwCamera *RwCameraEndUpdate(RwCamera*) { VARJMP(RwCameraEndUpdate_A); }
-static uint32_t RwCameraSetNearClipPlane_A = AddressByVersion<uint32_t>(0x5A5070, 0x5A5330, 0x5A7270, 0x64A860, 0x64A8B0, 0x649810);
-WRAPPER RwCamera *RwCameraSetNearClipPlane(RwCamera*, RwReal) { VARJMP(RwCameraSetNearClipPlane_A); }
-static uint32_t RwCameraSetFarClipPlane_A = AddressByVersion<uint32_t>(0x5A5140, 0x5A5400, 0x5A72A0, 0x64A930, 0x64A980, 0x6498E0);
-WRAPPER RwCamera *RwCameraSetFarClipPlane(RwCamera*, RwReal) { VARJMP(RwCameraSetFarClipPlane_A); }
-static uint32_t RwCameraSetViewWindow_A = AddressByVersion<uint32_t>(0x5A52B0, 0x5A5570, 0x5A7440, 0x64AAA0, 0x64AAF0, 0x649A50);
-WRAPPER RwCamera *RwCameraSetViewWindow(RwCamera*, const RwV2d*) { VARJMP(RwCameraSetViewWindow_A); }
-static uint32_t RwCameraClear_A = AddressByVersion<uint32_t>(0x5A51E0, 0x5A54A0, 0x5A7350, 0x64A9D0, 0x64AA20, 0x649980);
-WRAPPER RwCamera *RwCameraClear(RwCamera*, RwRGBA*, RwInt32) { VARJMP(RwCameraClear_A); }
-
-static uint32_t RwRasterCreate_A = AddressByVersion<uint32_t>(0x5AD930, 0x5ADBF0, 0x5B0580, 0x655490, 0x6554E0, 0x654440);
-WRAPPER RwRaster *RwRasterCreate(RwInt32, RwInt32, RwInt32, RwInt32) { VARJMP(RwRasterCreate_A); }
-// ADDRESS
-static uint32_t RwRasterDestroy_A = AddressByVersion<uint32_t>(0x5AD780, 0, 0, 0x6552E0, 0, 0);
-WRAPPER RwBool RwRasterDestroy(RwRaster*) { VARJMP(RwRasterDestroy_A); }
-static uint32_t RwRasterSetFromImage_A = AddressByVersion<uint32_t>(0x5BBF50, 0x5BC210, 0x5C0BF0, 0x6602B0, 0x660300, 0x65F260);
-WRAPPER RwRaster *RwRasterSetFromImage(RwRaster*, RwImage*) { VARJMP(RwRasterSetFromImage_A); }
-static uint32_t RwRasterPushContext_A = AddressByVersion<uint32_t>(0x5AD7C0, 0x5ADA80, 0x5B03C0, 0x655320, 0x655370, 0x6542D0);
-WRAPPER RwRaster *RwRasterPushContext(RwRaster*) { VARJMP(RwRasterPushContext_A); }
-static uint32_t RwRasterPopContext_A = AddressByVersion<uint32_t>(0x5AD870, 0x5ADB30, 0x5B0460, 0x6553D0, 0x655420, 0x654380);
-WRAPPER RwRaster *RwRasterPopContext(void) { VARJMP(RwRasterPopContext_A); }
-static uint32_t RwRasterRenderFast_A = AddressByVersion<uint32_t>(0x5AD710, 0x5AD9D0, 0x5B0800, 0x655270, 0x6552C0, 0x654220);
-WRAPPER RwRaster *RwRasterRenderFast(RwRaster*, RwInt32, RwInt32) { VARJMP(RwRasterRenderFast_A); }
-//RwRaster *RwRasterRenderScaled(RwRaster *raster, RwRect *rect)
-//{
-// ((RwGlobals*)RwEngineInst)->stdFunc[rwSTANDARDRASTERRENDERSCALED](raster, rect, 0);
-// return raster;
-//}
-
-static uint32_t RwTextureCreate_A = AddressByVersion<uint32_t>(0x5A72D0, 0x5A7590, 0x5A8AC0, 0x64DE60, 0x64DEB0, 0x64CE10);
-WRAPPER RwTexture *RwTextureCreate(RwRaster*) { VARJMP(RwTextureCreate_A); }
-WRAPPER RwBool RwTextureDestroy(RwTexture*) { EAXJMP(0x5A7330); }
-
-static uint32_t RwRenderStateGet_A = AddressByVersion<uint32_t>(0x5A4410, 0x5A46D0, 0x5A53B0, 0x649BF0, 0x649C40, 0x648BA0);
-WRAPPER RwBool RwRenderStateGet(RwRenderState, void*) { VARJMP(RwRenderStateGet_A); }
-static uint32_t RwRenderStateSet_A = AddressByVersion<uint32_t>(0x5A43C0, 0x5A4680, 0x5A5360, 0x649BA0, 0x649BF0, 0x648B50);
-WRAPPER RwBool RwRenderStateSet(RwRenderState, void*) { VARJMP(RwRenderStateSet_A); }
-
-static uint32_t RwD3D8SetTexture_A = AddressByVersion<uint32_t>(0x5B53A0, 0x5B5660, 0x5BA2D0, 0x659850, 0x6598A0, 0x658800);
-WRAPPER RwBool RwD3D8SetTexture(RwTexture*, RwUInt32) { VARJMP(RwD3D8SetTexture_A); }
-static uint32_t RwD3D8SetRenderState_A = AddressByVersion<uint32_t>(0x5B3CF0, 0x5B3FB0, 0x5B84B0, 0x6582A0, 0x6582F0, 0x657250);
-WRAPPER RwBool RwD3D8SetRenderState(RwUInt32, RwUInt32) { VARJMP(RwD3D8SetRenderState_A); }
-static uint32_t RwD3D8GetRenderState_A = AddressByVersion<uint32_t>(0x5B3D40, 0x5B4000, 0x5B8510, 0x6582F0, 0x658340, 0x6572A0);
-WRAPPER void RwD3D8GetRenderState(RwUInt32, void*) { VARJMP(RwD3D8GetRenderState_A); }
-static uint32_t RwD3D8SetTextureStageState_A = AddressByVersion<uint32_t>(0x5B3D60, 0x5B4020, 0x5B8530, 0x658310, 0x658360, 0x6572C0);
-WRAPPER RwBool RwD3D8SetTextureStageState(RwUInt32, RwUInt32, RwUInt32) { VARJMP(RwD3D8SetTextureStageState_A); }
-static uint32_t RwD3D8SetVertexShader_A = AddressByVersion<uint32_t>(0x5BAF90, 0x5BB250, 0x5BF440, 0x65F2F0, 0x65F340, 0x65E2A0);
-WRAPPER RwBool RwD3D8SetVertexShader(RwUInt32) { VARJMP(RwD3D8SetVertexShader_A); }
-static uint32_t RwD3D8SetPixelShader_A = AddressByVersion<uint32_t>(0x5BAFD0, 0x5BB290, 0x5BF4A0, 0x65F330, 0x65F380, 0x65E2E0);
-WRAPPER RwBool RwD3D8SetPixelShader(RwUInt32 handle) { VARJMP(RwD3D8SetPixelShader_A); }
-static uint32_t RwD3D8SetStreamSource_A = AddressByVersion<uint32_t>(0x5BB010, 0x5BB2D0, 0x5BF500, 0x65F370, 0x65F3C0, 0x65E320);
-WRAPPER RwBool RwD3D8SetStreamSource(RwUInt32, void*, RwUInt32) { VARJMP(RwD3D8SetStreamSource_A); }
-static uint32_t RwD3D8SetIndices_A = AddressByVersion<uint32_t>(0x5BB060, 0x5BB320, 0x5BF590, 0x65F3C0, 0x65F410, 0x65E370);
-WRAPPER RwBool RwD3D8SetIndices(void*, RwUInt32) { VARJMP(RwD3D8SetIndices_A); }
-static uint32_t RwD3D8DrawIndexedPrimitive_A = AddressByVersion<uint32_t>(0x5BB0B0, 0x5BB370, 0x5BF610, 0x65F410, 0x65F460, 0x65E3C0);
-WRAPPER RwBool RwD3D8DrawIndexedPrimitive(RwUInt32, RwUInt32, RwUInt32, RwUInt32, RwUInt32) { VARJMP(RwD3D8DrawIndexedPrimitive_A); }
-static uint32_t RwD3D8DrawPrimitive_A = AddressByVersion<uint32_t>(0x5BB140, 0x5BB400, 0x5BF6C0, 0x65F4A0, 0x65F4F0, 0x65E450);
-WRAPPER RwBool RwD3D8DrawPrimitive(RwUInt32, RwUInt32, RwUInt32) { VARJMP(RwD3D8DrawPrimitive_A); }
-static uint32_t RwD3D8SetSurfaceProperties_A = AddressByVersion<uint32_t>(0x5BB490, 0x5BB750, 0x5BFB30, 0x65F7F0, 0x65F840, 0x65E7A0);
-WRAPPER RwBool RwD3D8SetSurfaceProperties(const RwRGBA*, const RwSurfaceProperties*, RwBool) { VARJMP(RwD3D8SetSurfaceProperties_A); }
-static uint32_t RwD3D8SetTransform_A = AddressByVersion<uint32_t>(0x5BB1D0, 0x5BB490, 0x5BF768, 0x65F530, 0x65F580, 0x65E4E0);
-WRAPPER RwBool RwD3D8SetTransform(RwUInt32 a1, const void* a2)
-{
- if (gtaversion != III_STEAM)
- VARJMP(RwD3D8SetTransform_A);
-
- __asm
- {
- mov edx, [esp+8]
- mov eax, [esp+4]
- jmp RwD3D8SetTransform_A
- }
-}
-static uint32_t RwD3D8GetTransform_A = AddressByVersion<uint32_t>(0x5BB310, 0x5BB5D0, 0x5BF930, 0x65F670, 0x65F6C0, 0x65E620);
-WRAPPER void RwD3D8GetTransform(RwUInt32, void*) { VARJMP(RwD3D8GetTransform_A); }
-
-//WRAPPER RwBool RwD3D8SetLight(RwInt32, const void*) { EAXJMP(0x65FB20); }
-//WRAPPER RwBool RwD3D8EnableLight(RwInt32, RwBool) { EAXJMP(0x65FC10); }
-
-static uint32_t rwD3D8RenderStateIsVertexAlphaEnable_A = AddressByVersion<uint32_t>(0x5B5A50, 0x5B5D10, 0x5BA970, 0x659F60, 0x659FB0, 0x658F10);
-WRAPPER RwBool rwD3D8RenderStateIsVertexAlphaEnable(void) { VARJMP(rwD3D8RenderStateIsVertexAlphaEnable_A); };
-static uint32_t rwD3D8RenderStateVertexAlphaEnable_A = AddressByVersion<uint32_t>(0x5B57E0, 0x5B5AA0, 0x5BA840, 0x659CF0, 0x659D40, 0x658CA0);
-WRAPPER void rwD3D8RenderStateVertexAlphaEnable(RwBool x) { VARJMP(rwD3D8RenderStateVertexAlphaEnable_A); };
-static uint32_t RpAtomicGetWorldBoundingSphere_A = AddressByVersion<uint32_t>(0x59E800, 0x59EAC0, 0x59EB20, 0x640710, 0x640760, 0x63F6C0);
-WRAPPER const RwSphere *RpAtomicGetWorldBoundingSphere(RpAtomic*) { VARJMP(RpAtomicGetWorldBoundingSphere_A); };
-static uint32_t RwD3D8CameraIsSphereFullyInsideFrustum_A = AddressByVersion<uint32_t>(0x5BBC40, 0x5BBF00, 0x5C0450, 0x65FFB0, 0x660000, 0x65EF60);
-WRAPPER RwBool RwD3D8CameraIsSphereFullyInsideFrustum(const void*, const void*) { VARJMP(RwD3D8CameraIsSphereFullyInsideFrustum_A); };
-static uint32_t RwD3D8CameraIsBBoxFullyInsideFrustum_A = AddressByVersion<uint32_t>(0x5BBCA0, 0x5BBF60, 0x5C04B0, 0x660010, 0x660060, 0x65EFC0);
-WRAPPER RwBool RwD3D8CameraIsBBoxFullyInsideFrustum(const void*, const void*) { VARJMP(RwD3D8CameraIsBBoxFullyInsideFrustum_A); };
-
-static uint32_t RtBMPImageRead_A = AddressByVersion<uint32_t>(0x5AFE70, 0x5B0130, 0x5B3390, 0x657870, 0x6578C0, 0x656820);
-WRAPPER RwImage *RtBMPImageRead(const RwChar*) { VARJMP(RtBMPImageRead_A); }
-static uint32_t RwImageFindRasterFormat_A = AddressByVersion<uint32_t>(0x5BBF80, 0x5BC240, 0x5C0C40, 0x6602E0, 0x660330, 0x65F290);
-WRAPPER RwImage *RwImageFindRasterFormat(RwImage*, RwInt32, RwInt32*, RwInt32*, RwInt32*, RwInt32*) { VARJMP(RwImageFindRasterFormat_A); }
-static uint32_t RwImageDestroy_A = AddressByVersion<uint32_t>(0x5A9180, 0x5A9440, 0x5AB6A0, 0x6512B0, 0x651300, 0x650260);
-WRAPPER RwBool RwImageDestroy(RwImage*) { VARJMP(RwImageDestroy_A); }
-
-// ADDRESS
-static uint32_t RwImageCreate_A = AddressByVersion<uint32_t>(0x5A9120, 0, 0, 0x651250, 0, 0);
-WRAPPER RwImage *RwImageCreate(RwInt32, RwInt32, RwInt32) { VARJMP(RwImageCreate_A); }
-static uint32_t RwImageAllocatePixels_A = AddressByVersion<uint32_t>(0x5A91E0, 0, 0, 0x651310, 0, 0);
-WRAPPER RwImage *RwImageAllocatePixels(RwImage *) { VARJMP(RwImageAllocatePixels_A); }
-static uint32_t RwStreamOpen_A = AddressByVersion<uint32_t>(0x5A3FE0, 0, 0, 0x6459C0, 0, 0);
-WRAPPER RwStream *RwStreamOpen(RwStreamType, RwStreamAccessType, const void*) { VARJMP(RwStreamOpen_A); }
-static uint32_t RwStreamClose_A = AddressByVersion<uint32_t>(0x5A3F10, 0, 0, 0x6458F0, 0, 0);
-WRAPPER RwBool RwStreamClose(RwStream*, void*) { VARJMP(RwStreamClose_A); }
-static uint32_t RwStreamRead_A = AddressByVersion<uint32_t>(0x5A3AD0, 0, 0, 0x6454B0, 0, 0);
-WRAPPER RwUInt32 RwStreamRead(RwStream*, void*, RwUInt32) { VARJMP(RwStreamRead_A); }
-static uint32_t RwStreamSkip_A = AddressByVersion<uint32_t>(0x5A3DF0, 0, 0, 0x6457D0, 0, 0);
-WRAPPER RwStream *RwStreamSkip(RwStream*, RwUInt32) { VARJMP(RwStreamSkip_A); }
-static uint32_t RwStreamFindChunk_A = AddressByVersion<uint32_t>(0x5AA540, 0, 0, 0x64FAC0, 0, 0);
-WRAPPER RwBool RwStreamFindChunk(RwStream*, RwUInt32, RwUInt32*, RwUInt32*) { VARJMP(RwStreamFindChunk_A); }
-static uint32_t RwTexDictionaryStreamRead_A = AddressByVersion<uint32_t>(0x5924A0, 0, 0, 0x61E710, 0, 0);
-WRAPPER RwTexDictionary *RwTexDictionaryStreamRead(RwStream*) { VARJMP(RwTexDictionaryStreamRead_A); }
-WRAPPER void _rwD3D8TexDictionaryEnableRasterFormatConversion(RwBool enable) { EAXJMP(0x5BE280); }
-
-static uint32_t RpGeometryLock_A = AddressByVersion<uint32_t>(0, 0, 0, 0x64CCD0, 0, 0);
-static uint32_t RpGeometryUnlock_A = AddressByVersion<uint32_t>(0, 0, 0, 0x64CD00, 0, 0);
-WRAPPER RpGeometry *RpGeometryLock(RpGeometry*, RwInt32) { VARJMP(RpGeometryLock_A); }
-WRAPPER RpGeometry *RpGeometryUnlock(RpGeometry*) { VARJMP(RpGeometryUnlock_A); }
-WRAPPER RpGeometry *RpGeometryForAllMaterials(RpGeometry*, RpMaterialCallBack, void*) { EAXJMP(0x5ACBF0); }
-
-static uint32_t RwIm2DGetNearScreenZ_A = AddressByVersion<uint32_t>(0x5A43A0, 0x5A4660, 0x5A5340, 0x649B80, 0x649BD0, 0x648B30);
-WRAPPER RwReal RwIm2DGetNearScreenZ(void) { VARJMP(RwIm2DGetNearScreenZ_A); }
-// ADDRESS
-static uint32_t RwIm2DGetFarScreenZ_A = AddressByVersion<uint32_t>(0x5A43B0, 0, 0, 0x649B90, 0, 0);
-WRAPPER RwReal RwIm2DGetFarScreenZ(void) { VARJMP(RwIm2DGetFarScreenZ_A); }
-WRAPPER RwBool RwIm2DRenderPrimitive(RwPrimitiveType primType, RwIm2DVertex *vertices, RwInt32 numVertices) { EAXJMP(0x5A4430); }
-static uint32_t RwIm2DRenderIndexedPrimitive_A = AddressByVersion<uint32_t>(0x5A4440, 0x5A4700, 0x5A5440, 0x649C20, 0x649C70, 0x648BD0);
-WRAPPER RwBool RwIm2DRenderIndexedPrimitive(RwPrimitiveType, RwIm2DVertex*, RwInt32, RwImVertexIndex*, RwInt32) { VARJMP(RwIm2DRenderIndexedPrimitive_A); }
-
-WRAPPER RwBool RwIm3DRenderIndexedPrimitive(RwPrimitiveType primType, RwImVertexIndex *indices, RwInt32 numIndices) { EAXJMP(0x5B6820); }
-WRAPPER void *RwIm3DTransform(RwIm3DVertex *pVerts, RwUInt32 numVerts, RwMatrix *ltm, RwUInt32 flags) { EAXJMP(0x5B6720); }
+#include "rwcore.h"
+#include "rpworld.h"
+#include "rpmatfx.h"
+#include "rpskin.h"
+#include "rphanim.h"
+#include "rtbmp.h"
+
+typedef RwV3d *(*rwVectorsMultFn) (RwV3d * pointsOut,
+ const RwV3d * pointsIn,
+ RwInt32 numPoints,
+ const RwMatrix * matrix);
+
+
+WRAPPER void _rwObjectHasFrameSetFrame(void* object, RwFrame* frame) { EAXJMP(0x5BC950); }
+WRAPPER RpAtomic* AtomicDefaultRenderCallBack(RpAtomic* atomic) { EAXJMP(0x59E690); }
+WRAPPER void _rpAtomicResyncInterpolatedSphere(RpAtomic* atomic) { EAXJMP(0x59E6C0); }
+WRAPPER RwSphere const* RpAtomicGetWorldBoundingSphere(RpAtomic* atomic) { EAXJMP(0x59E800); }
+WRAPPER RwInt32 RpClumpGetNumAtomics(RpClump* clump) { EAXJMP(0x59ED50); }
+WRAPPER RpClump* RpClumpRender(RpClump* clump) { EAXJMP(0x59ED80); }
+WRAPPER RpClump* RpClumpForAllAtomics(RpClump* clump, RpAtomicCallBack callback, void* pData) { EAXJMP(0x59EDD0); }
+WRAPPER RpClump* RpClumpForAllCameras(RpClump* clump, RwCameraCallBack callback, void* pData) { EAXJMP(0x59EE10); }
+WRAPPER RpClump* RpClumpForAllLights(RpClump* clump, RpLightCallBack callback, void* pData) { EAXJMP(0x59EE60); }
+WRAPPER RpAtomic* RpAtomicCreate() { EAXJMP(0x59EEB0); }
+WRAPPER RpAtomic* RpAtomicSetGeometry(RpAtomic* atomic, RpGeometry* geometry, RwUInt32 flags) { EAXJMP(0x59EFA0); }
+WRAPPER RwBool RpAtomicDestroy(RpAtomic* atomic) { EAXJMP(0x59F020); }
+WRAPPER RpAtomic* RpAtomicClone(RpAtomic* atomic) { EAXJMP(0x59F0A0); }
+WRAPPER RpClump* RpClumpClone(RpClump* clump) { EAXJMP(0x59F1B0); }
+WRAPPER RpClump* RpClumpCreate() { EAXJMP(0x59F490); }
+WRAPPER RwBool RpClumpDestroy(RpClump* clump) { EAXJMP(0x59F500); }
+WRAPPER RpClump* RpClumpAddAtomic(RpClump* clump, RpAtomic* atomic) { EAXJMP(0x59F680); }
+WRAPPER RpClump* RpClumpRemoveAtomic(RpClump* clump, RpAtomic* atomic) { EAXJMP(0x59F6B0); }
+WRAPPER RpClump* RpClumpRemoveLight(RpClump* clump, RpLight* light) { EAXJMP(0x59F6E0); }
+WRAPPER RpClump* RpClumpStreamRead(RwStream* stream) { EAXJMP(0x59FC50); }
+WRAPPER RwInt32 RpAtomicRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5A0510); }
+WRAPPER RwInt32 RpClumpRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5A0540); }
+WRAPPER RwInt32 RpAtomicRegisterPluginStream(RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB) { EAXJMP(0x5A0570); }
+WRAPPER RwInt32 RpAtomicSetStreamAlwaysCallBack(RwUInt32 pluginID, RwPluginDataChunkAlwaysCallBack alwaysCB) { EAXJMP(0x5A05A0); }
+WRAPPER RwInt32 RpAtomicSetStreamRightsCallBack(RwUInt32 pluginID, RwPluginDataChunkRightsCallBack rightsCB) { EAXJMP(0x5A05C0); }
+WRAPPER RwInt32 RpAtomicGetPluginOffset(RwUInt32 pluginID) { EAXJMP(0x5A05E0); }
+WRAPPER RpAtomic* RpAtomicSetFrame(RpAtomic* atomic, RwFrame* frame) { EAXJMP(0x5A0600); }
+WRAPPER RwInt32 RwEngineRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor initCB, RwPluginObjectDestructor termCB) { EAXJMP(0x5A0DC0); }
+WRAPPER RwInt32 RwEngineGetPluginOffset(RwUInt32 pluginID) { EAXJMP(0x5A0DF0); }
+WRAPPER RwInt32 RwEngineGetNumSubSystems() { EAXJMP(0x5A0E10); }
+WRAPPER RwSubSystemInfo* RwEngineGetSubSystemInfo(RwSubSystemInfo* subSystemInfo, RwInt32 subSystemIndex) { EAXJMP(0x5A0E40); }
+WRAPPER RwInt32 RwEngineGetCurrentSubSystem() { EAXJMP(0x5A0E70); }
+WRAPPER RwBool RwEngineSetSubSystem(RwInt32 subSystemIndex) { EAXJMP(0x5A0EA0); }
+WRAPPER RwInt32 RwEngineGetNumVideoModes() { EAXJMP(0x5A0ED0); }
+WRAPPER RwVideoMode* RwEngineGetVideoModeInfo(RwVideoMode* modeinfo, RwInt32 modeIndex) { EAXJMP(0x5A0F00); }
+WRAPPER RwInt32 RwEngineGetCurrentVideoMode() { EAXJMP(0x5A0F30); }
+WRAPPER RwBool RwEngineSetVideoMode(RwInt32 modeIndex) { EAXJMP(0x5A0F60); }
+WRAPPER RwBool RwEngineStop() { EAXJMP(0x5A0F90); }
+WRAPPER RwBool RwEngineStart() { EAXJMP(0x5A0FE0); }
+WRAPPER RwBool RwEngineClose() { EAXJMP(0x5A1070); }
+WRAPPER RwBool RwEngineOpen(RwEngineOpenParams* initParams) { EAXJMP(0x5A10E0); }
+WRAPPER RwBool RwEngineTerm() { EAXJMP(0x5A1290); }
+WRAPPER RwBool RwEngineInit(RwMemoryFunctions* memFuncs, RwUInt32 initFlags, RwUInt32 resArenaSize) { EAXJMP(0x5A12D0); }
+WRAPPER void* _rwFrameOpen(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5A15E0); }
+WRAPPER void* _rwFrameClose(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5A1650); }
+WRAPPER RwFrame* _rwFrameCloneAndLinkClones(RwFrame* root) { EAXJMP(0x5A1690); }
+WRAPPER RwFrame* _rwFramePurgeClone(RwFrame* root) { EAXJMP(0x5A1880); }
+WRAPPER RwBool RwFrameDirty(RwFrame const* frame) { EAXJMP(0x5A1930); }
+WRAPPER void _rwFrameInit(RwFrame* frame) { EAXJMP(0x5A1950); }
+WRAPPER RwFrame* RwFrameCreate() { EAXJMP(0x5A1A00); }
+WRAPPER RwBool RwFrameDestroy(RwFrame* frame) { EAXJMP(0x5A1A30); }
+WRAPPER RwBool RwFrameDestroyHierarchy(RwFrame* frame) { EAXJMP(0x5A1BF0); }
+WRAPPER RwFrame* RwFrameUpdateObjects(RwFrame* frame) { EAXJMP(0x5A1C60); }
+WRAPPER RwMatrix* RwFrameGetLTM(RwFrame* frame) { EAXJMP(0x5A1CE0); }
+WRAPPER RwFrame* RwFrameAddChild(RwFrame* parent, RwFrame* child) { EAXJMP(0x5A1D00); }
+WRAPPER RwFrame* RwFrameRemoveChild(RwFrame* child) { EAXJMP(0x5A1ED0); }
+WRAPPER RwFrame* RwFrameForAllChildren(RwFrame* frame, RwFrameCallBack callBack, void* data) { EAXJMP(0x5A1FC0); }
+WRAPPER RwFrame* RwFrameTranslate(RwFrame* frame, RwV3d const* v, RwOpCombineType combine) { EAXJMP(0x5A2000); }
+WRAPPER RwFrame* RwFrameScale(RwFrame* frame, RwV3d const* v, RwOpCombineType combine) { EAXJMP(0x5A20A0); }
+WRAPPER RwFrame* RwFrameTransform(RwFrame* frame, RwMatrix const* m, RwOpCombineType combine) { EAXJMP(0x5A2140); }
+WRAPPER RwFrame* RwFrameRotate(RwFrame* frame, RwV3d const* axis, RwReal angle, RwOpCombineType combine) { EAXJMP(0x5A21E0); }
+WRAPPER RwFrame* RwFrameSetIdentity(RwFrame* frame) { EAXJMP(0x5A2280); }
+WRAPPER RwFrame* RwFrameForAllObjects(RwFrame* frame, RwObjectCallBack callBack, void* data) { EAXJMP(0x5A2340); }
+WRAPPER RwInt32 RwFrameRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5A2380); }
+WRAPPER RwBool _rwMatrixSetMultFn(rwMatrixMultFn multMat) { EAXJMP(0x5A23B0); }
+WRAPPER RwReal _rwMatrixDeterminant(RwMatrix const* matrix) { EAXJMP(0x5A2520); }
+WRAPPER RwReal _rwMatrixOrthogonalError(RwMatrix const* matrix) { EAXJMP(0x5A2570); }
+WRAPPER RwReal _rwMatrixNormalError(RwMatrix const* matrix) { EAXJMP(0x5A25D0); }
+WRAPPER RwReal _rwMatrixIdentityError(RwMatrix const* matrix) { EAXJMP(0x5A2660); }
+WRAPPER void* _rwMatrixClose(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5A2730); }
+WRAPPER void* _rwMatrixOpen(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5A2770); }
+WRAPPER RwMatrix* RwMatrixOptimize(RwMatrix* matrix, RwMatrixTolerance const* tolerance) { EAXJMP(0x5A2820); }
+WRAPPER RwMatrix* RwMatrixUpdate(RwMatrix* matrix) { EAXJMP(0x5A28E0); }
+WRAPPER RwMatrix* RwMatrixMultiply(RwMatrix* matrixOut, RwMatrix const* MatrixIn1, RwMatrix const* matrixIn2) { EAXJMP(0x5A28F0); }
+WRAPPER RwMatrix* RwMatrixRotateOneMinusCosineSine(RwMatrix* matrix, RwV3d const* unitAxis, RwReal oneMinusCosine, RwReal sine, RwOpCombineType combineOp) { EAXJMP(0x5A2960); }
+WRAPPER RwMatrix* RwMatrixRotate(RwMatrix* matrix, RwV3d const* axis, RwReal angle, RwOpCombineType combineOp) { EAXJMP(0x5A2BF0); }
+WRAPPER RwMatrix* RwMatrixInvert(RwMatrix* matrixOut, RwMatrix const* matrixIn) { EAXJMP(0x5A2C90); }
+WRAPPER RwMatrix* RwMatrixScale(RwMatrix* matrix, RwV3d const* scale, RwOpCombineType combineOp) { EAXJMP(0x5A2EE0); }
+WRAPPER RwMatrix* RwMatrixTranslate(RwMatrix* matrix, RwV3d const* translation, RwOpCombineType combineOp) { EAXJMP(0x5A3070); }
+WRAPPER RwMatrix* RwMatrixTransform(RwMatrix* matrix, RwMatrix const* transform, RwOpCombineType combineOp) { EAXJMP(0x5A31C0); }
+WRAPPER RwBool RwMatrixDestroy(RwMatrix* mpMat) { EAXJMP(0x5A3300); }
+WRAPPER RwMatrix* RwMatrixCreate() { EAXJMP(0x5A3330); }
+WRAPPER RwBool _rwVectorSetMultFn(rwVectorMultFn multPoint, rwVectorsMultFn multPoints, rwVectorMultFn multVector, rwVectorsMultFn multVectors) { EAXJMP(0x5A3450); }
+WRAPPER RwReal _rwV3dNormalize(RwV3d* out, RwV3d const* in) { EAXJMP(0x5A3600); }
+WRAPPER RwReal RwV3dLength(RwV3d const* in) { EAXJMP(0x5A36A0); }
+WRAPPER RwReal _rwSqrt(RwReal const num) { EAXJMP(0x5A3710); }
+WRAPPER RwReal _rwInvSqrt(RwReal const num) { EAXJMP(0x5A3770); }
+WRAPPER RwV3d* RwV3dTransformPoints(RwV3d* pointsOut, RwV3d const* pointsIn, RwInt32 numPoints, RwMatrix const* matrix) { EAXJMP(0x5A37D0); }
+WRAPPER RwV3d* RwV3dTransformVectors(RwV3d* vectorsOut, RwV3d const* vectorsIn, RwInt32 numPoints, RwMatrix const* matrix) { EAXJMP(0x5A37E0); }
+WRAPPER void* _rwVectorClose(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5A37F0); }
+WRAPPER void* _rwVectorOpen(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5A3860); }
+WRAPPER RwUInt32 RwStreamRead(RwStream* stream, void* buffer, RwUInt32 length) { EAXJMP(0x5A3AD0); }
+WRAPPER RwStream* RwStreamWrite(RwStream* stream, void const* buffer, RwUInt32 length) { EAXJMP(0x5A3C30); }
+WRAPPER RwStream* RwStreamSkip(RwStream* stream, RwUInt32 offset) { EAXJMP(0x5A3DF0); }
+WRAPPER RwBool RwStreamClose(RwStream* stream, void* pData) { EAXJMP(0x5A3F10); }
+WRAPPER RwStream* RwStreamOpen(RwStreamType type, RwStreamAccessType accessType, void const* pData) { EAXJMP(0x5A3FE0); }
+WRAPPER RwReal RwIm2DGetNearScreenZ() { EAXJMP(0x5A43A0); }
+WRAPPER RwReal RwIm2DGetFarScreenZ() { EAXJMP(0x5A43B0); }
+WRAPPER RwBool RwRenderStateSet(RwRenderState state, void* value) { EAXJMP(0x5A43C0); }
+WRAPPER RwBool RwRenderStateGet(RwRenderState state, void* value) { EAXJMP(0x5A4410); }
+WRAPPER RwBool RwIm2DRenderLine(RwIm2DVertex* vertices, RwInt32 numVertices, RwInt32 vert1, RwInt32 vert2) { EAXJMP(0x5A4420); }
+WRAPPER RwBool RwIm2DRenderPrimitive(RwPrimitiveType primType, RwIm2DVertex* vertices, RwInt32 numVertices) { EAXJMP(0x5A4430); }
+WRAPPER RwBool RwIm2DRenderIndexedPrimitive(RwPrimitiveType primType, RwIm2DVertex* vertices, RwInt32 numVertices, RwImVertexIndex* indices, RwInt32 numIndices) { EAXJMP(0x5A4440); }
+WRAPPER RwCamera* RwCameraEndUpdate(RwCamera* camera) { EAXJMP(0x5A5020); }
+WRAPPER RwCamera* RwCameraBeginUpdate(RwCamera* camera) { EAXJMP(0x5A5030); }
+WRAPPER RwCamera* RwCameraSetViewOffset(RwCamera* camera, RwV2d const* offset) { EAXJMP(0x5A5040); }
+WRAPPER RwCamera* RwCameraSetNearClipPlane(RwCamera* camera, RwReal nearClip) { EAXJMP(0x5A5070); }
+WRAPPER RwCamera* RwCameraSetFarClipPlane(RwCamera* camera, RwReal farClip) { EAXJMP(0x5A5140); }
+WRAPPER RwFrustumTestResult RwCameraFrustumTestSphere(RwCamera const* camera, RwSphere const* sphere) { EAXJMP(0x5A5170); }
+WRAPPER RwCamera* RwCameraClear(RwCamera* camera, RwRGBA* colour, RwInt32 clearMode) { EAXJMP(0x5A51E0); }
+WRAPPER RwCamera* RwCameraShowRaster(RwCamera* camera, void* pDev, RwUInt32 flags) { EAXJMP(0x5A5210); }
+WRAPPER RwCamera* RwCameraSetProjection(RwCamera* camera, RwCameraProjection projection) { EAXJMP(0x5A5240); }
+WRAPPER RwCamera* RwCameraSetViewWindow(RwCamera* camera, RwV2d const* viewWindow) { EAXJMP(0x5A52B0); }
+WRAPPER RwInt32 RwCameraRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5A52F0); }
+WRAPPER RwBool RwCameraDestroy(RwCamera* camera) { EAXJMP(0x5A5320); }
+WRAPPER RwCamera* RwCameraCreate() { EAXJMP(0x5A5360); }
+WRAPPER RwBool RwTextureSetMipmapping(RwBool enable) { EAXJMP(0x5A7100); }
+WRAPPER RwBool RwTextureGetMipmapping() { EAXJMP(0x5A7120); }
+WRAPPER RwBool RwTextureSetAutoMipmapping(RwBool enable) { EAXJMP(0x5A7130); }
+WRAPPER RwBool RwTextureGetAutoMipmapping() { EAXJMP(0x5A7150); }
+WRAPPER RwTexDictionary* RwTexDictionaryCreate() { EAXJMP(0x5A7160); }
+WRAPPER RwBool RwTexDictionaryDestroy(RwTexDictionary* dict) { EAXJMP(0x5A7200); }
+WRAPPER RwTexDictionary const* RwTexDictionaryForAllTextures(RwTexDictionary const* dict, RwTextureCallBack fpCallBack, void* pData) { EAXJMP(0x5A7290); }
+WRAPPER RwTexture* RwTextureCreate(RwRaster* raster) { EAXJMP(0x5A72D0); }
+WRAPPER RwBool RwTextureDestroy(RwTexture* texture) { EAXJMP(0x5A7330); }
+WRAPPER RwTexture* RwTextureSetName(RwTexture* texture, RwChar const* name) { EAXJMP(0x5A73B0); }
+WRAPPER RwTexture* RwTextureSetMaskName(RwTexture* texture, RwChar const* maskName) { EAXJMP(0x5A7420); }
+WRAPPER RwTexture* RwTexDictionaryAddTexture(RwTexDictionary* dict, RwTexture* texture) { EAXJMP(0x5A7490); }
+WRAPPER RwTexture* RwTexDictionaryFindNamedTexture(RwTexDictionary* dict, RwChar const* name) { EAXJMP(0x5A74D0); }
+WRAPPER RwTexDictionary* RwTexDictionarySetCurrent(RwTexDictionary* dict) { EAXJMP(0x5A7550); }
+WRAPPER RwTexDictionary* RwTexDictionaryGetCurrent() { EAXJMP(0x5A7570); }
+WRAPPER RwTexture* RwTextureRead(RwChar const* name, RwChar const* maskName) { EAXJMP(0x5A7580); }
+WRAPPER RwBool RwTextureRasterGenerateMipmaps(RwRaster* raster, RwImage* image) { EAXJMP(0x5A7780); }
+WRAPPER RwImage* RwImageCreate(RwInt32 width, RwInt32 height, RwInt32 depth) { EAXJMP(0x5A9120); }
+WRAPPER RwBool RwImageDestroy(RwImage* image) { EAXJMP(0x5A9180); }
+WRAPPER RwImage* RwImageAllocatePixels(RwImage* image) { EAXJMP(0x5A91E0); }
+WRAPPER RwImage* RwImageFreePixels(RwImage* image) { EAXJMP(0x5A92A0); }
+WRAPPER RwImage* RwImageMakeMask(RwImage* image) { EAXJMP(0x5A92D0); }
+WRAPPER RwImage* RwImageApplyMask(RwImage* image, RwImage const* mask) { EAXJMP(0x5A93A0); }
+WRAPPER RwChar const* RwImageSetPath(RwChar const* path) { EAXJMP(0x5A9750); }
+WRAPPER RwImage* RwImageRead(RwChar const* imageName) { EAXJMP(0x5A9810); }
+WRAPPER RwChar const* RwImageFindFileType(RwChar const* imageName) { EAXJMP(0x5A9B40); }
+WRAPPER RwImage* RwImageReadMaskedImage(RwChar const* imageName, RwChar const* maskname) { EAXJMP(0x5A9C10); }
+WRAPPER RwImage* RwImageCopy(RwImage* destImage, RwImage const* sourceImage) { EAXJMP(0x5A9F50); }
+WRAPPER RwImage* RwImageGammaCorrect(RwImage* image) { EAXJMP(0x5AA130); }
+WRAPPER RwBool RwImageSetGamma(RwReal gammaValue) { EAXJMP(0x5AA2C0); }
+WRAPPER RwStream* _rwStreamWriteVersionedChunkHeader(RwStream* stream, RwInt32 type, RwInt32 size, RwUInt32 version, RwUInt32 buildNum) { EAXJMP(0x5AA4E0); }
+WRAPPER RwBool RwStreamFindChunk(RwStream* stream, RwUInt32 type, RwUInt32* lengthOut, RwUInt32* versionOut) { EAXJMP(0x5AA540); }
+WRAPPER void* RwMemLittleEndian32(void* mem, RwUInt32 size) { EAXJMP(0x5AA640); }
+WRAPPER void* RwMemNative32(void* mem, RwUInt32 size) { EAXJMP(0x5AA650); }
+WRAPPER void* RwMemFloat32ToReal(void* mem, RwUInt32 size) { EAXJMP(0x5AA660); }
+WRAPPER RwStream* RwStreamWriteReal(RwStream* stream, RwReal const* reals, RwUInt32 numBytes) { EAXJMP(0x5AA680); }
+WRAPPER RwStream* RwStreamWriteInt32(RwStream* stream, RwInt32 const* ints, RwUInt32 numBytes) { EAXJMP(0x5AA720); }
+WRAPPER RwStream* RwStreamReadReal(RwStream* stream, RwReal* reals, RwUInt32 numBytes) { EAXJMP(0x5AA740); }
+WRAPPER RwStream* RwStreamReadInt32(RwStream* stream, RwInt32* ints, RwUInt32 numBytes) { EAXJMP(0x5AA7B0); }
+WRAPPER RwUInt32 RwTextureStreamGetSize(RwTexture const* texture) { EAXJMP(0x5AA800); }
+WRAPPER RwTexture const* RwTextureStreamWrite(RwTexture const* texture, RwStream* stream) { EAXJMP(0x5AA870); }
+WRAPPER RwTexture* RwTextureStreamRead(RwStream* stream) { EAXJMP(0x5AAA40); }
+WRAPPER RwTexDictionary const* RwTexDictionaryStreamWrite(RwTexDictionary const* texDict, RwStream* stream) { EAXJMP(0x5AB020); }
+WRAPPER RpMorphTarget const* RpMorphTargetCalcBoundingSphere(RpMorphTarget const* morphTarget, RwSphere* boundingSphere) { EAXJMP(0x5AC890); }
+WRAPPER RwInt32 RpGeometryAddMorphTargets(RpGeometry* geometry, RwInt32 mtcount) { EAXJMP(0x5AC9A0); }
+WRAPPER RpGeometry const* RpGeometryTriangleSetVertexIndices(RpGeometry const* geometry, RpTriangle* triangle, RwUInt16 vert1, RwUInt16 vert2, RwUInt16 vert3) { EAXJMP(0x5ACB60); }
+WRAPPER RpGeometry* RpGeometryTriangleSetMaterial(RpGeometry* geometry, RpTriangle* triangle, RpMaterial* material) { EAXJMP(0x5ACB90); }
+WRAPPER RpGeometry* RpGeometryForAllMaterials(RpGeometry* geometry, RpMaterialCallBack fpCallBack, void* pData) { EAXJMP(0x5ACBF0); }
+WRAPPER RpGeometry* RpGeometryLock(RpGeometry* geometry, RwInt32 lockMode) { EAXJMP(0x5ACC30); }
+WRAPPER RpGeometry* RpGeometryUnlock(RpGeometry* geometry) { EAXJMP(0x5ACC60); }
+WRAPPER RpGeometry* RpGeometryCreate(RwInt32 numVert, RwInt32 numTriangles, RwUInt32 format) { EAXJMP(0x5ACD10); }
+WRAPPER RpGeometry* _rpGeometryAddRef(RpGeometry* geometry) { EAXJMP(0x5ACF40); }
+WRAPPER RwBool RpGeometryDestroy(RpGeometry* geometry) { EAXJMP(0x5ACF50); }
+WRAPPER RwInt32 RpGeometryRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5ACFF0); }
+WRAPPER RwInt32 RpGeometryRegisterPluginStream(RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB) { EAXJMP(0x5AD020); }
+WRAPPER RpGeometry* RpGeometryStreamRead(RwStream* stream) { EAXJMP(0x5AD050); }
+WRAPPER RwRaster* RwRasterGetCurrentContext() { EAXJMP(0x5AD6D0); }
+WRAPPER RwRaster* RwRasterUnlock(RwRaster* raster) { EAXJMP(0x5AD6F0); }
+WRAPPER RwRaster* RwRasterRenderFast(RwRaster* raster, RwInt32 x, RwInt32 y) { EAXJMP(0x5AD710); }
+WRAPPER RwRaster* RwRasterUnlockPalette(RwRaster* raster) { EAXJMP(0x5AD750); }
+WRAPPER RwBool RwRasterDestroy(RwRaster* raster) { EAXJMP(0x5AD780); }
+WRAPPER RwRaster* RwRasterPushContext(RwRaster* raster) { EAXJMP(0x5AD7C0); }
+WRAPPER RwInt32 RwRasterRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5AD810); }
+WRAPPER RwUInt8* RwRasterLockPalette(RwRaster* raster, RwInt32 lockMode) { EAXJMP(0x5AD840); }
+WRAPPER RwRaster* RwRasterPopContext() { EAXJMP(0x5AD870); }
+WRAPPER RwInt32 RwRasterGetNumLevels(RwRaster* raster) { EAXJMP(0x5AD8C0); }
+WRAPPER RwRaster* RwRasterShowRaster(RwRaster* raster, void* dev, RwUInt32 flags) { EAXJMP(0x5AD900); }
+WRAPPER RwRaster* RwRasterCreate(RwInt32 width, RwInt32 height, RwInt32 depth, RwInt32 flags) { EAXJMP(0x5AD930); }
+WRAPPER RwUInt8* RwRasterLock(RwRaster* raster, RwUInt8 level, RwInt32 lockMode) { EAXJMP(0x5AD9D0); }
+WRAPPER RpMaterial* RpMaterialCreate() { EAXJMP(0x5ADC30); }
+WRAPPER RwBool RpMaterialDestroy(RpMaterial* material) { EAXJMP(0x5ADCB0); }
+WRAPPER RpMaterial* RpMaterialSetTexture(RpMaterial* material, RwTexture* texture) { EAXJMP(0x5ADD10); }
+WRAPPER RwInt32 RpMaterialRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5ADD40); }
+WRAPPER RwInt32 RpMaterialRegisterPluginStream(RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB) { EAXJMP(0x5ADD70); }
+WRAPPER RpMaterial* RpMaterialStreamRead(RwStream* stream) { EAXJMP(0x5ADDA0); }
+WRAPPER RpWorldSector* _rpSectorDefaultRenderCallBack(RpWorldSector* sector) { EAXJMP(0x5AE0B0); }
+WRAPPER RwBool _rpWorldForAllGlobalLights(RpLightCallBack callBack, void* pData) { EAXJMP(0x5AE100); }
+WRAPPER RpWorldSector* _rpWorldSectorForAllLocalLights(RpWorldSector* sector, RpLightCallBack callBack, void* pData) { EAXJMP(0x5AE150); }
+WRAPPER RpWorld* RpWorldUnlock(RpWorld* world) { EAXJMP(0x5AE190); }
+WRAPPER RpWorld* RpWorldSectorGetWorld(RpWorldSector const* sector) { EAXJMP(0x5AE2B0); }
+WRAPPER RwBool RpWorldDestroy(RpWorld* world) { EAXJMP(0x5AE340); }
+WRAPPER RpWorld* RpWorldCreate(RwBBox* boundingBox) { EAXJMP(0x5AE6A0); }
+WRAPPER RwInt32 RpWorldRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5AEA40); }
+WRAPPER RwInt32 RpWorldRegisterPluginStream(RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB) { EAXJMP(0x5AEA70); }
+WRAPPER RwBool RpWorldPluginAttach() { EAXJMP(0x5AEAA0); }
+WRAPPER RpWorld* RpWorldAddCamera(RpWorld* world, RwCamera* camera) { EAXJMP(0x5AFB80); }
+WRAPPER RpWorld* RpWorldRemoveCamera(RpWorld* world, RwCamera* camera) { EAXJMP(0x5AFBB0); }
+WRAPPER RpWorld* RpAtomicGetWorld(RpAtomic const* atomic) { EAXJMP(0x5AFC10); }
+WRAPPER RpWorld* RpWorldAddClump(RpWorld* world, RpClump* clump) { EAXJMP(0x5AFC20); }
+WRAPPER RpWorld* RpWorldAddLight(RpWorld* world, RpLight* light) { EAXJMP(0x5AFDA0); }
+WRAPPER RpWorld* RpWorldRemoveLight(RpWorld* world, RpLight* light) { EAXJMP(0x5AFDF0); }
+WRAPPER RwImage* RtBMPImageRead(RwChar const* imageName) { EAXJMP(0x5AFE70); }
+WRAPPER RwBool RpSkinPluginAttach() { EAXJMP(0x5B07D0); }
+WRAPPER RpAtomic* RpSkinAtomicSetHAnimHierarchy(RpAtomic* atomic, RpHAnimHierarchy* hierarchy) { EAXJMP(0x5B1050); }
+WRAPPER RpHAnimHierarchy* RpSkinAtomicGetHAnimHierarchy(RpAtomic const* atomic) { EAXJMP(0x5B1070); }
+WRAPPER RpSkin* RpSkinGeometryGetSkin(RpGeometry* geometry) { EAXJMP(0x5B1080); }
+WRAPPER RpGeometry* RpSkinGeometrySetSkin(RpGeometry* geometry, RpSkin* skin) { EAXJMP(0x5B1090); }
+WRAPPER RwMatrix const* RpSkinGetSkinToBoneMatrices(RpSkin* skin) { EAXJMP(0x5B10D0); }
+WRAPPER RpHAnimHierarchy* RpHAnimHierarchyCreate(RwInt32 numNodes, RwUInt32* nodeFlags, RwInt32* nodeIDs, RpHAnimHierarchyFlag flags, RwInt32 maxKeyFrameSize) { EAXJMP(0x5B10E0); }
+WRAPPER RpHAnimHierarchy* RpHAnimFrameGetHierarchy(RwFrame* frame) { EAXJMP(0x5B11F0); }
+WRAPPER RwBool RpHAnimHierarchySetCurrentAnim(RpHAnimHierarchy* hierarchy, RpHAnimAnimation* anim) { EAXJMP(0x5B1200); }
+WRAPPER RwBool RpHAnimHierarchySubAnimTime(RpHAnimHierarchy* hierarchy, RwReal time) { EAXJMP(0x5B12B0); }
+WRAPPER RwBool RpHAnimHierarchyAddAnimTime(RpHAnimHierarchy* hierarchy, RwReal time) { EAXJMP(0x5B1480); }
+WRAPPER RwBool RpHAnimHierarchyUpdateMatrices(RpHAnimHierarchy* hierarchy) { EAXJMP(0x5B1780); }
+WRAPPER RpHAnimAnimation* RpHAnimAnimationStreamRead(RwStream* stream) { EAXJMP(0x5B1C10); }
+WRAPPER RwBool RpHAnimPluginAttach() { EAXJMP(0x5B1D50); }
+WRAPPER RwBool RpMatFXPluginAttach() { EAXJMP(0x5B2640); }
+WRAPPER RpAtomic* RpMatFXAtomicEnableEffects(RpAtomic* atomic) { EAXJMP(0x5B3750); }
+WRAPPER RpMaterial* RpMatFXMaterialSetEffects(RpMaterial* material, RpMatFXMaterialFlags flags) { EAXJMP(0x5B3780); }
+WRAPPER RpMaterial* RpMatFXMaterialSetupEnvMap(RpMaterial* material, RwTexture* texture, RwFrame* frame, RwBool useFrameBufferAlpha, RwReal coef) { EAXJMP(0x5B38D0); }
+WRAPPER RpMaterial* RpMatFXMaterialSetBumpMapTexture(RpMaterial* material, RwTexture* texture) { EAXJMP(0x5B3A40); }
+WRAPPER RwBool RwD3D8SetRenderState(RwUInt32 state, RwUInt32 value) { EAXJMP(0x5B3CF0); }
+WRAPPER void RwD3D8GetRenderState(RwUInt32 state, void* value) { EAXJMP(0x5B3D40); }
+WRAPPER RwBool RwD3D8SetTextureStageState(RwUInt32 stage, RwUInt32 type, RwUInt32 value) { EAXJMP(0x5B3D60); }
+WRAPPER RwBool RwD3D8SetTexture(RwTexture* texture, RwUInt32 stage) { EAXJMP(0x5B53A0); }
+WRAPPER void* RwIm3DTransform(RwIm3DVertex* pVerts, RwUInt32 numVerts, RwMatrix* ltm, RwUInt32 flags) { EAXJMP(0x5B6720); }
+WRAPPER RwBool RwIm3DEnd() { EAXJMP(0x5B67F0); }
+WRAPPER RwBool RwIm3DRenderIndexedPrimitive(RwPrimitiveType primType, RwImVertexIndex* indices, RwInt32 numIndices) { EAXJMP(0x5B6820); }
WRAPPER RwBool RwIm3DRenderLine(RwInt32 vert1, RwInt32 vert2) { EAXJMP(0x5B6980); }
-WRAPPER RwBool RwIm3DEnd(void) { EAXJMP(0x5B67F0); }
-
-static uint32_t _rwObjectHasFrameSetFrame_A = AddressByVersion<uint32_t>(0x5BC950, 0x5BCC10, 0x5C1820, 0x660CC0, 0x660D10, 0x65FC70);
-WRAPPER void _rwObjectHasFrameSetFrame(void*, RwFrame*) { VARJMP(_rwObjectHasFrameSetFrame_A); }
-
-static uint32_t RxPipelineCreate_A = AddressByVersion<uint32_t>(0x5C2E00, 0x5C30C0, 0x5C8FC0, 0x668FC0, 0x669010, 0x667F70);
-WRAPPER RxPipeline *RxPipelineCreate(void) { VARJMP(RxPipelineCreate_A); }
-static uint32_t RxPipelineLock_A = AddressByVersion<uint32_t>(0x5D29F0, 0x5D2CB0, 0x5DDBF0, 0x67AC50, 0x67ACA0, 0x679C00);
-WRAPPER RxLockedPipe *RxPipelineLock(RxPipeline*) { VARJMP(RxPipelineLock_A); }
-static uint32_t RxLockedPipeUnlock_A = AddressByVersion<uint32_t>(0x5D1FA0, 0x5D2260, 0x5DD0C0, 0x67A200, 0x67A250, 0x6791B0);
-WRAPPER RxPipeline *RxLockedPipeUnlock(RxLockedPipe*) { VARJMP(RxLockedPipeUnlock_A); }
-static uint32_t RxNodeDefinitionGetD3D8AtomicAllInOne_A = AddressByVersion<uint32_t>(0x5DC500, 0x5DC7C0, 0x5EC470, 0x67CB90, 0x67CBE0, 0x67BB40);
-WRAPPER RxNodeDefinition *RxNodeDefinitionGetD3D8AtomicAllInOne(void) { VARJMP(RxNodeDefinitionGetD3D8AtomicAllInOne_A); }
-static uint32_t RxLockedPipeAddFragment_A = AddressByVersion<uint32_t>(0x5D2BA0, 0x5D2E60, 0x5DE000, 0x67AE00, 0x67AE50, 0x679DB0);
-WRAPPER RxLockedPipe *RxLockedPipeAddFragment(RxLockedPipe*, RwUInt32*, RxNodeDefinition*, ...) { VARJMP(RxLockedPipeAddFragment_A); }
-static uint32_t _rxPipelineDestroy_A = AddressByVersion<uint32_t>(0x5C2E70, 0x5C3130, 0x5C9030, 0x669030, 0x669080, 0x667FE0);
-WRAPPER void _rxPipelineDestroy(RxPipeline*) { VARJMP(_rxPipelineDestroy_A); }
-static uint32_t RxPipelineFindNodeByName_A = AddressByVersion<uint32_t>(0x5D2B10, 0x5D2DD0, 0x5DDF40, 0x67AD70, 0x67ADC0, 0x679D20);
-WRAPPER RxPipelineNode *RxPipelineFindNodeByName(RxPipeline*, const RwChar*, RxPipelineNode*, RwInt32*) { VARJMP(RxPipelineFindNodeByName_A); }
-static uint32_t RxD3D8AllInOneSetRenderCallBack_A = AddressByVersion<uint32_t>(0x5DFC60, 0x5DFF20, 0x5EE330, 0x678E30, 0x678E80, 0x677DE0);
-WRAPPER void RxD3D8AllInOneSetRenderCallBack(RxPipelineNode*, RxD3D8AllInOneRenderCallBack) { VARJMP(RxD3D8AllInOneSetRenderCallBack_A); }
-RxD3D8AllInOneRenderCallBack RxD3D8AllInOneGetRenderCallBack(RxPipelineNode *node)
-{
- return *(RxD3D8AllInOneRenderCallBack*)((uint8*)node->privateData + 12);
-}
-void RxD3D8AllInOneSetInstanceCallBack(RxPipelineNode *node, RxD3D8AllInOneInstanceCallBack callback)
-{
- *(RxD3D8AllInOneInstanceCallBack*)node->privateData = callback;
-}
-
-static uint32_t rxD3D8DefaultRenderCallback_A = AddressByVersion<uint32_t>(0x5DF960, 0x5DFC20, 0x5EE350, 0x678B30, 0x678B80, 0x677AE0);
-WRAPPER void rxD3D8DefaultRenderCallback(RwResEntry*, void*, RwUInt8, RwUInt32) { VARJMP(rxD3D8DefaultRenderCallback_A); }
-static uint32_t rwD3D8AtomicMatFXRenderCallback_A = AddressByVersion<uint32_t>(0x5D0B80, 0x5D0E40, 0x5D8B20, 0x676460, 0x6764B0, 0x675410);
-
-WRAPPER RpMaterial *RpMatFXMaterialSetEffects(RpMaterial*, RpMatFXMaterialFlags) { EAXJMP(0x5B3780); }
-WRAPPER RpMaterial *RpMatFXMaterialSetupEnvMap(RpMaterial*, RwTexture*, RwFrame*, RwBool, RwReal) { EAXJMP(0x5B38D0); }
-WRAPPER void rwD3D8AtomicMatFXRenderCallback(RwResEntry*, void*, RwUInt8, RwUInt32) { VARJMP(rwD3D8AtomicMatFXRenderCallback_A); }
-WRAPPER RpAtomic *RpMatFXAtomicEnableEffects(RpAtomic*) { EAXJMP(0x5B3750); }
-
-WRAPPER RpAtomic *RpAtomicSetFrame(RpAtomic*, RwFrame*) { EAXJMP(0x5A0600); }
-WRAPPER RwBool RpAtomicDestroy(RpAtomic*) { EAXJMP(0x59F020); }
-WRAPPER RpAtomic *RpAtomicClone(RpAtomic*) { EAXJMP(0x59F0A0); }
-WRAPPER RpAtomic *RpAtomicSetGeometry(RpAtomic*, RpGeometry*, RwUInt32) { EAXJMP(0x59EFA0); }
-WRAPPER RwInt32 RpAtomicRegisterPlugin(RwInt32, RwUInt32, RwPluginObjectConstructor, RwPluginObjectDestructor, RwPluginObjectCopy) { EAXJMP(0x5A0510); }
-WRAPPER void _rpAtomicResyncInterpolatedSphere(RpAtomic*) { EAXJMP(0x59E6C0); }
-
-WRAPPER RpAtomic *AtomicDefaultRenderCallBack(RpAtomic*) { EAXJMP(0x59E690); }
-
-static uint32_t RpClumpForAllAtomics_A = AddressByVersion<uint32_t>(0x59EDD0, 0x59F090, 0x59EFC0, 0x640D00, 0x640D50, 0x63FCB0);
-WRAPPER RpClump *RpClumpForAllAtomics(RpClump*, RpAtomicCallBack, void*) { VARJMP(RpClumpForAllAtomics_A); }
-WRAPPER RpClump *RpClumpRender(RpClump *) { EAXJMP(0x59ED80); }
-WRAPPER RpClump *RpClumpClone(RpClump *) { EAXJMP(0x59F1B0); }
-WRAPPER RwBool RpClumpDestroy(RpClump * clump) { EAXJMP(0x59F500); }
-WRAPPER RwInt32 RpClumpRegisterPlugin(RwInt32, RwUInt32, RwPluginObjectConstructor, RwPluginObjectDestructor, RwPluginObjectCopy) { EAXJMP(0x5A0540); }
-WRAPPER RpClump *RpClumpRemoveAtomic(RpClump*, RpAtomic*) { EAXJMP(0x59F6B0); }
-WRAPPER RpClump *RpClumpAddAtomic(RpClump*, RpAtomic*) { EAXJMP(0x59F680); }
-
-WRAPPER RpLight *RpLightSetColor(RpLight *light, const RwRGBAReal *color) { EAXJMP(0x5BC320); } \ No newline at end of file
+WRAPPER RxPipeline* RwIm3DSetTransformPipeline(RxPipeline* pipeline) { EAXJMP(0x5B6A50); }
+WRAPPER RxPipeline* RwIm3DSetRenderPipeline(RxPipeline* pipeline, RwPrimitiveType primType) { EAXJMP(0x5B6AC0); }
+WRAPPER void RwD3D8EngineSetRefreshRate(RwUInt32 refreshRate) { EAXJMP(0x5B95D0); }
+WRAPPER RwBool RwD3D8CameraAttachWindow(void* camera, void* hwnd) { EAXJMP(0x5B9640); }
+WRAPPER RwBool RwD3D8DeviceSupportsDXTTexture() { EAXJMP(0x5BAEB0); }
+WRAPPER RwBool RwD3D8SetVertexShader(RwUInt32 handle) { EAXJMP(0x5BAF90); }
+WRAPPER RwBool RwD3D8SetPixelShader(RwUInt32 handle) { EAXJMP(0x5BAFD0); }
+WRAPPER RwBool RwD3D8SetStreamSource(RwUInt32 streamNumber, void* streamData, RwUInt32 stride) { EAXJMP(0x5BB010); }
+WRAPPER RwBool RwD3D8SetIndices(void* indexData, RwUInt32 baseVertexIndex) { EAXJMP(0x5BB060); }
+WRAPPER RwBool RwD3D8DrawIndexedPrimitive(RwUInt32 primitiveType, RwUInt32 minIndex, RwUInt32 numVertices, RwUInt32 startIndex, RwUInt32 numIndices) { EAXJMP(0x5BB0B0); }
+WRAPPER RwBool RwD3D8DrawPrimitive(RwUInt32 primitiveType, RwUInt32 startVertex, RwUInt32 numVertices) { EAXJMP(0x5BB140); }
+WRAPPER RwBool RwD3D8SetTransform(RwUInt32 state, void const* matrix) { EAXJMP(0x5BB1D0); }
+WRAPPER void RwD3D8GetTransform(RwUInt32 state, void* matrix) { EAXJMP(0x5BB310); }
+WRAPPER RwBool RwD3D8SetTransformWorld(RwMatrix const* matrix) { EAXJMP(0x5BB340); }
+WRAPPER RwBool RwD3D8SetSurfaceProperties(RwRGBA const* color, RwSurfaceProperties const* surfaceProps, RwBool modulate) { EAXJMP(0x5BB490); }
+WRAPPER RwBool RwD3D8SetLight(RwInt32 index, void const* light) { EAXJMP(0x5BB7A0); }
+WRAPPER RwBool RwD3D8EnableLight(RwInt32 index, RwBool enable) { EAXJMP(0x5BB890); }
+WRAPPER RwBool RwD3D8DynamicVertexBufferCreate(RwUInt32 fvf, RwUInt32 size, void** vertexBuffer) { EAXJMP(0x5BB9F0); }
+WRAPPER void RwD3D8DynamicVertexBufferDestroy(void* vertexBuffer) { EAXJMP(0x5BBAE0); }
+WRAPPER RwBool RwD3D8IndexBufferCreate(RwUInt32 numIndices, void** indexBuffer) { EAXJMP(0x5BBB10); }
+WRAPPER RwBool RwD3D8CreatePixelShader(RwUInt32 const* function, RwUInt32* handle) { EAXJMP(0x5BBB40); }
+WRAPPER void RwD3D8DeletePixelShader(RwUInt32 handle) { EAXJMP(0x5BBB90); }
+WRAPPER RwBool RwD3D8SetPixelShaderConstant(RwUInt32 registerAddress, void const* antData, RwUInt32 antCount) { EAXJMP(0x5BBC00); }
+WRAPPER void const* RwD3D8GetCaps() { EAXJMP(0x5BBC30); }
+WRAPPER RwBool RwD3D8CameraIsSphereFullyInsideFrustum(void const* camera, void const* sphere) { EAXJMP(0x5BBC40); }
+WRAPPER RwBool RwD3D8CameraIsBBoxFullyInsideFrustum(void const* camera, void const* boundingBox) { EAXJMP(0x5BBCA0); }
+WRAPPER RwBool RwD3D8DynamicVertexBufferLock(RwUInt32 vertexSize, RwUInt32 numVertex, void** vertexBufferOut, void** vertexDataOut, RwUInt32* baseIndexOut) { EAXJMP(0x5BBD30); }
+WRAPPER RwBool RwD3D8DynamicVertexBufferUnlock(void* vertexBuffer) { EAXJMP(0x5BBEB0); }
+WRAPPER RwBool _rwIntelSSEsupported() { EAXJMP(0x5BBED0); }
+WRAPPER RwImage* RwImageSetFromRaster(RwImage* image, RwRaster* raster) { EAXJMP(0x5BBF10); }
+WRAPPER RwRaster* RwRasterSetFromImage(RwRaster* raster, RwImage* image) { EAXJMP(0x5BBF50); }
+WRAPPER RwImage* RwImageFindRasterFormat(RwImage* ipImage, RwInt32 nRasterType, RwInt32* npWidth, RwInt32* npHeight, RwInt32* npDepth, RwInt32* npFormat) { EAXJMP(0x5BBF80); }
+WRAPPER RwInt32 RwFrameRegisterPluginStream(RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB) { EAXJMP(0x5BBFF0); }
+WRAPPER rwFrameList* _rwFrameListDeinitialize(rwFrameList* frameList) { EAXJMP(0x5BC020); }
+WRAPPER rwFrameList* _rwFrameListStreamRead(RwStream* stream, rwFrameList* fl) { EAXJMP(0x5BC050); }
+WRAPPER RpLight* RpLightSetRadius(RpLight* light, RwReal radius) { EAXJMP(0x5BC300); }
+WRAPPER RpLight* RpLightSetColor(RpLight* light, RwRGBAReal const* color) { EAXJMP(0x5BC320); }
+WRAPPER RwReal RpLightGetConeAngle(RpLight const* light) { EAXJMP(0x5BC370); }
+WRAPPER RwInt32 RpLightRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5BC5B0); }
+WRAPPER RpLight* RpLightStreamRead(RwStream* stream) { EAXJMP(0x5BC5E0); }
+WRAPPER RwBool RpLightDestroy(RpLight* light) { EAXJMP(0x5BC780); }
+WRAPPER RpLight* RpLightCreate(RwInt32 type) { EAXJMP(0x5BC7C0); }
+WRAPPER void _rwD3D8TexDictionaryEnableRasterFormatConversion(RwBool enable) { EAXJMP(0x5BE280); }
+WRAPPER RwFileFunctions* RwOsGetFileInterface() { EAXJMP(0x5BF110); }
+WRAPPER RwBool RwFreeListDestroy(RwFreeList* freelist) { EAXJMP(0x5C1720); }
+WRAPPER RwFreeList* RwFreeListCreate(RwInt32 entrySize, RwInt32 entriesPerBlock, RwInt32 alignment) { EAXJMP(0x5C1790); }
+WRAPPER RwInt32 RwFreeListPurge(RwFreeList* freelist) { EAXJMP(0x5C19F0); }
+WRAPPER RwInt32 RwFreeListPurgeAllFreeLists() { EAXJMP(0x5C1B90); }
+WRAPPER RwFreeList* RwFreeListForAllUsed(RwFreeList* freelist, RwFreeListCallBack fpCallBack, void* pData) { EAXJMP(0x5C1D40); }
+WRAPPER RwBool _rxPipelineClose() { EAXJMP(0x5C2780); }
+WRAPPER RwBool _rxPipelineOpen() { EAXJMP(0x5C27E0); }
+WRAPPER RxHeap* RxHeapGetGlobalHeap() { EAXJMP(0x5C2AD0); }
+WRAPPER RxPacket* RxPacketCreate(RxPipelineNode* node) { EAXJMP(0x5C2AE0); }
+WRAPPER RxCluster* RxClusterSetExternalData(RxCluster* cluster, void* data, RwInt32 stride, RwInt32 numElements) { EAXJMP(0x5C2B10); }
+WRAPPER RxCluster* RxClusterSetData(RxCluster* cluster, void* data, RwInt32 stride, RwInt32 numElements) { EAXJMP(0x5C2B70); }
+WRAPPER RxCluster* RxClusterInitializeData(RxCluster* cluster, RwUInt32 numElements, RwUInt16 stride) { EAXJMP(0x5C2BD0); }
+WRAPPER RxCluster* RxClusterResizeData(RxCluster* CurrentCluster, RwUInt32 NumElements) { EAXJMP(0x5C2C40); }
+WRAPPER RxCluster* RxClusterLockWrite(RxPacket* packet, RwUInt32 clusterIndex, RxPipelineNode* node) { EAXJMP(0x5C2C90); }
+WRAPPER RxPipeline* RxPipelineExecute(RxPipeline* pipeline, void* data, RwBool heapReset) { EAXJMP(0x5C2D60); }
+WRAPPER RxPipeline* RxPipelineCreate() { EAXJMP(0x5C2E00); }
+WRAPPER void _rxPipelineDestroy(RxPipeline* Pipeline) { EAXJMP(0x5C2E70); }
+WRAPPER RwBool RwResourcesFreeResEntry(RwResEntry* entry) { EAXJMP(0x5C3080); }
+WRAPPER void _rwResourcesPurge() { EAXJMP(0x5C30F0); }
+WRAPPER RwResEntry* RwResourcesAllocateResEntry(void* owner, RwResEntry** ownerRef, RwInt32 size, RwResEntryDestroyNotify destroyNotify) { EAXJMP(0x5C3170); }
+WRAPPER RwBool RwResourcesEmptyArena() { EAXJMP(0x5C3360); }
+WRAPPER RwBool _rwPluginRegistryOpen() { EAXJMP(0x5C3450); }
+WRAPPER RwBool _rwPluginRegistryClose() { EAXJMP(0x5C3480); }
+WRAPPER RwInt32 _rwPluginRegistryGetPluginOffset(RwPluginRegistry const* reg, RwUInt32 pluginID) { EAXJMP(0x5C3590); }
+WRAPPER RwInt32 _rwPluginRegistryAddPlugin(RwPluginRegistry* reg, RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5C35C0); }
+WRAPPER RwPluginRegistry const* _rwPluginRegistryInitObject(RwPluginRegistry const* reg, void* object) { EAXJMP(0x5C37F0); }
+WRAPPER RwPluginRegistry const* _rwPluginRegistryDeInitObject(RwPluginRegistry const* reg, void* object) { EAXJMP(0x5C3850); }
+WRAPPER RwPluginRegistry const* _rwPluginRegistryCopyObject(RwPluginRegistry const* reg, void* dstObject, void const* srcObject) { EAXJMP(0x5C3880); }
+WRAPPER RwError* RwErrorSet(RwError* code) { EAXJMP(0x5C3910); }
+WRAPPER RwInt32 _rwerror(RwInt32 code, ...) { EAXJMP(0x5C3970); }
+WRAPPER RwInt32 _rwPluginRegistryAddPluginStream(RwPluginRegistry* reg, RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB) { EAXJMP(0x5C3980); }
+WRAPPER RwInt32 _rwPluginRegistryAddPlgnStrmlwysCB(RwPluginRegistry* reg, RwUInt32 pluginID, RwPluginDataChunkAlwaysCallBack alwaysCB) { EAXJMP(0x5C39C0); }
+WRAPPER RwInt32 _rwPluginRegistryAddPlgnStrmRightsCB(RwPluginRegistry* reg, RwUInt32 pluginID, RwPluginDataChunkRightsCallBack rightsCB) { EAXJMP(0x5C39F0); }
+WRAPPER RwPluginRegistry const* _rwPluginRegistryReadDataChunks(RwPluginRegistry const* reg, RwStream* stream, void* object) { EAXJMP(0x5C3A20); }
+WRAPPER RwPluginRegistry const* _rwPluginRegistryInvokeRights(RwPluginRegistry const* reg, RwUInt32 id, void* obj, RwUInt32 extraData) { EAXJMP(0x5C3B50); }
+WRAPPER RwInt32 _rwPluginRegistryGetSize(RwPluginRegistry const* reg, void const* object) { EAXJMP(0x5C3BA0); }
+WRAPPER RwPluginRegistry const* _rwPluginRegistryWriteDataChunks(RwPluginRegistry const* reg, RwStream* stream, void const* object) { EAXJMP(0x5C3BE0); }
+WRAPPER RwPluginRegistry const* _rwPluginRegistrySkipDataChunks(RwPluginRegistry const* reg, RwStream* stream) { EAXJMP(0x5C3CB0); }
+WRAPPER RwCamera* RwCameraStreamRead(RwStream* stream) { EAXJMP(0x5C3D30); }
+WRAPPER RwBBox* RwBBoxCalculate(RwBBox* boundBox, RwV3d const* verts, RwInt32 numVerts) { EAXJMP(0x5C5570); }
+WRAPPER RwImage* RwImageResample(RwImage* dstImage, RwImage const* srcImage) { EAXJMP(0x5C72B0); }
+WRAPPER RwImage* RwImageCreateResample(RwImage const* srcImage, RwInt32 width, RwInt32 height) { EAXJMP(0x5C7B30); }
+WRAPPER RxRenderStateVector* RxRenderStateVectorSetDefaultRenderStateVector(RxRenderStateVector* rsvp) { EAXJMP(0x5D9240); }
+WRAPPER RxRenderStateVector* RxRenderStateVectorCreate(RwBool current) { EAXJMP(0x5D9340); }
+WRAPPER void RxRenderStateVectorDestroy(RxRenderStateVector* rsvp) { EAXJMP(0x5D9410); }
+WRAPPER RxRenderStateVector* RxRenderStateVectorLoadDriverState(RxRenderStateVector* rsvp) { EAXJMP(0x5D9460); }
+WRAPPER void _rxEmbeddedPacketBetweenPipelines(RxPipeline* fromPipeline, RxPipeline* toPipeline) { EAXJMP(0x5D95D0); }
+WRAPPER RxPipelineNode* _rxEmbeddedPacketBetweenNodes(RxPipeline* pipeline, RxPipelineNode* nodeFrom, RwUInt32 whichOutput) { EAXJMP(0x5D9740); }
+WRAPPER void _rxPacketDestroy(RxPacket* Packet) { EAXJMP(0x5D9810); }
+WRAPPER RpMaterialList* _rpMaterialListDeinitialize(RpMaterialList* matList) { EAXJMP(0x5C8B10); }
+WRAPPER RpMaterialList* _rpMaterialListInitialize(RpMaterialList* matList) { EAXJMP(0x5C8B70); }
+WRAPPER RpMaterial* _rpMaterialListGetMaterial(RpMaterialList const* matList, RwInt32 matIndex) { EAXJMP(0x5C8B80); }
+WRAPPER RwInt32 _rpMaterialListAppendMaterial(RpMaterialList* matList, RpMaterial* material) { EAXJMP(0x5C8B90); }
+WRAPPER RwInt32 _rpMaterialListFindMaterialIndex(RpMaterialList const* matList, RpMaterial const* material) { EAXJMP(0x5C8C50); }
+WRAPPER RpMaterialList* _rpMaterialListStreamRead(RwStream* stream, RpMaterialList* matList) { EAXJMP(0x5C8C80); }
+WRAPPER RpMeshHeader* _rpMeshHeaderCreate(RwUInt32 size) { EAXJMP(0x5C8FE0); }
+WRAPPER void* _rpMeshClose(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5C8FF0); }
+WRAPPER void* _rpMeshOpen(void* instance, RwInt32 offset, RwInt32 size) { EAXJMP(0x5C9020); }
+WRAPPER RpBuildMesh* _rpBuildMeshCreate(RwUInt32 bufferSize) { EAXJMP(0x5C9140); }
+WRAPPER RwBool _rpBuildMeshDestroy(RpBuildMesh* mesh) { EAXJMP(0x5C9220); }
+WRAPPER RwBool _rpMeshDestroy(RpMeshHeader* mesh) { EAXJMP(0x5C9260); }
+WRAPPER RpBuildMesh* _rpBuildMeshAddTriangle(RpBuildMesh* mesh, RpMaterial* material, RwInt32 vert1, RwInt32 vert2, RwInt32 vert3) { EAXJMP(0x5C92A0); }
+WRAPPER RpMeshHeader* _rpMeshHeaderForAllMeshes(RpMeshHeader* meshHeader, RpMeshCallBack fpCallBack, void* pData) { EAXJMP(0x5C9380); }
+WRAPPER RwStream* _rpMeshWrite(RpMeshHeader const* meshHeader, void const* object, RwStream* stream, RpMaterialList const* matList) { EAXJMP(0x5C93C0); }
+WRAPPER RpMeshHeader* _rpMeshRead(RwStream* stream, void const* object, RpMaterialList const* matList) { EAXJMP(0x5C9510); }
+WRAPPER RwInt32 _rpMeshSize(RpMeshHeader const* meshHeader, void const* object) { EAXJMP(0x5C96E0); }
+WRAPPER RpMeshHeader* RpBuildMeshGenerateDefaultTriStrip(RpBuildMesh* buildmesh, void* data) { EAXJMP(0x5C9730); }
+WRAPPER RpMeshHeader* _rpTriListMeshGenerate(RpBuildMesh* buildMesh, void* data) { EAXJMP(0x5CAE10); }
+WRAPPER RpMeshHeader* _rpMeshOptimise(RpBuildMesh* buildmesh, RwUInt32 flags) { EAXJMP(0x5CB230); }
+WRAPPER RwInt32 RpWorldSectorRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor ructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB) { EAXJMP(0x5CB2B0); }
+WRAPPER RwInt32 RpWorldSectorRegisterPluginStream(RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB) { EAXJMP(0x5CB2E0); }
+WRAPPER RxPipeline* RpWorldSetDefaultSectorPipeline(RxPipeline* pipeline) { EAXJMP(0x5CB630); }
+WRAPPER RxPipeline* RpAtomicSetDefaultPipeline(RxPipeline* pipeline) { EAXJMP(0x5CB670); }
+WRAPPER void RpHAnimStdKeyFrameToMatrix(RwMatrix* matrix, void* voidIFrame) { EAXJMP(0x5CDEE0); }
+WRAPPER void RpHAnimStdKeyFrameInterpolate(void* voidOut, void* voidIn1, void* voidIn2, RwReal time) { EAXJMP(0x5CE000); }
+WRAPPER void RpHAnimStdKeyFrameBlend(void* voidOut, void* voidIn1, void* voidIn2, RwReal alpha) { EAXJMP(0x5CE420); }
+WRAPPER RpHAnimAnimation* RpHAnimStdKeyFrameStreamRead(RwStream* stream, RpHAnimAnimation* animation) { EAXJMP(0x5CE820); }
+WRAPPER RwBool RpHAnimStdKeyFrameStreamWrite(RpHAnimAnimation* animation, RwStream* stream) { EAXJMP(0x5CE8C0); }
+WRAPPER RwInt32 RpHAnimStdKeyFrameStreamGetSize(RpHAnimAnimation* animation) { EAXJMP(0x5CE930); }
+WRAPPER void RpHAnimStdKeyFrameMulRecip(void* voidFrame, void* voidStart) { EAXJMP(0x5CE950); }
+WRAPPER void RpHAnimStdKeyFrameAdd(void* voidOut, void* voidIn1, void* voidIn2) { EAXJMP(0x5CEAB0); }
+WRAPPER void RxHeapFree(RxHeap* heap, void* block) { EAXJMP(0x5D1070); }
+WRAPPER void* RxHeapAlloc(RxHeap* heap, RwUInt32 size) { EAXJMP(0x5D1260); }
+WRAPPER void* RxHeapRealloc(RxHeap* heap, void* block, RwUInt32 newSize, RwBool allowCopy) { EAXJMP(0x5D14D0); }
+WRAPPER RwBool _rxHeapReset(RxHeap* heap) { EAXJMP(0x5D1680); }
+WRAPPER void RxHeapDestroy(RxHeap* heap) { EAXJMP(0x5D16F0); }
+WRAPPER RxHeap* RxHeapCreate(RwUInt32 size) { EAXJMP(0x5D1750); }
+WRAPPER RxNodeOutput RxPipelineNodeFindOutputByName(RxPipelineNode* node, RwChar const* outputname) { EAXJMP(0x5D1EC0); }
+WRAPPER RxNodeInput RxPipelineNodeFindInput(RxPipelineNode* node) { EAXJMP(0x5D1F20); }
+WRAPPER RxPipeline* RxPipelineNodeRequestCluster(RxPipeline* pipeline, RxPipelineNode* node, RxClusterDefinition* clusterDef) { EAXJMP(0x5D1F30); }
+WRAPPER RxPipeline* RxLockedPipeUnlock(RxLockedPipe* pipeline) { EAXJMP(0x5D1FA0); }
+WRAPPER RxLockedPipe* RxPipelineLock(RxPipeline* pipeline) { EAXJMP(0x5D29F0); }
+WRAPPER RxPipelineNode* RxPipelineFindNodeByName(RxPipeline* pipeline, RwChar const* name, RxPipelineNode* start, RwInt32* nodeIndex) { EAXJMP(0x5D2B10); }
+WRAPPER RxLockedPipe* RxLockedPipeAddFragment(RxLockedPipe *pipeline, RwUInt32 *firstIndex, RxNodeDefinition *nodeDef0, ...) { EAXJMP(0x5D2BA0); }
+WRAPPER RxPipeline* RxLockedPipeAddPath(RxLockedPipe* pipeline, RxNodeOutput out, RxNodeInput in) { EAXJMP(0x5D2EE0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetImmRenderSetup() { EAXJMP(0x5D31C0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetImmMangleTriangleIndices() { EAXJMP(0x5D35C0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetCullTriangle() { EAXJMP(0x5D3C60); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetClipTriangle() { EAXJMP(0x5D4F80); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetSubmitTriangle() { EAXJMP(0x5D51C0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetImmInstance() { EAXJMP(0x5D5400); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetTransform() { EAXJMP(0x5D6000); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetImmStash() { EAXJMP(0x5D61C0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetImmMangleLineIndices() { EAXJMP(0x5D6470); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetClipLine() { EAXJMP(0x5D7230); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetSubmitLine() { EAXJMP(0x5D74C0); }
+WRAPPER RwBool _rwD3D8LightsOpen() { EAXJMP(0x5D9C90); }
+WRAPPER void _rwD3D8LightsClose() { EAXJMP(0x5D9EF0); }
+WRAPPER RwBool _rwD3D8LightsGlobalEnable(RpLightFlag flags) { EAXJMP(0x5D9F80); }
+WRAPPER RwBool _rwD3D8LightLocalEnable(RpLight* light) { EAXJMP(0x5DA210); }
+WRAPPER void _rwD3D8LightsEnable(RwBool enable, RwUInt32 type) { EAXJMP(0x5DA450); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetD3D8WorldSectorAllInOne() { EAXJMP(0x5DAAC0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetD3D8AtomicAllInOne() { EAXJMP(0x5DC500); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetWorldSectorInstance() { EAXJMP(0x5DCC50); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetWorldSectorEnumerateLights() { EAXJMP(0x5DCD80); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetAtomicInstance() { EAXJMP(0x5DD800); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetAtomicEnumerateLights() { EAXJMP(0x5DD9B0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetMaterialScatter() { EAXJMP(0x5DDAA0); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetLight() { EAXJMP(0x5DF040); }
+WRAPPER RxNodeDefinition* RxNodeDefinitionGetPostLight() { EAXJMP(0x5DF560); }
+WRAPPER void RxD3D8AllInOneSetRenderCallBack(RxPipelineNode* node, RxD3D8AllInOneRenderCallBack callback) { EAXJMP(0x5DFC60); } \ No newline at end of file
diff --git a/src/skel/events.cpp b/src/skel/events.cpp
new file mode 100644
index 00000000..4a7a8bd2
--- /dev/null
+++ b/src/skel/events.cpp
@@ -0,0 +1,845 @@
+#include "rwcore.h"
+#include "skeleton.h"
+#include "events.h"
+
+//#include "main.h"
+
+#include "common.h"
+#include "Pad.h"
+#include "ControllerConfig.h"
+#include "Frontend.h"
+#include "Camera.h"
+
+
+#include "patcher.h"
+
+/*
+ *****************************************************************************
+ */
+static RsEventStatus
+HandleKeyDown(RsKeyStatus *keyStatus)
+{
+ CPad *pad0 = CPad::GetPad(0);
+ CPad *pad1 = CPad::GetPad(1);
+
+ RwInt32 c = keyStatus->keyCharCode;
+
+ if ( c != rsNULL )
+ {
+ switch (c)
+ {
+ case rsESC:
+ {
+ CPad::TempKeyState.ESC = 255;
+ break;
+ }
+
+ case rsINS:
+ {
+ CPad::TempKeyState.INS = 255;
+ break;
+ }
+
+ case rsDEL:
+ {
+ CPad::TempKeyState.DEL = 255;
+ break;
+ }
+
+ case rsHOME:
+ {
+ CPad::TempKeyState.HOME = 255;
+ break;
+ }
+
+ case rsEND:
+ {
+ CPad::TempKeyState.END = 255;
+ break;
+ }
+
+ case rsPGUP:
+ {
+ CPad::TempKeyState.PGUP = 255;
+ break;
+ }
+
+ case rsPGDN:
+ {
+ CPad::TempKeyState.PGDN = 255;
+ break;
+ }
+
+ case rsUP:
+ {
+ CPad::TempKeyState.UP = 255;
+ break;
+ }
+
+ case rsDOWN:
+ {
+ CPad::TempKeyState.DOWN = 255;
+ break;
+ }
+
+ case rsLEFT:
+ {
+ CPad::TempKeyState.LEFT = 255;
+ break;
+ }
+
+ case rsRIGHT:
+ {
+ CPad::TempKeyState.RIGHT = 255;
+ break;
+ }
+
+ case rsNUMLOCK:
+ {
+ CPad::TempKeyState.NUMLOCK = 255;
+ break;
+ }
+
+ case rsPADDEL:
+ {
+ CPad::TempKeyState.DECIMAL = 255;
+ break;
+ }
+
+ case rsPADEND:
+ {
+ CPad::TempKeyState.NUM1 = 255;
+ break;
+ }
+
+ case rsPADDOWN:
+ {
+ CPad::TempKeyState.NUM2 = 255;
+ break;
+ }
+
+ case rsPADPGDN:
+ {
+ CPad::TempKeyState.NUM3 = 255;
+ break;
+ }
+
+ case rsPADLEFT:
+ {
+ CPad::TempKeyState.NUM4 = 255;
+ break;
+ }
+
+ case rsPAD5:
+ {
+ CPad::TempKeyState.NUM5 = 255;
+ break;
+ }
+
+ case rsPADRIGHT:
+ {
+ CPad::TempKeyState.NUM6 = 255;
+ break;
+ }
+
+ case rsPADHOME:
+ {
+ CPad::TempKeyState.NUM7 = 255;
+ break;
+ }
+
+ case rsPADUP:
+ {
+ CPad::TempKeyState.NUM8 = 255;
+ break;
+ }
+
+ case rsPADPGUP:
+ {
+ CPad::TempKeyState.NUM9 = 255;
+ break;
+ }
+
+ case rsPADINS:
+ {
+ CPad::TempKeyState.NUM0 = 255;
+ break;
+ }
+
+ case rsDIVIDE:
+ {
+ CPad::TempKeyState.DIV = 255;
+ break;
+ }
+
+ case rsTIMES:
+ {
+ CPad::TempKeyState.MUL = 255;
+ break;
+ }
+
+ case rsMINUS:
+ {
+ CPad::TempKeyState.SUB = 255;
+ break;
+ }
+
+ case rsPADENTER:
+ {
+ CPad::TempKeyState.ENTER = 255;
+ break;
+ }
+
+ case rsPLUS:
+ {
+ CPad::TempKeyState.ADD = 255;
+ break;
+ }
+
+ case rsENTER:
+ {
+ CPad::TempKeyState.EXTENTER = 255;
+ break;
+ }
+
+ case rsSCROLL:
+ {
+ CPad::TempKeyState.SCROLLLOCK = 255;
+ break;
+ }
+
+ case rsPAUSE:
+ {
+ CPad::TempKeyState.PAUSE = 255;
+ break;
+ }
+
+ case rsBACKSP:
+ {
+ CPad::TempKeyState.BACKSP = 255;
+ break;
+ }
+
+ case rsTAB:
+ {
+ CPad::TempKeyState.TAB = 255;
+ break;
+ }
+
+ case rsCAPSLK:
+ {
+ CPad::TempKeyState.CAPSLOCK = 255;
+ break;
+ }
+
+ case rsLSHIFT:
+ {
+ CPad::TempKeyState.LSHIFT = 255;
+ break;
+ }
+
+ case rsSHIFT:
+ {
+ CPad::TempKeyState.SHIFT = 255;
+ break;
+ }
+
+ case rsRSHIFT:
+ {
+ CPad::TempKeyState.RSHIFT = 255;
+ break;
+ }
+
+ case rsLCTRL:
+ {
+ CPad::TempKeyState.LCTRL = 255;
+ break;
+ }
+
+ case rsRCTRL:
+ {
+ CPad::TempKeyState.RCTRL = 255;
+ break;
+ }
+
+ case rsLALT:
+ {
+ CPad::TempKeyState.LALT = 255;
+ break;
+ }
+
+ case rsRALT:
+ {
+ CPad::TempKeyState.RALT = 255;
+ break;
+ }
+
+
+ case rsLWIN:
+ {
+ CPad::TempKeyState.LWIN = 255;
+ break;
+ }
+
+ case rsRWIN:
+ {
+ CPad::TempKeyState.RWIN = 255;
+ break;
+ }
+
+ case rsAPPS:
+ {
+ CPad::TempKeyState.APPS = 255;
+ break;
+ }
+
+ case rsF1:
+ case rsF2:
+ case rsF3:
+ case rsF4:
+ case rsF5:
+ case rsF6:
+ case rsF7:
+ case rsF8:
+ case rsF9:
+ case rsF10:
+ case rsF11:
+ case rsF12:
+ {
+ CPad::TempKeyState.F[c - rsF1] = 255;
+ break;
+ }
+
+ default:
+ {
+ if ( c < 255 )
+ {
+ CPad::TempKeyState.VK_KEYS[c] = 255;
+ pad0->AddToPCCheatString(c);
+ }
+ break;
+ }
+ }
+
+ if ( CPad::m_bMapPadOneToPadTwo )
+ {
+ if ( c == 'D' ) pad1->PCTempKeyState.LeftStickX = 128;
+ if ( c == 'A' ) pad1->PCTempKeyState.LeftStickX = -128;
+ if ( c == 'W' ) pad1->PCTempKeyState.LeftStickY = 128;
+ if ( c == 'S' ) pad1->PCTempKeyState.LeftStickY = -128;
+ if ( c == 'J' ) pad1->PCTempKeyState.RightStickX = 128;
+ if ( c == 'G' ) pad1->PCTempKeyState.RightStickX = -128;
+ if ( c == 'Y' ) pad1->PCTempKeyState.RightStickY = 128;
+ if ( c == 'H' ) pad1->PCTempKeyState.RightStickY = -128;
+ if ( c == 'Z' ) pad1->PCTempKeyState.LeftShoulder1 = 255;
+ if ( c == 'X' ) pad1->PCTempKeyState.LeftShoulder2 = 255;
+ if ( c == 'C' ) pad1->PCTempKeyState.RightShoulder1 = 255;
+ if ( c == 'V' ) pad1->PCTempKeyState.RightShoulder2 = 255;
+ if ( c == 'O' ) pad1->PCTempKeyState.DPadUp = 255;
+ if ( c == 'L' ) pad1->PCTempKeyState.DPadDown = 255;
+ if ( c == 'K' ) pad1->PCTempKeyState.DPadLeft = 255;
+ if ( c == ';' ) pad1->PCTempKeyState.DPadRight = 255;
+ if ( c == 'B' ) pad1->PCTempKeyState.Start = 255;
+ if ( c == 'N' ) pad1->PCTempKeyState.Select = 255;
+ if ( c == 'M' ) pad1->PCTempKeyState.Square = 255;
+ if ( c == ',' ) pad1->PCTempKeyState.Triangle = 255;
+ if ( c == '.' ) pad1->PCTempKeyState.Cross = 255;
+ if ( c == '/' ) pad1->PCTempKeyState.Circle = 255;
+ if ( c == rsRSHIFT ) pad1->PCTempKeyState.LeftShock = 255;
+ if ( c == rsRCTRL ) pad1->PCTempKeyState.RightShock = 255;
+ }
+ }
+
+ return rsEVENTPROCESSED;
+}
+
+
+static RsEventStatus
+HandleKeyUp(RsKeyStatus *keyStatus)
+{
+ CPad *pad0 = CPad::GetPad(0);
+ CPad *pad1 = CPad::GetPad(1);
+
+ RwInt32 c = keyStatus->keyCharCode;
+
+ if ( c != rsNULL )
+ {
+ switch (c)
+ {
+ case rsESC:
+ {
+ CPad::TempKeyState.ESC = 0;
+ break;
+ }
+
+ case rsINS:
+ {
+ CPad::TempKeyState.INS = 0;
+ break;
+ }
+
+ case rsDEL:
+ {
+ CPad::TempKeyState.DEL = 0;
+ break;
+ }
+
+ case rsHOME:
+ {
+ CPad::TempKeyState.HOME = 0;
+ break;
+ }
+
+ case rsEND:
+ {
+ CPad::TempKeyState.END = 0;
+ break;
+ }
+
+ case rsPGUP:
+ {
+ CPad::TempKeyState.PGUP = 0;
+ break;
+ }
+
+ case rsPGDN:
+ {
+ CPad::TempKeyState.PGDN = 0;
+ break;
+ }
+
+ case rsUP:
+ {
+ CPad::TempKeyState.UP = 0;
+ break;
+ }
+
+ case rsDOWN:
+ {
+ CPad::TempKeyState.DOWN = 0;
+ break;
+ }
+
+ case rsLEFT:
+ {
+ CPad::TempKeyState.LEFT = 0;
+ break;
+ }
+
+ case rsRIGHT:
+ {
+ CPad::TempKeyState.RIGHT = 0;
+ break;
+ }
+
+ case rsNUMLOCK:
+ {
+ CPad::TempKeyState.NUMLOCK = 0;
+ break;
+ }
+
+ case rsPADDEL:
+ {
+ CPad::TempKeyState.DECIMAL = 0;
+ break;
+ }
+
+ case rsPADEND:
+ {
+ CPad::TempKeyState.NUM1 = 0;
+ break;
+ }
+
+ case rsPADDOWN:
+ {
+ CPad::TempKeyState.NUM2 = 0;
+ break;
+ }
+
+ case rsPADPGDN:
+ {
+ CPad::TempKeyState.NUM3 = 0;
+ break;
+ }
+
+ case rsPADLEFT:
+ {
+ CPad::TempKeyState.NUM4 = 0;
+ break;
+ }
+
+ case rsPAD5:
+ {
+ CPad::TempKeyState.NUM5 = 0;
+ break;
+ }
+
+ case rsPADRIGHT:
+ {
+ CPad::TempKeyState.NUM6 = 0;
+ break;
+ }
+
+ case rsPADHOME:
+ {
+ CPad::TempKeyState.NUM7 = 0;
+ break;
+ }
+
+ case rsPADUP:
+ {
+ CPad::TempKeyState.NUM8 = 0;
+ break;
+ }
+
+ case rsPADPGUP:
+ {
+ CPad::TempKeyState.NUM9 = 0;
+ break;
+ }
+
+ case rsPADINS:
+ {
+ CPad::TempKeyState.NUM0 = 0;
+ break;
+ }
+
+ case rsDIVIDE:
+ {
+ CPad::TempKeyState.DIV = 0;
+ break;
+ }
+
+ case rsTIMES:
+ {
+ CPad::TempKeyState.MUL = 0;
+ break;
+ }
+
+ case rsMINUS:
+ {
+ CPad::TempKeyState.SUB = 0;
+ break;
+ }
+
+ case rsPADENTER:
+ {
+ CPad::TempKeyState.ENTER = 0;
+ break;
+ }
+
+ case rsPLUS:
+ {
+ CPad::TempKeyState.ADD = 0;
+ break;
+ }
+
+ case rsENTER:
+ {
+ CPad::TempKeyState.EXTENTER = 0;
+ break;
+ }
+
+ case rsSCROLL:
+ {
+ CPad::TempKeyState.SCROLLLOCK = 0;
+ break;
+ }
+
+ case rsPAUSE:
+ {
+ CPad::TempKeyState.PAUSE = 0;
+ break;
+ }
+
+ case rsBACKSP:
+ {
+ CPad::TempKeyState.BACKSP = 0;
+ break;
+ }
+
+ case rsTAB:
+ {
+ CPad::TempKeyState.TAB = 0;
+ break;
+ }
+
+ case rsCAPSLK:
+ {
+ CPad::TempKeyState.CAPSLOCK = 0;
+ break;
+ }
+
+ case rsLSHIFT:
+ {
+ CPad::TempKeyState.LSHIFT = 0;
+ break;
+ }
+
+ case rsSHIFT:
+ {
+ CPad::TempKeyState.SHIFT = 0;
+ break;
+ }
+
+ case rsRSHIFT:
+ {
+ CPad::TempKeyState.RSHIFT = 0;
+ break;
+ }
+
+ case rsLCTRL:
+ {
+ CPad::TempKeyState.LCTRL = 0;
+ break;
+ }
+
+ case rsRCTRL:
+ {
+ CPad::TempKeyState.RCTRL = 0;
+ break;
+ }
+
+ case rsLALT:
+ {
+ CPad::TempKeyState.LALT = 0;
+ break;
+ }
+
+ case rsRALT:
+ {
+ CPad::TempKeyState.RALT = 0;
+ break;
+ }
+
+
+ case rsLWIN:
+ {
+ CPad::TempKeyState.LWIN = 0;
+ break;
+ }
+
+ case rsRWIN:
+ {
+ CPad::TempKeyState.RWIN = 0;
+ break;
+ }
+
+ case rsAPPS:
+ {
+ CPad::TempKeyState.APPS = 0;
+ break;
+ }
+
+ case rsF1:
+ case rsF2:
+ case rsF3:
+ case rsF4:
+ case rsF5:
+ case rsF6:
+ case rsF7:
+ case rsF8:
+ case rsF9:
+ case rsF10:
+ case rsF11:
+ case rsF12:
+ {
+ CPad::TempKeyState.F[c - rsF1] = 0;
+ break;
+ }
+
+ default:
+ {
+ if ( c < 255 )
+ {
+ CPad::TempKeyState.VK_KEYS[c] = 0;
+ pad0->AddToPCCheatString(c);
+ }
+ break;
+ }
+ }
+
+ if ( CPad::m_bMapPadOneToPadTwo )
+ {
+ if ( c == 'D' ) pad1->PCTempKeyState.LeftStickX = 0;
+ if ( c == 'A' ) pad1->PCTempKeyState.LeftStickX = 0;
+ if ( c == 'W' ) pad1->PCTempKeyState.LeftStickY = 0;
+ if ( c == 'S' ) pad1->PCTempKeyState.LeftStickY = 0;
+ if ( c == 'J' ) pad1->PCTempKeyState.RightStickX = 0;
+ if ( c == 'G' ) pad1->PCTempKeyState.RightStickX = 0;
+ if ( c == 'Y' ) pad1->PCTempKeyState.RightStickY = 0;
+ if ( c == 'H' ) pad1->PCTempKeyState.RightStickY = 0;
+ if ( c == 'Z' ) pad1->PCTempKeyState.LeftShoulder1 = 0;
+ if ( c == 'X' ) pad1->PCTempKeyState.LeftShoulder2 = 0;
+ if ( c == 'C' ) pad1->PCTempKeyState.RightShoulder1 = 0;
+ if ( c == 'V' ) pad1->PCTempKeyState.RightShoulder2 = 0;
+ if ( c == 'O' ) pad1->PCTempKeyState.DPadUp = 0;
+ if ( c == 'L' ) pad1->PCTempKeyState.DPadDown = 0;
+ if ( c == 'K' ) pad1->PCTempKeyState.DPadLeft = 0;
+ if ( c == ';' ) pad1->PCTempKeyState.DPadRight = 0;
+ if ( c == 'B' ) pad1->PCTempKeyState.Start = 0;
+ if ( c == 'N' ) pad1->PCTempKeyState.Select = 0;
+ if ( c == 'M' ) pad1->PCTempKeyState.Square = 0;
+ if ( c == ',' ) pad1->PCTempKeyState.Triangle = 0;
+ if ( c == '.' ) pad1->PCTempKeyState.Cross = 0;
+ if ( c == '/' ) pad1->PCTempKeyState.Circle = 0;
+ if ( c == rsRSHIFT ) pad1->PCTempKeyState.LeftShock = 0;
+ if ( c == rsRCTRL ) pad1->PCTempKeyState.RightShock = 0;
+ }
+ }
+
+ return rsEVENTPROCESSED;
+}
+
+
+/*
+ *****************************************************************************
+ */
+static RsEventStatus
+KeyboardHandler(RsEvent event, void *param)
+{
+ /*
+ * ...then the application events, if necessary...
+ */
+ switch( event )
+ {
+ case rsKEYDOWN:
+ {
+ return HandleKeyDown((RsKeyStatus *)param);
+ }
+
+ case rsKEYUP:
+ {
+ return HandleKeyUp((RsKeyStatus *)param);
+ }
+
+ default:
+ {
+ return rsEVENTNOTPROCESSED;
+ }
+ }
+}
+
+/*
+ *****************************************************************************
+ */
+static RsEventStatus
+HandlePadButtonDown(RsPadButtonStatus *padButtonStatus)
+{
+ Bool bPadTwo = false;
+ Int32 padNumber = padButtonStatus->padID;
+
+ CPad *pad = CPad::GetPad(padNumber);
+
+ if ( CPad::m_bMapPadOneToPadTwo )
+ padNumber = 1;
+
+ if ( padNumber == 1 )
+ bPadTwo = true;
+
+ ControlsManager.UpdateJoyButtonState(padNumber);
+
+ for ( Int32 i = 0; i < _TODOCONST(16); i++ )
+ {
+ RsPadButtons btn = rsPADNULL;
+ if ( ControlsManager.m_aButtonStates[i] == TRUE )
+ btn = (RsPadButtons)(i + 1);
+
+ if ( FrontEndMenuManager.m_bMenuActive || bPadTwo )
+ ControlsManager.UpdateJoyInConfigMenus_ButtonDown(btn, padNumber);
+ else
+ ControlsManager.AffectControllerStateOn_ButtonDown(btn, JOYSTICK);
+ }
+
+ return rsEVENTPROCESSED;
+}
+
+
+/*
+ *****************************************************************************
+ */
+static RsEventStatus
+HandlePadButtonUp(RsPadButtonStatus *padButtonStatus)
+{
+ Bool bPadTwo = false;
+ Int32 padNumber = padButtonStatus->padID;
+
+ CPad *pad = CPad::GetPad(padNumber);
+
+ if ( CPad::m_bMapPadOneToPadTwo )
+ padNumber = 1;
+
+ if ( padNumber == 1 )
+ bPadTwo = true;
+
+ Bool bCam = false;
+ Int16 mode = TheCamera.Cams[TheCamera.ActiveCam].Mode;
+ if ( mode == CCam::MODE_FLYBY || mode == CCam::MODE_FIXED )
+ Bool bCam = true;
+
+ ControlsManager.UpdateJoyButtonState(padNumber);
+
+ for ( Int32 i = 1; i < _TODOCONST(16); i++ )
+ {
+ RsPadButtons btn = rsPADNULL;
+ if ( ControlsManager.m_aButtonStates[i] == FALSE )
+ btn = (RsPadButtons)(i + 1); // bug ?, cycle begins from 1(not zero), 1+1==2==rsPADBUTTON2, so we skip rsPADBUTTON1, right ?
+
+ if ( FrontEndMenuManager.m_bMenuActive || bPadTwo || bCam )
+ ControlsManager.UpdateJoyInConfigMenus_ButtonUp(btn, padNumber);
+ else
+ ControlsManager.AffectControllerStateOn_ButtonUp(btn, JOYSTICK);
+ }
+
+ return rsEVENTPROCESSED;
+}
+
+/*
+ *****************************************************************************
+ */
+static RsEventStatus
+PadHandler(RsEvent event, void *param)
+{
+ switch( event )
+ {
+ case rsPADBUTTONDOWN:
+ {
+ return HandlePadButtonDown((RsPadButtonStatus *)param);
+ }
+
+ case rsPADBUTTONUP:
+ {
+ return HandlePadButtonUp((RsPadButtonStatus *)param);
+ }
+
+ default:
+ {
+ return rsEVENTNOTPROCESSED;
+ }
+ }
+}
+
+
+/*
+ *****************************************************************************
+ */
+RwBool
+AttachInputDevices(void)
+{
+ RsInputDeviceAttach(rsKEYBOARD, KeyboardHandler);
+
+ RsInputDeviceAttach(rsPAD, PadHandler);
+
+ return TRUE;
+}
+
+
+STARTPATCHES
+ InjectHook(0x583F10, HandleKeyDown, PATCH_JUMP);
+ InjectHook(0x5842F0, HandleKeyUp, PATCH_JUMP);
+ InjectHook(0x5846C0, KeyboardHandler, PATCH_JUMP);
+ InjectHook(0x5846F0, HandlePadButtonDown, PATCH_JUMP);
+ InjectHook(0x584770, HandlePadButtonUp, PATCH_JUMP);
+ InjectHook(0x584830, PadHandler, PATCH_JUMP);
+ InjectHook(0x584860, AttachInputDevices, PATCH_JUMP);
+ENDPATCHES \ No newline at end of file
diff --git a/src/skel/events.h b/src/skel/events.h
new file mode 100644
index 00000000..ef812ebc
--- /dev/null
+++ b/src/skel/events.h
@@ -0,0 +1,7 @@
+#ifndef EVENTS_H
+#define EVENTS_H
+
+#include <rwcore.h>
+#include "skeleton.h"
+
+#endif /* EVENTS_H */
diff --git a/src/skel/platform.h b/src/skel/platform.h
new file mode 100644
index 00000000..5338b270
--- /dev/null
+++ b/src/skel/platform.h
@@ -0,0 +1,36 @@
+#ifndef PLATFORM_H
+#define PLATFORM_H
+
+#include "rwcore.h"
+#include "skeleton.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+extern RwUInt32 psTimer(void);
+
+
+extern RwBool psInitialise(void);
+extern void psTerminate(void);
+
+extern void psCameraShowRaster(RwCamera *camera);
+extern RwBool psCameraBeginUpdate(RwCamera *camera);
+
+extern void psMouseSetPos(RwV2d *pos);
+
+extern RwBool psSelectDevice(RwBool useDefault);
+
+/* install the platform specific file system */
+extern RwBool psInstallFileSystem(void);
+
+
+/* Handle native texture support */
+extern RwBool psNativeTextureSupport(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* PLATFORM_H */
diff --git a/src/skel/skeleton.cpp b/src/skel/skeleton.cpp
new file mode 100644
index 00000000..f9fc95ea
--- /dev/null
+++ b/src/skel/skeleton.cpp
@@ -0,0 +1,454 @@
+#include "common.h"
+#include "patcher.h"
+
+#include <stdio.h>
+#include <math.h>
+#include <ctype.h>
+#include <string.h>
+
+#include "rwcore.h"
+
+#include "skeleton.h"
+#include "platform.h"
+
+
+
+static RwBool DefaultVideoMode = TRUE;
+
+//RsGlobalType RsGlobal;
+RsGlobalType &RsGlobal = *(RsGlobalType*)0x8F4360;
+
+////////////////////////////////////////////////////////////////////////
+WRAPPER RwUInt32 psTimer(void) { EAXJMP(0x580CE0); }
+
+WRAPPER RwBool psInitialise(void) { EAXJMP(0x581180); }
+WRAPPER void psTerminate(void) { EAXJMP(0x581460); }
+WRAPPER void psCameraShowRaster(RwCamera *camera) { EAXJMP(0x580CA0); }
+WRAPPER RwBool psCameraBeginUpdate(RwCamera *camera) { EAXJMP(0x580C70); }
+WRAPPER void psMouseSetPos(RwV2d *pos) { EAXJMP(0x580D20); }
+WRAPPER RwBool psSelectDevice(RwBool useDefault) { EAXJMP(0x581D80); }
+WRAPPER RwBool psInstallFileSystem(void) { EAXJMP(0x580E20); }
+WRAPPER RwBool psNativeTextureSupport(void) { EAXJMP(0x580E30); }
+////////////////////////////////////////////////////////////////////////
+_TODO("psGetMemoryFunctions");
+RwMemoryFunctions*
+psGetMemoryFunctions(void)
+{
+ return 0;
+}
+
+/*
+ *****************************************************************************
+ */
+RwUInt32
+RsTimer(void)
+{
+ return psTimer();
+}
+
+
+/*
+ *****************************************************************************
+ */
+void
+RsCameraShowRaster(RwCamera * camera)
+{
+ psCameraShowRaster(camera);
+
+ return;
+}
+
+/*
+ *****************************************************************************
+ */
+RwBool
+RsCameraBeginUpdate(RwCamera * camera)
+{
+ return psCameraBeginUpdate(camera);
+}
+
+/*
+ *****************************************************************************
+ */
+RwBool
+RsRegisterImageLoader(void)
+{
+ return TRUE;
+}
+
+/*
+ *****************************************************************************
+ */
+static RwBool
+RsSetDebug(void)
+{
+ return TRUE;
+}
+
+/*
+ *****************************************************************************
+ */
+void
+RsMouseSetPos(RwV2d * pos)
+{
+ psMouseSetPos(pos);
+
+ return;
+}
+
+/*
+ *****************************************************************************
+ */
+RwBool
+RsSelectDevice(void)
+{
+ return psSelectDevice(DefaultVideoMode);
+}
+
+/*
+ *****************************************************************************
+ */
+RwBool
+RsInputDeviceAttach(RsInputDeviceType inputDevice,
+ RsInputEventHandler inputEventHandler)
+{
+ switch (inputDevice)
+ {
+ case rsKEYBOARD:
+ {
+ RsGlobal.keyboard.inputEventHandler = inputEventHandler;
+ RsGlobal.keyboard.used = TRUE;
+ break;
+ }
+ case rsMOUSE:
+ {
+ RsGlobal.mouse.inputEventHandler = inputEventHandler;
+ RsGlobal.mouse.used = TRUE;
+ break;
+ }
+ case rsPAD:
+ {
+ RsGlobal.pad.inputEventHandler = inputEventHandler;
+ RsGlobal.pad.used = TRUE;
+ break;
+ }
+ default:
+ {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+
+/*
+ *****************************************************************************
+ */
+static RwBool
+rsCommandLine(RwChar *arg)
+{
+ RsEventHandler(rsFILELOAD, arg);
+
+ return TRUE;
+}
+
+
+/*
+ *****************************************************************************
+ */
+static RwBool
+rsPreInitCommandLine(RwChar *arg)
+{
+ if( !strcmp(arg, RWSTRING("-vms")) )
+ {
+ DefaultVideoMode = FALSE;
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*
+ *****************************************************************************
+ */
+RsEventStatus
+RsKeyboardEventHandler(RsEvent event, void *param)
+{
+ if (RsGlobal.keyboard.used)
+ {
+ return RsGlobal.keyboard.inputEventHandler(event, param);
+ }
+
+ return rsEVENTNOTPROCESSED;
+}
+
+/*
+ *****************************************************************************
+ */
+RsEventStatus
+RsPadEventHandler(RsEvent event, void *param)
+{
+ if (RsGlobal.pad.used)
+ {
+ return RsGlobal.pad.inputEventHandler(event, param);
+ }
+
+ return rsEVENTNOTPROCESSED;
+}
+
+/*
+ *****************************************************************************
+ */
+RsEventStatus
+RsEventHandler(RsEvent event, void *param)
+{
+ RsEventStatus result;
+ RsEventStatus es;
+
+ /*
+ * Give the application an opportunity to override any events...
+ */
+ es = AppEventHandler(event, param);
+
+ /*
+ * We never allow the app to replace the quit behaviour,
+ * only to intercept...
+ */
+ if (event == rsQUITAPP)
+ {
+ /*
+ * Set the flag which causes the event loop to exit...
+ */
+ RsGlobal.quit = TRUE;
+ }
+
+ if (es == rsEVENTNOTPROCESSED)
+ {
+ switch (event)
+ {
+ case rsSELECTDEVICE:
+ result =
+ (RsSelectDevice()? rsEVENTPROCESSED : rsEVENTERROR);
+ break;
+
+ case rsCOMMANDLINE:
+ result = (rsCommandLine((RwChar *) param) ?
+ rsEVENTPROCESSED : rsEVENTERROR);
+ break;
+ case rsPREINITCOMMANDLINE:
+ result = (rsPreInitCommandLine((RwChar *) param) ?
+ rsEVENTPROCESSED : rsEVENTERROR);
+ break;
+ case rsINITDEBUG:
+ result =
+ (RsSetDebug()? rsEVENTPROCESSED : rsEVENTERROR);
+ break;
+
+ case rsREGISTERIMAGELOADER:
+ result = (RsRegisterImageLoader()?
+ rsEVENTPROCESSED : rsEVENTERROR);
+ break;
+
+ case rsRWTERMINATE:
+ RsRwTerminate();
+ result = (rsEVENTPROCESSED);
+ break;
+
+ case rsRWINITIALISE:
+ result = (RsRwInitialise(param) ?
+ rsEVENTPROCESSED : rsEVENTERROR);
+ break;
+
+ case rsTERMINATE:
+ RsTerminate();
+ result = (rsEVENTPROCESSED);
+ break;
+
+ case rsINITIALISE:
+ result =
+ (RsInitialise()? rsEVENTPROCESSED : rsEVENTERROR);
+ break;
+
+ default:
+ result = (es);
+ break;
+
+ }
+ }
+ else
+ {
+ result = (es);
+ }
+
+ return result;
+}
+
+/*
+ *****************************************************************************
+ */
+void
+RsRwTerminate(void)
+{
+ /* Close RenderWare */
+
+ RwEngineStop();
+ RwEngineClose();
+ RwEngineTerm();
+
+ return;
+}
+
+/*
+ *****************************************************************************
+ */
+RwBool
+RsRwInitialise(void *displayID)
+{
+ RwEngineOpenParams openParams;
+
+ /*
+ * Start RenderWare...
+ */
+
+ if (!RwEngineInit(psGetMemoryFunctions(), 0, rsRESOURCESDEFAULTARENASIZE))
+ {
+ return (FALSE);
+ }
+
+ /*
+ * Install any platform specific file systems...
+ */
+ psInstallFileSystem();
+
+ /*
+ * Initialize debug message handling...
+ */
+ RsEventHandler(rsINITDEBUG, NULL);
+
+ /*
+ * Attach all plugins...
+ */
+ if (RsEventHandler(rsPLUGINATTACH, NULL) == rsEVENTERROR)
+ {
+ return (FALSE);
+ }
+
+ /*
+ * Attach input devices...
+ */
+ if (RsEventHandler(rsINPUTDEVICEATTACH, NULL) == rsEVENTERROR)
+ {
+ return (FALSE);
+ }
+
+ openParams.displayID = displayID;
+
+ if (!RwEngineOpen(&openParams))
+ {
+ RwEngineTerm();
+ return (FALSE);
+ }
+
+ if (RsEventHandler(rsSELECTDEVICE, displayID) == rsEVENTERROR)
+ {
+ RwEngineClose();
+ RwEngineTerm();
+ return (FALSE);
+ }
+
+ if (!RwEngineStart())
+ {
+ RwEngineClose();
+ RwEngineTerm();
+ return (FALSE);
+ }
+
+ /*
+ * Register loaders for an image with a particular file extension...
+ */
+ RsEventHandler(rsREGISTERIMAGELOADER, NULL);
+
+ psNativeTextureSupport();
+
+ RwTextureSetMipmapping(FALSE);
+ RwTextureSetAutoMipmapping(FALSE);
+
+ return TRUE;
+}
+
+/*
+ *****************************************************************************
+ */
+void
+RsTerminate(void)
+{
+ psTerminate();
+
+ return;
+}
+
+/*
+ *****************************************************************************
+ */
+RwBool
+RsInitialise(void)
+{
+ /*
+ * Initialize Platform independent data...
+ */
+ RwBool result;
+
+ RsGlobal.appName = RWSTRING("GTA3");
+ RsGlobal.maximumWidth = DEFAULT_SCREEN_WIDTH;
+ RsGlobal.maximumHeight = DEFAULT_SCREEN_HEIGHT;
+ RsGlobal.width = DEFAULT_SCREEN_WIDTH;
+ RsGlobal.height = DEFAULT_SCREEN_HEIGHT;
+
+ RsGlobal.maxFPS = 30;
+
+ RsGlobal.quit = FALSE;
+
+ /* setup the keyboard */
+ RsGlobal.keyboard.inputDeviceType = rsKEYBOARD;
+ RsGlobal.keyboard.inputEventHandler = 0;
+ RsGlobal.keyboard.used = FALSE;
+
+ /* setup the mouse */
+ RsGlobal.mouse.inputDeviceType = rsMOUSE;
+ RsGlobal.mouse.inputEventHandler = 0;
+ RsGlobal.mouse.used = FALSE;
+
+ /* setup the pad */
+ RsGlobal.pad.inputDeviceType = rsPAD;
+ RsGlobal.pad.inputEventHandler = 0;
+ RsGlobal.pad.used = FALSE;
+
+ result = psInitialise();
+
+ return result;
+}
+
+
+
+
+STARTPATCHES
+ InjectHook(0x584890, RsTimer, PATCH_JUMP);
+ InjectHook(0x5848A0, RsCameraShowRaster, PATCH_JUMP);
+ InjectHook(0x5848B0, RsCameraBeginUpdate, PATCH_JUMP);
+ InjectHook(0x5848C0, RsRegisterImageLoader, PATCH_JUMP);
+ InjectHook(0x5848D0, RsSetDebug, PATCH_JUMP);
+ InjectHook(0x5848E0, RsMouseSetPos, PATCH_JUMP);
+ InjectHook(0x5848F0, RsSelectDevice, PATCH_JUMP);
+ InjectHook(0x584900, RsInputDeviceAttach, PATCH_JUMP);
+ InjectHook(0x584960, rsCommandLine, PATCH_JUMP);
+ InjectHook(0x584980, rsPreInitCommandLine, PATCH_JUMP);
+ InjectHook(0x5849C0, RsKeyboardEventHandler, PATCH_JUMP);
+ InjectHook(0x5849F0, RsPadEventHandler, PATCH_JUMP);
+ InjectHook(0x584A20, RsEventHandler, PATCH_JUMP);
+ InjectHook(0x584B30, RsRwTerminate, PATCH_JUMP);
+ InjectHook(0x584B40, RsRwInitialise, PATCH_JUMP);
+ InjectHook(0x584C30, RsTerminate, PATCH_JUMP);
+ InjectHook(0x584C40, RsInitialise, PATCH_JUMP);
+ENDPATCHES \ No newline at end of file
diff --git a/src/skel/skeleton.h b/src/skel/skeleton.h
new file mode 100644
index 00000000..891ca14f
--- /dev/null
+++ b/src/skel/skeleton.h
@@ -0,0 +1,276 @@
+#ifndef SKELETON_H
+#define SKELETON_H
+
+#include "rwcore.h"
+
+/* Default arena size depending on platform. */
+#define rsRESOURCESDEFAULTARENASIZE (1 << 20)
+
+#if (!defined(RsSprintf))
+#define RsSprintf rwsprintf
+#endif /* (!defined(RsSprintf)) */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#if (!defined(RSASSERT))
+#define RSASSERT(_condition) /* No-op */
+#endif /* (!defined(RSASSERT)) */
+
+#define RSASSERTISTYPE(_f, _t) \
+ RSASSERT( (!(_f)) || ((((const RwObject *)(_f))->type)==(_t)) )
+
+enum RsInputDeviceType
+{
+ rsKEYBOARD,
+ rsMOUSE,
+ rsPAD
+};
+typedef enum RsInputDeviceType RsInputDeviceType;
+
+enum RsEventStatus
+{
+ rsEVENTERROR,
+ rsEVENTPROCESSED,
+ rsEVENTNOTPROCESSED
+};
+typedef enum RsEventStatus RsEventStatus;
+
+enum RsEvent
+{
+ rsCAMERASIZE,
+ rsCOMMANDLINE,
+ rsFILELOAD,
+ rsINITDEBUG,
+ rsINPUTDEVICEATTACH,
+ rsLEFTBUTTONDOWN,
+ rsLEFTBUTTONUP,
+ rsMOUSEMOVE,
+ rsMOUSEWHEELMOVE,
+ rsPLUGINATTACH,
+ rsREGISTERIMAGELOADER,
+ rsRIGHTBUTTONDOWN,
+ rsRIGHTBUTTONUP,
+ _rs_13,
+ _rs_14,
+ _rs_15,
+ _rs_16,
+ _rs_17,
+ _rs_18,
+ _rs_19,
+ _rs_20,
+ rsRWINITIALISE,
+ rsRWTERMINATE,
+ rsSELECTDEVICE,
+ rsINITIALISE,
+ rsTERMINATE,
+ rsIDLE,
+ rsFRONTENDIDLE,
+ rsKEYDOWN,
+ rsKEYUP,
+ rsQUITAPP,
+ rsPADBUTTONDOWN,
+ rsPADBUTTONUP,
+ rsPADANALOGUELEFT,
+ rsPADANALOGUELEFTRESET,
+ rsPADANALOGUERIGHT,
+ rsPADANALOGUERIGHTRESET,
+ rsPREINITCOMMANDLINE,
+ rsACTIVATE,
+};
+
+typedef enum RsEvent RsEvent;
+
+typedef RsEventStatus (*RsInputEventHandler)(RsEvent event, void *param);
+
+typedef struct RsInputDevice RsInputDevice;
+struct RsInputDevice
+{
+ RsInputDeviceType inputDeviceType;
+ RwBool used;
+ RsInputEventHandler inputEventHandler;
+};
+
+typedef struct RsGlobalType RsGlobalType;
+struct RsGlobalType
+{
+ const RwChar *appName;
+ RwInt32 width;
+ RwInt32 height;
+ RwInt32 maximumWidth;
+ RwInt32 maximumHeight;
+ RwInt32 maxFPS;
+ RwBool quit;
+
+ void *ps; /* platform specific data */
+
+ RsInputDevice keyboard;
+ RsInputDevice mouse;
+ RsInputDevice pad;
+};
+
+enum RsKeyCodes
+{
+ rsESC = 1000,
+
+ rsF1 = 1001,
+ rsF2 = 1002,
+ rsF3 = 1003,
+ rsF4 = 1004,
+ rsF5 = 1005,
+ rsF6 = 1006,
+ rsF7 = 1007,
+ rsF8 = 1008,
+ rsF9 = 1009,
+ rsF10 = 1010,
+ rsF11 = 1011,
+ rsF12 = 1012,
+
+ rsINS = 1013,
+ rsDEL = 1014,
+ rsHOME = 1015,
+ rsEND = 1016,
+ rsPGUP = 1017,
+ rsPGDN = 1018,
+
+ rsUP = 1019,
+ rsDOWN = 1020,
+ rsLEFT = 1021,
+ rsRIGHT = 1022,
+
+ rsDIVIDE = 1023,
+ rsTIMES = 1024,
+ rsPLUS = 1025,
+ rsMINUS = 1026,
+ rsPADDEL = 1027,
+ rsPADEND = 1028,
+ rsPADDOWN = 1029,
+ rsPADPGDN = 1030,
+ rsPADLEFT = 1031,
+ rsPAD5 = 1032,
+ rsNUMLOCK = 1033,
+ rsPADRIGHT = 1034,
+ rsPADHOME = 1035,
+ rsPADUP = 1036,
+ rsPADPGUP = 1037,
+ rsPADINS = 1038,
+ rsPADENTER = 1039,
+
+ rsSCROLL = 1040,
+ rsPAUSE = 1041,
+
+ rsBACKSP = 1042,
+ rsTAB = 1043,
+ rsCAPSLK = 1044,
+ rsENTER = 1045,
+ rsLSHIFT = 1046,
+ rsRSHIFT = 1047,
+ rsSHIFT = 1048,
+ rsLCTRL = 1049,
+ rsRCTRL = 1050,
+ rsLALT = 1051,
+ rsRALT = 1052,
+ rsLWIN = 1053,
+ rsRWIN = 1054,
+ rsAPPS = 1055,
+
+ rsNULL = 1056,
+};
+typedef enum RsKeyCodes RsKeyCodes;
+
+typedef struct RsKeyStatus RsKeyStatus;
+struct RsKeyStatus
+{
+ RwInt32 keyCharCode;
+};
+
+typedef struct RsPadButtonStatus RsPadButtonStatus;
+struct RsPadButtonStatus
+{
+ RwInt32 padID;
+ RwUInt32 padButtons;
+};
+
+enum RsPadButtons
+{
+ rsPADNULL = 0,
+
+ rsPADBUTTON1 = 1,
+ rsPADBUTTON2 = 2,
+ rsPADBUTTON3 = 3,
+ rsPADBUTTON4 = 4,
+
+ rsPADBUTTON5 = 5,
+ rsPADBUTTON6 = 6,
+ rsPADBUTTON7 = 7,
+ rsPADBUTTON8 = 8,
+
+ rsPADSELECT = 9,
+
+ rsPADBUTTONA1 = 10,
+ rsPADBUTTONA2 = 11,
+
+ rsPADSTART = 12,
+
+ rsPADDPADUP = 13,
+ rsPADDPADRIGHT = 14,
+ rsPADDPADDOWN = 15,
+ rsPADDPADLEFT = 16,
+};
+typedef enum RsPadButtons RsPadButtons;
+
+
+extern RsGlobalType &RsGlobal;
+
+extern RsEventStatus AppEventHandler(RsEvent event, void *param);
+extern RwBool AttachInputDevices(void);
+
+extern RsEventStatus RsEventHandler(RsEvent event, void *param);
+extern RsEventStatus RsKeyboardEventHandler(RsEvent event, void *param);
+extern RsEventStatus RsPadEventHandler(RsEvent event, void *param);
+
+extern RwBool
+RsInitialise(void);
+
+extern RwBool
+RsRegisterImageLoader(void);
+
+extern RwBool
+RsRwInitialise(void *param);
+
+extern RwBool
+RsSelectDevice(void);
+
+extern RwBool
+RsInputDeviceAttach(RsInputDeviceType inputDevice,
+ RsInputEventHandler inputEventHandler);
+
+extern RwUInt32
+RsTimer(void);
+
+extern void
+RsCameraShowRaster(RwCamera *camera);
+
+extern RwBool
+RsCameraBeginUpdate(RwCamera *camera);
+
+//TODO
+//extern void
+//RsMouseSetVisibility(RwBool visible);
+
+extern void
+RsMouseSetPos(RwV2d *pos);
+
+extern void
+RsRwTerminate(void);
+
+extern void
+RsTerminate(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SKELETON_H */