Dolphin, the GameCube and Wii emulator - Forums

Full Version: Technical question for devs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I take "FPS" from the Core.cpp line here:

Code:
float FPS = (float)frames / t;

And make it readable by Render.cpp?

What I'm trying to do is add Overlay Core FPS to the video plugin, because it differs from the Overlay FPS that it is currently in place... but this is what I'm stuck on, I got the option for it and everything else set up, but copying the actual count from Core to Render is a bit beyond me... I don't know all the namespaces and classes available to both...

Any help? Thanks.
anyone?
Man, you got a bit of problem here, I mean, the devs probably can tell you easly, but I just cant imagine how, since the two .cpp are coded in diferent styles... I would try to transform the fps count into a variable, and direct it to render.cpp but this wouldnt help much cause it would probably stay unreadeble... I'm relatively new to c++ coding, but the only solution I can see is to make a custom library with some comands that would make it possible to make it readeble by render.cpp, but there must be a more simple way. Sorry.
To send the variable into the plugin, you could try adding a pointer into the VideoIntialize thing and then have render.cpp access the pointer and read the FPS, problem is syncing issues.
Ideally, your approach would be better if the emulator did not use plugins.

You could make the FPS a global variable.

The current architecture though, makes that impossible.
running into walls all over the place. It's frustrating when I don't know C++ that well. I can figure out most errors, but I'm getting unresolved external link errors and when I try to reference them from the plugin. I got everything but the actual pass of the FPS from Core to Render... the option to show up in the config, save in the config properly, and I got both the Video and Core FPS texts to display on the screen. my brain hurts now. takin a break
just look in pluginspecs_dsp.h, it has something called "DSPInitialize", this struct we send to the plugin contains a bunch of pointers that all point to something in the core, you would access the pointer in the plugin to get the value from the core, but for something FPS, that will be updated constantly by the CPU, if the DSP runs on its own thread and you when you read it, you need to yield the CPU thread and get the value, then do w/e, after you finished using the variable, CPU thread can resume. This way you get every FPS read change.