diff --git a/README.md b/README.md index 09ec9ca..59ea9a7 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,10 @@ Cross / Circle / Square / Triangle, L1 / R1 on the shoulders, L2 / R2 on the triggers for the item and weapon menus, so a pad with triggers (or the keyboard's E / R) is needed for those. +MSX: A / B are the joystick's two fire buttons, start is the MSX's F1 key +(pause in Konami's games), select shows the on-screen keyboard and Y opens +fMSX's own menu. + New controllers: the console prints each device's decoded buttons on change (debug level in `usb_hid.cpp`); a wrong mapping is a quirk-table entry in espp's `hid-rp-report-map.hpp`. diff --git a/components/darkforces/TheForceEngine b/components/darkforces/TheForceEngine index 6ef6cb8..8853391 160000 --- a/components/darkforces/TheForceEngine +++ b/components/darkforces/TheForceEngine @@ -1 +1 @@ -Subproject commit 6ef6cb804ecce5221d9b33901e594521f98a658c +Subproject commit 8853391f7b40641540c773085732747b33bc1f57 diff --git a/components/emulink b/components/emulink index 3433770..d948611 160000 --- a/components/emulink +++ b/components/emulink @@ -1 +1 @@ -Subproject commit 3433770dfac07836090b95181b426bcdeb5001b1 +Subproject commit d948611320bf9a06c507a5fe0103e22294a70a2c diff --git a/components/msx/fmsx b/components/msx/fmsx index 66b85a3..be673ef 160000 --- a/components/msx/fmsx +++ b/components/msx/fmsx @@ -1 +1 @@ -Subproject commit 66b85a3883d5407300dc9c93604a242f2c936b47 +Subproject commit be673efe919eaa34e832da9d423618543dc1232a diff --git a/components/nes/nofrendo b/components/nes/nofrendo index 332fb5b..985c399 160000 --- a/components/nes/nofrendo +++ b/components/nes/nofrendo @@ -1 +1 @@ -Subproject commit 332fb5bd1a1e0519e20c65a66074434a4a92a87a +Subproject commit 985c399229712b6a0bb7ffa64d7a658c95de7fd6 diff --git a/components/snes/src/snes.cpp b/components/snes/src/snes.cpp index 29758a7..9c75e89 100644 --- a/components/snes/src/snes.cpp +++ b/components/snes/src/snes.cpp @@ -36,6 +36,8 @@ constexpr int MAX_SKIP = 3; // rendered vs skipped frames (the frame-time statistics blend both) static uint64_t g_rendered_frames = 0, g_rendered_us = 0, g_skipped_frames = 0, g_skipped_us = 0; static uint64_t g_next_due = 0; // cumulative frame deadline (esp_timer us) +// the last frame packed for a screenshot (the core's frames have a pitch) +std::vector g_packed; } extern "C" uint32_t snes_host_read_joypad(int port) { @@ -198,8 +200,10 @@ std::pair get_snes_video_size() { return {static_cast(g_ std::span get_snes_video_buffer() { if (!g_initialized || !g_last_frame) return {}; - // the screenshot writer expects a packed frame; repack the pitch - static std::vector packed; + // the screenshot writer expects a packed frame; repack the pitch (into a + // buffer deinit_snes() frees: a static one stayed in the middle of the + // PSRAM heap after the game, splitting its largest block) + auto &packed = g_packed; packed.resize(static_cast(g_last_w) * g_last_h * 2); for (int y = 0; y < g_last_h; y++) { memcpy(packed.data() + static_cast(y) * g_last_w * 2, g_last_frame + static_cast(y) * snes_glue_pitch(), @@ -222,4 +226,5 @@ void deinit_snes() { snes_glue_deinit(); BoxEmu::get().audio_sample_rate(48000); g_last_frame = nullptr; + std::vector().swap(g_packed); // the screenshot buffer goes back too }