47 LOG_INFO(
"App",
"Initializing Application instance...");
62 LOG_INFO(
"App",
"Found pending ROM load: %s", start_path.c_str());
63 }
else if (!start_path.empty()) {
64 LOG_INFO(
"App",
"Using configured startup ROM: %s", start_path.c_str());
66 LOG_INFO(
"App",
"No pending ROM, starting empty.");
69 LOG_INFO(
"App",
"WASM build - ROM loading handled via wasm_bootstrap queue.");
77 LOG_ERROR(
"App",
"Failed to initialize controller: %s",
78 std::string(status.message()).c_str());
80 LOG_INFO(
"App",
"Controller initialized successfully. Active: %s",
88 if (!start_path.empty() &&
controller_->editor_manager()) {
95 LOG_INFO(
"App",
"Initializing Unified gRPC Server...");
96 canvas_automation_service_ =
97 std::make_unique<CanvasAutomationServiceImpl>();
98 grpc_server_ = std::make_unique<YazeGRPCServer>();
100 auto rom_getter = [
this]() {
103 auto rom_loader = [
this](
const std::string& path) ->
bool {
106 auto status =
controller_->editor_manager()->OpenRomOrProject(path);
113 LOG_INFO(
"App",
"Using Mesen2 backend for emulator service");
115 std::make_unique<emu::mesen::MesenEmulatorAdapter>();
116 emulator_interface = emulator_backend_.get();
120 internal_emulator = &
controller_->editor_manager()->emulator();
123 "EditorManager not ready; internal emulator services may be "
128 std::make_unique<emu::InternalEmulatorAdapter>(internal_emulator);
131 adapter->SetRomLoader([
this](
const std::string& path) ->
bool {
134 auto status =
controller_->editor_manager()->OpenRomOrProject(path);
138 adapter->SetRomGetter(
139 [
this]() {
return controller_->GetCurrentRom(); });
141 emulator_backend_ = std::move(adapter);
142 emulator_interface = emulator_backend_.get();
146 auto status = grpc_server_->Initialize(
151 canvas_automation_service_.get());
154 status = grpc_server_->StartAsync();
156 LOG_ERROR(
"App",
"Failed to start gRPC server: %s",
157 std::string(status.message()).c_str());
159 LOG_INFO(
"App",
"Unified gRPC server started on port %d",
163 LOG_ERROR(
"App",
"Failed to initialize gRPC server: %s",
164 std::string(status.message()).c_str());
168 if (canvas_automation_service_) {
170 canvas_automation_service_.get());
178 yaze::app::wasm::SetRomLoadHandler(
184 absl::StrFormat(
"/tmp/yaze-%d.status", pid));
186 LOG_INFO(
"App",
"Activity file created: %s",
::yaze::EventBus * event_bus()
Get the current EventBus instance.