38 LOG_INFO(
"App",
"Initializing Application instance...");
50 LOG_INFO(
"App",
"Found pending ROM load: %s", start_path.c_str());
51 }
else if (!start_path.empty()) {
52 LOG_INFO(
"App",
"Using configured startup ROM: %s", start_path.c_str());
54 LOG_INFO(
"App",
"No pending ROM, starting empty.");
57 LOG_INFO(
"App",
"WASM build - ROM loading handled via wasm_bootstrap queue.");
65 LOG_ERROR(
"App",
"Failed to initialize controller: %s", std::string(status.message()).c_str());
67 LOG_INFO(
"App",
"Controller initialized successfully. Active: %s",
controller_->IsActive() ?
"Yes" :
"No");
74 if (!start_path.empty() &&
controller_->editor_manager()) {
81 LOG_INFO(
"App",
"Initializing Unified gRPC Server...");
82 canvas_automation_service_ = std::make_unique<CanvasAutomationServiceImpl>();
83 grpc_server_ = std::make_unique<YazeGRPCServer>();
85 auto rom_getter = [
this]() {
return controller_->GetCurrentRom(); };
86 auto rom_loader = [
this](
const std::string& path) ->
bool {
88 auto status =
controller_->editor_manager()->OpenRomOrProject(path);
95 LOG_INFO(
"App",
"Using Mesen2 backend for emulator service");
96 emulator_backend_ = std::make_unique<emu::mesen::MesenEmulatorAdapter>();
97 emulator_interface = emulator_backend_.get();
101 internal_emulator = &
controller_->editor_manager()->emulator();
103 LOG_WARN(
"App",
"EditorManager not ready; internal emulator services may be limited");
106 auto adapter = std::make_unique<emu::InternalEmulatorAdapter>(internal_emulator);
109 adapter->SetRomLoader([
this](
const std::string& path) ->
bool {
111 auto status =
controller_->editor_manager()->OpenRomOrProject(path);
115 adapter->SetRomGetter([
this]() {
return controller_->GetCurrentRom(); });
117 emulator_backend_ = std::move(adapter);
118 emulator_interface = emulator_backend_.get();
122 auto status = grpc_server_->Initialize(
130 canvas_automation_service_.get()
134 status = grpc_server_->StartAsync();
136 LOG_ERROR(
"App",
"Failed to start gRPC server: %s", std::string(status.message()).c_str());
141 LOG_ERROR(
"App",
"Failed to initialize gRPC server: %s", std::string(status.message()).c_str());
145 if (canvas_automation_service_) {
146 controller_->SetCanvasAutomationService(canvas_automation_service_.get());
154 yaze::app::wasm::SetRomLoadHandler([](std::string path) {
161 absl::StrFormat(
"/tmp/yaze-%d.status", pid));
::yaze::EventBus * event_bus()
Get the current EventBus instance.