Panda3DS/include/services/cfg.hpp
wheremyfoodat dc80828397
Fix typo (#680)
Co-authored-by: Noumi <139501014+noumidev@users.noreply.github.com>
2024-12-10 18:52:53 +02:00

51 lines
No EOL
1.4 KiB
C++

#pragma once
#include <cstring>
#include "helpers.hpp"
#include "logger.hpp"
#include "memory.hpp"
#include "region_codes.hpp"
#include "result/result.hpp"
class CFGService {
using Handle = HorizonHandle;
Memory& mem;
CountryCodes country = CountryCodes::US; // Default to USA
MAKE_LOG_FUNCTION(log, cfgLogger)
void writeStringU16(u32 pointer, const std::u16string& string);
// Service functions
void getConfigInfoBlk2(u32 messagePointer);
void getConfigInfoBlk8(u32 messagePointer, u32 commandWord);
void getCountryCodeID(u32 messagePointer);
void getLocalFriendCodeSeed(u32 messagePointer);
void getRegionCanadaUSA(u32 messagePointer);
void getSystemModel(u32 messagePointer);
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 isFangateSupported(u32 messagePointer);
// cfg:nor functions
void norInitialize(u32 messagePointer);
void norReadData(u32 messagePointer);
void getConfigInfo(u32 output, u32 blockID, u32 size, u32 permissionMask);
public:
enum class Type {
U, // cfg:u
I, // cfg:i
S, // cfg:s
NOR, // cfg:nor
};
CFGService(Memory& mem) : mem(mem) {}
void reset();
void handleSyncRequest(u32 messagePointer, Type type);
};