[Scummvm-cvs-logs] SF.net SVN: scummvm: [25123] scummvm/trunk/backends/platform/ds/arm7
agent-q at users.sourceforge.net
agent-q at users.sourceforge.net
Fri Jan 19 22:38:03 CET 2007
Revision: 25123
http://scummvm.svn.sourceforge.net/scummvm/?rev=25123&view=rev
Author: agent-q
Date: 2007-01-19 13:38:03 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
Changed to ARM7 for libcartreset
Modified Paths:
--------------
scummvm/trunk/backends/platform/ds/arm7/Makefile
scummvm/trunk/backends/platform/ds/arm7/source/main.cpp
Modified: scummvm/trunk/backends/platform/ds/arm7/Makefile
===================================================================
--- scummvm/trunk/backends/platform/ds/arm7/Makefile 2007-01-19 21:36:47 UTC (rev 25122)
+++ scummvm/trunk/backends/platform/ds/arm7/Makefile 2007-01-19 21:38:03 UTC (rev 25123)
@@ -10,11 +10,12 @@
#---------------------------------------------------------------------------------
TARGET := arm7
BUILD := build
-SOURCES := gfx source data
+SOURCES := gfx source source/libcartreset data
INCLUDES := include build
+
# Enable support for debugger (must be the same as in the arm9 makefile)
-USE_DEBUGGER = 1
+#USE_DEBUGGER = 1
#---------------------------------------------------------------------------------
# options for code generation
@@ -91,7 +92,7 @@
export LD := $(CXX)
#export LD := $(CC)
-CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
+CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
PCXFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.pcx)))
@@ -99,6 +100,8 @@
PALFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.pal)))
RAWFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.raw)))
MAPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.map)))
+
+
export OFILES := $(MAPFILES:.map=.o) $(RAWFILES:.raw=.o) $(PALFILES:.pal=.o) $(BINFILES:.bin=.o) $(PCXFILES:.pcx=.o)\
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
@@ -106,7 +109,7 @@
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) -I- -I$(CURDIR)/../commoninclude\
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include/nds)\
- -I$(CURDIR)/$(BUILD)
+ -I$(CURDIR)/$(BUILD) -I$(CURDIR)/source/libcartreset
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
@@ -115,6 +118,8 @@
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
+ @echo $(OFILES)
+ @echo $(CFILES)
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
@@ -146,6 +151,7 @@
#---------------------------------------------------------------------------------
%.elf:
echo ELF
+ @echo $(LD) $(LDFLAGS) -specs=ds_arm7.specs $(OFILES) $(LIBPATHS) $(LIBS) -o $(TARGET).elf
@$(LD) $(LDFLAGS) -specs=ds_arm7.specs $(OFILES) $(LIBPATHS) $(LIBS) -o $(TARGET).elf
@@ -153,7 +159,7 @@
#---------------------------------------------------------------------------------
# Compile Targets for C/C++
#---------------------------------------------------------------------------------
-
+
#---------------------------------------------------------------------------------
%.o : %.cpp
@echo $(notdir $<)
@@ -164,6 +170,7 @@
#---------------------------------------------------------------------------------
%.o : %.c
@echo $(notdir $<)
+ @echo $(CC) $(CFLAGS) -c $< -o$@
@$(CC) -MM $(CFLAGS) -o $*.d $<
@$(CC) $(CFLAGS) -c $< -o$@
Modified: scummvm/trunk/backends/platform/ds/arm7/source/main.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm7/source/main.cpp 2007-01-19 21:36:47 UTC (rev 25122)
+++ scummvm/trunk/backends/platform/ds/arm7/source/main.cpp 2007-01-19 21:38:03 UTC (rev 25123)
@@ -25,6 +25,7 @@
// -- modified by Darkain and others
//////////////////////////////////////////////////////////////////////
+#define USE_LIBCARTRESET
#include <nds.h>
@@ -40,6 +41,7 @@
#include <dswifi7.h>
#endif
+#include "cartreset_nolibfat.h"
#define TOUCH_CAL_X1 (*(vs16*)0x027FFCD8)
#define TOUCH_CAL_Y1 (*(vs16*)0x027FFCDA)
@@ -344,6 +346,9 @@
powerManagerWrite(0, 0x30, false);
}
+void powerOff() {
+ powerManagerWrite(0, 0x40, true);
+}
//////////////////////////////////////////////////////////////////////
@@ -558,6 +563,13 @@
}
#endif
+#ifdef USE_LIBCARTRESET
+void reboot() {
+ cartExecute();
+}
+#endif
+
+
int main(int argc, char ** argv) {
#ifdef USE_DEBUGGER
@@ -605,20 +617,29 @@
DISP_SR = DISP_VBLANK_IRQ;
REG_IME = 1;
*/
+
#ifdef USE_DEBUGGER
initDebugger();
#endif
// Keep the ARM7 out of main RAM
- while (1) {
+ while ((1)) {
if (needSleep) {
performSleep();
needSleep = false;
}
-// if (IPC->reset) {
-// swiSoftReset();
-// }
+
+#ifdef USE_LIBCARTRESET
+ if (passmeloopQuery()) {
+ reboot();
+ }
+#endif
+
+ if (IPC->reset) {
+ powerOff();
+ }
+ swiWaitForVBlank();
}
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list