Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement getFps hc function #322

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/emulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ class Emulator {
ServiceManager& getServiceManager() { return kernel.getServiceManager(); }
RendererType getRendererType() const { return config.rendererType; }
Renderer* getRenderer() { return gpu.getRenderer(); }
u64 getTicks() { return cpu.getTicks(); }
};
4 changes: 4 additions & 0 deletions src/hydra_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class HC_GLOBAL HydraCore final : public hydra::IBase, public hydra::IOpenGlRend

// IFrontendDriven
void runFrame() override;
uint16_t getFps() override;

// IInput
void setPollInputCallback(void (*callback)()) override;
Expand Down Expand Up @@ -69,10 +70,13 @@ void HydraCore::runFrame() {
int y = !!checkButtonCallback(0, hydra::ButtonType::Analog1Up) - !!checkButtonCallback(0, hydra::ButtonType::Analog1Down);
hid.setCirclepadX(x * 0x9C);
hid.setCirclepadY(y * 0x9C);
hid.updateInputs(emulator->getTicks());

emulator->runFrame();
}

uint16_t HydraCore::getFps() { return 60; }

void HydraCore::reset() { emulator->reset(Emulator::ReloadOption::Reload); }

hydra::Size HydraCore::getNativeSize() { return {400, 480}; }
Expand Down
2 changes: 1 addition & 1 deletion third_party/hydra_core
Loading