This commit is contained in:
2024-09-25 02:19:37 +08:00
parent a2bfc78e8d
commit 47d35aa3a2
95 changed files with 1208 additions and 288 deletions

View File

@@ -99,4 +99,8 @@ template <typename T0> inline constexpr uint16_t SUB42(T0 a, size_t b) {
return cc_type_t(a) >> (b * 8);
}
constexpr byte R3ModId_not_initialized = 0xff;
#include "stubexcept.h"
#endif /* B8D59B54_1674_4C0F_AA2C_611385FF5D03 */

View File

@@ -36,12 +36,4 @@ typedef void *pointer;
typedef char *TerminatedCString;
typedef char *string;
// Can not export enums for some reason
enum R3ModuleId : uint8_t {
R3ModId_unk = 0x00,
R3ModId_not_initialized = 0xff,
};
#endif /* A523F6DB_0645_4DEB_8AEB_3792CB732B49 */

View File

@@ -0,0 +1,10 @@
#ifndef AE625BF8_B0F9_452E_8772_8819F311CB57
#define AE625BF8_B0F9_452E_8772_8819F311CB57
#include <stdexcept>
struct GHStubException : public std::exception {
GHStubException(const char *msg);
};
#endif /* AE625BF8_B0F9_452E_8772_8819F311CB57 */

View File

@@ -5,24 +5,52 @@
#include <gh_global.h>
struct R3Config {
std::string gameDataDir;
std::string gfxAdapter;
std::string gfxIdentifier;
std::string gfxGliMode;
// The root directory of the game, containing the executable
std::string gameRootDir;
// Language code of the game "English", etc.
std::string language;
// The adapter to use
int gfxAdapter{};
// The UUID of the device to use
std::string gfxIdentifier;
// Game default is "1 - 640 x 480 x 16"
// first digit 1 is fullscreen, 0 is windowed
// second digit is width
// third digit is height
// fourth digit is bpp
std::string gfxGliMode;
// Any of:
// Agp8
// Agp4
// Vram8
// Vram4
// Vram+
// Vram
std::string gfxTexturesMem;
bool gfxTexturesCompressed{};
bool gfxTnl{};
bool gfxTrilinear{};
int cameraHorizontalAxis = 2;
int cameraVerticalAxis = 5;
std::string gameDataBinPath;
};
inline R3Config createDefaultConfig() {
R3Config config{};
#ifdef R3_GAME_DATA_DIR
config.gameDataDir = R3_GAME_DATA_DIR;
config.gameRootDir = R3_GAME_DATA_DIR;
#endif
// Windowed 720p
config.gfxGliMode = "0 - 1200 x 720 - 16";
config.gfxAdapter = "D3D";
config.gfxGliMode = "0 - 1200 x 720 x 16";
config.gfxAdapter = 0;
config.gfxIdentifier = "00000000-0000-0000-0000-000000000000";
config.language = s_English_005b684c;
config.gfxTexturesMem = "Vram+";
config.gfxTrilinear = true;
config.gfxTnl = true;
config.gfxTexturesCompressed = false;
config.gameDataBinPath = "Gamedatabin";
return config;
}

4
game_re/r3/gfx.hpp Normal file
View File

@@ -0,0 +1,4 @@
#ifndef E50D740C_6BA6_42B1_83FF_2D235ADFA276
#define E50D740C_6BA6_42B1_83FF_2D235ADFA276
#endif /* E50D740C_6BA6_42B1_83FF_2D235ADFA276 */

View File

@@ -3,10 +3,18 @@
#include <stdexcept>
#include <stdio.h>
#include <r3/binders/static_mem.h>
#include <r3/binders/stubexcept.h>
// Error reporting and such
extern "C" void r3_noop(void*, void*) {}
extern "C" int r3_main(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR *cmdline, int showCmd);
GHStubException::GHStubException(const char *msg) : std::exception(msg) {
SPDLOG_ERROR("{}", msg);
}
int main(int argc, char **argv) {
try {
gh_init_data_segment();