diff --git a/.gitignore b/.gitignore index f2062af..f38c7e6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ .git/ arm7/build/ arm9/build/ +arm9/nitrofs/data/ build/ flipnotes-example/ fs/ diff --git a/Makefile b/Makefile index a6603db..5594422 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ ifeq ($(strip $(DEVKITARM)),) $(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") endif +MAKEFILE_PATH:=$(realpath $(shell dirname $(firstword $(MAKEFILE_LIST)))) +$(info MAKEFILE_PATH=$(MAKEFILE_PATH)) + include $(DEVKITARM)/ds_rules export GAME_TITLE := FSPDS @@ -12,7 +15,15 @@ export GAME_ICON := $(CURDIR)/icon.bmp export TARGET := FSPDS export NDS_FILE := $(TARGET) -NITRO := nitrofs +USE_NTFS := ${shell grep -E "^NTFS\s*\=\s*.*\s*$$" $(MAKEFILE_PATH)/config.ini | sed -E "s/^NTFS\s*\=\s*(.*)\s*$$/\1/" | grep . || echo "0"} + +ifeq ($(USE_NTFS), 1) +$(info NTFS) +NITRO := nitrofs +else +$(info NO_NTFS) +NITRO := +endif ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) @@ -38,11 +49,13 @@ all: $(TARGET).nds ifneq ($(strip $(NITRO)),) $(TARGET).nds : arm7/$(TARGET).elf arm9/$(TARGET).elf $(NITRO_FILES) + $(info ndstool -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -b $(GAME_ICON) "$(GAME_TITLE)" -d $(NITRO_FILES) -c $(TARGET).nds) @ndstool -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -b $(GAME_ICON) "$(GAME_TITLE)" -d $(NITRO_FILES) -c $(TARGET).nds @echo built ... $(notdir $@) - mv $(TARGET).nds $(TARGET)-V${shell python build_counter.py}.nds + mv $(TARGET).nds $(TARGET)-V$(TARGET_BUILD_VERSION).nds else $(TARGET).nds : arm7/$(TARGET).elf arm9/$(TARGET).elf + $(info ndstool -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -b $(GAME_ICON) "$(GAME_TITLE)" -d $(NITRO_FILES) -c $(TARGET).nds) @ndstool -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -b $(GAME_ICON) "$(GAME_TITLE)" -c $(TARGET).nds @echo built ... $(notdir $@) mv $(TARGET).nds $(TARGET)-V$(TARGET_BUILD_VERSION).nds diff --git a/arm9/assets/background.png b/arm9/assets/background.png index 1d89e9c..b64256a 100644 Binary files a/arm9/assets/background.png and b/arm9/assets/background.png differ diff --git a/arm9/assets/title_spr_nitro.asset b/arm9/assets/title_spr_nitro.asset new file mode 100644 index 0000000..bbf032d --- /dev/null +++ b/arm9/assets/title_spr_nitro.asset @@ -0,0 +1 @@ +-tiles -8bpp -mw8 -mh8 \ No newline at end of file diff --git a/arm9/assets/title_spr_nitro.png b/arm9/assets/title_spr_nitro.png new file mode 100644 index 0000000..b007af1 Binary files /dev/null and b/arm9/assets/title_spr_nitro.png differ diff --git a/arm9/data/0B33C4_0BC1601FB8421_000.bin b/arm9/data/0B33C4_0BC1601FB8421_000.bin deleted file mode 100644 index 853a06c..0000000 Binary files a/arm9/data/0B33C4_0BC1601FB8421_000.bin and /dev/null differ diff --git a/arm9/source/help_scene.cpp b/arm9/source/help_scene.cpp index e54439c..1e1ec27 100644 --- a/arm9/source/help_scene.cpp +++ b/arm9/source/help_scene.cpp @@ -8,6 +8,12 @@ #include "version.h" +#if USE_NTFS==1 + #define FMT_VERSION "FSPDS V%i.%i.%i Nitro" +#else + #define FMT_VERSION "FSPDS V%i.%i.%i" +#endif + class HelpScene : public SimpleScene { private: @@ -118,7 +124,9 @@ public: vwf_bottom.set_cursor(9, 8); - vwf_bottom.put_text(str_print(buffer, "FSPDS V%i.%i.%i", MAJOR, MINOR, BUILD), Pal4bit, SolidColorBrush(0x1)); + + vwf_bottom.put_text(str_print(buffer, FMT_VERSION, MAJOR, MINOR, BUILD), Pal4bit, SolidColorBrush(0x1)); + vwf_bottom.set_cursor(10, 8); vwf_bottom.put_text(str_print(buffer, "%s build", BUILD_TYPE=='D' ? "Debug" : "Release"), Pal4bit, SolidColorBrush(0x1)); } diff --git a/arm9/source/player_scene.cpp b/arm9/source/player_scene.cpp index 8ef447b..7f7fda8 100644 --- a/arm9/source/player_scene.cpp +++ b/arm9/source/player_scene.cpp @@ -7,8 +7,6 @@ #include "frame_decoder.hpp" #include "sound_decoder.hpp" -#include "0B33C4_0BC1601FB8421_000_bin.h" - #include "player_bg.h" #include "bar_fragments.h" #include "player_icons.h" @@ -570,13 +568,13 @@ public: } else { - int* d = (int*)ppm_reader; - int* s = (int*)_0B33C4_0BC1601FB8421_000_bin; + /*int* d = (int*)ppm_reader; + int* s = (int*)...; Debug::log("START = %X", d); for(int i=0;i<253196/4;i++) - *(d++)=*(s++); + *(d++)=*(s++);*/ } soundFreq = ppm_reader->getSoundFreq(); diff --git a/arm9/source/playlists_scene.cpp b/arm9/source/playlists_scene.cpp index a0941cd..4108e2c 100644 --- a/arm9/source/playlists_scene.cpp +++ b/arm9/source/playlists_scene.cpp @@ -16,13 +16,15 @@ Scene* folder_picker_return_to_playlists(); class PlaylistsScene : public SimpleScene { private: - ObjFrame* folder_highlighted_frame; Sprite* folder_icons[4]; - Sprite* add_folder_icon=nullptr; - Sprite* back_arrow = nullptr; + ObjFrame* folder_highlighted_frame; + Sprite* back_arrow = nullptr; +#if USE_NTFS!=1 Sprite* reindex_icon = nullptr; Sprite* remove_icon = nullptr; + Sprite* add_folder_icon=nullptr; +#endif VwfEngine* vwf = new VwfEngine(Resources::Fonts::default_8x16); @@ -66,6 +68,7 @@ public: else if(keys & KEY_TOUCH) { touchRead(&touch); + #if USE_NTFS!=1 if(touch_in_rect(220, 0, 32, 32)) { folder_picker_next_scene_gen = folder_picker_return_to_playlists; @@ -110,6 +113,7 @@ public: { close()->next(gen_title_scene()); } + #endif // USE_NTFS!=1 } else if(keys & KEY_B) { @@ -149,6 +153,7 @@ public: folder_icons[i]->set_position(8, 32 + 32*i); } + #if USE_NTFS!=1 add_folder_icon = create_sprite(new Sprite(SIZE_32x32, Engine::Sub)); add_folder_icon->add_frame(new ObjFrame(&ROA_folder_icon8,0,3)); add_folder_icon->set_position(220, 0); @@ -164,6 +169,7 @@ public: remove_icon = create_sprite(new Sprite(SIZE_32x32, Engine::Sub)); remove_icon->add_frame(new ObjFrame(&ROA_folder_icon8,0,5)); remove_icon->set_position(140, 0); + #endif end_sprites_init(); @@ -222,10 +228,11 @@ public: vwf->clear(Pal4bit); vwf->set_cursor(5, Strings::pcx_indexing_files); vwf->put_text(Strings::str_indexing_files, Pal4bit, SolidColorBrush(0x2)); - + #if USE_NTFS!=1 add_folder_icon->hide(); reindex_icon->hide(); remove_icon->hide(); + #endif back_arrow->hide(); GenericScene256::frame(); swiWaitForVBlank(); @@ -302,10 +309,12 @@ public: swiWaitForVBlank(); } + #if USE_NTFS!=1 add_folder_icon->show(); reindex_icon->show(); remove_icon->show(); back_arrow->show(); + #endif display_page(); } @@ -375,16 +384,20 @@ public: int loc_selected_index=0; void display_page() { + #if USE_NTFS!=1 reindex_icon->show(); remove_icon->show(); + #endif vwf->clear(Pal4bit); for(int i=0;i<4;i++) folder_icons[i]->hide(); if(locations_provider->get_count()==0) { + #if USE_NTFS!=1 reindex_icon->hide(); remove_icon->hide(); + #endif vwf->set_cursor(6, Strings::pcx_no_flipnote_locations); vwf->put_text(Strings::str_no_flipnote_locations, Pal4bit, SolidColorBrush(0x3)); return; @@ -461,10 +474,11 @@ public: vwf->clear(Pal4bit); vwf->set_cursor(5, Strings::pcx_indexing_files); vwf->put_text(Strings::str_indexing_files, Pal4bit, SolidColorBrush(0x2)); - + #if USE_NTFS!=1 add_folder_icon->hide(); reindex_icon->hide(); remove_icon->hide(); + #endif back_arrow->hide(); GenericScene256::frame(); swiWaitForVBlank(); @@ -540,14 +554,17 @@ public: for(int i=0;i<60;i++) swiWaitForVBlank(); + #if USE_NTFS!=1 add_folder_icon->show(); reindex_icon->show(); remove_icon->show(); + #endif back_arrow->show(); } ~PlaylistsScene() { + key_down.remove_event(&PlaylistsScene::on_key_down, this); delete vwf; for(int i=0;i<4;i++) { @@ -556,15 +573,14 @@ public: delete[] list_buffer[i]; } - delete back_arrow; - delete add_folder_icon; - - delete folder_highlighted_frame; - key_down.remove_event(&PlaylistsScene::on_key_down, this); + delete back_arrow; + delete folder_highlighted_frame; delete locations_provider; - + #if USE_NTFS!=1 + delete add_folder_icon; delete reindex_icon; delete remove_icon; + #endif } }; diff --git a/arm9/source/title.cpp b/arm9/source/title.cpp index ea04385..310fcb6 100644 --- a/arm9/source/title.cpp +++ b/arm9/source/title.cpp @@ -7,11 +7,16 @@ #include "logo_tb_bin.h" #include "esodev_logo.h" #include "background.h" -#include "title_spr.h" #include "opt_box.h" #include "fat_fail.h" #include "empty.h" +#if USE_NTFS==1 + #include "title_spr_nitro.h" +#else + #include "title_spr.h" +#endif + #include "scenes.hpp" @@ -71,10 +76,15 @@ class TitleScene : public GenericScene256 begin_sprites_init(); empty = create_sprite(new Sprite(SIZE_8x8, Engine::Sub)); - empty->add_frame(new ObjFrame(&ROA_empty8, 0,0)); + empty->add_frame(new ObjFrame(&ROA_empty8, 0,0)); + #if USE_NTFS==1 + title[0]->add_frame(new ObjFrame(&ROA_title_spr_nitro8, 0,0)); + title[1]->add_frame(new ObjFrame(&ROA_title_spr_nitro8, 0,1)); + #else title[0]->add_frame(new ObjFrame(&ROA_title_spr8, 0,0)); title[1]->add_frame(new ObjFrame(&ROA_title_spr8, 0,1)); + #endif title[0]->set_position(128-64, 116); title[1]->set_position(128, 116);