forked from pixel-stuck/arm9loaderhax
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c3ccec
commit 0130647
Showing
24 changed files
with
2,313 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ENTRY(_start) | ||
SECTIONS | ||
{ | ||
. = 0x1FFF4C80; | ||
.text.start : { *(.text.start) } | ||
.text : { *(.text) } | ||
.data : { *(.data) } | ||
.bss : { *(.bss COMMON) } | ||
.rodata : { *(.rodata) } | ||
. = ALIGN(4); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#include "types.h" | ||
|
||
#define BRIGHTNESS 0x39 | ||
|
||
void main(void) | ||
{ | ||
vu32 *arm11 = (u32 *)0x1FFFFFF8; | ||
|
||
*(vu32 *)0x10141200 = 0x1007F; | ||
*(vu32 *)0x10202014 = 0x00000001; | ||
*(vu32 *)0x1020200C &= 0xFFFEFFFE; | ||
|
||
*(vu32 *)0x10202240 = BRIGHTNESS; | ||
*(vu32 *)0x10202A40 = BRIGHTNESS; | ||
*(vu32 *)0x10202244 = 0x1023E; | ||
*(vu32 *)0x10202A44 = 0x1023E; | ||
|
||
// Top screen | ||
*(vu32 *)0x10400400 = 0x000001c2; | ||
*(vu32 *)0x10400404 = 0x000000d1; | ||
*(vu32 *)0x10400408 = 0x000001c1; | ||
*(vu32 *)0x1040040c = 0x000001c1; | ||
*(vu32 *)0x10400410 = 0x00000000; | ||
*(vu32 *)0x10400414 = 0x000000cf; | ||
*(vu32 *)0x10400418 = 0x000000d1; | ||
*(vu32 *)0x1040041c = 0x01c501c1; | ||
*(vu32 *)0x10400420 = 0x00010000; | ||
*(vu32 *)0x10400424 = 0x0000019d; | ||
*(vu32 *)0x10400428 = 0x00000002; | ||
*(vu32 *)0x1040042c = 0x00000192; | ||
*(vu32 *)0x10400430 = 0x00000192; | ||
*(vu32 *)0x10400434 = 0x00000192; | ||
*(vu32 *)0x10400438 = 0x00000001; | ||
*(vu32 *)0x1040043c = 0x00000002; | ||
*(vu32 *)0x10400440 = 0x01960192; | ||
*(vu32 *)0x10400444 = 0x00000000; | ||
*(vu32 *)0x10400448 = 0x00000000; | ||
*(vu32 *)0x1040045C = 0x00f00190; | ||
*(vu32 *)0x10400460 = 0x01c100d1; | ||
*(vu32 *)0x10400464 = 0x01920002; | ||
*(vu32 *)0x10400468 = 0x18300000; | ||
*(vu32 *)0x10400470 = 0x80341; | ||
*(vu32 *)0x10400474 = 0x00010501; | ||
*(vu32 *)0x10400478 = 0; | ||
*(vu32 *)0x10400490 = 0x000002D0; | ||
*(vu32 *)0x1040049C = 0x00000000; | ||
|
||
// Disco register | ||
for(u32 i = 0; i < 256; i++) | ||
*(vu32 *)0x10400484 = 0x10101 * i; | ||
|
||
// Bottom screen | ||
*(vu32 *)0x10400500 = 0x000001c2; | ||
*(vu32 *)0x10400504 = 0x000000d1; | ||
*(vu32 *)0x10400508 = 0x000001c1; | ||
*(vu32 *)0x1040050c = 0x000001c1; | ||
*(vu32 *)0x10400510 = 0x000000cd; | ||
*(vu32 *)0x10400514 = 0x000000cf; | ||
*(vu32 *)0x10400518 = 0x000000d1; | ||
*(vu32 *)0x1040051c = 0x01c501c1; | ||
*(vu32 *)0x10400520 = 0x00010000; | ||
*(vu32 *)0x10400524 = 0x0000019d; | ||
*(vu32 *)0x10400528 = 0x00000052; | ||
*(vu32 *)0x1040052c = 0x00000192; | ||
*(vu32 *)0x10400530 = 0x00000192; | ||
*(vu32 *)0x10400534 = 0x0000004f; | ||
*(vu32 *)0x10400538 = 0x00000050; | ||
*(vu32 *)0x1040053c = 0x00000052; | ||
*(vu32 *)0x10400540 = 0x01980194; | ||
*(vu32 *)0x10400544 = 0x00000000; | ||
*(vu32 *)0x10400548 = 0x00000011; | ||
*(vu32 *)0x1040055C = 0x00f00140; | ||
*(vu32 *)0x10400560 = 0x01c100d1; | ||
*(vu32 *)0x10400564 = 0x01920052; | ||
*(vu32 *)0x10400568 = 0x18300000 + 0x46500; | ||
*(vu32 *)0x10400570 = 0x80301; | ||
*(vu32 *)0x10400574 = 0x00010501; | ||
*(vu32 *)0x10400578 = 0; | ||
*(vu32 *)0x10400590 = 0x000002D0; | ||
*(vu32 *)0x1040059C = 0x00000000; | ||
|
||
// Disco register | ||
for(u32 i = 0; i < 256; i++) | ||
*(vu32 *)0x10400584 = 0x10101 * i; | ||
|
||
*(vu32 *)0x10400468 = 0x18300000; | ||
*(vu32 *)0x1040046c = 0x18300000; | ||
*(vu32 *)0x10400494 = 0x18300000; | ||
*(vu32 *)0x10400498 = 0x18300000; | ||
*(vu32 *)0x10400568 = 0x18346500; | ||
*(vu32 *)0x1040056c = 0x18346500; | ||
|
||
//Set CakeBrah framebuffers | ||
*((vu32 *)0x23FFFE00) = 0x18300000; | ||
*((vu32 *)0x23FFFE04) = 0x18300000; | ||
*((vu32 *)0x23FFFE08) = 0x18346500; | ||
|
||
//Clear ARM11 entry offset | ||
*arm11 = 0; | ||
|
||
//Wait for the entry to be set | ||
while(!*arm11); | ||
|
||
//Jump to it | ||
((void (*)())*arm11)(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.section .text.start | ||
.align 4 | ||
.global _start | ||
_start: | ||
@ Disable interrupts | ||
CPSID aif | ||
|
||
b main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* types.h | ||
* by Reisyukaku | ||
* Copyright (c) 2015 All Rights Reserved | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
//Common data types | ||
typedef uint32_t u32; | ||
typedef volatile u32 vu32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ENTRY(_start) | ||
SECTIONS | ||
{ | ||
. = 0x08006000; | ||
.text.start : { *(.text.start) } | ||
.text : { *(.text) } | ||
.data : { *(.data) } | ||
.bss : { *(.bss COMMON) } | ||
.rodata : { *(.rodata) } | ||
. = ALIGN(4); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* buttons.h | ||
* by Aurora Wright | ||
* Copyright (c) 2016 All Rights Reserved | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "types.h" | ||
|
||
#define HID_PAD (*(vu32 *)0x10146000 ^ 0xFFF) | ||
#define BUTTON_R1 (1 << 8) | ||
#define BUTTON_L1 (1 << 9) | ||
#define BUTTON_A 1 | ||
#define BUTTON_B (1 << 1) | ||
#define BUTTON_X (1 << 10) | ||
#define BUTTON_Y (1 << 11) | ||
#define BUTTON_SELECT (1 << 2) | ||
#define BUTTON_START (1 << 3) | ||
#define BUTTON_RIGHT (1 << 4) | ||
#define BUTTON_LEFT (1 << 5) | ||
#define BUTTON_UP (1 << 6) | ||
#define BUTTON_DOWN (1 << 7) | ||
#define BUTTON_L1R1 (BUTTON_R1 | BUTTON_L1) | ||
#define SAFE_MODE (BUTTON_L1R1 | BUTTON_A | BUTTON_UP) | ||
#define OVERRIDE_BUTTONS (BUTTON_B ^ 0xFFF) | ||
#define SINGLE_PAYLOAD_BUTTONS (BUTTON_LEFT | BUTTON_RIGHT | BUTTON_UP | BUTTON_DOWN | BUTTON_START | BUTTON_X | BUTTON_Y) | ||
#define L_PAYLOAD_BUTTONS (BUTTON_R1 | BUTTON_SELECT) | ||
#define MENU_BUTTONS (BUTTON_LEFT | BUTTON_RIGHT | BUTTON_UP | BUTTON_DOWN | BUTTON_A | BUTTON_START) |
Oops, something went wrong.