2022-06-26 18:17:11 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-11-19 23:28:20 -05:00
|
|
|
#include <optional>
|
|
|
|
|
2022-09-16 20:42:33 -04:00
|
|
|
#include "common/common_types.h"
|
2023-06-25 16:51:46 -04:00
|
|
|
#include "common/sqlite/sqlite.h"
|
2022-11-19 23:28:20 -05:00
|
|
|
|
2022-06-26 18:17:11 -04:00
|
|
|
namespace jak2 {
|
|
|
|
void InitParms(int argc, const char* const* argv);
|
|
|
|
void InitIOP();
|
|
|
|
int InitMachine();
|
|
|
|
int ShutdownMachine();
|
|
|
|
void InitMachineScheme();
|
|
|
|
|
2023-06-25 16:51:46 -04:00
|
|
|
extern sqlite::SQLiteDatabase sql_db;
|
2022-11-19 23:28:20 -05:00
|
|
|
void initialize_sql_db();
|
2023-06-25 16:51:46 -04:00
|
|
|
sqlite::GenericResponse run_sql_query(const std::string& query);
|
2022-11-19 23:28:20 -05:00
|
|
|
|
2022-09-16 20:42:33 -04:00
|
|
|
struct MouseInfo {
|
|
|
|
// ((active symbol :offset-assert 4)
|
|
|
|
u32 active;
|
|
|
|
// (cursor basic :offset-assert 8)
|
|
|
|
u32 cursor;
|
|
|
|
// (valid symbol :offset-assert 12)
|
|
|
|
u32 valid;
|
|
|
|
// (id uint8 :offset-assert 16)
|
|
|
|
u8 id;
|
|
|
|
u8 pad;
|
|
|
|
// (status uint16 :offset-assert 18)
|
|
|
|
u16 status;
|
|
|
|
// (button0 uint16 :offset-assert 20)
|
|
|
|
u16 button0;
|
|
|
|
// (deltax int8 :offset-assert 22)
|
|
|
|
s8 deltax;
|
|
|
|
// (deltay int8 :offset-assert 23)
|
|
|
|
s8 deltay;
|
|
|
|
// (wheel uint8 :offset-assert 24)
|
|
|
|
u8 wheel;
|
2022-11-19 23:28:20 -05:00
|
|
|
u8 pad1[3];
|
2022-09-16 20:42:33 -04:00
|
|
|
// (change-time time-frame :offset-assert 32)
|
|
|
|
// (button0-abs uint32 3 :offset-assert 40)
|
|
|
|
// (button0-shadow-abs uint32 1 :offset-assert 52)
|
|
|
|
// (button0-rel uint32 3 :offset-assert 56)
|
|
|
|
// (pos vector 2 :inline :offset-assert 80)
|
2022-11-19 23:28:20 -05:00
|
|
|
u32 pad2[13];
|
2022-09-16 20:42:33 -04:00
|
|
|
// (posx float :offset 80)
|
2022-11-19 23:28:20 -05:00
|
|
|
float posx;
|
2022-09-16 20:42:33 -04:00
|
|
|
// (posy float :offset 84)
|
2022-11-19 23:28:20 -05:00
|
|
|
float posy;
|
2022-09-16 20:42:33 -04:00
|
|
|
// (oldposx float :offset 96 :do-not-decompile)
|
|
|
|
// (oldposy float :offset 100)
|
|
|
|
// (speedx float :offset 92)
|
|
|
|
// (speedy float :offset 108)
|
|
|
|
};
|
2023-01-07 10:34:01 -05:00
|
|
|
|
2023-06-17 00:16:40 -04:00
|
|
|
enum class FocusStatus : u32 {
|
|
|
|
Disable = 0,
|
|
|
|
Dead = 1,
|
|
|
|
Ignore = 2,
|
|
|
|
Inactive = 3,
|
|
|
|
Dangerous = 4,
|
|
|
|
InAir = 5,
|
|
|
|
Hit = 6,
|
|
|
|
Grabbed = 7,
|
|
|
|
InHead = 8,
|
|
|
|
TouchWater = 9,
|
|
|
|
OnWater = 10,
|
|
|
|
UnderWater = 11,
|
|
|
|
EdgeGrab = 12,
|
|
|
|
Pole = 13,
|
|
|
|
PilotRiding = 14,
|
|
|
|
Flut = 15,
|
|
|
|
Tube = 16,
|
|
|
|
Ice = 17,
|
|
|
|
Board = 18,
|
|
|
|
Gun = 19,
|
|
|
|
Pilot = 20,
|
|
|
|
Mech = 21,
|
|
|
|
Dark = 22,
|
|
|
|
Rail = 23,
|
|
|
|
Halfpipe = 24,
|
|
|
|
Carry = 25,
|
|
|
|
Super = 26,
|
|
|
|
Shooting = 27,
|
|
|
|
Indax = 28,
|
|
|
|
Arrestable = 29,
|
|
|
|
Teleporting = 30,
|
|
|
|
FS31 = 31,
|
|
|
|
Max = 32
|
|
|
|
};
|
|
|
|
|
|
|
|
#define FOCUS_TEST(status, foc) (status.test(static_cast<size_t>(foc)))
|
|
|
|
|
2023-01-07 10:34:01 -05:00
|
|
|
struct DiscordInfo {
|
2023-06-17 00:16:40 -04:00
|
|
|
float orb_count; // float
|
|
|
|
float gem_count; // float
|
|
|
|
u32 death_count; // int32
|
2023-01-07 10:34:01 -05:00
|
|
|
u32 status; // string
|
|
|
|
u32 level; // string
|
|
|
|
u32 cutscene; // symbol - bool
|
2023-06-17 00:16:40 -04:00
|
|
|
float time_of_day; // float
|
2023-01-07 10:34:01 -05:00
|
|
|
float percent_completed; // float
|
2023-06-17 00:16:40 -04:00
|
|
|
u32 focus_status; // uint32
|
|
|
|
u32 task; // string
|
2023-01-07 10:34:01 -05:00
|
|
|
};
|
2023-04-30 17:38:05 -04:00
|
|
|
// To speedup finding the auto-splitter block in GOAL memory
|
|
|
|
// all this has is a marker for LiveSplit to find, and then the pointer
|
|
|
|
// to the symbol
|
|
|
|
struct AutoSplitterBlock {
|
|
|
|
const char marker[20] = "UnLiStEdStRaTs_JaK2";
|
|
|
|
u64 pointer_to_symbol = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern AutoSplitterBlock gAutoSplitterBlock;
|
2023-01-07 10:34:01 -05:00
|
|
|
|
2022-11-19 23:28:20 -05:00
|
|
|
} // namespace jak2
|