Hola,a todos he tenido un error en el jeugo de Zelda y no se como arreglarlo,esta basado en las NFLIB.
Os dejo el main y el Makefile:
Main
//Includes #include <stdio.h> #include <fat.h> #include <filesystem.h> #include <unistd.h> #include <string.h> #include <nds.h> #include "data.h" #include <nf_lib.h> #include <maxmod9.h> #include "soundbank.h" #include "funciones.h" //Funciones touchPosition Stylus; //Lapiz tactil //////////////////////////////////// //Main /////////////////////////////////// int main(int argc, char** argv){ consoleDemoInit(); NF_Set2D(1,0); NF_Set2D(0,0); switch(NF_GetLanguage()){ case 2: //español iprintf("Iniciando NitroFs...\nPor favor, espere...\n"); default: //ingles iprintf("NitroFS is inizialiting...\nPlease wait\n"); } NF_SetRootFolder("NITROFS"); consoleClear(); ////////////////////////////////////////////////// //Inicia los buffers de Sprites 2D NF_InitSpriteBuffers(); NF_InitSpriteSys(0); NF_InitSpriteSys(1); NF_InitTiledBgBuffers(); NF_InitTiledBgSys(1); NF_InitTiledBgSys(0); NF_InitTextSys(1); NF_InitTextSys(0); soundEnable(); NF_InitRawSoundBuffers(); mmInitDefault("audio/soundbank.bin"); NF_LoadTiledBg("splashes/splash_up", "up", 256, 256);//cargamos el splash de arriba y lo llamamos "up" NF_LoadTiledBg("splashes/splash_down", "down", 256, 256);//cargamos el splash de abajo y lo llamamos "down" NF_CreateTiledBg(0, 0, "up"); NF_CreateTiledBg(1, 0, "down"); ////////////////////////////////////////////// s8 i; //control del brillo de la pantalla i=-16; //y le ponemos de valor -16(negro total) u32 time; //tiempo que dura el Splash Screen time=10*10; //cambia el 4 por el numero de segundos que quiere que dure el Splash Screen for(i=-16;//mientras que i sea -16 i<0; //y que sea menor que 0 i++){ //aumentamos el brillo setBrightness(3, i);//esto aumenta el brillo de la DS con la variable i swiWaitForVBlank(); swiWaitForVBlank(); } while(time>=0){ time--; scanKeys(); if(keysHeld() &KEY_A){break;} } //Para terminar, salimos con el brillo de la DS for(i=0;i>-16;i--){ setBrightness(3, i);//pone el brillo bien swiWaitForVBlank(); swiWaitForVBlank(); } setBrightness(3, 0);//pone el brillo normal //borra los fondos de la memoria NF_ResetTiledBgBuffers(); NF_DeleteTiledBg(0, 0); NF_DeleteTiledBg(1, 0); /////////////////////////////////////////////////// //Segundo Splash Screen de MiguelSeiya y IndexAlpha9 ////////////////////////////////////////////////// NF_LoadTiledBg("splashes/up", "up", 256, 256); NF_CreateTiledBg(0, 0, "up"); NF_LoadTiledBg("splashes/IndexAlpha9", "down", 256, 256); NF_CreateTiledBg(1, 0, "down"); s32 bgx[2]; bgx[1]=256; bgx[2]=-256; while(1){ //suma cantidades bgx[1]--; bgx[2]++; ////////// //scrollea NF_ScrollBg(0, 0, bgx[1], 0); NF_ScrollBg(1, 0, bgx[2], 0); swiWaitForVBlank(); swiWaitForVBlank(); swiWaitForVBlank(); if(bgx[1]==0){break;}//si termina, sale } /////////////////////////////////////////////////// //Splash Screen San-HugoAnto & Flagelonte Estudios /////////////////////////////////////////////////// NF_LoadTiledBg("splashes/San-HugoAnto","sha",256,256); NF_CreateTiledBg(0,0,"sha"); NF_LoadTiledBg("splashes/Flagelonte","flan",256,256); NF_CreateTiledBg(1,0,"flan"); //Fade Out for(i=0;i>-16;i--){ setBrightness(3, i); swiWaitForVBlank(); swiWaitForVBlank(); } //resetea todo setBrightness(3, 0); NF_ResetTiledBgBuffers(); NF_DeleteTiledBg(1, 0); NF_DeleteTiledBg(0, 0); /////////////////////////////////////////////////////////// //carga el menu y lo muestra en pantalla NF_LoadTiledBg("mainmenu/up_menu", "upm" ,256,256); NF_CreateTiledBg(0, 0, "upm"); NF_LoadTiledBg("mainmenu/down_menu", "downm", 256, 256); NF_CreateTiledBg(1, 1, "downm"); mmLoad(MOD_MAINMENU); mmStart(MOD_MAINMENU, MM_PLAY_LOOP); //////////////////////////////////////////// while(1){ scanKeys(); touchRead(&Stylus); if(keysDown() &KEY_TOUCH) break; swiWaitForVBlank(); } //Resetea NF_DeleteTiledBg(1, 1); NF_DeleteTiledBg(0, 1); NF_ResetTiledBgBuffers(); mmUnload(MOD_MAINMENU); //Carga NF_DeleteTiledBg(1, 1); NF_DeleteTiledBg(1, 0); NF_ResetTiledBgBuffers(); NF_LoadTiledBg("init/tunombre_up", "name_up", 256, 256); NF_CreateTiledBg(0, 0, "name_up"); I9_KeyBoardName(); //nombre en el teclado //Historia o duelo keyboardHide(); consoleClear(); NF_DeleteTiledBg(0, 0); NF_ResetTiledBgBuffers(); NF_InitTiledBgSys(1); NF_LoadTiledBg("mainmenu/historia_duelo", "hd", 256, 256); NF_CreateTiledBg(1, 0, "hd"); //Bucle general while(1){scanKeys(); if((keysHeld() &KEY_TOUCH) && (keysHeld() &KEY_A)){partida=1;break;} if((keysHeld() &KEY_TOUCH) && (keysHeld() &KEY_B)){partida=2;break;} swiWaitForVBlank();NF_UpdateTextLayers(); } //Nombre de la yegua NF_LoadTiledBg("yegua/nombreyeguas","yegu",256,256); NF_CreateTiledBg(0,0, "yegu"); SaveData(); //Sal, apaga! systemShutDown(); return 0; }
Y ahora el MakeFile:
#--------------------------------------------------------------------------------- # Makefile for Zelda the Time Brothers #--------------------------------------------------------------------------------- .SUFFIXES: #--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITARM)),) $(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM") endif #--------------------------------------------------------------------------------- # This part substitutes this include: # include $(DEVKITARM)/ds_rules # This allows you to set ROM info and icon easy # Please update this block from DS_RULES file at every DEVKITARM update #--------------------------------------------------------------------------------- include $(DEVKITARM)/base_rules LIBNDS := $(DEVKITPRO)/libnds GAME_TITLE := The Legend of Zelda GAME_SUBTITLE1 := Brothers of Time GAME_SUBTITLE2 := By MiguelSeiya y IndexAlpha9 GAME_ICON := $(CURDIR)/../icon.bmp _ADDFILES := -d $(NITRO_FILES) #--------------------------------------------------------------------------------- %.nds: %.arm9 @ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES) @echo built ... $(notdir $@) #--------------------------------------------------------------------------------- %.nds: %.elf @ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES) @echo built ... $(notdir $@) #--------------------------------------------------------------------------------- %.arm9: %.elf @$(OBJCOPY) -O binary $< $@ @echo built ... $(notdir $@) #--------------------------------------------------------------------------------- %.arm7: %.elf @$(OBJCOPY) -O binary $< $@ @echo built ... $(notdir $@) #--------------------------------------------------------------------------------- %.elf: @echo linking $(notdir $@) @$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@ #--------------------------------------------------------------------------------- # 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 # DATA is a list of directories containing binary files embedded using bin2o # NITRODATA is the directory where files for NitroFS will be placed #--------------------------------------------------------------------------------- TARGET := $(shell basename $(CURDIR)) BUILD := build SOURCES := source INCLUDES := include DATA := data NITRODATA := nitrofiles Audio := Audio #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- ARCH := -mthumb -mthumb-interwork CFLAGS := -g -Wall -O2\ -march=armv5te -mtune=arm946e-s -fomit-frame-pointer\ -ffast-math \ $(ARCH) CFLAGS += $(INCLUDE) -DARM9 CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions ASFLAGS := -g $(ARCH) LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- LIBS := -lnflib -lfilesystem -lfat -lnds9 -lmm9 #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- LIBDIRS := $(LIBNDS) $(CURDIR)/nflib #--------------------------------------------------------------------------------- # 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 OUTPUT := $(CURDIR)/$(TARGET) export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ $(foreach dir,$(DATA),$(CURDIR)/$(dir)) export DEPSDIR := $(CURDIR)/$(BUILD) export NITRO_FILES := $(CURDIR)/$(NITRODATA) CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C #--------------------------------------------------------------------------------- ifeq ($(strip $(CPPFILES)),) #--------------------------------------------------------------------------------- export LD := $(CC) #--------------------------------------------------------------------------------- else #--------------------------------------------------------------------------------- export LD := $(CXX) #--------------------------------------------------------------------------------- endif #--------------------------------------------------------------------------------- export OFILES := $(addsuffix .o,$(BINFILES)) \ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ -I$(CURDIR)/$(BUILD) export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) icons := $(wildcard *.bmp) ifneq (,$(findstring $(TARGET).bmp,$(icons))) export GAME_ICON := $(CURDIR)/$(TARGET).bmp else ifneq (,$(findstring icon.bmp,$(icons))) export GAME_ICON := $(CURDIR)/icon.bmp endif endif .PHONY: $(BUILD) clean #--------------------------------------------------------------------------------- $(BUILD): @[ -d $@ ] || mkdir -p $@ @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile #--------------------------------------------------------------------------------- clean: @echo clean ... @rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(TARGET).arm9 #--------------------------------------------------------------------------------- else #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- $(OUTPUT).nds : $(OUTPUT).elf $(OUTPUT).elf : $(OFILES) #--------------------------------------------------------------------------------- %.bin.o : %.bin #--------------------------------------------------------------------------------- @echo $(notdir $<) $(bin2o) #--------------------------------------------------------------------------------------- endif #---------------------------------------------------------------------------------------
Espero que me lo solucioneis.
Grax de antemano
Mira soy Dark Link si te acercas te mato,si me respetas te ayudo y si me insultas te denuncio a los Moderadores.
Soy un buen Coder con muchos estudios en C++ con mi exfuerzo la gente tendra muchos juegos buenos :)
Esque//
Cuando sale el menu dice haz click en la pantalla tactil le ago clcik y despues me sale esto:
Eso en el archivo .nds
Espero que me puedan ayudar.
Mira soy Dark Link si te acercas te mato,si me respetas te ayudo y si me insultas te denuncio a los Moderadores.
Soy un buen Coder con muchos estudios en C++ con mi exfuerzo la gente tendra muchos juegos buenos :)
El mensaje te lo indica
Estás intentando manipular, ya sea moviendo o borrando, un fondo que no has creado, en la capa 1 de la pantalla 0.
Gracias!!!
Ya lo he conseguido,gracias exterminator.