Skip to content

Commit 33a6d08

Browse files
authored
Merge pull request #2 from LiquidFenrir/new-ui
New ui, pp2d based
2 parents 270bbbb + fa1761d commit 33a6d08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+10464
-480
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 LiquidFenrir
3+
Copyright (c) 2018 LiquidFenrir
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 56 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,66 @@ endif
99
TOPDIR ?= $(CURDIR)
1010
include $(DEVKITARM)/3ds_rules
1111

12-
APP_TITLE := WifiManager
13-
APP_DESCRIPTION := Backup and restore your WiFi slots!
14-
APP_AUTHOR := LiquidFenrir
12+
# Your values.
13+
APP_TITLE := WifiManager
14+
APP_DESCRIPTION := Backup and restore your WiFi slots!
15+
APP_AUTHOR := LiquidFenrir
1516

16-
TARGET := $(notdir $(CURDIR))
17-
OUTDIR := out
18-
BUILD := build
19-
SOURCES := source source/filebrowser
20-
INCLUDES := include
2117

22-
ICON := icon.png
23-
ICON_FLAGS := visible,nosavebackups
18+
TARGET := $(subst $e ,_,$(notdir $(APP_TITLE)))
19+
OUTDIR := out
20+
BUILD := build
21+
SOURCES := source source/pp2d
22+
INCLUDES := include
23+
ROMFS := romfs
2424

25-
BANNER_AUDIO := audio.wav
26-
BANNER_IMAGE := banner.png
2725

28-
RSF_PATH := app.rsf
29-
PRODUCT_CODE := CTR-P-WIFI
30-
UNIQUE_ID := 0x05DC9
26+
# Path to the files
27+
# If left blank, will try to use "icon.png", "$(TARGET).png", or the default ctrulib icon, in that order
28+
ICON := meta/icon.png
29+
30+
BANNER_AUDIO := meta/audio.wav
31+
BANNER_IMAGE := meta/banner.png
32+
33+
RSF_PATH := meta/app.rsf
34+
35+
# If left blank, makerom will use the default Homebrew logo
36+
LOGO :=
37+
38+
39+
# If left blank, makerom will use default values (0xff3ff and CTR-P-CTAP, respectively)
40+
# Be careful if UNIQUE_ID is the same as other apps: it will overwrite the previously installed one
41+
UNIQUE_ID := 0x05DC9
42+
PRODUCT_CODE := CTR-P-WIFI
43+
44+
# Don't really need to change this
45+
ICON_FLAGS := nosavebackups,visible
3146

3247
#---------------------------------------------------------------------------------
3348
# options for code generation
3449
#---------------------------------------------------------------------------------
3550
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
3651

3752
CFLAGS := -g -Wall -Wextra -O2 -mword-relocations \
38-
-fomit-frame-pointer -ffunction-sections \
53+
-ffunction-sections \
3954
$(ARCH)
4055

41-
CFLAGS += $(INCLUDE) -DARM11 -D_3DS
56+
revision := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/')
57+
58+
CFLAGS += $(INCLUDE) -DARM11 -D_3DS -D_GNU_SOURCE -DTITLE="\"$(APP_TITLE)\"" -DAUTHOR="\"$(APP_AUTHOR)\""
4259

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

4562
ASFLAGS := -g $(ARCH)
4663
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
4764

48-
LIBS := -lctru -lm
65+
LIBS := -lcitro3d -lctrud -lm -lz
4966

5067
#---------------------------------------------------------------------------------
5168
# list of directories containing libraries, this must be the top level containing
5269
# include and lib
5370
#---------------------------------------------------------------------------------
54-
LIBDIRS := $(CTRULIB)
71+
LIBDIRS := $(CTRULIB) $(DEVKITPRO)/portlibs/armv6k
5572

5673

5774
#---------------------------------------------------------------------------------
@@ -124,12 +141,13 @@ endif
124141
.PHONY: $(BUILD) clean all
125142

126143
#---------------------------------------------------------------------------------
144+
all: 3dsx cia
145+
127146
3dsx: $(BUILD) $(OUTPUT).3dsx
128147

129148
cia : $(BUILD) $(OUTPUT).cia
130149

