2016-12-19 19:20:30 +00:00
|
|
|
#ifndef __URDE_CSAVEUI_HPP__
|
|
|
|
#define __URDE_CSAVEUI_HPP__
|
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "CToken.hpp"
|
|
|
|
#include "CIOWin.hpp"
|
|
|
|
#include "CMemoryCardDriver.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CTexture;
|
|
|
|
class CStringTable;
|
|
|
|
class CGuiFrame;
|
|
|
|
class CSaveWorld;
|
|
|
|
class CFinalInput;
|
|
|
|
class CGuiTextPane;
|
|
|
|
class CGuiTableGroup;
|
|
|
|
|
|
|
|
namespace MP1
|
|
|
|
{
|
|
|
|
|
2016-12-30 06:37:01 +00:00
|
|
|
enum class ESaveContext
|
|
|
|
{
|
|
|
|
FrontEnd,
|
|
|
|
InGame
|
|
|
|
};
|
|
|
|
|
2016-12-21 20:44:30 +00:00
|
|
|
class CSaveUI
|
2016-12-19 19:20:30 +00:00
|
|
|
{
|
2016-12-21 20:44:30 +00:00
|
|
|
public:
|
2016-12-30 06:37:01 +00:00
|
|
|
enum class EUIType
|
2016-12-19 19:20:30 +00:00
|
|
|
{
|
2016-12-29 05:53:00 +00:00
|
|
|
Empty = 0,
|
|
|
|
BusyReading = 1,
|
|
|
|
BusyWriting = 2,
|
|
|
|
NoCardFound = 3,
|
|
|
|
NeedsFormatBroken = 4,
|
|
|
|
NeedsFormatEncoding = 5,
|
|
|
|
CardDamaged = 6,
|
|
|
|
WrongDevice = 7,
|
|
|
|
InsufficientSpaceBadCheck = 8,
|
|
|
|
InsufficientSpaceOKCheck = 9,
|
|
|
|
IncompatibleCard = 10,
|
|
|
|
SaveCorrupt = 11,
|
|
|
|
StillInsufficientSpace = 12,
|
|
|
|
ProgressWillBeLost = 13,
|
|
|
|
NotOriginalCard = 14,
|
|
|
|
AllDataWillBeLost = 15,
|
2017-01-09 03:44:00 +00:00
|
|
|
SaveReady = 16
|
2016-12-19 19:20:30 +00:00
|
|
|
};
|
|
|
|
|
2017-01-09 03:44:00 +00:00
|
|
|
bool IsHiddenFromFrontEnd()
|
2016-12-19 19:20:30 +00:00
|
|
|
{
|
|
|
|
switch (x10_uiType)
|
|
|
|
{
|
2017-01-09 03:44:00 +00:00
|
|
|
case EUIType::SaveReady:
|
2016-12-30 06:37:01 +00:00
|
|
|
case EUIType::Empty:
|
|
|
|
case EUIType::BusyReading:
|
|
|
|
case EUIType::BusyWriting:
|
2016-12-19 19:20:30 +00:00
|
|
|
return false;
|
|
|
|
default:
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-21 20:44:30 +00:00
|
|
|
private:
|
2016-12-30 06:37:01 +00:00
|
|
|
ESaveContext x0_saveCtx;
|
2016-12-24 00:45:51 +00:00
|
|
|
u64 x8_serial;
|
2016-12-30 06:37:01 +00:00
|
|
|
EUIType x10_uiType = EUIType::Empty;
|
2016-12-19 19:20:30 +00:00
|
|
|
TLockedToken<CTexture> x14_txtrSaveBanner;
|
|
|
|
TLockedToken<CTexture> x20_txtrSaveIcon0;
|
|
|
|
TLockedToken<CTexture> x2c_txtrSaveIcon1;
|
|
|
|
TLockedToken<CStringTable> x38_strgMemoryCard;
|
|
|
|
TLockedToken<CGuiFrame> x44_frmeGenericMenu;
|
|
|
|
CGuiFrame* x50_loadedFrame = nullptr;
|
|
|
|
CGuiTextPane* x54_textpane_message;
|
|
|
|
CGuiTableGroup* x58_tablegroup_choices;
|
|
|
|
CGuiTextPane* x5c_textpane_choice0;
|
|
|
|
CGuiTextPane* x60_textpane_choice1;
|
|
|
|
CGuiTextPane* x64_textpane_choice2;
|
|
|
|
CGuiTextPane* x68_textpane_choice3;
|
|
|
|
std::unique_ptr<CMemoryCardDriver> x6c_cardDriver;
|
|
|
|
std::vector<TLockedToken<CSaveWorld>> x70_saveWorlds;
|
2016-12-24 00:45:51 +00:00
|
|
|
CIOWin::EMessageReturn x80_iowRet = CIOWin::EMessageReturn::Normal;
|
2016-12-19 19:20:30 +00:00
|
|
|
u32 x84_navConfirmSfx = 1460;
|
|
|
|
u32 x88_navMoveSfx = 1461;
|
|
|
|
u32 x8c_navBackSfx = 1459;
|
2016-12-24 00:45:51 +00:00
|
|
|
bool x90_needsDriverReset = false;
|
2016-12-29 05:53:00 +00:00
|
|
|
bool x91_uiTextDirty = false;
|
2016-12-31 00:51:51 +00:00
|
|
|
bool x92_savingDisabled = false;
|
2016-12-30 06:37:01 +00:00
|
|
|
bool x93_inGame;
|
2016-12-19 19:20:30 +00:00
|
|
|
|
2016-12-29 05:53:00 +00:00
|
|
|
void ContinueWithoutSaving();
|
2016-12-24 00:45:51 +00:00
|
|
|
|
2016-12-21 20:44:30 +00:00
|
|
|
public:
|
2016-12-30 06:37:01 +00:00
|
|
|
static std::unique_ptr<CMemoryCardDriver> ConstructCardDriver(bool inGame);
|
2017-01-09 03:44:00 +00:00
|
|
|
void ResetCardDriver();
|
2016-12-19 19:20:30 +00:00
|
|
|
CIOWin::EMessageReturn Update(float dt);
|
2016-12-30 06:37:01 +00:00
|
|
|
void SetInGame(bool v) { x93_inGame = v; }
|
2016-12-19 19:20:30 +00:00
|
|
|
bool PumpLoad();
|
2016-12-30 06:37:01 +00:00
|
|
|
EUIType SelectUIType() const;
|
2016-12-29 05:53:00 +00:00
|
|
|
void SetUIText();
|
|
|
|
void SetUIColors();
|
2016-12-19 19:20:30 +00:00
|
|
|
void Draw() const;
|
|
|
|
|
|
|
|
void DoAdvance(CGuiTableGroup* caller);
|
2017-01-09 03:44:00 +00:00
|
|
|
void DoSelectionChange(CGuiTableGroup* caller, int userSel);
|
2016-12-19 19:20:30 +00:00
|
|
|
|
|
|
|
void ProcessUserInput(const CFinalInput& input);
|
|
|
|
void StartGame(int idx);
|
2016-12-31 00:51:51 +00:00
|
|
|
void SaveNESState();
|
2016-12-19 19:20:30 +00:00
|
|
|
void EraseGame(int idx);
|
2016-12-30 06:37:01 +00:00
|
|
|
const CGameState::GameFileStateInfo* GetGameData(int idx) const;
|
|
|
|
EUIType GetUIType() const { return x10_uiType; }
|
2016-12-31 00:51:51 +00:00
|
|
|
bool IsSavingDisabled() const { return x92_savingDisabled; }
|
2016-12-30 06:37:01 +00:00
|
|
|
CSaveUI(ESaveContext saveCtx, u64 serial);
|
2016-12-19 19:20:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CSAVEUI_HPP__
|