From bb54482d0cff11243fb7ca364c1c73d1dea31316 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Wed, 3 Jul 2024 09:12:37 -0500 Subject: [PATCH] WIP fleshing out rewiring of menu / gui / main / cart to use BoxEmu component instead of box-emu-hal component --- CMakeLists.txt | 2 +- components/box-emu/src/box-emu.cpp | 9 ------ components/gui/CMakeLists.txt | 2 +- components/gui/include/gui.hpp | 15 ++++----- components/gui/src/gui.cpp | 35 ++++++++++----------- components/menu/CMakeLists.txt | 2 +- components/menu/include/menu.hpp | 16 +++++----- components/menu/src/menu.cpp | 20 ++++++------ main/cart.hpp | 18 +++++------ main/gbc_cart.hpp | 6 ++-- main/genesis_cart.hpp | 6 ++-- main/main.cpp | 49 ++++++++++++++++++++++++++---- main/nes_cart.hpp | 6 ++-- main/sms_cart.hpp | 6 ++-- 14 files changed, 111 insertions(+), 81 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1699558e..ceb349b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,7 @@ set(EMULATOR_COMPONENTS set( COMPONENTS - "main esptool_py esp_lcd esp_psram task format display display_drivers monitor timer ${EMULATOR_COMPONENTS} box-emu-hal gui menu" + "main esptool_py esp_lcd esp_psram task format display display_drivers monitor timer ${EMULATOR_COMPONENTS} box-emu gui menu" CACHE STRING "List of components to include" ) diff --git a/components/box-emu/src/box-emu.cpp b/components/box-emu/src/box-emu.cpp index bef6d4d7..6eea1418 100644 --- a/components/box-emu/src/box-emu.cpp +++ b/components/box-emu/src/box-emu.cpp @@ -196,15 +196,6 @@ uint8_t *BoxEmu::romdata() const { // Gamepad ///////////////////////////////////////////////////////////////////////////// -extern "C" lv_indev_t *get_keypad_input_device() { - auto keypad = BoxEmu::get().keypad(); - if (!keypad) { - fmt::print("cannot get keypad input device: keypad not initialized properly!\n"); - return nullptr; - } - return keypad->get_input_device(); -} - bool BoxEmu::initialize_gamepad() { logger_.info("Initializing gamepad"); if (version_ == BoxEmu::Version::V0) { diff --git a/components/gui/CMakeLists.txt b/components/gui/CMakeLists.txt index d1390720..b309fd79 100644 --- a/components/gui/CMakeLists.txt +++ b/components/gui/CMakeLists.txt @@ -2,4 +2,4 @@ idf_component_register( SRC_DIRS "src" "generated" "generated/screens" "generated/components" INCLUDE_DIRS "include" PRIV_INCLUDE_DIRS "generated" - REQUIRES lvgl task display logger jpeg rom_info box-emu-hal) + REQUIRES lvgl task display logger jpeg rom_info box-emu) diff --git a/components/gui/include/gui.hpp b/components/gui/include/gui.hpp index a46f2a86..f68a9e5c 100644 --- a/components/gui/include/gui.hpp +++ b/components/gui/include/gui.hpp @@ -11,7 +11,7 @@ #include "task.hpp" #include "logger.hpp" -#include "box_emu_hal.hpp" +#include "box-emu.hpp" #include "rom_info.hpp" class Gui { @@ -80,7 +80,7 @@ class Gui { void set_mute(bool muted); void toggle_mute() { - set_mute(!hal::is_muted()); + set_mute(!espp::EspBox::get().is_muted()); } void set_audio_level(int new_audio_level); @@ -147,10 +147,11 @@ class Gui { void toggle_usb(); void update_shared_state() { - set_mute(hal::is_muted()); - set_audio_level(hal::get_audio_volume()); - set_brightness(hal::get_display_brightness() * 100.0f); - set_video_setting(hal::get_video_setting()); + auto &box = espp::EspBox::get(); + set_mute(box.is_muted()); + set_audio_level(box.volume()); + set_brightness(box.brightness()); + set_video_setting(BoxEmu::get().video_setting()); } VideoSetting get_video_setting(); @@ -158,7 +159,7 @@ class Gui { void on_rom_focused(lv_obj_t *new_focus); void on_mute_button_pressed(const std::vector& data) { - set_mute(hal::is_muted()); + set_mute(espp::EspBox::get().is_muted()); } void on_battery(const std::vector& data); diff --git a/components/gui/src/gui.cpp b/components/gui/src/gui.cpp index dc2ac1a7..5c7cf6fb 100644 --- a/components/gui/src/gui.cpp +++ b/components/gui/src/gui.cpp @@ -7,7 +7,7 @@ extern "C" { } void Gui::set_mute(bool muted) { - hal::set_muted(muted); + espp::EspBox::get().mute(muted); if (muted) { lv_obj_add_state(ui_mutebutton, LV_STATE_CHECKED); } else { @@ -18,17 +18,17 @@ void Gui::set_mute(bool muted) { void Gui::set_audio_level(int new_audio_level) { new_audio_level = std::clamp(new_audio_level, 0, 100); lv_bar_set_value(ui_volumebar, new_audio_level, LV_ANIM_ON); - hal::set_audio_volume(new_audio_level); + espp::EspBox::get().volume(new_audio_level); } void Gui::set_brightness(int new_brightness) { new_brightness = std::clamp(new_brightness, 10, 100); lv_bar_set_value(ui_brightnessbar, new_brightness, LV_ANIM_ON); - hal::set_display_brightness((float)new_brightness / 100.0f); + espp::EspBox::get().brightness((float)new_brightness); } void Gui::set_video_setting(VideoSetting setting) { - hal::set_video_setting(setting); + BoxEmu::get().video_setting(setting); lv_dropdown_set_selected(ui_videosettingdropdown, (int)setting); } @@ -169,7 +169,7 @@ void Gui::init_ui() { settings_screen_group_ = lv_group_create(); // get the KEYPAD indev - auto keypad = get_keypad_input_device(); + auto keypad = BoxEmu::get().keypad()->get_input_device(); if (keypad) lv_indev_set_group(keypad, rom_screen_group_); @@ -188,7 +188,7 @@ void Gui::init_ui() { lv_obj_set_flex_flow(ui_rompanel, LV_FLEX_FLOW_COLUMN); lv_obj_set_scroll_snap_y(ui_rompanel, LV_SCROLL_SNAP_CENTER); - lv_bar_set_value(ui_volumebar, hal::get_audio_volume(), LV_ANIM_OFF); + lv_bar_set_value(ui_volumebar, espp::EspBox::get().volume(), LV_ANIM_OFF); // rom screen navigation lv_obj_add_event_cb(ui_settingsbutton, &Gui::event_callback, LV_EVENT_PRESSED, static_cast(this)); @@ -306,12 +306,12 @@ void Gui::on_pressed(lv_event_t *e) { // volume controls bool is_volume_up_button = (target == ui_volumeupbutton); if (is_volume_up_button) { - set_audio_level(hal::get_audio_volume() + 10); + set_audio_level(espp::EspBox::get().volume() + 10); return; } bool is_volume_down_button = (target == ui_volumedownbutton); if (is_volume_down_button) { - set_audio_level(hal::get_audio_volume() - 10); + set_audio_level(espp::EspBox::get().volume() - 10); return; } bool is_mute_button = (target == ui_mutebutton); @@ -322,13 +322,13 @@ void Gui::on_pressed(lv_event_t *e) { // brightness controlsn bool is_brightness_up_button = (target == ui_brightnessupbutton); if (is_brightness_up_button) { - int brightness = hal::get_display_brightness() * 100.0f; + int brightness = espp::EspBox::get().brightness(); set_brightness(brightness + 10); return; } bool is_brightness_down_button = (target == ui_brightnessdownbutton); if (is_brightness_down_button) { - int brightness = hal::get_display_brightness() * 100.0f; + int brightness = espp::EspBox::get().brightness(); set_brightness(brightness - 10); return; } @@ -375,7 +375,7 @@ void Gui::on_pressed(lv_event_t *e) { void Gui::on_volume(const std::vector& data) { // the volume was changed, update our display of the volume - lv_bar_set_value(ui_volumebar, hal::get_audio_volume(), LV_ANIM_ON); + lv_bar_set_value(ui_volumebar, espp::EspBox::get().volume(), LV_ANIM_ON); } void Gui::on_battery(const std::vector& data) { @@ -417,14 +417,15 @@ void Gui::on_battery(const std::vector& data) { void Gui::toggle_usb() { fmt::print("Toggling USB\n"); + auto &emu = BoxEmu::get(); // toggle the usb - if (usb_is_enabled()) { - usb_deinit(); + if (emu.is_usb_enabled()) { + emu.deinitialize_usb(); } else { - usb_init(); + emu.initialize_usb(); } // update the label - if (usb_is_enabled()) { + if (emu.is_usb_enabled()) { lv_label_set_text(ui_usb_label, "Enabled"); } else { lv_label_set_text(ui_usb_label, "Disabled"); @@ -445,7 +446,7 @@ void Gui::focus_rommenu() { // focus the rom screen group logger_.debug("Focusing rom screen group"); lv_group_focus_freeze(rom_screen_group_, false); - auto keypad = get_keypad_input_device(); + auto keypad = BoxEmu::get().keypad()->get_input_device(); if (keypad) lv_indev_set_group(keypad, rom_screen_group_); } @@ -456,7 +457,7 @@ void Gui::focus_settings() { logger_.debug("Focusing settings screen group"); lv_group_focus_freeze(settings_screen_group_, false); // NOTE: we don't set editing here since we use it to manage the dropdown - auto keypad = get_keypad_input_device(); + auto keypad = BoxEmu::get().keypad()->get_input_device(); if (keypad) lv_indev_set_group(keypad, settings_screen_group_); } diff --git a/components/menu/CMakeLists.txt b/components/menu/CMakeLists.txt index 0641fa75..49418c5a 100644 --- a/components/menu/CMakeLists.txt +++ b/components/menu/CMakeLists.txt @@ -2,4 +2,4 @@ idf_component_register( INCLUDE_DIRS "include" SRC_DIRS "src" "generated" "generated/screens" "generated/components" PRIV_INCLUDE_DIRS "generated" - REQUIRES lvgl timer display logger jpeg box-emu-hal) + REQUIRES lvgl timer display logger jpeg box-emu statistics) diff --git a/components/menu/include/menu.hpp b/components/menu/include/menu.hpp index 79cb9341..f54a4624 100644 --- a/components/menu/include/menu.hpp +++ b/components/menu/include/menu.hpp @@ -9,7 +9,8 @@ #include "high_resolution_timer.hpp" #include "logger.hpp" -#include "box_emu_hal.hpp" +#include "box-emu.hpp" +#include "statistics.hpp" class Menu { public: @@ -90,7 +91,7 @@ class Menu { void set_mute(bool muted); void toggle_mute() { - set_mute(!hal::is_muted()); + set_mute(!espp::EspBox::get().is_muted()); } void set_audio_level(int new_audio_level); @@ -123,16 +124,17 @@ class Menu { void update_fps_label(float fps); void update_shared_state() { - set_mute(hal::is_muted()); - set_audio_level(hal::get_audio_volume()); - set_brightness(hal::get_display_brightness() * 100.0f); - set_video_setting(hal::get_video_setting()); + auto &box = espp::EspBox::get(); + set_mute(box.is_muted()); + set_audio_level(box.volume()); + set_brightness(box.brightness()); + set_video_setting(BoxEmu::get().video_setting()); } VideoSetting get_video_setting(); void on_mute_button_pressed(const std::vector& data) { - set_mute(hal::is_muted()); + set_mute(espp::EspBox::get().is_muted()); } void update() { diff --git a/components/menu/src/menu.cpp b/components/menu/src/menu.cpp index 518897c7..44d42e3d 100644 --- a/components/menu/src/menu.cpp +++ b/components/menu/src/menu.cpp @@ -15,7 +15,7 @@ void Menu::init_ui() { lv_group_set_default(group_); // get the KEYPAD indev - auto keypad = get_keypad_input_device(); + auto keypad = BoxEmu::get().keypad()->get_input_device(); if (keypad) lv_indev_set_group(keypad, group_); @@ -218,7 +218,7 @@ void Menu::update_fps_label(float fps) { } void Menu::set_mute(bool muted) { - hal::set_muted(muted); + espp::EspBox::get().mute(muted); if (muted) { lv_obj_add_state(ui_volume_mute_btn, LV_STATE_CHECKED); } else { @@ -229,17 +229,17 @@ void Menu::set_mute(bool muted) { void Menu::set_audio_level(int new_audio_level) { new_audio_level = std::clamp(new_audio_level, 0, 100); lv_bar_set_value(ui_Bar2, new_audio_level, LV_ANIM_ON); - hal::set_audio_volume(new_audio_level); + espp::EspBox::get().volume(new_audio_level); } void Menu::set_brightness(int new_brightness) { new_brightness = std::clamp(new_brightness, 10, 100); lv_bar_set_value(ui_brightness_bar, new_brightness, LV_ANIM_ON); - hal::set_display_brightness((float)new_brightness / 100.0f); + espp::EspBox::get().brightness((float)new_brightness); } void Menu::set_video_setting(VideoSetting setting) { - hal::set_video_setting(setting); + BoxEmu::get().video_setting(setting); lv_dropdown_set_selected(ui_Dropdown2, (int)setting); } @@ -307,12 +307,12 @@ void Menu::on_pressed(lv_event_t *e) { // volume controls bool is_volume_up_button = (target == ui_volume_inc_btn); if (is_volume_up_button) { - set_audio_level(hal::get_audio_volume() + 10); + set_audio_level(espp::EspBox::get().volume() + 10); return; } bool is_volume_down_button = (target == ui_volume_dec_btn); if (is_volume_down_button) { - set_audio_level(hal::get_audio_volume() - 10); + set_audio_level(espp::EspBox::get().volume() - 10); return; } bool is_mute_button = (target == ui_volume_mute_btn); @@ -323,19 +323,19 @@ void Menu::on_pressed(lv_event_t *e) { // brightness controls bool is_brightness_up_button = (target == ui_brightness_inc_btn); if (is_brightness_up_button) { - set_brightness(hal::get_display_brightness() * 100.0f + 10); + set_brightness(espp::EspBox::get().brightness() + 10); return; } bool is_brightness_down_button = (target == ui_brightness_dec_btn); if (is_brightness_down_button) { - set_brightness(hal::get_display_brightness() * 100.0f - 10); + set_brightness(espp::EspBox::get().brightness() - 10); return; } } void Menu::on_volume(const std::vector& data) { // the volume was changed, update our display of the volume - lv_bar_set_value(ui_Bar2, hal::get_audio_volume(), LV_ANIM_ON); + lv_bar_set_value(ui_Bar2, espp::EspBox::get().volume(), LV_ANIM_ON); } void Menu::on_battery(const std::vector& data) { diff --git a/main/cart.hpp b/main/cart.hpp index b9397293..f4c1aa1e 100644 --- a/main/cart.hpp +++ b/main/cart.hpp @@ -7,7 +7,7 @@ #include "display.hpp" #include "logger.hpp" -#include "box_emu_hal.hpp" +#include "box-emu.hpp" #include "rom_info.hpp" #include "menu.hpp" @@ -39,8 +39,8 @@ class Cart { // clear the screen espp::St7789::clear(0,0,320,240); // copy the romdata - rom_size_bytes_ = copy_romdata_to_cart_partition(get_rom_filename()); - romdata_ = get_mmapped_romdata(); + rom_size_bytes_ = BoxEmu::get().copy_file_to_romdata(get_rom_filename()); + romdata_ = BoxEmu::get().romdata(); // create the menu menu_ = std::make_unique(Menu::Config{ .display = display_, @@ -156,16 +156,14 @@ class Cart { virtual bool run() { running_ = true; // handle touchpad so we can know if the user presses the menu - uint8_t _num_touches = 0, _btn_state = false; - uint16_t _x = 0 ,_y = 0; - touchpad_read(&_num_touches, &_x, &_y, &_btn_state); + auto touch = espp::EspBox::get().touchpad_data(); + bool btn_state = touch.btn_state; // also get the gamepad input state so we can know if the user presses the // start/select buttons together to bring up the menu - InputState state; - hal::get_input_state(&state); + auto state = BoxEmu::get().gamepad_state(); // if the user presses the menu button or the start/select buttons, then // pause the game and show the menu - bool show_menu = _btn_state || (state.start && state.select); + bool show_menu = btn_state || (state.start && state.select); if (show_menu) { logger_.info("Menu pressed!"); pre_menu(); @@ -258,7 +256,7 @@ class Cart { virtual void handle_video_setting() { logger_.info("Base handling video setting..."); - switch (hal::get_video_setting()) { + switch (BoxEmu::get().video_setting()) { case VideoSetting::ORIGINAL: set_original_video_setting(); break; diff --git a/main/gbc_cart.hpp b/main/gbc_cart.hpp index 7458dbe8..3630b5ae 100644 --- a/main/gbc_cart.hpp +++ b/main/gbc_cart.hpp @@ -86,7 +86,7 @@ class GbcCart : public Cart { virtual void set_original_video_setting() override { #if defined(ENABLE_GBC) logger_.info("gbc::video: original"); - hal::set_display_size(GAMEBOY_WIDTH, GAMEBOY_HEIGHT); + BoxEmu::get().display_size(GAMEBOY_WIDTH, GAMEBOY_HEIGHT); #endif } @@ -108,14 +108,14 @@ class GbcCart : public Cart { logger_.info("gbc::video: fit"); float x_scale = static_cast(SCREEN_HEIGHT) / static_cast(GAMEBOY_HEIGHT); int new_width = static_cast(static_cast(GAMEBOY_WIDTH) * x_scale); - hal::set_display_size(new_width, SCREEN_HEIGHT); + BoxEmu::get().display_size(new_width, SCREEN_HEIGHT); #endif } virtual void set_fill_video_setting() override { #if defined(ENABLE_GBC) logger_.info("gbc::video: fill"); - hal::set_display_size(SCREEN_WIDTH, SCREEN_HEIGHT); + BoxEmu::get().display_size(SCREEN_WIDTH, SCREEN_HEIGHT); #endif } diff --git a/main/genesis_cart.hpp b/main/genesis_cart.hpp index e50f4aa3..cded9a47 100644 --- a/main/genesis_cart.hpp +++ b/main/genesis_cart.hpp @@ -97,7 +97,7 @@ class GenesisCart : public Cart { #if defined(ENABLE_GENESIS) auto height = GENESIS_HEIGHT; auto width = GENESIS_WIDTH; - hal::set_display_size(width, height); + BoxEmu::get().display_size(width, height); #endif } @@ -120,14 +120,14 @@ class GenesisCart : public Cart { #if defined(ENABLE_GENESIS) logger_.info("genesis::video: fit"); // the genesis is already 320 px wide, don't do anything - hal::set_display_size(GENESIS_WIDTH, GENESIS_HEIGHT); + BoxEmu::get().display_size(GENESIS_WIDTH, GENESIS_HEIGHT); #endif } virtual void set_fill_video_setting() override { #if defined(ENABLE_GENESIS) logger_.info("genesis::video: fill"); - hal::set_display_size(SCREEN_WIDTH, SCREEN_HEIGHT); + BoxEmu::get().display_size(SCREEN_WIDTH, SCREEN_HEIGHT); #endif } diff --git a/main/main.cpp b/main/main.cpp index a7da375b..e7117fd6 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -11,11 +11,12 @@ #include "task_monitor.hpp" #include "timer.hpp" -#include "box_emu_hal.hpp" +#include "box-emu.hpp" #include "carts.hpp" #include "gui.hpp" #include "heap_utils.hpp" #include "rom_info.hpp" +#include "statistics.hpp" using namespace std::chrono_literals; @@ -23,15 +24,51 @@ extern "C" void app_main(void) { espp::Logger logger({.tag = "esp-box-emu", .level = espp::Logger::Verbosity::DEBUG}); logger.info("Bootup"); - hal::init(); + // initialize the hardware abstraction layer + BoxEmu &emu = BoxEmu::get(); + emu.set_log_level(espp::Logger::Verbosity::INFO); + espp::EspBox &box = espp::EspBox::get(); + logger.info("Running on {}", box.box_type()); + logger.info("Box Emu version: {}", emu.version()); + + // initialize + if (!emu.initialize_box()) { + logger.error("Failed to initialize box!"); + return; + } + + if (!emu.initialize_sdcard()) { + logger.warn("Failed to initialize SD card!"); + logger.warn("This may happen if the SD card is not inserted."); + } + + if (!emu.initialize_memory()) { + logger.error("Failed to initialize memory!"); + return; + } + + if (!emu.initialize_gamepad()) { + logger.warn("Failed to initialize gamepad!"); + logger.warn("This may happen if the gamepad is not connected."); + } + + if (!emu.initialize_battery()) { + logger.warn("Failed to initialize battery!"); + logger.warn("This may happen if the battery is not connected."); + } + + if (!emu.initialize_video()) { + logger.error("Failed to initialize video!"); + return; + } std::error_code ec; - auto external_i2c = hal::get_external_i2c(); + auto &external_i2c = emu.external_i2c(); espp::Drv2605 haptic_motor(espp::Drv2605::Config{ .device_address = espp::Drv2605::DEFAULT_ADDRESS, - .write = std::bind(&espp::I2c::write, external_i2c.get(), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), - .read_register = std::bind(&espp::I2c::read_at_register, external_i2c.get(), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), + .write = std::bind(&espp::I2c::write, &external_i2c, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), + .read_register = std::bind(&espp::I2c::read_at_register, &external_i2c, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), .motor_type = espp::Drv2605::MotorType::LRA }); // we're using an LRA motor, so select th LRA library. @@ -49,7 +86,7 @@ extern "C" void app_main(void) { logger.info("initializing gui..."); - auto display = hal::get_display(); + auto display = box.display(); // initialize the gui Gui gui({ diff --git a/main/nes_cart.hpp b/main/nes_cart.hpp index 51f294fe..299ff93f 100644 --- a/main/nes_cart.hpp +++ b/main/nes_cart.hpp @@ -97,7 +97,7 @@ class NesCart : public Cart { virtual void set_original_video_setting() override { #if defined(ENABLE_NES) - hal::set_display_size(NES_WIDTH, NES_HEIGHT); + BoxEmu::get().display_size(NES_WIDTH, NES_HEIGHT); #endif } @@ -105,13 +105,13 @@ class NesCart : public Cart { #if defined(ENABLE_NES) float x_scale = static_cast(SCREEN_HEIGHT) / static_cast(NES_HEIGHT); int new_width = static_cast(static_cast(NES_WIDTH) * x_scale); - hal::set_display_size(new_width, SCREEN_HEIGHT); + BoxEmu::get().display_size(new_width, SCREEN_HEIGHT); #endif } virtual void set_fill_video_setting() override { #if defined(ENABLE_NES) - hal::set_display_size(SCREEN_WIDTH, SCREEN_HEIGHT); + BoxEmu::get().display_size(SCREEN_WIDTH, SCREEN_HEIGHT); #endif } diff --git a/main/sms_cart.hpp b/main/sms_cart.hpp index 8747f5d5..49ea7d7b 100644 --- a/main/sms_cart.hpp +++ b/main/sms_cart.hpp @@ -102,7 +102,7 @@ class SmsCart : public Cart { #if defined(ENABLE_SMS) auto height = info_.platform == Emulator::SEGA_MASTER_SYSTEM ? SMS_HEIGHT : GG_HEIGHT; auto width = info_.platform == Emulator::SEGA_MASTER_SYSTEM ? SMS_WIDTH : GG_WIDTH; - hal::set_display_size(width, height); + BoxEmu::get().display_size(width, height); #endif } @@ -128,14 +128,14 @@ class SmsCart : public Cart { float width = info_.platform == Emulator::SEGA_MASTER_SYSTEM ? SMS_WIDTH : GG_WIDTH; float x_scale = static_cast(SCREEN_HEIGHT) / height; int new_width = static_cast(width * x_scale); - hal::set_display_size(new_width, SCREEN_HEIGHT); + BoxEmu::get().display_size(new_width, SCREEN_HEIGHT); #endif } virtual void set_fill_video_setting() override { #if defined(ENABLE_SMS) logger_.info("sms::video: fill"); - hal::set_display_size(SCREEN_WIDTH, SCREEN_HEIGHT); + BoxEmu::get().display_size(SCREEN_WIDTH, SCREEN_HEIGHT); #endif }