mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
connectToPort stub, acknowledge configuration memory
This commit is contained in:
parent
8bb494229d
commit
aa643c44bb
5 changed files with 27 additions and 1 deletions
|
@ -54,6 +54,7 @@ set(KERNEL_SOURCE_FILES src/core/kernel/kernel.cpp src/core/kernel/resource_limi
|
||||||
set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/opengl.hpp include/termcolor.hpp
|
set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/opengl.hpp include/termcolor.hpp
|
||||||
include/cpu.hpp include/cpu_dynarmic.hpp include/memory.hpp include/kernel/kernel.hpp
|
include/cpu.hpp include/cpu_dynarmic.hpp include/memory.hpp include/kernel/kernel.hpp
|
||||||
include/dynarmic_cp15.hpp include/kernel/resource_limits.hpp include/kernel/kernel_types.hpp
|
include/dynarmic_cp15.hpp include/kernel/resource_limits.hpp include/kernel/kernel_types.hpp
|
||||||
|
include/kernel/config_mem.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(THIRD_PARTY_SOURCE_FILES third_party/imgui/imgui.cpp
|
set(THIRD_PARTY_SOURCE_FILES third_party/imgui/imgui.cpp
|
||||||
|
|
10
include/kernel/config_mem.hpp
Normal file
10
include/kernel/config_mem.hpp
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
#include "helpers.hpp"
|
||||||
|
|
||||||
|
// Configuration memory addresses
|
||||||
|
namespace ConfigMem {
|
||||||
|
enum : u32 {
|
||||||
|
KernelVersionMinor = 0x1FF80002,
|
||||||
|
KernelVersionMajor = 0x1FF80003
|
||||||
|
};
|
||||||
|
}
|
|
@ -59,6 +59,7 @@ class Kernel {
|
||||||
void getResourceLimitLimitValues();
|
void getResourceLimitLimitValues();
|
||||||
void getResourceLimitCurrentValues();
|
void getResourceLimitCurrentValues();
|
||||||
void svcCloseHandle();
|
void svcCloseHandle();
|
||||||
|
void connectToPort();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Kernel(std::array<u32, 16>& regs, Memory& mem) : regs(regs), mem(mem), handleCounter(0) {
|
Kernel(std::array<u32, 16>& regs, Memory& mem) : regs(regs), mem(mem), handleCounter(0) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ void Kernel::serviceSVC(u32 svc) {
|
||||||
case 0x01: controlMemory(); break;
|
case 0x01: controlMemory(); break;
|
||||||
case 0x21: createAddressArbiter(); break;
|
case 0x21: createAddressArbiter(); break;
|
||||||
case 0x23: svcCloseHandle(); break;
|
case 0x23: svcCloseHandle(); break;
|
||||||
|
case 0x2D: connectToPort(); break;
|
||||||
case 0x38: getResourceLimit(); break;
|
case 0x38: getResourceLimit(); break;
|
||||||
case 0x39: getResourceLimitLimitValues(); break;
|
case 0x39: getResourceLimitLimitValues(); break;
|
||||||
case 0x3A: getResourceLimitCurrentValues(); break;
|
case 0x3A: getResourceLimitCurrentValues(); break;
|
||||||
|
@ -64,6 +65,14 @@ void Kernel::svcCloseHandle() {
|
||||||
regs[0] = SVCResult::Success;
|
regs[0] = SVCResult::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Kernel::connectToPort() {
|
||||||
|
const u32 handlePointer = regs[0];
|
||||||
|
const char* port = static_cast<const char*>(mem.getReadPointer(regs[1]));
|
||||||
|
|
||||||
|
printf("ConnectToPort(handle pointer = %08X, port = \"%s\")\n", handlePointer, port);
|
||||||
|
Helpers::panic("Unimplemented IPC");
|
||||||
|
}
|
||||||
|
|
||||||
std::string Kernel::getProcessName(u32 pid) {
|
std::string Kernel::getProcessName(u32 pid) {
|
||||||
if (pid == KernelHandles::CurrentProcess) {
|
if (pid == KernelHandles::CurrentProcess) {
|
||||||
return "current";
|
return "current";
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "memory.hpp"
|
#include "memory.hpp"
|
||||||
|
#include "config_mem.hpp"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
|
||||||
Memory::Memory() {
|
Memory::Memory() {
|
||||||
fcram = new uint8_t[FCRAM_SIZE]();
|
fcram = new uint8_t[FCRAM_SIZE]();
|
||||||
readTable.resize(totalPageCount, 0);
|
readTable.resize(totalPageCount, 0);
|
||||||
|
@ -122,7 +124,10 @@ u8 Memory::read8(u32 vaddr) {
|
||||||
return *(u8*)(pointer + offset);
|
return *(u8*)(pointer + offset);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Helpers::panic("Unimplemented 8-bit read, addr: %08X", vaddr);
|
switch (vaddr) {
|
||||||
|
case ConfigMem::KernelVersionMinor: return 38;
|
||||||
|
default: Helpers::panic("Unimplemented 8-bit read, addr: %08X", vaddr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue