mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-26 10:49:21 +00:00
BII/SS pref item "yearofs"
This commit is contained in:
parent
e3c8cd9ffb
commit
e676dbf839
@ -26,6 +26,8 @@
|
||||
#include "disk.h"
|
||||
#include "cdrom.h"
|
||||
#include "macos_util.h"
|
||||
#include "prefs.h"
|
||||
#include <algorithm>
|
||||
|
||||
#define DEBUG 0
|
||||
#include "debug.h"
|
||||
@ -134,6 +136,7 @@ uint32 TimeToMacTime(time_t t)
|
||||
struct tm *local = localtime(&t);
|
||||
const int TM_EPOCH_YEAR = 1900;
|
||||
const int MAC_EPOCH_YEAR = 1904;
|
||||
local->tm_year = std::max(MAC_EPOCH_YEAR - TM_EPOCH_YEAR, local->tm_year - PrefsFindInt32("yearofs"));
|
||||
int a4 = ((local->tm_year + TM_EPOCH_YEAR) >> 2) - !(local->tm_year & 3);
|
||||
int b4 = (MAC_EPOCH_YEAR >> 2) - !(MAC_EPOCH_YEAR & 3);
|
||||
int a100 = a4 / 25 - (a4 % 25 < 0);
|
||||
|
@ -75,6 +75,7 @@ prefs_desc common_prefs_items[] = {
|
||||
{"hotkey",TYPE_INT32,false,"hotkey modifier"},
|
||||
{"scale_nearest",TYPE_BOOLEAN,false,"nearest neighbor scaling"},
|
||||
{"scale_integer",TYPE_BOOLEAN,false,"integer scaling"},
|
||||
{"yearofs", TYPE_INT32, 0, "year offset"},
|
||||
{NULL, TYPE_END, false, NULL} // End of list
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include "emul_op.h"
|
||||
#include "macos_util.h"
|
||||
#include "thunks.h"
|
||||
#include "prefs.h"
|
||||
#include <algorithm>
|
||||
|
||||
#define DEBUG 0
|
||||
#include "debug.h"
|
||||
@ -333,6 +335,7 @@ uint32 TimeToMacTime(time_t t)
|
||||
#endif
|
||||
const int TM_EPOCH_YEAR = 1900;
|
||||
const int MAC_EPOCH_YEAR = 1904;
|
||||
local->tm_year = std::max(MAC_EPOCH_YEAR - TM_EPOCH_YEAR, local->tm_year - PrefsFindInt32("yearofs"));
|
||||
int a4 = ((local->tm_year + TM_EPOCH_YEAR) >> 2) - !(local->tm_year & 3);
|
||||
int b4 = (MAC_EPOCH_YEAR >> 2) - !(MAC_EPOCH_YEAR & 3);
|
||||
int a100 = a4 / 25 - (a4 % 25 < 0);
|
||||
|
@ -63,6 +63,7 @@ prefs_desc common_prefs_items[] = {
|
||||
{"scale_nearest",TYPE_BOOLEAN,false,"nearest neighbor scaling"},
|
||||
{"scale_integer",TYPE_BOOLEAN,false,"integer scaling"},
|
||||
{"cpuclock", TYPE_INT32, 0, "CPU clock [MHz] of system info"},
|
||||
{"yearofs", TYPE_INT32, 0, "year offset"},
|
||||
{NULL, TYPE_END, false, NULL} // End of list
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user