mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-08-04 23:28:55 +00:00
Add IPC buffer header
This commit is contained in:
parent
80ebb353a5
commit
7475a15473
1 changed files with 11 additions and 0 deletions
|
@ -2,8 +2,19 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace IPC {
|
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) {
|
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
|
// TODO: Maybe validate the response count stuff fits in 6 bits
|
||||||
return (commandID << 16) | (normalResponses << 6) | translateResponses;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue