feat(profile): more hardware detection

This commit is contained in:
phaneron 2024-12-20 15:12:31 -05:00
parent 0fa8d70e2c
commit 1e6fb307de
16 changed files with 26811 additions and 33 deletions

View file

@ -4,23 +4,41 @@
DECLARE_ENUM(CMDOPT);
enum CMDOPT {
CMD_D3D = 0,
CMD_D3D9EX = 1,
CMD_DATA_DIR = 2,
CMD_NO_LAG_FIX = 3,
CMD_LOADFILE = 4,
CMD_GAMETYPE = 5,
CMD_OPENGL = 6,
CMD_SW_TNL = 7,
CMD_TIMEDEMO = 8,
CMD_DEMOREZ = 9,
CMD_DEMODEPTH = 10,
CMD_DEMODETAIL = 11,
CMD_DEMOSOUND = 12,
CMD_FULL_SCREEN = 13,
CMD_22050HZ = 14,
CMD_NO_WARNINGS = 15,
CMDOPTS = 16
CMD_D3D = 0,
CMD_D3D9EX = 1,
CMD_DATA_DIR = 2,
CMD_NO_LAG_FIX = 3,
CMD_LOADFILE = 4,
CMD_GAMETYPE = 5,
CMD_OPENGL = 6,
CMD_SW_TNL = 7,
CMD_TIMEDEMO = 8,
CMD_DEMOREZ = 9,
CMD_DEMODEPTH = 10,
CMD_DEMODETAIL = 11,
CMD_DEMOSOUND = 12,
CMD_FULL_SCREEN = 13,
CMD_22050HZ = 14,
CMD_NO_WARNINGS = 15,
// CMDOPTS = 16,
// NOTE: these extensions are NOT canonically part of the CMDOPT enum, but may be USED as CMDOPT values.
CMD_RES_800x600 = 16,
CMD_RES_1024x768 = 17,
CMD_RES_1280x960 = 18,
CMD_RES_1280x1024 = 19,
CMD_RES_1600x1200 = 20,
CMD_UP_TO_DATE = 21,
CMD_16_BIT = 22,
CMD_NO_FIX_LAG = 24,
CMD_NO_SOUND = 26,
CMD_SOUND_CHAOS = 27,
CMD_DEPTH_16 = 29,
CMD_DEPTH_24 = 30,
CMD_DEPTH_32 = 31,
CMD_WINDOWED = 32,
CMD_CONSOLE = 35,
CMD_HW_DETECT = 36,
CMD_GX_OVERRIDE = 39
};
#endif

View file

@ -0,0 +1,31 @@
#ifndef CONSOLE_DEFAULT_SETTINGS_H
#define CONSOLE_DEFAULT_SETTINGS_H
DECLARE_STRUCT(DefaultSettings);
#include "gx/format.h"
struct DefaultSettings {
float farClip;
// float terrainLODDist;
uint32_t terrainShadowLOD;
uint32_t detailDoodadDensity;
uint32_t detailDoodadAlpha;
bool animatingDoodads;
bool trilinear;
uint32_t numLights;
bool specularity;
bool unk19;
bool unk1A;
uint32_t waterLOD;
float particleDensity;
float unitDrawDist;
float smallCull;
float distCull;
CGxFormat* format;
uint32_t baseMipLevel;
uint32_t numChannels;
bool fivePointOne;
};
#endif

View file

@ -0,0 +1,46 @@
#ifndef CONSOLE_HARDWARE_H
#define CONSOLE_HARDWARE_H
#include "db/records.h"
DECLARE_STRUCT(CpuHardware);
DECLARE_STRUCT(SoundHardware);
DECLARE_STRUCT(Hardware__Device);
DECLARE_STRUCT(Hardware);
struct CpuHardware {
uint32_t farclipIdx;
uint32_t animatingDoodadIdx;
uint32_t waterLODIdx;
uint32_t particleDensityIdx;
uint32_t smallCullDistIdx;
uint32_t unitDrawDistIdx;
};
// struct __declspec(align(4)) SoundHardware
struct SoundHardware {
uint32_t numChannels;
bool fivePointOne;
};
// struct Hardware::Device
struct Hardware__Device {
uint16_t vendorID;
uint16_t deviceID;
uint32_t driverVersionHi;
uint32_t driverVersionLo;
};
struct Hardware {
Hardware__Device videoDevice;
Hardware__Device soundDevice;
uint32_t cpuIdx;
uint32_t videoIdx;
uint32_t soundIdx;
uint32_t memIdx;
VideoHardwareRec* videoHw;
CpuHardware* cpuHw;
SoundHardware* soundHw;
};
#endif

View file

@ -1351,7 +1351,7 @@ struct ItemRandomPropertiesRec {
int32_t m_ID;
const char* m_name;
int32_t m_enchantment[5];
const char* m_name;
const char* m_name_lang;
};
struct ItemRandomSuffixRec {
@ -4214,7 +4214,7 @@ struct ItemRandomPropertiesRec {
int32_t m_ID;
const char* m_name;
int32_t m_enchantment[5];
const char* m_name;
const char* m_name_lang;
};
struct ItemRandomSuffixRec {

View file

@ -0,0 +1,16 @@
#ifndef GX_MONITOR_MODE_H
#define GX_MONITOR_MODE_H
DECLARE_STRUCT(CGxMonitorMode);
#include "tempest/vector.h"
#include "storm/array.h"
struct CGxMonitorMode {
C2iVector size;
uint32_t bpp;
uint32_t refreshRate;
};
STORM_TS_GROWABLE_ARRAY(CGxMonitorMode);
#endif

View file

@ -30,6 +30,8 @@
#include "common/refcount.h"
#include "common/rcstring.h"
#include "console/hardware.h"
#include "console/default_settings.h"
#include "console/command.h"
#include "console/line.h"
#include "console/var.h"
@ -54,6 +56,7 @@
#include "gx/device.h"
#include "gx/format.h"
#include "gx/matrix_stack.h"
#include "gx/monitor_mode.h"
#include "gx/opengl.h"
#include "gx/shader.h"
#include "gx/state_bom.h"