2014-03-28 20:06:15 +01:00
# include "stdafx.h"
2014-06-02 19:27:24 +02:00
# include "Emu/Memory/Memory.h"
# include "Emu/System.h"
# include "Emu/SysCalls/Modules.h"
2014-11-10 01:21:50 +01:00
# include "Emu/SysCalls/CB_FUNC.h"
2014-08-23 22:40:04 +02:00
2014-08-26 01:55:37 +02:00
# include "Emu/FS/VFS.h"
2014-06-02 19:27:24 +02:00
# include "Emu/FS/vfsFile.h"
# include "Emu/FS/vfsDir.h"
2014-03-28 20:06:15 +01:00
# include "Loader/PSF.h"
2014-09-04 19:32:20 +02:00
# include "cellSaveData.h"
2014-03-28 20:06:15 +01:00
2014-12-26 09:06:12 +01:00
# ifdef _WIN32
# include <windows.h>
# undef CreateFile
# else
# include <sys/types.h>
# include <sys/stat.h>
# endif
2015-02-18 17:22:06 +01:00
extern Module cellSysutil ;
2014-03-28 20:06:15 +01:00
// Auxiliary Classes
2015-04-15 16:27:37 +02:00
class SortSaveDataEntry
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
const u32 m_type ;
const u32 m_order ;
2014-03-28 20:06:15 +01:00
public :
2015-04-15 16:27:37 +02:00
SortSaveDataEntry ( u32 type , u32 order )
: m_type ( type )
, m_order ( order )
{
}
2014-04-09 18:23:14 +02:00
bool operator ( ) ( const SaveDataEntry & entry1 , const SaveDataEntry & entry2 ) const
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
if ( m_order = = CELL_SAVEDATA_SORTORDER_DESCENT )
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
if ( m_type = = CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME )
{
return entry1 . mtime > = entry2 . mtime ;
}
if ( m_type = = CELL_SAVEDATA_SORTTYPE_SUBTITLE )
{
2014-03-28 20:06:15 +01:00
return entry1 . subtitle > = entry2 . subtitle ;
2015-04-15 16:27:37 +02:00
}
2014-03-28 20:06:15 +01:00
}
2015-04-15 16:27:37 +02:00
if ( m_order = = CELL_SAVEDATA_SORTORDER_ASCENT )
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
if ( m_type = = CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME )
{
return entry1 . mtime < entry2 . mtime ;
}
if ( m_type = = CELL_SAVEDATA_SORTTYPE_SUBTITLE )
{
2014-03-28 20:06:15 +01:00
return entry1 . subtitle < entry2 . subtitle ;
2015-04-15 16:27:37 +02:00
}
2014-03-28 20:06:15 +01:00
}
2015-04-15 16:27:37 +02:00
2014-03-31 12:04:34 +02:00
return true ;
2014-03-28 20:06:15 +01:00
}
} ;
// Auxiliary Functions
2015-04-15 16:27:37 +02:00
u64 get_save_data_size ( const std : : string & dir )
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
u64 result = 0 ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
for ( const auto entry : vfsDir ( dir ) )
2014-12-26 09:06:12 +01:00
{
2015-04-15 16:27:37 +02:00
if ( ( entry - > flags & DirEntry_TypeMask ) = = DirEntry_TypeFile )
{
2015-04-15 17:12:10 +02:00
result + = entry - > size ;
2015-04-15 16:27:37 +02:00
}
2014-12-26 09:06:12 +01:00
}
2015-04-15 16:27:37 +02:00
return result ;
2014-03-28 20:06:15 +01:00
}
2014-09-02 03:05:13 +02:00
void addNewSaveDataEntry ( std : : vector < SaveDataEntry > & saveEntries , vm : : ptr < CellSaveDataListNewData > newData )
2014-03-31 12:04:34 +02:00
{
2014-04-09 18:23:14 +02:00
SaveDataEntry saveEntry ;
2014-09-04 19:32:20 +02:00
saveEntry . dirName = newData - > dirName . get_ptr ( ) ;
saveEntry . title = newData - > icon - > title . get_ptr ( ) ;
saveEntry . subtitle = newData - > icon - > title . get_ptr ( ) ;
2015-04-15 16:27:37 +02:00
//saveEntry.iconBuf = newData->icon->iconBuf.get_ptr();
//saveEntry.iconBufSize = newData->icon->iconBufSize;
2014-03-31 12:04:34 +02:00
saveEntry . isNew = true ;
// TODO: Add information stored in newData->iconPosition. (It's not very relevant)
saveEntries . push_back ( saveEntry ) ;
}
2014-04-09 18:23:14 +02:00
u32 focusSaveDataEntry ( const std : : vector < SaveDataEntry > & saveEntries , u32 focusPosition )
2014-03-31 12:04:34 +02:00
{
2014-03-31 20:30:07 +02:00
// TODO: Get the correct index. Right now, this returns the first element of the list.
2014-03-31 12:04:34 +02:00
return 0 ;
}
2014-09-02 03:05:13 +02:00
void setSaveDataList ( std : : vector < SaveDataEntry > & saveEntries , vm : : ptr < CellSaveDataDirList > fixedList , u32 fixedListNum )
2014-03-31 12:04:34 +02:00
{
2014-04-09 18:23:14 +02:00
std : : vector < SaveDataEntry > : : iterator entry = saveEntries . begin ( ) ;
2014-03-31 12:04:34 +02:00
while ( entry ! = saveEntries . end ( ) )
{
bool found = false ;
2014-12-24 19:47:56 +01:00
for ( u32 j = 0 ; j < fixedListNum ; j + + )
2014-03-31 12:04:34 +02:00
{
if ( entry - > dirName = = ( char * ) fixedList [ j ] . dirName )
{
found = true ;
break ;
}
}
if ( ! found )
entry = saveEntries . erase ( entry ) ;
else
entry + + ;
}
}
2014-09-02 03:05:13 +02:00
void setSaveDataFixed ( std : : vector < SaveDataEntry > & saveEntries , vm : : ptr < CellSaveDataFixedSet > fixedSet )
2014-04-09 18:23:14 +02:00
{
std : : vector < SaveDataEntry > : : iterator entry = saveEntries . begin ( ) ;
while ( entry ! = saveEntries . end ( ) )
{
2014-09-04 19:32:20 +02:00
if ( entry - > dirName = = fixedSet - > dirName . get_ptr ( ) )
2014-04-09 18:23:14 +02:00
entry = saveEntries . erase ( entry ) ;
else
entry + + ;
}
if ( saveEntries . size ( ) = = 0 )
{
SaveDataEntry entry ;
2014-09-04 19:32:20 +02:00
entry . dirName = fixedSet - > dirName . get_ptr ( ) ;
2014-04-09 18:23:14 +02:00
entry . isNew = true ;
saveEntries . push_back ( entry ) ;
}
2014-09-02 00:22:13 +02:00
if ( fixedSet - > newIcon )
2014-04-09 18:23:14 +02:00
{
2015-04-15 16:27:37 +02:00
//saveEntries[0].iconBuf = fixedSet->newIcon->iconBuf.get_ptr();
//saveEntries[0].iconBufSize = fixedSet->newIcon->iconBufSize;
2014-09-04 19:32:20 +02:00
saveEntries [ 0 ] . title = fixedSet - > newIcon - > title . get_ptr ( ) ;
saveEntries [ 0 ] . subtitle = fixedSet - > newIcon - > title . get_ptr ( ) ;
2014-04-09 18:23:14 +02:00
}
}
2014-09-02 03:05:13 +02:00
void getSaveDataStat ( SaveDataEntry entry , vm : : ptr < CellSaveDataStatGet > statGet )
2014-03-31 20:30:07 +02:00
{
if ( entry . isNew )
statGet - > isNewData = CELL_SAVEDATA_ISNEWDATA_YES ;
else
statGet - > isNewData = CELL_SAVEDATA_ISNEWDATA_NO ;
statGet - > bind = 0 ; // TODO ?
statGet - > sizeKB = entry . sizeKB ;
statGet - > hddFreeSizeKB = 40000000 ; // 40 GB. TODO ?
statGet - > sysSizeKB = 0 ; // TODO: This is the size of PARAM.SFO + PARAM.PDF
statGet - > dir . st_atime_ = 0 ; // TODO ?
statGet - > dir . st_mtime_ = 0 ; // TODO ?
statGet - > dir . st_ctime_ = 0 ; // TODO ?
2014-09-04 19:32:20 +02:00
strcpy_trunc ( statGet - > dir . dirName , entry . dirName ) ;
2014-03-31 20:30:07 +02:00
statGet - > getParam . attribute = 0 ; // TODO ?
2014-09-04 19:32:20 +02:00
strcpy_trunc ( statGet - > getParam . title , entry . title ) ;
strcpy_trunc ( statGet - > getParam . subTitle , entry . subtitle ) ;
strcpy_trunc ( statGet - > getParam . detail , entry . details ) ;
strcpy_trunc ( statGet - > getParam . listParam , entry . listParam ) ;
2014-03-31 20:30:07 +02:00
statGet - > fileNum = 0 ;
2015-01-19 17:30:35 +01:00
statGet - > fileList . set ( 0 ) ;
2014-03-31 20:30:07 +02:00
statGet - > fileListNum = 0 ;
std : : string saveDir = " /dev_hdd0/home/00000001/savedata/ " + entry . dirName ; // TODO: Get the path of the current user
vfsDir dir ( saveDir ) ;
if ( ! dir . IsOpened ( ) )
return ;
std : : vector < CellSaveDataFileStat > fileEntries ;
for ( const DirEntryInfo * dirEntry = dir . Read ( ) ; dirEntry ; dirEntry = dir . Read ( ) ) {
if ( dirEntry - > flags & DirEntry_TypeFile ) {
if ( dirEntry - > name = = " PARAM.SFO " | | dirEntry - > name = = " PARAM.PFD " )
continue ;
statGet - > fileNum + + ;
statGet - > fileListNum + + ;
CellSaveDataFileStat fileEntry ;
vfsFile file ( saveDir + " / " + dirEntry - > name ) ;
2014-12-11 15:54:02 +01:00
if ( dirEntry - > name = = " ICON0.PNG " )
fileEntry . fileType = CELL_SAVEDATA_FILETYPE_CONTENT_ICON0 ;
else if ( dirEntry - > name = = " ICON1.PAM " )
fileEntry . fileType = CELL_SAVEDATA_FILETYPE_CONTENT_ICON1 ;
else if ( dirEntry - > name = = " PIC1.PNG " )
fileEntry . fileType = CELL_SAVEDATA_FILETYPE_CONTENT_PIC1 ;
else if ( dirEntry - > name = = " SND0.AT3 " )
fileEntry . fileType = CELL_SAVEDATA_FILETYPE_CONTENT_SND0 ;
2014-03-31 20:30:07 +02:00
fileEntry . st_size = file . GetSize ( ) ;
fileEntry . st_atime_ = 0 ; // TODO ?
fileEntry . st_mtime_ = 0 ; // TODO ?
fileEntry . st_ctime_ = 0 ; // TODO ?
2014-09-04 19:32:20 +02:00
strcpy_trunc ( fileEntry . fileName , dirEntry - > name ) ;
2014-03-31 20:30:07 +02:00
fileEntries . push_back ( fileEntry ) ;
}
}
2015-01-19 17:30:35 +01:00
statGet - > fileList . set ( ( u32 ) Memory . Alloc ( sizeof ( CellSaveDataFileStat ) * fileEntries . size ( ) , 8 ) ) ;
2014-12-20 12:45:27 +01:00
for ( u32 i = 0 ; i < fileEntries . size ( ) ; i + + ) {
CellSaveDataFileStat * dst = & statGet - > fileList [ i ] ;
memcpy ( dst , & fileEntries [ i ] , sizeof ( CellSaveDataFileStat ) ) ;
}
2014-03-31 20:30:07 +02:00
}
2014-09-01 14:47:26 +02:00
s32 modifySaveDataFiles ( vm : : ptr < CellSaveDataFileCallback > funcFile , vm : : ptr < CellSaveDataCBResult > result , const std : : string & saveDataDir )
2014-03-31 20:30:07 +02:00
{
2014-07-31 18:08:02 +02:00
vm : : var < CellSaveDataFileGet > fileGet ;
vm : : var < CellSaveDataFileSet > fileSet ;
2014-04-09 18:23:14 +02:00
2014-04-19 18:50:06 +02:00
if ( ! Emu . GetVFS ( ) . ExistsDir ( saveDataDir ) )
Emu . GetVFS ( ) . CreateDir ( saveDataDir ) ;
fileGet - > excSize = 0 ;
while ( true )
2014-04-09 18:23:14 +02:00
{
2014-09-01 14:47:26 +02:00
funcFile ( result , fileGet , fileSet ) ;
2014-04-19 18:50:06 +02:00
if ( result - > result < 0 ) {
2015-02-18 17:22:06 +01:00
cellSysutil . Error ( " modifySaveDataFiles: CellSaveDataFileCallback failed. " ) ; // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
2014-04-19 18:50:06 +02:00
return CELL_SAVEDATA_ERROR_CBRESULT ;
}
2014-12-26 09:06:12 +01:00
if ( result - > result = = CELL_SAVEDATA_CBRESULT_OK_LAST | | result - > result = = CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM ) {
2014-04-19 18:50:06 +02:00
break ;
}
std : : string filepath = saveDataDir + ' / ' ;
vfsStream * file = NULL ;
2014-09-04 19:32:20 +02:00
void * buf = fileSet - > fileBuf . get_ptr ( ) ;
2014-04-19 18:50:06 +02:00
2014-04-25 18:57:00 +02:00
switch ( ( u32 ) fileSet - > fileType )
2014-04-19 18:50:06 +02:00
{
2014-09-04 19:32:20 +02:00
case CELL_SAVEDATA_FILETYPE_SECUREFILE : filepath + = fileSet - > fileName . get_ptr ( ) ; break ;
case CELL_SAVEDATA_FILETYPE_NORMALFILE : filepath + = fileSet - > fileName . get_ptr ( ) ; break ;
2014-04-19 18:50:06 +02:00
case CELL_SAVEDATA_FILETYPE_CONTENT_ICON0 : filepath + = " ICON0.PNG " ; break ;
case CELL_SAVEDATA_FILETYPE_CONTENT_ICON1 : filepath + = " ICON1.PAM " ; break ;
case CELL_SAVEDATA_FILETYPE_CONTENT_PIC1 : filepath + = " PIC1.PNG " ; break ;
case CELL_SAVEDATA_FILETYPE_CONTENT_SND0 : filepath + = " SND0.AT3 " ; break ;
default :
2015-02-18 17:22:06 +01:00
cellSysutil . Error ( " modifySaveDataFiles: Unknown fileType! Aborting... " ) ;
2014-04-19 18:50:06 +02:00
return CELL_SAVEDATA_ERROR_PARAM ;
}
2014-04-25 18:57:00 +02:00
switch ( ( u32 ) fileSet - > fileOperation )
2014-04-19 18:50:06 +02:00
{
case CELL_SAVEDATA_FILEOP_READ :
file = Emu . GetVFS ( ) . OpenFile ( filepath , vfsRead ) ;
2014-08-30 22:41:01 +02:00
fileGet - > excSize = ( u32 ) file - > Read ( buf , ( u32 ) std : : min ( fileSet - > fileSize , fileSet - > fileBufSize ) ) ; // TODO: This may fail for big files because of the dest pointer.
2014-04-19 18:50:06 +02:00
break ;
2014-04-09 18:23:14 +02:00
2014-04-19 18:50:06 +02:00
case CELL_SAVEDATA_FILEOP_WRITE :
Emu . GetVFS ( ) . CreateFile ( filepath ) ;
file = Emu . GetVFS ( ) . OpenFile ( filepath , vfsWrite ) ;
2014-08-30 22:41:01 +02:00
fileGet - > excSize = ( u32 ) file - > Write ( buf , ( u32 ) std : : min ( fileSet - > fileSize , fileSet - > fileBufSize ) ) ; // TODO: This may fail for big files because of the dest pointer.
2014-04-19 18:50:06 +02:00
break ;
2014-04-09 18:23:14 +02:00
2014-04-19 18:50:06 +02:00
case CELL_SAVEDATA_FILEOP_DELETE :
Emu . GetVFS ( ) . RemoveFile ( filepath ) ;
fileGet - > excSize = 0 ;
break ;
2014-04-09 18:23:14 +02:00
2014-04-19 18:50:06 +02:00
case CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC :
2015-02-18 17:22:06 +01:00
cellSysutil . Todo ( " modifySaveDataFiles: CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC " ) ;
2014-04-19 18:50:06 +02:00
break ;
2014-03-31 20:30:07 +02:00
2014-04-19 18:50:06 +02:00
default :
2015-02-18 17:22:06 +01:00
cellSysutil . Error ( " modifySaveDataFiles: Unknown fileOperation! Aborting... " ) ;
2014-04-19 18:50:06 +02:00
return CELL_SAVEDATA_ERROR_PARAM ;
}
2014-04-09 18:23:14 +02:00
2014-04-19 18:50:06 +02:00
if ( file & & file - > IsOpened ( ) )
file - > Close ( ) ;
}
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-31 20:30:07 +02:00
}
2015-04-14 16:54:03 +02:00
enum : u32
{
SAVEDATA_OP_AUTO_SAVE = 0 ,
SAVEDATA_OP_AUTO_LOAD = 1 ,
SAVEDATA_OP_LIST_AUTO_SAVE = 2 ,
SAVEDATA_OP_LIST_AUTO_LOAD = 3 ,
SAVEDATA_OP_LIST_SAVE = 4 ,
SAVEDATA_OP_LIST_LOAD = 5 ,
SAVEDATA_OP_FIXED_SAVE = 6 ,
SAVEDATA_OP_FIXED_LOAD = 7 ,
SAVEDATA_OP_FIXED_DELETE = 14 ,
} ;
2015-04-15 16:27:37 +02:00
__noinline s32 savedata_op (
PPUThread & CPU ,
2015-04-14 16:54:03 +02:00
u32 operation ,
u32 version ,
vm : : ptr < const char > dirName ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataListCallback > funcList ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
u32 unknown , // 0, 2, 6
vm : : ptr < void > userdata ,
u32 userId ,
vm : : ptr < CellSaveDataDoneCallback > funcDone )
{
2015-04-15 16:27:37 +02:00
static const std : : string base_dir = " /dev_hdd0/home/00000001/savedata/ " ; // TODO: Get the path of the current or specified user
2015-04-14 16:54:03 +02:00
2015-04-15 16:27:37 +02:00
vm : : stackvar < CellSaveDataCBResult > result ( CPU ) ;
vm : : stackvar < CellSaveDataListGet > listGet ( CPU ) ;
vm : : stackvar < CellSaveDataListSet > listSet ( CPU ) ;
vm : : stackvar < CellSaveDataStatGet > statGet ( CPU ) ;
vm : : stackvar < CellSaveDataStatSet > statSet ( CPU ) ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
result - > userdata = userdata ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
std : : vector < SaveDataEntry > save_entries ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
if ( setList )
{
listGet - > dirNum = 0 ;
listGet - > dirListNum = 0 ;
listGet - > dirList . set ( setBuf - > buf . addr ( ) ) ;
memset ( listGet - > reserved , 0 , sizeof ( listGet - > reserved ) ) ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
const auto prefix_list = fmt : : split ( setList - > dirNamePrefix . get_ptr ( ) , { " | " } ) ;
2014-08-22 21:34:43 +02:00
2015-04-15 16:27:37 +02:00
for ( const auto entry : vfsDir ( base_dir ) )
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
if ( ( entry - > flags & DirEntry_TypeMask ) ! = DirEntry_TypeDir )
{
2014-03-28 20:06:15 +01:00
continue ;
2015-04-15 16:27:37 +02:00
}
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
for ( const auto & prefix : prefix_list )
{
if ( entry - > name . substr ( 0 , prefix . size ( ) ) = = prefix )
{
// Count the amount of matches and the amount of listed directories
if ( listGet - > dirListNum + + < setBuf - > dirListMax )
{
listGet - > dirNum + + ;
// PSF parameters
vfsFile f ( base_dir + entry - > name + " /PARAM.SFO " ) ;
PSFLoader psf ( f ) ;
if ( ! psf . Load ( false ) )
{
break ;
}
SaveDataEntry save_entry ;
save_entry . dirName = psf . GetString ( " SAVEDATA_DIRECTORY " ) ;
save_entry . listParam = psf . GetString ( " SAVEDATA_LIST_PARAM " ) ;
save_entry . title = psf . GetString ( " TITLE " ) ;
save_entry . subtitle = psf . GetString ( " SUB_TITLE " ) ;
save_entry . details = psf . GetString ( " DETAIL " ) ;
save_entry . sizeKB = get_save_data_size ( base_dir + entry - > name ) / 1024 ;
save_entry . atime = entry - > access_time ;
save_entry . mtime = entry - > modify_time ;
save_entry . ctime = entry - > create_time ;
//save_entry.iconBuf = NULL; // TODO: Here should be the PNG buffer
//save_entry.iconBufSize = 0; // TODO: Size of the PNG file
save_entry . isNew = false ;
save_entries . push_back ( save_entry ) ;
}
break ;
}
}
2014-03-28 20:06:15 +01:00
}
2015-04-15 16:27:37 +02:00
// Sort the entries
std : : sort ( save_entries . begin ( ) , save_entries . end ( ) , SortSaveDataEntry ( setList - > sortType , setList - > sortOrder ) ) ;
2014-08-22 21:34:43 +02:00
2015-04-15 16:27:37 +02:00
// Fill the listGet->dirList array
auto dir_list = listGet - > dirList . get_ptr ( ) ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
for ( const auto & entry : save_entries )
{
auto & dir = * dir_list + + ;
strcpy_trunc ( dir . dirName , entry . dirName ) ;
strcpy_trunc ( dir . listParam , entry . listParam ) ;
memset ( dir . reserved , 0 , sizeof ( dir . reserved ) ) ;
}
2014-08-22 21:34:43 +02:00
2015-04-15 16:27:37 +02:00
// Data List Callback
funcList ( result , listGet , listSet ) ;
2014-03-31 20:30:07 +02:00
}
2015-04-15 16:27:37 +02:00
2014-03-31 20:30:07 +02:00
2015-04-15 16:27:37 +02:00
setSaveDataList ( save_entries , listSet - > fixedList , listSet - > fixedListNum ) ;
2014-09-02 00:22:13 +02:00
if ( listSet - > newData )
2015-04-15 16:27:37 +02:00
addNewSaveDataEntry ( save_entries , listSet - > newData ) ;
if ( save_entries . size ( ) = = 0 ) {
cellSysutil . Error ( " cellSaveDataListLoad2: No save entries found! " ) ; // TODO: Find a better way to handle this error
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-31 20:30:07 +02:00
}
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
u32 focusIndex = focusSaveDataEntry ( save_entries , listSet - > focusPosition ) ;
2014-03-31 20:30:07 +02:00
// TODO: Display the dialog here
u32 selectedIndex = focusIndex ; // TODO: Until the dialog is implemented, select always the focused entry
2015-04-15 16:27:37 +02:00
getSaveDataStat ( save_entries [ selectedIndex ] , statGet ) ;
2014-09-04 19:32:20 +02:00
result - > userdata = userdata ;
2014-03-31 20:30:07 +02:00
2014-09-01 14:47:26 +02:00
funcStat ( result , statGet , statSet ) ;
2014-09-02 00:22:13 +02:00
Memory . Free ( statGet - > fileList . addr ( ) ) ;
2014-03-31 20:30:07 +02:00
if ( result - > result < 0 ) {
2015-02-18 17:22:06 +01:00
cellSysutil . Error ( " cellSaveDataListLoad2: CellSaveDataStatCallback failed. " ) ; // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
2014-03-31 20:30:07 +02:00
return CELL_SAVEDATA_ERROR_CBRESULT ;
}
2014-08-22 21:34:43 +02:00
2014-09-02 03:05:13 +02:00
/*if (statSet->setParam)
2015-04-15 16:27:37 +02:00
// TODO: Write PARAM.SFO file
2014-04-09 18:23:14 +02:00
*/
2014-03-28 20:06:15 +01:00
2014-04-19 18:50:06 +02:00
// Enter the loop where the save files are read/created/deleted.
2015-04-15 16:27:37 +02:00
s32 ret = modifySaveDataFiles ( funcFile , result , base_dir + ( char * ) statGet - > dir . dirName ) ;
2014-03-28 20:06:15 +01:00
2014-04-19 18:50:06 +02:00
return ret ;
2014-03-28 20:06:15 +01:00
}
2015-04-15 16:27:37 +02:00
// Functions
s32 cellSaveDataListSave2 (
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataListCallback > funcList ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
cellSysutil . Warning ( " cellSaveDataListSave2(version=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
2015-04-14 16:54:03 +02:00
version , setList , setBuf , funcList , funcStat , funcFile , container , userdata ) ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_LIST_SAVE , version , vm : : null , 1 , setList , setBuf , funcList , vm : : null , funcStat , funcFile , container , 2 , userdata , 0 , vm : : null ) ;
}
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
s32 cellSaveDataListLoad2 (
PPUThread & CPU ,
u32 version ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataListCallback > funcList ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
{
cellSysutil . Warning ( " cellSaveDataListLoad2(version=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , setList , setBuf , funcList , funcStat , funcFile , container , userdata ) ;
2014-03-28 20:06:15 +01:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_LIST_LOAD , version , vm : : null , 1 , setList , setBuf , funcList , vm : : null , funcStat , funcFile , container , 2 , userdata , 0 , vm : : null ) ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataFixedSave2 (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Warning ( " cellSaveDataFixedSave2(version=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2014-04-09 18:23:14 +02:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_FIXED_SAVE , version , vm : : null , 1 , setList , setBuf , vm : : null , funcFixed , funcStat , funcFile , container , 2 , userdata , 0 , vm : : null ) ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataFixedLoad2 (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Warning ( " cellSaveDataFixedLoad2(version=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2014-04-09 18:23:14 +02:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_FIXED_LOAD , version , vm : : null , 1 , setList , setBuf , vm : : null , funcFixed , funcStat , funcFile , container , 2 , userdata , 0 , vm : : null ) ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataAutoSave2 (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
vm : : ptr < const char > dirName ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Warning ( " cellSaveDataAutoSave2(version=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , dirName , errDialog , setBuf , funcStat , funcFile , container , userdata ) ;
2014-05-31 23:37:48 +02:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_AUTO_SAVE , version , dirName , errDialog , vm : : null , setBuf , vm : : null , vm : : null , funcStat , funcFile , container , 2 , userdata , 0 , vm : : null ) ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataAutoLoad2 (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
vm : : ptr < const char > dirName ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Warning ( " cellSaveDataAutoLoad2(version=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , dirName , errDialog , setBuf , funcStat , funcFile , container , userdata ) ;
2014-05-31 23:37:48 +02:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_AUTO_LOAD , version , dirName , errDialog , vm : : null , setBuf , vm : : null , vm : : null , funcStat , funcFile , container , 2 , userdata , 0 , vm : : null ) ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataListAutoSave (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
cellSysutil . Warning ( " cellSaveDataListAutoSave(version=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
2015-04-14 16:54:03 +02:00
version , errDialog , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2014-08-22 21:34:43 +02:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_LIST_AUTO_SAVE , version , vm : : null , errDialog , setList , setBuf , vm : : null , funcFixed , funcStat , funcFile , container , 0 , userdata , 0 , vm : : null ) ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataListAutoLoad (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-15 16:27:37 +02:00
cellSysutil . Warning ( " cellSaveDataListAutoLoad(version=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
2015-04-14 16:54:03 +02:00
version , errDialog , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2014-08-22 21:34:43 +02:00
2015-04-15 16:27:37 +02:00
return savedata_op ( CPU , SAVEDATA_OP_LIST_AUTO_LOAD , version , vm : : null , errDialog , setList , setBuf , vm : : null , funcFixed , funcStat , funcFile , container , 0 , userdata , 0 , vm : : null ) ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataDelete2 ( u32 container )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataDelete2(container=0x%x) " , container ) ;
2015-01-05 00:07:46 +01:00
2014-03-28 20:06:15 +01:00
return CELL_SAVEDATA_RET_CANCEL ;
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataFixedDelete (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataFixedDelete(setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x) " ,
setList , setBuf , funcFixed , funcDone , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserListSave (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataListCallback > funcList ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserListSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , setList , setBuf , funcList , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserListLoad (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataListCallback > funcList ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserListLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , setList , setBuf , funcList , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserFixedSave (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserFixedSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserFixedLoad (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserAutoSave (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
vm : : ptr < const char > dirName ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserAutoSave(version=%d, userId=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , dirName , errDialog , setBuf , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserAutoLoad (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
vm : : ptr < const char > dirName ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName=*0x%x, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , dirName , errDialog , setBuf , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserListAutoSave (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , errDialog , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserListAutoLoad (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 version ,
u32 userId ,
u32 errDialog ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataStatCallback > funcStat ,
vm : : ptr < CellSaveDataFileCallback > funcFile ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x) " ,
version , userId , errDialog , setList , setBuf , funcFixed , funcStat , funcFile , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserFixedDelete (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataFixedCallback > funcFixed ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
2015-04-14 16:54:03 +02:00
cellSysutil . Todo ( " cellSaveDataUserFixedDelete(userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x) " ,
userId , setList , setBuf , funcFixed , funcDone , container , userdata ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
void cellSaveDataEnableOverlay ( s32 enable )
{
2015-02-18 17:22:06 +01:00
cellSysutil . Todo ( " cellSaveDataEnableOverlay(enable=%d) " , enable ) ;
2015-01-05 00:07:46 +01:00
return ;
}
2014-03-28 20:06:15 +01:00
// Functions (Extensions)
2015-01-05 00:07:46 +01:00
s32 cellSaveDataListDelete (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataListCallback > funcList ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataListImport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
vm : : ptr < CellSaveDataSetList > setList ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataListExport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
vm : : ptr < CellSaveDataSetList > setList ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataFixedImport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
vm : : ptr < const char > dirName ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataFixedExport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
vm : : ptr < const char > dirName ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataGetListItem (
vm : : ptr < const char > dirName ,
vm : : ptr < CellSaveDataDirStat > dir ,
vm : : ptr < CellSaveDataSystemFileParam > sysFileParam ,
vm : : ptr < u32 > bind ,
vm : : ptr < u32 > sizeKB )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserListDelete (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
vm : : ptr < CellSaveDataSetBuf > setBuf ,
vm : : ptr < CellSaveDataListCallback > funcList ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserListImport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserListExport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 userId ,
vm : : ptr < CellSaveDataSetList > setList ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserFixedImport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 userId ,
vm : : ptr < const char > dirName ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserFixedExport (
2015-04-15 16:27:37 +02:00
PPUThread & CPU ,
2015-01-05 00:07:46 +01:00
u32 userId ,
vm : : ptr < const char > dirName ,
u32 maxSizeKB ,
vm : : ptr < CellSaveDataDoneCallback > funcDone ,
u32 container ,
vm : : ptr < void > userdata )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
2014-03-28 20:06:15 +01:00
}
2015-01-05 00:07:46 +01:00
s32 cellSaveDataUserGetListItem (
u32 userId ,
vm : : ptr < const char > dirName ,
vm : : ptr < CellSaveDataDirStat > dir ,
vm : : ptr < CellSaveDataSystemFileParam > sysFileParam ,
vm : : ptr < u32 > bind ,
vm : : ptr < u32 > sizeKB )
2014-03-28 20:06:15 +01:00
{
UNIMPLEMENTED_FUNC ( cellSysutil ) ;
2015-01-05 00:07:46 +01:00
return CELL_OK ;
}
void cellSysutil_SaveData_init ( )
{
// libsysutil functions:
REG_FUNC ( cellSysutil , cellSaveDataEnableOverlay ) ;
REG_FUNC ( cellSysutil , cellSaveDataDelete2 ) ;
//REG_FUNC(cellSysutil, cellSaveDataDelete);
REG_FUNC ( cellSysutil , cellSaveDataUserFixedDelete ) ;
REG_FUNC ( cellSysutil , cellSaveDataFixedDelete ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserFixedLoad ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserFixedSave ) ;
REG_FUNC ( cellSysutil , cellSaveDataFixedLoad2 ) ;
REG_FUNC ( cellSysutil , cellSaveDataFixedSave2 ) ;
//REG_FUNC(cellSysutil, cellSaveDataFixedLoad);
//REG_FUNC(cellSysutil, cellSaveDataFixedSave);
REG_FUNC ( cellSysutil , cellSaveDataUserListLoad ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserListSave ) ;
REG_FUNC ( cellSysutil , cellSaveDataListLoad2 ) ;
REG_FUNC ( cellSysutil , cellSaveDataListSave2 ) ;
//REG_FUNC(cellSysutil, cellSaveDataListLoad);
//REG_FUNC(cellSysutil, cellSaveDataListSave);
REG_FUNC ( cellSysutil , cellSaveDataUserListAutoLoad ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserListAutoSave ) ;
REG_FUNC ( cellSysutil , cellSaveDataListAutoLoad ) ;
REG_FUNC ( cellSysutil , cellSaveDataListAutoSave ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserAutoLoad ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserAutoSave ) ;
REG_FUNC ( cellSysutil , cellSaveDataAutoLoad2 ) ;
REG_FUNC ( cellSysutil , cellSaveDataAutoSave2 ) ;
//REG_FUNC(cellSysutil, cellSaveDataAutoLoad);
//REG_FUNC(cellSysutil, cellSaveDataAutoSave);
// libsysutil_savedata functions:
REG_FUNC ( cellSysutil , cellSaveDataUserGetListItem ) ;
REG_FUNC ( cellSysutil , cellSaveDataGetListItem ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserListDelete ) ;
REG_FUNC ( cellSysutil , cellSaveDataListDelete ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserFixedExport ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserFixedImport ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserListExport ) ;
REG_FUNC ( cellSysutil , cellSaveDataUserListImport ) ;
REG_FUNC ( cellSysutil , cellSaveDataFixedExport ) ;
REG_FUNC ( cellSysutil , cellSaveDataFixedImport ) ;
REG_FUNC ( cellSysutil , cellSaveDataListExport ) ;
REG_FUNC ( cellSysutil , cellSaveDataListImport ) ;
// libsysutil_savedata_psp functions:
2014-03-28 20:06:15 +01:00
}