diff --git a/.gitignore b/.gitignore index dea43c7d..bbd2c4e0 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ EBOOT.PBP # 3ds *.3dsx *.smdh +*.d +/build/ .DS_Store diff --git a/Makefile.3ds b/Makefile.3ds index 8a50ff3b..8b6def64 100644 --- a/Makefile.3ds +++ b/Makefile.3ds @@ -37,6 +37,9 @@ SOURCES := src src/game src/io src/io/gfx src/jj1bonuslevel \ DATA := data INCLUDES := src #ROMFS := romfs +APP_TITLE := OpenJazz +#APP_DESCRIPTION:= +APP_AUTHOR := AlisterT & carstene1ns #--------------------------------------------------------------------------------- # options for code generation @@ -47,20 +50,20 @@ CFLAGS := -g -Wall -O2 -mword-relocations \ -fomit-frame-pointer -ffunction-sections \ $(ARCH) -CFLAGS += $(INCLUDE) -DARM11 -D_3DS -DDATAPATH=\"sdmc:/3ds/OJ/\" +CFLAGS += $(INCLUDE) -DARM11 -D_3DS -DUSE_XMP -DDATAPATH=\"sdmc:/3ds/OJ/\" CXXFLAGS := $(CFLAGS) -frtti -fexceptions -std=gnu++11 ASFLAGS := -g $(ARCH) LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) -LIBS := -lSDL -lcitro3d -lctru -lm +LIBS := -lSDL -lxmp -lcitro3d -lctru -lz -lm #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- -LIBDIRS := $(CTRULIB) $(CURDIR)/SDL +LIBDIRS := $(CTRULIB) $(CURDIR)/deps #--------------------------------------------------------------------------------- diff --git a/src/io/file.cpp b/src/io/file.cpp index de308ff6..d55f1b0f 100644 --- a/src/io/file.cpp +++ b/src/io/file.cpp @@ -33,13 +33,7 @@ #include "util.h" #include - -#ifdef _3DS -#define MINIZ_HEADER_FILE_ONLY -#include "miniz.c" -#else #include -#endif #ifndef _WIN32 #define UPPERCASE_FILENAMES diff --git a/src/io/gfx/video.h b/src/io/gfx/video.h index 187ec8ef..44f41ef2 100644 --- a/src/io/gfx/video.h +++ b/src/io/gfx/video.h @@ -75,7 +75,7 @@ #define FULLSCREEN_FLAGS (SDL_FULLSCREEN | SDL_SWSURFACE | SDL_HWPALETTE) #elif defined(_3DS) - #define DEFAULT_SCREEN_WIDTH 320 + #define DEFAULT_SCREEN_WIDTH 400 #define DEFAULT_SCREEN_HEIGHT 240 #define FULLSCREEN_ONLY diff --git a/src/io/sound.cpp b/src/io/sound.cpp index 6eab7bf4..6197a539 100644 --- a/src/io/sound.cpp +++ b/src/io/sound.cpp @@ -45,7 +45,7 @@ #endif -#ifdef __SYMBIAN32__ +#if defined(__SYMBIAN32__) || defined(_3DS) #define SOUND_FREQ 22050 #else #define SOUND_FREQ 44100 @@ -68,8 +68,12 @@ ModPlugFile *musicFile; #elif defined(USE_XMP) +# ifdef _3DS + #define MUSIC_INTERPOLATION XMP_INTERP_NEAREST +# else #define MUSIC_INTERPOLATION XMP_INTERP_SPLINE #define MUSIC_EFFECTS XMP_DSP_ALL +# endif xmp_context xmpC; @@ -163,7 +167,7 @@ void openAudio () { asDesired.freq = SOUND_FREQ; asDesired.format = AUDIO_S16; asDesired.channels = 2; -#if defined(GP2X) || defined(PSP) +#if defined(GP2X) || defined(PSP) || defined(_3DS) asDesired.samples = 512; #else asDesired.samples = 2048; @@ -307,7 +311,9 @@ void playMusic (const char * fileName) { xmp_start_player(xmpC, audioSpec.freq, playerFlags); xmp_set_player(xmpC, XMP_PLAYER_INTERP, MUSIC_INTERPOLATION); +# ifdef MUSIC_EFFECTS xmp_set_player(xmpC, XMP_PLAYER_DSP, MUSIC_EFFECTS); +# endif #endif diff --git a/src/main.cpp b/src/main.cpp index add03922..96eb124e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -534,14 +534,9 @@ int main(int argc, char *argv[]) { atexit(sceKernelExitGame); sceIoChdir("ms0:/PSP/GAME/OpenJazz"); #endif - //gfxInit(GSP_RGBA8_OES, GSP_BGR8_OES, false); - //consoleInit(GFX_BOTTOM, NULL); - //printf("\n\nOJ 3DS\n\n"); - // Initialise SDL - // SDL_INIT_JOYSTICK crashes the 3ds - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) < 0) { + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) { logError("Could not start SDL", SDL_GetError());