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

thread 'main' panicked at 'attempt to add with overflow' tap.rs:68:13 -m128 - loading tape #100

Closed
Tracked by #102
georgik opened this issue Sep 3, 2021 · 3 comments · Fixed by #102
Closed
Tracked by #102

Comments

@georgik
Copy link

georgik commented Sep 3, 2021

Behavior: Load Wonderful Dizzy .tap, rutzx fails with error after displaying load-screen:

thread 'main' panicked at 'attempt to add with overflow', C:\projects\rustzx\rustzx-core\src\emulator\fastload\tap.rs:68:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\rustzx.exe -m128 --tape .\dizzy.tap` (exit code: 101)

Tap: https://yolkfolk.com/wonderful-dizzy/

Command:

cargo run --bin rustzx -- -m128 --tape .\dizzy.tap

Environment: Windows 10 21H1, rustc 1.56.0-nightly (ae90dcf02 2021-08-09)

@georgik
Copy link
Author

georgik commented Sep 6, 2021

It seems to be a problem with 128K mode.
tap.rs:68:13 fails after loading tape to 65535. The increment fails, because dest counter is u16:
let mut dest = emulator.cpu.regs.get_reg_16(RegName16::IX);

@georgik georgik changed the title thread 'main' panicked at 'attempt to add with overflow' tap.rs:68:13 thread 'main' panicked at 'attempt to add with overflow' tap.rs:68:13 -m128 - loading tape Sep 6, 2021
@pacmancoder
Copy link
Collaborator

@georgik Thanks for the report! Huh, interesting, maybe dizzy intentionally loads some data with destination pointer overflow. Does it load/work correctly when compiled with --release? (Rust does not check for overflow in release)

@georgik
Copy link
Author

georgik commented Sep 6, 2021

@pacmancoder Thank you for the response. Your hint is correct. Build with --release works.

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

Successfully merging a pull request may close this issue.

2 participants