Remove vita for now

This commit is contained in:
2026-07-16 15:50:19 -05:00
parent 78cd973a33
commit dcf5f434c5
20 changed files with 2 additions and 611 deletions
+2 -4
View File
@@ -124,18 +124,16 @@ Set `DUSK_TARGET_SYSTEM` at CMake configure time to select a platform:
| `linux` | `DUSK_LINUX` | Linux desktop |
| `knulli` | `DUSK_KNULLI` | Knulli (handheld)|
| `psp` | `DUSK_PSP` | Sony PSP |
| `vita` | `DUSK_VITA` | PlayStation Vita |
| `gamecube` | `DUSK_GAMECUBE` | Nintendo GameCube|
| `wii` | `DUSK_WII` | Nintendo Wii |
### Layer structure
```
src/dusk/ core, platform-agnostic game logic
src/duskgl/ OpenGL abstraction (Linux, Knulli, PSP, Vita)
src/dusksdl2/ SDL2 window + input (Linux, Knulli, PSP, Vita)
src/duskgl/ OpenGL abstraction (Linux, Knulli, PSP)
src/dusksdl2/ SDL2 window + input (Linux, Knulli, PSP)
src/dusklinux/ Linux + Knulli platform impl
src/duskpsp/ PSP platform impl
src/duskvita/ Vita platform impl
src/duskdolphin/ GameCube / Wii platform impl (no SDL2/OpenGL)
```
-88
View File
@@ -1,88 +0,0 @@
# Copyright (c) 2026 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
if(NOT DEFINED ENV{VITASDK})
message(FATAL_ERROR "VITASDK environment variable is not set.")
endif()
include("$ENV{VITASDK}/share/vita.cmake" REQUIRED)
set(VITA_APP_NAME "Dusk")
set(VITA_TITLEID "DUSK00001")
set(VITA_VERSION "01.00")
find_package(SDL2 REQUIRED)
# Custom flags for cglm
set(CGLM_SHARED OFF CACHE BOOL "Build cglm shared" FORCE)
set(CGLM_STATIC ON CACHE BOOL "Build cglm static" FORCE)
find_package(cglm REQUIRED)
# Link libraries
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
${SDL2_LIBRARIES}
cglm
SDL2
SDL2main
zip
bz2
z
zstd
crypto
lzma
m
pthread
stdc++
vitaGL
mathneon
vitashark
kubridge_stub
SceAppMgr_stub
SceAudio_stub
SceCtrl_stub
SceCommonDialog_stub
SceDisplay_stub
SceKernelDmacMgr_stub
SceGxm_stub
SceShaccCg_stub
SceSysmodule_stub
ScePower_stub
SceTouch_stub
SceVshBridge_stub
SceIofilemgr_stub
SceShaccCgExt
libtaihen_stub.a
# SceKernel_stub
SceAppUtil_stub
SceHid_stub
SceRtc_stub
)
target_include_directories(${DUSK_LIBRARY_TARGET_NAME} PRIVATE
${SDL2_INCLUDE_DIRS}
)
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
DUSK_SDL2
DUSK_OPENGL
DUSK_VITA
DUSK_INPUT_GAMEPAD
DUSK_PLATFORM_ENDIAN_LITTLE
DUSK_OPENGL_LEGACY
DUSK_DISPLAY_WIDTH=960
DUSK_DISPLAY_HEIGHT=544
)
# Post-build: create SELF from the ELF binary (UNSAFE = homebrew, no signing)
vita_create_self(${DUSK_BINARY_TARGET_NAME}.self ${DUSK_BINARY_TARGET_NAME} UNSAFE)
# Post-build: package SELF + assets into a .vpk installable on the Vita
vita_create_vpk(${DUSK_BINARY_TARGET_NAME}.vpk ${VITA_TITLEID} ${DUSK_BINARY_TARGET_NAME}.self
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
FILE ${DUSK_ASSETS_ZIP} dusk.dsk
)
-5
View File
@@ -15,11 +15,6 @@ elseif(DUSK_TARGET_SYSTEM STREQUAL "psp")
add_subdirectory(dusksdl2)
add_subdirectory(duskgl)
elseif(DUSK_TARGET_SYSTEM STREQUAL "vita")
add_subdirectory(duskvita)
add_subdirectory(dusksdl2)
add_subdirectory(duskgl)
elseif(DUSK_TARGET_SYSTEM STREQUAL "wii" OR DUSK_TARGET_SYSTEM STREQUAL "gamecube")
add_subdirectory(duskdolphin)
-21
View File
@@ -1,21 +0,0 @@
# Copyright (c) 2026 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Includes
target_include_directories(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)
# Sources
target_sources(${DUSK_BINARY_TARGET_NAME}
PUBLIC
)
# Subdirs
add_subdirectory(asset)
add_subdirectory(input)
add_subdirectory(log)
add_subdirectory(save)
-10
View File
@@ -1,10 +0,0 @@
# Copyright (c) 2026 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
assetvita.c
)
-13
View File
@@ -1,13 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "assetvita.h"
typedef assetvita_t assetplatform_t;
#define assetInitPlatform assetInitVita
#define assetDisposePlatform assetDisposeVita
-22
View File
@@ -1,22 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "asset/asset.h"
#include "assert/assert.h"
errorret_t assetInitVita(void) {
int32_t error;
ASSET.zip = zip_open(ASSET_VITA_DSK_PATH, ZIP_RDONLY, &error);
if(ASSET.zip == NULL) {
errorThrow("Failed to open asset file: " ASSET_VITA_DSK_PATH);
}
errorOk();
}
errorret_t assetDisposeVita(void) {
errorOk();
}
-30
View File
@@ -1,30 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "error/error.h"
// dusk.dsk is packaged at the root of the VPK and accessible via app0:/
#define ASSET_VITA_DSK_PATH "app0:/" ASSET_FILE_NAME
typedef struct {
uint8_t _unused;
} assetvita_t;
/**
* Initializes the Vita asset system, opening dusk.dsk from the VPK mount.
*
* @returns An errorret_t indicating success or failure.
*/
errorret_t assetInitVita(void);
/**
* Disposes the Vita asset system.
*
* @returns An errorret_t indicating success or failure.
*/
errorret_t assetDisposeVita(void);
-16
View File
@@ -1,16 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "display/displaysdl2.h"
typedef displaysdl2_t displayplatform_t;
#define displayPlatformInit displaySDL2Init
#define displayPlatformUpdate displaySDL2Update
#define displayPlatformSwap displaySDL2Swap
#define displayPlatformDispose displaySDL2Dispose
-23
View File
@@ -1,23 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <vitasdk.h>
#define GL_COLOR_INDEX8_EXT 0x80E5
#define GL_NO_ERROR 0
#define glDrawArrays(type, first, count) ((void)0)
#define glColorTableEXT( \
target, internalformat, count, format, type, pixels) ((void)0)
#define glDepthFunc(func) ((void)0)
#define glBlendFunc(sfactor, dfactor) ((void)0)
#define glGetError() GL_NO_ERROR
#define GL_GLEXT_PROTOTYPES
typedef uint32_t GLbitfield;
#include "dusksdl2.h"
-10
View File
@@ -1,10 +0,0 @@
# Copyright (c) 2026 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
inputvita.c
)
-87
View File
@@ -1,87 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "input/input.h"
inputbuttondata_t INPUT_BUTTON_DATA[] = {
{ .name = "triangle", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_Y } },
{ .name = "cross", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_A } },
{ .name = "circle", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_B } },
{ .name = "square", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_X } },
{ .name = "start", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_START } },
{ .name = "select", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_BACK } },
{ .name = "up", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_UP } },
{ .name = "down", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_DOWN } },
{ .name = "left", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_LEFT } },
{ .name = "right", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_RIGHT } },
{ .name = "l", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_LEFTSHOULDER } },
{ .name = "r", {
.type = INPUT_BUTTON_TYPE_GAMEPAD,
.gpButton = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER } },
{ .name = "lstick_down", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_LEFTY, .positive = true } } },
{ .name = "lstick_up", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_LEFTY, .positive = false } } },
{ .name = "lstick_right", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_LEFTX, .positive = true } } },
{ .name = "lstick_left", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_LEFTX, .positive = false } } },
{ .name = "rstick_down", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_RIGHTY, .positive = true } } },
{ .name = "rstick_up", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_RIGHTY, .positive = false } } },
{ .name = "rstick_right", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_RIGHTX, .positive = true } } },
{ .name = "rstick_left", {
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
.gpAxis = {
.axis = SDL_CONTROLLER_AXIS_RIGHTX, .positive = false } } },
{ .name = NULL }
};
float_t inputGetDeadzoneSDL2(const inputbutton_t button) {
return 0.17f;
}
-10
View File
@@ -1,10 +0,0 @@
# Copyright (c) 2026 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
log.c
)
-52
View File
@@ -1,52 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "log/log.h"
void logDebug(const char_t *message, ...) {
va_list args;
va_start(args, message);
// print to stdout
va_list copy;
va_copy(copy, args);
vprintf(message, copy);
va_end(copy);
// print to file
FILE *file = fopen("ux0:data/Dusk/debug.log", "a");
if(file) {
va_copy(copy, args);
vfprintf(file, message, copy);
va_end(copy);
fclose(file);
}
va_end(args);
}
void logError(const char_t *message, ...) {
va_list args;
va_start(args, message);
// print to stderr
va_list copy;
va_copy(copy, args);
vfprintf(stderr, message, copy);
va_end(copy);
// print to file
FILE *file = fopen("ux0:data/Dusk/error.log", "a");
if(file) {
va_copy(copy, args);
vfprintf(file, message, copy);
va_end(copy);
fclose(file);
}
va_end(args);
}
-11
View File
@@ -1,11 +0,0 @@
# Copyright (c) 2026 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DUSK_LIBRARY_TARGET_NAME}
PUBLIC
savevita.c
savestreamvita.c
)
-30
View File
@@ -1,30 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "save/savevita.h"
#include "save/savestreamvita.h"
typedef savevita_t saveplatform_t;
typedef savestreamvita_t saveplatformstream_t;
#define saveInitPlatform saveInitVita
#define saveDisposePlatform saveDisposeVita
#define saveDeletePlatform saveDeleteVita
#define saveStreamOpenReadPlatform(stream, slot) \
saveStreamOpenReadVita(&(stream)->platform, &(stream)->found, slot)
#define saveStreamOpenWritePlatform(stream, slot) \
saveStreamOpenWriteVita(&(stream)->platform, slot)
#define saveStreamClosePlatform(stream) \
saveStreamCloseVita(&(stream)->platform)
#define saveStreamReadBytesPlatform(stream, buf, len) \
saveStreamReadBytesVita(&(stream)->platform, buf, len)
#define saveStreamWriteBytesPlatform(stream, buf, len) \
saveStreamWriteBytesVita(&(stream)->platform, buf, len)
#define saveStreamSeekPlatform(stream, pos) \
saveStreamSeekVita(&(stream)->platform, pos)
-77
View File
@@ -1,77 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "save/save.h"
#include "save/savestreamvita.h"
errorret_t saveStreamOpenReadVita(
savestreamvita_t *p, bool_t *found, const uint8_t slot
) {
char_t path[SAVE_VITA_PATH_MAX];
snprintf(path, SAVE_VITA_PATH_MAX, SAVE_VITA_FILE_FORMAT,
SAVE_VITA_TITLE_ID, (uint32_t)slot
);
p->fd = sceIoOpen(path, SCE_O_RDONLY, 0);
*found = (p->fd >= 0);
errorOk();
}
errorret_t saveStreamOpenWriteVita(savestreamvita_t *p, const uint8_t slot) {
char_t dir[SAVE_VITA_PATH_MAX];
snprintf(dir, SAVE_VITA_PATH_MAX, SAVE_VITA_DIR_FORMAT,
SAVE_VITA_TITLE_ID, (uint32_t)slot
);
sceIoMkdir(dir, 0777);
char_t path[SAVE_VITA_PATH_MAX];
snprintf(path, SAVE_VITA_PATH_MAX, SAVE_VITA_FILE_FORMAT,
SAVE_VITA_TITLE_ID, (uint32_t)slot
);
p->fd = sceIoOpen(path, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);
if(p->fd < 0) {
errorThrow(
"Failed to open Vita save file for writing: slot %u", (uint32_t)slot
);
}
errorOk();
}
void saveStreamCloseVita(savestreamvita_t *p) {
if(p->fd >= 0) {
sceIoClose(p->fd);
p->fd = -1;
}
}
errorret_t saveStreamReadBytesVita(
savestreamvita_t *p, void *buf, const size_t len
) {
int32_t read = sceIoRead(p->fd, buf, (SceSize)len);
if(read != (int32_t)len) {
errorThrow("Unexpected end of Vita save file");
}
errorOk();
}
errorret_t saveStreamWriteBytesVita(
savestreamvita_t *p, const void *buf, const size_t len
) {
int32_t written = sceIoWrite(p->fd, buf, (SceSize)len);
if(written != (int32_t)len) {
errorThrow("Failed to write Vita save data");
}
errorOk();
}
errorret_t saveStreamSeekVita(savestreamvita_t *p, const size_t pos) {
if(sceIoLseek(p->fd, (SceOff)pos, SCE_SEEK_SET) < 0) {
errorThrow("Failed to seek in Vita save file");
}
errorOk();
}
-78
View File
@@ -1,78 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "error/error.h"
#include <psp2/io/fcntl.h>
#include <psp2/io/stat.h>
#include <stddef.h>
typedef struct {
SceUID fd;
} savestreamvita_t;
/**
* Opens a Vita save data file for reading.
*
* @param p Stream to initialize.
* @param found Set to true if the file exists, false if it does not.
* @param slot Save slot index.
* @return An error if the open fails for a reason other than missing file.
*/
errorret_t saveStreamOpenReadVita(
savestreamvita_t *p, bool_t *found, const uint8_t slot
);
/**
* Opens a Vita save data file for writing, creating or truncating it.
* Creates the save data directory if it does not already exist.
*
* @param p Stream to initialize.
* @param slot Save slot index.
* @return An error if the file cannot be opened for writing.
*/
errorret_t saveStreamOpenWriteVita(savestreamvita_t *p, const uint8_t slot);
/**
* Closes the file descriptor held by the stream.
*
* @param p Stream to close.
*/
void saveStreamCloseVita(savestreamvita_t *p);
/**
* Reads len bytes from the stream into buf.
*
* @param p Active stream.
* @param buf Destination buffer.
* @param len Number of bytes to read.
* @return An error if fewer than len bytes are available.
*/
errorret_t saveStreamReadBytesVita(
savestreamvita_t *p, void *buf, const size_t len
);
/**
* Writes len bytes from buf into the stream.
*
* @param p Active stream.
* @param buf Source buffer.
* @param len Number of bytes to write.
* @return An error if the write fails.
*/
errorret_t saveStreamWriteBytesVita(
savestreamvita_t *p, const void *buf, const size_t len
);
/**
* Seeks to an absolute byte position within the stream.
*
* @param p Active stream.
* @param pos Target byte offset from the start of the file.
* @return An error if the seek fails.
*/
errorret_t saveStreamSeekVita(savestreamvita_t *p, const size_t pos);
@@ -1,11 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "moduleplatformvita.h"
#define modulePlatformPlatform modulePlatformVita
@@ -1,13 +0,0 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "script/scriptmanager.h"
void modulePlatformVita(void) {
scriptManagerExec("VITA = true\n", NULL);
}