aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/3ds
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/3ds')
-rw-r--r--backends/platform/3ds/3ds.mk29
-rw-r--r--backends/platform/3ds/README.md16
-rw-r--r--backends/platform/3ds/main.cpp2
-rw-r--r--backends/platform/3ds/osystem.cpp25
-rw-r--r--backends/platform/3ds/osystem.h1
5 files changed, 44 insertions, 29 deletions
diff --git a/backends/platform/3ds/3ds.mk b/backends/platform/3ds/3ds.mk
index 7cb162ff88..dcb7b5e3ab 100644
--- a/backends/platform/3ds/3ds.mk
+++ b/backends/platform/3ds/3ds.mk
@@ -21,21 +21,40 @@ clean: clean_3ds
clean_3ds:
$(RM) $(TARGET).3dsx
$(RM) $(TARGET).cia
+ $(RM) -rf romfs
+
+romfs: $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD)
+ @rm -rf romfs
+ @mkdir -p romfs
+ @cp $(DIST_FILES_THEMES) romfs/
+ifdef DIST_FILES_ENGINEDATA
+ @cp $(DIST_FILES_ENGINEDATA) romfs/
+endif
+ifdef DIST_FILES_NETWORKING
+ @cp $(DIST_FILES_NETWORKING) romfs/
+endif
+ifdef DIST_FILES_VKEYBD
+ @cp $(DIST_FILES_VKEYBD) romfs/
+endif
$(TARGET).smdh: $(APP_ICON)
@smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
@echo built ... $(notdir $@)
-$(TARGET).3dsx: $(EXECUTABLE) $(TARGET).smdh
- @3dsxtool $< $@ --smdh=$(TARGET).smdh
+$(TARGET).3dsx: $(EXECUTABLE) $(TARGET).smdh romfs
+ @3dsxtool $< $@ --smdh=$(TARGET).smdh --romfs=romfs
@echo built ... $(notdir $@)
$(TARGET).bnr: $(APP_BANNER_IMAGE) $(APP_BANNER_AUDIO)
@bannertool makebanner -o $@ -i $(APP_BANNER_IMAGE) -a $(APP_BANNER_AUDIO)
@echo built ... $(notdir $@)
-
-$(TARGET).cia: $(EXECUTABLE) $(APP_RSF) $(TARGET).smdh $(TARGET).bnr
- @makerom -f cia -target t -exefslogo -o $@ -elf $(EXECUTABLE) -rsf $(APP_RSF) -banner $(TARGET).bnr -icon $(TARGET).smdh
+
+$(TARGET).romfs: romfs
+ @3dstool -cvtf romfs $(TARGET).romfs --romfs-dir romfs
+ @echo built ... $(notdir $@)
+
+$(TARGET).cia: $(EXECUTABLE) $(APP_RSF) $(TARGET).smdh $(TARGET).bnr $(TARGET).romfs
+ @makerom -f cia -target t -exefslogo -o $@ -elf $(EXECUTABLE) -rsf $(APP_RSF) -banner $(TARGET).bnr -icon $(TARGET).smdh -romfs $(TARGET).romfs
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
diff --git a/backends/platform/3ds/README.md b/backends/platform/3ds/README.md
index b45a2a69d1..95ce0f4a8f 100644
--- a/backends/platform/3ds/README.md
+++ b/backends/platform/3ds/README.md
@@ -49,19 +49,7 @@ Not having this file will cause many problems with games that need audio, someti
even crashing, so this is NOT considered optional.
Using any CIA installation software (search elsewhere for that), you need to install
-the `scummvm.cia` file. Then, just like what is done with the 3DSX installation, you
-need to extract all ScummVM 3DS files (`scummvm.cia` excluded) to the root of your SD
-card so that all files reside in the `/3ds/scummvm/` directory.
-
-1.3) Additional files
----------------------
-In order to use the Virtual Keyboard, you need to get the:
-`backends/vkeybd/packs/vkeybd_small.zip` file from ScummVM's repository, and
-place it on your SD card, in the `/3ds/scummvm/kb` folder.
-
-In case you want a translated GUI, you need to get the:
-`scummvm/gui/themes/translations.dat` file from ScummVM's repository, and place
-it on your SD card, in the `/3ds/scummvm/themes` folder.
+the `scummvm.cia` file.
2.0) Controls
-------------
@@ -229,7 +217,7 @@ Additionally compile to specific formats to be used on the 3DS:
Assuming everything was successful, you'll be able to find the binary
files in the root of your scummvm folder.
-Note: for the CIA format, you will need the 'makerom' and 'bannertool' tools which are
+Note: for the CIA format, you will need the '3dstool', 'makerom' and 'bannertool' tools which are
not supplied with devkitPro.
4.3) Warning for build sizes
diff --git a/backends/platform/3ds/main.cpp b/backends/platform/3ds/main.cpp
index dc89faaef6..ce549b67c4 100644
--- a/backends/platform/3ds/main.cpp
+++ b/backends/platform/3ds/main.cpp
@@ -27,6 +27,7 @@ int main(int argc, char *argv[]) {
// Initialize basic libctru stuff
gfxInitDefault();
cfguInit();
+ romfsInit();
osSetSpeedupEnable(true);
// consoleInit(GFX_TOP, NULL);
@@ -50,6 +51,7 @@ int main(int argc, char *argv[]) {
gspLcdExit();
}
+ romfsExit();
cfguExit();
gfxExit();
return res;
diff --git a/backends/platform/3ds/osystem.cpp b/backends/platform/3ds/osystem.cpp
index c42e208b40..0e5cb7bfbb 100644
--- a/backends/platform/3ds/osystem.cpp
+++ b/backends/platform/3ds/osystem.cpp
@@ -36,8 +36,8 @@
#include "common/str.h"
#include "config.h"
-#include "backends/fs/posix/posix-fs-factory.h"
-#include "backends/fs/posix/posix-fs.h"
+#include "backends/fs/posix-drives/posix-drives-fs-factory.h"
+#include "backends/fs/posix-drives/posix-drives-fs.h"
#include <unistd.h>
#include <time.h>
@@ -77,8 +77,13 @@ OSystem_3DS::OSystem_3DS():
sleeping(false)
{
chdir("sdmc:/");
- _fsFactory = new POSIXFilesystemFactory();
- Posix::assureDirectoryExists("/3ds/scummvm/saves/");
+
+ DrivesPOSIXFilesystemFactory *fsFactory = new DrivesPOSIXFilesystemFactory();
+ fsFactory->addDrive("sdmc:");
+ fsFactory->addDrive("romfs:");
+ _fsFactory = fsFactory;
+
+ Posix::assureDirectoryExists("sdmc:/3ds/scummvm/saves/");
}
OSystem_3DS::~OSystem_3DS() {
@@ -101,15 +106,11 @@ void OSystem_3DS::initBackend() {
ConfMan.registerDefault("aspect_ratio", true);
if (!ConfMan.hasKey("vkeybd_pack_name"))
ConfMan.set("vkeybd_pack_name", "vkeybd_small");
- if (!ConfMan.hasKey("vkeybdpath"))
- ConfMan.set("vkeybdpath", "/3ds/scummvm/kb");
- if (!ConfMan.hasKey("themepath"))
- ConfMan.set("themepath", "/3ds/scummvm");
if (!ConfMan.hasKey("gui_theme"))
ConfMan.set("gui_theme", "builtin");
_timerManager = new DefaultTimerManager();
- _savefileManager = new DefaultSaveFileManager("/3ds/scummvm/saves/");
+ _savefileManager = new DefaultSaveFileManager("sdmc:/3ds/scummvm/saves/");
initGraphics();
initAudio();
@@ -125,7 +126,11 @@ void OSystem_3DS::updateConfig() {
}
Common::String OSystem_3DS::getDefaultConfigFileName() {
- return "/3ds/scummvm/scummvm.ini";
+ return "sdmc:/3ds/scummvm/scummvm.ini";
+}
+
+void OSystem_3DS::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
+ s.add("RomFS", new Common::FSDirectory("romfs:/"), priority);
}
uint32 OSystem_3DS::getMillis(bool skipRecord) {
diff --git a/backends/platform/3ds/osystem.h b/backends/platform/3ds/osystem.h
index 6901295640..28d21c3eda 100644
--- a/backends/platform/3ds/osystem.h
+++ b/backends/platform/3ds/osystem.h
@@ -88,6 +88,7 @@ public:
virtual void quit();
virtual Common::String getDefaultConfigFileName();
+ void addSysArchivesToSearchSet(Common::SearchSet &s, int priority) override;
// Graphics
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;