Implement TransferPakRTCReader and add a "Print Game Clock" menu option temporarily

This commit is contained in:
Philippe Symons
2025-03-04 13:12:58 +01:00
parent d106863b50
commit a6fb80f8c4
15 changed files with 220 additions and 5 deletions

View File

@@ -116,4 +116,6 @@ void askConfirmationWipeSave(void* context, const void* param);
*/
void resetRTC(void* context, const void* param);
void printClock(void* context, const void* param);
#endif

View File

@@ -22,6 +22,7 @@ public:
void render(RDPQGraphics& gfx, const Rectangle& sceneBounds) override;
protected:
private:
char headerTextString_[128];
uint8_t fontIdMainFont_;
uint8_t fontMainFontStyleWhiteId_;
sprite_t* logoLibDragon_;

View File

@@ -32,6 +32,7 @@ private:
void loadSaveMetadata();
const char* getGameTypeString();
char pokeMe64String_[48];
sprite_t* menu9SliceSprite_;
TransferPakDetectionWidget tpakDetectWidget_;
WidgetFocusChainSegment tpakDetectWidgetSegment_;

View File

@@ -54,6 +54,11 @@ public:
*/
void switchGBROMBank(uint8_t bankIndex);
/**
* @brief Returns whether we called setRAMEnabled(true) on this TransferPakManager instance before
*/
bool isRAMEnabled() const;
/**
* @brief This function enables/disables gameboy RAM/RTC access.
* WARNING: it switches to transfer pak bank 0
@@ -110,6 +115,7 @@ protected:
private:
joypad_port_t port_;
bool isPoweredOn_;
bool ramEnabled_;
uint8_t currentSRAMBank_;
uint16_t readBufferBankOffset_;
uint16_t writeBufferSRAMBankOffset_;

View File

@@ -0,0 +1,28 @@
#ifndef _TRANSFERPAKRTCREADER_H
#define _TRANSFERPAKRTCREADER_H
#include "RTCReader.h"
class TransferPakManager;
/**
* @brief This class implements the IRTCReader interface specifically for the N64 Transfer Pak with libdragon
*/
class TransferPakRTCReader : public BaseRTCReader
{
public:
TransferPakRTCReader(TransferPakManager& tpakManager);
virtual ~TransferPakRTCReader();
/**
* This function will grab the current values of the RTC chip and store them internally
*
* Use the getXYZ() functions to actually retrieve this data
*/
void latch() override;
protected:
private:
TransferPakManager& tpakManager_;
};
#endif

8
include/version.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef _VERSION_H
#define _VERSION_H
#define POKEME64_VERSION_NUMBER "0.4"
const char* getPokeMe64VersionString();
#endif