Curation round 1: 66 boot-path functions rewritten in src/; the game links into a Linux executable
Six agents took over ANM2/AnimationState/LayerState, ItemConfig, EntityConfig, StringTable/Font/FormattedText/RichText, OptionsConfig/ChallengeParams and ModManager/ModEntry functions (FormattedText::parse checked against a transliteration of its assembly on 200,000 random inputs). 174 field rows and 32 names from the round are merged into db/. source_tree.py: a struct or class src/*.h defines is no longer emitted in classes.h (class takeover) and gets no stubs; data labels get stub definitions. build/isaac links (64-bit ELF) and stops at the first function not reconstructed: IsaacMain. Boot path 64/615 functions curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c31c98a81
commit
837aa06518
63 files changed
+10557
-12054
No files matched your search
@@ -0,0 +1,149 @@
|
||||
#include "classes.h"
|
||||
#include "options_config.h"
|
||||
#include <string_view>
|
||||
|
||||
constexpr float DEFAULT_VOLUME = 0.3f;
|
||||
constexpr float DEFAULT_MAP_OPACITY = 0.3f;
|
||||
constexpr int DEFAULT_ONLINE_PLAYER_VOLUME = 6;
|
||||
constexpr int DEFAULT_ONLINE_PLAYER_OPACITY = 10;
|
||||
constexpr int DEFAULT_ONLINE_INPUT_DELAY = 3;
|
||||
constexpr int DEFAULT_MAX_SCALE = 99;
|
||||
constexpr int DEFAULT_MAX_RENDER_SCALE = 2;
|
||||
constexpr int DEFAULT_WINDOW_X = 8;
|
||||
constexpr int DEFAULT_WINDOW_Y = 32;
|
||||
// An MSVC string keeps up to 15 characters in its own buffer, and a pointer to the heap there past that.
|
||||
constexpr uint32_t STRING_INLINE_CAPACITY = 15;
|
||||
|
||||
// A node of the MSVC std::map<std::string, std::string> an .ini file is parsed into.
|
||||
struct StringMapNode
|
||||
{
|
||||
StringMapNode* left;
|
||||
StringMapNode* parent;
|
||||
StringMapNode* right;
|
||||
char color;
|
||||
bool isNil;
|
||||
alignas(void*) std_string key;
|
||||
std_string value;
|
||||
};
|
||||
LAYOUT32(offsetof(StringMapNode, value) == 0x28 && sizeof(StringMapNode) == 0x40);
|
||||
|
||||
static char* string_text(std_string& text)
|
||||
{
|
||||
return text._capacity <= STRING_INLINE_CAPACITY ? text._buf : *(char**)text._buf;
|
||||
}
|
||||
|
||||
static std::string_view string_view_get(std_string& text)
|
||||
{
|
||||
return {string_text(text), text._size};
|
||||
}
|
||||
|
||||
// The value stored under key, or null when the map has none.
|
||||
static std_string* keyvalue_find(std_map* map, std::string_view key)
|
||||
{
|
||||
auto head = (StringMapNode*)map->_head;
|
||||
StringMapNode* bound = head;
|
||||
|
||||
for (StringMapNode* node = head->parent; !node->isNil;)
|
||||
{
|
||||
if (string_view_get(node->key) < key) node = node->right;
|
||||
else
|
||||
{
|
||||
bound = node;
|
||||
node = node->left;
|
||||
}
|
||||
}
|
||||
|
||||
bool isFound = !bound->isNil && !(key < string_view_get(bound->key));
|
||||
return isFound ? &bound->value : nullptr;
|
||||
}
|
||||
|
||||
// 006841d0 A key's value as a bool, true for "true", "True" or a nonzero number, and the default when missing or empty.
|
||||
// Its this is not an OptionsConfig but the key-value map an .ini file was parsed into.
|
||||
uint8_t OptionsConfig::read_bool(uint8_t* key, uint8_t isDefault)
|
||||
{
|
||||
std_string* value = keyvalue_find((std_map*)this, (char*)key);
|
||||
if (!value || value->_size == 0) return isDefault;
|
||||
|
||||
char* text = string_text(*value);
|
||||
return !strcmp(text, "true") || !strcmp(text, "True") || atoi(text) != 0;
|
||||
}
|
||||
|
||||
// 00924000 Puts every option options.ini holds back to its default, the window at the size it has now.
|
||||
void OptionsConfig::reset_defaults()
|
||||
{
|
||||
int windowSize[2];
|
||||
|
||||
_musicVolume = DEFAULT_VOLUME;
|
||||
_sfxVolume = DEFAULT_VOLUME;
|
||||
_mapOpacity = DEFAULT_MAP_OPACITY;
|
||||
_brightness = 0;
|
||||
_contrast = 1;
|
||||
_exposure = 1;
|
||||
_gamma = 1;
|
||||
_hudOffset = 1;
|
||||
|
||||
_announcerVoiceMode = ANNOUNCER_VOICE_MODE_RANDOM;
|
||||
_cameraStyle = CAMERA_STYLE_ACTIVE_CAM_ON;
|
||||
_consoleFont = CONSOLE_FONT_DEFAULT;
|
||||
_eosCrossplay = 0;
|
||||
_historyHudMode = EXTRA_HUD_STYLE_OFF;
|
||||
_onlineColorSet = 0;
|
||||
_onlineHud = 0;
|
||||
_onlineInputDelay = DEFAULT_ONLINE_INPUT_DELAY;
|
||||
_onlinePlayerOpacity = DEFAULT_ONLINE_PLAYER_OPACITY;
|
||||
_onlinePlayerVolume = DEFAULT_ONLINE_PLAYER_VOLUME;
|
||||
_popupsMode = 1;
|
||||
_touchMode = 1;
|
||||
|
||||
_acceptedDataCollectionDisclaimer = false;
|
||||
_acceptedPublicBeta_VERSION = false;
|
||||
_ascentVoiceover = true;
|
||||
_bossHpOnBottom = true;
|
||||
_controlHotplugEnabled = true;
|
||||
_enableAimLock = true;
|
||||
_enableBulletVisibility = false;
|
||||
_enableChargeBars = false;
|
||||
_enableDebugConsole = false;
|
||||
_enableEpicOverlay = true;
|
||||
_enableFadedConsoleDisplay = false;
|
||||
_enableFoundHUD = false;
|
||||
_enableMods = true;
|
||||
_enableMouseControl = false;
|
||||
_enablePauseOnFocusLost = true;
|
||||
_enableRumble = true;
|
||||
_enableSaveCommandHistory = true;
|
||||
_enableSteamCloud = true;
|
||||
_enableVSync = true;
|
||||
_filterEnabled = false;
|
||||
_isExclusiveFullscreen = false;
|
||||
_isFullscreen = false;
|
||||
_itemInfoDisplayEnabled = false;
|
||||
_onlineChatEnabled = true;
|
||||
_onlineFilterEnabled = true;
|
||||
_streamerMode = false;
|
||||
_tryImportSave = false;
|
||||
|
||||
glfw_get_window_size(windowSize, 0);
|
||||
_maxRenderScale = DEFAULT_MAX_RENDER_SCALE;
|
||||
_maxScale = DEFAULT_MAX_SCALE;
|
||||
_windowHeight = windowSize[1];
|
||||
_windowPosX = DEFAULT_WINDOW_X;
|
||||
_windowPosY = DEFAULT_WINDOW_Y;
|
||||
_windowWidth = windowSize[0];
|
||||
|
||||
_optionsIniFilePath._size = 0;
|
||||
string_text(_optionsIniFilePath)[0] = '\0';
|
||||
}
|
||||
|
||||
// 00925c60 Switches fullscreen on or off, going back to the saved window size, position and cursor when off.
|
||||
void OptionsConfig::set_fullscreen(uint8_t isFullscreen)
|
||||
{
|
||||
_isFullscreen = isFullscreen;
|
||||
KAGE_Graphics::set_fullscreen(isFullscreen, _isExclusiveFullscreen);
|
||||
if (_isFullscreen) return;
|
||||
|
||||
int windowSize[] = {_windowWidth, _windowHeight};
|
||||
KAGE_Graphics::set_window_size(windowSize);
|
||||
glfw_set_window_pos(_windowPosX, _windowPosY);
|
||||
glfwSetInputMode(g_glfwWindow, _enableMouseControl ? GLFW_CURSOR_HIDDEN : GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
Reference in new issue
Block a user