diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a6b58e1..3d8f0808 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -460,3 +460,40 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.extract_tag.outputs.tag_name }} files: projects/*.zip + + build-vita: + runs-on: ubuntu-latest + container: vitasdk/vitasdk:latest + steps: + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + - name: Install required libraries + run: | + apk add git zip unzip grep py3-pillow + + - name: Build VITA + working-directory: projects + run: make PLATFORM=VITA + + - name: Package build + working-directory: projects + run: | + curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.1.zip + unzip lgpt-resources.zip + mv lgpt-resources-1.1/*/ ./resources/packaging + rm -rf lgpt-resources* + ./resources/packaging/lgpt_package.sh + + - name: Extract Git tag name + id: extract_tag + run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}" + env: + GITHUB_REF: ${{ github.ref }} + + - name: Upload build release + uses: softprops/action-gh-release@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ steps.extract_tag.outputs.tag_name }} + files: ./projects/*.zip diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 41899ad3..df5b7cb2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -444,3 +444,34 @@ jobs: name: LGPT-${{ github.job }}-${{ github.sha }}.zip path: projects/*.zip if-no-files-found: error + + vita: + runs-on: ubuntu-latest + container: vitasdk/vitasdk:latest + steps: + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + - name: Install required libraries + run: | + apk add git zip unzip grep py3-pillow + + - name: Build VITA + working-directory: projects + run: make PLATFORM=VITA + + - name: Package build + working-directory: projects + run: | + curl -L -o lgpt-resources.zip https://github.com/djdiskmachine/lgpt-resources/archive/refs/tags/1.1.zip + unzip lgpt-resources.zip + mv lgpt-resources-1.1/*/ ./resources/packaging + rm -rf lgpt-resources* + ./resources/packaging/lgpt_package.sh + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: LGPT-${{ github.job }}-${{ github.sha }}.zip + path: projects/*.zip + if-no-files-found: error diff --git a/README.md b/README.md index a199ef6e..231f484b 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Recommended reading to get you started: | GARLICPLUS | MAYBE | NO | YES | Port by [Simotek](http://simotek.net)| | RG35XXPLUS | MAYBE | NO | YES | Port by [Simotek](http://simotek.net)| | MACOS | YES | YES | NO | Port by [clsource](https://genserver.social/clsource) | +| VITA | NO | NO | YES | | * **Soundfont library is currently not ported for 64bit OS** diff --git a/projects/Makefile b/projects/Makefile index 60aa3825..d00cde0c 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -198,6 +198,18 @@ PSPDIRS := \ ../sources/Adapters/SDL/GUI \ ../sources/Adapters/SDL/Timer +VITADIRS := \ + . \ + ../sources/Adapters/VITA/Main \ + ../sources/Adapters/VITA/FileSystem \ + ../sources/System/Process \ + ../sources/Adapters/VITA/System \ + ../sources/Adapters/Dummy/Midi \ + ../sources/Adapters/SDL2/Process \ + ../sources/Adapters/SDL2/Audio \ + ../sources/Adapters/SDL2/GUI \ + ../sources/Adapters/SDL2/Timer + GP32DIRS := .\ ../sources/Adapters/GP32FileSystem \ ../sources/Adapters/GP32Midi \ @@ -439,6 +451,20 @@ PSPFILES := \ SDLTimer.o \ PSPSystem.o +VITAFILES := \ + VITAmain.o \ + VITAFileSystem.o \ + Process.o \ + DummyMidi.o \ + GUIFactory.o \ + SDLGUIWindowImp.o \ + SDLEventManager.o \ + SDLAudioDriver.o \ + SDLAudio.o \ + SDLProcess.o \ + SDLTimer.o \ + VITASystem.o + #--------------------------------------------------------------------------------- # Windows #--------------------------------------------------------------------------------- diff --git a/projects/Makefile.VITA b/projects/Makefile.VITA new file mode 100644 index 00000000..d4901d57 --- /dev/null +++ b/projects/Makefile.VITA @@ -0,0 +1,62 @@ +-include $(PWD)/rules_base + +DEFINES := \ + -DPLATFORM_$(PLATFORM) \ + -DBUFFERED \ + -DCPP_MEMORY \ + -DHAVE_STDINT_H \ + -DSDL2 \ + -DNDEBUG + + +DEVKIT = /usr/local/vitasdk/ +CROSS_COMPILE=$(DEVKIT)bin/arm-vita-eabi- + +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +STRIP = $(CROSS_COMPILE)strip +SYSROOT := $(shell $(CROSS_COMPILE)gcc --print-sysroot) +SDL_CFLAGS := $(shell $(SYSROOT)/bin/sdl2-config --cflags) +SDL_LIBS := $(shell $(SYSROOT)/bin/sdl2-config --libs) + +INCLUDES = -Iinclude $(SDL_CFLAGS) -I$(PWD)/../sources +OPT_FLAGS = -O3 -g -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -ftree-vectorize -ffast-math -fsigned-char -fno-optimize-sibling-calls -fno-rtti + +TOOLPATH=$(DEVKIT)/bin +PREFIX := arm-bita-eabi- + +CFLAGS := $(DEFINES) $(INCLUDES) $(SDL_CFLAGS) $(OPT_FLAGS) +CXXFLAGS:= $(CFLAGS) -std=gnu++03 +LIBS := -lSDL_mixer $(SDL_LIBS) +LDFLAGS := $(LDFLAGS) -Wl,-q -Wl,-z,nocopyreloc +LIBDIRS := $(DEKVIT)/lib +LIBDIRS += $(DEKVIT)/arm-vita-eabi/lib +OUTPUT = ../lgpt-vita +EXTENSION:= vpk + +#--------------------------------------------------------------------------------- +%.vpk: %.bin %.sfo + vita-make-fself $< $@ + vita-pack-vpk -s ../lgpt-vita.sfo -b $< \ + --add ../resources/VITA/sce_sys=sce_sys \ + $@ + @echo built ... $(notdir $@) + +#--------------------------------------------------------------------------------- +%.sfo: + vita-mksfoex -s TITLE_ID="LGPT00001" "Piggy Tracker" $@ + +#--------------------------------------------------------------------------------- +%.bin: %.velf + vita-make-fself $< $@ + @echo built ... $(notdir $@) + +#--------------------------------------------------------------------------------- +%.velf: %.elf + vita-elf-create -s $< $@ + @echo built ... $(notdir $@) + +#--------------------------------------------------------------------------------- + +%.elf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) \ No newline at end of file diff --git a/projects/README.md b/projects/README.md index 03e885ac..e0ff96c2 100644 --- a/projects/README.md +++ b/projects/README.md @@ -110,3 +110,9 @@ From repo root: cp pre-commit ./git/hooks tar -xf rg35xx-plus-aarch64-SDL2-SDK-0.1.0.tar.xz Build with: make PLATFORM=RG35XXPLUS + +##### VITA: Compile under linux/WSL2 + Install vitasdk: + https://vitasdk.org/ + Build with: + make PLATFORM=VITA diff --git a/projects/resources/VITA/INSTALL_HOW_TO.txt b/projects/resources/VITA/INSTALL_HOW_TO.txt new file mode 100644 index 00000000..ebd66248 --- /dev/null +++ b/projects/resources/VITA/INSTALL_HOW_TO.txt @@ -0,0 +1,5 @@ +Install bin/lgpt-vita.vpk via vitashell + +Copy samplelib, and optionally demo track (lgpt_BETA) and bin/*.xml configs to ux0:/data/lgpt/ + +Enjoy! \ No newline at end of file diff --git a/projects/resources/VITA/config.xml b/projects/resources/VITA/config.xml new file mode 100644 index 00000000..35c18569 --- /dev/null +++ b/projects/resources/VITA/config.xml @@ -0,0 +1,21 @@ + + > + + + + + + + + + + + + + + + + + + + diff --git a/projects/resources/VITA/mapping.xml b/projects/resources/VITA/mapping.xml new file mode 100644 index 00000000..c0604f7b --- /dev/null +++ b/projects/resources/VITA/mapping.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + diff --git a/projects/resources/VITA/sce_sys/icon0.png b/projects/resources/VITA/sce_sys/icon0.png new file mode 100644 index 00000000..3eae2018 Binary files /dev/null and b/projects/resources/VITA/sce_sys/icon0.png differ diff --git a/projects/resources/VITA/sce_sys/livearea/contents/bg.png b/projects/resources/VITA/sce_sys/livearea/contents/bg.png new file mode 100644 index 00000000..e469f5ec Binary files /dev/null and b/projects/resources/VITA/sce_sys/livearea/contents/bg.png differ diff --git a/projects/resources/VITA/sce_sys/livearea/contents/startup.png b/projects/resources/VITA/sce_sys/livearea/contents/startup.png new file mode 100644 index 00000000..27c4d2de Binary files /dev/null and b/projects/resources/VITA/sce_sys/livearea/contents/startup.png differ diff --git a/projects/resources/VITA/sce_sys/livearea/contents/template.xml b/projects/resources/VITA/sce_sys/livearea/contents/template.xml new file mode 100644 index 00000000..a4d43f01 --- /dev/null +++ b/projects/resources/VITA/sce_sys/livearea/contents/template.xml @@ -0,0 +1,11 @@ + + + + + bg.png + + + + startup.png + + diff --git a/projects/resources/packaging/lgpt_package.sh b/projects/resources/packaging/lgpt_package.sh index 03f9ea21..0c3d42f0 100755 --- a/projects/resources/packaging/lgpt_package.sh +++ b/projects/resources/packaging/lgpt_package.sh @@ -60,3 +60,4 @@ collect_resources RG35XXPLUS lgpt-rg35xxplus.elf collect_resources MACOS LittleGPTracker.app # collect_resources RS97 lgpt.dge # collect_resources STEAM lgpt.steam-exe +collect_resources VITA lgpt-vita.vpk diff --git a/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp index 7f4eb05a..3a41baa0 100644 --- a/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp +++ b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp @@ -44,6 +44,11 @@ SDLGUIWindowImp::SDLGUIWindowImp(GUICreateWindowParams &p) int screenWidth = 480; int screenHeight = 272; windowed_ = false; + #elif defined(PLATFORM_VITA) + int screenWidth = 960; + int screenHeight = 544; + windowed_ = false; + mult_ = 2; #elif defined(RS97) int screenWidth = 320; int screenHeight = 240; @@ -78,8 +83,10 @@ SDLGUIWindowImp::SDLGUIWindowImp(GUICreateWindowParams &p) windowed_ = false; } - #ifdef PLATFORM_PSP + #if defined(PLATFORM_PSP) mult_ = 1; + #elif defined(PLATFORM_VITA) + mult_ = 2; #else int multFromSize=MIN(screenHeight/appHeight,screenWidth/appWidth); const char *mult=Config::GetInstance()->GetValue("SCREENMULT") ; diff --git a/sources/Adapters/SDL2/Process/SDLProcess.cpp b/sources/Adapters/SDL2/Process/SDLProcess.cpp index 90719c30..028855b9 100644 --- a/sources/Adapters/SDL2/Process/SDLProcess.cpp +++ b/sources/Adapters/SDL2/Process/SDLProcess.cpp @@ -9,7 +9,7 @@ int _SDLStartThread(void *argp) { } bool SDLProcessFactory::BeginThread(SysThread& thread) { - SDL_CreateThread(_SDLStartThread,&thread); + SDL_CreateThread(_SDLStartThread,"lgtp",&thread); return true ; } diff --git a/sources/Adapters/VITA/FileSystem/VITAFileSystem.cpp b/sources/Adapters/VITA/FileSystem/VITAFileSystem.cpp new file mode 100644 index 00000000..2b0b1e2e --- /dev/null +++ b/sources/Adapters/VITA/FileSystem/VITAFileSystem.cpp @@ -0,0 +1,179 @@ + +#include "VITAFileSystem.h" +#include "System/Console/Trace.h" +#include +#include +#include +#include + +#include +#include + +VITAFile::VITAFile(SceUID file) { + file_=file ; + writeBufferPos_=0 ; +} + +VITAFile::~VITAFile() { +} + +int VITAFile::Read(void *ptr,int size, int nmemb) { + return sceIoRead(file_,ptr,size*nmemb); +} + +void VITAFile::flush() { + if (writeBufferPos_>0) { + sceIoWrite(file_,writeBuffer_,writeBufferPos_); + } + writeBufferPos_=0 ; +} + +int VITAFile::Write(const void *ptr,int size, int nmemb) { + int len=size*nmemb ; + if (writeBufferPos_+len>WRITE_BUFFER_SIZE) { + flush() ; + } + if (len>WRITE_BUFFER_SIZE) { + sceIoWrite(file_,ptr,len); + } else { + memcpy(writeBuffer_+writeBufferPos_,ptr,len) ; + writeBufferPos_+=len ; + } + return len ; +} + +void VITAFile::Printf(const char *fmt, ...) { + char buffer[1024] ; + va_list args; + va_start(args,fmt); + + vsprintf(buffer,fmt,args ); + Write(buffer,strlen(buffer),1) ; + va_end(args); +} + +void VITAFile::Seek(long offset,int whence) { + sceIoLseek(file_,offset,whence); +} + +long VITAFile::Tell() { + return sceIoLseek(file_,0,SEEK_CUR); +} + +void VITAFile::Close() { + flush() ; + sceIoClose(file_) ; +} +// + +VITADir::VITADir(const char *path):I_Dir(path) { +} + +void VITADir::GetContent(char *mask) { + + Empty() ; + + SceIoDirent de; + memset(&de,0,sizeof(SceIoDirent)); + + SceUID fd=sceIoDopen(path_); + if(fd<0) { + Trace::Error("Failed to open %s",path_); + return; + } + + if (!(strcmp(path_, "ux0:/data/lgpt") == 0 || strcmp(path_, "ux0:/data/lgpt/") == 0)) { + std::string fullpath=path_ ; + if (path_[strlen(path_)-1]!='/') { + fullpath+="/" ; + } + fullpath+=".." ; + + Path *path=new Path(fullpath.c_str()) ; + Insert(path) ; + } + + SceUID v=sceIoDread(fd,&de); + char nameBuffer[256] ; + + while(v!=0) { + + // See if matches current mask + int len=strlen(de.d_name) ; + for (int i=0;i0) { + vitaFile=new VITAFile(file) ; + } + return vitaFile ; +} + +FileType VITAFileSystem::GetFileType(const char *path) { + + struct stat attributes ; + if (stat(path,&attributes)==0) + { + if (attributes.st_mode&S_IFDIR) return FT_DIR ; + if (attributes.st_mode&S_IFREG) return FT_FILE ; + } + return FT_UNKNOWN ; + +} + +void VITAFileSystem::Delete(const char *path) { + sceIoRemove(path); +} + +Result VITAFileSystem::MakeDir(const char *path) { + int retval = sceIoMkdir(path,0777); + if (retval != 0) + { + std::ostringstream oss ; + oss << "MakeDir failed with code " << retval; + return Result(oss.str()); + } + return Result::NoError; +} \ No newline at end of file diff --git a/sources/Adapters/VITA/FileSystem/VITAFileSystem.h b/sources/Adapters/VITA/FileSystem/VITAFileSystem.h new file mode 100644 index 00000000..f77b4ec0 --- /dev/null +++ b/sources/Adapters/VITA/FileSystem/VITAFileSystem.h @@ -0,0 +1,46 @@ + +#ifndef _VITA_FILESYSTEM_H_ +#define _VITA_FILESYSTEM_H_ + +#include "System/FileSystem/FileSystem.h" +#include +#include +#include + +#define WRITE_BUFFER_SIZE 1024 + +class VITAFile: public I_File { +public: + VITAFile(SceUID) ; + virtual ~VITAFile() ; + virtual int Read(void *ptr, int size, int nmemb) ; + virtual int Write(const void *ptr, int size, int nmemb) ; + virtual void Printf(const char *format,...); + virtual void Seek(long offset,int whence) ; + virtual long Tell() ; + virtual void Close() ; +protected: + void flush() ; +private: + SceUID file_ ; + unsigned char writeBuffer_[WRITE_BUFFER_SIZE] ; + int writeBufferPos_ ; + +} ; + +class VITADir: public I_Dir { +public: + VITADir(const char *path) ; + virtual ~VITADir() {} ; + virtual void GetContent(char *mask) ; +} ; + +class VITAFileSystem: public FileSystem { +public: + virtual I_File *Open(const char *path,char *mode); + virtual I_Dir *Open(const char *path) ; + virtual FileType GetFileType(const char *path) ; + virtual Result MakeDir(const char *path) ; + virtual void Delete(const char *path) ; +} ; +#endif diff --git a/sources/Adapters/VITA/Main/VITAmain.cpp b/sources/Adapters/VITA/Main/VITAmain.cpp new file mode 100644 index 00000000..b3f82169 --- /dev/null +++ b/sources/Adapters/VITA/Main/VITAmain.cpp @@ -0,0 +1,30 @@ +#include "Application/Application.h" +#include "Adapters/VITA/System/VITASystem.h" +#include "Foundation/T_Singleton.h" +#include +#include +#include "Adapters/SDL2/GUI/SDLGUIWindowImp.h" +#include "Application/Persistency/PersistencyService.h" +#include "Adapters/SDL2/GUI/SDLGUIWindowImp.h" + +#include + +/* Define printf, just to make typing easier */ +#define printf sceClibPrintf + +int _newlib_heap_size_user = 100*1024*1024; + +int main(int argc,char *argv[]) +{ + VITASystem::Boot(argc,argv) ; + + SDLCreateWindowParams params ; + params.title="littlegptracker" ; + params.cacheFonts_=false ; + params.framebuffer_=false ; + Application::GetInstance()->Init(params) ; + VITASystem::MainLoop() ; + VITASystem::Shutdown() ; + return 0 ; +} + diff --git a/sources/Adapters/VITA/System/VITASystem.cpp b/sources/Adapters/VITA/System/VITASystem.cpp new file mode 100644 index 00000000..633185ed --- /dev/null +++ b/sources/Adapters/VITA/System/VITASystem.cpp @@ -0,0 +1,154 @@ + +#include "VITASystem.h" +#include "Adapters/Dummy/Midi/DummyMidi.h" +#include "Adapters/SDL2/Audio/SDLAudio.h" +#include "Adapters/SDL2/GUI/SDLEventManager.h" +#include "Adapters/SDL2/GUI/GUIFactory.h" +#include "Adapters/SDL2/GUI/SDLGUIWindowImp.h" +#include "Adapters/SDL2/Process/SDLProcess.h" +#include "Adapters/VITA/FileSystem/VITAFileSystem.h" +#include "Adapters/SDL2/Timer/SDLTimer.h" +#include "Application/Model/Config.h" +#include "System/Console/Logger.h" +#include +#include +#include +#include + +#include +#include +#include + +EventManager *VITASystem::eventManager_ = NULL ; + +int VITASystem::MainLoop() +{ + eventManager_->InstallMappings() ; + return eventManager_->MainLoop() ; +} ; + +void VITASystem::Boot(int argc,char **argv) { + // Install System + System::Install(new VITASystem()) ; + + // Install FileSystem + FileSystem::Install(new VITAFileSystem()) ; + FileSystem::GetInstance()->MakeDir("ux0:/data/lgpt/"); + + Path::SetAlias("bin","ux0:/data/lgpt") ; + Path::SetAlias("root","ux0:/data/lgpt") ; + + Config::GetInstance()->ProcessArguments(argc,argv) ; + + Path logPath("bin:lgpt.log"); + FileLogger *fileLogger=new FileLogger(logPath); + + if(fileLogger->Init().Succeeded()) + { + Trace::GetInstance()->SetLogger(*fileLogger); + } + + // Install GUI Factory + I_GUIWindowFactory::Install(new GUIFactory()) ; + + // Install Timers + TimerService::GetInstance()->Install(new SDLTimerService()) ; + + // Install Sound + AudioSettings hints ; + hints.bufferSize_ = 1024 ; + hints.preBufferCount_ = 8 ; + Audio::Install(new SDLAudio(hints)) ; + + // Install Midi + MidiService::Install(new DummyMidi()) ; + + // Install Threads + + SysProcessFactory::Install(new SDLProcessFactory()) ; + + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|SDL_INIT_TIMER) < 0 ) { + return; + } +#ifndef SDL2 + SDL_EnableUNICODE(1); +#endif + SDL_ShowCursor(SDL_DISABLE); + + atexit(SDL_Quit); + + eventManager_=I_GUIWindowFactory::GetInstance()->GetEventManager() ; + eventManager_->Init() ; + + // VITA SDL Basic config + + bool invert=false ; + Config *config=Config::GetInstance() ; + const char *s=config->GetValue("INVERT") ; + + if ((s)&&(!strcmp(s,"YES"))) { + invert=true ; + } + + if (!invert) { + eventManager_->MapAppButton("but:0:1",APP_BUTTON_B) ; + eventManager_->MapAppButton("but:0:2",APP_BUTTON_A) ; + }else { + eventManager_->MapAppButton("but:0:1",APP_BUTTON_A) ; + eventManager_->MapAppButton("but:0:2",APP_BUTTON_B) ; + } + eventManager_->MapAppButton("but:0:7",APP_BUTTON_LEFT) ; + eventManager_->MapAppButton("but:0:9",APP_BUTTON_RIGHT) ; + eventManager_->MapAppButton("but:0:8",APP_BUTTON_UP) ; + eventManager_->MapAppButton("but:0:6",APP_BUTTON_DOWN) ; + eventManager_->MapAppButton("but:0:4",APP_BUTTON_L) ; + eventManager_->MapAppButton("but:0:5",APP_BUTTON_R) ; + eventManager_->MapAppButton("but:0:11",APP_BUTTON_START) ; +} ; + +void VITASystem::Shutdown() { +} ; + +unsigned long VITASystem::GetClock() { + struct timeval now; + Uint32 ticks; + gettimeofday(&now, NULL); + ticks=(now.tv_sec)*1000+(now.tv_usec)/1000; + return(ticks); +} + +void VITASystem::Sleep(int millisec) { +} + +void *VITASystem::Malloc(unsigned size) { + return malloc(size) ; +} + +void VITASystem::Free(void *ptr) { + free(ptr) ; +} + +void VITASystem::Memset(void *addr,char val,int size) { + memset(addr,val,size) ; +} ; + +void *VITASystem::Memcpy(void *s1, const void *s2, int n) { + return memcpy(s1,s2,n) ; +} ; + +void VITASystem::PostQuitMessage() { + SDLEventManager::GetInstance()->PostQuitMessage() ; +} ; + +unsigned int VITASystem::GetMemoryUsage() { + struct mallinfo m=mallinfo(); + return m.uordblks ; +} + +int VITASystem::GetBatteryLevel() { + if (sceKernelGetModel() == SCE_KERNEL_MODEL_VITA) + { + return scePowerGetBatteryLifePercent() ; + } + return -1 ; +} ; diff --git a/sources/Adapters/VITA/System/VITASystem.h b/sources/Adapters/VITA/System/VITASystem.h new file mode 100644 index 00000000..d6371bae --- /dev/null +++ b/sources/Adapters/VITA/System/VITASystem.h @@ -0,0 +1,29 @@ +#ifndef _VITA_SYSTEM_H_ +#define _VITA_SYSTEM_H_ + +#include "System/System/System.h" +#include "UIFramework/SimpleBaseClasses/EventManager.h" + +class VITASystem: public System { +public: + static void Boot(int argc,char **argv) ; + static void Shutdown() ; + static int MainLoop() ; + +public: // System implementation + virtual unsigned long GetClock() ; + virtual void Sleep(int millisec); + virtual void *Malloc(unsigned size) ; + virtual void Free(void *) ; + virtual void Memset(void *addr,char val,int size) ; + virtual void *Memcpy(void *s1, const void *s2, int n) ; + virtual int GetBatteryLevel() ; + virtual void PostQuitMessage() ; + virtual unsigned int GetMemoryUsage() ; + + static bool finished_ ; +private: + static EventManager *eventManager_; + +} ; +#endif diff --git a/sources/Application/FX/FxPrinter.cpp b/sources/Application/FX/FxPrinter.cpp index 3c4a442a..1b121df3 100644 --- a/sources/Application/FX/FxPrinter.cpp +++ b/sources/Application/FX/FxPrinter.cpp @@ -67,6 +67,8 @@ bool FxPrinter::Run() { bool imported = SamplePool::GetInstance()->IsImported(foWav_); std::string cmd = parseCommand(); Trace::Log("Processed", cmd.c_str()); + +#if !defined(PLATFORM_VITA) if (system(cmd.c_str()) == 0) { int newIndex = SamplePool::GetInstance()->Reassign(foWav_, imported); instrument_->AssignSample(newIndex); @@ -77,4 +79,7 @@ bool FxPrinter::Run() { notificationResult_ = "Failed, check lgpt.log"; return false; } +#else + return false; +#endif }