Migrate to vitasdk
This commit is contained in:
parent
36a196389b
commit
f49b55cbe1
7 changed files with 57 additions and 49 deletions
|
|
@ -134,11 +134,12 @@ jobs:
|
|||
- store_artifacts: {path: ./build/devilutionx, destination: devilutionx_m68k}
|
||||
vita:
|
||||
docker:
|
||||
- image: sarcasticat/dolcesdk:latest
|
||||
- image: vitasdk/vitasdk:latest
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- run: cmake -S. -Bbuild -GNinja .. -DBINARY_RELEASE=ON -DVITA=1
|
||||
- run: apk --no-cache add cmake ninja
|
||||
- run: cmake -S. -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DNIGHTLY_BUILD=ON
|
||||
- run: cmake --build build -j $(nproc)
|
||||
- store_artifacts: {path: ./build/devilutionx.vpk, destination: devilutionx.vpk}
|
||||
|
||||
|
|
|
|||
22
3rdParty/StormLib/src/FileStream.cpp
vendored
22
3rdParty/StormLib/src/FileStream.cpp
vendored
|
|
@ -101,7 +101,7 @@ static bool BaseFile_Create(TFileStream * pStream)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
{
|
||||
intptr_t handle;
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ static bool BaseFile_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
{
|
||||
struct stat64 fileinfo;
|
||||
int oflag = (dwStreamFlags & STREAM_FLAG_READ_ONLY) ? O_RDONLY : O_RDWR;
|
||||
|
|
@ -222,7 +222,7 @@ static bool BaseFile_Read(
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
{
|
||||
ssize_t bytes_read;
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ static bool BaseFile_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
{
|
||||
ssize_t bytes_written;
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ static bool BaseFile_Resize(TFileStream * pStream, ULONGLONG NewFileSize)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
{
|
||||
if(ftruncate64((intptr_t)pStream->Base.File.hFile, (off64_t)NewFileSize) == -1)
|
||||
{
|
||||
|
|
@ -404,7 +404,7 @@ static bool BaseFile_Replace(TFileStream * pStream, TFileStream * pNewStream)
|
|||
return (bool)MoveFile(pNewStream->szFileName, pStream->szFileName);
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
// "rename" on Linux also works if the target file exists
|
||||
if(rename(pNewStream->szFileName, pStream->szFileName) == -1)
|
||||
{
|
||||
|
|
@ -424,7 +424,7 @@ static void BaseFile_Close(TFileStream * pStream)
|
|||
CloseHandle(pStream->Base.File.hFile);
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
close((intptr_t)pStream->Base.File.hFile);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -503,7 +503,7 @@ static bool BaseMap_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
|
|||
return false;
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
struct stat64 fileinfo;
|
||||
intptr_t handle;
|
||||
bool bResult = false;
|
||||
|
|
@ -516,7 +516,7 @@ static bool BaseMap_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
|
|||
if(fstat64(handle, &fileinfo) != -1)
|
||||
{
|
||||
#if !defined(PLATFORM_AMIGA)
|
||||
#if defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
pStream->Base.Map.pbFile = (LPBYTE)malloc((size_t)fileinfo.st_size);
|
||||
#else
|
||||
pStream->Base.Map.pbFile = (LPBYTE)mmap(NULL, (size_t)fileinfo.st_size, PROT_READ, MAP_PRIVATE, handle, 0);
|
||||
|
|
@ -578,11 +578,11 @@ static void BaseMap_Close(TFileStream * pStream)
|
|||
UnmapViewOfFile(pStream->Base.Map.pbFile);
|
||||
#endif
|
||||
|
||||
#if (defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)) && !defined(PLATFORM_AMIGA) && !defined(PLATFORM_SWITCH) && !defined(PLATFORM_CTR)
|
||||
#if (defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU)) && !defined(PLATFORM_AMIGA) && !defined(PLATFORM_SWITCH) && !defined(PLATFORM_CTR) && !defined(PLATFORM_VITA)
|
||||
//Todo(Amiga): Fix a proper solution for this
|
||||
if(pStream->Base.Map.pbFile != NULL)
|
||||
munmap(pStream->Base.Map.pbFile, (size_t )pStream->Base.Map.FileSize);
|
||||
#elif defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#elif defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
if(pStream->Base.Map.pbFile != NULL)
|
||||
free(pStream->Base.Map.pbFile);
|
||||
#endif
|
||||
|
|
|
|||
28
3rdParty/StormLib/src/StormPort.h
vendored
28
3rdParty/StormLib/src/StormPort.h
vendored
|
|
@ -196,6 +196,30 @@
|
|||
|
||||
#endif
|
||||
|
||||
#if !defined(PLATFORM_DEFINED) && defined(__vita__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef __BIG_ENDIAN__
|
||||
#define PLATFORM_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#define PLATFORM_VITA
|
||||
#define PLATFORM_DEFINED
|
||||
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Assumption: we are not on Windows nor Macintosh, so this must be linux *grin*
|
||||
|
||||
|
|
@ -299,7 +323,7 @@
|
|||
#endif // !PLATFORM_WINDOWS
|
||||
|
||||
// 64-bit calls are supplied by "normal" calls on Mac
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(__vita__)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
#define stat64 stat
|
||||
#define fstat64 fstat
|
||||
#define lseek64 lseek
|
||||
|
|
@ -309,7 +333,7 @@
|
|||
#endif
|
||||
|
||||
// Platform-specific error codes for UNIX-based platforms
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR)
|
||||
#if defined(PLATFORM_MAC) || defined(PLATFORM_LINUX) || defined(PLATFORM_HAIKU) || defined(PLATFORM_AMIGA) || defined(PLATFORM_SWITCH) || defined(PLATFORM_CTR) || defined(PLATFORM_VITA)
|
||||
#define ERROR_SUCCESS 0
|
||||
#define ERROR_FILE_NOT_FOUND ENOENT
|
||||
#define ERROR_ACCESS_DENIED EPERM
|
||||
|
|
|
|||
|
|
@ -1,14 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.10) # CMP0083 NEW
|
||||
|
||||
if(VITA)
|
||||
if(DEFINED ENV{DOLCESDK})
|
||||
set(CMAKE_TOOLCHAIN_FILE "$ENV{DOLCESDK}/share/dolce.toolchain.cmake" CACHE PATH "toolchain file")
|
||||
else()
|
||||
message(FATAL_ERROR "Please define DOLCESDK to point to your SDK path!")
|
||||
endif()
|
||||
include("$ENV{DOLCESDK}/share/dolce.cmake" REQUIRED)
|
||||
endif()
|
||||
|
||||
include(CMake/out_of_tree.cmake)
|
||||
include(CMake/genex.cmake)
|
||||
|
||||
|
|
@ -93,6 +84,7 @@ if(SWITCH)
|
|||
endif()
|
||||
|
||||
if(VITA)
|
||||
include("$ENV{VITASDK}/share/vita.cmake" REQUIRED)
|
||||
include(vita_defs)
|
||||
endif()
|
||||
|
||||
|
|
@ -557,28 +549,18 @@ foreach(target devilution ${BIN_TARGET} SourceS)
|
|||
|
||||
if (VITA)
|
||||
target_link_libraries(${target} PRIVATE
|
||||
pib
|
||||
SceDisplay_stub
|
||||
SceCtrl_stub
|
||||
SceAppMgr_stub
|
||||
SceAudio_stub
|
||||
SceSysmodule_stub
|
||||
SceSharedFb_stub
|
||||
SceDisplay_stub
|
||||
SceDisplayUser_stub
|
||||
SceCtrl_stub
|
||||
SceAppMgr_stub
|
||||
SceAppMgrUser_stub
|
||||
SceAudio_stub
|
||||
SceIofilemgr_stub
|
||||
SceSysmodule_stub
|
||||
SceGxm_stub
|
||||
SceGxmInternalForVsh_stub
|
||||
SceCommonDialog_stub
|
||||
SceTouch_stub
|
||||
SceCtrl_stub
|
||||
SceDisplay_stub
|
||||
SceGxm_stub
|
||||
SceHid_stub
|
||||
SceIofilemgr_stub
|
||||
SceMotion_stub
|
||||
ScePower_stub
|
||||
SceSysmodule_stub
|
||||
SceTouch_stub
|
||||
freetype
|
||||
png
|
||||
m
|
||||
|
|
@ -704,10 +686,10 @@ if(VITA)
|
|||
set(VITA_APP_NAME "devilutionX")
|
||||
set(VITA_TITLEID "DVLX00001")
|
||||
set(VITA_VERSION "01.00")
|
||||
set(DOLCE_MKSFOEX_FLAGS "${DOLCE_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
|
||||
set(DOLCE_MKSFOEX_FLAGS "${DOLCE_MKSFOEX_FLAGS} -d ATTRIBUTE2=12")
|
||||
dolce_create_self(devilutionx.self devilutionx UNSAFE)
|
||||
dolce_create_vpk(devilutionx.vpk ${VITA_TITLEID} devilutionx.self
|
||||
set(VITA_MKSFOEX_FLAGS "${DOLCE_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
|
||||
set(VITA_MKSFOEX_FLAGS "${DOLCE_MKSFOEX_FLAGS} -d ATTRIBUTE2=12")
|
||||
vita_create_self(devilutionx.self devilutionx UNSAFE)
|
||||
vita_create_vpk(devilutionx.vpk ${VITA_TITLEID} devilutionx.self
|
||||
VERSION ${VITA_VERSION}
|
||||
NAME ${VITA_APP_NAME}
|
||||
FILE Packaging/vita/sce_sys/icon0.png sce_sys/icon0.png
|
||||
|
|
|
|||
|
|
@ -226,9 +226,10 @@ The output-files will be generated in the build folder.
|
|||
### Compiling
|
||||
```
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DVITA=1 ..
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
```
|
||||
[PlayStation Vita manual](docs/manual/platforms/vita.md)
|
||||
</details>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ void CalculatePreferdWindowSize(int &width, int &height, bool useIntegerScaling)
|
|||
bool SpawnWindow(const char *lpWindowName)
|
||||
{
|
||||
#ifdef __vita__
|
||||
scePowerSetArmClockFrequency(444);
|
||||
scePowerSetArmClockFrequency(444);
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,6)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
```
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DVITA=1 ..
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
```
|
||||
|
||||
|
|
@ -26,8 +26,8 @@ make
|
|||
- □: cast spell, delete character while in main menu
|
||||
- L1: use health item from belt
|
||||
- R1: use mana potion from belt
|
||||
- Left back touch panel: character sheet (alt: Start + ←)
|
||||
- Right back touch panel: inventory (alt: Start + →)
|
||||
- Left back touch panel: character sheet (alt: Start + ←, alt: L2 on ds4)
|
||||
- Right back touch panel: inventory (alt: Start + →, alt: R2 on ds4)
|
||||
- Start + ↓: toggle automap
|
||||
- Start + Select: game menu (alt: Start + ↑)
|
||||
- Select + ×/○/□/△: Spell hotkeys
|
||||
|
|
@ -45,7 +45,7 @@ There's special section `controls` in diablo.ini file, that allows you to adjust
|
|||
switch_potions_and_clicks=0
|
||||
dpad_hotkeys=0
|
||||
enable_second_touchscreen=1
|
||||
sdl2_controller_mapping=50535669746120436f6e74726f6c6c65,PSVita Controller,y:b0,b:b1,a:b2,x:b3,leftshoulder:b4,rightshoulder:b5,dpdown:b6,dpleft:b7,dpup:b8,dpright:b9,back:b10,start:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
sdl2_controller_mapping=50535669746120436f6e74726f6c6c65,PSVita Controller,y:b0,b:b1,a:b2,x:b3,leftshoulder:b4,rightshoulder:b5,dpdown:b6,dpleft:b7,dpup:b8,dpright:b9,back:b10,start:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,leftstick:b14,rightstick:b15,
|
||||
```
|
||||
|
||||
- **dpad_hotkeys:** dpad works as hotkeys without holding Start button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue