Skip to content

Commit

Permalink
Merge pull request ps2homebrew#171 from sp193/gamelistcache
Browse files Browse the repository at this point in the history
Game list cache + apps feature update
  • Loading branch information
ElPatas1 committed Jan 12, 2019
2 parents 7fdff43 + 5ae7c22 commit 68ad23d
Show file tree
Hide file tree
Showing 21 changed files with 892 additions and 133 deletions.
17 changes: 17 additions & 0 deletions include/appsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@

#define APP_MODE_UPDATE_DELAY 240

#define APP_TITLE_MAX 128
#define APP_PATH_MAX 128
#define APP_BOOT_MAX 64

#define APP_CONFIG_TITLE "title"
#define APP_CONFIG_BOOT "boot"

#define APP_TITLE_CONFIG_FILE "title.cfg"

typedef struct
{
char title[APP_TITLE_MAX + 1];
char path[APP_PATH_MAX + 1];
char boot[APP_BOOT_MAX + 1];
u8 legacy;
} app_info_t;

void appInit();
item_list_t *appGetObject(int initOnly);

Expand Down
1 change: 1 addition & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ enum CONFIG_INDEX {
#define CONFIG_OPL_OVERSCAN "overscan"
#define CONFIG_OPL_DISABLE_DEBUG "disable_debug"
#define CONFIG_OPL_PS2LOGO "ps2logo"
#define CONFIG_OPL_GAME_LIST_CACHE "game_list_cache"
#define CONFIG_OPL_EXIT_PATH "exit_path"
#define CONFIG_OPL_AUTO_SORT "autosort"
#define CONFIG_OPL_AUTO_REFRESH "autorefresh"
Expand Down
1 change: 1 addition & 0 deletions include/dialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum UI_ITEMS {

CFG_DEBUG,
CFG_PS2LOGO,
CFG_GAMELISTCACHE,
CFG_EXITTO,
CFG_DEFDEVICE,
CFG_USBMODE,
Expand Down
2 changes: 1 addition & 1 deletion include/hddsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ typedef struct
u8 ops2l_compat_flags;
u8 dma_type;
u8 dma_mode;
u8 disctype;
u32 layer_break;
int disctype;
u32 start_sector;
u32 total_size_in_kb;
} hdl_game_info_t;
Expand Down
6 changes: 6 additions & 0 deletions include/iosupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ typedef struct
{
short int mode;

/// Device priority when it comes to locating art assets for apps. Higher value = lower priority. (< 0) means no support for art assets.
char appsPriority;

char enabled;

unsigned char flags;
Expand All @@ -96,6 +99,9 @@ typedef struct
/// item description in localised form (used if value is not negative)
int textId;

/// Path to applications storage on the device (set to NULL if not applicable).
char *appsPath;

void (*itemInit)(void);

/** @return 1 if update is needed, 0 otherwise */
Expand Down
1 change: 1 addition & 0 deletions include/lang.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ enum _STR_IDS {
_STR_SFX_VOLUME,
_STR_BOOT_SND_VOLUME,
_STR_CFM_VMODE_CHG,
_STR_CACHE_GAME_LIST,

LANG_STR_COUNT
};
Expand Down
12 changes: 12 additions & 0 deletions include/opl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@

#define OPL_IS_DEV_BUILD 1 //Define if this build is a development build.

#ifdef OPL_IS_DEV_BUILD
#define OPL_FOLDER "CFG-DEV"
#else
#define OPL_FOLDER "CFG"
#endif

//Master password for disabling the parental lock.
#define OPL_PARENTAL_LOCK_MASTER_PASS "989765"

Expand All @@ -57,6 +63,11 @@

#define OPL_VMODE_CHANGE_CONFIRMATION_TIMEOUT_MS 10000

int oplPath2Mode(const char *path);
char *oplGetModeText(int mode);
int oplGetAppImage(char *folder, int isRelative, char *value, char *suffix, GSTEXTURE *resultTex, short psm);
int oplScanApps(int (*callback)(const char *path, config_set_t *appConfig, void *arg), void *arg);

void setErrorMessage(int strId);
void setErrorMessageWithCode(int strId, int error);
int loadConfig(int types);
Expand Down Expand Up @@ -115,6 +126,7 @@ int gXOff;
int gYOff;
int gOverscan;
int gSelectButton;
int gGameListCache;

int gEnableSFX;
int gEnableBootSND;
Expand Down
7 changes: 5 additions & 2 deletions include/supportbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

#define UL_GAME_NAME_MAX 32
#define ISO_GAME_NAME_MAX 64
#define ISO_GAME_EXTENSION_MAX 4
#define GAME_STARTUP_MAX 12

#define ISO_GAME_FNAME_MAX (ISO_GAME_NAME_MAX+ISO_GAME_EXTENSION_MAX)

enum GAME_FORMAT {
GAME_FORMAT_USBLD = 0,
GAME_FORMAT_OLD_ISO,
Expand All @@ -15,11 +18,11 @@ typedef struct
{
char name[ISO_GAME_NAME_MAX + 1]; // MUST be the higher value from UL / ISO
char startup[GAME_STARTUP_MAX + 1];
char extension[5];
char extension[ISO_GAME_EXTENSION_MAX + 1];
u8 parts;
u8 media;
u8 format;
int sizeMB;
u32 sizeMB;
} base_game_info_t;

typedef struct
Expand Down
1 change: 1 addition & 0 deletions include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum CONSOLE_REGIONS {
int InitConsoleRegionData(void);
const char *GetSystemDataPath(void);
char GetSystemFolderLetter(void);
int sysDeleteFolder(const char *folder);

int CheckPS2Logo(int fd, u32 lba);

Expand Down
Loading

0 comments on commit 68ad23d

Please sign in to comment.