Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulator trying to read 'debug/levels/105_YI1main.bin' #38

Open
Finxx1 opened this issue May 18, 2024 · 1 comment
Open

Emulator trying to read 'debug/levels/105_YI1main.bin' #38

Finxx1 opened this issue May 18, 2024 · 1 comment

Comments

@Finxx1
Copy link

Finxx1 commented May 18, 2024

The last commit to smwe-emu uncommented some lines in emu.rs that appears to be loading a level dump from a debug directory not in the repository. The editor crashes when trying to load the Level Editor or Sprite Editor as it cannot find this file.

if cpu.pc == 0x200C {
    let layer1_ptr = cpu.mem.load_u24(layer1_data_ptr);
    cpu.mem.store_u24(layer1_data_ptr, 0x600000);
    // todo: properly load level data from RAM at `layer1_ptr`
    let level_data = std::fs::read("debug/levels/105_YI1main.bin").unwrap(); // bang! crash.
    cpu.mem.extram[..level_data.len()].copy_from_slice(&level_data);
}

Log:

2024-05-18T08:32:18.019568215-05:00 INFO smw_editor - No path defined in ROM_PATH
2024-05-18T08:32:18.021558811-05:00 WARN winit::platform_impl::platform::x11::xdisplay - error setting XSETTINGS; Xft options won't reload automatically
2024-05-18T08:32:18.045621683-05:00 INFO winit::platform_impl::platform::x11::window - Guessed window scale factor: 1
2024-05-18T08:32:22.751571592-05:00 INFO smw_editor::ui::project_creator - Opened Project Creator
2024-05-18T08:32:30.787020428-05:00 INFO smw_editor::ui::project_creator - Attempting to create a new project
2024-05-18T08:32:30.802024722-05:00 INFO smw_editor::ui::project_creator - Success creating a new project
2024-05-18T08:32:30.802133158-05:00 INFO smw_editor::ui::project_creator - Closed Project Creator
thread 'main' panicked at crates/smwe-emu/src/emu.rs:367:76:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-05-18T08:32:32.357669976-05:00 WARN egui_glow::painter - You forgot to call destroy() on the egui glow painter. Resources will leak!
@Adanos020
Copy link
Member

Hi, yes we are aware of this. This repository is a work in progress project, and we do not expect anyone to use it yet, since we're still just experimenting and prototyping stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants