You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Move controls lists + some renames
This commit is contained in:
@@ -347,6 +347,7 @@
|
||||
#define COLOR_RGBA32_CRASH_DISASM_IMMEDIATE COLOR_RGBA32_LIGHT_GREEN
|
||||
// Settings:
|
||||
#define COLOR_RGBA32_CRASH_SETTINGS_DESCRIPTION COLOR_RGBA32_VERY_LIGHT_GRAY
|
||||
#define COLOR_RGBA32_CRASH_SETTINGS_DISABLED COLOR_RGBA32_GRAY
|
||||
#define COLOR_RGBA32_CRASH_SETTINGS_NAMED COLOR_RGBA32_VSC_ENUM
|
||||
#define COLOR_RGBA32_CRASH_SETTINGS_NUMERIC COLOR_RGBA32_VSC_NUMBER
|
||||
// Unused:
|
||||
|
||||
@@ -62,7 +62,7 @@ struct CSSettingsEntry gCSSettings[NUM_CS_OPTS] = { //! TODO: Callback functions
|
||||
#endif
|
||||
[CS_OPT_CONTEXT_FLOATS_FMT ] = { .name = "Floats print format", .valNames = &sValNames_print_num_fmt, .val = PRINT_NUM_FMT_DEC, .defaultVal = PRINT_NUM_FMT_DEC, .lowerBound = PRINT_NUM_FMT_HEX, .upperBound = PRINT_NUM_FMT_SCI, },
|
||||
[CS_OPT_HEADER_PAGE_MEMORY ] = { .name = "RAM VIEW", .valNames = &sIsSettingHeader, .val = TRUE, .defaultVal = TRUE, .lowerBound = FALSE, .upperBound = TRUE, },
|
||||
[CS_OPT_MEMORY_AS_ASCII ] = { .name = "Show data as ascii", .valNames = &sValNames_bool, .val = TRUE, .defaultVal = TRUE, .lowerBound = FALSE, .upperBound = TRUE, },
|
||||
[CS_OPT_MEMORY_AS_ASCII ] = { .name = "Show data as ascii", .valNames = &sValNames_bool, .val = FALSE, .defaultVal = FALSE, .lowerBound = FALSE, .upperBound = TRUE, },
|
||||
[CS_OPT_HEADER_PAGE_DISASM ] = { .name = "DISASM", .valNames = &sIsSettingHeader, .val = TRUE, .defaultVal = TRUE, .lowerBound = FALSE, .upperBound = TRUE, },
|
||||
[CS_OPT_DISASM_BINARY ] = { .name = "Unknown as binary", .valNames = &sValNames_bool, .val = FALSE, .defaultVal = FALSE, .lowerBound = FALSE, .upperBound = TRUE, },
|
||||
[CS_OPT_DISASM_PSEUDOINSNS ] = { .name = "Pseudoinstructions", .valNames = &sValNames_bool, .val = TRUE, .defaultVal = TRUE, .lowerBound = FALSE, .upperBound = TRUE, },
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
#include "page_assert.h"
|
||||
|
||||
|
||||
static u32 sAssertScrollIndex = 0;
|
||||
static size_t sAssertPrintSize = 0;
|
||||
|
||||
|
||||
const enum ControlTypes assertsContList[] = {
|
||||
CONT_DESC_SWITCH_PAGE,
|
||||
CONT_DESC_SHOW_CONTROLS,
|
||||
@@ -27,6 +23,10 @@ const enum ControlTypes assertsContList[] = {
|
||||
};
|
||||
|
||||
|
||||
static u32 sAssertScrollIndex = 0;
|
||||
static size_t sAssertPrintSize = 0;
|
||||
|
||||
|
||||
void assert_init(void) {
|
||||
sAssertScrollIndex = 0;
|
||||
sAssertPrintSize = 0;
|
||||
|
||||
@@ -18,6 +18,19 @@
|
||||
#include "page_disasm.h"
|
||||
|
||||
|
||||
const enum ControlTypes disasmContList[] = {
|
||||
CONT_DESC_SWITCH_PAGE,
|
||||
CONT_DESC_SHOW_CONTROLS,
|
||||
CONT_DESC_CYCLE_DRAW,
|
||||
CONT_DESC_CURSOR_VERTICAL,
|
||||
CONT_DESC_JUMP_TO_ADDRESS,
|
||||
#ifdef INCLUDE_DEBUG_MAP
|
||||
CONT_DESC_TOGGLE_FUNCTIONS,
|
||||
#endif
|
||||
CONT_DESC_LIST_END,
|
||||
};
|
||||
|
||||
|
||||
static u32 sDisasmViewportIndex = 0x00000000;
|
||||
static u32 sDisasmBranchStartX = 0; // The X position where branch arrows start.
|
||||
|
||||
@@ -343,18 +356,6 @@ void disasm_draw(void) {
|
||||
osWritebackDCacheAll();
|
||||
}
|
||||
|
||||
const enum ControlTypes disasmContList[] = {
|
||||
CONT_DESC_SWITCH_PAGE,
|
||||
CONT_DESC_SHOW_CONTROLS,
|
||||
CONT_DESC_CYCLE_DRAW,
|
||||
CONT_DESC_CURSOR_VERTICAL,
|
||||
CONT_DESC_JUMP_TO_ADDRESS,
|
||||
#ifdef INCLUDE_DEBUG_MAP
|
||||
CONT_DESC_TOGGLE_FUNCTIONS,
|
||||
#endif
|
||||
CONT_DESC_LIST_END,
|
||||
};
|
||||
|
||||
void disasm_input(void) {
|
||||
#ifdef INCLUDE_DEBUG_MAP
|
||||
Address oldPos = gSelectedAddress;
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
#include "page_map.h"
|
||||
|
||||
|
||||
u32 sMapViewerSelectedIndex = 0;
|
||||
static u32 sMapViewerViewportIndex = 0;
|
||||
|
||||
|
||||
const enum ControlTypes mapViewerContList[] = {
|
||||
CONT_DESC_SWITCH_PAGE,
|
||||
CONT_DESC_SHOW_CONTROLS,
|
||||
@@ -29,6 +25,10 @@ const enum ControlTypes mapViewerContList[] = {
|
||||
};
|
||||
|
||||
|
||||
u32 sMapViewerSelectedIndex = 0;
|
||||
static u32 sMapViewerViewportIndex = 0;
|
||||
|
||||
|
||||
void map_view_init(void) {
|
||||
s32 newIndex = get_symbol_index_from_addr_backward(gSelectedAddress);
|
||||
sMapViewerSelectedIndex = (newIndex != -1) ? newIndex : 0;
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
#include "page_memory.h"
|
||||
|
||||
|
||||
static Address sRamViewViewportIndex = 0x00000000;
|
||||
|
||||
|
||||
const enum ControlTypes ramViewerContList[] = {
|
||||
CONT_DESC_SWITCH_PAGE,
|
||||
CONT_DESC_SHOW_CONTROLS,
|
||||
@@ -28,6 +25,8 @@ const enum ControlTypes ramViewerContList[] = {
|
||||
};
|
||||
|
||||
|
||||
static Address sRamViewViewportIndex = 0x00000000;
|
||||
|
||||
static const char gHex[0x10] = "0123456789ABCDEF";
|
||||
|
||||
|
||||
|
||||
@@ -13,11 +13,6 @@
|
||||
#include "page_settings.h"
|
||||
|
||||
|
||||
u32 sSettingsSelectedIndex = 0;
|
||||
static u32 sSettingsViewportIndex = 0;
|
||||
static u32 sSettngsTotalShownAmount = NUM_CS_OPTS;
|
||||
|
||||
|
||||
const enum ControlTypes settingsContList[] = {
|
||||
CONT_DESC_SWITCH_PAGE,
|
||||
CONT_DESC_SHOW_CONTROLS,
|
||||
@@ -28,32 +23,33 @@ const enum ControlTypes settingsContList[] = {
|
||||
CONT_DESC_LIST_END,
|
||||
};
|
||||
|
||||
extern const char* sIsSettingHeader[];
|
||||
|
||||
enum CSSettings gCSDisplayedSettings[NUM_CS_OPTS];
|
||||
u32 sSettingsSelectedIndex = 0;
|
||||
static u32 sSettingsViewportIndex = 0;
|
||||
static u32 sSettngsTotalShownAmount = NUM_CS_OPTS;
|
||||
|
||||
enum CSSettings gCSDisplayedSettingIDs[NUM_CS_OPTS];
|
||||
|
||||
|
||||
void update_displayed_settings(void) {
|
||||
bzero(&gCSDisplayedSettings, sizeof(gCSDisplayedSettings));
|
||||
bzero(&gCSDisplayedSettingIDs, sizeof(gCSDisplayedSettingIDs));
|
||||
|
||||
int dstSettingIndex = 0;
|
||||
_Bool shownSection = TRUE;
|
||||
_Bool sectionShown = TRUE;
|
||||
|
||||
for (int srcSettingIndex = 0; srcSettingIndex < NUM_CS_OPTS; srcSettingIndex++) {
|
||||
const struct CSSettingsEntry* srcSetting = &gCSSettings[srcSettingIndex];
|
||||
|
||||
_Bool show = shownSection;
|
||||
_Bool show = sectionShown;
|
||||
|
||||
// Header entry:
|
||||
if (crash_screen_setting_is_header(srcSettingIndex)) {
|
||||
// Set whether the next section is shown:
|
||||
shownSection = srcSetting->val;
|
||||
sectionShown = gCSSettings[srcSettingIndex].val;
|
||||
show = TRUE;
|
||||
}
|
||||
|
||||
// If section is not collapsed:
|
||||
if (show) {
|
||||
gCSDisplayedSettings[dstSettingIndex] = srcSettingIndex;
|
||||
gCSDisplayedSettingIDs[dstSettingIndex] = srcSettingIndex;
|
||||
dstSettingIndex++;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +72,7 @@ void print_settings_list(u32 line, u32 numLines) {
|
||||
|
||||
// Print
|
||||
for (u32 i = 0; i < numLines; i++) {
|
||||
u32 currIndex = gCSDisplayedSettings[currViewIndex];
|
||||
u32 currIndex = gCSDisplayedSettingIDs[currViewIndex];
|
||||
const struct CSSettingsEntry* setting = &gCSSettings[currIndex];
|
||||
|
||||
if (currViewIndex >= sSettngsTotalShownAmount) {
|
||||
@@ -109,7 +105,7 @@ void print_settings_list(u32 line, u32 numLines) {
|
||||
crash_screen_print(
|
||||
centeredDefaultsStartX, y,
|
||||
STR_COLOR_PREFIX"<%s>",
|
||||
COLOR_RGBA32_GRAY, setting->name
|
||||
COLOR_RGBA32_CRASH_SETTINGS_DISABLED, setting->name
|
||||
);
|
||||
}
|
||||
} else if (crash_screen_setting_is_header(currIndex)) { // Header entry.
|
||||
@@ -205,7 +201,7 @@ void settings_draw(void) {
|
||||
}
|
||||
|
||||
void settings_input(void) {
|
||||
u32 currIndex = gCSDisplayedSettings[sSettingsSelectedIndex];
|
||||
u32 currIndex = gCSDisplayedSettingIDs[sSettingsSelectedIndex];
|
||||
u16 buttonPressed = gCSCompositeController->buttonPressed;
|
||||
|
||||
// Handle the reset to defaults entry differently.
|
||||
|
||||
@@ -16,12 +16,6 @@
|
||||
#include "segment_symbols.h"
|
||||
|
||||
|
||||
ALIGNED16 static struct FunctionInStack sCSFunctionStackBuffer[STACK_TRACE_BUFFER_SIZE];
|
||||
static u32 sCSNumFoundFunctions = 0;
|
||||
|
||||
static u32 sStackTraceSelectedIndex = 0;
|
||||
static u32 sStackTraceViewportIndex = 0;
|
||||
|
||||
const enum ControlTypes stackTraceContList[] = {
|
||||
CONT_DESC_SWITCH_PAGE,
|
||||
CONT_DESC_SHOW_CONTROLS,
|
||||
@@ -34,6 +28,13 @@ const enum ControlTypes stackTraceContList[] = {
|
||||
CONT_DESC_LIST_END,
|
||||
};
|
||||
|
||||
|
||||
ALIGNED16 static struct FunctionInStack sCSFunctionStackBuffer[STACK_TRACE_BUFFER_SIZE];
|
||||
static u32 sCSNumFoundFunctions = 0;
|
||||
|
||||
static u32 sStackTraceSelectedIndex = 0;
|
||||
static u32 sStackTraceViewportIndex = 0;
|
||||
|
||||
static void add_to_stack(struct FunctionInStack* func) {
|
||||
sCSFunctionStackBuffer[sCSNumFoundFunctions++] = *func;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user