Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Made a small change.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommai78101 committed Nov 28, 2017
1 parent a15a0f5 commit a47daae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,39 @@ include $(DEVKITARM)/3ds_rules
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
#---------------------------------------------------------------------------------
TARGET :=
# TARGET :=
BUILD := build
SOURCES := source source/dsp source/jpeg source/ns source/libctru
DATA :=
INCLUDES := include include/jpeg
OLD_3DS_TARGET := o3ds_ntr_payload
NEW_3DS_TARGET := n3ds_ntr_payload

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft

CFLAGS := -Wall \
CFLAGS_DEF := -Wall \
-fomit-frame-pointer -ffunction-sections -fdata-sections \
$(ARCH)

ifeq ($(strip $(NEW_3DS)),1)
CFLAGS += $(INCLUDE) -DHAS_JPEG=1 -O3
TARGET := n3ds_ntr_payload
TARGET := $(NEW_3DS_TARGET)
CFLAGS_VAR := $(INCLUDE) -DHAS_JPEG=1 -O3
else
TARGET := $(OLD_3DS_TARGET)

HAS_DSP := $(call containing,dsp,$(VPATH))
ifeq ($(strip $(HAS_DSP)),)
CFLAGS += $(INCLUDE) -Os
ifeq ($(findstring nightshift,$(basename $%)),nightshift)
CFLAGS_VAR := $(INCLUDE) -O3
else
CFLAGS += $(INCLUDE) -O3
CFLAGS_VAR := $(INCLUDE) -Os
endif

TARGET := o3ds_ntr_payload

endif

CFLAGS := $(CFLAGS_DEF) $(CFLAGS_VAR)

CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11

ASFLAGS := -g $(ARCH)
Expand Down Expand Up @@ -125,7 +127,7 @@ $(BUILD):
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).bin $(TARGET).elf
@rm -fr $(BUILD) $(NEW_3DS_TARGET).bin $(NEW_3DS_TARGET).elf $(OLD_3DS_TARGET).bin $(OLD_3DS_TARGET).elf

old_3ds:
@echo making ntr_payload for old_3ds ...
Expand Down
11 changes: 10 additions & 1 deletion source/dsp/nightshift.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "global.h"

#ifndef NEW_3DS
# pragma GCC push_options
# pragma GCC optimize ("O3")
#endif

extern PLGLOADER_INFO *g_plgInfo;

#define NIGHT_SHIFT_RGB565_B(level) \
Expand Down Expand Up @@ -293,4 +298,8 @@ u32 plgNightShiftFramebuffer(u32 addr, u32 stride, u32 height, u32 format) {
return plgNightShift2(addr, stride, height, format, 1);
}
return plgNightShift2(addr, stride, height, format, 0);
}
}

#ifndef NEW_3DS
# pragma GCC pop_options
#endif

0 comments on commit a47daae

Please sign in to comment.