mirror of
https://github.com/RKX1209/nsemu.git
synced 2024-05-11 09:05:21 -04:00
Fixed some bugs
This commit is contained in:
parent
3af589503c
commit
eaf0deb95a
|
@ -21,7 +21,7 @@ static uint64_t counter;
|
|||
void Interpreter::Run() {
|
||||
debug_print ("Running with Interpreter\n");
|
||||
|
||||
uint64_t estimate = 3500000, mx = 100000;
|
||||
uint64_t estimate = 3728000, mx = 200000;
|
||||
//uint64_t estimate = 3000000, mx = 10000;
|
||||
//uint64_t estimate = 0, mx = 1000000;
|
||||
while (Cpu::GetState () == Cpu::State::Running) {
|
||||
|
@ -41,9 +41,9 @@ void Interpreter::Run() {
|
|||
Cpu::DumpMachine ();
|
||||
}
|
||||
//Cpu::DumpMachine ();
|
||||
if (counter >= estimate + mx) {
|
||||
break;
|
||||
}
|
||||
// if (counter >= estimate + mx) {
|
||||
// break;
|
||||
// }
|
||||
SingleStep ();
|
||||
counter++;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ static T ReadFromRAM(const uint64_t gpa) {
|
|||
template<typename T>
|
||||
static void WriteToRAM(const uint64_t gpa, T value) {
|
||||
uint8_t *emu_mem = static_cast<uint8_t *>(Memory::GetRawPtr(gpa, sizeof(T)));
|
||||
debug_print("WriteToRAM: 0x%lx, (%d)\n", gpa, sizeof(T));
|
||||
debug_print("WriteToRAM: 0x%lx, (%d) RawPtr(%p)\n", gpa, sizeof(T), (void *)emu_mem);
|
||||
for (uint64_t addr = gpa; addr < gpa + sizeof(T); addr++) {
|
||||
uint8_t byte = value & 0xff;
|
||||
std::memcpy (&emu_mem[addr - gpa], &byte, sizeof(uint8_t));
|
||||
|
|
41
Memory.cpp
41
Memory.cpp
|
@ -2,7 +2,7 @@
|
|||
#include <sys/mman.h>
|
||||
#include "Nsemu.hpp"
|
||||
|
||||
RAMBlock::RAMBlock (std::string _name, uint64_t _addr, size_t _length, int _perm) : block(nullptr){
|
||||
RAMBlock::RAMBlock (std::string _name, uint64_t _addr, unsigned int _length, int _perm) : block(nullptr){
|
||||
int page = getpagesize ();
|
||||
name = _name;
|
||||
length = _length;
|
||||
|
@ -12,7 +12,7 @@ RAMBlock::RAMBlock (std::string _name, uint64_t _addr, size_t _length, int _perm
|
|||
}
|
||||
addr = _addr;
|
||||
}
|
||||
RAMBlock::RAMBlock(std::string _name, uint64_t _addr, size_t _length, uint8_t *raw, int _perm) {
|
||||
RAMBlock::RAMBlock(std::string _name, uint64_t _addr, unsigned int _length, uint8_t *raw, int _perm) {
|
||||
int page = getpagesize ();
|
||||
name = _name;
|
||||
length = _length;
|
||||
|
@ -29,7 +29,7 @@ namespace Memory
|
|||
uint64_t heap_base = 0x9000000;
|
||||
uint64_t heap_size = 0x0;
|
||||
uint8_t *pRAM; // XXX: Replace raw pointer to View wrapper.
|
||||
size_t ram_size = 0x10000000;
|
||||
unsigned int ram_size = 0x10000000;
|
||||
uint64_t straight_max = heap_base + heap_size;
|
||||
std::vector<RAMBlock*> regions;
|
||||
static RAMBlock mem_map_straight[] =
|
||||
|
@ -40,29 +40,31 @@ static RAMBlock mem_map_straight[] =
|
|||
RAMBlock ("[stack]", 0x3000000, 0x0ffffff, PROT_READ | PROT_WRITE),
|
||||
};
|
||||
|
||||
static bool inline IsStraight(uint64_t addr, size_t len) {
|
||||
static bool inline IsStraight(uint64_t addr, unsigned int len) {
|
||||
return addr + len <= straight_max;
|
||||
}
|
||||
|
||||
static RAMBlock* FindRamBlock(uint64_t addr, size_t len) {
|
||||
debug_print("Find 0x%lx, 0x%x\n", addr, len);
|
||||
static RAMBlock* FindRamBlock(uint64_t addr, unsigned int len) {
|
||||
//ns_print("Find 0x%lx, 0x%x\n", addr, len);
|
||||
for (int i = 0; i < regions.size(); i++) {
|
||||
debug_print("region[%d] 0x%lx: 0x%x\n", i, regions[i]->addr, regions[i]->length);
|
||||
if (regions[i]->addr <= addr && addr + len <= regions[i]->addr + regions[i]->length) {
|
||||
debug_print("0x%lx, 0x%x => match %d\n", addr, len, i);
|
||||
//ns_print("region[%d] 0x%lx: 0x%x\n", i, regions[i]->addr, regions[i]->length);
|
||||
//if (regions[i]->addr <= addr && addr + len <= regions[i]->addr + regions[i]->length) {
|
||||
//FIXME: [addr, addr+length] can be laid over contigious ramblocks
|
||||
if (regions[i]->addr <= addr && addr <= regions[i]->addr + regions[i]->length) {
|
||||
//ns_print("0x%lx, 0x%x => match %d\n", addr, len, i);
|
||||
return regions[i];
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void AddAnonStraight(uint64_t addr, size_t len, int perm) {
|
||||
static void AddAnonStraight(uint64_t addr, unsigned int len, int perm) {
|
||||
ns_print("Add anonymous fixed region [0x%lx, %d]\n", addr, len);
|
||||
RAMBlock *new_ram = new RAMBlock("[anon]", addr, len, perm) ;
|
||||
regions.push_back(new_ram);
|
||||
}
|
||||
|
||||
static void AddAnonRamBlock(uint64_t addr, size_t len, int perm) {
|
||||
static void AddAnonRamBlock(uint64_t addr, unsigned int len, int perm) {
|
||||
uint8_t *raw = new uint8_t[len];
|
||||
if (!raw) {
|
||||
ns_abort("Failed to allocate new RAM Block\n");
|
||||
|
@ -72,7 +74,7 @@ static void AddAnonRamBlock(uint64_t addr, size_t len, int perm) {
|
|||
regions.push_back(new_ram);
|
||||
}
|
||||
|
||||
void AddMemmap(uint64_t addr, size_t len) {
|
||||
void AddMemmap(uint64_t addr, unsigned int len) {
|
||||
if (IsStraight(addr, len)) {
|
||||
/* Within straight regions */
|
||||
AddAnonStraight(addr, len, PROT_READ | PROT_WRITE);
|
||||
|
@ -85,7 +87,7 @@ void AddMemmap(uint64_t addr, size_t len) {
|
|||
AddAnonRamBlock(addr, len, PROT_READ | PROT_WRITE);
|
||||
}
|
||||
|
||||
void DelMemmap(uint64_t addr, size_t len) {
|
||||
void DelMemmap(uint64_t addr, unsigned int len) {
|
||||
auto it = regions.begin();
|
||||
while (it != regions.end()) {
|
||||
RAMBlock *ram = *it;
|
||||
|
@ -114,7 +116,7 @@ std::list<std::tuple<uint64_t,uint64_t, int>> GetRegions() {
|
|||
list<tuple<uint64_t, uint64_t>> temp;
|
||||
for (int i = 0; i < regions.size(); i++) {
|
||||
uint64_t addr = regions[i]->addr;
|
||||
size_t length = regions[i]->length;
|
||||
unsigned int length = regions[i]->length;
|
||||
temp.push_back(make_tuple(addr, addr + length));
|
||||
}
|
||||
temp.sort([](auto a, auto b) { auto [ab, _] = a; auto [bb, __] = b; return ab < bb; });
|
||||
|
@ -130,13 +132,14 @@ std::list<std::tuple<uint64_t,uint64_t, int>> GetRegions() {
|
|||
return ret;
|
||||
}
|
||||
|
||||
void *GetRawPtr(uint64_t gpa, size_t len) {
|
||||
void *emu_mem;
|
||||
void *GetRawPtr(uint64_t gpa, unsigned int len) {
|
||||
void *emu_mem = 0;
|
||||
if (IsStraight(gpa, len)) {
|
||||
emu_mem = (void *)&pRAM[gpa];
|
||||
} else {
|
||||
RAMBlock *ram = FindRamBlock (gpa, len);
|
||||
if (!ram) {
|
||||
ns_abort("Cannnot find addr: 0x%lx size: %d\n", gpa, len);
|
||||
return nullptr;
|
||||
}
|
||||
debug_print("Uncontigious block\n");
|
||||
|
@ -145,7 +148,7 @@ void *GetRawPtr(uint64_t gpa, size_t len) {
|
|||
return emu_mem;
|
||||
}
|
||||
|
||||
static bool _CopyMemEmu(void *data, uint64_t gpa, size_t len, bool load) {
|
||||
static bool _CopyMemEmu(void *data, uint64_t gpa, unsigned int len, bool load) {
|
||||
void *emu_mem = GetRawPtr (gpa, len);
|
||||
if (!emu_mem) {
|
||||
return false;
|
||||
|
@ -158,11 +161,11 @@ static bool _CopyMemEmu(void *data, uint64_t gpa, size_t len, bool load) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CopytoEmu(Nsemu *nsemu, void *data, uint64_t gpa, size_t len) {
|
||||
bool CopytoEmu(Nsemu *nsemu, void *data, uint64_t gpa, unsigned int len) {
|
||||
return _CopyMemEmu (data, gpa, len, true);
|
||||
}
|
||||
|
||||
bool CopyfromEmu(Nsemu *nsemu, void *data, uint64_t gpa, size_t len) {
|
||||
bool CopyfromEmu(Nsemu *nsemu, void *data, uint64_t gpa, unsigned int len) {
|
||||
return _CopyMemEmu (data, gpa, len, false);
|
||||
}
|
||||
|
||||
|
|
114
Service/Fsp.cpp
114
Service/Fsp.cpp
|
@ -4,7 +4,7 @@
|
|||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenBisPartition(nn::fssrv::sf::Partition partitionID, nn::fssrv::sf::IStorage*& BisPartition) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenBisPartition\n");
|
||||
//BisPartition = buildInterface(nn::fssrv::sf::IStorage, "bis.istorage");
|
||||
BisPartition = new nn::fssrv::sf::IStorage();
|
||||
return 0x0;
|
||||
}
|
||||
|
||||
|
@ -12,13 +12,13 @@ uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDataStorageByApplicationId(nn::App
|
|||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDataStorageByApplicationId 0x%lx\n", tid);
|
||||
std::stringstream ss;
|
||||
ss << "tid_archives_" << hex << tid << ".istorage";
|
||||
//dataStorage = buildInterface(nn::fssrv::sf::IStorage, ss.str());
|
||||
dataStorage = new nn::fssrv::sf::IStorage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDataStorageByCurrentProcess(nn::fssrv::sf::IStorage*& dataStorage) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDataStorageByCurrentProcess\n");
|
||||
//dataStorage = buildInterface(nn::fssrv::sf::IStorage, "");
|
||||
dataStorage = new nn::fssrv::sf::IStorage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -26,18 +26,120 @@ uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDataStorageByDataId(nn::Applicatio
|
|||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDataStorageByDataId 0x%lx\n", 0x0100000000000800+(uint64_t)storageId);
|
||||
std::stringstream ss;
|
||||
ss << "archives/" << hex << setw(16) << setfill('0') << 0x0100000000000800+(uint64_t)storageId << ".istorage";
|
||||
//dataStorage = buildInterface(nn::fssrv::sf::IStorage, ss.str());
|
||||
dataStorage = new nn::fssrv::sf::IStorage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenGameCardPartition(nn::fssrv::sf::Partition partitionID, uint32_t _1, nn::fssrv::sf::IStorage*& gameCardFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenGameCardPartition\n");
|
||||
//gameCardFs = buildInterface(nn::fssrv::sf::IStorage, "GamePartition.istorage");
|
||||
gameCardFs = new nn::fssrv::sf::IStorage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenRomStorage(nn::fssrv::sf::IStorage*& _0) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenRomStorage\n");
|
||||
//_0 = buildInterface(nn::fssrv::sf::IStorage, "RomStorage.istorage");
|
||||
_0 = new nn::fssrv::sf::IStorage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Funcs
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByCurrentProcess(nn::fssrv::sf::IFileSystem*& _0) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByCurrentProcess");
|
||||
_0 = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountContent7(nn::ApplicationId tid, uint32_t ncaType, nn::fssrv::sf::IFileSystem*& _2) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountContent7");
|
||||
_2 = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountContent(nn::ApplicationId tid, uint32_t flag, int8_t * path, unsigned int path_size, nn::fssrv::sf::IFileSystem*& contentFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountContent");
|
||||
contentFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByApplicationId(nn::ApplicationId tid, nn::fssrv::sf::IFileSystem*& dataFiles) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByApplicationId");
|
||||
dataFiles = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountBis(nn::fssrv::sf::Partition partitionID, int8_t * path, unsigned int path_size, nn::fssrv::sf::IFileSystem*& Bis) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountBis");
|
||||
Bis = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenHostFileSystemImpl(int8_t * path, unsigned int path_size, nn::fssrv::sf::IFileSystem*& _1) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenHostFileSystemImpl");
|
||||
_1 = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSdCard(nn::fssrv::sf::IFileSystem*& sdCard) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSdCard");
|
||||
//sdCard = new nn::fssrv::sf::IFileSystem, "SDCard");
|
||||
sdCard = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountGameCardPartition(uint32_t _0, uint32_t _1, nn::fssrv::sf::IFileSystem*& gameCardPartitionFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountGameCardPartition");
|
||||
//gameCardPartitionFs = new nn::fssrv::sf::IFileSystem, "GameCard");
|
||||
gameCardPartitionFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSaveData(uint8_t input, nn::fssrv::sf::SaveStruct saveStruct, nn::fssrv::sf::IFileSystem*& saveDataFs) {
|
||||
uint64_t tid = *(uint64_t *)(&saveStruct[0x18]);
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSaveData 0x%lx", tid);
|
||||
std::stringstream ss;
|
||||
ss << "save_" << hex << tid;
|
||||
//saveDataFs = new nn::fssrv::sf::IFileSystem, ss.str());
|
||||
saveDataFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSystemSaveData(uint8_t input, nn::fssrv::sf::SaveStruct saveStruct, nn::fssrv::sf::IFileSystem*& systemSaveDataFs) {
|
||||
uint64_t tid = *(uint64_t *)(&saveStruct[0x18]);
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSystemSaveData 0x%lx", tid);
|
||||
std::stringstream ss;
|
||||
ss << "syssave_" << hex << tid;
|
||||
//systemSaveDataFs = new nn::fssrv::sf::IFileSystem, ss.str());
|
||||
systemSaveDataFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSaveDataReadOnly(uint8_t input, nn::fssrv::sf::SaveStruct saveStruct, nn::fssrv::sf::IFileSystem*& saveDataFs) {
|
||||
uint64_t tid = *(uint64_t *)(&saveStruct[0x18]);
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSaveDataReadOnly 0x%lx", tid);
|
||||
std::stringstream ss;
|
||||
ss << "save_" << hex << tid;
|
||||
//saveDataFs = new nn::fssrv::sf::IFileSystem, ss.str());
|
||||
saveDataFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountImageDirectory(uint32_t _0, nn::fssrv::sf::IFileSystem*& imageFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountImageDirectory");
|
||||
//imageFs = new nn::fssrv::sf::IFileSystem, string("Image_") + to_string(_0));
|
||||
imageFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountContentStorage(uint32_t contentStorageID, nn::fssrv::sf::IFileSystem*& contentFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountContentStorage");
|
||||
//contentFs = new nn::fssrv::sf::IFileSystem, string("CS_") + to_string(contentStorageID));
|
||||
contentFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxyForLoader::MountCode(nn::ApplicationId TID, int8_t * contentPath, unsigned int contentPath_size, nn::fssrv::sf::IFileSystem*& contentFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxyForLoader::MountCode");
|
||||
//contentFs = new nn::fssrv::sf::IFileSystem, "");
|
||||
contentFs = new nn::fssrv::sf::IFileSystem();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ uint32_t SmService::GetService(ServiceName _name, IpcService*& service) {
|
|||
uint32_t SmService::RegisterService(ServiceName _name, IpcService*& service) {
|
||||
std::string name = (char *) _name;
|
||||
IpcService *new_srv = new IpcService();
|
||||
debug_print("Registering service %s\n", _name);
|
||||
ns_print("Registering service %s\n", _name);
|
||||
IPC::services[name] = new_srv;
|
||||
service = new_srv;
|
||||
return 0;
|
||||
|
@ -33,7 +33,7 @@ uint32_t SmService::UnregisterService(ServiceName _name) {
|
|||
return 0xC15; //error code
|
||||
}
|
||||
IpcService *srv = it->second;
|
||||
debug_print("Unregistering service %s\n", _name);
|
||||
ns_print("Unregistering service %s\n", _name);
|
||||
delete srv;
|
||||
IPC::services.erase(it);
|
||||
return 0;
|
||||
|
|
|
@ -16329,54 +16329,6 @@ uint32_t nn::fssrv::sf::IFileSystemProxy::IsExFatSupported(uint8_t& isSupported)
|
|||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::IsExFatSupported\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountBis(nn::fssrv::sf::Partition partitionID, int8_t * path, unsigned int path_size, nn::fssrv::sf::IFileSystem*& Bis) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountBis\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountContent(nn::ApplicationId tid, uint32_t flag, int8_t * path, unsigned int path_size, nn::fssrv::sf::IFileSystem*& contentFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountContent\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountContent7(nn::ApplicationId tid, uint32_t ncaType, nn::fssrv::sf::IFileSystem*& _2) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountContent7\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountContentStorage(uint32_t contentStorageID, nn::fssrv::sf::IFileSystem*& contentFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountContentStorage\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountGameCardPartition(uint32_t _0, uint32_t _1, nn::fssrv::sf::IFileSystem*& gameCardPartitionFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountGameCardPartition\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountImageDirectory(uint32_t _0, nn::fssrv::sf::IFileSystem*& imageFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountImageDirectory\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSaveData(uint8_t input, nn::fssrv::sf::SaveStruct saveStruct, nn::fssrv::sf::IFileSystem*& saveDataFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSaveData\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSaveDataReadOnly(uint8_t input, nn::fssrv::sf::SaveStruct saveStruct, nn::fssrv::sf::IFileSystem*& saveDataFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSaveDataReadOnly\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSdCard(nn::fssrv::sf::IFileSystem*& sdCard) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSdCard\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::MountSystemSaveData(uint8_t input, nn::fssrv::sf::SaveStruct saveStruct, nn::fssrv::sf::IFileSystem*& systemSaveDataFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::MountSystemSaveData\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByApplicationId(nn::ApplicationId tid, nn::fssrv::sf::IFileSystem*& dataFiles) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByApplicationId\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByCurrentProcess(nn::fssrv::sf::IFileSystem*& _0) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDataFileSystemByCurrentProcess\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenDeviceOperator(nn::fssrv::sf::IDeviceOperator*& _0) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenDeviceOperator\n");
|
||||
return 0;
|
||||
|
@ -16385,10 +16337,6 @@ uint32_t nn::fssrv::sf::IFileSystemProxy::OpenGameCardDetectionEventNotifier(nn:
|
|||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenGameCardDetectionEventNotifier\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenHostFileSystemImpl(int8_t * path, unsigned int path_size, nn::fssrv::sf::IFileSystem*& _1) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenHostFileSystemImpl\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxy::OpenSaveDataInfoReader(nn::fssrv::sf::ISaveDataInfoReader*& _0) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxy::OpenSaveDataInfoReader\n");
|
||||
return 0;
|
||||
|
@ -16469,10 +16417,6 @@ uint32_t nn::fssrv::sf::IFileSystemProxyForLoader::IsCodeMounted(nn::Application
|
|||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxyForLoader::IsCodeMounted\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IFileSystemProxyForLoader::MountCode(nn::ApplicationId TID, int8_t * contentPath, unsigned int contentPath_size, nn::fssrv::sf::IFileSystem*& contentFs) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IFileSystemProxyForLoader::MountCode\n");
|
||||
return 0;
|
||||
}
|
||||
uint32_t nn::fssrv::sf::IProgramRegistry::ClearFsPermissions(uint64_t pid) {
|
||||
ns_print("Stub implementation for nn::fssrv::sf::IProgramRegistry::ClearFsPermissions\n");
|
||||
return 0;
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
class RAMBlock {
|
||||
public:
|
||||
std::string name;
|
||||
size_t length;
|
||||
unsigned int length;
|
||||
int perm;
|
||||
uint64_t addr; //gpa (guest physical address)
|
||||
uint8_t *block;
|
||||
RAMBlock() { block = nullptr; }
|
||||
RAMBlock(std::string _name, uint64_t _addr, size_t _length, int _perm); //straight mapping
|
||||
RAMBlock(std::string _name, uint64_t _addr, size_t _length, uint8_t *raw, int _perm);
|
||||
RAMBlock(std::string _name, uint64_t _addr, unsigned int _length, int _perm); //straight mapping
|
||||
RAMBlock(std::string _name, uint64_t _addr, unsigned int _length, uint8_t *raw, int _perm);
|
||||
~RAMBlock() {
|
||||
if (block) {
|
||||
delete[] block;
|
||||
|
@ -34,14 +34,14 @@ extern uint64_t heap_base;
|
|||
extern uint64_t heap_size;
|
||||
|
||||
void InitMemmap(Nsemu *nsemu);
|
||||
void AddMemmap(uint64_t addr, size_t len);
|
||||
void DelMemmap(uint64_t addr, size_t len);
|
||||
void AddMemmap(uint64_t addr, unsigned int len);
|
||||
void DelMemmap(uint64_t addr, unsigned int len);
|
||||
std::list<std::tuple<uint64_t,uint64_t, int>> GetRegions();
|
||||
|
||||
void *GetRawPtr(uint64_t gpa, size_t len);
|
||||
bool CopytoEmu(Nsemu *nsemu, void *data, uint64_t addr, size_t len);
|
||||
bool CopytoEmuByName(Nsemu *nsemu, void *data, std::string name, size_t len);
|
||||
bool CopyfromEmu(Nsemu *nsemu, void *data, uint64_t addr, size_t len);
|
||||
void *GetRawPtr(uint64_t gpa, unsigned int len);
|
||||
bool CopytoEmu(Nsemu *nsemu, void *data, uint64_t addr, unsigned int len);
|
||||
bool CopytoEmuByName(Nsemu *nsemu, void *data, std::string name, unsigned int len);
|
||||
bool CopyfromEmu(Nsemu *nsemu, void *data, uint64_t addr, unsigned int len);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue