mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 19:28:43 +12:00
Conflicts fixed
This commit is contained in:
commit
24becb9325
16 changed files with 904 additions and 582 deletions
|
@ -8,6 +8,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
add_definitions(-w) # TODO: remove me
|
add_definitions(-w) # TODO: remove me
|
||||||
add_definitions(-fpermissive) # TODO: remove me
|
add_definitions(-fpermissive) # TODO: remove me
|
||||||
add_definitions(-g) # Debugging!!
|
add_definitions(-g) # Debugging!!
|
||||||
|
add_definitions(-msse2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
|
||||||
|
@ -59,5 +60,5 @@ ${CMAKE_SOURCE_DIR}/../Utilities/*
|
||||||
|
|
||||||
add_executable(rpcs3 ${RPCS3_SRC})
|
add_executable(rpcs3 ${RPCS3_SRC})
|
||||||
|
|
||||||
target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES} libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a ${ZLIB_LIBRARIES})
|
target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES} libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a ${ZLIB_LIBRARIES})
|
||||||
|
|
||||||
|
|
|
@ -457,7 +457,7 @@ void validate_data(const char* file_name, unsigned char *klicensee, NPD_HEADER *
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Generate klicensee xor key.
|
// Generate klicensee xor key.
|
||||||
xor(key, klicensee, NP_OMAC_KEY_2, 0x10);
|
xor_(key, klicensee, NP_OMAC_KEY_2, 0x10);
|
||||||
|
|
||||||
// Hash with generated key and compare with dev_hash.
|
// Hash with generated key and compare with dev_hash.
|
||||||
dev_hash_result = cmac_hash_compare(key, 0x10, (unsigned char *)npd, 0x60, npd->dev_hash);
|
dev_hash_result = cmac_hash_compare(key, 0x10, (unsigned char *)npd, 0x60, npd->dev_hash);
|
||||||
|
@ -529,7 +529,7 @@ bool extract_data(wxFile *input, wxFile *output, const char* input_file_name, un
|
||||||
if((EDAT->flags & SDAT_FLAG) == SDAT_FLAG)
|
if((EDAT->flags & SDAT_FLAG) == SDAT_FLAG)
|
||||||
{
|
{
|
||||||
ConLog.Warning("EDAT: SDAT detected!\n");
|
ConLog.Warning("EDAT: SDAT detected!\n");
|
||||||
xor(key, NPD->dev_hash, SDAT_KEY, 0x10);
|
xor_(key, NPD->dev_hash, SDAT_KEY, 0x10);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -670,4 +670,4 @@ int DecryptEDAT(const std::string& input_file_name, const std::string& output_fi
|
||||||
input.Close();
|
input.Close();
|
||||||
output.Close();
|
output.Close();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ u64 swap64(u64 i)
|
||||||
((i & 0x00ff000000000000) >> 40) | ((i & 0xff00000000000000) >> 56);
|
((i & 0x00ff000000000000) >> 40) | ((i & 0xff00000000000000) >> 56);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xor(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size)
|
void xor_(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < size; i++)
|
for(i = 0; i < size; i++)
|
||||||
|
@ -744,4 +744,4 @@ int lz_decompress(unsigned char *out, unsigned char *in, unsigned int size)
|
||||||
delete[] tmp;
|
delete[] tmp;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
u16 swap16(u16 i);
|
u16 swap16(u16 i);
|
||||||
u32 swap32(u32 i);
|
u32 swap32(u32 i);
|
||||||
u64 swap64(u64 i);
|
u64 swap64(u64 i);
|
||||||
void xor(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size);
|
void xor_(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size);
|
||||||
|
|
||||||
// Hex string conversion auxiliary functions.
|
// Hex string conversion auxiliary functions.
|
||||||
u64 hex_to_u64(const char* hex_str);
|
u64 hex_to_u64(const char* hex_str);
|
||||||
|
@ -19,4 +19,4 @@ bool hmac_hash_compare(unsigned char *key, int key_len, unsigned char *in, int i
|
||||||
bool cmac_hash_compare(unsigned char *key, int key_len, unsigned char *in, int in_len, unsigned char *hash);
|
bool cmac_hash_compare(unsigned char *key, int key_len, unsigned char *in, int in_len, unsigned char *hash);
|
||||||
|
|
||||||
// Reverse-engineered custom Lempel–Ziv–Markov based compression (unknown variant of LZRC).
|
// Reverse-engineered custom Lempel–Ziv–Markov based compression (unknown variant of LZRC).
|
||||||
int lz_decompress(unsigned char *out, unsigned char *in, unsigned int size);
|
int lz_decompress(unsigned char *out, unsigned char *in, unsigned int size);
|
||||||
|
|
2
rpcs3/Emu/SysCalls/Dialogs/Dialog.cpp
Normal file
2
rpcs3/Emu/SysCalls/Dialogs/Dialog.cpp
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "Dialog.h"
|
8
rpcs3/Emu/SysCalls/Dialogs/Dialog.h
Normal file
8
rpcs3/Emu/SysCalls/Dialogs/Dialog.h
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class Dialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Show();
|
||||||
|
void Close();
|
||||||
|
};
|
7
rpcs3/Emu/SysCalls/Dialogs/MessageDialog.cpp
Normal file
7
rpcs3/Emu/SysCalls/Dialogs/MessageDialog.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "MessageDialog.h"
|
||||||
|
|
||||||
|
MessageDialog::MessageDialog(std::string message, std::string title, int flags, char* icon)
|
||||||
|
{
|
||||||
|
// TODO: Use RSX post-drawing instead of wxWidgets
|
||||||
|
}
|
15
rpcs3/Emu/SysCalls/Dialogs/MessageDialog.h
Normal file
15
rpcs3/Emu/SysCalls/Dialogs/MessageDialog.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#pragma once
|
||||||
|
#include "Dialog.h"
|
||||||
|
|
||||||
|
enum MessageDialogFlags
|
||||||
|
{
|
||||||
|
MessageDialog_Button_Enter = 0x1,
|
||||||
|
MessageDialog_Button_Back = 0x2,
|
||||||
|
|
||||||
|
MessageDialog_Controls_YesNo = 0x4,
|
||||||
|
};
|
||||||
|
|
||||||
|
class MessageDialog : public Dialog
|
||||||
|
{
|
||||||
|
MessageDialog(std::string message, std::string title, int flags, char* icon);
|
||||||
|
};
|
37
rpcs3/Emu/SysCalls/Dialogs/SaveDataList.cpp
Normal file
37
rpcs3/Emu/SysCalls/Dialogs/SaveDataList.cpp
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "SaveDataList.h"
|
||||||
|
|
||||||
|
void SaveDataList::Load(const std::vector<SaveDataListEntry>& entries)
|
||||||
|
{
|
||||||
|
wxDialog dialog(NULL, wxID_ANY, "test", wxDefaultPosition, wxSize(450, 680));
|
||||||
|
|
||||||
|
wxPanel *panel = new wxPanel(&dialog, -1);
|
||||||
|
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
|
||||||
|
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
wxListCtrl* list = new wxListCtrl(&dialog, wxID_ANY, wxPoint(10,10), wxSize(400,600));
|
||||||
|
|
||||||
|
list->InsertColumn(0, "Icon");
|
||||||
|
list->InsertColumn(1, "Information");
|
||||||
|
wxImageList* pImageList = new wxImageList(320,176);
|
||||||
|
|
||||||
|
for (int i=0; i<entries.size(); i++)
|
||||||
|
{
|
||||||
|
list->InsertItem (i, i);
|
||||||
|
list->SetItemColumnImage (i, 0, i);
|
||||||
|
list->SetItem (i, 1, wxString::Format("%d",i+1));
|
||||||
|
|
||||||
|
wxImage img(320, 176, entries[i].iconBuffer);
|
||||||
|
pImageList->Add(img);
|
||||||
|
}
|
||||||
|
list->SetImageList(pImageList, wxIMAGE_LIST_SMALL);
|
||||||
|
|
||||||
|
panel->AddChild(list);
|
||||||
|
|
||||||
|
vbox->Add(panel, 1);
|
||||||
|
vbox->Add(hbox, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, 10);
|
||||||
|
|
||||||
|
dialog.SetSizer(vbox);
|
||||||
|
dialog.Centre();
|
||||||
|
dialog.ShowModal();
|
||||||
|
dialog.Destroy();
|
||||||
|
}
|
9
rpcs3/Emu/SysCalls/Dialogs/SaveDataList.h
Normal file
9
rpcs3/Emu/SysCalls/Dialogs/SaveDataList.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
#include "Dialog.h"
|
||||||
|
#include "Emu/SysCalls/Modules/cellSysutil_SaveData.h"
|
||||||
|
|
||||||
|
class SaveDataList : public Dialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Load(const std::vector<SaveDataListEntry>& entries);
|
||||||
|
};
|
2
rpcs3/Emu/SysCalls/Dialogs/UserList.cpp
Normal file
2
rpcs3/Emu/SysCalls/Dialogs/UserList.cpp
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "UserList.h"
|
0
rpcs3/Emu/SysCalls/Dialogs/UserList.h
Normal file
0
rpcs3/Emu/SysCalls/Dialogs/UserList.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -23,17 +23,18 @@ public:
|
||||||
if (sortOrder == CELL_SAVEDATA_SORTORDER_DESCENT)
|
if (sortOrder == CELL_SAVEDATA_SORTORDER_DESCENT)
|
||||||
{
|
{
|
||||||
if (sortType == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
if (sortType == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
||||||
return entry1.timestamp >= entry2.timestamp;
|
return entry1.st_mtime_ >= entry2.st_mtime_;
|
||||||
else //if (sortType == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
if (sortType == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||||
return entry1.subtitle >= entry2.subtitle;
|
return entry1.subtitle >= entry2.subtitle;
|
||||||
}
|
}
|
||||||
else //if (sortOrder == CELL_SAVEDATA_SORTORDER_ASCENT)
|
if (sortOrder == CELL_SAVEDATA_SORTORDER_ASCENT)
|
||||||
{
|
{
|
||||||
if (sortType == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
if (sortType == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
||||||
return entry1.timestamp < entry2.timestamp;
|
return entry1.st_mtime_ < entry2.st_mtime_;
|
||||||
else //if (sortType == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
if (sortType == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||||
return entry1.subtitle < entry2.subtitle;
|
return entry1.subtitle < entry2.subtitle;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ u64 getSaveDataSize(const std::string& dirName)
|
||||||
return totalSize;
|
return totalSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getSaveDataEntry(std::vector<SaveDataListEntry>& saveEntries, const std::string& saveDir)
|
void addSaveDataEntry(std::vector<SaveDataListEntry>& saveEntries, const std::string& saveDir)
|
||||||
{
|
{
|
||||||
// PSF parameters
|
// PSF parameters
|
||||||
vfsFile f(saveDir + "/PARAM.SFO");
|
vfsFile f(saveDir + "/PARAM.SFO");
|
||||||
|
@ -75,12 +76,56 @@ void getSaveDataEntry(std::vector<SaveDataListEntry>& saveEntries, const std::st
|
||||||
saveEntry.subtitle = psf.GetString("SUB_TITLE");
|
saveEntry.subtitle = psf.GetString("SUB_TITLE");
|
||||||
saveEntry.details = psf.GetString("DETAIL");
|
saveEntry.details = psf.GetString("DETAIL");
|
||||||
saveEntry.sizeKb = getSaveDataSize(saveDir)/1024;
|
saveEntry.sizeKb = getSaveDataSize(saveDir)/1024;
|
||||||
saveEntry.timestamp = 0; // TODO
|
saveEntry.st_atime_ = 0; // TODO
|
||||||
saveEntry.iconBuffer = stbi_load(localPath.mb_str(), &width, &height, &actual_components, 3);
|
saveEntry.st_mtime_ = 0; // TODO
|
||||||
|
saveEntry.st_ctime_ = 0; // TODO
|
||||||
|
saveEntry.iconBuf = stbi_load(localPath.mb_str(), &width, &height, &actual_components, 3);
|
||||||
|
saveEntry.iconBufSize = width * height * 3;
|
||||||
|
saveEntry.isNew = false;
|
||||||
|
|
||||||
saveEntries.push_back(saveEntry);
|
saveEntries.push_back(saveEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addNewSaveDataEntry(std::vector<SaveDataListEntry>& saveEntries, mem_ptr_t<CellSaveDataListNewData> newData)
|
||||||
|
{
|
||||||
|
SaveDataListEntry saveEntry;
|
||||||
|
saveEntry.dirName = (char*)Memory.VirtualToRealAddr(newData->dirName_addr);
|
||||||
|
saveEntry.title = (char*)Memory.VirtualToRealAddr(newData->icon->title_addr);
|
||||||
|
saveEntry.subtitle = (char*)Memory.VirtualToRealAddr(newData->icon->title_addr);
|
||||||
|
saveEntry.iconBuf = Memory.VirtualToRealAddr(newData->icon->iconBuf_addr);
|
||||||
|
saveEntry.iconBufSize = newData->icon->iconBufSize;
|
||||||
|
saveEntry.isNew = true;
|
||||||
|
// TODO: Add information stored in newData->iconPosition. (It's not very relevant)
|
||||||
|
|
||||||
|
saveEntries.push_back(saveEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 focusSaveDataEntry(const std::vector<SaveDataListEntry>& saveEntries, u32 focusPosition)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setSaveDataEntries(std::vector<SaveDataListEntry>& saveEntries, mem_ptr_t<CellSaveDataDirList> fixedList, u32 fixedListNum)
|
||||||
|
{
|
||||||
|
std::vector<SaveDataListEntry>::iterator entry = saveEntries.begin();
|
||||||
|
while (entry != saveEntries.end())
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
for (u32 j=0; j<fixedListNum; j++)
|
||||||
|
{
|
||||||
|
if (entry->dirName == (char*)fixedList[j].dirName)
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
entry = saveEntries.erase(entry);
|
||||||
|
else
|
||||||
|
entry++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, mem_ptr_t<CellSaveDataSetBuf> setBuf,
|
int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, mem_ptr_t<CellSaveDataSetBuf> setBuf,
|
||||||
|
@ -95,7 +140,7 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||||
|
|
||||||
MemoryAllocator<CellSaveDataCBResult> result;
|
MemoryAllocator<CellSaveDataCBResult> result;
|
||||||
MemoryAllocator<CellSaveDataListGet> listGet;
|
MemoryAllocator<CellSaveDataListGet> listGet;
|
||||||
MemoryAllocator<CellSaveDataListGet> listSet;
|
MemoryAllocator<CellSaveDataListSet> listSet;
|
||||||
|
|
||||||
std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
|
std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
|
||||||
vfsDir dir(saveBaseDir);
|
vfsDir dir(saveBaseDir);
|
||||||
|
@ -115,14 +160,14 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||||
listGet->dirNum++;
|
listGet->dirNum++;
|
||||||
|
|
||||||
std::string saveDir = saveBaseDir + (const char*)(entry->name.mb_str());
|
std::string saveDir = saveBaseDir + (const char*)(entry->name.mb_str());
|
||||||
getSaveDataEntry(saveEntries, saveDir);
|
addSaveDataEntry(saveEntries, saveDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort the entries and fill the listGet->dirList array
|
// Sort the entries and fill the listGet->dirList array
|
||||||
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
||||||
listGet->dirList_addr = setBuf->buf_addr;
|
listGet->dirList.SetAddr(setBuf->buf_addr);
|
||||||
CellSaveDataDirList* dirList = (CellSaveDataDirList*)Memory.VirtualToRealAddr(listGet->dirList_addr);
|
CellSaveDataDirList* dirList = (CellSaveDataDirList*)Memory.VirtualToRealAddr(listGet->dirList.GetAddr());
|
||||||
for (u32 i=0; i<saveEntries.size(); i++) {
|
for (u32 i=0; i<saveEntries.size(); i++) {
|
||||||
memcpy(dirList[i].dirName, saveEntries[i].dirName.c_str(), CELL_SAVEDATA_DIRNAME_SIZE);
|
memcpy(dirList[i].dirName, saveEntries[i].dirName.c_str(), CELL_SAVEDATA_DIRNAME_SIZE);
|
||||||
memcpy(dirList[i].listParam, saveEntries[i].listParam.c_str(), CELL_SAVEDATA_SYSP_LPARAM_SIZE);
|
memcpy(dirList[i].listParam, saveEntries[i].listParam.c_str(), CELL_SAVEDATA_SYSP_LPARAM_SIZE);
|
||||||
|
@ -139,8 +184,8 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||||
funcFile(result.GetAddr(), fileGet.GetAddr(), fileSet.GetAddr());
|
funcFile(result.GetAddr(), fileGet.GetAddr(), fileSet.GetAddr());
|
||||||
|
|
||||||
for (auto& entry : saveEntries) {
|
for (auto& entry : saveEntries) {
|
||||||
delete[] entry.iconBuffer;
|
delete[] entry.iconBuf;
|
||||||
entry.iconBuffer = nullptr;
|
entry.iconBuf = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_SAVEDATA_RET_OK;
|
return CELL_SAVEDATA_RET_OK;
|
||||||
|
@ -158,7 +203,7 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||||
|
|
||||||
MemoryAllocator<CellSaveDataCBResult> result;
|
MemoryAllocator<CellSaveDataCBResult> result;
|
||||||
MemoryAllocator<CellSaveDataListGet> listGet;
|
MemoryAllocator<CellSaveDataListGet> listGet;
|
||||||
MemoryAllocator<CellSaveDataListGet> listSet;
|
MemoryAllocator<CellSaveDataListSet> listSet;
|
||||||
|
|
||||||
std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
|
std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
|
||||||
vfsDir dir(saveBaseDir);
|
vfsDir dir(saveBaseDir);
|
||||||
|
@ -178,23 +223,42 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||||
listGet->dirNum++;
|
listGet->dirNum++;
|
||||||
|
|
||||||
std::string saveDir = saveBaseDir + (const char*)(entry->name.mb_str());
|
std::string saveDir = saveBaseDir + (const char*)(entry->name.mb_str());
|
||||||
getSaveDataEntry(saveEntries, saveDir);
|
addSaveDataEntry(saveEntries, saveDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort the entries and fill the listGet->dirList array
|
// Sort the entries and fill the listGet->dirList array
|
||||||
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
||||||
listGet->dirList_addr = setBuf->buf_addr;
|
listGet->dirList.SetAddr(setBuf->buf_addr);
|
||||||
CellSaveDataDirList* dirList = (CellSaveDataDirList*)Memory.VirtualToRealAddr(listGet->dirList_addr);
|
CellSaveDataDirList* dirList = (CellSaveDataDirList*)Memory.VirtualToRealAddr(listGet->dirList.GetAddr());
|
||||||
for (u32 i=0; i<saveEntries.size(); i++) {
|
for (u32 i=0; i<saveEntries.size(); i++) {
|
||||||
memcpy(dirList[i].dirName, saveEntries[i].dirName.c_str(), CELL_SAVEDATA_DIRNAME_SIZE);
|
memcpy(dirList[i].dirName, saveEntries[i].dirName.c_str(), CELL_SAVEDATA_DIRNAME_SIZE);
|
||||||
memcpy(dirList[i].listParam, saveEntries[i].listParam.c_str(), CELL_SAVEDATA_SYSP_LPARAM_SIZE);
|
memcpy(dirList[i].listParam, saveEntries[i].listParam.c_str(), CELL_SAVEDATA_SYSP_LPARAM_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
funcList(result.GetAddr(), listGet.GetAddr(), listSet.GetAddr());
|
funcList(result.GetAddr(), listGet.GetAddr(), listSet.GetAddr());
|
||||||
|
|
||||||
|
if (result->result < 0) {
|
||||||
|
ConLog.Error("cellSaveDataListLoad2: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||||
|
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||||
|
}
|
||||||
|
if (!listSet->fixedList.IsGood()) {
|
||||||
|
return CELL_SAVEDATA_ERROR_PARAM;
|
||||||
|
}
|
||||||
|
setSaveDataEntries(saveEntries, (u32)listSet->fixedList.GetAddr(), listSet->fixedListNum);
|
||||||
|
u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||||
|
|
||||||
MemoryAllocator<CellSaveDataStatGet> statGet;
|
MemoryAllocator<CellSaveDataStatGet> statGet;
|
||||||
MemoryAllocator<CellSaveDataStatSet> statSet;
|
MemoryAllocator<CellSaveDataStatSet> statSet;
|
||||||
|
|
||||||
|
// TODO: Display the dialog here
|
||||||
|
ConLog.Warning("cellSaveDataListLoad2:");
|
||||||
|
|
||||||
|
statGet->isNewData = CELL_SAVEDATA_ISNEWDATA_NO; // You can *never* load new data
|
||||||
|
//statGet->dir =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
funcStat(result.GetAddr(), statGet.GetAddr(), statSet.GetAddr());
|
funcStat(result.GetAddr(), statGet.GetAddr(), statSet.GetAddr());
|
||||||
|
|
||||||
MemoryAllocator<CellSaveDataFileGet> fileGet;
|
MemoryAllocator<CellSaveDataFileGet> fileGet;
|
||||||
|
@ -202,8 +266,8 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||||
funcFile(result.GetAddr(), fileGet.GetAddr(), fileSet.GetAddr());
|
funcFile(result.GetAddr(), fileGet.GetAddr(), fileSet.GetAddr());
|
||||||
|
|
||||||
for (auto& entry : saveEntries) {
|
for (auto& entry : saveEntries) {
|
||||||
delete[] entry.iconBuffer;
|
delete[] entry.iconBuf;
|
||||||
entry.iconBuffer = nullptr;
|
entry.iconBuf = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_SAVEDATA_RET_OK;
|
return CELL_SAVEDATA_RET_OK;
|
||||||
|
|
|
@ -19,6 +19,19 @@ enum
|
||||||
CELL_SAVEDATA_ERROR_NOTSUPPORTED = 0x8002b40c,
|
CELL_SAVEDATA_ERROR_NOTSUPPORTED = 0x8002b40c,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Callback return codes
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM = 2,
|
||||||
|
CELL_SAVEDATA_CBRESULT_OK_LAST = 1,
|
||||||
|
CELL_SAVEDATA_CBRESULT_OK_NEXT = 0,
|
||||||
|
CELL_SAVEDATA_CBRESULT_ERR_NOSPACE = -1,
|
||||||
|
CELL_SAVEDATA_CBRESULT_ERR_FAILURE = -2,
|
||||||
|
CELL_SAVEDATA_CBRESULT_ERR_BROKEN = -3,
|
||||||
|
CELL_SAVEDATA_CBRESULT_ERR_NODATA = -4,
|
||||||
|
CELL_SAVEDATA_CBRESULT_ERR_INVALID = -5,
|
||||||
|
};
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -46,6 +59,18 @@ enum
|
||||||
// CellSaveDataSortOrder
|
// CellSaveDataSortOrder
|
||||||
CELL_SAVEDATA_SORTORDER_DESCENT = 0,
|
CELL_SAVEDATA_SORTORDER_DESCENT = 0,
|
||||||
CELL_SAVEDATA_SORTORDER_ASCENT = 1,
|
CELL_SAVEDATA_SORTORDER_ASCENT = 1,
|
||||||
|
|
||||||
|
// CellSaveDataIsNewData
|
||||||
|
CELL_SAVEDATA_ISNEWDATA_NO = 0,
|
||||||
|
CELL_SAVEDATA_ISNEWDATA_YES = 1,
|
||||||
|
|
||||||
|
// CellSaveDataFocusPosition
|
||||||
|
CELL_SAVEDATA_FOCUSPOS_DIRNAME = 0,
|
||||||
|
CELL_SAVEDATA_FOCUSPOS_LISTHEAD = 1,
|
||||||
|
CELL_SAVEDATA_FOCUSPOS_LISTTAIL = 2,
|
||||||
|
CELL_SAVEDATA_FOCUSPOS_LATEST = 3,
|
||||||
|
CELL_SAVEDATA_FOCUSPOS_OLDEST = 4,
|
||||||
|
CELL_SAVEDATA_FOCUSPOS_NEWDATA = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +102,7 @@ struct CellSaveDataListNewData
|
||||||
{
|
{
|
||||||
be_t<u32> iconPosition;
|
be_t<u32> iconPosition;
|
||||||
be_t<u32> dirName_addr; // char*
|
be_t<u32> dirName_addr; // char*
|
||||||
be_t<u32> icon_addr; // CellSaveDataNewDataIcon*
|
mem_beptr_t<CellSaveDataNewDataIcon> icon;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellSaveDataDirList
|
struct CellSaveDataDirList
|
||||||
|
@ -90,7 +115,7 @@ struct CellSaveDataListGet
|
||||||
{
|
{
|
||||||
be_t<u32> dirNum;
|
be_t<u32> dirNum;
|
||||||
be_t<u32> dirListNum;
|
be_t<u32> dirListNum;
|
||||||
be_t<u32> dirList_addr; // CellSaveDataDirList*
|
mem_beptr_t<CellSaveDataDirList> dirList;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellSaveDataListSet
|
struct CellSaveDataListSet
|
||||||
|
@ -98,14 +123,15 @@ struct CellSaveDataListSet
|
||||||
be_t<u32> focusPosition;
|
be_t<u32> focusPosition;
|
||||||
be_t<u32> focusDirName_addr; // char*
|
be_t<u32> focusDirName_addr; // char*
|
||||||
be_t<u32> fixedListNum;
|
be_t<u32> fixedListNum;
|
||||||
be_t<u32> fixedList_addr; // CellSaveDataDirList*
|
mem_beptr_t<CellSaveDataDirList> fixedList;
|
||||||
be_t<u32> newData_addr; // CellSaveDataListNewData*
|
mem_beptr_t<CellSaveDataListNewData> newData;
|
||||||
|
be_t<u32> reserved_addr; // void*
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellSaveDataFixedSet
|
struct CellSaveDataFixedSet
|
||||||
{
|
{
|
||||||
be_t<u32> dirName_addr; // char*
|
be_t<u32> dirName_addr; // char*
|
||||||
be_t<u32> newIcon_addr; // CellSaveDataNewDataIcon*
|
mem_beptr_t<CellSaveDataNewDataIcon> newIcon;
|
||||||
be_t<u32> option;
|
be_t<u32> option;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -151,7 +177,7 @@ struct CellSaveDataStatGet
|
||||||
be_t<s32> sysSizeKB;
|
be_t<s32> sysSizeKB;
|
||||||
be_t<u32> fileNum;
|
be_t<u32> fileNum;
|
||||||
be_t<u32> fileListNum;
|
be_t<u32> fileListNum;
|
||||||
be_t<u32> fileList_addr; // CellSaveDataFileStat*
|
mem_beptr_t<CellSaveDataFileStat> fileList;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellSaveDataAutoIndicator
|
struct CellSaveDataAutoIndicator
|
||||||
|
@ -165,9 +191,9 @@ struct CellSaveDataAutoIndicator
|
||||||
|
|
||||||
struct CellSaveDataStatSet
|
struct CellSaveDataStatSet
|
||||||
{
|
{
|
||||||
be_t<u32> setParam_addr; // CellSaveDataSystemFileParam*
|
mem_beptr_t<CellSaveDataSystemFileParam> setParam;
|
||||||
be_t<u32> reCreateMode;
|
be_t<u32> reCreateMode;
|
||||||
be_t<u32> indicator_addr; // CellSaveDataAutoIndicator*
|
mem_beptr_t<CellSaveDataAutoIndicator> indicator;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellSaveDataFileGet
|
struct CellSaveDataFileGet
|
||||||
|
@ -223,8 +249,12 @@ struct SaveDataListEntry
|
||||||
std::string subtitle;
|
std::string subtitle;
|
||||||
std::string details;
|
std::string details;
|
||||||
u32 sizeKb;
|
u32 sizeKb;
|
||||||
u64 timestamp;
|
s64 st_atime_;
|
||||||
void* iconBuffer;
|
s64 st_mtime_;
|
||||||
|
s64 st_ctime_;
|
||||||
|
void* iconBuf;
|
||||||
|
u32 iconBufSize;
|
||||||
|
bool isNew;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
47
rpcs3/cmake_modules/FindGLEW.cmake
Normal file
47
rpcs3/cmake_modules/FindGLEW.cmake
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#
|
||||||
|
# Try to find GLEW library and include path.
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# GLEW_FOUND
|
||||||
|
# GLEW_INCLUDE_PATH
|
||||||
|
# GLEW_LIBRARY
|
||||||
|
#
|
||||||
|
|
||||||
|
IF (WIN32)
|
||||||
|
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
|
||||||
|
$ENV{PROGRAMFILES}/GLEW/include
|
||||||
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
|
||||||
|
DOC "The directory where GL/glew.h resides")
|
||||||
|
FIND_LIBRARY( GLEW_LIBRARY
|
||||||
|
NAMES glew GLEW glew32 glew32s
|
||||||
|
PATHS
|
||||||
|
$ENV{PROGRAMFILES}/GLEW/lib
|
||||||
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
|
||||||
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
|
||||||
|
DOC "The GLEW library")
|
||||||
|
ELSE (WIN32)
|
||||||
|
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
/sw/include
|
||||||
|
/opt/local/include
|
||||||
|
DOC "The directory where GL/glew.h resides")
|
||||||
|
FIND_LIBRARY( GLEW_LIBRARY
|
||||||
|
NAMES GLEW glew
|
||||||
|
PATHS
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
DOC "The GLEW library")
|
||||||
|
ENDIF (WIN32)
|
||||||
|
|
||||||
|
IF (GLEW_INCLUDE_PATH)
|
||||||
|
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
|
||||||
|
ELSE (GLEW_INCLUDE_PATH)
|
||||||
|
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
|
||||||
|
ENDIF (GLEW_INCLUDE_PATH)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED( GLEW_FOUND )
|
Loading…
Add table
Add a link
Reference in a new issue