(3ds) remove stack_adjust.s

add a warning when using an unsupported hbl version.
This commit is contained in:
aliaspider 2015-11-06 11:00:32 +01:00
parent 981020997c
commit 646192fba9
4 changed files with 35 additions and 64 deletions

View File

@ -24,7 +24,6 @@ include ctr/Makefile.cores
OBJS :=
OBJS += gfx/drivers/ctr_sprite.o
OBJS += ctr/stack_adjust.o
OBJS += ctr/ctr_system.o
OBJS += ctr/ctr_memory.o
OBJS += ctr/ctr_linear.o

View File

@ -39,6 +39,7 @@ startup:
@ System initialization
mov r0, r4
and r4, sp, #7
bl initSystem
@ Set up argc/argv arguments for main()
@ -47,8 +48,10 @@ startup:
ldr r0, [r0]
ldr r1, [r1]
@ Jump to user code
@ Jump to user code
ldr r3, =main
cmp r4, #0
ldrne r3, =ctr_request_update
ldr lr, =__ctru_exit
bx r3

View File

@ -4,6 +4,7 @@
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include "ctr_debug.h"
#define CTR_APPMEMALLOC_PTR ((u32*)0x1FF80040)
@ -60,7 +61,7 @@ void __system_allocateHeaps() {
svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
// Set up newlib heap
extern char* fake_heap_end;
fake_heap_end = 0x13F00000;
fake_heap_end = (char*)0x13F00000;
}
@ -153,21 +154,38 @@ void __system_initArgv()
}
//void initSystem(void (*retAddr)(void))
//{
// __libctru_init(retAddr);
// __appInit();
// __libc_init_array();
void initSystem(void (*retAddr)(void))
{
__libctru_init(retAddr);
__appInit();
__libc_init_array();
//}
//void __attribute__((noreturn)) __ctru_exit(int rc)
//{
// __libc_fini_array();
// __appExit();
// __libctru_exit(rc);
}
void __attribute__((noreturn)) __ctru_exit(int rc)
{
__libc_fini_array();
__appExit();
__libctru_exit(rc);
}
//}
int ctr_request_update(void)
{
gfxInit(GSP_BGR8_OES,GSP_RGB565_OES,false);
gfxSet3D(false);
consoleInit(GFX_BOTTOM, NULL);
printf("\n\nunsupported version\n\n");
printf("Please update your playload\n");
wait_for_input();
gfxExit();
return 0;
}
typedef union{
struct

View File

@ -1,49 +0,0 @@
.arm
.align 2
.global initSystem
.type initSystem, %function
initSystem:
ldr r2, =saved_stack
str sp, [r2]
str lr, [r2,#4]
bics sp, sp, #7
bl __libctru_init
bl __appInit
bl __libc_init_array
ldr r2, =saved_stack
ldr lr, [r2,#4]
bx lr
.global __ctru_exit
.type __ctru_exit, %function
__ctru_exit:
bl __libc_fini_array
bl __appExit
ldr r2, =saved_stack
ldr sp, [r2]
b __libctru_exit
.data
.align 2
__stacksize__:
.word 0x100000
.weak __stacksize__
.bss
.align 2
saved_stack:
.space 8