mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-14 06:46:53 +12:00
Backup Noumi's Home Menu changes from her deleted repo
Co-Authored-By: Noumi <139501014+noumidev@users.noreply.github.com>
This commit is contained in:
parent
6be642a118
commit
38ef0dbe4c
32 changed files with 661 additions and 34 deletions
|
@ -2,8 +2,19 @@
|
|||
#include <cstdint>
|
||||
|
||||
namespace IPC {
|
||||
namespace BufferType {
|
||||
enum : std::uint32_t {
|
||||
Send = 1,
|
||||
Receive,
|
||||
};
|
||||
}
|
||||
|
||||
constexpr std::uint32_t responseHeader(std::uint32_t commandID, std::uint32_t normalResponses, std::uint32_t translateResponses) {
|
||||
// TODO: Maybe validate the response count stuff fits in 6 bits
|
||||
return (commandID << 16) | (normalResponses << 6) | translateResponses;
|
||||
}
|
||||
}
|
||||
|
||||
constexpr std::uint32_t pointerHeader(std::uint32_t index, std::uint32_t size, std::uint32_t type) {
|
||||
return (size << 14) | (index << 10) | (type << 1);
|
||||
}
|
||||
} // namespace IPC
|
|
@ -8,6 +8,7 @@ namespace ConfigMem {
|
|||
KernelVersionMajor = 0x1FF80003,
|
||||
SyscoreVer = 0x1FF80010,
|
||||
EnvInfo = 0x1FF80014,
|
||||
PrevFirm = 0x1FF80016,
|
||||
AppMemAlloc = 0x1FF80040,
|
||||
FirmUnknown = 0x1FF80060,
|
||||
FirmRevision = 0x1FF80061,
|
||||
|
@ -30,6 +31,12 @@ namespace ConfigMem {
|
|||
|
||||
// Shows what type of hardware we're running on
|
||||
namespace HardwareCodes {
|
||||
enum : u8 { Product = 1, Devboard = 2, Debugger = 3, Capture = 4 };
|
||||
enum : u8 {
|
||||
Product = 1,
|
||||
Devboard = 2,
|
||||
Debugger = 3,
|
||||
Capture = 4,
|
||||
};
|
||||
}
|
||||
} // namespace ConfigMem
|
||||
|
|
@ -35,14 +35,17 @@ namespace KernelHandles {
|
|||
MCU_HWC, // Used for various MCU hardware-related things like battery control
|
||||
MIC, // MIC service (Controls the microphone)
|
||||
NFC, // NFC (Duh), used for Amiibo
|
||||
NIM, // Updates, DLC, etc
|
||||
NIM_AOC, // DLC, etc
|
||||
NIM_U, // Updates
|
||||
NDM, // ?????
|
||||
NS_S, // Nintendo Shell service
|
||||
NWM_UDS, // Local multiplayer
|
||||
NEWS_S, // news:u on steroids
|
||||
NEWS_U, // This service literally has 1 command (AddNotification) and I don't even understand what it does
|
||||
PTM_U, // PTM service (Used for accessing various console info, such as battery, shell and pedometer state)
|
||||
PTM_SYSM, // PTM system service
|
||||
PTM_PLAY, // PTM Play service, used for retrieving play history
|
||||
PTM_GETS, // PTM RTC service (GetSystemTime)
|
||||
SOC, // Socket service
|
||||
SSL, // SSL service (Totally didn't expect that)
|
||||
Y2R, // Also does camera stuff
|
||||
|
@ -97,10 +100,12 @@ namespace KernelHandles {
|
|||
case MCU_HWC: return "MCU::HWC";
|
||||
case MIC: return "MIC";
|
||||
case NDM: return "NDM";
|
||||
case NEWS_S: return "NEWS_S";
|
||||
case NEWS_U: return "NEWS_U";
|
||||
case NWM_UDS: return "nwm::UDS";
|
||||
case NFC: return "NFC";
|
||||
case NIM: return "NIM";
|
||||
case NIM_AOC: return "NIM:AOC";
|
||||
case NIM_U: return "NIM:U";
|
||||
case PTM_U: return "PTM:U";
|
||||
case PTM_SYSM: return "PTM:SYSM";
|
||||
case PTM_PLAY: return "PTM:PLAY";
|
||||
|
|
|
@ -65,6 +65,7 @@ namespace Log {
|
|||
static Logger<false> nwmUdsLogger;
|
||||
static Logger<false> nimLogger;
|
||||
static Logger<false> ndmLogger;
|
||||
static Logger<false> nsLogger;
|
||||
static Logger<false> ptmLogger;
|
||||
static Logger<false> socLogger;
|
||||
static Logger<false> sslLogger;
|
||||
|
|
|
@ -19,6 +19,7 @@ class ACService {
|
|||
void closeAsync(u32 messagePointer);
|
||||
void createDefaultConfig(u32 messagePointer);
|
||||
void getConnectingInfraPriority(u32 messagePointer);
|
||||
void getNZoneBeaconNotFoundEvent(u32 messagePointer);
|
||||
void getStatus(u32 messagePointer);
|
||||
void getLastErrorCode(u32 messagePointer);
|
||||
void getWifiStatus(u32 messagePointer);
|
||||
|
|
|
@ -13,9 +13,14 @@ class AMService {
|
|||
MAKE_LOG_FUNCTION(log, amLogger)
|
||||
|
||||
// Service commands
|
||||
void checkContentRights(u32 messagePointer);
|
||||
void getDLCTitleInfo(u32 messagePointer);
|
||||
void getPatchTitleInfo(u32 messagePointer);
|
||||
void getProgramInfos(u32 messagePointer);
|
||||
void getProgramList(u32 messagePointer);
|
||||
void getTicketList(u32 messagePointer);
|
||||
void listTitleInfo(u32 messagePointer);
|
||||
void needsCleanup(u32 messagePointer);
|
||||
|
||||
public:
|
||||
AMService(Memory& mem) : mem(mem) {}
|
||||
|
|
|
@ -65,15 +65,18 @@ class APTService {
|
|||
void checkNew3DSApp(u32 messagePointer);
|
||||
void enable(u32 messagePointer);
|
||||
void getAppletInfo(u32 messagePointer);
|
||||
void getCaptureInfo(u32 messagePointer);
|
||||
void getSharedFont(u32 messagePointer);
|
||||
void getWirelessRebootInfo(u32 messagePointer);
|
||||
void glanceParameter(u32 messagePointer);
|
||||
void initialize(u32 messagePointer);
|
||||
void inquireNotification(u32 messagePointer);
|
||||
void isRegistered(u32 messagePointer);
|
||||
void loadSysMenuArg(u32 messagePointer);
|
||||
void notifyToWait(u32 messagePointer);
|
||||
void preloadLibraryApplet(u32 messagePointer);
|
||||
void prepareToStartLibraryApplet(u32 messagePointer);
|
||||
void receiveDeliverArg(u32 messagePointer);
|
||||
void receiveParameter(u32 messagePointer);
|
||||
void replySleepQuery(u32 messagePointer);
|
||||
void setApplicationCpuTimeLimit(u32 messagePointer);
|
||||
|
|
|
@ -14,10 +14,14 @@ class BOSSService {
|
|||
|
||||
// Service commands
|
||||
void cancelTask(u32 messagePointer);
|
||||
void deleteNsData(u32 messagePointer);
|
||||
void initializeSession(u32 messagePointer);
|
||||
void getAppNewFlag(u32 messagePointer);
|
||||
void getErrorCode(u32 messagePointer);
|
||||
void getNsDataHeaderInfo(u32 messagePointer);
|
||||
void getNewArrivalFlag(u32 messagePointer);
|
||||
void getNsDataIdList(u32 messagePointer, u32 commandWord);
|
||||
void getNsDataLastUpdated(u32 messagePointer);
|
||||
void getOptoutFlag(u32 messagePointer);
|
||||
void getStorageEntryInfo(u32 messagePointer); // Unknown what this is, name taken from Citra
|
||||
void getTaskIdList(u32 messagePointer);
|
||||
|
@ -26,12 +30,15 @@ class BOSSService {
|
|||
void getTaskState(u32 messagePointer);
|
||||
void getTaskStatus(u32 messagePointer);
|
||||
void getTaskStorageInfo(u32 messagePointer);
|
||||
void readNsData(u32 messagePointer);
|
||||
void receiveProperty(u32 messagePointer);
|
||||
void registerNewArrivalEvent(u32 messagePointer);
|
||||
void registerStorageEntry(u32 messagePointer);
|
||||
void registerTask(u32 messagePointer);
|
||||
void sendProperty(u32 messagePointer);
|
||||
void setAppNewFlag(u32 messagePointer);
|
||||
void setOptoutFlag(u32 messagePointer);
|
||||
void startBgImmediate(u32 messagePointer);
|
||||
void startTask(u32 messagePointer);
|
||||
void unregisterStorage(u32 messagePointer);
|
||||
void unregisterTask(u32 messagePointer);
|
||||
|
|
|
@ -26,6 +26,8 @@ class CFGService {
|
|||
void genUniqueConsoleHash(u32 messagePointer);
|
||||
void secureInfoGetByte101(u32 messagePointer);
|
||||
void secureInfoGetRegion(u32 messagePointer);
|
||||
void setConfigInfoBlk4(u32 messagePointer);
|
||||
void updateConfigNANDSavegame(u32 messagePointer);
|
||||
void translateCountryInfo(u32 messagePointer);
|
||||
|
||||
void getConfigInfo(u32 output, u32 blockID, u32 size, u32 permissionMask);
|
||||
|
|
|
@ -70,6 +70,7 @@ class FSService {
|
|||
void getArchiveResource(u32 messagePointer);
|
||||
void getFreeBytes(u32 messagePointer);
|
||||
void getFormatInfo(u32 messagePointer);
|
||||
void getNumSeeds(u32 messagePointer);
|
||||
void getPriority(u32 messagePointer);
|
||||
void getSdmcArchiveResource(u32 messagePointer);
|
||||
void getThisSaveDataSecureValue(u32 messagePointer);
|
||||
|
|
|
@ -13,8 +13,9 @@ class LCDService {
|
|||
MAKE_LOG_FUNCTION(log, gspLCDLogger)
|
||||
|
||||
// Service commands
|
||||
void setLedForceOff(u32 messagePointer);
|
||||
|
||||
public:
|
||||
public:
|
||||
LCDService(Memory& mem) : mem(mem) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
|
|
20
include/services/news_s.hpp
Normal file
20
include/services/news_s.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
#include "helpers.hpp"
|
||||
#include "kernel_types.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "memory.hpp"
|
||||
|
||||
class NewsSService {
|
||||
using Handle = HorizonHandle;
|
||||
|
||||
Handle handle = KernelHandles::NEWS_S;
|
||||
Memory& mem;
|
||||
MAKE_LOG_FUNCTION(log, newsLogger)
|
||||
|
||||
// Service commands
|
||||
|
||||
public:
|
||||
NewsSService(Memory& mem) : mem(mem) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
};
|
|
@ -5,18 +5,31 @@
|
|||
#include "memory.hpp"
|
||||
#include "result/result.hpp"
|
||||
|
||||
class Kernel;
|
||||
|
||||
class NIMService {
|
||||
using Handle = HorizonHandle;
|
||||
|
||||
Handle handle = KernelHandles::NIM;
|
||||
Memory& mem;
|
||||
Kernel& kernel;
|
||||
MAKE_LOG_FUNCTION(log, nimLogger)
|
||||
|
||||
std::optional<Handle> backgroundSystemUpdateEvent;
|
||||
|
||||
// Service commands
|
||||
void getAutoTitleDownloadTaskInfos(u32 messagePointer);
|
||||
void getBackgroundEventForMenu(u32 messagePointer);
|
||||
void getTaskInfos(u32 messagePointer);
|
||||
void initialize(u32 messagePointer);
|
||||
void isPendingAutoTitleDownloadTasks(u32 messagePointer);
|
||||
|
||||
public:
|
||||
NIMService(Memory& mem) : mem(mem) {}
|
||||
enum class Type {
|
||||
AOC, // nim:aoc
|
||||
U, // nim:u
|
||||
};
|
||||
|
||||
NIMService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
void handleSyncRequest(u32 messagePointer, Type type);
|
||||
};
|
25
include/services/ns.hpp
Normal file
25
include/services/ns.hpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
#include "helpers.hpp"
|
||||
#include "kernel_types.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "result/result.hpp"
|
||||
|
||||
class NSService {
|
||||
Memory& mem;
|
||||
MAKE_LOG_FUNCTION(log, nsLogger)
|
||||
|
||||
// Service commands
|
||||
void launchTitle(u32 messagePointer);
|
||||
|
||||
public:
|
||||
enum class Type {
|
||||
S, // ns:s
|
||||
P, // ns:p
|
||||
C, // ns:c
|
||||
};
|
||||
|
||||
NSService(Memory& mem) : mem(mem) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer, Type type);
|
||||
};
|
|
@ -13,17 +13,21 @@ class PTMService {
|
|||
const EmulatorConfig& config;
|
||||
|
||||
// Service commands
|
||||
void clearSoftwareClosedFlag(u32 messagePointer);
|
||||
void configureNew3DSCPU(u32 messagePointer);
|
||||
void getAdapterState(u32 messagePointer);
|
||||
void getBatteryChargeState(u32 messagePointer);
|
||||
void getBatteryLevel(u32 messagePointer);
|
||||
void getSoftwareClosedFlag(u32 messagePointer);
|
||||
void getPedometerState(u32 messagePointer);
|
||||
void getStepHistory(u32 messagePointer);
|
||||
void getStepHistoryAll(u32 messagePointer);
|
||||
void getSystemTime(u32 messagePointer);
|
||||
void getTotalStepCount(u32 messagePointer);
|
||||
|
||||
public:
|
||||
enum class Type {
|
||||
GETS, // ptm:gets
|
||||
U, // ptm:u
|
||||
SYSM, // ptm:sysm
|
||||
PLAY, // ptm:play
|
||||
|
|
|
@ -28,10 +28,12 @@
|
|||
#include "services/mcu/mcu_hwc.hpp"
|
||||
#include "services/mic.hpp"
|
||||
#include "services/ndm.hpp"
|
||||
#include "services/nwm_uds.hpp"
|
||||
#include "services/news_s.hpp"
|
||||
#include "services/news_u.hpp"
|
||||
#include "services/nfc.hpp"
|
||||
#include "services/nim.hpp"
|
||||
#include "services/ns.hpp"
|
||||
#include "services/nwm_uds.hpp"
|
||||
#include "services/ptm.hpp"
|
||||
#include "services/soc.hpp"
|
||||
#include "services/ssl.hpp"
|
||||
|
@ -52,11 +54,11 @@ class ServiceManager {
|
|||
|
||||
MAKE_LOG_FUNCTION(log, srvLogger)
|
||||
|
||||
ACService ac;
|
||||
ACService ac;
|
||||
ACTService act;
|
||||
AMService am;
|
||||
AMService am;
|
||||
APTService apt;
|
||||
BOSSService boss;
|
||||
BOSSService boss;
|
||||
CAMService cam;
|
||||
CECDService cecd;
|
||||
CFGService cfg;
|
||||
|
@ -73,10 +75,12 @@ class ServiceManager {
|
|||
LDRService ldr;
|
||||
MICService mic;
|
||||
NDMService ndm;
|
||||
NewsSService news_s;
|
||||
NewsUService news_u;
|
||||
NFCService nfc;
|
||||
NwmUdsService nwm_uds;
|
||||
NIMService nim;
|
||||
NIMService nim;
|
||||
NSService ns;
|
||||
PTMService ptm;
|
||||
SOCService soc;
|
||||
SSLService ssl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue