Updated to latest SDK

This commit is contained in:
TheFloW 2017-07-22 17:34:53 +02:00
parent 8116312012
commit 07fc3ceb18
6 changed files with 48 additions and 82 deletions

View File

@ -313,19 +313,15 @@ int audioPlayer(const char *file, int type, FileList *list, FileListEntry *entry
if (previous) {
if (*rel_pos > 0) {
(*rel_pos)--;
} else {
if (*base_pos > 0) {
(*base_pos)--;
}
} else if (*base_pos > 0) {
(*base_pos)--;
}
} else {
if ((*rel_pos+1) < list->length) {
if ((*rel_pos+1) < MAX_POSITION) {
(*rel_pos)++;
} else {
if ((*base_pos+*rel_pos+1) < list->length) {
(*base_pos)++;
}
} else if ((*base_pos+*rel_pos+1) < list->length) {
(*base_pos)++;
}
}
}
@ -368,7 +364,6 @@ int audioPlayer(const char *file, int type, FileList *list, FileListEntry *entry
// Start drawing
startDrawing(bg_audio_image);
// Draw shell info
drawShellInfo(file);

7
file.h
View File

@ -63,13 +63,6 @@ enum FileMoveFlags {
MOVE_REPLACE = 0x2, // Replace files
};
typedef struct {
uint64_t max_size;
uint64_t free_size;
uint32_t cluster_size;
void *unk;
} SceIoDevInfo;
typedef struct {
uint64_t *value;
uint64_t max;

56
hex.c
View File

@ -130,49 +130,45 @@ int hexViewer(const char *file) {
if (hold_buttons & SCE_CTRL_UP || hold2_buttons & SCE_CTRL_LEFT_ANALOG_UP) {
if (rel_pos > 0) {
rel_pos -= 0x10;
} else {
if (base_pos > 0) {
base_pos -= 0x10;
} else if (base_pos > 0) {
base_pos -= 0x10;
// Tail to head
list.tail->next = list.head;
list.head->previous = list.tail;
list.head = list.tail;
// Tail to head
list.tail->next = list.head;
list.head->previous = list.tail;
list.head = list.tail;
// Second last to tail
list.tail = list.tail->previous;
list.tail->next = NULL;
// Second last to tail
list.tail = list.tail->previous;
list.tail->next = NULL;
// No previous
list.head->previous = NULL;
// No previous
list.head->previous = NULL;
// Read
memcpy(list.head->data, buffer+base_pos, 0x10);
}
// Read
memcpy(list.head->data, buffer+base_pos, 0x10);
}
} else if (hold_buttons & SCE_CTRL_DOWN || hold2_buttons & SCE_CTRL_LEFT_ANALOG_DOWN) {
if ((rel_pos+0x10) < size) {
if ((rel_pos+0x10) < ((MAX_POSITION-1) * 0x10)) {
rel_pos += 0x10;
} else {
if ((base_pos+rel_pos+0x10) < size) {
base_pos += 0x10;
} else if ((base_pos+rel_pos+0x10) < size) {
base_pos += 0x10;
// Head to tail
list.head->previous = list.tail;
list.tail->next = list.head;
list.tail = list.head;
// Head to tail
list.head->previous = list.tail;
list.tail->next = list.head;
list.tail = list.head;
// Second first to head
list.head = list.head->next;
list.head->previous = NULL;
// Second first to head
list.head = list.head->next;
list.head->previous = NULL;
// No next
list.tail->next = NULL;
// No next
list.tail->next = NULL;
// Read
memcpy(list.tail->data, buffer+base_pos + (0x10-1) * 0x10, 0x10);
}
// Read
memcpy(list.tail->data, buffer+base_pos + (0x10-1) * 0x10, 0x10);
}
}
}

30
main.c
View File

@ -181,10 +181,8 @@ static void setFocusOnFilename(const char *name) {
if (index > name_pos) {
if (rel_pos > 0) {
rel_pos--;
} else {
if (base_pos > 0) {
base_pos--;
}
} else if (base_pos > 0) {
base_pos--;
}
}
@ -192,10 +190,8 @@ static void setFocusOnFilename(const char *name) {
if ((rel_pos+1) < file_list.length) {
if ((rel_pos+1) < MAX_POSITION) {
rel_pos++;
} else {
if ((base_pos+rel_pos+1) < file_list.length) {
base_pos++;
}
} else if ((base_pos+rel_pos+1) < file_list.length) {
base_pos++;
}
}
}
@ -221,10 +217,8 @@ int refreshFileList() {
while ((base_pos+rel_pos) >= file_list.length) {
if (base_pos > 0) {
base_pos--;
} else {
if (rel_pos > 0) {
rel_pos--;
}
} else if (rel_pos > 0) {
rel_pos--;
}
}
@ -1175,10 +1169,8 @@ static int fileBrowserMenuCtrl() {
if (rel_pos > 0) {
rel_pos--;
} else {
if (base_pos > 0) {
base_pos--;
}
} else if (base_pos > 0) {
base_pos--;
}
if (old_pos != base_pos+rel_pos)
@ -1189,10 +1181,8 @@ static int fileBrowserMenuCtrl() {
if ((rel_pos+1) < file_list.length) {
if ((rel_pos+1) < MAX_POSITION) {
rel_pos++;
} else {
if ((base_pos+rel_pos+1) < file_list.length) {
base_pos++;
}
} else if ((base_pos+rel_pos+1) < file_list.length) {
base_pos++;
}
}

12
photo.c
View File

@ -220,19 +220,15 @@ int photoViewer(const char *file, int type, FileList *list, FileListEntry *entry
if (previous) {
if (*rel_pos > 0) {
(*rel_pos)--;
} else {
if (*base_pos > 0) {
(*base_pos)--;
}
} else if (*base_pos > 0) {
(*base_pos)--;
}
} else {
if ((*rel_pos+1) < list->length) {
if ((*rel_pos+1) < MAX_POSITION) {
(*rel_pos)++;
} else {
if ((*base_pos+*rel_pos+1) < list->length) {
(*base_pos)++;
}
} else if ((*base_pos+*rel_pos+1) < list->length) {
(*base_pos)++;
}
}
}

12
sfo.c
View File

@ -147,19 +147,15 @@ int SFOReader(const char *file) {
if (hold_buttons & SCE_CTRL_UP || hold2_buttons & SCE_CTRL_LEFT_ANALOG_UP) {
if (rel_pos > 0) {
rel_pos--;
} else {
if (base_pos > 0) {
base_pos--;
}
} else if (base_pos > 0) {
base_pos--;
}
} else if (hold_buttons & SCE_CTRL_DOWN || hold2_buttons & SCE_CTRL_LEFT_ANALOG_DOWN) {
if ((rel_pos+1) < sfo_header->count) {
if ((rel_pos+1) < MAX_POSITION) {
rel_pos++;
} else {
if ((base_pos+rel_pos+1) < sfo_header->count) {
base_pos++;
}
} else if ((base_pos+rel_pos+1) < sfo_header->count) {
base_pos++;
}
}
}