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

More debugging / hacking functionality #337

Open
eliasreid opened this issue Apr 11, 2021 · 4 comments
Open

More debugging / hacking functionality #337

eliasreid opened this issue Apr 11, 2021 · 4 comments

Comments

@eliasreid
Copy link

I experimenting with some in-RAM / register game hacking (ex. In Pokemon, change the move a trainer will use before they use it, etc). Emulators like BGB (https://bgb.bircd.org/) and Bizhawk (https://github.com/TASVideos/BizHawk) are helpful because they allow for things like breaking on address execution, or adding Lua scripts that are executed on certain conditions.

I think it would be really cool (at least for a project I have in mind) to add API to the wasmboy lib, to allow for executing callbacks on certain conditions, and modifying the internal state (registers, memory, etc). Right now from what I can tell (I'm a JavaScript / Web noob), the lib only allows for a single read and write breakpoint. I think it would be possible to extend the current "plugins" functionality to achieve some of these things?

I'm curious if this is way out of scope for the goals of this project, and if you have a sense of how hard this would be. I would be interested in attempting to contribute some of these features.

@eliasreid
Copy link
Author

Sorry, I just realized after looking at the code a bit more that there is already functionality for a program counter breakpoint, awesome!

I guess to re-phrase my issue as simpler question. Is there currently a way for a library consumer to write to the gameboy's memory and registers?

@torch2424
Copy link
Owner

Hello! Sorry for the super late reply! I was out last week for vacation, and then been catching up on open source things 😄

I experimenting with some in-RAM / register game hacking (ex. In Pokemon, change the move a trainer will use before they use it, etc). Emulators like BGB (https://bgb.bircd.org/) and Bizhawk (https://github.com/TASVideos/BizHawk) are helpful because they allow for things like breaking on address execution, or adding Lua scripts that are executed on certain conditions.

Ah yes! I haven't worked on WasmBoy for a while due to lack of time. But I noticed a lot of emulators were implementing that feature! I think it's super rad! 😄

I think it would be really cool (at least for a project I have in mind) to add API to the wasmboy lib, to allow for executing callbacks on certain conditions, and modifying the internal state (registers, memory, etc). Right now from what I can tell (I'm a JavaScript / Web noob), the lib only allows for a single read and write breakpoint. I think it would be possible to extend the current "plugins" functionality to achieve some of these things?

Oh yeah! Totally, the API is a bit wacky, but I think there is a way to set breakpoints, because I know I am doing it for the debugger, using the WasmBoy API.

I'm curious if this is way out of scope for the goals of this project, and if you have a sense of how hard this would be. I would be interested in attempting to contribute some of these features.

Totally not out of scope! Would be happy to review and merge some PRs! 😄

Sorry, I just realized after looking at the code a bit more that there is already functionality for a program counter breakpoint, awesome!
I guess to re-phrase my issue as simpler question. Is there currently a way for a library consumer to write to the gameboy's memory and registers?

No worries! 😄 I think there should be! All the memory for the ROM and things, should be in Wasm Memory. So as long as your 3P script, or modifying script writes to the Wasm memory should be good to go! 😄

@eliasreid
Copy link
Author

Thank you for the reply! I started trying to figure out some of this stuff, but as a non-web developer it was a bit overwhelming to follow everything (between WASM, web workers, JS in general..), and I found that BizHawk has a plugin system that pretty much exactly matches what I need.

@torch2424
Copy link
Owner

@eliasreid Ah yeah! This project definitely isn't a completed, end-user ready library. Definitely, I'd reccomend using something like BizHawk if you aren't too familiar with a Modern JS web Development stack (and possibly even some of the rough edges with Wasm 😄 )

Cool! Glad you found something that works for you! 😄 👍 Again, thank you for reaching out! 😄

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