diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e5c1355 --- /dev/null +++ b/Makefile @@ -0,0 +1,200 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITPRO)),) +$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro") +endif + +TOPDIR ?= $(CURDIR) +include $(DEVKITPRO)/libnx/switch_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +# EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm". +# ROMFS is the directory containing data to be added to RomFS, relative to the Makefile (Optional) +# +# NO_ICON: if set to anything, do not use icon. +# NO_NACP: if set to anything, no .nacp file is generated. +# APP_TITLE is the name of the app stored in the .nacp file (Optional) +# APP_AUTHOR is the author of the app stored in the .nacp file (Optional) +# APP_VERSION is the version of the app stored in the .nacp file (Optional) +# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional) +# ICON is the filename of the icon (.jpg), relative to the project folder. +# If not set, it attempts to use one of the following (in this order): +# - .jpg +# - icon.jpg +# - /default_icon.jpg +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := include +EXEFS_SRC := exefs_src +ROMFS := romfs + +APP_TITLE := BOTW UI +APP_AUTHOR := Jpe230 +APP_VERSION := 0.2 +ICON := meta/icon.jpg + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE + +CFLAGS := -g -Wall -O2 -ffunction-sections \ + $(ARCH) $(DEFINES) + +CFLAGS += $(INCLUDE) -D__SWITCH__ + +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 + +ASFLAGS := -g $(ARCH) + +LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +LIBS := -lSDL2_ttf -lSDL2_gfx -lSDL2_image \ + -lpng -ljpeg `sdl2-config --libs` `freetype-config --libs` -lnx + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(PORTLIBS) $(LIBNX) + + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES_BIN := $(addsuffix .o,$(BINFILES)) +export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) +export OFILES := $(OFILES_BIN) $(OFILES_SRC) +export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES))) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC) + +ifeq ($(strip $(ICON)),) + icons := $(wildcard *.jpg) + ifneq (,$(findstring $(TARGET).jpg,$(icons))) + export APP_ICON := $(TOPDIR)/$(TARGET).jpg + else + ifneq (,$(findstring icon.jpg,$(icons))) + export APP_ICON := $(TOPDIR)/icon.jpg + endif + endif +else + export APP_ICON := $(TOPDIR)/$(ICON) +endif + +ifeq ($(strip $(NO_ICON)),) + export NROFLAGS += --icon=$(APP_ICON) +endif + +ifeq ($(strip $(NO_NACP)),) + export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp +endif + +ifneq ($(APP_TITLEID),) + export NACPFLAGS += --titleid=$(APP_TITLEID) +endif + +ifneq ($(ROMFS),) + export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS) +endif + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).pfs0 $(TARGET).nso $(TARGET).nro $(TARGET).nacp $(TARGET).elf + + +#--------------------------------------------------------------------------------- +else +.PHONY: all + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +all : $(OUTPUT).pfs0 $(OUTPUT).nro + +$(OUTPUT).pfs0 : $(OUTPUT).nso + +$(OUTPUT).nso : $(OUTPUT).elf + +ifeq ($(strip $(NO_NACP)),) +$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp +else +$(OUTPUT).nro : $(OUTPUT).elf +endif + +$(OUTPUT).elf : $(OFILES) + +$(OFILES_SRC) : $(HFILES_BIN) + +#--------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#--------------------------------------------------------------------------------- +%.bin.o %_bin.h : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/README.md b/README.md index 021da1c..2f88c02 100644 --- a/README.md +++ b/README.md @@ -1 +1,43 @@ -# BOTW Save Editor GUI +# Legend of Zelda Breath of the Wild Save File Editor GUI (WIP) + + + +A Work in Progress Save Editor, currently it only to modifies rupees, durability of weapons, arrows and modifiers. + + +# Intructions + +- Open BOTW with your current user. Wait until the title screen, then exit it. (Close the game, too). +- Open the Save Editor and select your save file slot. (DPAD Left/Right, A to Enter) . +- Use DPAD to navigate between the items. (Press A to select an item, B to deselect it). +- When a keyboard shows up, press A to select an input, B to close the Keyboard. +- Press + to exit the program. + + +# Compile + +- Use LibNX. + +# Disclaimer + +- Please always make a backup before editing your save file; I'm not responsible for any lost save file. +- This is a WIP, it contains bugs. +- Your Switch can catch on fire by using this. + +# To Do + +- Make backups for the save files. +- Add more items. +- Add buttons hints at the bottom of the screen. + +# Credits + +- Starbucks: For having free internet +- Marcrobledo: For the amazing work reverse-engineering the save file (also for the assets used jeje) +- Joel-16: For the SDL Helper code + + + + + + diff --git a/include/MainMenu.h b/include/MainMenu.h new file mode 100644 index 0000000..f998f2e --- /dev/null +++ b/include/MainMenu.h @@ -0,0 +1,66 @@ +#ifndef _MAINMENU_H_ +#define _MAINMENU_H_ + +#include +#include +#include +#include "translations.h" +#include "botw_backend.h" + +SDL_Window* window; +SDL_Surface* screenSurface; +SDL_Renderer* renderer; +TTF_Font *Arial, *Arial_S, *Arial_M; +SDL_Texture *sprites[200]; +SDL_Texture *GreenRupee; +SDL_Texture *back; +SDL_Texture *bbutton; +SDL_Texture *okbutton; +SDL_Texture *bbuttonp; +SDL_Texture *okbuttonp; +SDL_Texture *check; + +int isArrow; + + +static inline SDL_Color SDL_MakeColor(Uint8 r, Uint8 g, Uint8 b) +{ + SDL_Color colour = {r, g, b}; + return colour; +} + + +#define TOPBAR_COLOR SDL_MakeColor(45,45,45) +#define ALERT_COLOR SDL_MakeColor(32,32,32) +#define LEFTBAR_COLOR SDL_MakeColor(50,50,50) +#define BACKGROUND_COLOR SDL_MakeColor(45,45,45) +#define ITEM_COLOR SDL_MakeColor(47,47,47) +#define WHITE_TEXT_COLOR SDL_MakeColor(235,235,235) +#define WHITE_COLOR SDL_MakeColor(254, 254, 254) +#define BLACK_COLOR SDL_MakeColor(1,1,1) +#define BLUE_TEXT_COLOR SDL_MakeColor(1,254,203) + + + +void SDL_ClearScreen(SDL_Renderer* renderer, SDL_Color colour); +void SDL_DrawRect(SDL_Renderer* renderer, int x, int y, int w, int h, SDL_Color colour); +void SDL_DrawText(TTF_Font *font, int x, int y, SDL_Color colour, const char *text); +void setMenuItems(int x, int page); +void setPageBar(int page, int mPage); +void mainUI(int x, int currentPage, int MaxPage,int showBox, int BoxPos); +SDL_Surface *SDL_LoadImage(SDL_Renderer* renderer, SDL_Texture **texture, char *path); +void SDL_DrawImage(SDL_Renderer* renderer, SDL_Texture *texture, int x, int y, int w, int h); +void showItemSDL(int currentItem, int arrow); +void selectSlotMenu(int slotchar); +void showKeyboard(int currentKey); +void errorScreen(); +void showKeyboard(); +void showCurrentRup(); +void KeyboardScreen(); +void showBoxSelect(int pos); +void Show_DropDownMenu(int pos); +void Show_DropDownMenuMod(int pos); +void printText(int textNum); +void exitMenu(int pos); + +#endif diff --git a/include/botw_backend.h b/include/botw_backend.h new file mode 100644 index 0000000..93105e9 --- /dev/null +++ b/include/botw_backend.h @@ -0,0 +1,51 @@ +#ifndef _BOTW_BACKEND_H_ +#define _BOTW_BACKEND_H_ + +#include +#include +#include +#include "mount.h" + + + +char itemName[60][40]; +long int quantItems[60]; +long int newQuantItems[60]; +int numberOfItems; + +long int rupeeValue; +long int rupees; + +int rupID[7]; +int itemsID[7]; +int itemsQuant[7]; +int header[7]; +char versionArray[7][5]; + +int FLAGS_WEAPON[7]; +int FLAGSV_WEAPON[7]; +int FLAGS_BOW[7]; +int FLAGSV_BOW[7]; +int FLAGS_SHIELD[7]; +int FLAGSV_SHIELD[7]; + +int numberOfWeapons; +int numberOfBows; +int numberOfShields; + +long int quantMod[60]; +long int new_quantMod[60]; +long int modNames[60]; +long int new_modNames[60]; + + +int maxArrows; +int version; + +FILE *fp; + +int setFile(); +void getData(); +void writeFile(); + +#endif diff --git a/include/main.h b/include/main.h new file mode 100644 index 0000000..fbe7588 --- /dev/null +++ b/include/main.h @@ -0,0 +1,47 @@ +#ifndef _main_h_ +#define _main_h_ + +#include +#include "MainMenu.h" +#include "botw_backend.h" + +int buttons; +int currentPage; +int maxPage; +int currentState; +int slot; +int keyboard; +int keyboardy; +int itemBox; +int isopen; +int drop; +char str[7]; +int positionKey; +int key; +int number; +int currentItem; + +int main(int argc, char **argv); +void startSDLServices(); +void initServices(); +void buttonLogic(int x); +void closeServices(); +void MenuButtons(int x); +void MenuButtonsSlot(int x); +void ConfirmButton(); +void setPages(); +void returnMainScreen(); +void KeyboardButtons(int x); +void BackButton(); +void ItemMenu(int x); +void RupeeKey(); +void comboBox(int x); +void dropMenuButtons(int x); +void KeyboardLogic(); +void exitMen(); + + + + + +#endif \ No newline at end of file diff --git a/include/mount.h b/include/mount.h new file mode 100644 index 0000000..1e6d87b --- /dev/null +++ b/include/mount.h @@ -0,0 +1,9 @@ +#ifndef MOUNT_H_ /* Include guard */ +#define MOUNT_H_ + + +void unmountSaveData(); +void mountSaveData(); + + +#endif // TRANSLATIONS_H_ \ No newline at end of file diff --git a/include/translations.h b/include/translations.h new file mode 100644 index 0000000..b34fbf7 --- /dev/null +++ b/include/translations.h @@ -0,0 +1,8 @@ +#ifndef TRANSLATIONS_H_ /* Include guard */ +#define TRANSLATIONS_H_ + +const char * translate(const char* rawName); +int getIDNumber(const char* rawName); +const char * translateMods(long int md); + +#endif // TRANSLATIONS_H_ \ No newline at end of file diff --git a/meta/icon.jpg b/meta/icon.jpg new file mode 100644 index 0000000..4ffb420 Binary files /dev/null and b/meta/icon.jpg differ diff --git a/romfs/arial.ttf b/romfs/arial.ttf new file mode 100644 index 0000000..886789b Binary files /dev/null and b/romfs/arial.ttf differ diff --git a/romfs/back.png b/romfs/back.png new file mode 100644 index 0000000..29ec7c5 Binary files /dev/null and b/romfs/back.png differ diff --git a/romfs/bbutton.png b/romfs/bbutton.png new file mode 100644 index 0000000..a8f7210 Binary files /dev/null and b/romfs/bbutton.png differ diff --git a/romfs/bbutton_p.png b/romfs/bbutton_p.png new file mode 100644 index 0000000..d5ec628 Binary files /dev/null and b/romfs/bbutton_p.png differ diff --git a/romfs/check.png b/romfs/check.png new file mode 100644 index 0000000..5322b5b Binary files /dev/null and b/romfs/check.png differ diff --git a/romfs/gr.png b/romfs/gr.png new file mode 100644 index 0000000..c09ed24 Binary files /dev/null and b/romfs/gr.png differ diff --git a/romfs/okbutton.png b/romfs/okbutton.png new file mode 100644 index 0000000..bb4da5f Binary files /dev/null and b/romfs/okbutton.png differ diff --git a/romfs/okbutton_p.png b/romfs/okbutton_p.png new file mode 100644 index 0000000..a7e74d9 Binary files /dev/null and b/romfs/okbutton_p.png differ diff --git a/romfs/sprites/0_01.png b/romfs/sprites/0_01.png new file mode 100644 index 0000000..926be92 Binary files /dev/null and b/romfs/sprites/0_01.png differ diff --git a/romfs/sprites/0_02.png b/romfs/sprites/0_02.png new file mode 100644 index 0000000..b1bec6b Binary files /dev/null and b/romfs/sprites/0_02.png differ diff --git a/romfs/sprites/0_03.png b/romfs/sprites/0_03.png new file mode 100644 index 0000000..d8ddbfc Binary files /dev/null and b/romfs/sprites/0_03.png differ diff --git a/romfs/sprites/0_04.png b/romfs/sprites/0_04.png new file mode 100644 index 0000000..55bb8e7 Binary files /dev/null and b/romfs/sprites/0_04.png differ diff --git a/romfs/sprites/0_05.png b/romfs/sprites/0_05.png new file mode 100644 index 0000000..71a1146 Binary files /dev/null and b/romfs/sprites/0_05.png differ diff --git a/romfs/sprites/0_06.png b/romfs/sprites/0_06.png new file mode 100644 index 0000000..8e75417 Binary files /dev/null and b/romfs/sprites/0_06.png differ diff --git a/romfs/sprites/0_07.png b/romfs/sprites/0_07.png new file mode 100644 index 0000000..e7a2037 Binary files /dev/null and b/romfs/sprites/0_07.png differ diff --git a/romfs/sprites/0_08.png b/romfs/sprites/0_08.png new file mode 100644 index 0000000..f152b2f Binary files /dev/null and b/romfs/sprites/0_08.png differ diff --git a/romfs/sprites/0_09.png b/romfs/sprites/0_09.png new file mode 100644 index 0000000..e3617fe Binary files /dev/null and b/romfs/sprites/0_09.png differ diff --git a/romfs/sprites/0_10.png b/romfs/sprites/0_10.png new file mode 100644 index 0000000..0789066 Binary files /dev/null and b/romfs/sprites/0_10.png differ diff --git a/romfs/sprites/0_100.png b/romfs/sprites/0_100.png new file mode 100644 index 0000000..b50bbf2 Binary files /dev/null and b/romfs/sprites/0_100.png differ diff --git a/romfs/sprites/0_101.png b/romfs/sprites/0_101.png new file mode 100644 index 0000000..7bf9d3d Binary files /dev/null and b/romfs/sprites/0_101.png differ diff --git a/romfs/sprites/0_102.png b/romfs/sprites/0_102.png new file mode 100644 index 0000000..198bc53 Binary files /dev/null and b/romfs/sprites/0_102.png differ diff --git a/romfs/sprites/0_103.png b/romfs/sprites/0_103.png new file mode 100644 index 0000000..1281aff Binary files /dev/null and b/romfs/sprites/0_103.png differ diff --git a/romfs/sprites/0_104.png b/romfs/sprites/0_104.png new file mode 100644 index 0000000..c163b53 Binary files /dev/null and b/romfs/sprites/0_104.png differ diff --git a/romfs/sprites/0_105.png b/romfs/sprites/0_105.png new file mode 100644 index 0000000..b1ffc17 Binary files /dev/null and b/romfs/sprites/0_105.png differ diff --git a/romfs/sprites/0_106.png b/romfs/sprites/0_106.png new file mode 100644 index 0000000..2b437d0 Binary files /dev/null and b/romfs/sprites/0_106.png differ diff --git a/romfs/sprites/0_107.png b/romfs/sprites/0_107.png new file mode 100644 index 0000000..43d8a87 Binary files /dev/null and b/romfs/sprites/0_107.png differ diff --git a/romfs/sprites/0_108.png b/romfs/sprites/0_108.png new file mode 100644 index 0000000..18ff4d6 Binary files /dev/null and b/romfs/sprites/0_108.png differ diff --git a/romfs/sprites/0_109.png b/romfs/sprites/0_109.png new file mode 100644 index 0000000..5bb2f32 Binary files /dev/null and b/romfs/sprites/0_109.png differ diff --git a/romfs/sprites/0_11.png b/romfs/sprites/0_11.png new file mode 100644 index 0000000..0235a33 Binary files /dev/null and b/romfs/sprites/0_11.png differ diff --git a/romfs/sprites/0_110.png b/romfs/sprites/0_110.png new file mode 100644 index 0000000..c6fb93c Binary files /dev/null and b/romfs/sprites/0_110.png differ diff --git a/romfs/sprites/0_111.png b/romfs/sprites/0_111.png new file mode 100644 index 0000000..6ca5441 Binary files /dev/null and b/romfs/sprites/0_111.png differ diff --git a/romfs/sprites/0_112.png b/romfs/sprites/0_112.png new file mode 100644 index 0000000..cefb9d6 Binary files /dev/null and b/romfs/sprites/0_112.png differ diff --git a/romfs/sprites/0_113.png b/romfs/sprites/0_113.png new file mode 100644 index 0000000..31d57a0 Binary files /dev/null and b/romfs/sprites/0_113.png differ diff --git a/romfs/sprites/0_114.png b/romfs/sprites/0_114.png new file mode 100644 index 0000000..5205eb5 Binary files /dev/null and b/romfs/sprites/0_114.png differ diff --git a/romfs/sprites/0_115.png b/romfs/sprites/0_115.png new file mode 100644 index 0000000..942660e Binary files /dev/null and b/romfs/sprites/0_115.png differ diff --git a/romfs/sprites/0_116.png b/romfs/sprites/0_116.png new file mode 100644 index 0000000..29735fd Binary files /dev/null and b/romfs/sprites/0_116.png differ diff --git a/romfs/sprites/0_117.png b/romfs/sprites/0_117.png new file mode 100644 index 0000000..08c610d Binary files /dev/null and b/romfs/sprites/0_117.png differ diff --git a/romfs/sprites/0_118.png b/romfs/sprites/0_118.png new file mode 100644 index 0000000..dd69513 Binary files /dev/null and b/romfs/sprites/0_118.png differ diff --git a/romfs/sprites/0_119.png b/romfs/sprites/0_119.png new file mode 100644 index 0000000..f116267 Binary files /dev/null and b/romfs/sprites/0_119.png differ diff --git a/romfs/sprites/0_12.png b/romfs/sprites/0_12.png new file mode 100644 index 0000000..4402818 Binary files /dev/null and b/romfs/sprites/0_12.png differ diff --git a/romfs/sprites/0_120.png b/romfs/sprites/0_120.png new file mode 100644 index 0000000..ed5aa0c Binary files /dev/null and b/romfs/sprites/0_120.png differ diff --git a/romfs/sprites/0_121.png b/romfs/sprites/0_121.png new file mode 100644 index 0000000..76176f0 Binary files /dev/null and b/romfs/sprites/0_121.png differ diff --git a/romfs/sprites/0_122.png b/romfs/sprites/0_122.png new file mode 100644 index 0000000..f8b9e06 Binary files /dev/null and b/romfs/sprites/0_122.png differ diff --git a/romfs/sprites/0_123.png b/romfs/sprites/0_123.png new file mode 100644 index 0000000..aaec9d7 Binary files /dev/null and b/romfs/sprites/0_123.png differ diff --git a/romfs/sprites/0_124.png b/romfs/sprites/0_124.png new file mode 100644 index 0000000..1cc4281 Binary files /dev/null and b/romfs/sprites/0_124.png differ diff --git a/romfs/sprites/0_125.png b/romfs/sprites/0_125.png new file mode 100644 index 0000000..da71e65 Binary files /dev/null and b/romfs/sprites/0_125.png differ diff --git a/romfs/sprites/0_126.png b/romfs/sprites/0_126.png new file mode 100644 index 0000000..9a413bc Binary files /dev/null and b/romfs/sprites/0_126.png differ diff --git a/romfs/sprites/0_127.png b/romfs/sprites/0_127.png new file mode 100644 index 0000000..e456023 Binary files /dev/null and b/romfs/sprites/0_127.png differ diff --git a/romfs/sprites/0_128.png b/romfs/sprites/0_128.png new file mode 100644 index 0000000..0298dd2 Binary files /dev/null and b/romfs/sprites/0_128.png differ diff --git a/romfs/sprites/0_129.png b/romfs/sprites/0_129.png new file mode 100644 index 0000000..b37dc2d Binary files /dev/null and b/romfs/sprites/0_129.png differ diff --git a/romfs/sprites/0_13.png b/romfs/sprites/0_13.png new file mode 100644 index 0000000..e2d7a81 Binary files /dev/null and b/romfs/sprites/0_13.png differ diff --git a/romfs/sprites/0_130.png b/romfs/sprites/0_130.png new file mode 100644 index 0000000..f32b44b Binary files /dev/null and b/romfs/sprites/0_130.png differ diff --git a/romfs/sprites/0_131.png b/romfs/sprites/0_131.png new file mode 100644 index 0000000..b2ee95f Binary files /dev/null and b/romfs/sprites/0_131.png differ diff --git a/romfs/sprites/0_132.png b/romfs/sprites/0_132.png new file mode 100644 index 0000000..4874f62 Binary files /dev/null and b/romfs/sprites/0_132.png differ diff --git a/romfs/sprites/0_133.png b/romfs/sprites/0_133.png new file mode 100644 index 0000000..97b9d1e Binary files /dev/null and b/romfs/sprites/0_133.png differ diff --git a/romfs/sprites/0_134.png b/romfs/sprites/0_134.png new file mode 100644 index 0000000..b2e5912 Binary files /dev/null and b/romfs/sprites/0_134.png differ diff --git a/romfs/sprites/0_135.png b/romfs/sprites/0_135.png new file mode 100644 index 0000000..3d37524 Binary files /dev/null and b/romfs/sprites/0_135.png differ diff --git a/romfs/sprites/0_136.png b/romfs/sprites/0_136.png new file mode 100644 index 0000000..78d3062 Binary files /dev/null and b/romfs/sprites/0_136.png differ diff --git a/romfs/sprites/0_137.png b/romfs/sprites/0_137.png new file mode 100644 index 0000000..1b08f62 Binary files /dev/null and b/romfs/sprites/0_137.png differ diff --git a/romfs/sprites/0_138.png b/romfs/sprites/0_138.png new file mode 100644 index 0000000..d8357f8 Binary files /dev/null and b/romfs/sprites/0_138.png differ diff --git a/romfs/sprites/0_139.png b/romfs/sprites/0_139.png new file mode 100644 index 0000000..5cb871f Binary files /dev/null and b/romfs/sprites/0_139.png differ diff --git a/romfs/sprites/0_14.png b/romfs/sprites/0_14.png new file mode 100644 index 0000000..017e5ad Binary files /dev/null and b/romfs/sprites/0_14.png differ diff --git a/romfs/sprites/0_140.png b/romfs/sprites/0_140.png new file mode 100644 index 0000000..cb5eb08 Binary files /dev/null and b/romfs/sprites/0_140.png differ diff --git a/romfs/sprites/0_141.png b/romfs/sprites/0_141.png new file mode 100644 index 0000000..bf711d4 Binary files /dev/null and b/romfs/sprites/0_141.png differ diff --git a/romfs/sprites/0_142.png b/romfs/sprites/0_142.png new file mode 100644 index 0000000..12c9da9 Binary files /dev/null and b/romfs/sprites/0_142.png differ diff --git a/romfs/sprites/0_143.png b/romfs/sprites/0_143.png new file mode 100644 index 0000000..1ede65f Binary files /dev/null and b/romfs/sprites/0_143.png differ diff --git a/romfs/sprites/0_144.png b/romfs/sprites/0_144.png new file mode 100644 index 0000000..63144ed Binary files /dev/null and b/romfs/sprites/0_144.png differ diff --git a/romfs/sprites/0_145.png b/romfs/sprites/0_145.png new file mode 100644 index 0000000..592f17b Binary files /dev/null and b/romfs/sprites/0_145.png differ diff --git a/romfs/sprites/0_146.png b/romfs/sprites/0_146.png new file mode 100644 index 0000000..20d0a6a Binary files /dev/null and b/romfs/sprites/0_146.png differ diff --git a/romfs/sprites/0_147.png b/romfs/sprites/0_147.png new file mode 100644 index 0000000..45eab12 Binary files /dev/null and b/romfs/sprites/0_147.png differ diff --git a/romfs/sprites/0_148.png b/romfs/sprites/0_148.png new file mode 100644 index 0000000..ecc15d4 Binary files /dev/null and b/romfs/sprites/0_148.png differ diff --git a/romfs/sprites/0_149.png b/romfs/sprites/0_149.png new file mode 100644 index 0000000..a4fb74e Binary files /dev/null and b/romfs/sprites/0_149.png differ diff --git a/romfs/sprites/0_15.png b/romfs/sprites/0_15.png new file mode 100644 index 0000000..2482e6a Binary files /dev/null and b/romfs/sprites/0_15.png differ diff --git a/romfs/sprites/0_150.png b/romfs/sprites/0_150.png new file mode 100644 index 0000000..baddb37 Binary files /dev/null and b/romfs/sprites/0_150.png differ diff --git a/romfs/sprites/0_151.png b/romfs/sprites/0_151.png new file mode 100644 index 0000000..7b3cbdd Binary files /dev/null and b/romfs/sprites/0_151.png differ diff --git a/romfs/sprites/0_152.png b/romfs/sprites/0_152.png new file mode 100644 index 0000000..d5fa945 Binary files /dev/null and b/romfs/sprites/0_152.png differ diff --git a/romfs/sprites/0_153.png b/romfs/sprites/0_153.png new file mode 100644 index 0000000..64d5551 Binary files /dev/null and b/romfs/sprites/0_153.png differ diff --git a/romfs/sprites/0_154.png b/romfs/sprites/0_154.png new file mode 100644 index 0000000..1befd7d Binary files /dev/null and b/romfs/sprites/0_154.png differ diff --git a/romfs/sprites/0_155.png b/romfs/sprites/0_155.png new file mode 100644 index 0000000..963b1e3 Binary files /dev/null and b/romfs/sprites/0_155.png differ diff --git a/romfs/sprites/0_156.png b/romfs/sprites/0_156.png new file mode 100644 index 0000000..b50637c Binary files /dev/null and b/romfs/sprites/0_156.png differ diff --git a/romfs/sprites/0_157.png b/romfs/sprites/0_157.png new file mode 100644 index 0000000..56650ab Binary files /dev/null and b/romfs/sprites/0_157.png differ diff --git a/romfs/sprites/0_158.png b/romfs/sprites/0_158.png new file mode 100644 index 0000000..d7c86e6 Binary files /dev/null and b/romfs/sprites/0_158.png differ diff --git a/romfs/sprites/0_159.png b/romfs/sprites/0_159.png new file mode 100644 index 0000000..a2d3d11 Binary files /dev/null and b/romfs/sprites/0_159.png differ diff --git a/romfs/sprites/0_16.png b/romfs/sprites/0_16.png new file mode 100644 index 0000000..3024d44 Binary files /dev/null and b/romfs/sprites/0_16.png differ diff --git a/romfs/sprites/0_160.png b/romfs/sprites/0_160.png new file mode 100644 index 0000000..b90ce20 Binary files /dev/null and b/romfs/sprites/0_160.png differ diff --git a/romfs/sprites/0_161.png b/romfs/sprites/0_161.png new file mode 100644 index 0000000..b91c063 Binary files /dev/null and b/romfs/sprites/0_161.png differ diff --git a/romfs/sprites/0_162.png b/romfs/sprites/0_162.png new file mode 100644 index 0000000..785b78a Binary files /dev/null and b/romfs/sprites/0_162.png differ diff --git a/romfs/sprites/0_163.png b/romfs/sprites/0_163.png new file mode 100644 index 0000000..aaeb6f8 Binary files /dev/null and b/romfs/sprites/0_163.png differ diff --git a/romfs/sprites/0_164.png b/romfs/sprites/0_164.png new file mode 100644 index 0000000..e10a8ee Binary files /dev/null and b/romfs/sprites/0_164.png differ diff --git a/romfs/sprites/0_165.png b/romfs/sprites/0_165.png new file mode 100644 index 0000000..0796f52 Binary files /dev/null and b/romfs/sprites/0_165.png differ diff --git a/romfs/sprites/0_166.png b/romfs/sprites/0_166.png new file mode 100644 index 0000000..3d61d3e Binary files /dev/null and b/romfs/sprites/0_166.png differ diff --git a/romfs/sprites/0_167.png b/romfs/sprites/0_167.png new file mode 100644 index 0000000..42a9c1e Binary files /dev/null and b/romfs/sprites/0_167.png differ diff --git a/romfs/sprites/0_168.png b/romfs/sprites/0_168.png new file mode 100644 index 0000000..84161ba Binary files /dev/null and b/romfs/sprites/0_168.png differ diff --git a/romfs/sprites/0_169.png b/romfs/sprites/0_169.png new file mode 100644 index 0000000..1165160 Binary files /dev/null and b/romfs/sprites/0_169.png differ diff --git a/romfs/sprites/0_17.png b/romfs/sprites/0_17.png new file mode 100644 index 0000000..1e8d841 Binary files /dev/null and b/romfs/sprites/0_17.png differ diff --git a/romfs/sprites/0_170.png b/romfs/sprites/0_170.png new file mode 100644 index 0000000..9192e34 Binary files /dev/null and b/romfs/sprites/0_170.png differ diff --git a/romfs/sprites/0_171.png b/romfs/sprites/0_171.png new file mode 100644 index 0000000..307c4a0 Binary files /dev/null and b/romfs/sprites/0_171.png differ diff --git a/romfs/sprites/0_172.png b/romfs/sprites/0_172.png new file mode 100644 index 0000000..2807d1d Binary files /dev/null and b/romfs/sprites/0_172.png differ diff --git a/romfs/sprites/0_173.png b/romfs/sprites/0_173.png new file mode 100644 index 0000000..b0a72a7 Binary files /dev/null and b/romfs/sprites/0_173.png differ diff --git a/romfs/sprites/0_174.png b/romfs/sprites/0_174.png new file mode 100644 index 0000000..27d906e Binary files /dev/null and b/romfs/sprites/0_174.png differ diff --git a/romfs/sprites/0_175.png b/romfs/sprites/0_175.png new file mode 100644 index 0000000..2d6e5d4 Binary files /dev/null and b/romfs/sprites/0_175.png differ diff --git a/romfs/sprites/0_176.png b/romfs/sprites/0_176.png new file mode 100644 index 0000000..cec8580 Binary files /dev/null and b/romfs/sprites/0_176.png differ diff --git a/romfs/sprites/0_177.png b/romfs/sprites/0_177.png new file mode 100644 index 0000000..0ca8894 Binary files /dev/null and b/romfs/sprites/0_177.png differ diff --git a/romfs/sprites/0_178.png b/romfs/sprites/0_178.png new file mode 100644 index 0000000..6be0c12 Binary files /dev/null and b/romfs/sprites/0_178.png differ diff --git a/romfs/sprites/0_179.png b/romfs/sprites/0_179.png new file mode 100644 index 0000000..205edae Binary files /dev/null and b/romfs/sprites/0_179.png differ diff --git a/romfs/sprites/0_18.png b/romfs/sprites/0_18.png new file mode 100644 index 0000000..861e2b8 Binary files /dev/null and b/romfs/sprites/0_18.png differ diff --git a/romfs/sprites/0_180.png b/romfs/sprites/0_180.png new file mode 100644 index 0000000..7f60efa Binary files /dev/null and b/romfs/sprites/0_180.png differ diff --git a/romfs/sprites/0_181.png b/romfs/sprites/0_181.png new file mode 100644 index 0000000..c3f1117 Binary files /dev/null and b/romfs/sprites/0_181.png differ diff --git a/romfs/sprites/0_182.png b/romfs/sprites/0_182.png new file mode 100644 index 0000000..09ef689 Binary files /dev/null and b/romfs/sprites/0_182.png differ diff --git a/romfs/sprites/0_183.png b/romfs/sprites/0_183.png new file mode 100644 index 0000000..9617a00 Binary files /dev/null and b/romfs/sprites/0_183.png differ diff --git a/romfs/sprites/0_184.png b/romfs/sprites/0_184.png new file mode 100644 index 0000000..706f129 Binary files /dev/null and b/romfs/sprites/0_184.png differ diff --git a/romfs/sprites/0_185.png b/romfs/sprites/0_185.png new file mode 100644 index 0000000..e8b197d Binary files /dev/null and b/romfs/sprites/0_185.png differ diff --git a/romfs/sprites/0_186.png b/romfs/sprites/0_186.png new file mode 100644 index 0000000..78804fa Binary files /dev/null and b/romfs/sprites/0_186.png differ diff --git a/romfs/sprites/0_187.png b/romfs/sprites/0_187.png new file mode 100644 index 0000000..216fde3 Binary files /dev/null and b/romfs/sprites/0_187.png differ diff --git a/romfs/sprites/0_188.png b/romfs/sprites/0_188.png new file mode 100644 index 0000000..58df289 Binary files /dev/null and b/romfs/sprites/0_188.png differ diff --git a/romfs/sprites/0_189.png b/romfs/sprites/0_189.png new file mode 100644 index 0000000..2430d72 Binary files /dev/null and b/romfs/sprites/0_189.png differ diff --git a/romfs/sprites/0_19.png b/romfs/sprites/0_19.png new file mode 100644 index 0000000..7ea12c2 Binary files /dev/null and b/romfs/sprites/0_19.png differ diff --git a/romfs/sprites/0_190.png b/romfs/sprites/0_190.png new file mode 100644 index 0000000..baf2fce Binary files /dev/null and b/romfs/sprites/0_190.png differ diff --git a/romfs/sprites/0_191.png b/romfs/sprites/0_191.png new file mode 100644 index 0000000..3be6549 Binary files /dev/null and b/romfs/sprites/0_191.png differ diff --git a/romfs/sprites/0_192.png b/romfs/sprites/0_192.png new file mode 100644 index 0000000..81f8b36 Binary files /dev/null and b/romfs/sprites/0_192.png differ diff --git a/romfs/sprites/0_193.png b/romfs/sprites/0_193.png new file mode 100644 index 0000000..f1a811e Binary files /dev/null and b/romfs/sprites/0_193.png differ diff --git a/romfs/sprites/0_194.png b/romfs/sprites/0_194.png new file mode 100644 index 0000000..02b1bcf Binary files /dev/null and b/romfs/sprites/0_194.png differ diff --git a/romfs/sprites/0_195.png b/romfs/sprites/0_195.png new file mode 100644 index 0000000..59734c8 Binary files /dev/null and b/romfs/sprites/0_195.png differ diff --git a/romfs/sprites/0_196.png b/romfs/sprites/0_196.png new file mode 100644 index 0000000..d53f349 Binary files /dev/null and b/romfs/sprites/0_196.png differ diff --git a/romfs/sprites/0_197.png b/romfs/sprites/0_197.png new file mode 100644 index 0000000..9540e47 Binary files /dev/null and b/romfs/sprites/0_197.png differ diff --git a/romfs/sprites/0_198.png b/romfs/sprites/0_198.png new file mode 100644 index 0000000..4ed2b99 Binary files /dev/null and b/romfs/sprites/0_198.png differ diff --git a/romfs/sprites/0_20.png b/romfs/sprites/0_20.png new file mode 100644 index 0000000..0428005 Binary files /dev/null and b/romfs/sprites/0_20.png differ diff --git a/romfs/sprites/0_21.png b/romfs/sprites/0_21.png new file mode 100644 index 0000000..25722e4 Binary files /dev/null and b/romfs/sprites/0_21.png differ diff --git a/romfs/sprites/0_22.png b/romfs/sprites/0_22.png new file mode 100644 index 0000000..11d622e Binary files /dev/null and b/romfs/sprites/0_22.png differ diff --git a/romfs/sprites/0_23.png b/romfs/sprites/0_23.png new file mode 100644 index 0000000..92ee1f1 Binary files /dev/null and b/romfs/sprites/0_23.png differ diff --git a/romfs/sprites/0_24.png b/romfs/sprites/0_24.png new file mode 100644 index 0000000..b75dde9 Binary files /dev/null and b/romfs/sprites/0_24.png differ diff --git a/romfs/sprites/0_25.png b/romfs/sprites/0_25.png new file mode 100644 index 0000000..a2b1b03 Binary files /dev/null and b/romfs/sprites/0_25.png differ diff --git a/romfs/sprites/0_26.png b/romfs/sprites/0_26.png new file mode 100644 index 0000000..5a2f064 Binary files /dev/null and b/romfs/sprites/0_26.png differ diff --git a/romfs/sprites/0_27.png b/romfs/sprites/0_27.png new file mode 100644 index 0000000..2be4a2a Binary files /dev/null and b/romfs/sprites/0_27.png differ diff --git a/romfs/sprites/0_28.png b/romfs/sprites/0_28.png new file mode 100644 index 0000000..67317b1 Binary files /dev/null and b/romfs/sprites/0_28.png differ diff --git a/romfs/sprites/0_29.png b/romfs/sprites/0_29.png new file mode 100644 index 0000000..2e26754 Binary files /dev/null and b/romfs/sprites/0_29.png differ diff --git a/romfs/sprites/0_30.png b/romfs/sprites/0_30.png new file mode 100644 index 0000000..a7503b5 Binary files /dev/null and b/romfs/sprites/0_30.png differ diff --git a/romfs/sprites/0_31.png b/romfs/sprites/0_31.png new file mode 100644 index 0000000..d2bb8c5 Binary files /dev/null and b/romfs/sprites/0_31.png differ diff --git a/romfs/sprites/0_32.png b/romfs/sprites/0_32.png new file mode 100644 index 0000000..d87aa40 Binary files /dev/null and b/romfs/sprites/0_32.png differ diff --git a/romfs/sprites/0_33.png b/romfs/sprites/0_33.png new file mode 100644 index 0000000..3225e71 Binary files /dev/null and b/romfs/sprites/0_33.png differ diff --git a/romfs/sprites/0_34.png b/romfs/sprites/0_34.png new file mode 100644 index 0000000..ec8833e Binary files /dev/null and b/romfs/sprites/0_34.png differ diff --git a/romfs/sprites/0_35.png b/romfs/sprites/0_35.png new file mode 100644 index 0000000..a438664 Binary files /dev/null and b/romfs/sprites/0_35.png differ diff --git a/romfs/sprites/0_36.png b/romfs/sprites/0_36.png new file mode 100644 index 0000000..19307a0 Binary files /dev/null and b/romfs/sprites/0_36.png differ diff --git a/romfs/sprites/0_37.png b/romfs/sprites/0_37.png new file mode 100644 index 0000000..b6c67c9 Binary files /dev/null and b/romfs/sprites/0_37.png differ diff --git a/romfs/sprites/0_38.png b/romfs/sprites/0_38.png new file mode 100644 index 0000000..6964de4 Binary files /dev/null and b/romfs/sprites/0_38.png differ diff --git a/romfs/sprites/0_39.png b/romfs/sprites/0_39.png new file mode 100644 index 0000000..ff5ffd4 Binary files /dev/null and b/romfs/sprites/0_39.png differ diff --git a/romfs/sprites/0_40.png b/romfs/sprites/0_40.png new file mode 100644 index 0000000..0022015 Binary files /dev/null and b/romfs/sprites/0_40.png differ diff --git a/romfs/sprites/0_41.png b/romfs/sprites/0_41.png new file mode 100644 index 0000000..34a54dd Binary files /dev/null and b/romfs/sprites/0_41.png differ diff --git a/romfs/sprites/0_42.png b/romfs/sprites/0_42.png new file mode 100644 index 0000000..477fa26 Binary files /dev/null and b/romfs/sprites/0_42.png differ diff --git a/romfs/sprites/0_43.png b/romfs/sprites/0_43.png new file mode 100644 index 0000000..4d352dc Binary files /dev/null and b/romfs/sprites/0_43.png differ diff --git a/romfs/sprites/0_44.png b/romfs/sprites/0_44.png new file mode 100644 index 0000000..474f0a0 Binary files /dev/null and b/romfs/sprites/0_44.png differ diff --git a/romfs/sprites/0_45.png b/romfs/sprites/0_45.png new file mode 100644 index 0000000..73d0ba2 Binary files /dev/null and b/romfs/sprites/0_45.png differ diff --git a/romfs/sprites/0_46.png b/romfs/sprites/0_46.png new file mode 100644 index 0000000..9656692 Binary files /dev/null and b/romfs/sprites/0_46.png differ diff --git a/romfs/sprites/0_47.png b/romfs/sprites/0_47.png new file mode 100644 index 0000000..aceb251 Binary files /dev/null and b/romfs/sprites/0_47.png differ diff --git a/romfs/sprites/0_48.png b/romfs/sprites/0_48.png new file mode 100644 index 0000000..4dfa4cd Binary files /dev/null and b/romfs/sprites/0_48.png differ diff --git a/romfs/sprites/0_49.png b/romfs/sprites/0_49.png new file mode 100644 index 0000000..241de86 Binary files /dev/null and b/romfs/sprites/0_49.png differ diff --git a/romfs/sprites/0_50.png b/romfs/sprites/0_50.png new file mode 100644 index 0000000..3e63a69 Binary files /dev/null and b/romfs/sprites/0_50.png differ diff --git a/romfs/sprites/0_51.png b/romfs/sprites/0_51.png new file mode 100644 index 0000000..8beca19 Binary files /dev/null and b/romfs/sprites/0_51.png differ diff --git a/romfs/sprites/0_52.png b/romfs/sprites/0_52.png new file mode 100644 index 0000000..13d65e6 Binary files /dev/null and b/romfs/sprites/0_52.png differ diff --git a/romfs/sprites/0_53.png b/romfs/sprites/0_53.png new file mode 100644 index 0000000..1a61ec1 Binary files /dev/null and b/romfs/sprites/0_53.png differ diff --git a/romfs/sprites/0_54.png b/romfs/sprites/0_54.png new file mode 100644 index 0000000..19aa62b Binary files /dev/null and b/romfs/sprites/0_54.png differ diff --git a/romfs/sprites/0_55.png b/romfs/sprites/0_55.png new file mode 100644 index 0000000..e9a4bac Binary files /dev/null and b/romfs/sprites/0_55.png differ diff --git a/romfs/sprites/0_56.png b/romfs/sprites/0_56.png new file mode 100644 index 0000000..feb4741 Binary files /dev/null and b/romfs/sprites/0_56.png differ diff --git a/romfs/sprites/0_57.png b/romfs/sprites/0_57.png new file mode 100644 index 0000000..567a052 Binary files /dev/null and b/romfs/sprites/0_57.png differ diff --git a/romfs/sprites/0_58.png b/romfs/sprites/0_58.png new file mode 100644 index 0000000..3374f92 Binary files /dev/null and b/romfs/sprites/0_58.png differ diff --git a/romfs/sprites/0_59.png b/romfs/sprites/0_59.png new file mode 100644 index 0000000..1650b50 Binary files /dev/null and b/romfs/sprites/0_59.png differ diff --git a/romfs/sprites/0_60.png b/romfs/sprites/0_60.png new file mode 100644 index 0000000..f9c77f8 Binary files /dev/null and b/romfs/sprites/0_60.png differ diff --git a/romfs/sprites/0_61.png b/romfs/sprites/0_61.png new file mode 100644 index 0000000..acb1f97 Binary files /dev/null and b/romfs/sprites/0_61.png differ diff --git a/romfs/sprites/0_62.png b/romfs/sprites/0_62.png new file mode 100644 index 0000000..ce8b545 Binary files /dev/null and b/romfs/sprites/0_62.png differ diff --git a/romfs/sprites/0_63.png b/romfs/sprites/0_63.png new file mode 100644 index 0000000..7f5f0f9 Binary files /dev/null and b/romfs/sprites/0_63.png differ diff --git a/romfs/sprites/0_64.png b/romfs/sprites/0_64.png new file mode 100644 index 0000000..65e7ca5 Binary files /dev/null and b/romfs/sprites/0_64.png differ diff --git a/romfs/sprites/0_65.png b/romfs/sprites/0_65.png new file mode 100644 index 0000000..93f3463 Binary files /dev/null and b/romfs/sprites/0_65.png differ diff --git a/romfs/sprites/0_66.png b/romfs/sprites/0_66.png new file mode 100644 index 0000000..a0819a7 Binary files /dev/null and b/romfs/sprites/0_66.png differ diff --git a/romfs/sprites/0_67.png b/romfs/sprites/0_67.png new file mode 100644 index 0000000..931c1fc Binary files /dev/null and b/romfs/sprites/0_67.png differ diff --git a/romfs/sprites/0_68.png b/romfs/sprites/0_68.png new file mode 100644 index 0000000..3c62b5f Binary files /dev/null and b/romfs/sprites/0_68.png differ diff --git a/romfs/sprites/0_69.png b/romfs/sprites/0_69.png new file mode 100644 index 0000000..29e55f1 Binary files /dev/null and b/romfs/sprites/0_69.png differ diff --git a/romfs/sprites/0_70.png b/romfs/sprites/0_70.png new file mode 100644 index 0000000..fc472cd Binary files /dev/null and b/romfs/sprites/0_70.png differ diff --git a/romfs/sprites/0_71.png b/romfs/sprites/0_71.png new file mode 100644 index 0000000..002c2d6 Binary files /dev/null and b/romfs/sprites/0_71.png differ diff --git a/romfs/sprites/0_72.png b/romfs/sprites/0_72.png new file mode 100644 index 0000000..f30d16a Binary files /dev/null and b/romfs/sprites/0_72.png differ diff --git a/romfs/sprites/0_73.png b/romfs/sprites/0_73.png new file mode 100644 index 0000000..4dcabfa Binary files /dev/null and b/romfs/sprites/0_73.png differ diff --git a/romfs/sprites/0_74.png b/romfs/sprites/0_74.png new file mode 100644 index 0000000..bad6cec Binary files /dev/null and b/romfs/sprites/0_74.png differ diff --git a/romfs/sprites/0_75.png b/romfs/sprites/0_75.png new file mode 100644 index 0000000..2289321 Binary files /dev/null and b/romfs/sprites/0_75.png differ diff --git a/romfs/sprites/0_76.png b/romfs/sprites/0_76.png new file mode 100644 index 0000000..6612a75 Binary files /dev/null and b/romfs/sprites/0_76.png differ diff --git a/romfs/sprites/0_77.png b/romfs/sprites/0_77.png new file mode 100644 index 0000000..e361558 Binary files /dev/null and b/romfs/sprites/0_77.png differ diff --git a/romfs/sprites/0_78.png b/romfs/sprites/0_78.png new file mode 100644 index 0000000..e27a735 Binary files /dev/null and b/romfs/sprites/0_78.png differ diff --git a/romfs/sprites/0_79.png b/romfs/sprites/0_79.png new file mode 100644 index 0000000..bd2847a Binary files /dev/null and b/romfs/sprites/0_79.png differ diff --git a/romfs/sprites/0_80.png b/romfs/sprites/0_80.png new file mode 100644 index 0000000..6ae592d Binary files /dev/null and b/romfs/sprites/0_80.png differ diff --git a/romfs/sprites/0_81.png b/romfs/sprites/0_81.png new file mode 100644 index 0000000..0739c13 Binary files /dev/null and b/romfs/sprites/0_81.png differ diff --git a/romfs/sprites/0_82.png b/romfs/sprites/0_82.png new file mode 100644 index 0000000..9a90172 Binary files /dev/null and b/romfs/sprites/0_82.png differ diff --git a/romfs/sprites/0_83.png b/romfs/sprites/0_83.png new file mode 100644 index 0000000..932574d Binary files /dev/null and b/romfs/sprites/0_83.png differ diff --git a/romfs/sprites/0_84.png b/romfs/sprites/0_84.png new file mode 100644 index 0000000..0f0324a Binary files /dev/null and b/romfs/sprites/0_84.png differ diff --git a/romfs/sprites/0_85.png b/romfs/sprites/0_85.png new file mode 100644 index 0000000..55e0c6c Binary files /dev/null and b/romfs/sprites/0_85.png differ diff --git a/romfs/sprites/0_86.png b/romfs/sprites/0_86.png new file mode 100644 index 0000000..9da5e8a Binary files /dev/null and b/romfs/sprites/0_86.png differ diff --git a/romfs/sprites/0_87.png b/romfs/sprites/0_87.png new file mode 100644 index 0000000..87a4394 Binary files /dev/null and b/romfs/sprites/0_87.png differ diff --git a/romfs/sprites/0_88.png b/romfs/sprites/0_88.png new file mode 100644 index 0000000..c4f376e Binary files /dev/null and b/romfs/sprites/0_88.png differ diff --git a/romfs/sprites/0_89.png b/romfs/sprites/0_89.png new file mode 100644 index 0000000..bfbffac Binary files /dev/null and b/romfs/sprites/0_89.png differ diff --git a/romfs/sprites/0_90.png b/romfs/sprites/0_90.png new file mode 100644 index 0000000..874d77b Binary files /dev/null and b/romfs/sprites/0_90.png differ diff --git a/romfs/sprites/0_91.png b/romfs/sprites/0_91.png new file mode 100644 index 0000000..b8c2e5a Binary files /dev/null and b/romfs/sprites/0_91.png differ diff --git a/romfs/sprites/0_92.png b/romfs/sprites/0_92.png new file mode 100644 index 0000000..20a246d Binary files /dev/null and b/romfs/sprites/0_92.png differ diff --git a/romfs/sprites/0_93.png b/romfs/sprites/0_93.png new file mode 100644 index 0000000..f220fd5 Binary files /dev/null and b/romfs/sprites/0_93.png differ diff --git a/romfs/sprites/0_94.png b/romfs/sprites/0_94.png new file mode 100644 index 0000000..1566463 Binary files /dev/null and b/romfs/sprites/0_94.png differ diff --git a/romfs/sprites/0_95.png b/romfs/sprites/0_95.png new file mode 100644 index 0000000..798fbef Binary files /dev/null and b/romfs/sprites/0_95.png differ diff --git a/romfs/sprites/0_96.png b/romfs/sprites/0_96.png new file mode 100644 index 0000000..cba0e4d Binary files /dev/null and b/romfs/sprites/0_96.png differ diff --git a/romfs/sprites/0_97.png b/romfs/sprites/0_97.png new file mode 100644 index 0000000..69366c4 Binary files /dev/null and b/romfs/sprites/0_97.png differ diff --git a/romfs/sprites/0_98.png b/romfs/sprites/0_98.png new file mode 100644 index 0000000..335f0c5 Binary files /dev/null and b/romfs/sprites/0_98.png differ diff --git a/romfs/sprites/0_99.png b/romfs/sprites/0_99.png new file mode 100644 index 0000000..0fc023b Binary files /dev/null and b/romfs/sprites/0_99.png differ diff --git a/source/MainMenu.c b/source/MainMenu.c new file mode 100644 index 0000000..e913492 --- /dev/null +++ b/source/MainMenu.c @@ -0,0 +1,363 @@ +#include "MainMenu.h" + + +void selectSlotMenu(int slotchar){ + + SDL_ClearScreen(renderer, BACKGROUND_COLOR); + SDL_DrawRect(renderer,0,0,1280, 88, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,87,1220,2, WHITE_COLOR); + SDL_DrawRect(renderer,0,648,1280,72, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR); + SDL_DrawText(Arial, 110, 27, WHITE_TEXT_COLOR, "Breath of the Wild Editor"); + + SDL_DrawRect(renderer,380,248,517,167, LEFTBAR_COLOR); + SDL_DrawText(Arial_S,554,300, WHITE_TEXT_COLOR, "Select File Slot:"); + + char slotc[2]; + snprintf(slotc, sizeof slotc, "%d", slotchar); + SDL_DrawText(Arial_S, 632, 330, WHITE_TEXT_COLOR, slotc); + SDL_RenderPresent(renderer); +} + + +void exitMenu(int pos){ + + SDL_DrawRect(renderer, 380, 250, 520, 220, ALERT_COLOR); + SDL_DrawText(Arial, 510, 300, WHITE_TEXT_COLOR, "Save Changes?"); + SDL_DrawText(Arial_M, 450, 350, WHITE_TEXT_COLOR, "A: Save X: Discard B: Return"); + SDL_RenderPresent(renderer); + +} + +void KeyboardScreen(){ + SDL_DrawImage(renderer, back, 0, 0, 1280, 720); + SDL_DrawRect(renderer, 120, 30, 1040, 210, WHITE_COLOR); + SDL_DrawRect(renderer, 122, 32, 1036, 206, BACKGROUND_COLOR); + SDL_DrawRect(renderer, 0,270,1280,450, LEFTBAR_COLOR); + SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR); + SDL_RenderPresent(renderer); + showKeyboard(0); +} + +void errorScreen(){ + + SDL_ClearScreen(renderer, BACKGROUND_COLOR); + SDL_DrawRect(renderer,0,0,1280, 88, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,87,1220,2, WHITE_COLOR); + SDL_DrawRect(renderer,0,648,1280,72, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR); + SDL_DrawText(Arial, 110, 27, WHITE_TEXT_COLOR, "Breath of the Wild Editor"); + SDL_DrawRect(renderer,380,248,517,167, LEFTBAR_COLOR); + SDL_DrawText(Arial_S,440,280, WHITE_TEXT_COLOR, "Error while mounting save directory!"); + SDL_DrawText(Arial_S,480,320, WHITE_TEXT_COLOR, "(Try launching BOTW before)"); + SDL_RenderPresent(renderer); +} + + +void showCurrentRup(){ + + SDL_DrawImage(renderer, GreenRupee, 1077, 18, 35, 55); + char rupString[10]; + snprintf(rupString, sizeof rupString, " : %d", rupeeValue); + SDL_DrawText(Arial_S, 1112, 33, WHITE_TEXT_COLOR, rupString); + + +} + + +void printText(int textNum){ + SDL_DrawRect(renderer, 122, 32, 1036, 206, BACKGROUND_COLOR); + char tmpstring[8]; + snprintf(tmpstring, sizeof tmpstring, "%d", textNum); + SDL_DrawText(Arial, 125, 110, WHITE_TEXT_COLOR, tmpstring); + SDL_RenderPresent(renderer); +} + +void mainUI(int x, int currentPage, int maxPage, int showBox, int BoxPos){ + + SDL_ClearScreen(renderer, BACKGROUND_COLOR); + SDL_DrawRect(renderer,0,0,1280, 88, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,87,1220,2, WHITE_COLOR); + SDL_DrawRect(renderer,0,89,410,560, LEFTBAR_COLOR); + SDL_DrawRect(renderer,410,89,880,560, TOPBAR_COLOR); + SDL_DrawRect(renderer,0,648,1280,72, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR); + SDL_DrawText(Arial, 110, 27, WHITE_TEXT_COLOR, "Breath of the Wild Editor"); + + setMenuItems(x, currentPage); + + showCurrentRup(); + + setPageBar(currentPage, maxPage); + + if(showBox){ + showBoxSelect(BoxPos); + } + + int selectedItem = (5 * (currentPage - 1) + x); + + isArrow = 0; + + for(int i = 0; i < 6; i++){ + if(getIDNumber(itemName[selectedItem]) >= 192){ + isArrow = 1; + break; + } + } + + if(isArrow && newQuantItems[selectedItem] >= 999){ + newQuantItems[selectedItem] = 999; + } + + if(selectedItem <= numberOfItems - 1){ + showItemSDL(selectedItem, isArrow); + } + SDL_RenderPresent(renderer); +} + + +void showKeyboard(int currentKey){ + + char populateKeyboard[9][2] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"}; + + for(int y = 0; y < 3; y++){ + for(int x = 0; x < 3; x++){ + + if((x + (y * 3)) == currentKey){ + SDL_DrawRect(renderer, 470 + (x * 110), 300 + (y * 80), 105, 75, TOPBAR_COLOR); + SDL_DrawText(Arial, 510 + (x * 110), 320 + (y * 80), BLUE_TEXT_COLOR, populateKeyboard[x + (y * 3)]); + } + else{ + SDL_DrawRect(renderer, 470 + (x * 110), 300 + (y * 80), 105, 75, ITEM_COLOR); + SDL_DrawText(Arial, 510 + (x * 110), 320 + (y * 80), WHITE_TEXT_COLOR, populateKeyboard[x + (y * 3)]); + } + + } + } + + if(currentKey == 9){ + SDL_DrawImage(renderer, bbuttonp, 470, 540, 105, 75); + } + else{ + SDL_DrawImage(renderer, bbutton, 470, 540, 105, 75); + } + + if(currentKey == 11){ + SDL_DrawImage(renderer, okbuttonp, 690, 540, 105, 75); + } + else{ + SDL_DrawImage(renderer, okbutton, 690, 540, 105, 75); + } + + if(currentKey == 10){ + SDL_DrawRect(renderer, 580, 540, 105, 75, TOPBAR_COLOR); + SDL_DrawText(Arial, 620, 560, BLUE_TEXT_COLOR, "0"); + } + else{ + SDL_DrawRect(renderer, 580, 540, 105, 75, ITEM_COLOR); + SDL_DrawText(Arial, 620, 560, WHITE_TEXT_COLOR, "0"); + } + + + + + SDL_RenderPresent(renderer); + + +} + + +void showBoxSelect(int pos){ + if(pos == 1){ + SDL_DrawRect(renderer, 465, 237, 760, 70, BLUE_TEXT_COLOR); + SDL_DrawRect(renderer, 470, 240, 750, 60, TOPBAR_COLOR); + } + if(pos == 2){ + SDL_DrawRect(renderer, 465, 317, 760, 70, BLUE_TEXT_COLOR); + SDL_DrawRect(renderer, 470, 320, 750, 60, TOPBAR_COLOR); + } + +} + + + + +void showItemSDL(int currentItem, int arrow){ + + SDL_DrawRect(renderer, 470, 140, 750, 3, LEFTBAR_COLOR); + SDL_DrawText(Arial, 480, 150, WHITE_TEXT_COLOR, translate(itemName[currentItem])); + SDL_DrawRect(renderer, 470, 200, 750, 3, LEFTBAR_COLOR); + + char value[25]; + snprintf(value, sizeof value, "%d", newQuantItems[currentItem]); + + SDL_DrawRect(renderer, 470, 240, 750, 3, LEFTBAR_COLOR); + SDL_DrawText(Arial_M, 480, 252, WHITE_TEXT_COLOR, "Quantity"); + SDL_DrawText(Arial_M, 1100, 252, BLUE_TEXT_COLOR, value); + SDL_DrawRect(renderer, 470, 300, 750, 3, LEFTBAR_COLOR); + + char othervalue[25]; + if(strcmp(translateMods(new_modNames[currentItem]), "(none)")==0){ + new_quantMod[currentItem] = 0; + } + snprintf(othervalue, sizeof othervalue, "%d", new_quantMod[currentItem]); + + if(arrow == 0){ + SDL_DrawRect(renderer, 470, 320, 750, 3, LEFTBAR_COLOR); + SDL_DrawText(Arial_M, 480, 332, WHITE_TEXT_COLOR, translateMods(new_modNames[currentItem])); + SDL_DrawText(Arial_M, 1100, 332, BLUE_TEXT_COLOR, othervalue); + SDL_DrawRect(renderer, 470, 380, 750, 3, LEFTBAR_COLOR); + } + + + +} + + +void Show_DropDownMenu(int pos){ + SDL_DrawRect(renderer,0,360,1280,360, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,432,1220,2, WHITE_COLOR); + SDL_DrawRect(renderer,300,540,620,2, WHITE_TEXT_COLOR); + SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR); + + if(pos == 1){ + SDL_DrawRect(renderer, 300, 440, 620, 98, BLUE_TEXT_COLOR); + SDL_DrawRect(renderer, 304, 444, 612, 90, TOPBAR_COLOR); + } + else if(pos == 2){ + SDL_DrawRect(renderer, 300, 548, 620, 98, BLUE_TEXT_COLOR); + SDL_DrawRect(renderer, 304, 552, 612, 90, TOPBAR_COLOR); + } + SDL_DrawText(Arial_M, 500, 475, WHITE_TEXT_COLOR, "Edit Modifier"); + SDL_DrawText(Arial_M, 500, 580, WHITE_TEXT_COLOR, "Edit Quantity"); + + SDL_RenderPresent(renderer); + +} + +void Show_DropDownMenuMod(int pos){ + + SDL_ClearScreen(renderer, BACKGROUND_COLOR); + + SDL_DrawRect(renderer,0,0,1280, 88, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,87,1220,2, WHITE_COLOR); + SDL_DrawRect(renderer,0,648,1280,72, TOPBAR_COLOR); + SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR); + SDL_DrawText(Arial, 110, 27, WHITE_TEXT_COLOR, "Breath of the Wild Editor"); + + int offset = 95; + + char modifierNames[17][28] = { + "(none)", + "Attack up", + "Attack up *", + "Durability up", + "Durability up *", + "Critical hit up", + "Critical hit up*", + "Long throw * (Weapon)", + "Long throw * (Weapon)", + "Five-Shot Burst (Bow)", + "Five-Shot Burst* (Bow)", + "Quick shot (Bow)", + "Quick shot * (Bow)", + "Shield surf up (Shield)", + "Shield surf up * (Shield)", + "Shield guard up (Shield)", + "Shield guard up * (Shield)" + }; + + for(int x = 0; x < 17; x++){ + if(x == pos){ + SDL_DrawImage(renderer, check, 50, offset + (x * 32), 32, 32); + SDL_DrawText(Arial_M, 100, offset + (x * 32), BLUE_TEXT_COLOR, modifierNames[x]); + } + else{ + SDL_DrawText(Arial_M, 100, offset + (x * 32), WHITE_TEXT_COLOR, modifierNames[x]); + } + } + + SDL_RenderPresent(renderer); + +} + + + +void SDL_ClearScreen(SDL_Renderer* renderer, SDL_Color colour) +{ + SDL_SetRenderDrawColor(renderer, colour.r, colour.g, colour.b, 255); + SDL_RenderClear(renderer); +} + +void setPageBar(int page, int mPage){ + char pageText[15]; + snprintf(pageText, sizeof pageText, "Page (%d/%d)", page, mPage); + SDL_DrawText(Arial_S, 30, 670, WHITE_TEXT_COLOR, pageText); +} + +void setMenuItems(int active, int page){ + + int offset = 100; + for(int x = 0; x < 5; x++) + { + + + if(((5 * (page - 1)) + x) < numberOfItems){ + if(x == active){ + SDL_DrawRect(renderer, 30, 25 + (offset * (x+1)), 5, 80, BLUE_TEXT_COLOR); + SDL_DrawText(Arial_S, 120, offset * (x+1) + 50,BLUE_TEXT_COLOR, translate(itemName[(5 * (page - 1)) + x])); + + } + else{ + //SDL_DrawRect(renderer, 25, 25 + (offset * (x+1)), 350, 80, ITEM_COLOR); + SDL_DrawText(Arial_S, 120, offset * (x+1) + 50,WHITE_TEXT_COLOR, translate(itemName[(5 * (page - 1)) + x])); + } + + SDL_DrawImage(renderer, sprites[getIDNumber(itemName[(5 * (page - 1)) + x])], 50, 35 + (offset * (x+1)) , 50, 50); + } + + + } + +} + +SDL_Surface *SDL_LoadImage(SDL_Renderer* renderer, SDL_Texture **texture, char *path) +{ + SDL_Surface *loaded_surface = NULL; + loaded_surface = IMG_Load(path); + + if (loaded_surface) + { + Uint32 colorkey = SDL_MapRGB(loaded_surface->format, 0, 0, 0); + SDL_SetColorKey(loaded_surface, SDL_TRUE, colorkey); + *texture = SDL_CreateTextureFromSurface(renderer, loaded_surface); + } + + SDL_FreeSurface(loaded_surface); +} + +void SDL_DrawImage(SDL_Renderer* renderer, SDL_Texture *texture, int x, int y, int w, int h) +{ + SDL_Rect viewport; + viewport.x = x; viewport.y = y; viewport.w = w; viewport.h = h; + SDL_RenderCopy(renderer, texture, NULL, &viewport); +} + + +void SDL_DrawRect(SDL_Renderer* renderer, int x, int y, int w, int h, SDL_Color colour) +{ + SDL_Rect rect; + rect.x = x; rect.y = y; rect.w = w; rect.h = h; + SDL_SetRenderDrawColor(renderer, colour.r, colour.g, colour.b, 255); + SDL_RenderFillRect(renderer, &rect); +} + +void SDL_DrawText(TTF_Font *font, int x, int y, SDL_Color colour, const char *text) +{ + SDL_Surface *surface = TTF_RenderText_Blended_Wrapped(font, text, colour, 1280); + SDL_SetSurfaceAlphaMod(surface, 255); + SDL_Rect position = {x, y, surface->w, surface->h}; + SDL_BlitSurface(surface, NULL, screenSurface, &position); + SDL_FreeSurface(surface); +} + diff --git a/source/botw_backend.c b/source/botw_backend.c new file mode 100644 index 0000000..dc3208c --- /dev/null +++ b/source/botw_backend.c @@ -0,0 +1,196 @@ +#include "botw_backend.h" + +int rupID[7] = {0x00e0a0, 0x00e110, 0x00e110, 0x00e678, 0x00e730, 0x00eaf8, 0x00eaf8}; +int itemsID[7] = {0x052828, 0x0528d8, 0x0528c0, 0x053890, 0x05fa48, 0x060408, 0x060408}; +int itemsQuant[7] = {0x063340, 0x0633f0, 0x0633d8, 0x064550, 0x070730, 0x0711c8, 0x0711c8}; +int header[7] = {0x24e2, 0x24ee, 0x2588, 0x29c0, 0x3ef8, 0x471a, 0x471b}; +int FLAGS_WEAPON[7] = {0x050328, 0x0503d8, 0x0503c0, 0x051270, 0x05d420, 0x05dd20, 0x05dd20}; +int FLAGSV_WEAPON[7] = {0x0a9ca8, 0x0a9d78, 0x0a9d58, 0x0ab8d0, 0x0c3bd8, 0x0c4c68, 0x0c4c68}; +int FLAGS_BOW[7]={0x0045f0, 0x0045f8, 0x0045f8, 0x0047e8, 0x004828, 0x004990, 0x004990}; +int FLAGSV_BOW[7]={0x00a8e0, 0x00a940, 0x00a940, 0x00ae08, 0x00ae90, 0x00b1e0, 0x00b1e0}; +int FLAGSV_SHIELD[7]={0x063218, 0x0632c8, 0x0632b0, 0x064420, 0x070600, 0x071098, 0x071098}; +int FLAGS_SHIELD[7]={0x0b5810, 0x0b58e8, 0x0b58c8, 0x0b7910, 0x0cfc70, 0x0d1038, 0x0d1038}; + +void writeFile(){ + + if(rupeeValue != rupees){ + fseek(fp,rupID[version],SEEK_SET); + fwrite(&rupeeValue, sizeof(long int), 1, fp); + } + + for(int x = 0; x < numberOfItems; x++){ + if(newQuantItems[x] != quantItems[x]){ + fseek(fp, itemsQuant[version] + (8 * x),SEEK_SET); + fwrite(&newQuantItems[x], sizeof(int), 1, fp); + } + } + + for(int x = 0; x= 4){ + keyboardy = 0; + } + break; + case 2: + keyboard++; + if(keyboard >= 3){ + keyboard = 0; + } + break; + case 3: + keyboard--; + if(keyboard <= -1){ + keyboard = 2; + } + break; + } + + key = keyboard + (keyboardy * 3); + showKeyboard(key); + +} + +void MenuButtonsSlot(int x){ + + switch(x){ + case 2: + slot++; + if(slot == 6) + slot = 0; + break; + case 3: + slot--; + if(slot == -1) + slot = 5; + break; + } + + selectSlotMenu(slot); + +} + +void ConfirmButton(){ + long int modifiers[17] = { + 0x00000000, + 0x00000001, + 0x80000001, + 0x00000002, + 0x80000002, + 0x00000004, + 0x80000004, + 0x00000008, + 0x80000008, + 0x00000010, + 0x80000010, + 0x00000040, + 0x80000040, + 0x00000080, + 0x80000080, + 0x00000100, + 0x80000100 + }; + + switch(currentState){ + case 0: + if(setFile(slot)){ + setPages(); + currentState++; + mainUI(buttons, currentPage, maxPage,0,0); + } + else{ + currentState = -1; + errorScreen(); + } + break; + case 1: + //showKeyboard(0); + itemBox = 1; + mainUI(buttons, currentPage, maxPage,1,1); + currentState++; + break; + case 2: + if(itemBox == 1){ + currentState = 8; + keyboard = 0; + keyboardy = 0; + KeyboardScreen(); + isopen = 1; + } + if(itemBox == 2){ + itemBox = 1; + Show_DropDownMenu(1); + currentState++; + } + break; + + case 3: + if(itemBox == 1){ + Show_DropDownMenuMod(0); + drop = 0; + currentState++; + } + else if(itemBox == 2){ + currentState = 9; + keyboard = 0; + keyboardy = 0; + KeyboardScreen(); + isopen = 1; + } + break; + case 4: + + new_modNames[currentItem] = modifiers[drop]; + currentState = 2; + mainUI(buttons, currentPage, maxPage,1,1); + break; + + case 7: + KeyboardLogic(); + if(key == 11){ + rupeeValue = number; + currentState = 1; + mainUI(buttons, currentPage, maxPage,0,0); + isopen = 0; + positionKey = 0; + key = 0; + str[positionKey] = '\0'; + + } + + break; + + case 8: + KeyboardLogic(); + if(key == 11){ + newQuantItems[currentItem] = number; + currentState = 2; + mainUI(buttons, currentPage, maxPage,1,1); + isopen = 0; + positionKey = 0; + key = 0; + str[positionKey] = '\0'; + + } + + break; + + case 9: + KeyboardLogic(); + if(key == 11){ + new_quantMod[currentItem] = number; + currentState = 2; + mainUI(buttons, currentPage, maxPage,1,2); + isopen = 0; + positionKey = 0; + key = 0; + str[positionKey] = '\0'; + + } + break; + + } + +} + +void KeyboardLogic(){ + if(positionKey < 6){ + if(key < 9){ + str[positionKey] = key + 49; + positionKey++; + str[positionKey] = '\0'; + } + + if(key == 9){ + positionKey--; + if(positionKey <= 0){ + positionKey = 0; + } + str[positionKey] = '\0'; + } + + if(key == 10){ + str[positionKey] = '0'; + positionKey++; + str[positionKey] = '\0'; + } + + char string[7]; + strcpy(string, str); + number = atoi(string); + printText(number); + } + + else{ + if(key == 9){ + positionKey--; + if(positionKey <= 0){ + positionKey = 0; + } + str[positionKey] = '\0'; + char string[7]; + strcpy(string, str); + number = atoi(string); + printText(number); + } + + } +} + +void dropMenuButtons(int x){ + + switch(x){ + case 0: + drop--; + if(drop <= -1){ + drop = 0; + } + break; + case 1: + drop++; + if(drop >= 17){ + drop = 16; + } + break; + } + + Show_DropDownMenuMod(drop); + +} + +void MenuButtons(int x){ + switch(x){ + case 0: + buttons--; + if((buttons - 1) == -2){ + currentPage--; + if(currentPage - 1 <= -1){ + currentPage = maxPage; + } + buttons = 4; + } + break; + case 1: + buttons++; + if((buttons + 1) == 6){ + currentPage++; + if(currentPage >= maxPage + 1){ + currentPage = 1; + } + buttons = 0; + } + break; + case 2: + currentPage++; + if(currentPage >= maxPage + 1){ + currentPage = 1; + } + break; + case 3: + currentPage--; + if(currentPage - 1 <= -1){ + currentPage = maxPage; + } + break; + + } + currentItem = (5 * (currentPage - 1) + buttons); + mainUI(buttons, currentPage, maxPage, 0, 0); +} + +int main(int argc, char **argv){ + + initServices(); + + selectSlotMenu(slot); + + while(appletMainLoop()) + { + hidScanInput(); + + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + + + if (kDown & KEY_DUP) buttonLogic(0); + if (kDown & KEY_DDOWN) buttonLogic(1); + if (kDown & KEY_DRIGHT) buttonLogic(2); + if (kDown & KEY_DLEFT) buttonLogic(3); + if (kDown & KEY_A) ConfirmButton(); + + if(currentState != 0){ + if (kDown & KEY_B) BackButton(); + if (kDown & KEY_Y) RupeeKey(); + if (kDown & KEY_PLUS) exitMen(); + if(currentState == 12 && kDown & KEY_A){ + writeFile(); + break; + } + if(currentState == 12 && kDown & KEY_X){ + break; + } + } + + } + + closeServices(); + return 0; + +} + +void exitMen(){ + currentState = 12; + exitMenu(0); +} + +void RupeeKey(){ + if(isopen == 1){ + currentState = 1; + mainUI(buttons, currentPage, maxPage, 0, 0); + isopen = 0; + } + else if(isopen == 0){ + currentState = 7; + keyboard = 0; + keyboardy = 0; + KeyboardScreen(); + isopen = 1; + } +} + +void returnMainScreen(){ + + buttons = 0; + slot = 0; + currentPage = 1; + currentState = 0; + isopen = 0; + + fclose(fp); + unmountSaveData(); + fsdevUnmountDevice("save"); + selectSlotMenu(slot); + + + +} + +void closeServices(){ + fclose(fp); + unmountSaveData(); + fsdevUnmountDevice("save"); + TTF_CloseFont(Arial); + TTF_Quit(); + romfsExit(); + SDL_Quit(); + +} \ No newline at end of file diff --git a/source/mount.c b/source/mount.c new file mode 100644 index 0000000..0a62085 --- /dev/null +++ b/source/mount.c @@ -0,0 +1,65 @@ +#include +#include +#include + +#include + + + +void unmountSaveData(){ + fsdevCommitDevice("save"); + fsdevUnmountDevice("save"); +} + +void mountSaveData() +{ + int ret=0; + Result rc = 0; + DIR* dir; + struct dirent* ent; + + FsFileSystem tmpfs; + u128 userID=0; + bool account_selected=0; + u64 titleID=0x01007ef00011e000; + + rc = accountInitialize(); + + if (R_FAILED(rc)) { + printf("accountInitialize() failed: 0x%x\n", rc); + } + + if (R_SUCCEEDED(rc)) { + rc = accountGetActiveUser(&userID, &account_selected); + accountExit(); + + if (R_FAILED(rc)) { + printf("accountGetActiveUser() failed: 0x%x\n", rc); + } + else if(!account_selected) { + printf("No user is currently selected.\n"); + rc = -1; + } + } + + if (R_SUCCEEDED(rc)) { + printf("Using titleID=0x%016lx userID: 0x%lx 0x%lx\n", titleID, (u64)(userID>>64), (u64)userID); + } + + if (R_SUCCEEDED(rc)) { + rc = fsMount_SaveData(&tmpfs, titleID, userID); + if (R_FAILED(rc)) { + printf("fsMount_SaveData() failed: 0x%x\n", rc); + } + } + + if (R_SUCCEEDED(rc)) { + ret = fsdevMountDevice("save", tmpfs); + if (ret==-1) { + printf("fsdevMountDevice() failed.\n"); + rc = ret; + } + } + +} + diff --git a/source/translations.c b/source/translations.c new file mode 100644 index 0000000..b6bd833 --- /dev/null +++ b/source/translations.c @@ -0,0 +1,484 @@ +char weapons[200][50] = { + "Weapon_Sword_001", + "Weapon_Sword_002", + "Weapon_Sword_003", + "Weapon_Sword_004", + "Weapon_Sword_005", + "Weapon_Sword_006", + "Weapon_Sword_007", + "Weapon_Sword_008", + "Weapon_Sword_009", + "Weapon_Sword_013", + "Weapon_Sword_014", + "Weapon_Sword_015", + "Weapon_Sword_016", + "Weapon_Sword_017", + "Weapon_Sword_018", + "Weapon_Sword_019", + "Weapon_Sword_020", + "Weapon_Sword_021", + "Weapon_Sword_022", + "Weapon_Sword_023", + "Weapon_Sword_024", + "Weapon_Sword_025", + "Weapon_Sword_027", + "Weapon_Sword_029", + "Weapon_Sword_030", + "Weapon_Sword_031", + "Weapon_Sword_033", + "Weapon_Sword_034", + "Weapon_Sword_035", + "Weapon_Sword_040", + "Weapon_Sword_041", + "Weapon_Sword_043", + "Weapon_Sword_044", + "Weapon_Sword_047", + "Weapon_Sword_048", + "Weapon_Sword_049", + "Weapon_Sword_050", + "Weapon_Sword_051", + "Weapon_Sword_052", + "Weapon_Sword_053", + "Weapon_Sword_056", + "Weapon_Sword_057", + "Weapon_Sword_058", + "Weapon_Sword_059", + "Weapon_Sword_060", + "Weapon_Sword_061", + "Weapon_Sword_062", + "Weapon_Sword_070", + "Weapon_Sword_071", + "Weapon_Sword_072", + "Weapon_Sword_073", + "Weapon_Sword_500", + "Weapon_Sword_502", + "Weapon_Sword_503", + "Weapon_Lsword_001", + "Weapon_Lsword_002", + "Weapon_Lsword_003", + "Weapon_Lsword_004", + "Weapon_Lsword_005", + "Weapon_Lsword_006", + "Weapon_Lsword_010", + "Weapon_Lsword_011", + "Weapon_Lsword_012", + "Weapon_Lsword_013", + "Weapon_Lsword_014", + "Weapon_Lsword_015", + "Weapon_Lsword_016", + "Weapon_Lsword_017", + "Weapon_Lsword_018", + "Weapon_Lsword_019", + "Weapon_Lsword_020", + "Weapon_Lsword_023", + "Weapon_Lsword_024", + "Weapon_Lsword_027", + "Weapon_Lsword_029", + "Weapon_Lsword_030", + "Weapon_Lsword_031", + "Weapon_Lsword_032", + "Weapon_Lsword_033", + "Weapon_Lsword_034", + "Weapon_Lsword_035", + "Weapon_Lsword_036", + "Weapon_Lsword_037", + "Weapon_Lsword_038", + "Weapon_Lsword_041", + "Weapon_Lsword_045", + "Weapon_Lsword_047", + "Weapon_Lsword_051", + "Weapon_Lsword_054", + "Weapon_Lsword_055", + "Weapon_Lsword_056", + "Weapon_Lsword_057", + "Weapon_Lsword_059", + "Weapon_Lsword_060", + "Weapon_Lsword_074", + "Weapon_Spear_001", + "Weapon_Spear_002", + "Weapon_Spear_003", + "Weapon_Spear_004", + "Weapon_Spear_005", + "Weapon_Spear_006", + "Weapon_Spear_007", + "Weapon_Spear_008", + "Weapon_Spear_009", + "Weapon_Spear_010", + "Weapon_Spear_011", + "Weapon_Spear_012", + "Weapon_Spear_013", + "Weapon_Spear_014", + "Weapon_Spear_015", + "Weapon_Spear_016", + "Weapon_Spear_017", + "Weapon_Spear_018", + "Weapon_Spear_021", + "Weapon_Spear_022", + "Weapon_Spear_023", + "Weapon_Spear_024", + "Weapon_Spear_025", + "Weapon_Spear_027", + "Weapon_Spear_028", + "Weapon_Spear_029", + "Weapon_Spear_030", + "Weapon_Spear_031", + "Weapon_Spear_032", + "Weapon_Spear_033", + "Weapon_Spear_034", + "Weapon_Spear_035", + "Weapon_Spear_036", + "Weapon_Spear_037", + "Weapon_Spear_038", + "Weapon_Spear_047", + "Weapon_Spear_049", + "Weapon_Spear_050", + "Weapon_Bow_001", + "Weapon_Bow_002", + "Weapon_Bow_003", + "Weapon_Bow_004", + "Weapon_Bow_006", + "Weapon_Bow_009", + "Weapon_Bow_011", + "Weapon_Bow_013", + "Weapon_Bow_014", + "Weapon_Bow_015", + "Weapon_Bow_016", + "Weapon_Bow_017", + "Weapon_Bow_023", + "Weapon_Bow_026", + "Weapon_Bow_027", + "Weapon_Bow_028", + "Weapon_Bow_029", + "Weapon_Bow_030", + "Weapon_Bow_032", + "Weapon_Bow_033", + "Weapon_Bow_035", + "Weapon_Bow_036", + "Weapon_Bow_038", + "Weapon_Bow_040", + "Weapon_Bow_071", + "Weapon_Bow_072", + "Weapon_Shield_001", + "Weapon_Shield_002", + "Weapon_Shield_003", + "Weapon_Shield_004", + "Weapon_Shield_005", + "Weapon_Shield_006", + "Weapon_Shield_007", + "Weapon_Shield_008", + "Weapon_Shield_009", + "Weapon_Shield_013", + "Weapon_Shield_014", + "Weapon_Shield_015", + "Weapon_Shield_016", + "Weapon_Shield_017", + "Weapon_Shield_018", + "Weapon_Shield_021", + "Weapon_Shield_022", + "Weapon_Shield_023", + "Weapon_Shield_025", + "Weapon_Shield_026", + "Weapon_Shield_030", + "Weapon_Shield_031", + "Weapon_Shield_032", + "Weapon_Shield_033", + "Weapon_Shield_034", + "Weapon_Shield_035", + "Weapon_Shield_036", + "Weapon_Shield_037", + "Weapon_Shield_038", + "Weapon_Shield_040", + "Weapon_Shield_041", + "Weapon_Shield_042", + "Weapon_Shield_057", + "NormalArrow", + "FireArrow", + "IceArrow", + "ElectricArrow", + "BombArrow_A", + "AncientArrow" +}; + +char weaponsNames[200][50] = { + "Traveler's Sword", + "Soldier's Broadsword", + "Knight's Broadsword", + "Boko Club", + "Spiked Boko Club", + "Dragonbone Boko Club", + "Lizal Boomerand", + "Lizal Forked Boomerang", + "Lizal Tri-Boomerang", + "Guardian Sword", + "Guardian Sword+", + "Guardian Sword++", + "Lynel Sword", + "Mighty Lynel Sword", + "Savage Lynel Sword", + "Bokoblin Arm", + "Lizalfos Arm", + "Rusty Broadsword", + "Soup ladle", + "Ancient Short Sword", + "Royal Broadsword", + "Forest Dweller's Sword", + "Zora Sword", + "Gerudo Scimitar", + "Moonlight Scimitar", + "Feathered Edge", + "Flameblade", + "Frostblade", + "Thunderblade", + "Spring-Loaded Hammer", + "Eightfold Blade", + "Torch", + "Tree Branch", + "Royal Guard's Sword", + "Meteor Rod", + "Blizzard Rod", + "Thunderstorm Rod", + "Boomerang", + "Scimitar of the Seven", + "Vicious Sickle", + "Master Sword (Broken/Unequippable)", + "Goddess Sword", + "Hero's Sword (8-bit Link)", + "Sea-Breeze Boomerang (Wind Waker)", + "Fire Rod", + "Ice Rod", + "Lightning Rod", + "Master Sword", + "Master Sword (no near malice, no charge)", + "Master Sword (near malice, no charge)", + "Demon Carver", + "Lantern", + "OH Obliterator", + "OH Obliterator(?)", + "Traveler's Claymore", + "Soldier's Claymore", + "Knight's Claymore", + "Boko Bat", + "Spiked Boko Bat", + "Dragonbone Boko Bat", + "Moblin Club", + "Spiked Moblin Club", + "Dragonbone Moblin Club", + "Ancient Battle Axe", + "Ancient Battle Axe+", + "Ancient Battle Axe++", + "Lynel Crusher", + "Mighty Lynel Crusher", + "Savage Lynel Crusher", + "Moblin Arm", + "Rusty Claymore", + "Ancient Bladesaw", + "Royal Claymore", + "Silver Longsword", + "Golden Claymore", + "Double Axe", + "Iron Sledgehammer", + "Woodcutter's Axe", + "Great Flameblade", + "Great Frostblade", + "Great Thunderblade", + "Cobble Crusher", + "Stone Smasher", + "Boat Oar", + "Eightfold Longblade", + "Farming Hoe", + "Royal Guard's Claymore", + "Giant Boomerang", + "Boulder Breaker", + "Edge of Duality", + "Korok Leaf", + "Sword of the Six Sages (Twilight Princess)", + "Biggoron's Sword (Ocarina of Time)", + "Fierce Deity Sword (Majora's Mask)", + "Windcleaver", + "Traveler's Spear", + "Soldier's Spear", + "Knight's Halberd", + "Boko Spear", + "Spiked Boko Spear", + "Dragonbone Boko Spear", + "Lizal Spear", + "Enhanced Lizal Spear", + "Forked Lizal Spear", + "Moblin Spear", + "Spiked Moblin Spear", + "Dragonbone Moblin Spear", + "Guardian Spear", + "Guardian Spear+", + "Guardian Spear++", + "Lynel Spear", + "Mighty Lynel Spear", + "Savage Lynel Spear", + "Rusty Halberd", + "Farmer's Pichfork", + "Ancient Spear", + "Royal Halberd", + "Forest Dweller's Spear", + "Zora Spear", + "Silverscale Spear", + "Gerudo Spear", + "Throwing Spear", + "Drillshaft", + "Feathered Spear", + "Flamespear", + "Frostspear", + "Thunderspear", + "Wooden Mop", + "Serpentine Spear", + "Fishing Harpoon", + "Royal Guard's Spear", + "Ceremonial Trident", + "Lightscale Trident", + "Traveler's Bow", + "Soldier's Bow", + "Spiked Boko Bow", + "Boko Bow", + "Lizal Bow", + "Lynel Bow", + "Strengthened Lizal Bow", + "Forest Dweller's Bow", + "Silver Bow", + "Golden Bow", + "Swallow Bow", + "Falcon Bow", + "Ancient Bow", + "Mighty Lynel Bow", + "Dragon Bone Boko Bow", + "Great Eagle Bow", + "Phrenic Bow", + "Steel Lizal Bow", + "Savage Lynel Bow", + "Royal Guard's Bow", + "Knight's Bow", + "Royal Bow", + "Wooden Bow", + "Duplex Bow", + "Bow of Light", + "Twilight Bow (Twilight Princess)", + "Wooden Shield", + "Soldier's Shield", + "Knight's Shield", + "Boko Shield", + "Spiked Boko Shield", + "Dragonbone Boko Shield", + "Lizal Shield", + "Reinforced Lizal Shield", + "Steel Lizal Shield", + "Guardian Shield", + "Guardian Shield+", + "Guardian Shield++", + "Lynel Shield", + "Mighty Lynel Shield", + "Savage Lynel Shield", + "Rusty Shield", + "Royal Shield", + "Forest Dweller's Shield", + "Silver Shield", + "Gerudo Shield", + "Hylian Shield", + "Hunter's Shield", + "Fisherman's Shield", + "Royal Guard's Shield", + "Emblazoned Shield", + "Traveler's Shield", + "Radiant Shield", + "Daybreaker", + "Ancient Shield", + "Pot Lid", + "Shield of the Mind's Eye", + "Kite Shield", + "Hero's Shield (Wind Waker)", + "Arrow", + "Fire Arrow", + "Ice Arrow", + "Shock Arrow", + "Bomb Arrow", + "Ancient Arrow" +}; + + +long int modifiers[17] = { + 0x00000000, + 0x00000001, + 0x80000001, + 0x00000002, + 0x80000002, + 0x00000004, + 0x80000004, + 0x00000008, + 0x80000008, + 0x00000010, + 0x80000010, + 0x00000040, + 0x80000040, + 0x00000080, + 0x80000080, + 0x00000100, + 0x80000100 +}; + +char modifierName[17][20] = { + "(none)", + "Attack up", + "Attack up *", + "Durability up", + "Durability up *", + "Critical hit up", + "Critical hit up*", + "Long throw *", + "Long throw *", + "Five-Shot Burst", + "Five-Shot Burst*", + "Quick shot", + "Quick shot *", + "Shield surf up", + "Shield surf up *", + "Shield guard up", + "Shield guard up *" +}; + + +const char * translateMods(long int md){ + int x; + for(x = 0; x < 17; x++){ + if(md == modifiers[x]){ + return modifierName[x]; + break; + } + } + return "NULL"; +} + +const char * translate(const char* rawName) +{ + + int x; + for(x = 0; x < 198; x++){ + if(strcmp(rawName, weapons[x])==0){ + //printf("%d", x); + return weaponsNames[x]; + break; + } + } + + return rawName; +} + + +int getIDNumber(const char* rawName){ + + int x; + for(x = 0; x < 198; x++){ + if(strcmp(rawName, weapons[x])==0){ + return x; + break; + } + } + + return 0; + +}