SBSPSS/source/memcard/saveload.h

138 lines
2.4 KiB
C
Raw Normal View History

2001-01-03 16:55:10 +01:00
/*=========================================================================
saveload.h
Author: PKG
Created:
Project: SBSP
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
#ifndef __MEMCARD_SAVELOAD_H__
#define __MEMCARD_SAVELOAD_H__
/*----------------------------------------------------------------------
Includes
-------- */
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
2001-01-10 23:03:20 +01:00
#ifndef __GAME_GAMESLOT_H__
#include "game\gameslot.h"
#endif
2001-01-03 16:55:10 +01:00
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
struct SaveLoad_SystemDetails
{
2001-01-10 23:03:20 +01:00
char m_screenOffX,m_screenOffY;
2001-07-16 23:39:50 +02:00
unsigned char m_volumes[CSoundMediator::NUM_VOLUMETYPESTOSAVE];
2001-06-28 21:14:44 +02:00
unsigned char m_controlStyle,m_vibrationIsTurnedOn;
2001-01-10 23:03:20 +01:00
unsigned char m_language;
2001-01-03 16:55:10 +01:00
};
struct SaveLoad_DataBuffer
{
2001-01-10 23:03:20 +01:00
unsigned char m_headerId;
SaveLoad_SystemDetails m_systemDetails;
CGameSlotManager::GameSlot m_gameSlots[CGameSlotManager::NUM_GAME_SLOTS];
2001-01-03 16:55:10 +01:00
};
2001-01-10 23:03:20 +01:00
class CSaveLoadDatabase
2001-01-03 16:55:10 +01:00
{
public:
enum
{
INACTIVE,
IN_PROGRESS,
FINISHED_OK,
FAILED,
} STATUS;
2001-01-10 23:03:20 +01:00
CSaveLoadDatabase();
~CSaveLoadDatabase();
2001-01-03 16:55:10 +01:00
void think();
void gatherData();
bool startSave(char *_filename,int _fileNum=-1);
int getSaveStatus();
bool startLoad(int _file);
int getLoadStatus();
bool startFormat();
int getFormatStatus();
void startAutoload();
bool monitorAutoload();
private:
enum
{
MC_HEADER_SIZE=256,
};
enum
{
2001-07-16 23:39:50 +02:00
SAVELOAD_HEADERID=3,
2001-01-03 16:55:10 +01:00
};
void createData();
2001-07-21 21:32:46 +02:00
void restoreData(int _loadSettingsOnly);
2001-01-03 16:55:10 +01:00
void allocateBuffer();
void freeBuffer();
SaveLoad_DataBuffer m_dataBuffer;
int m_saving,m_loading,m_formatting,m_autoloading;
unsigned char *m_tempBuffer;
int m_bufferSize;
unsigned char *m_memcardHeader;
int m_autoloadFrameCounter;
};
/*----------------------------------------------------------------------
Globals
------- */
/* Vars
---- */
/* Data
---- */
/* Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __MEMCARD_SAVELOAD_H__ */
/*===========================================================================
end */