diff --git a/Makefile b/Makefile index f9bf60a18c..1982f6338a 100644 --- a/Makefile +++ b/Makefile @@ -498,7 +498,7 @@ ifeq ($(TARGET_N3DS),1) CTRULIB := $(DEVKITPRO)/libctru LIBDIRS := $(CTRULIB) export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) - PLATFORM_CFLAGS := -mtp=soft -DTARGET_N3DS -DARM11 -DosGetTime=n64_osGetTime -D_3DS -march=armv6k -mtune=mpcore -mfloat-abi=hard -mword-relocations -fomit-frame-pointer -ffast-math $(foreach dir,$(LIBDIRS),-I$(dir)/include) + PLATFORM_CFLAGS := -mtp=soft -DTARGET_N3DS -DARM11 -DosGetTime=n64_osGetTime -D_3DS -D__3DS__ -march=armv6k -mtune=mpcore -mfloat-abi=hard -mword-relocations -fomit-frame-pointer -ffast-math $(foreach dir,$(LIBDIRS),-I$(dir)/include) PLATFORM_LDFLAGS := $(LIBPATHS) -lcitro3d -lctru -lm -specs=3dsx.specs -g -marm -mthumb-interwork -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ifeq ($(DISABLE_AUDIO),1) PLATFORM_CFLAGS += -DDISABLE_AUDIO @@ -545,7 +545,7 @@ else endif CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security -D_LANGUAGE_C $(VERSION_CFLAGS) $(MATCH_CFLAGS) $(PLATFORM_CFLAGS) $(GFX_CFLAGS) $(GRUCODE_CFLAGS) -CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) -D_LANGUAGE_C $(VERSION_CFLAGS) $(MATCH_CFLAGS) $(PLATFORM_CFLAGS) $(GFX_CFLAGS) $(GRUCODE_CFLAGS) $(MARCH_FLAGS) -fno-strict-aliasing -fwrapv +CFLAGS := -O3 $(INCLUDE_CFLAGS) -D_LANGUAGE_C $(VERSION_CFLAGS) $(MATCH_CFLAGS) $(PLATFORM_CFLAGS) $(GFX_CFLAGS) $(GRUCODE_CFLAGS) $(MARCH_FLAGS) -fno-strict-aliasing -fwrapv ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) diff --git a/enhancements/60fps.patch b/enhancements/60fps.patch index 0deb2e0f4e..b695f223e2 100644 --- a/enhancements/60fps.patch +++ b/enhancements/60fps.patch @@ -6,8 +6,8 @@ index 619f84d..fa11f9a 100644 CTRULIB := $(DEVKITPRO)/libctru LIBDIRS := $(CTRULIB) export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) -- PLATFORM_CFLAGS := -mtp=soft -DTARGET_N3DS -DARM11 -DosGetTime=n64_osGetTime -D_3DS -march=armv6k -mtune=mpcore -mfloat-abi=hard -mword-relocations -fomit-frame-pointer -ffast-math $(foreach dir,$(LIBDIRS),-I$(dir)/include) -+ PLATFORM_CFLAGS := -mtp=soft -DTARGET_N3DS -D_60FPS_PATCH -DARM11 -DosGetTime=n64_osGetTime -D_3DS -march=armv6k -mtune=mpcore -mfloat-abi=hard -mword-relocations -fomit-frame-pointer -ffast-math $(foreach dir,$(LIBDIRS),-I$(dir)/include) +- PLATFORM_CFLAGS := -mtp=soft -DTARGET_N3DS -DARM11 -DosGetTime=n64_osGetTime -D_3DS -D__3DS__ -march=armv6k -mtune=mpcore -mfloat-abi=hard -mword-relocations -fomit-frame-pointer -ffast-math $(foreach dir,$(LIBDIRS),-I$(dir)/include) ++ PLATFORM_CFLAGS := -mtp=soft -DTARGET_N3DS -D_60FPS_PATCH -DARM11 -DosGetTime=n64_osGetTime -D_3DS -D__3DS__ -march=armv6k -mtune=mpcore -mfloat-abi=hard -mword-relocations -fomit-frame-pointer -ffast-math $(foreach dir,$(LIBDIRS),-I$(dir)/include) PLATFORM_LDFLAGS := $(LIBPATHS) -lcitro3d -lctru -lm -specs=3dsx.specs -g -marm -mthumb-interwork -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ifeq ($(DISABLE_AUDIO),1) PLATFORM_CFLAGS += -DDISABLE_AUDIO diff --git a/src/pc/audio/audio_3ds.c b/src/pc/audio/audio_3ds.c index 473f960225..22bf4cbfb6 100644 --- a/src/pc/audio/audio_3ds.c +++ b/src/pc/audio/audio_3ds.c @@ -116,17 +116,25 @@ static bool audio_3ds_init() LightEvent_Init(&s_event_main, RESET_ONESHOT); s32 prio = 0; - svcGetThreadPriority(&prio, CUR_THREAD_HANDLE); int cpu; if (is_new_n3ds()) + { cpu = 2; // n3ds 3rd core - else if (R_SUCCEEDED(APT_SetAppCpuTimeLimit(80))) + prio = 0x18; + } + else if (R_SUCCEEDED(APT_SetAppCpuTimeLimit(70))) + { cpu = 1; // o3ds 2nd core (system) + prio = 0x18; + } else + { cpu = 0; // better to have choppy sound than no sound? + prio = 0x19; + } - threadId = threadCreate(audio_3ds_loop, 0, 128 * 1024, prio - 1, cpu, true); + threadId = threadCreate(audio_3ds_loop, 0, 64 * 1024, prio, cpu, true); if (threadId) printf("Created audio thread on core %i\n", cpu); diff --git a/tools/audiofile/Makefile b/tools/audiofile/Makefile index 20d22a45f6..70828fe157 100644 --- a/tools/audiofile/Makefile +++ b/tools/audiofile/Makefile @@ -4,7 +4,7 @@ libaudiofile.a: audiofile.o ar rcs libaudiofile.a audiofile.o audiofile.o: audiofile.cpp audiofile.h aupvlist.h - $(CXX) -std=c++11 -O2 -I. -c audiofile.cpp + $(CXX) -std=gnu++11 -O3 -ffast-math -I. -c audiofile.cpp clean: rm -f audiofile.o libaudiofile.a diff --git a/tools/audiofile/audiofile.cpp b/tools/audiofile/audiofile.cpp index 85b89687f4..ee458ea634 100644 --- a/tools/audiofile/audiofile.cpp +++ b/tools/audiofile/audiofile.cpp @@ -10184,7 +10184,7 @@ static const TrackSetup _af_default_tracksetup = { 0, { - 44100.0, + 32728.5, AF_SAMPFMT_TWOSCOMP, 16, _AF_BYTEORDER_NATIVE, diff --git a/tools/sdk-tools/tabledesign/Makefile b/tools/sdk-tools/tabledesign/Makefile index a06d70af3e..f7cf6eb069 100644 --- a/tools/sdk-tools/tabledesign/Makefile +++ b/tools/sdk-tools/tabledesign/Makefile @@ -6,7 +6,7 @@ IRIX_CC := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc IRIX_CFLAGS := -fullwarn -Wab,-r4300_mul -Xcpluscomm -mips1 -O2 NATIVE_CC := gcc -NATIVE_CFLAGS := -Wall -Wno-uninitialized -O2 +NATIVE_CFLAGS := -Wall -Wno-uninitialized -O3 LDFLAGS := -lm -laudiofile