1-17-2020 (wasnt in git)

This commit is contained in:
Michael Nolan 2022-04-17 06:44:32 -05:00
parent 28db59ee93
commit 5d8203e27b
4 changed files with 638 additions and 207 deletions

View File

@ -37,7 +37,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
LIBS := -lgrrlib -lcurl -lmbedtls -lmbedx509 -lmbedcrypto -lwiisocket LIBS := -lgrrlib -lcurl -lmbedtls -lmbedx509 -lmbedcrypto -lwiisocket
LIBS += -lfreetype -lbz2 LIBS += -lfreetype -lbz2
LIBS += -lpngu -lpng -ljpeg -lz -lntfs -lfat LIBS += -lpngu -lpng -ljpeg -lz -lntfs -lfat
LIBS += -lwiiuse LIBS += -lwiikeyboard -lwiiuse
#LIBS += -lmodplay -laesnd #LIBS += -lmodplay -laesnd
LIBS += -lbte -logc -lm LIBS += -lbte -logc -lm

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,21 @@
#include "settings.h" #include "settings.h"
int irmode=0; int irmode=0;
char* FileNameParse(char* path){
char *yt = malloc(sizeof(char)*530);
size_t len = strlen(path);
size_t pos=0;
for(size_t i = len-1;path[i] != '/';i--){
pos = i;
}
for(size_t i = pos;i<=len;i++){
size_t ind = i - pos;
yt[ind] = path[i];
}
return yt;
}
void DLFhandler(dlf* dl,size_t real){ void DLFhandler(dlf* dl,size_t real){
//max fat32 is 4,294,967,000 just to be safe //max fat32 is 4,294,967,000 just to be safe
size_t bytesnow = ftell(dl->fp) + real; size_t bytesnow = ftell(dl->fp) + real;
@ -30,9 +45,29 @@ FILE* HistoryAppend(){
FILE* PlaylistTXT(char* fil){ FILE* PlaylistTXT(char* fil){
char file2[500]; char file2[500];
sprintf(file2,"/TYTD/PLTXT/%s.txt",fil); sprintf(file2,"/TYTD/PLTXT/%s",fil);
return fopen(file2,"r"); return fopen(file2,"r");
} }
void CreatePL(char* fil){
char file2[500];
sprintf(file2,"/TYTD/PLTXT/%s",fil);
FILE *f =fopen(file2,"w");
fclose(f);
}
void WriteFile2PL(char* fil,char* type,char* url,char* filename){
char file2[500];
sprintf(file2,"/TYTD/PLTXT/%s",fil);
FILE *f =fopen(file2,"a");
fseek(f,0,SEEK_END);
if(ftell(f) == 0L){
fprintf(f,"%s %s %s",type,url,filename);
}else{
fprintf(f,"\n%s %s %s",type,url,filename);
}
fclose(f);
}
int FileSystemDrivers(){ int FileSystemDrivers(){
fatInitDefault(); fatInitDefault();
USBStorage_Initialize(); USBStorage_Initialize();

View File

@ -1,18 +1,20 @@
#ifndef SETTINGS_H #ifndef SETTINGS_H
#define SETTINGS_H #define SETTINGS_H
#include <gccore.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fat.h> #include <fat.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include <ogc/usbstorage.h> #include <ogc/usbstorage.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <gccore.h>
#include <wiiuse/wpad.h> #include <wiiuse/wpad.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <grrlib.h> #include <grrlib.h>
#include "FreeMonoBold_ttf.h" #include "FreeMonoBold_ttf.h"
@ -20,9 +22,11 @@
typedef struct dlf{ typedef struct dlf{
FILE* fp; FILE* fp;
char fnam[1000]; char fnam[1000];
char fnam2[500];
int fileid; int fileid;
int fileindex;
}dlf; }dlf;
char* FileNameParse(char* path);
void DLFhandler(dlf* dl,size_t real); void DLFhandler(dlf* dl,size_t real);
void OpenPlaylistFile(char* playlist); void OpenPlaylistFile(char* playlist);
char* OpenFile(char* fname); char* OpenFile(char* fname);
@ -32,6 +36,8 @@ FILE* HistoryRead();
FILE* HistoryAppend(); FILE* HistoryAppend();
int UsingIRFeatures(); int UsingIRFeatures();
int FileSystemDrivers(); int FileSystemDrivers();
void WriteFile2PL(char* fil,char* type,char* url,char* filename);
void CreatePL(char* fil);
char* OpenVideoFile(char* filename); char* OpenVideoFile(char* filename);
char* ThumbnailFileName(char* filename); char* ThumbnailFileName(char* filename);
int ThumbnailExists(char* id); int ThumbnailExists(char* id);