[APT] Implement some functions for Metroid 2

This commit is contained in:
wheremyfoodat 2022-10-15 21:30:38 +03:00
parent 57fa61eb3f
commit ec26631e5d
3 changed files with 50 additions and 2 deletions

View file

@ -55,6 +55,7 @@ void Kernel::getResourceLimitCurrentValues() {
const Handle resourceLimit = regs[1];
u32 names = regs[2]; // Pointer to resources that we should return
u32 count = regs[3]; // Number of resources
logSVC("GetResourceLimitCurrentValues(values = %08X, handle = %X, names = %08X, count = %d)\n", values, resourceLimit, names, count);
const KernelObject* limit = getObject(resourceLimit, KernelObjectType::ResourceLimit);
if (limit == nullptr) [[unlikely]] {
@ -62,7 +63,6 @@ void Kernel::getResourceLimitCurrentValues() {
return;
}
logSVC("GetResourceLimitCurrentValues(values = %08X, handle = %X, names = %08X, count = %d)\n", values, resourceLimit, names, count);
while (count != 0) {
const u32 name = mem.read32(names);
// TODO: Unsure if this is supposed to be s32 or u32. Shouldn't matter as the kernel can't create so many resources