Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Commit

Permalink
restore a7 in main coz it DESCRIPTION
Browse files Browse the repository at this point in the history
removes long black screen on boot for dsi sdnand and make ds flashcard go quicker too!
  • Loading branch information
FlameKat53 authored Jan 28, 2020
1 parent e75517d commit 34ed905
Show file tree
Hide file tree
Showing 3 changed files with 226 additions and 5 deletions.
18 changes: 13 additions & 5 deletions main/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ endif

export GAME_TITLE := $(TARGET)

.PHONY: bootloader bootstub clean arm9/$(TARGET).elf
.PHONY: bootloader bootstub clean arm7/$(TARGET).elf arm9/$(TARGET).elf

all: bootloader bootstub $(TARGET).nds

Expand All @@ -118,14 +118,20 @@ dist: all
@cp BootStrap/_BOOT_MP.NDS BootStrap/TTMENU.DAT BootStrap/_DS_MENU.DAT BootStrap/ez5sys.bin BootStrap/akmenu4.nds hbmenu
@tar -cvjf $(TARGET)-$(VERSION).tar.bz2 hbmenu testfiles README.html COPYING hbmenu -X exclude.lst

$(TARGET).nds: arm9/$(TARGET).elf
ndstool -c $(TARGET).nds -9 arm9/$(TARGET).elf \
-b icon.bmp "Relaunch;Universal-Team" $(_ADDFILES) \
-z 80040000 -u 00030004 -a 00000138
$(TARGET).nds: $(TARGET).arm7 $(TARGET).arm9
ndstool -c $(TARGET).nds -7 $(TARGET).arm7.elf -9 $(TARGET).arm9.elf \
-z 80040000 -u 00030004 -a 00000143 -b icon.bmp "Relaunch;Universal-Team"

$(TARGET).arm7: arm7/$(TARGET).elf
cp arm7/$(TARGET).elf $(TARGET).arm7.elf

$(TARGET).arm9: arm9/$(TARGET).elf
cp arm9/$(TARGET).elf $(TARGET).arm9.elf

#---------------------------------------------------------------------------------
arm7/$(TARGET).elf:
@$(MAKE) -C arm7

#---------------------------------------------------------------------------------
arm9/$(TARGET).elf:
@$(MAKE) -C arm9
Expand All @@ -139,10 +145,12 @@ clean:
@echo clean ...
@rm -fr data
@rm -fr $(BUILD) $(TARGET).elf
@rm -fr $(TARGET).arm7.elf
@rm -fr $(TARGET).arm9.elf
@$(MAKE) -C bootloader clean
@$(MAKE) -C bootstub clean
@$(MAKE) -C arm9 clean
@$(MAKE) -C arm7 clean

data:
@mkdir -p data
Expand Down
136 changes: 136 additions & 0 deletions main/arm7/Makefile
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
#---------------------------------------------------------------------------------------
77 changes: 77 additions & 0 deletions main/arm7/source/main.c
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;
}

0 comments on commit 34ed905

Please sign in to comment.