This repository has been archived by the owner on Mar 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore a7 in main coz it DESCRIPTION
removes long black screen on boot for dsi sdnand and make ds flashcard go quicker too!
- Loading branch information
1 parent
e75517d
commit 34ed905
Showing
3 changed files
with
226 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
|
||
export ARM7_MAJOR := 0 | ||
export ARM7_MINOR := 6 | ||
export ARM7_PATCH := 0 | ||
|
||
VERSTRING := $(ARM7_MAJOR).$(ARM7_MINOR).$(ARM7_PATCH) | ||
#--------------------------------------------------------------------------------- | ||
.SUFFIXES: | ||
#--------------------------------------------------------------------------------- | ||
ifeq ($(strip $(DEVKITARM)),) | ||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM) | ||
endif | ||
|
||
include $(DEVKITARM)/ds_rules | ||
#--------------------------------------------------------------------------------- | ||
# TARGET is the name of the output | ||
# BUILD is the directory where object files & intermediate files will be placed | ||
# SOURCES is a list of directories containing source code | ||
# INCLUDES is a list of directories containing extra header files | ||
#--------------------------------------------------------------------------------- | ||
TARGET := Relaunch | ||
BUILD := build | ||
SOURCES := source | ||
INCLUDES := include build | ||
|
||
#--------------------------------------------------------------------------------- | ||
# options for code generation | ||
#--------------------------------------------------------------------------------- | ||
ARCH := -march=armv4t -mthumb -mthumb-interwork | ||
|
||
CFLAGS := -g -Wall -O2\ | ||
-mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\ | ||
-ffast-math \ | ||
$(ARCH) | ||
|
||
CFLAGS += $(INCLUDE) -DARM7 | ||
|
||
ASFLAGS := -g $(ARCH) | ||
LDFLAGS = -specs=ds_arm7.specs -g $(ARCH) -Wl,--nmagic -Wl,-Map,$(notdir $*).map | ||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
# any extra libraries we wish to link with the project | ||
#--------------------------------------------------------------------------------- | ||
LIBS := -lnds7 | ||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
# list of directories containing libraries, this must be the top level containing | ||
# include and lib | ||
#--------------------------------------------------------------------------------- | ||
LIBDIRS := $(LIBNDS) | ||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
# no real need to edit anything past this point unless you need to add additional | ||
# rules for different file extensions | ||
#--------------------------------------------------------------------------------- | ||
ifneq ($(BUILD),$(notdir $(CURDIR))) | ||
#--------------------------------------------------------------------------------- | ||
|
||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) | ||
|
||
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) | ||
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) | ||
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) | ||
|
||
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) | ||
|
||
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ | ||
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \ | ||
-I$(CURDIR)/$(BUILD) | ||
|
||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) | ||
|
||
export DEPSDIR := $(CURDIR)/$(BUILD) | ||
|
||
export OUTPUT := $(CURDIR)/$(TARGET) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# use CXX for linking C++ projects, CC for standard C | ||
#--------------------------------------------------------------------------------- | ||
ifeq ($(strip $(CPPFILES)),) | ||
#--------------------------------------------------------------------------------- | ||
export LD := $(CC) | ||
#--------------------------------------------------------------------------------- | ||
else | ||
#--------------------------------------------------------------------------------- | ||
export LD := $(CXX) | ||
#--------------------------------------------------------------------------------- | ||
endif | ||
#--------------------------------------------------------------------------------- | ||
|
||
.PHONY: all $(BUILD) clean | ||
|
||
all : $(BUILD) | ||
|
||
#--------------------------------------------------------------------------------- | ||
$(BUILD): | ||
@[ -d $@ ] || mkdir -p $@ | ||
@$(MAKE) -C $(BUILD) -f $(CURDIR)/Makefile | ||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
dist: all | ||
#--------------------------------------------------------------------------------- | ||
@tar --exclude=*CVS* --exclude=.svn -cvjf default_arm7-src-$(VERSTRING).tar.bz2 source Makefile | ||
@tar -cvjf default_arm7-$(VERSTRING).tar.bz2 default.elf | ||
|
||
#--------------------------------------------------------------------------------- | ||
install: all | ||
#--------------------------------------------------------------------------------- | ||
cp $(TARGET).elf $(LIBNDS) | ||
|
||
#--------------------------------------------------------------------------------- | ||
clean: | ||
@echo clean ... | ||
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).arm7 | ||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
else | ||
|
||
DEPENDS := $(OFILES:.o=.d) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# main targets | ||
#--------------------------------------------------------------------------------- | ||
|
||
$(OUTPUT).elf : $(OFILES) $(LIBNDS)/lib/libnds7.a | ||
|
||
-include $(DEPENDS) | ||
|
||
#--------------------------------------------------------------------------------------- | ||
endif | ||
#--------------------------------------------------------------------------------------- |
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,77 @@ | ||
/*--------------------------------------------------------------------------------- | ||
default ARM7 core | ||
Copyright (C) 2005 - 2010 | ||
Michael Noland (joat) | ||
Jason Rogers (dovoto) | ||
Dave Murphy (WinterMute) | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any | ||
damages arising from the use of this software. | ||
Permission is granted to anyone to use this software for any | ||
purpose, including commercial applications, and to alter it and | ||
redistribute it freely, subject to the following restrictions: | ||
1. The origin of this software must not be misrepresented; you | ||
must not claim that you wrote the original software. If you use | ||
this software in a product, an acknowledgment in the product | ||
documentation would be appreciated but is not required. | ||
2. Altered source versions must be plainly marked as such, and | ||
must not be misrepresented as being the original software. | ||
3. This notice may not be removed or altered from any source | ||
distribution. | ||
---------------------------------------------------------------------------------*/ | ||
#include <nds.h> | ||
|
||
//--------------------------------------------------------------------------------- | ||
void VblankHandler(void) { | ||
//--------------------------------------------------------------------------------- | ||
} | ||
|
||
//--------------------------------------------------------------------------------- | ||
void VcountHandler() { | ||
//--------------------------------------------------------------------------------- | ||
inputGetAndSend(); | ||
} | ||
|
||
volatile bool exitflag = false; | ||
|
||
//--------------------------------------------------------------------------------- | ||
void powerButtonCB() { | ||
//--------------------------------------------------------------------------------- | ||
exitflag = true; | ||
} | ||
|
||
//--------------------------------------------------------------------------------- | ||
int main() { | ||
//--------------------------------------------------------------------------------- | ||
nocashMessage("ARM7 main.c main"); | ||
|
||
// clear sound registers | ||
dmaFillWords(0, (void*)0x04000400, 0x100); | ||
|
||
REG_SOUNDCNT |= SOUND_ENABLE; | ||
writePowerManagement(PM_CONTROL_REG, ( readPowerManagement(PM_CONTROL_REG) & ~PM_SOUND_MUTE ) | PM_SOUND_AMP ); | ||
powerOn(POWER_SOUND); | ||
|
||
ledBlink(0); | ||
|
||
irqInit(); | ||
|
||
fifoInit(); | ||
|
||
SetYtrigger(80); | ||
|
||
installSystemFIFO(); | ||
|
||
irqSet(IRQ_VCOUNT, VcountHandler); | ||
irqSet(IRQ_VBLANK, VblankHandler); | ||
|
||
irqEnable( IRQ_VBLANK | IRQ_VCOUNT ); | ||
|
||
setPowerButtonCB(powerButtonCB); | ||
|
||
// Keep the ARM7 mostly idle | ||
while (!exitflag) { | ||
swiWaitForVBlank(); | ||
} | ||
return 0; | ||
} |