Forgot this
This commit is contained in:
parent
5196869634
commit
6845e42f2c
1
haxloader/CakeBrah
Submodule
1
haxloader/CakeBrah
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 9f7cea77d4db4d743e45b2e5193df76ffed0a571
|
@ -1,25 +0,0 @@
|
||||
LD := arm-none-eabi-ld
|
||||
AS := arm-none-eabi-as
|
||||
OC := arm-none-eabi-objcopy
|
||||
XXD := xxd
|
||||
|
||||
all: loader.h
|
||||
|
||||
loader.o: loader.s
|
||||
$(AS) -o $@ $<
|
||||
|
||||
loader.elf: loader.o
|
||||
$(LD) -T stub.ld -o $@ $<
|
||||
|
||||
loader.bin: loader.elf
|
||||
$(OC) -O binary $< $@
|
||||
|
||||
loader.h: loader.bin
|
||||
$(XXD) -i $< > $@
|
||||
@rm -f *.elf *.o
|
||||
@echo built loader
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@rm -f *.h *.bin *.elf *.o
|
||||
@echo cleaned loader
|
@ -1,41 +0,0 @@
|
||||
.section .text
|
||||
|
||||
start_:
|
||||
|
||||
@ Initial setup
|
||||
ldr r1, =0x24F7FFFC @ void *r1 = (void*) 0x24F7FFFC;
|
||||
ldr r2, =0x23EFFFFC @ void *r2 = (void*) 0x23EFFFFC;
|
||||
ldr r3, =0x24EFFFFC @ void *r3 = (void*) 0x24EFFFFC;
|
||||
|
||||
copy_loop:
|
||||
ldr r0, [r3, #4]! @ u32 r0 = *((u32*)(r3 + 4)); r3 += 4;
|
||||
str r0, [r2, #4]! @ *((u32*)(r2 + 4)) = r0; r2 += 4;
|
||||
|
||||
cmp r3, r1 @ if r3 != 0x24F7FFFC
|
||||
bne copy_loop @ goto copy_loop;
|
||||
|
||||
|
||||
@ Cache flush routine by gemarcano (aka Gelex)
|
||||
|
||||
mov r1, #0
|
||||
|
||||
outer_loop:
|
||||
mov r0, #0
|
||||
|
||||
inner_loop:
|
||||
orr r2, r1, r0
|
||||
mcr p15, 0, r2, c7, c14, 2
|
||||
add r0, r0, #0x20
|
||||
cmp r0, #0x400
|
||||
bne inner_loop
|
||||
|
||||
add r1, r1, #0x40000000
|
||||
cmp r1, #0x0
|
||||
bne outer_loop
|
||||
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c5, 0
|
||||
mcr p15, 0, r0, c7, c10, 4
|
||||
|
||||
ldr r3, =0x23F00000
|
||||
bx r3
|
@ -1,5 +0,0 @@
|
||||
SECTIONS
|
||||
{
|
||||
.text : { *(.text.*) }
|
||||
. = ALIGN(4);
|
||||
}
|
Reference in New Issue
Block a user