Skip to content

Commit

Permalink
Merge pull request #2 from LiquidFenrir/new-ui
Browse files Browse the repository at this point in the history
New ui, pp2d based
  • Loading branch information
LiquidFenrir authored Jan 15, 2018
2 parents 270bbbb + fa1761d commit 33a6d08
Show file tree
Hide file tree
Showing 47 changed files with 10,464 additions and 480 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 LiquidFenrir
Copyright (c) 2018 LiquidFenrir

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
85 changes: 56 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,66 @@ endif
TOPDIR ?= $(CURDIR)
include $(DEVKITARM)/3ds_rules

APP_TITLE := WifiManager
APP_DESCRIPTION := Backup and restore your WiFi slots!
APP_AUTHOR := LiquidFenrir
# Your values.
APP_TITLE := WifiManager
APP_DESCRIPTION := Backup and restore your WiFi slots!
APP_AUTHOR := LiquidFenrir

TARGET := $(notdir $(CURDIR))
OUTDIR := out
BUILD := build
SOURCES := source source/filebrowser
INCLUDES := include

ICON := icon.png
ICON_FLAGS := visible,nosavebackups
TARGET := $(subst $e ,_,$(notdir $(APP_TITLE)))
OUTDIR := out
BUILD := build
SOURCES := source source/pp2d
INCLUDES := include
ROMFS := romfs

BANNER_AUDIO := audio.wav
BANNER_IMAGE := banner.png

RSF_PATH := app.rsf
PRODUCT_CODE := CTR-P-WIFI
UNIQUE_ID := 0x05DC9
# Path to the files
# If left blank, will try to use "icon.png", "$(TARGET).png", or the default ctrulib icon, in that order
ICON := meta/icon.png

BANNER_AUDIO := meta/audio.wav
BANNER_IMAGE := meta/banner.png

RSF_PATH := meta/app.rsf

# If left blank, makerom will use the default Homebrew logo
LOGO :=


# If left blank, makerom will use default values (0xff3ff and CTR-P-CTAP, respectively)
# Be careful if UNIQUE_ID is the same as other apps: it will overwrite the previously installed one
UNIQUE_ID := 0x05DC9
PRODUCT_CODE := CTR-P-WIFI

# Don't really need to change this
ICON_FLAGS := nosavebackups,visible

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

CFLAGS := -g -Wall -Wextra -O2 -mword-relocations \
-fomit-frame-pointer -ffunction-sections \
-ffunction-sections \
$(ARCH)

CFLAGS += $(INCLUDE) -DARM11 -D_3DS
revision := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/')

CFLAGS += $(INCLUDE) -DARM11 -D_3DS -D_GNU_SOURCE -DTITLE="\"$(APP_TITLE)\"" -DAUTHOR="\"$(APP_AUTHOR)\""

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

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

LIBS := -lctru -lm
LIBS := -lcitro3d -lctrud -lm -lz

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(CTRULIB)
LIBDIRS := $(CTRULIB) $(DEVKITPRO)/portlibs/armv6k


#---------------------------------------------------------------------------------
Expand Down Expand Up @@ -124,12 +141,13 @@ endif
.PHONY: $(BUILD) clean all

#---------------------------------------------------------------------------------
all: 3dsx cia

3dsx: $(BUILD) $(OUTPUT).3dsx

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

all: 3dsx cia

#---------------------------------------------------------------------------------
$(BUILD):
@mkdir -p $(OUTDIR)
@[ -d "$@" ] || mkdir -p "$@"
Expand All @@ -141,19 +159,27 @@ clean:
@rm -fr $(BUILD) $(OUTDIR)

#---------------------------------------------------------------------------------

ifeq ($(strip $(NO_SMDH)),)
$(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh
else
$(OUTPUT).3dsx : $(OUTPUT).elf
endif

MAKEROM ?= makerom
#---------------------------------------------------------------------------------
MAKEROM ?= makerom

%.cia: $(OUTPUT).elf $(BUILD)/banner.bnr $(BUILD)/icon.icn
$(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)"
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)"

ifneq ($(strip $(LOGO)),)
MAKEROM_ARGS += -logo "$(LOGO)"
endif
ifneq ($(strip $(ROMFS)),)
MAKEROM_ARGS += -DAPP_ROMFS="$(ROMFS)"
endif

$(OUTPUT).cia: $(OUTPUT).elf $(BUILD)/banner.bnr $(BUILD)/icon.icn
$(MAKEROM) -f cia -o "$@" -target t -exefslogo $(MAKEROM_ARGS)

# Banner

BANNERTOOL ?= bannertool

Expand All @@ -169,11 +195,12 @@ else
BANNER_AUDIO_ARG := -a
endif

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

$(BUILD)/%.icn : $(ICON)
$(BANNERTOOL) makesmdh -s "$(APP_TITLE)" -l "$(APP_DESCRIPTION)" -p "$(APP_AUTHOR)" -i "$(ICON)" -f "$(ICON_FLAGS)" -o "$@"
$(BUILD)/icon.icn : $(APP_ICON)
$(BANNERTOOL) makesmdh -s "$(APP_TITLE)" -l "$(APP_DESCRIPTION)" -p "$(APP_AUTHOR)" -i "$(APP_ICON)" -f "$(ICON_FLAGS)" -o "$@"


#---------------------------------------------------------------------------------
else
Expand Down
3 changes: 3 additions & 0 deletions app.rsf → meta/app.rsf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ BasicInfo:
ProductCode : $(APP_PRODUCT_CODE)
Logo : Homebrew

RomFs:
RootPath: $(APP_ROMFS)

TitleInfo:
Category : Application
UniqueId : $(APP_UNIQUE_ID)
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
Binary file added romfs/arrow_down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/arrow_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added romfs/write.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions source/basic.h

This file was deleted.

34 changes: 34 additions & 0 deletions source/basic.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

#include <3ds.h>

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

extern FS_Archive sdmcArchive;
extern touchPosition touch;

#ifdef __cplusplus
}

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#endif

#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#define POS() DEBUG("%s (line %d)...\n", __func__, __LINE__)

#define DEBUGPOS(...) \
POS(); \
DEBUG(__VA_ARGS__)

#define WORKING_DIR "/3ds/" TITLE
23 changes: 0 additions & 23 deletions source/blocks.c

This file was deleted.

Loading

0 comments on commit 33a6d08

Please sign in to comment.