mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
RTC revamp (#1867)
* get this started * implement DSi RTC commands * set up RTC clock timer. lay down basic idea of a clock. * make the date/time registers writable * move RTC state to its own structure, to make it easier to deal with * more RTC work lay base for date/time dialog * get the bulk of the RTC functionality going * much simpler design for RTC stuff * aha, that is what it is * start working on the RTC IRQ * implement all types of RTC IRQ * start refining sleep mode. code still kinda sucks. * implement keypad IRQ * refine it some more * shut the fuck uuuuuupppppppppppppp
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include "Platform.h"
|
||||
#include "Config.h"
|
||||
|
||||
@ -140,6 +141,8 @@ int MouseHideSeconds;
|
||||
|
||||
bool PauseLostFocus;
|
||||
|
||||
int64_t RTCOffset;
|
||||
|
||||
bool DSBatteryLevelOkay;
|
||||
int DSiBatteryLevel;
|
||||
bool DSiBatteryCharging;
|
||||
@ -339,6 +342,8 @@ ConfigEntry ConfigFile[] =
|
||||
{"MouseHideSeconds", 0, &MouseHideSeconds, 5, false},
|
||||
{"PauseLostFocus", 1, &PauseLostFocus, false, false},
|
||||
|
||||
{"RTCOffset", 3, &RTCOffset, (int64_t)0, true},
|
||||
|
||||
{"DSBatteryLevelOkay", 1, &DSBatteryLevelOkay, true, true},
|
||||
{"DSiBatteryLevel", 0, &DSiBatteryLevel, 0xF, true},
|
||||
{"DSiBatteryCharging", 1, &DSiBatteryCharging, true, true},
|
||||
@ -406,6 +411,7 @@ void LoadFile(int inst)
|
||||
case 0: *(int*)entry->Value = strtol(entryval, NULL, 10); break;
|
||||
case 1: *(bool*)entry->Value = strtol(entryval, NULL, 10) ? true:false; break;
|
||||
case 2: *(std::string*)entry->Value = entryval; break;
|
||||
case 3: *(int64_t*)entry->Value = strtoll(entryval, NULL, 10); break;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -426,6 +432,7 @@ void Load()
|
||||
case 0: *(int*)entry->Value = std::get<int>(entry->Default); break;
|
||||
case 1: *(bool*)entry->Value = std::get<bool>(entry->Default); break;
|
||||
case 2: *(std::string*)entry->Value = std::get<std::string>(entry->Default); break;
|
||||
case 3: *(int64_t*)entry->Value = std::get<int64_t>(entry->Default); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,6 +469,7 @@ void Save()
|
||||
case 0: Platform::FileWriteFormatted(f, "%s=%d\r\n", entry->Name, *(int*)entry->Value); break;
|
||||
case 1: Platform::FileWriteFormatted(f, "%s=%d\r\n", entry->Name, *(bool*)entry->Value ? 1:0); break;
|
||||
case 2: Platform::FileWriteFormatted(f, "%s=%s\r\n", entry->Name, (*(std::string*)entry->Value).c_str()); break;
|
||||
case 3: Platform::FileWriteFormatted(f, "%s=%" PRId64 "\r\n", entry->Name, *(int64_t*)entry->Value); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user