Skip to content

Commit a183a4c

Browse files
committed
app: Consistent function naming schemes
1 parent d59a98a commit a183a4c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

app/include/utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "vlf.h"
44

5-
int GetRegistryValue(const char *dir, const char *name, void *buf, int bufsize, int inttype);
6-
int Random(int min, int max);
5+
int pspGetRegistryValue(const char *dir, const char *name, void *buf, int bufsize, int inttype);
6+
int random(int min, int max);
77
int utf82unicode(wchar_t *dest, char *src);
88
VlfText pspEverestPrintf(int x, int y, const char *text, ...);

app/source/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ void SystemInfo(void) {
310310
vlfGuiSetPictureXY(pic_button_assign, 131, 68);
311311

312312
char unicode_username[26];
313-
utf82unicode((wchar_t *)unicode_username, (char *)GetRegistryValue("/CONFIG/SYSTEM", "owner_name", &username, sizeof(username), 0));
313+
utf82unicode((wchar_t *)unicode_username, (char *)pspGetRegistryValue("/CONFIG/SYSTEM", "owner_name", &username, sizeof(username), 0));
314314

315315
text_system[2] = pspEverestPrintf(237, 45, trans->system.username);
316316
text_system[3] = vlfGuiAddTextW(language == PSP_SYSTEMPARAM_LANGUAGE_RUSSIAN ? 337 : 327, 45, (u16 *)unicode_username);
317-
text_system[4] = pspEverestPrintf(237, 65, trans->system.password, GetRegistryValue("/CONFIG/SYSTEM/LOCK", "password", &password, sizeof(password), 0));
317+
text_system[4] = pspEverestPrintf(237, 65, trans->system.password, pspGetRegistryValue("/CONFIG/SYSTEM/LOCK", "password", &password, sizeof(password), 0));
318318
text_system[5] = pspEverestPrintf(10, 120, "version.txt:");
319319

320320
if (vertxt != NULL)
@@ -413,7 +413,7 @@ int app_main(int argc, char *argv[]) {
413413
pspGetInitialFW(initial_fw);
414414
pspChkregGetPsCode(&pscode);
415415
sceOpenPSIDGetOpenPSID(&psid);
416-
GetRegistryValue("/CONFIG/SYSTEM/XMB", "button_assign", &button_assign, 4, 1);
416+
pspGetRegistryValue("/CONFIG/SYSTEM/XMB", "button_assign", &button_assign, 4, 1);
417417
vertxt = pspGetVersionTxt();
418418

419419
vlfGuiSystemSetup(1, 1, 1);
@@ -436,7 +436,7 @@ int app_main(int argc, char *argv[]) {
436436
vlfGuiAddEventHandler(PSP_CTRL_LTRIGGER, -1, OnBackgroundMinus, NULL);
437437

438438
max_background_number = backgrounds_bmp_size / 6176 - 1;
439-
background_number = Random(0, max_background_number);
439+
background_number = random(0, max_background_number);
440440

441441
SetBackground();
442442
MainMenu(0);

app/source/utils.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "main.h"
1010
#include "vlf.h"
1111

12-
int GetRegistryValue(const char *dir, const char *name, void *buf, int bufsize, int inttype) {
12+
int pspGetRegistryValue(const char *dir, const char *name, void *buf, int bufsize, int inttype) {
1313
int ret = 0;
1414
struct RegParam reg;
1515
REGHANDLE h;
@@ -44,11 +44,11 @@ int GetRegistryValue(const char *dir, const char *name, void *buf, int bufsize,
4444
return ret;
4545
}
4646

47-
int Random(int min, int max) {
48-
u64 tick;
49-
SceKernelUtilsMt19937Context ctx;
47+
int random(int min, int max) {
48+
u64 tick = 0;
49+
SceKernelUtilsMt19937Context ctx = { 0 };
5050
sceRtcGetCurrentTick(&tick);
51-
sceKernelUtilsMt19937Init(&ctx, (u32)tick);
51+
sceKernelUtilsMt19937Init(&ctx, tick);
5252
return min + (sceKernelUtilsMt19937UInt(&ctx) % max);
5353
}
5454

0 commit comments

Comments
 (0)