aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/3ds
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/3ds')
-rw-r--r--backends/platform/3ds/3ds.mk7
-rw-r--r--backends/platform/3ds/README.md6
-rw-r--r--backends/platform/3ds/main.cpp10
-rw-r--r--backends/platform/3ds/osystem-graphics.cpp28
-rw-r--r--backends/platform/3ds/osystem.cpp2
-rw-r--r--backends/platform/3ds/osystem.h2
-rw-r--r--backends/platform/3ds/sprite.cpp18
7 files changed, 63 insertions, 10 deletions
diff --git a/backends/platform/3ds/3ds.mk b/backends/platform/3ds/3ds.mk
index 511408f0a0..c6aff90516 100644
--- a/backends/platform/3ds/3ds.mk
+++ b/backends/platform/3ds/3ds.mk
@@ -27,7 +27,7 @@ clean_3ds:
$(RM) $(TARGET).cia
$(RM) -rf romfs
-romfs: $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD)
+romfs: $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_3DS_EXTRA_FILES)
@rm -rf romfs
@mkdir -p romfs
@cp $(DIST_FILES_THEMES) romfs/
@@ -40,6 +40,9 @@ endif
ifdef DIST_FILES_VKEYBD
@cp $(DIST_FILES_VKEYBD) romfs/
endif
+ifdef DIST_3DS_EXTRA_FILES
+ @cp -a $(DIST_3DS_EXTRA_FILES) romfs/
+endif
$(TARGET).smdh: $(APP_ICON)
@smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
@@ -48,7 +51,7 @@ $(TARGET).smdh: $(APP_ICON)
$(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 $@)
diff --git a/backends/platform/3ds/README.md b/backends/platform/3ds/README.md
index 345a046a62..a5e24ee91d 100644
--- a/backends/platform/3ds/README.md
+++ b/backends/platform/3ds/README.md
@@ -202,6 +202,12 @@ Note: In more recent codebases of ScummVM, you may or may not need to set the fo
```$ export PKG_CONFIG_LIBDIR=$PORTLIBS/lib/pkgconfig```
See above for $PORTLIBS.
+ScummVM doesn't provide the CA certificates bundle required by the cloud synchronization features.
+You need to download it from the curl website: https://curl.haxx.se/ca/cacert.pem, and instruct
+the build system to package it in the binary:
+```$ export DIST_3DS_EXTRA_FILES=/path/to/cacert.pem```
+The name of the file must be `cacert.pem`.
+
From the root of the scummvm repository:
```
$ ./configure --host=3ds
diff --git a/backends/platform/3ds/main.cpp b/backends/platform/3ds/main.cpp
index ce549b67c4..18df14b93d 100644
--- a/backends/platform/3ds/main.cpp
+++ b/backends/platform/3ds/main.cpp
@@ -22,6 +22,7 @@
#include "osystem.h"
#include <3ds.h>
+#include <malloc.h>
int main(int argc, char *argv[]) {
// Initialize basic libctru stuff
@@ -31,6 +32,12 @@ int main(int argc, char *argv[]) {
osSetSpeedupEnable(true);
// consoleInit(GFX_TOP, NULL);
+#ifdef USE_LIBCURL
+ const uint32 soc_sharedmem_size = 0x10000;
+ void *soc_sharedmem = memalign(0x1000, soc_sharedmem_size);
+ socInit((u32 *)soc_sharedmem, soc_sharedmem_size);
+#endif
+
g_system = new _3DS::OSystem_3DS();
assert(g_system);
@@ -51,6 +58,9 @@ int main(int argc, char *argv[]) {
gspLcdExit();
}
+#ifdef USE_LIBCURL
+ socExit();
+#endif
romfsExit();
cfguExit();
gfxExit();
diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp
index 56e5e95a83..1a86be4402 100644
--- a/backends/platform/3ds/osystem-graphics.cpp
+++ b/backends/platform/3ds/osystem-graphics.cpp
@@ -86,6 +86,7 @@ void OSystem_3DS::destroyGraphics() {
_gameTopTexture.free();
_gameBottomTexture.free();
_overlay.free();
+ _activityIcon.free();
shaderProgramFree(&_program);
DVLB_Free(_dvlb);
@@ -280,6 +281,7 @@ void OSystem_3DS::updateScreen() {
if (_cursorVisible && config.showCursor) {
_cursorTexture.transfer();
}
+ _activityIcon.transfer();
C3D_FrameEnd(0);
C3D_FrameBegin(0);
@@ -294,6 +296,11 @@ void OSystem_3DS::updateScreen() {
C3D_FVUnifMtx4x4(GPU_VERTEX_SHADER, _modelviewLocation, _overlay.getMatrix());
_overlay.render();
}
+ if (_activityIcon.getPixels() && config.screen == kScreenTop) {
+ _activityIcon.setPosition(400 - _activityIcon.actualWidth, 0);
+ C3D_FVUnifMtx4x4(GPU_VERTEX_SHADER, _modelviewLocation, _activityIcon.getMatrix());
+ _activityIcon.render();
+ }
if (_cursorVisible && config.showCursor && config.screen == kScreenTop) {
C3D_FVUnifMtx4x4(GPU_VERTEX_SHADER, _modelviewLocation, _cursorTexture.getMatrix());
_cursorTexture.render();
@@ -311,6 +318,11 @@ void OSystem_3DS::updateScreen() {
C3D_FVUnifMtx4x4(GPU_VERTEX_SHADER, _modelviewLocation, _overlay.getMatrix());
_overlay.render();
}
+ if (_activityIcon.getPixels()) {
+ _activityIcon.setPosition(320 - _activityIcon.actualWidth, 0);
+ C3D_FVUnifMtx4x4(GPU_VERTEX_SHADER, _modelviewLocation, _activityIcon.getMatrix());
+ _activityIcon.render();
+ }
if (_cursorVisible && config.showCursor) {
C3D_FVUnifMtx4x4(GPU_VERTEX_SHADER, _modelviewLocation, _cursorTexture.getMatrix());
_cursorTexture.render();
@@ -436,6 +448,22 @@ void OSystem_3DS::copyRectToOverlay(const void *buf, int pitch, int x,
_overlay.markDirty();
}
+void OSystem_3DS::displayActivityIconOnOSD(const Graphics::Surface *icon) {
+ if (!icon) {
+ _activityIcon.free();
+ } else {
+ if (!_activityIcon.getPixels() || icon->w != _activityIcon.w || icon->h != _activityIcon.h) {
+ _activityIcon.create(icon->w, icon->h, _pfGameTexture);
+ }
+
+ Graphics::Surface *converted = icon->convertTo(_pfGameTexture);
+ _activityIcon.copyRectToSurface(*converted, 0, 0, Common::Rect(converted->w, converted->h));
+ _activityIcon.markDirty();
+ converted->free();
+ delete converted;
+ }
+}
+
int16 OSystem_3DS::getOverlayHeight() {
return 240;
}
diff --git a/backends/platform/3ds/osystem.cpp b/backends/platform/3ds/osystem.cpp
index 041685d31f..e1186e4bfb 100644
--- a/backends/platform/3ds/osystem.cpp
+++ b/backends/platform/3ds/osystem.cpp
@@ -193,7 +193,7 @@ void OSystem_3DS::fatalError() {
}
void OSystem_3DS::logMessage(LogMessageType::Type type, const char *message) {
- printf("3DS log: %s\n", message);
+ printf("%s", message);
}
} // namespace _3DS
diff --git a/backends/platform/3ds/osystem.h b/backends/platform/3ds/osystem.h
index 28d21c3eda..89271e127b 100644
--- a/backends/platform/3ds/osystem.h
+++ b/backends/platform/3ds/osystem.h
@@ -126,6 +126,7 @@ public:
virtual int16 getOverlayHeight();
virtual int16 getOverlayWidth();
virtual void displayMessageOnOSD(const char *msg);
+ void displayActivityIconOnOSD(const Graphics::Surface *icon) override;
bool showMouse(bool visible);
void warpMouse(int x, int y);
@@ -176,6 +177,7 @@ private:
Sprite _gameTopTexture;
Sprite _gameBottomTexture;
Sprite _overlay;
+ Sprite _activityIcon;
int _screenShakeOffset;
bool _overlayVisible;
diff --git a/backends/platform/3ds/sprite.cpp b/backends/platform/3ds/sprite.cpp
index b2785e2c2d..1f2c72e2d3 100644
--- a/backends/platform/3ds/sprite.cpp
+++ b/backends/platform/3ds/sprite.cpp
@@ -101,7 +101,7 @@ void Sprite::convertToInPlace(const Graphics::PixelFormat &dstFormat, const byte
}
void Sprite::transfer() {
- if (dirtyPixels) {
+ if (pixels && dirtyPixels) {
dirtyPixels = false;
GSPGPU_FlushDataCache(pixels, w * h * format.bytesPerPixel);
C3D_SyncDisplayTransfer((u32*)pixels, GX_BUFFER_DIM(w, h), (u32*)texture.data, GX_BUFFER_DIM(w, h), TEXTURE_TRANSFER_FLAGS);
@@ -123,15 +123,19 @@ void Sprite::clear(uint32 color) {
}
void Sprite::setScale (float x, float y) {
- scaleX = x;
- scaleY = y;
- dirtyMatrix = true;
+ if (x != scaleX || y != scaleY) {
+ scaleX = x;
+ scaleY = y;
+ dirtyMatrix = true;
+ }
}
void Sprite::setPosition(int x, int y) {
- posX = x;
- posY = y;
- dirtyMatrix = true;
+ if (x != posX || y != posY) {
+ posX = x;
+ posY = y;
+ dirtyMatrix = true;
+ }
}
C3D_Mtx* Sprite::getMatrix() {