fix compile errors

This commit is contained in:
Bea 2020-07-04 03:13:13 +02:00
parent a39053c3c3
commit cc9977774e
7 changed files with 30 additions and 40 deletions

View File

@ -133,25 +133,25 @@ static void installMmuHooks(void)
u32 *off;
for(off = (u32 *)officialSVCs[0x1F]; *off != 0xE1CD60F0; ++off);
off = decodeARMBranch(off + 1);
off = decodeArmBranch(off + 1);
for (; *off != 0xE58D5000; ++off);
off = decodeARMBranch(off + 1);
off = decodeArmBranch(off + 1);
for (; *off != 0xE58DC000; ++off);
off = decodeARMBranch(off + 1);
off = decodeArmBranch(off + 1);
for (; *off != 0xE1A0000B; ++off);
off = decodeARMBranch(off + 1);
off = decodeArmBranch(off + 1);
for (; *off != 0xE59D2030; ++off);
off = decodeARMBranch(off + 1);
off = decodeArmBranch(off + 1);
for (; *off != 0xE88D1100; ++off);
mapL2Section = (u32 *)PA_FROM_VA_PTR(decodeARMBranch(off + 1));
mapL2Section = (u32 *)PA_FROM_VA_PTR(decodeArmBranch(off + 1));
do
{
for (; *off != 0xE58D8000; ++off);
u32 *loc = (u32 *)PA_FROM_VA_PTR(decodeARMBranch(++off));
u32 *loc = (u32 *)PA_FROM_VA_PTR(decodeArmBranch(++off));
if (loc != mapL2Section)
mapL1Section = loc;
} while (mapL1Section == NULL);
@ -172,10 +172,10 @@ static void findUsefulSymbols(void)
// Patch ERRF__DumpException
for(off = (u32 *)0xFFFF0000; *off != 0xE1A04005; ++off);
++off;
*(u32 *)PA_FROM_VA_PTR(off) = makeARMBranch(off, off + 51, false);
*(u32 *)PA_FROM_VA_PTR(off) = makeArmBranch(off, off + 51, false);
for(; *off != 0xE2100102; ++off);
KProcessHwInfo__QueryMemory = (Result (*)(KProcessHwInfo *, MemoryInfo *, PageInfo *, void *))decodeARMBranch(off - 1);
KProcessHwInfo__QueryMemory = (Result (*)(KProcessHwInfo *, MemoryInfo *, PageInfo *, void *))decodeArmBranch(off - 1);
for(; *off != 0xE1A0D002; off++);
off += 3;
@ -241,16 +241,16 @@ static void findUsefulSymbols(void)
KProcessHwInfo__UnmapProcessMemory = (Result (*)(KProcessHwInfo *, void *, u32))decodeArmBranch(off - 1);
for (off = (u32 *)officialSVCs[0x70]; *off != 0xE8881200 && *off != 0xE8891900; ++off);
for (off = (u32 *)decodeARMBranch(off + 1); *off != 0xE2101102; ++off);
KProcessHwInfo__CheckVaState = (Result (*)(KProcessHwInfo *, u32, u32, u32, u32))decodeARMBranch(off - 1);
for (off = (u32 *)decodeArmBranch(off + 1); *off != 0xE2101102; ++off);
KProcessHwInfo__CheckVaState = (Result (*)(KProcessHwInfo *, u32, u32, u32, u32))decodeArmBranch(off - 1);
for (; *off != 0xE28D1008; ++off);
KProcessHwInfo__GetListOfKBlockInfoForVA = (Result (*)(KProcessHwInfo*, KLinkedList*, u32, u32))decodeARMBranch(off + 1);
KProcessHwInfo__GetListOfKBlockInfoForVA = (Result (*)(KProcessHwInfo*, KLinkedList*, u32, u32))decodeArmBranch(off + 1);
for (; *off != 0xE2000102; ++off);
KProcessHwInfo__MapListOfKBlockInfo = (Result (*)(KProcessHwInfo*, u32, KLinkedList*, u32, u32, u32))decodeARMBranch(off - 1);
KProcessHwInfo__MapListOfKBlockInfo = (Result (*)(KProcessHwInfo*, u32, KLinkedList*, u32, u32, u32))decodeArmBranch(off - 1);
for (; *off != 0xE8BD8FF0; ++off);
KLinkedList_KBlockInfo__Clear = (void (*)(KLinkedList *))decodeARMBranch(off - 6);
KLinkedList_KBlockInfo__Clear = (void (*)(KLinkedList *))decodeArmBranch(off - 6);
for(off = (u32 *)officialSVCs[0x7C]; *off != 0x03530000; off++);
KObjectMutex__WaitAndAcquire = (void (*)(KObjectMutex *))decodeArmBranch(++off);
@ -297,7 +297,7 @@ static void findUsefulSymbols(void)
ControlMemory = (Result (*)(u32 *, u32, u32, u32, MemOp, MemPerm, bool))
decodeArmBranch((u32 *)officialSVCs[0x01] + 5);
SleepThread = (void (*)(s64))officialSVCs[0x0A];
CreateEvent = (Result (*)(Handle *, ResetType))decodeARMBranch((u32 *)officialSVCs[0x17] + 3);
CreateEvent = (Result (*)(Handle *, ResetType))decodeArmBranch((u32 *)officialSVCs[0x17] + 3);
CloseHandle = (Result (*)(Handle))officialSVCs[0x23];
GetHandleInfo = (Result (*)(s64 *, Handle, u32))decodeArmBranch((u32 *)officialSVCs[0x29] + 3);
GetSystemInfo = (Result (*)(s64 *, s32, s32))decodeArmBranch((u32 *)officialSVCs[0x2A] + 3);

