added behavior for Nitro mode (#14)

This commit is contained in:
NotImplementedLife 2024-08-02 16:16:47 +03:00
parent 77909be2ed
commit 5f8a23a2ac
10 changed files with 68 additions and 21 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@ __pycache__/
.git/ .git/
arm7/build/ arm7/build/
arm9/build/ arm9/build/
arm9/nitrofs/data/
build/ build/
flipnotes-example/ flipnotes-example/
fs/ fs/

View File

@ -5,6 +5,9 @@ ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM") $(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif endif
MAKEFILE_PATH:=$(realpath $(shell dirname $(firstword $(MAKEFILE_LIST))))
$(info MAKEFILE_PATH=$(MAKEFILE_PATH))
include $(DEVKITARM)/ds_rules include $(DEVKITARM)/ds_rules
export GAME_TITLE := FSPDS export GAME_TITLE := FSPDS
@ -12,7 +15,15 @@ export GAME_ICON := $(CURDIR)/icon.bmp
export TARGET := FSPDS export TARGET := FSPDS
export NDS_FILE := $(TARGET) export NDS_FILE := $(TARGET)
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 NITRO := nitrofs
else
$(info NO_NTFS)
NITRO :=
endif
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
@ -38,11 +49,13 @@ all: $(TARGET).nds
ifneq ($(strip $(NITRO)),) ifneq ($(strip $(NITRO)),)
$(TARGET).nds : arm7/$(TARGET).elf arm9/$(TARGET).elf $(NITRO_FILES) $(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 @ndstool -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -b $(GAME_ICON) "$(GAME_TITLE)" -d $(NITRO_FILES) -c $(TARGET).nds
@echo built ... $(notdir $@) @echo built ... $(notdir $@)
mv $(TARGET).nds $(TARGET)-V${shell python build_counter.py}.nds mv $(TARGET).nds $(TARGET)-V$(TARGET_BUILD_VERSION).nds
else else
$(TARGET).nds : arm7/$(TARGET).elf arm9/$(TARGET).elf $(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 @ndstool -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -b $(GAME_ICON) "$(GAME_TITLE)" -c $(TARGET).nds
@echo built ... $(notdir $@) @echo built ... $(notdir $@)
mv $(TARGET).nds $(TARGET)-V$(TARGET_BUILD_VERSION).nds mv $(TARGET).nds $(TARGET)-V$(TARGET_BUILD_VERSION).nds

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
-tiles -8bpp -mw8 -mh8

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

View File

@ -8,6 +8,12 @@
#include "version.h" #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 class HelpScene : public SimpleScene
{ {
private: private:
@ -118,7 +124,9 @@ public:
vwf_bottom.set_cursor(9, 8); 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.set_cursor(10, 8);
vwf_bottom.put_text(str_print(buffer, "%s build", BUILD_TYPE=='D' ? "Debug" : "Release"), Pal4bit, SolidColorBrush(0x1)); vwf_bottom.put_text(str_print(buffer, "%s build", BUILD_TYPE=='D' ? "Debug" : "Release"), Pal4bit, SolidColorBrush(0x1));
} }

View File

@ -7,8 +7,6 @@
#include "frame_decoder.hpp" #include "frame_decoder.hpp"
#include "sound_decoder.hpp" #include "sound_decoder.hpp"
#include "0B33C4_0BC1601FB8421_000_bin.h"
#include "player_bg.h" #include "player_bg.h"
#include "bar_fragments.h" #include "bar_fragments.h"
#include "player_icons.h" #include "player_icons.h"
@ -570,13 +568,13 @@ public:
} }
else else
{ {
int* d = (int*)ppm_reader; /*int* d = (int*)ppm_reader;
int* s = (int*)_0B33C4_0BC1601FB8421_000_bin; int* s = (int*)...;
Debug::log("START = %X", d); Debug::log("START = %X", d);
for(int i=0;i<253196/4;i++) for(int i=0;i<253196/4;i++)
*(d++)=*(s++); *(d++)=*(s++);*/
} }
soundFreq = ppm_reader->getSoundFreq(); soundFreq = ppm_reader->getSoundFreq();

View File

@ -16,13 +16,15 @@ Scene* folder_picker_return_to_playlists();
class PlaylistsScene : public SimpleScene class PlaylistsScene : public SimpleScene
{ {
private: private:
ObjFrame* folder_highlighted_frame;
Sprite* folder_icons[4]; Sprite* folder_icons[4];
Sprite* add_folder_icon=nullptr; ObjFrame* folder_highlighted_frame;
Sprite* back_arrow = nullptr; Sprite* back_arrow = nullptr;
#if USE_NTFS!=1
Sprite* reindex_icon = nullptr; Sprite* reindex_icon = nullptr;
Sprite* remove_icon = nullptr; Sprite* remove_icon = nullptr;
Sprite* add_folder_icon=nullptr;
#endif
VwfEngine* vwf = new VwfEngine(Resources::Fonts::default_8x16); VwfEngine* vwf = new VwfEngine(Resources::Fonts::default_8x16);
@ -66,6 +68,7 @@ public:
else if(keys & KEY_TOUCH) else if(keys & KEY_TOUCH)
{ {
touchRead(&touch); touchRead(&touch);
#if USE_NTFS!=1
if(touch_in_rect(220, 0, 32, 32)) if(touch_in_rect(220, 0, 32, 32))
{ {
folder_picker_next_scene_gen = folder_picker_return_to_playlists; folder_picker_next_scene_gen = folder_picker_return_to_playlists;
@ -110,6 +113,7 @@ public:
{ {
close()->next(gen_title_scene()); close()->next(gen_title_scene());
} }
#endif // USE_NTFS!=1
} }
else if(keys & KEY_B) else if(keys & KEY_B)
{ {
@ -149,6 +153,7 @@ public:
folder_icons[i]->set_position(8, 32 + 32*i); 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 = create_sprite(new Sprite(SIZE_32x32, Engine::Sub));
add_folder_icon->add_frame(new ObjFrame(&ROA_folder_icon8,0,3)); add_folder_icon->add_frame(new ObjFrame(&ROA_folder_icon8,0,3));
add_folder_icon->set_position(220, 0); add_folder_icon->set_position(220, 0);
@ -164,6 +169,7 @@ public:
remove_icon = create_sprite(new Sprite(SIZE_32x32, Engine::Sub)); remove_icon = create_sprite(new Sprite(SIZE_32x32, Engine::Sub));
remove_icon->add_frame(new ObjFrame(&ROA_folder_icon8,0,5)); remove_icon->add_frame(new ObjFrame(&ROA_folder_icon8,0,5));
remove_icon->set_position(140, 0); remove_icon->set_position(140, 0);
#endif
end_sprites_init(); end_sprites_init();
@ -222,10 +228,11 @@ public:
vwf->clear(Pal4bit); vwf->clear(Pal4bit);
vwf->set_cursor(5, Strings::pcx_indexing_files); vwf->set_cursor(5, Strings::pcx_indexing_files);
vwf->put_text(Strings::str_indexing_files, Pal4bit, SolidColorBrush(0x2)); vwf->put_text(Strings::str_indexing_files, Pal4bit, SolidColorBrush(0x2));
#if USE_NTFS!=1
add_folder_icon->hide(); add_folder_icon->hide();
reindex_icon->hide(); reindex_icon->hide();
remove_icon->hide(); remove_icon->hide();
#endif
back_arrow->hide(); back_arrow->hide();
GenericScene256::frame(); GenericScene256::frame();
swiWaitForVBlank(); swiWaitForVBlank();
@ -302,10 +309,12 @@ public:
swiWaitForVBlank(); swiWaitForVBlank();
} }
#if USE_NTFS!=1
add_folder_icon->show(); add_folder_icon->show();
reindex_icon->show(); reindex_icon->show();
remove_icon->show(); remove_icon->show();
back_arrow->show(); back_arrow->show();
#endif
display_page(); display_page();
} }
@ -375,16 +384,20 @@ public:
int loc_selected_index=0; int loc_selected_index=0;
void display_page() void display_page()
{ {
#if USE_NTFS!=1
reindex_icon->show(); reindex_icon->show();
remove_icon->show(); remove_icon->show();
#endif
vwf->clear(Pal4bit); vwf->clear(Pal4bit);
for(int i=0;i<4;i++) for(int i=0;i<4;i++)
folder_icons[i]->hide(); folder_icons[i]->hide();
if(locations_provider->get_count()==0) if(locations_provider->get_count()==0)
{ {
#if USE_NTFS!=1
reindex_icon->hide(); reindex_icon->hide();
remove_icon->hide(); remove_icon->hide();
#endif
vwf->set_cursor(6, Strings::pcx_no_flipnote_locations); vwf->set_cursor(6, Strings::pcx_no_flipnote_locations);
vwf->put_text(Strings::str_no_flipnote_locations, Pal4bit, SolidColorBrush(0x3)); vwf->put_text(Strings::str_no_flipnote_locations, Pal4bit, SolidColorBrush(0x3));
return; return;
@ -461,10 +474,11 @@ public:
vwf->clear(Pal4bit); vwf->clear(Pal4bit);
vwf->set_cursor(5, Strings::pcx_indexing_files); vwf->set_cursor(5, Strings::pcx_indexing_files);
vwf->put_text(Strings::str_indexing_files, Pal4bit, SolidColorBrush(0x2)); vwf->put_text(Strings::str_indexing_files, Pal4bit, SolidColorBrush(0x2));
#if USE_NTFS!=1
add_folder_icon->hide(); add_folder_icon->hide();
reindex_icon->hide(); reindex_icon->hide();
remove_icon->hide(); remove_icon->hide();
#endif
back_arrow->hide(); back_arrow->hide();
GenericScene256::frame(); GenericScene256::frame();
swiWaitForVBlank(); swiWaitForVBlank();
@ -540,14 +554,17 @@ public:
for(int i=0;i<60;i++) for(int i=0;i<60;i++)
swiWaitForVBlank(); swiWaitForVBlank();
#if USE_NTFS!=1
add_folder_icon->show(); add_folder_icon->show();
reindex_icon->show(); reindex_icon->show();
remove_icon->show(); remove_icon->show();
#endif
back_arrow->show(); back_arrow->show();
} }
~PlaylistsScene() ~PlaylistsScene()
{ {
key_down.remove_event(&PlaylistsScene::on_key_down, this);
delete vwf; delete vwf;
for(int i=0;i<4;i++) for(int i=0;i<4;i++)
{ {
@ -557,14 +574,13 @@ public:
} }
delete back_arrow; delete back_arrow;
delete add_folder_icon;
delete folder_highlighted_frame; delete folder_highlighted_frame;
key_down.remove_event(&PlaylistsScene::on_key_down, this);
delete locations_provider; delete locations_provider;
#if USE_NTFS!=1
delete add_folder_icon;
delete reindex_icon; delete reindex_icon;
delete remove_icon; delete remove_icon;
#endif
} }
}; };

View File

@ -7,11 +7,16 @@
#include "logo_tb_bin.h" #include "logo_tb_bin.h"
#include "esodev_logo.h" #include "esodev_logo.h"
#include "background.h" #include "background.h"
#include "title_spr.h"
#include "opt_box.h" #include "opt_box.h"
#include "fat_fail.h" #include "fat_fail.h"
#include "empty.h" #include "empty.h"
#if USE_NTFS==1
#include "title_spr_nitro.h"
#else
#include "title_spr.h"
#endif
#include "scenes.hpp" #include "scenes.hpp"
@ -73,8 +78,13 @@ class TitleScene : public GenericScene256
empty = create_sprite(new Sprite(SIZE_8x8, Engine::Sub)); 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[0]->add_frame(new ObjFrame(&ROA_title_spr8, 0,0));
title[1]->add_frame(new ObjFrame(&ROA_title_spr8, 0,1)); title[1]->add_frame(new ObjFrame(&ROA_title_spr8, 0,1));
#endif
title[0]->set_position(128-64, 116); title[0]->set_position(128-64, 116);
title[1]->set_position(128, 116); title[1]->set_position(128, 116);