Rename Handle to HorizonHandle, add metal-cpp submodule, format

This commit is contained in:
wheremyfoodat 2024-07-23 15:22:15 +03:00
parent 855a374f67
commit 0f80d0af7a
46 changed files with 150 additions and 60 deletions

View file

@ -102,6 +102,8 @@ namespace KernelMemoryTypes {
}
class Memory {
using Handle = HorizonHandle;
u8* fcram;
u8* dspRam; // Provided to us by Audio
u8* vram; // Provided to the memory class by the GPU class
@ -213,8 +215,14 @@ private:
}
enum class BatteryLevel {
Empty = 0, AlmostEmpty, OneBar, TwoBars, ThreeBars, FourBars
Empty = 0,
AlmostEmpty,
OneBar,
TwoBars,
ThreeBars,
FourBars,
};
u8 getBatteryState(bool adapterConnected, bool charging, BatteryLevel batteryLevel) {
u8 value = static_cast<u8>(batteryLevel) << 2; // Bits 2:4 are the battery level from 0 to 5
if (adapterConnected) value |= 1 << 0; // Bit 0 shows if the charger is connected