pineman / fpt Goto Github PK
View Code? Open in Web Editor NEWGameboy emulator (yes, written in rust)
License: MIT License
Gameboy emulator (yes, written in rust)
License: MIT License
Try to break execution before the instruction is actually executed, somehow. Hard to do because pc is constant for at least 4 cycles, and obviously we don't want to pause execution 4 times in a row
See #55
Calling break(N)
in the debugger triggers a panic in hlua
When I run
RUST_BACKTRACE=1 cargo run debug <<EOF
print "gonna break 150"
break(150)
print "broke 150"
EOF
I'm expecting
gonna break 150
broke 150
CTRL-D
Instead, I'm getting this:
gonna break 150
thread 'main' panicked at library\core\src\panicking.rs:136:5:
attempted to leave type `&mut hlua::Lua<'_>` uninitialized, which is invalid
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0/library\std\src\panicking.rs:597
1: core::panicking::panic_nounwind_fmt
at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0/library\core\src\panicking.rs:106
2: core::panicking::panic_nounwind
at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0/library\core\src\panicking.rs:136
3: core::mem::uninitialized
at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0\library\core\src\mem\mod.rs:692
4: hlua::PushGuard<ref_mut$<hlua::Lua> >::into_inner<ref_mut$<hlua::Lua> >
at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lib.rs:228
5: hlua::lua_functions::impl$2::push_to_lua<ref_mut$<hlua::Lua>,std::io::cursor::Cursor<ref$<slice2$<u8> > > >
at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lua_functions.rs:163
6: hlua::lua_functions::LuaFunction<ref_mut$<hlua::Lua> >::load_from_reader<ref_mut$<hlua::Lua>,std::io::cursor::Cursor<ref$<slice2$<u8> > > >
at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lua_functions.rs:324
7: hlua::lua_functions::LuaFunction<ref_mut$<hlua::Lua> >::load<ref_mut$<hlua::Lua> >
at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lua_functions.rs:338
8: hlua::Lua::execute<enum2$<hlua::any::AnyHashableLuaValue> >
at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lib.rs:678
9: fpt::debugger::DebuggerTextInterface::run
at .\fpt\src\debugger.rs:353
10: fpt_cli::debug
at .\fpt-cli\src\main.rs:50
11: fpt_cli::main
at .\fpt-cli\src\main.rs:110
12: core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,enum2$<rustyline::error::ReadlineError> > > (*)(),tuple$<> >
at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread caused non-unwinding panic. aborting.
error: process didn't exit successfully: `target\debug\fpt-cli.exe debug` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
Automated test suite against real game roms
pc + 3
is hardcoded in call
but RST is only 1 byte
Line 559 in 72dbabe
Should we add a license to this project?
Which one should we use?
Add stack traces to the emulator.
We can do this by just keeping track of the PC values when issuing calls. but it would be nicer if this somehow included debug information.
RGBDS usually outputs files like the one attached (typically with the .sym extension but github doesn't like that):
rst_timing.txt.
We could read this information and enrich the stacktraces with it.
Allow to use breakpoints with function names. Would probably mean implemented reading .sym files produced by RGBDS, see #56.
Properly log errors
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.