Bavi_H wrote:
If you are using FCEUX's lua scripting, you can gather some information about the current sound register values by using sound.get(). In the help file, go to the Lua Functions List and search for sound.get() to see the overview of what's available. Then see the examples SoundDisplay.lua and SoundDisplay2.lua included with FCEUX or see my example script Scrolling Pitch Display.
Reading this is kind of ironic, because reading the actual addresses is the alternative to sound.get() I'm trying to make. It seems that FCEUX updates the APU information, provided by the function, once the frame has finished playing. I'm writing a Lua script, that needs to be synced with the changes in the sound channels, and using sound.get() creates a one frame delay. This is why I want to be able to get information directly from the APU's RAM addresses, so that my script can update along with them.
Bavi_H wrote:
Here's a complicated idea I've thought of, but haven't tried: Use FCEUX's lua memory.registerwrite to capture any attempts to write to the sound registers. When a write to a sound register is captured, examine the currently executing instruction using memory.readbyte(memory.getregister("pc")), figure out what CPU register is the value being written based on the instruction, then get that CPU register's value (using memory.getregister) and display it on the screen or store it in a lua variable or array or something.
I might try that. There doesn't seem to be any other solution at this point.
_________________
Greetings! I'm That Bio Mechanical Dude and I like creating various stuff like movies, games and of course chiptunes!
You can check out my
YouTube Channel.
You can also follow me on
Twitter.