131-
all: 3dsx cia
132-
150+
#---------------------------------------------------------------------------------
133151
$(BUILD):
134152
@mkdir -p $(OUTDIR)
135153
@[ -d "$@" ] || mkdir -p "$@"
@@ -141,19 +159,27 @@ clean:
141159
@rm -fr $(BUILD) $(OUTDIR)
142160

143161
#---------------------------------------------------------------------------------
144-
145162
ifeq ($(strip $(NO_SMDH)),)
146163
$(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh
147164
else
148165
$(OUTPUT).3dsx : $(OUTPUT).elf
149166
endif
150167

151-
MAKEROM ?= makerom
168+
#---------------------------------------------------------------------------------
169+
MAKEROM ?= makerom
152170

153-
%.cia: $(OUTPUT).elf $(BUILD)/banner.bnr $(BUILD)/icon.icn
154-
$(MAKEROM) -f cia -o "$@" -elf "$(OUTPUT).elf" -rsf "$(RSF_PATH)" -target t -exefslogo -banner "$(BUILD)/banner.bnr" -icon "$(BUILD)/icon.icn" -DAPP_TITLE="$(APP_TITLE)" -DAPP_PRODUCT_CODE="$(PRODUCT_CODE)" -DAPP_UNIQUE_ID="$(UNIQUE_ID)"
171+
MAKEROM_ARGS := -elf "$(OUTPUT).elf" -rsf "$(RSF_PATH)" -banner "$(BUILD)/banner.bnr" -icon "$(BUILD)/icon.icn" -DAPP_TITLE="$(APP_TITLE)" -DAPP_PRODUCT_CODE="$(PRODUCT_CODE)" -DAPP_UNIQUE_ID="$(UNIQUE_ID)"
172+
173+
ifneq ($(strip $(LOGO)),)
174+
MAKEROM_ARGS += -logo "$(LOGO)"
175+
endif
176+
ifneq ($(strip $(ROMFS)),)
177+
MAKEROM_ARGS += -DAPP_ROMFS="$(ROMFS)"
178+
endif
179+
180+
$(OUTPUT).cia: $(OUTPUT).elf $(BUILD)/banner.bnr $(BUILD)/icon.icn
181+
$(MAKEROM) -f cia -o "$@" -target t -exefslogo $(MAKEROM_ARGS)
155182

156-
# Banner
157183

158184
BANNERTOOL ?= bannertool
159185

@@ -169,11 +195,12 @@ else
169195
BANNER_AUDIO_ARG := -a
170196
endif
171197

172-
$(BUILD)/%.bnr : $(BANNER_IMAGE) $(BANNER_AUDIO)
198+
$(BUILD)/banner.bnr : $(BANNER_IMAGE) $(BANNER_AUDIO)
173199
$(BANNERTOOL) makebanner $(BANNER_IMAGE_ARG) "$(BANNER_IMAGE)" $(BANNER_AUDIO_ARG) "$(BANNER_AUDIO)" -o "$@"
174200

175-
$(BUILD)/%.icn : $(ICON)
176-
$(BANNERTOOL) makesmdh -s "$(APP_TITLE)" -l "$(APP_DESCRIPTION)" -p "$(APP_AUTHOR)" -i "$(ICON)" -f "$(ICON_FLAGS)" -o "$@"
201+
$(BUILD)/icon.icn : $(APP_ICON)
202+
$(BANNERTOOL) makesmdh -s "$(APP_TITLE)" -l "$(APP_DESCRIPTION)" -p "$(APP_AUTHOR)" -i "$(APP_ICON)" -f "$(ICON_FLAGS)" -o "$@"
203+
177204

178205
#---------------------------------------------------------------------------------
179206
else

app.rsf renamed to meta/app.rsf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ BasicInfo:
33
ProductCode : $(APP_PRODUCT_CODE)
44
Logo : Homebrew
55

6+
RomFs:
7+
RootPath: $(APP_ROMFS)
8+
69
TitleInfo:
710
Category : Application
811
UniqueId : $(APP_UNIQUE_ID)
File renamed without changes.
File renamed without changes.
File renamed without changes.

romfs/arrow_down.png

507 Bytes
Loading

romfs/arrow_up.png

508 Bytes
Loading

romfs/delete.png

777 Bytes
Loading

romfs/save.png

373 Bytes
Loading

0 commit comments

Comments
 (0)