yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
main.cc File Reference
#include <set>
#include <thread>
#include <chrono>
#include <fstream>
#include <iostream>
#include "absl/debugging/symbolize.h"
#include "absl/strings/ascii.h"
#include "absl/strings/str_split.h"
#include "absl/strings/strip.h"
#include "app/application.h"
#include "app/startup_flags.h"
#include "app/controller.h"
#include "app/editor/editor_manager.h"
#include "app/emu/debug/symbol_provider.h"
#include "core/features.h"
#include "util/crash_handler.h"
#include "util/flag.h"
#include "util/log.h"
#include "util/platform_paths.h"
#include "yaze.h"

Go to the source code of this file.

Namespaces

namespace  yaze
 
namespace  yaze::emu
 SNES Emulation and debugging tools.
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 
namespace  yaze::app
 
namespace  anonymous_namespace{main.cc}
 

Macros

#define IMGUI_DEFINE_MATH_OPERATORS
 

Functions

 DEFINE_FLAG (std::string, log_file, "", "Output log file path for debugging.")
 
 DEFINE_FLAG (std::string, rom_file, "", "ROM file to load on startup.")
 
 DEFINE_FLAG (bool, debug, false, "Enable debug logging and verbose output.")
 
 DEFINE_FLAG (std::string, log_level, "info", "Minimum log level: debug, info, warn, error, or fatal.")
 
 DEFINE_FLAG (bool, log_to_console, false, "Mirror logs to stderr even when writing to a file.")
 
 DEFINE_FLAG (std::string, log_categories, "", "Comma-separated list of log categories to enable or disable. " "Prefix with '-' to disable a category. " "Example: \"Room,DungeonEditor\" (allowlist) or \"-Input,-Graphics\" " "(blocklist).")
 
 DEFINE_FLAG (std::string, editor, "", "The editor to open on startup (e.g., Dungeon, Overworld, Assembly).")
 
 DEFINE_FLAG (std::string, open_panels, "", "Comma-separated list of panel IDs to open (e.g. 'dungeon.room_list,emulator.cpu_debugger')")
 
 DEFINE_FLAG (std::string, startup_welcome, "auto", "Welcome screen behavior at startup: auto, show, or hide.")
 
 DEFINE_FLAG (std::string, startup_dashboard, "auto", "Dashboard panel behavior at startup: auto, show, or hide.")
 
 DEFINE_FLAG (std::string, startup_sidebar, "auto", "Panel sidebar visibility at startup: auto, show, or hide.")
 
 DEFINE_FLAG (std::string, asset_mode, "auto", "Asset load mode: auto, full, or lazy.")
 
 DEFINE_FLAG (int, room, -1, "Open Dungeon Editor at specific room ID (0-295).")
 
 DEFINE_FLAG (int, map, -1, "Open Overworld Editor at specific map ID (0-159).")
 
 DEFINE_FLAG (bool, enable_api, false, "Enable the AI Agent API server.")
 
 DEFINE_FLAG (int, api_port, 8080, "Port for the AI Agent API server.")
 
 DEFINE_FLAG (bool, headless, false, "Run in headless mode without a GUI window.")
 
 DEFINE_FLAG (bool, service, false, "Run in service mode (GUI backend initialized but window hidden).")
 
 DEFINE_FLAG (bool, server, false, "Run in server mode (implies --enable_api, --enable_test_harness). Defaults to --headless unless --service or --no-headless is specified.")
 
 DEFINE_FLAG (std::string, export_symbols, "", "Export symbols to file (requires --rom_file).")
 
 DEFINE_FLAG (std::string, symbol_format, "mesen", "Format for symbol export: mesen, wla, asar, bsnes.")
 
 DEFINE_FLAG (std::string, load_symbols, "", "Load symbol file (.mlb, .sym, .asm) on startup.")
 
 DEFINE_FLAG (std::string, load_asar_symbols, "", "Load Asar symbols from directory on startup.")
 
 DEFINE_FLAG (bool, export_symbols_fast, false, "Export symbols without initializing UI. Requires --load_symbols or --load_asar_symbols.")
 
yaze::emu::Emulatoryaze::app::GetGlobalEmulator ()
 
yaze::editor::EditorManageryaze::app::GetGlobalEditorManager ()
 
yaze::util::LogLevel anonymous_namespace{main.cc}::ParseLogLevelFlag (const std::string &raw_level, bool debug_flag)
 
std::set< std::string > anonymous_namespace{main.cc}::ParseLogCategories (const std::string &raw)
 
const char * anonymous_namespace{main.cc}::LogLevelToString (yaze::util::LogLevel level)
 
std::vector< std::string > anonymous_namespace{main.cc}::ParseCommaList (const std::string &raw)
 
void TickFrame ()
 
void SetupCrashHandling ()
 
yaze::util::LogLevel ResolveLogConfig (bool debug_flag, bool log_to_console_flag)
 
yaze::AppConfig BuildAppConfig (yaze::util::LogLevel log_level, std::string log_path)
 
bool RunSymbolExportFastPath ()
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ IMGUI_DEFINE_MATH_OPERATORS

#define IMGUI_DEFINE_MATH_OPERATORS

Definition at line 11 of file main.cc.

Function Documentation

◆ DEFINE_FLAG() [1/24]

