-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from dark-samus/master
Screen init in stage 2
- Loading branch information
Showing
10 changed files
with
377 additions
and
29 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
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
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
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
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 @@ | ||
#include "i2c.h" | ||
|
||
void screenInit() | ||
{ | ||
|
||
i2cWriteRegister(3, 0x22, 0x2A); // 0x2A -> boot into firm with no backlight | ||
|
||
} |
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 @@ | ||
void screenInit(); |
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,59 @@ | ||
export PATH := $(DEVKITARM)/bin:$(PATH) | ||
|
||
CC=arm-none-eabi-gcc | ||
CP=arm-none-eabi-g++ | ||
OC=arm-none-eabi-objcopy | ||
LD=arm-none-eabi-ld | ||
MV=mv -f | ||
RM=rm -rf | ||
|
||
LIBNAME=screen_init | ||
ELFNAME=$(LIBNAME).elf | ||
BINNAME=$(LIBNAME).bin | ||
DATNAME=$(LIBNAME).dat | ||
|
||
SRC_DIR:=source/$(LIBNAME) | ||
OBJ_DIR:=obj/$(LIBNAME) | ||
LIB_DIR:=lib | ||
DEP_DIR:=obj/$(LIBNAME) | ||
|
||
LIBS= | ||
CFLAGS=-std=gnu99 -Os -g -mword-relocations -fomit-frame-pointer -ffast-math | ||
C9FLAGS=-mcpu=arm946e-s -march=armv5te -mlittle-endian | ||
C11FLAGS=-mcpu=mpcore -mlittle-endian | ||
LDFLAGS=$(LIBS) | ||
OCFLAGS=--set-section-flags .bss=alloc,load,contents | ||
|
||
OBJS:=$(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(wildcard $(SRC_DIR)/*.c)) | ||
OBJS+=$(patsubst $(SRC_DIR)/%.s, $(OBJ_DIR)/%.o, $(wildcard $(SRC_DIR)/*.s)) | ||
OBJS+=$(patsubst $(SRC_DIR)/%.S, $(OBJ_DIR)/%.o, $(wildcard $(SRC_DIR)/*.S)) | ||
|
||
OUT_DIR= obj/$(LIBNAME) | ||
|
||
.PHONY: clean | ||
|
||
all: screen_init.bin | ||
|
||
screen_init.bin: $(OBJS) | ||
$(CC) -nostartfiles --specs=$(LIBNAME).specs $(OBJS) $(LDFLAGS) -o $(ELFNAME) | ||
$(OC) $(OCFLAGS) -O binary $(ELFNAME) $(BINNAME) | ||
|
||
obj/%.o: source/%.c | dirs | ||
@echo Compiling $< | ||
$(CC) -c $(CFLAGS) $(C11FLAGS) $< -o $@ | ||
|
||
obj/%.o: source/%.s | dirs | ||
@echo Compiling $< | ||
$(CC) -c $(CFLAGS) $(C11FLAGS) $< -o $@ | ||
|
||
obj/%.o: source/%.S | dirs | ||
@echo Compiling $< | ||
$(CC) -c $(CFLAGS) $(C11FLAGS) $< -o $@ | ||
|
||
dirs: ${OUT_DIR} | ||
|
||
${OUT_DIR}: | ||
mkdir -p ${OUT_DIR} | ||
|
||
clean: | ||
rm -rf *.elf *.bin obj/* |
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,21 @@ | ||
OUTPUT_ARCH(arm) | ||
ENTRY(_entry) | ||
SECTIONS | ||
{ | ||
. = 0x1FFF4C80; | ||
.text : { | ||
*(.text.start) | ||
*(.text) | ||
} | ||
.data : { | ||
*(.data) | ||
} | ||
.bss : { | ||
*(.bss COMMON) | ||
} | ||
.rodata : { | ||
*(.rodata) | ||
} | ||
. = ALIGN(4); | ||
_stack = . + 0x100; | ||
} |
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,4 @@ | ||
%rename link old_link | ||
|
||
*link: | ||
%(old_link) -T screen_init.ld%s |
Oops, something went wrong.
5d7e4ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lavanoid Good idea
Seem it is related with #13 .
5d7e4ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lavanoid well there are several issues with that.... first thing's first, NATIVE_FIRM version, we have more than enough space to store some stuff in firm0 and 1 slots, but seeing that certain versions of firm aren't compatible with certain sysNAND versions, it's hard to make a solution that works for everyone, as there are already a few different schools of thought surrounding a9lh... Take for example, users (like me) who like to keep emuNAND, but keep that on 9.2 and sysNAND on the latest version, now we have to embed the 10.4 NATIVE_FIRM into the NAND, along with a payload to make it so they can load it... but what happens when they update to the next system version, and payload aren't compatible with the 10.4 firm? Well they're bricked until they can put this firmware back... then you have the users who want sysNAND to stay 9.2 and just use emuNAND for all of their needs, that problem is fairly simple to solve because they don't ever need to update the firm in NAND, but managing a good solution that supports both sides isn't exactly the easiest. That said we aren't giving up on it, however we have other uses for that extra space which will be more useful IMO than worrying about not having an SD card