Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
desktop-ui: fix ws orientation after savestate load at boot
WonderSwan and WonderSwan Color could boot with
the screen rotated incorrectly when loading a savestate during startup
(using `--save-state`).
Reapply the PPU/Screen/Orientation setting after unserializing a state
so the screen rotation matches the restored orientation.
  • Loading branch information
awsms committed Mar 18, 2026
commit f467c0caaaac79d40d38ba3287217f4f03398f99
8 changes: 8 additions & 0 deletions desktop-ui/program/states.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ auto Program::stateLoad(u32 slot) -> bool {
if(!memory.empty()) {
serializer state{memory.data(), (u32)memory.size()};
if(emulator->root->unserialize(state)) {
if(emulator->name == "WonderSwan" || emulator->name == "WonderSwan Color") {
if(auto orientation = emulator->root->find<ares::Node::Setting::String>("PPU/Screen/Orientation")) {
auto value = orientation->value();
orientation->setValue(value);
orientation->modify(value);
}
}

showMessage({"Loaded state from slot ", slot});
return true;
}
Expand Down
Loading