Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
GrapheneCt authored May 3, 2020
1 parent d5aeaff commit c356d19
Show file tree
Hide file tree
Showing 11 changed files with 906 additions and 862 deletions.
24 changes: 15 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
cmake_minimum_required(VERSION 2.8)

if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{VITASDK})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
if(DEFINED ENV{DOLCESDK})
set(CMAKE_TOOLCHAIN_FILE "$ENV{DOLCESDK}/share/dolce.toolchain.cmake" CACHE PATH "toolchain file")
else()
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
message(FATAL_ERROR "Please define DOLCESDK to point to your SDK path!")
endif()
endif()

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/boot_param.bin
COMMAND dolce-make-bootparam app_memsize 0x4000 attribute 0x02 ${CMAKE_CURRENT_BINARY_DIR}/boot_param.bin
)

project(ElevenMPV)
include("${VITASDK}/share/vita.cmake" REQUIRED)
include("${DOLCESDK}/share/dolce.cmake" REQUIRED)

set(VITA_APP_NAME "Eleven Music Player")
set(VITA_TITLEID "ELEVENMPV")
set(VITA_VERSION "02.10")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")

FUNCTION(ADD_RESOURCES out_var)
SET(result)
Expand Down Expand Up @@ -80,10 +84,10 @@ add_executable(${PROJECT_NAME}
)

target_link_libraries(${PROJECT_NAME}
vita2d
vita2d_sys
freetype
png
jpeg
SceJpeg_stub
z
c
FLAC
Expand All @@ -110,8 +114,10 @@ target_link_libraries(${PROJECT_NAME}
SceTouch_stub
)

vita_create_self(${PROJECT_NAME}.self ${PROJECT_NAME} UNSAFE)
vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} ${PROJECT_NAME}.self
set(DOLCE_MKSFOEX_FLAGS "${DOLCE_MKSFOEX_FLAGS} -d ATTRIBUTE=17731976 -s CATEGORY=gdc" -d PARENTAL_LEVEL=1)

dolce_create_self(${PROJECT_NAME}.self ${PROJECT_NAME} UNSAFE BOOT_PARAM ${CMAKE_CURRENT_BINARY_DIR}/boot_param.bin)
dolce_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} ${PROJECT_NAME}.self
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
FILE sce_sys/icon0.png sce_sys/icon0.png
Expand Down
2 changes: 1 addition & 1 deletion include/audio/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define _ELEVENMPV_AUDIO_H_

#include <psp2/types.h>
#include <vita2d.h>
#include <vita2d_sys.h>

extern SceBool playing, paused;

Expand Down
2 changes: 1 addition & 1 deletion include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <psp2/ctrl.h>
#include <psp2/types.h>
#include <vita2d.h>
#include <vita2d_sys.h>

/// Checks whether a result code indicates success.
#define R_SUCCEEDED(res) ((res)>=0)
Expand Down
2 changes: 1 addition & 1 deletion include/textures.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _ELEVENMPV_TEXTURES_H_
#define _ELEVENMPV_TEXTURES_H_

#include <vita2d.h>
#include <vita2d_sys.h>

vita2d_texture *icon_dir, *icon_file, *icon_audio, *battery_20, *battery_20_charging, *battery_30, *battery_30_charging, *battery_50, *battery_50_charging, \
*battery_60, *battery_60_charging, *battery_80, *battery_80_charging, *battery_90, *battery_90_charging, *battery_full, *battery_full_charging, \
Expand Down
1 change: 1 addition & 0 deletions include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ char *Utils_Basename(const char *filename);
void Utils_InitPowerTick(void);
void Utils_LockPower(void);
void Utils_UnlockPower(void);
int Utils_AppStatusIsRunning(void);

#endif
123 changes: 69 additions & 54 deletions source/main.c
Original file line number Diff line number Diff line change
@@ -1,54 +1,69 @@
#include <psp2/appmgr.h>
#include <psp2/io/stat.h>
#include <psp2/kernel/processmgr.h>
#include <psp2/shellutil.h>
#include <psp2/sysmodule.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "common.h"
#include "config.h"
#include "dirbrowse.h"
#include "fs.h"
#include "menu_displayfiles.h"
#include "textures.h"
#include "touch.h"
#include "utils.h"

int main(int argc, char *argv[]) {
vita2d_init();
font = vita2d_load_font_file("app0:Roboto-Regular.ttf");
Textures_Load();

sceIoMkdir("ux0:data/ElevenMPV", 0777);
Config_Load();
Config_GetLastDirectory();

Utils_InitAppUtil();
SCE_CTRL_ENTER = Utils_GetEnterButton();
SCE_CTRL_CANCEL = Utils_GetCancelButton();

sceAppMgrAcquireBgmPort();

Touch_Init();

sceShellUtilInitEvents(0);
sceSysmoduleLoadModule(SCE_SYSMODULE_MUSIC_EXPORT);
Utils_InitPowerTick();

Menu_DisplayFiles();

sceSysmoduleUnloadModule(SCE_SYSMODULE_MUSIC_EXPORT);

Touch_Shutdown();
sceAppMgrReleaseBgmPort();
Utils_TermAppUtil();

Textures_Free();
vita2d_free_font(font);
vita2d_fini();

sceKernelExitProcess(0);
return 0;
}
#include <psp2/appmgr.h>
#include <psp2/io/stat.h>
#include <psp2/kernel/processmgr.h>
#include <psp2/kernel/clib.h>
#include <psp2/shellutil.h>
#include <psp2/sysmodule.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "common.h"
#include "config.h"
#include "dirbrowse.h"
#include "fs.h"
#include "menu_displayfiles.h"
#include "textures.h"
#include "touch.h"
#include "utils.h"

#define CLIB_HEAP_SIZE 1 * 1024 * 1024

int _newlib_heap_size_user = 1 * 1024 * 1024;

int sceAppMgrAcquireBgmPortForMusicPlayer(void);

int main(int argc, char *argv[]) {

void* clibm_base;
void* mspace;
SceUID clib_heap = sceKernelAllocMemBlock("ClibHeap", SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, CLIB_HEAP_SIZE, NULL);
sceKernelGetMemBlockBase(clib_heap, &clibm_base);
mspace = sceClibMspaceCreate(clibm_base, CLIB_HEAP_SIZE);

vita2d_clib_pass_mspace(mspace);
vita2d_init();
font = vita2d_load_font_file("app0:Roboto-Regular.ttf");
Textures_Load();

sceIoMkdir("ux0:data/ElevenMPV", 0777);
Config_Load();
Config_GetLastDirectory();

Utils_InitAppUtil();
SCE_CTRL_ENTER = Utils_GetEnterButton();
SCE_CTRL_CANCEL = Utils_GetCancelButton();

sceAppMgrAcquireBgmPortForMusicPlayer();

Touch_Init();

sceShellUtilInitEvents(0);
sceSysmoduleLoadModule(SCE_SYSMODULE_MUSIC_EXPORT);
Utils_InitPowerTick();

Menu_DisplayFiles();

sceSysmoduleUnloadModule(SCE_SYSMODULE_MUSIC_EXPORT);

Touch_Shutdown();
sceAppMgrReleaseBgmPort();
Utils_TermAppUtil();

Textures_Free();
vita2d_free_font(font);
vita2d_fini();

sceKernelExitProcess(0);
return 0;
}
Loading

0 comments on commit c356d19

Please sign in to comment.