DEFINE_FLAG ( std::string ,
log_file ,
"" ,
"Output log file path for debugging."  )

◆ DEFINE_FLAG() [2/24]

DEFINE_FLAG ( std::string ,
rom_file ,
"" ,
"ROM file to load on startup."  )

◆ DEFINE_FLAG() [3/24]

DEFINE_FLAG ( bool ,
debug ,
false ,
"Enable debug logging and verbose output."  )

◆ DEFINE_FLAG() [4/24]

DEFINE_FLAG ( std::string ,
log_level ,
"info" ,
"Minimum log level: debug,
info ,
warn ,
error ,
or fatal."  )

◆ DEFINE_FLAG() [5/24]

DEFINE_FLAG ( bool ,
log_to_console ,
false ,
"Mirror logs to stderr even when writing to a file."  )

◆ DEFINE_FLAG() [6/24]

DEFINE_FLAG ( std::string ,
log_categories ,
"" ,
"Comma-separated list of log categories to enable or disable. " "Prefix with '-' to disable a category. " "Example: \" Room,
DungeonEditor\" (allowlist) or \"- Input,
-Graphics\" " "(blocklist)."  )

◆ DEFINE_FLAG() [7/24]

DEFINE_FLAG ( std::string ,
editor ,
"" ,
"The editor to open on startup (e.g., Dungeon, Overworld, Assembly)."  )

◆ DEFINE_FLAG() [8/24]

DEFINE_FLAG ( std::string ,
open_panels ,
"" ,
"Comma-separated list of panel IDs to open (e.g. 'dungeon.room_list,emulator.cpu_debugger')"  )

◆ DEFINE_FLAG() [9/24]

DEFINE_FLAG ( std::string ,
startup_welcome ,
"auto" ,
"Welcome screen behavior at startup: auto,
show ,
or hide."  )

◆ DEFINE_FLAG() [10/24]

DEFINE_FLAG ( std::string ,
startup_dashboard ,
"auto" ,
"Dashboard panel behavior at startup: auto,
show ,
or hide."  )

◆ DEFINE_FLAG() [11/24]

DEFINE_FLAG ( std::string ,
startup_sidebar ,
"auto" ,
"Panel sidebar visibility at startup: auto,
show ,
or hide."  )

◆ DEFINE_FLAG() [12/24]

DEFINE_FLAG ( std::string ,
asset_mode ,
"auto" ,
"Asset load mode: auto,
full ,
or lazy."  )

◆ DEFINE_FLAG() [13/24]

DEFINE_FLAG ( int ,
room ,
- 1,
"Open Dungeon Editor at specific room ID (0-295)."  )

◆ DEFINE_FLAG() [14/24]

DEFINE_FLAG ( int ,
map ,
- 1,
"Open Overworld Editor at specific map ID (0-159)."  )

◆ DEFINE_FLAG() [15/24]

DEFINE_FLAG ( bool ,
enable_api ,
false ,
"Enable the AI Agent API server."  )

◆ DEFINE_FLAG() [16/24]

DEFINE_FLAG ( int ,
api_port ,
8080 ,
"Port for the AI Agent API server."  )

◆ DEFINE_FLAG() [17/24]

DEFINE_FLAG ( bool ,
headless ,
false ,
"Run in headless mode without a GUI window."  )

◆ DEFINE_FLAG() [18/24]

DEFINE_FLAG ( bool ,
service ,
false ,
"Run in service mode (GUI backend initialized but window hidden)."  )

◆ DEFINE_FLAG() [19/24]

DEFINE_FLAG ( bool ,
server ,
false ,
"Run in server mode (implies --enable_api, --enable_test_harness). Defaults to --headless unless --service or --no-headless is specified."  )

◆ DEFINE_FLAG() [20/24]

DEFINE_FLAG ( std::string ,
export_symbols ,
"" ,
"Export symbols to file (requires --rom_file)."  )

◆ DEFINE_FLAG() [21/24]

DEFINE_FLAG ( std::string ,
symbol_format ,
"mesen" ,
"Format for symbol export: mesen,
wla ,
asar ,
bsnes."  )

◆ DEFINE_FLAG() [22/24]

DEFINE_FLAG ( std::string ,
load_symbols ,
"" ,
"Load symbol file (.mlb, .sym, .asm) on startup."  )

◆ DEFINE_FLAG() [23/24]

DEFINE_FLAG ( std::string ,
load_asar_symbols ,
"" ,
"Load Asar symbols from directory on startup."  )

◆ DEFINE_FLAG() [24/24]

DEFINE_FLAG ( bool ,
export_symbols_fast ,
false ,
"Export symbols without initializing UI. Requires --load_symbols or --load_asar_symbols."  )

◆ TickFrame()

void TickFrame ( )

Definition at line 197 of file main.cc.

References yaze::Application::Instance(), and yaze::Application::Tick().

Referenced by main().

Here is the call graph for this function:

◆ SetupCrashHandling()

void SetupCrashHandling ( )

Definition at line 203 of file main.cc.

References yaze::util::CrashHandler::CleanupOldLogs(), yaze::util::CrashHandler::Initialize(), and YAZE_VERSION_STRING.

Referenced by main().

Here is the call graph for this function:

◆ ResolveLogConfig()

◆ BuildAppConfig()

◆ RunSymbolExportFastPath()

◆ main()