So here's the fun thing about the PVM (PWK Virtual Machine) used by Wheel of Fortune (2010, Wii) and a bunch of other spigot games:
It's a stack-based VM (a stack machine), but it's not a simple one. It's a typed stack, as it's built of an array PVariable* which is a base class with a bunch of subclasses. So you get polymorphism with your stack.
and it's not just simple types either.
Aside from a few dozen interfaces/junctions to complex internal game engine objects, you've got XForm3s which are dual-matrixes, 2D points, Colors, three different kind of variable references, a sort of "Promise" integrating with the coroutine system, strings, booleans, ints, floats, function pointers, dictionaries, arrays, custom structures, and coroutines
so in theory there's an absolutely massive amount of information that can be extracted out of run-time tracing of this scripting engine because of the various reflection features provided.
in reality this is a slight nightmare that's going to involve modifying the emulator because the existing tools are simply not up to the task of dumping all this info
I flew too close to the sun
I'm pretty sure these programmers were trying to hide information from the compiler.
when you find yourself doing this, you need to stop and rethink your life. go for a walk.

Writing a script to edit your debugger's config files to mass-install breakpoints by the hundreds isn't normal

but on Foone it is

don't do reverse engineering, kids. it's bad for your brain.
125 logging breakpoints is normal for playing a game, right?
it just generates 1.4gb of logs booting up to the title screen. that's fine.

So I think I understand the basics of how the resource system works, and it's slightly wild.
So, step one, it just freads() the data in the datafiles into their destination structures.

Now, this isn't going to work, for a lot of reasons. pointers, mainly.

but that's the basics for how all resources are loaded. everything from sound effects to textures to models to puzzle solutions

but the pointers!

so, step two: it runs a per-type "fixup" function that takes the utterly corrupted fread()ed data in the structs and unmangles it back into the correct object setup

which mainly consists of going through all the pointers, extracting their values (which are not, in fact, valid addresses at this point (no pun intended)) and somehow turning them into real pointers
one way this is implemented is that a bunch of structures feature anonymous unions, and one member will be something like KeyTransDataTempl*, and the other member will be a ulong named "nOffsetTransData", which is an offset to where in the datafile the data that should be in the KeyTransDataTempl object was stored

this is not the most elegant or simple or flexible deserialization system I've ever seen.

but it's certainly not the worst

oh god I do not like seeing code that basically says
obj.__vtable = obj.__vtable + parentclass.__vtable
foone's law of C++ coding:
if you have to think about a vtable, you're going to have a bad day
I tried to hack the text of this dialog box but it turned out to be too annoying to overwrite strings in Dolphins memory editor so I switched to Cheat Engine which crashed as soon as I tried to search. So there.
I managed to get to the next level of codewarrior's useless function parameter listing:
it's not listing parameters that are not in the function!

SoundSystem::createSoundEvent(SoundSystem *,char *,int ,Point3 *,Point3 *,Point3 *)

CW's debug: the SoundEventHandle* parameter is named "seh"!

WHAT SOUND EVENT HANDLED PARAMETER
ugh. I'm hitting what I'm pretty sure is an emulator bug, and I'm pretty sure it's in the part of the emulator that I wrote.
or maybe they are trying to play a sound file named "��y�P
damn it. I don't have a way to extract the fmod sounds from the game, because apparently fmod stores files in native byte order. so all the tools assume little endian, and this is a wii game, so... nothing.
but I have discovered there is probably a hidden soundfile in the game designed to play when you are cheating.
hacked it into playing. it's just some of the usual chimes played in a different order.
I was hoping they'd gotten Pat Sajak to yell at me for cheating ;_;
Pat Sajak will retire from Wheel of Fortune in 2024

Well, the time has come. I’ve decided that our 41st season, which begins in September, will be my last. It’s been a wonderful ride, and I’ll have more to say in the coming months. Many thanks to...

@foone there are 41 seasons to "train" an "artificial intelligence" to sound like Pat Sajak. But why go through that effort when you can put his Scooby-Doo impression on a loop?
@foone when i was trying to handle date and time in c++ i kept writing to files like that
@gewt did you happen to work for pipeworks about 13 years ago:?
@foone dont you love it when it see an unexpected behavior and you *immediately* suspect what you didnt anticipate and when it happened
@foone Foone I appreciate that I can step away from fedi for a few minutes and come back to find you've filled my timeline with incoherent ramblings that can only happen deep in a thread of yours 😆

@foone I miss /usr/games instead of ~/.local/share/steam/steamapps &c.

(Yes, I know, the BSDs still use /usr/games for the terminal games they've always had)

@foone Also, dammit, Tusky, you jumped right when I hit reply to a post and replied to the wrong one (in case you thought this was a complete nonsequitur)
@foone if you try to use C++ you're gonna have a bad time
@foone the true wheel of fortune was inside us all along!
@foone wh... isn't __vtable a pointer? so the thing it freads into __vtable is the offset from the base class vtable to the subclass vtable? which relies on the linker always emitting the vtables for all resource types in the same arrangement?? 
@foone I've written this exact scheme for Gen 3 consoles and it's absolutely worth it to not hit the memory allocator, and all the extra memory that allocations need to be tracked, and more bonus if it's coming off a spinning disc in one enormous slab. Reducing the clean up to one free() is pretty great too.
@foone we absolutely used POD structures though, no vtable madness
@foone how are you finding these data types? Does the game contain debug symbols?
@foone isn't this how DLL relocation works?
@tthbaltazar kinda! Except that's an OS feature, and this is WHEEL OF FORTUNE FOR THE WII

@foone define what the OS is

under linux it's a regular library or executable in userspace

@foone ah yes of course i know this one, use after fread()
@foone Geeze. Are you writing the contents of the disc to the log every line? lol
@robotfactory Nah, I'm just dumping the whole potential-stack every time the VM runs an instruction, and it takes 280,000 instructions to hit the start menu
@foone Still better than Spotify taking 10GB of disk space for no reason
@instereo256 @foone Is it caching music or is that literally the executable size?
@stilescrisis @foone i don't remember, it was a 10GB folder in appdata, and the size never changed
@instereo256 @foone yeah that's a cache
@stilescrisis @foone still though, 10GB? it was so annoying when i had a small SSD and i couldn't turn it off, nor the desktop app ever told me what is it for