Merge remote-tracking branch 'origin/master'

* origin/master: (98 commits)
  rosalina: fix for latest libctru changes
  pm: fix critical bugs where 1.0(?) titles not in the list have scheduling mode misconfigured
  loader: revert to use the NS patch due to a Nintendo bug: https://www.3dbrew.org/wiki/NCCH/Extended_Header#Flag1
  loader: replace NS N3DS CPU patch with exheader override, fix overriding exheader with homebrew
  rosalina: ntp: use PTMSYSM_SetRtcTime
  revert the memory map to the old one (mostly)
  fix module loading
  kext: fix outer memory cacheability on newer versions
  so bascially rosalina's image...
  rosalina: add hidden debug info menu
  rosalina: refactor menu handling
  rosalina: rephrase brightness warning
  rosalina: add brightness control menu
  rosalina/pm: remove fs patch, use pm instead
  rosalina: cleanup variable names
  rosalina: reorder menus
  Fix latest commit
  rosalina menu: add scrolling, cpad and inputredir support (note: no ZL/ZR due to technical reasons)
  stuff
  newlib...
  ...

# Conflicts:
#	k11_extension/source/main.c
#	k11_extension/source/svc/UnmapProcessMemoryEx.c
#	sysmodules/rosalina/Makefile
#	sysmodules/rosalina/include/menu.h
#	sysmodules/rosalina/include/utils.h
#	sysmodules/rosalina/source/errdisp.c
#	sysmodules/rosalina/source/main.c
#	sysmodules/rosalina/source/menu.c
#	sysmodules/rosalina/source/menus.c
This commit is contained in:
Lorenzo Dellacà
2020-07-04 02:43:27 +02:00
266 changed files with 3161 additions and 1525 deletions

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017 TuxSH
Copyright (c) 2017-2020 TuxSH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -28,7 +28,7 @@ INCLUDES := include
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -DARM11 -D_3DS
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -O2 -mword-relocations \
CFLAGS := -g -std=gnu11 -Wall -Wextra -Werror -Os -mword-relocations \
-fomit-frame-pointer -ffunction-sections -fdata-sections \
$(ARCH) $(DEFINES)
@@ -37,7 +37,7 @@ CFLAGS += $(INCLUDE)
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map),-wrap,exit
LIBS := -lctru

View File

@@ -1,5 +1,5 @@
# 3ds_sm
Open source replacement of the ARM11 SM system module.
Open source replacement of the Arm11 SM system module.
This is licensed under the MIT license.
# Usage

View File

@@ -1,7 +1,7 @@
/*
common.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/
@@ -10,8 +10,10 @@ This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for
#include <3ds.h>
#include <string.h>
#define IS_PRE_7X (osGetFirmVersion() < SYSTEM_VERSION(2, 39, 4))
#define IS_PRE_93 (osGetFirmVersion() < SYSTEM_VERSION(2, 48, 3))
#define KERNEL_VERSION_MINOR (GET_VERSION_MINOR(osGetKernelVersion()))
#define IS_PRE_7X (KERNEL_VERSION_MINOR < 39)
#define IS_PRE_93 (KERNEL_VERSION_MINOR < 48)
extern u32 nbSection0Modules;
extern Handle resumeGetServiceHandleOrPortRegisteredSemaphore;

View File

@@ -1,7 +1,7 @@
/*
list.c
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
list.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
main.c
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/
@@ -24,10 +24,27 @@ static ProcessData processDataPool[64];
static u8 ALIGN(4) serviceAccessListStaticBuffer[0x110];
void __appInit(void)
{
s64 out;
void __ctru_exit(int rc) { (void)rc; } // needed to avoid linking error
// this is called after main exits
void __wrap_exit(int rc)
{
(void)rc;
// Not supposed to terminate... kernel will clean up the handles if it does happen anyway
svcExitProcess();
}
void __sync_init();
// void __libc_init_array(void);
// Called before main
void initSystem(void)
{
__sync_init();
//__libc_init_array();
s64 out;
u32 *staticBuffers = getThreadStaticBuffers();
staticBuffers[0] = IPC_Desc_StaticBuffer(0x110, 0);
staticBuffers[1] = (u32)serviceAccessListStaticBuffer;
@@ -40,28 +57,6 @@ void __appInit(void)
buildList(&freeProcessDataList, processDataPool, sizeof(processDataPool) / sizeof(ProcessData), sizeof(ProcessData));
}
// this is called after main exits
void __appExit(void){}
void __system_allocateHeaps(void){}
void __system_initSyscalls(void){}
Result __sync_init(void);
Result __sync_fini(void);
void __ctru_exit(void){}
void initSystem(void)
{
void __libc_init_array(void);
__sync_init();
__system_allocateHeaps();
__appInit();
__libc_init_array();
}
int main(void)
{
Result res;

View File

@@ -1,7 +1,7 @@
/*
notifications.c
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/
@@ -109,7 +109,7 @@ Result ReceiveNotification(SessionData *sessionData, u32 *notificationId)
if(processData == NULL || !processData->notificationEnabled || processData->nbPendingNotifications == 0)
{
if(processData->nbPendingNotifications)
if(processData != NULL && processData->nbPendingNotifications)
*notificationId = 0;
return 0xD8806404;
}

View File

@@ -1,7 +1,7 @@
/*
notifications.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
processes.c
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
processes.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
services.c
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
services.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
srv.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
srv.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
srv_pm.c
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/

View File

@@ -1,7 +1,7 @@
/*
srv_pm.h
(c) TuxSH, 2017
(c) TuxSH, 2017-2020
This is part of 3ds_sm, which is licensed under the MIT license (see LICENSE for details).
*/