Commits

clach04  committed 8a13c23

Added Dingoo (Native) port. Uses current key mappings. Menu/text is English, WAV audio is still Spainish.

  • Participants
  • Parent commits dc5cd51

Comments (0)

Files changed (3)

File Makefile.dingoo

+# make -f Makefile.dingoo
+# make -B -f Makefile.dingoo  # Force
+
+# Define the applications properties here:
+
+APP_NAME = vorton
+
+
+
+# Define the compiler settings here:
+
+CPP       = mipsel-linux-g++
+CC        = mipsel-linux-gcc
+LD        = mipsel-linux-ld
+
+SOURCE    = .
+
+INCLUDE   = -I$(DINGOO_SDK)/include -I$(DINGOO_SDK)/include/SDL -I../lib -I$(MIPSTOOLS)/mipsel-linux/include
+INCLUDE  += -Isrc -Isrc/SDL_flic -Isrc/SFont -Isrc/filmat -Isrc/phase2 -Isrc/ML_Lib
+
+
+W_OPTS    = -Wall -Wextra -finline-functions -fomit-frame-pointer -msoft-float -fno-builtin -fno-exceptions
+CPP_OPTS  = -G0 -O3 $(INCLUDE) -mips32 -mno-abicalls -fno-pic $(W_OPTS) -D_DEBUG -DMPU_JZ4740 -c
+CC_OPTS   = -G0 -O3 $(INCLUDE) -mips32 -mno-abicalls -fno-pic $(W_OPTS) -D_DEBUG -DMPU_JZ4740 -c
+CC_OPTS   += -DNDEBUG=1  ## allow assert() calls to be removed, if left fails to build with Dingoo native
+#CC_OPTS   += -DDATA_PREFIX=\"data/\" -DFILE_SEPARATOR=\"/\"
+#CC_OPTS   += -DARGS ## not really supported for Dingoo native
+CC_OPTS   += -DDINGOO_NATIVE=1
+CC_OPTS   += -DENGLISH
+CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_
+
+LIB_PATH  = $(DINGOO_SDK)/lib
+#LIBS      =  -lpng -lSDL -lsml -lc -ljz4740 -lgcc
+#LIBS      =       -lpng -lz -lSDL -lsml -lm -lc -ljz4740 -lgcc
+LIBS      = -lSDL -ltremor -lmikmod -lfreetype -lpng -lz -lm -lsml -lc -ljz4740 -lgcc
+
+LD_SCRIPT = $(DINGOO_SDK)/lib/dingoo.xn
+LD_OPTS   = -nodefaultlibs --script $(LD_SCRIPT) -L$(LIB_PATH) $(LIBS) -o $(APP_NAME).elf
+
+
+
+# Find all source files
+
+SRC_CPP = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.cpp))
+SRC_C   = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.c))
+SRC_C   = src/vorton.c \
+		src/video.c \
+		src/intro.c \
+		src/audio.c \
+		src/menu.c \
+		src/exit.c \
+		src/language.c \
+		src/records.c \
+		src/error.c \
+		src/rand.c \
+		src/filmat/laser.c \
+		src/filmat/process.c \
+		src/filmat/hero.c \
+		src/filmat/bloq.c \
+		src/filmat/brick.c \
+		src/filmat/fire.c \
+		src/filmat/robot.c \
+		src/filmat/movable.c \
+		src/filmat/parse.c \
+		src/filmat/pyramid.c \
+		src/filmat/dummy.c \
+		src/filmat/filmat.c \
+		src/filmat/video.c \
+		src/phase2/video.c \
+		src/phase2/process.c \
+		src/phase2/mode7.c \
+		src/phase2/stretch.c \
+		src/SDL_flic/SDL_flic.c \
+		src/SDL_flic/SDL_playflic.c \
+		src/SDL_flic/node_text.c \
+		src/SDL_flic/font-arial-12.c \
+		src/SFont/SFont.c \
+		src/ML_Lib/ML_Attribute.c \
+		src/ML_Lib/ML_Comment.c \
+		src/ML_Lib/ML_common_func.c \
+		src/ML_Lib/ML_COM_Sim.c \
+		src/ML_Lib/ML_Document.c \
+		src/ML_Lib/ML_Element.c \
+		src/ML_Lib/ML_leng_process.c \
+		src/ML_Lib/ML_Node.c \
+		src/ML_Lib/ML_Process.c \
+		src/ML_Lib/ML_Text.c \
+
+SRC_S   = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.S))
+OBJ_CPP = $(patsubst %.cpp, %.o, $(SRC_CPP))
+OBJ_C   = $(patsubst %.c, %.o, $(SRC_C))
+OBJ_S   = $(patsubst %.S, %.o, $(SRC_S))
+OBJ     = $(OBJ_CPP) $(OBJ_C) $(OBJ_S)
+
+
+
+# Compile rules.
+
+.PHONY : all
+
+all : $(APP_NAME).app
+
+$(APP_NAME).app : $(APP_NAME).elf
+	$(DINGOO_SDK)/tools/elf2app/elf2app $(APP_NAME)
+
+$(APP_NAME).elf : $(OBJ)
+	$(LD) $(OBJ) $(LD_OPTS)
+
+$(OBJ_CPP) : %.o : %.cpp
+	$(CPP) $(CPP_OPTS) -o $@ $<
+
+$(OBJ_C) : %.o : %.c
+	$(CC) $(CC_OPTS) -o $@ $<
+
+$(OBJ_S) : %.o : %.S
+	$(CC) $(CC_OPTS_A) -o $@ $<
+
+
+
+# Clean rules
+
+.PHONY : clean
+
+clean :
+	rm -f $(OBJ) $(APP_NAME).elf $(APP_NAME).bin $(APP_NAME).app

