Skip to content

Commit 211c00e

Browse files
committed
Add missing overclock.cpp/h
1 parent 3035905 commit 211c00e

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

src/overclock.cpp

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/** @file overclock.cpp
2+
*
3+
* A minimalist, cross-platform puzzle-platformer, designed
4+
* especially for the Nokia N-Gage.
5+
*
6+
* Copyright (c) 2025, Michael Fitzmayer. All rights reserved.
7+
* SPDX-License-Identifier: MIT
8+
*
9+
**/
10+
11+
#ifdef __SYMBIAN32__
12+
#include <e32std.h>
13+
#include <e32svr.h>
14+
#endif
15+
16+
#ifdef __cplusplus
17+
extern "C"
18+
{
19+
#endif // __cplusplus
20+
21+
#ifdef __SYMBIAN32__
22+
_LIT(KNinjaDll, "E:\\System\\Apps\\kagekero\\ninja.dll");
23+
_LIT(KTurtleDll, "E:\\System\\Apps\\kagekero\\turtle.dll");
24+
25+
static TBool is_overclock_enabled = EFalse;
26+
27+
void disable_overclock(void)
28+
{
29+
RLibrary lib;
30+
31+
if (!is_overclock_enabled)
32+
{
33+
return;
34+
}
35+
36+
if (lib.Load(KTurtleDll) == KErrNone)
37+
{
38+
UserSvr::ChangeLocale(lib);
39+
lib.Close();
40+
is_overclock_enabled = EFalse;
41+
}
42+
}
43+
44+
void enable_overclock(void)
45+
{
46+
RLibrary lib;
47+
48+
if (is_overclock_enabled)
49+
{
50+
return;
51+
}
52+
53+
if (lib.Load(KNinjaDll) == KErrNone)
54+
{
55+
UserSvr::ChangeLocale(lib);
56+
lib.Close();
57+
is_overclock_enabled = ETrue;
58+
}
59+
}
60+
#else
61+
void disable_overclock(void)
62+
{
63+
return;
64+
}
65+
66+
void enable_overclock(void)
67+
{
68+
return;
69+
}
70+
#endif
71+
72+
#ifdef __cplusplus
73+
}
74+
#endif // __cplusplus

src/overclock.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** @file overclock.h
2+
*
3+
* A minimalist, cross-platform puzzle-platformer, designed
4+
* especially for the Nokia N-Gage.
5+
*
6+
* Copyright (c) 2025, Michael Fitzmayer. All rights reserved.
7+
* SPDX-License-Identifier: MIT
8+
*
9+
**/
10+
11+
#ifndef OVERCLOCK_H
12+
#define OVERCLOCK_H
13+
14+
void disable_overclock(void);
15+
void enable_overclock(void);
16+
17+
#endif // OVERCLOCK_H

0 commit comments

Comments
 (0)