Skip to content

Commit

Permalink
pnes/psnes: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste committed Mar 4, 2022
1 parent 5130ae3 commit ca15739
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions pnes/sources/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C" int sceSystemServiceLoadExec(const char *path, const char *args[]);
#endif

UiMenu *uiMenu;
PNESGuiEmu *uiEmu;
PNESUiEmu *uiEmu;
PNESConfig *cfg;
PNESUIStateMenu *uiState;
RomList *romList;
Expand Down Expand Up @@ -133,7 +133,7 @@ int main(int argc, char **argv) {
romList->build();
uiRomList = new UIRomList(ui, romList, ui->getSize());
uiMenu = new UiMenu(ui);
uiEmu = new PNESGuiEmu(ui);
uiEmu = new PNESUiEmu(ui);
uiState = new PNESUIStateMenu(ui);
ui->init(uiRomList, uiMenu, uiEmu, uiState);

Expand Down
2 changes: 1 addition & 1 deletion pnes/sources/pnes_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern nstpaths_t nstpaths;
extern Emulator emulator;

// C2DUI
extern PNESGuiEmu *uiEmu;
extern PNESUiEmu *uiEmu;

void nst_ogl_init() {
uiEmu->addVideo(nullptr, nullptr, {basesize.w, basesize.h});
Expand Down
16 changes: 8 additions & 8 deletions pnes/sources/uiEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "c2dui.h"
#include "uiEmu.h"

extern PNESGuiEmu *uiEmu;
extern PNESUiEmu *uiEmu;

/// NESTOPIA
settings_t conf;
Expand All @@ -28,11 +28,11 @@ extern Nes::Core::Input::Controllers *cNstPads;
extern Emulator emulator;
/// NESTOPIA

PNESGuiEmu::PNESGuiEmu(UiMain *ui) : UiEmu(ui) {
PNESUiEmu::PNESUiEmu(UiMain *ui) : UiEmu(ui) {
printf("PNESGuiEmu()\n");
}

int PNESGuiEmu::load(const ss_api::Game &game) {
int PNESUiEmu::load(const ss_api::Game &game) {
getUi()->getUiProgressBox()->setTitle(game.getName().text);
getUi()->getUiProgressBox()->setMessage("Please wait...");
getUi()->getUiProgressBox()->setProgress(0);
Expand Down Expand Up @@ -64,7 +64,7 @@ int PNESGuiEmu::load(const ss_api::Game &game) {
return UiEmu::load(game);
}

void PNESGuiEmu::stop() {
void PNESUiEmu::stop() {
nst_pause();

// Remove the cartridge and shut down the NES
Expand All @@ -78,11 +78,11 @@ void PNESGuiEmu::stop() {
UiEmu::stop();
}

bool PNESGuiEmu::onInput(c2d::Input::Player *players) {
bool PNESUiEmu::onInput(c2d::Input::Player *players) {
return UiEmu::onInput(players);
}

void PNESGuiEmu::onUpdate() {
void PNESUiEmu::onUpdate() {
if (!isPaused()) {

// fps
Expand Down Expand Up @@ -216,7 +216,7 @@ void audio_adj_volume() {
}

/// NESTOPIA CONFIG
void PNESGuiEmu::nestopia_config_init() {
void PNESUiEmu::nestopia_config_init() {

// Video
conf.video_filter = 0;
Expand Down Expand Up @@ -277,7 +277,7 @@ void PNESGuiEmu::nestopia_config_init() {
}

// NESTOPIA CORE INIT
int PNESGuiEmu::nestopia_core_init(const char *rom_path) {
int PNESUiEmu::nestopia_core_init(const char *rom_path) {

// Set up directories
nst_set_dirs();
Expand Down
4 changes: 2 additions & 2 deletions pnes/sources/uiEmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

#include <string>

class PNESGuiEmu : public c2dui::UiEmu {
class PNESUiEmu : public c2dui::UiEmu {

public:

explicit PNESGuiEmu(c2dui::UiMain *ui);
explicit PNESUiEmu(c2dui::UiMain *ui);

int load(const ss_api::Game &game) override;

Expand Down
4 changes: 2 additions & 2 deletions psnes/sources/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern "C" int sceSystemServiceLoadExec(const char *path, const char *args[]);
#endif

PSNESUIMenu *uiMenu;
PSNESUIEmu *uiEmu;
PSNESUiEmu *uiEmu;
PSNESConfig *cfg;
PSNESUIStateMenu *uiState;
RomList *romList;
Expand Down Expand Up @@ -129,7 +129,7 @@ int main(int argc, char **argv) {
romList->build();
uiRomList = new UIRomList(ui, romList, ui->getSize());
uiMenu = new PSNESUIMenu(ui);
uiEmu = new PSNESUIEmu(ui);
uiEmu = new PSNESUiEmu(ui);
uiState = new PSNESUIStateMenu(ui);
ui->init(uiRomList, uiMenu, uiEmu, uiState);

Expand Down
14 changes: 7 additions & 7 deletions psnes/sources/uiEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ std::string getButtonId(int player, const std::string &name) {
return "Joypad" + std::to_string(player) + " " + name;
}

PSNESUIEmu::PSNESUIEmu(UiMain *ui) : UiEmu(ui) {
PSNESUiEmu::PSNESUiEmu(UiMain *ui) : UiEmu(ui) {

printf("PSNESUIEmu()\n");
_ui = ui;
}

int PSNESUIEmu::load(const ss_api::Game &game) {
int PSNESUiEmu::load(const ss_api::Game &game) {

ui->getUiProgressBox()->setTitle(game.getName().text);
ui->getUiProgressBox()->setMessage("Please wait...");
Expand Down Expand Up @@ -289,7 +289,7 @@ int PSNESUIEmu::load(const ss_api::Game &game) {
return UiEmu::load(game);
}

void PSNESUIEmu::stop() {
void PSNESUiEmu::stop() {

Settings.StopEmulation = TRUE;

Expand Down Expand Up @@ -323,11 +323,11 @@ void PSNESUIEmu::stop() {
UiEmu::stop();
}

bool PSNESUIEmu::onInput(c2d::Input::Player *players) {
bool PSNESUiEmu::onInput(c2d::Input::Player *players) {
return UiEmu::onInput(players);
}

void PSNESUIEmu::onUpdate() {
void PSNESUiEmu::onUpdate() {

UiEmu::onUpdate();

Expand Down Expand Up @@ -365,12 +365,12 @@ void PSNESUIEmu::onUpdate() {
}
}

void PSNESUIEmu::pause() {
void PSNESUiEmu::pause() {
S9xSetSoundMute(TRUE);
UiEmu::pause();
}

void PSNESUIEmu::resume() {
void PSNESUiEmu::resume() {
S9xSetSoundMute(FALSE);
UiEmu::resume();
}
Expand Down
4 changes: 2 additions & 2 deletions psnes/sources/uiEmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

#include <string>

class PSNESUIEmu : public c2dui::UiEmu {
class PSNESUiEmu : public c2dui::UiEmu {

public:

explicit PSNESUIEmu(c2dui::UiMain *ui);
explicit PSNESUiEmu(c2dui::UiMain *ui);

int load(const ss_api::Game &game) override;

Expand Down

0 comments on commit ca15739

Please sign in to comment.