|
|
Joined: Apr 2021
Posts: 46 Likes: 19
Member
|
OP
Member
Joined: Apr 2021
Posts: 46 Likes: 19 |
Did you know the Famicom had a Gameboy mode 6 years before the release of the handheld? ![[Linked Image from imgur.com]](https://imgur.com/j76i83K.png) Ok, apologies for the clickbait-y idea I stole from YT. I just wanted to draw attention to the cool memory tap addition Vas made to the Lua system yesterday. I had wanted to intercept memory read/writes from Lua before but didn't know how to do it. Here's my newb Lua script to force the NES PPU to always be in "green-scale": function callback(offset, data, mask) return data | 0x41 end
memory = manager.machine.devices[":maincpu"].spaces["program"]
if passthrough == nil then
passthrough = memory:install_write_tap(0x2001, 0x2001, "gbmode", callback)
else
passthrough:reinstall()
end
emu.register_stop(function() passthrough:remove() end)
|
3 members like this:
MrBogi, R. Belmont, Dullaron |
|
|
|
Joined: Feb 2004
Posts: 2,383 Likes: 98
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,383 Likes: 98 |
Thanks, I wanted to show a silly tap demo like this to demonstrate the new functionality, but hadn’t thought of a nice simple but visible example. You beat me to it. I’m working on addressing some pitfalls in the new Lua functionality so it’ll be easier to use by the time 0.241 is released (e.g. not crashing with a pure virtual function call if you don’t remember to explicitly remove your taps, and not having symbol tables garbage collected out from under you while you have expressions other symbol tables that depend on them).
|
1 member likes this:
MrBogi |
|
|
|
Joined: Feb 2004
Posts: 2,383 Likes: 98
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,383 Likes: 98 |
|
|
|
|
Joined: Apr 2021
Posts: 46 Likes: 19
Member
|
OP
Member
Joined: Apr 2021
Posts: 46 Likes: 19 |
Yesterday I made a quick and dirty hack of the dummy plugin and combined it with the "gbmode" tap example to expose all the 0x2001 register bits. Here's SMB3's World 1 map screen (the gray background should match the monochrome yellow theme; it's a PPU bug with a pending PR): ![[Linked Image from imgur.com]](https://imgur.com/Y3cqOai.png) I figure doing things like this and similarly being able to switch audio channels on and off from a plugin will be useful for testing purposes.
|
|
|
|
Joined: Feb 2004
Posts: 2,383 Likes: 98
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,383 Likes: 98 |
If it can speed up turnaround time for testing, that’s great. Hopefully it’ll also be useful for sophisticated cheat/hack applications, and other fun things. I build tools and hope people do cool things with them.
|
1 member likes this:
MrBogi |
|
|
1 members (Pernod),
21
guests, and
3
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,102
Posts119,266
Members5,019
|
Most Online890 Jan 17th, 2020
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|
|