Wow, aparrently setting memory.register completely breaks the emulation even though the Hex Editor already has that functionality outside of Lua via "write breakpoint".
And somehow, memory.register aparrently manages to fuck up everything related to registers or some garbage. Better hope you don't accidentally and unknowlingly change some somewhere!
Nevermind the fact this has been a part of FCEU XD since 2005:
But nope, let's create our own breakpoint function that completely fucks over the emulation if you happen to watch specific bytes, even when the original (still included!) debugger works fine.
Jesus christ.
I simply propose that memory.register works like this:
function somefunction(address, newvalue)
gui.text(1, 1, address .. " was changed to ".. newvalue);
end;
memory.register(0x2007, somefunction);
Which can actually provide new uses for things!
These would include
- Being able to use the same function for multiple addresses
- Being able to read values written to registers that are otherwise only readable with the debugger
- And more!
Instead of the current method, which as demonstrates has the amazing ability to completely blow up the emulation if you
dare read something unexpected! GASP