File src/vorton.c

 static int level_loaded=0;
 
 
+/****************************************************************/
+#ifdef DINGOO_NATIVE
+void debug_printf_init()
+{
+	char tmp_buf[1024];
+	int mesg_len=0;
+	FILE *fptr=NULL;
+
+	fptr = fopen("stdout.txt", "w");
+	if (fptr != NULL)
+	{
+		mesg_len = sprintf(tmp_buf, "stdout for vorton\n");
+		fwrite(tmp_buf, mesg_len, 1, fptr);
+		fclose(fptr);
+	}
+	/* else nothing we can do except maybe print to screen */
+}
+
+void debug_printf(char *fmt, ...)
+{
+	va_list ap;
+	char tmp_buf[1024];
+	int mesg_len=0;
+	FILE *fptr=NULL;
+
+	va_start(ap, fmt);
+	fptr = fopen("stdout.txt", "a");
+	if (fptr != NULL)
+	{
+		mesg_len = vsnprintf(tmp_buf, sizeof(tmp_buf)-1, fmt, ap);
+		fwrite(tmp_buf, mesg_len, 1, fptr);
+		fclose(fptr);
+	}
+	/* else nothing we can do except maybe print to screen */
+	va_end(ap);
+}
+#define printf debug_printf
+#endif /* DINGOO_NATIVE */
+/****************************************************************/
+
 #ifdef ARGS
 
 /*Argumento Sonido*/
 /* Argumento_lowsound */
 int lowsound_arg=0;
 
+
 void parse_args(int n_arg, char **argv)
 {
 	int i;
 {
 	int exit_main_loop=0, rate=RATE, mus=0;
 	Uint32 sdl_arg=SDL_INIT_VIDEO;
+
+#ifdef DINGOO_NATIVE
+    debug_printf_init();
+#endif /* DINGOO_NATIVE */
+
 #ifndef GP32
+    #ifndef DINGOO_NATIVE
 	sdl_arg|=SDL_INIT_JOYSTICK;
+    #endif
 #endif
 #ifdef ARGS
 	parse_args(n_arg,argv);

File src/vorton.h

 #include "SDL_flic.h"
 #include "SFont.h"
 
+
 #ifdef DREAMCAST
 #define SDL_Delay timer_spin_sleep
 #define SDL_GetTicks timer_ms_gettime64
 #endif
 
+#ifdef DINGOO_NATIVE
+#define FILE_SEPARATOR "\\"
+#define DATA_PREFIX "data" FILE_SEPARATOR
+#endif /* DINGOO_NATIVE */
+
 #define DATA_COMMON DATA_PREFIX "common" FILE_SEPARATOR
 
 /* Enumeracion para la carga de imagenes */