View File

@ -74,9 +74,6 @@ extern u32 menuCombo;
u32 waitInputWithTimeout(u32 msec);
u32 waitInput(void);
u32 waitComboWithTimeout(u32 msec);
u32 waitCombo(void);
bool menuCheckN3ds(void);
u32 menuCountItems(const Menu *menu);

View File

@ -247,7 +247,7 @@ void Draw_CreateBitmapHeader(u8 *dst, u32 width, u32 heigth)
Draw_WriteUnaligned(dst + 0x22, 3 * width * heigth, 4);
}
static inline void Draw_ConvertPixelToBGR8(u8 *dst, const u8 *src, GSPGPU_FramebufferFormat srcFormat)
static inline void Draw_ConvertPixelToBGR8(u8 *dst, const u8 *src, GSPGPU_FramebufferFormats srcFormat)
{
u8 red, green, blue;
switch(srcFormat)
@ -323,7 +323,7 @@ static void Draw_ConvertFrameBufferLinesKernel(const FrameBufferConvertArgs *arg
{
static const u8 formatSizes[] = { 4, 3, 2, 2, 2 };
GSPGPU_FramebufferFormat fmt = args->top ? (GSPGPU_FramebufferFormat)(GPU_FB_TOP_FMT & 7) : (GSPGPU_FramebufferFormat)(GPU_FB_BOTTOM_FMT & 7);
GSPGPU_FramebufferFormats fmt = args->top ? (GSPGPU_FramebufferFormats)(GPU_FB_TOP_FMT & 7) : (GSPGPU_FramebufferFormats)(GPU_FB_BOTTOM_FMT & 7);
u32 width = args->top ? 400 : 320;
u32 stride = args->top ? GPU_FB_TOP_STRIDE : GPU_FB_BOTTOM_STRIDE;

View File

@ -126,7 +126,7 @@ void inputRedirectionThreadMain(void)
if (Sleep__Status())
{
while (!Wifi__IsConnected()
&& inputRedirectionEnabled && !terminationRequest)
&& inputRedirectionEnabled && !preTerminationRequested)
svcSleepThread(1000000000ULL);
}

View File

@ -53,7 +53,7 @@ static inline u32 convertHidKeys(u32 keys)
return keys;
}
u32 waitInputWithTimeout(s32 msec)
u32 waitInputWithTimeout(u32 msec)
{
s32 n = 0;
u32 keys;
@ -204,14 +204,7 @@ void menuThreadMain(void)
menuShow(&rosalinaMenu);
menuLeave();
}
}
else
{
menuEnter();
if(isN3DS) N3DSMenu_UpdateStatus();
menuShow(&rosalinaMenu);
menuLeave();
}
// Check for home button on O3DS Mode3 with plugin loaded
if (homeBtnPressed != 0)
@ -450,7 +443,7 @@ void DispMessage(const char *title, const char *message)
do
{
keys = waitComboWithTimeout(1000);
}while (!terminationRequest && !(keys & BUTTON_B));
}while (!preTerminationRequested && !(keys & KEY_B));
Draw_Unlock(); ///< Keep it locked until we exit the message
menuLeave();
@ -478,7 +471,7 @@ u32 DispErrMessage(const char *title, const char *message, const Result error
do
{
keys = waitComboWithTimeout(1000);
}while (!terminationRequest && !(keys & BUTTON_B));
}while (!preTerminationRequested && !(keys & KEY_B));
Draw_Unlock(); ///< Keep it locked until we exit the message
menuLeave();
@ -505,12 +498,12 @@ u32 DispWarningOnHome(void)
do
{
keys = waitComboWithTimeout(1000);
}while (!terminationRequest && !(keys & BUTTON_B));
}while (!preTerminationRequested && !(keys & KEY_B));
Draw_Unlock(); ///< Keep it locked until we exit the message
menuLeave();
return (keys & BUTTON_UP) > 0;
return (keys & KEY_UP) > 0;
}
@ -564,17 +557,17 @@ void DisplayPluginMenu(u32 *cmdbuf)
// Wait for input
u32 pressed = waitInput();
if (pressed & BUTTON_A)
if (pressed & KEY_A)
states[cursor] = !states[cursor];
if (pressed & BUTTON_B)
if (pressed & KEY_B)
break;
if (pressed & BUTTON_DOWN)
if (pressed & KEY_DOWN)
if (++cursor >= nbItems)
cursor = 0;
if (pressed & BUTTON_UP)
if (pressed & KEY_UP)
if (--cursor >= nbItems)
cursor = nbItems - 1;

View File

@ -590,7 +590,7 @@ void PluginLoader__ThreadMain(void)
SetKernelConfigurationMemoryFlag(g_process != 0);
} while(!terminationRequest);
} while(!preTerminationRequested);
svcCloseHandle(sessionHandle);
svcCloseHandle(clientHandle);

View File

@ -191,7 +191,7 @@ void server_run(struct sock_server *serv)
if (Sleep__Status())
{
while (!Wifi__IsConnected()
&& serv->running && !terminationRequest)
&& serv->running && !preTerminationRequested)
svcSleepThread(1000000000ULL);
}