add shuffle and root check
This commit is contained in:
parent
8d65dc8314
commit
bc53ceed38
1 changed files with 13 additions and 2 deletions
15
libpandory.c
15
libpandory.c
|
@ -38,7 +38,15 @@ char *libpandory_rot13(const char *src) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isReadonly(char const *path)
|
void libpandory_shufflemusic()
|
||||||
|
{
|
||||||
|
system("umount /tmp/pandory/share/retroarch/assets/sounds/bgm.mp3");
|
||||||
|
system("cd /mnt/Pandory/.user/bgm && ls | sed -n \"$((RANDOM%$(ls | wc -l)+1))p\" > /tmp/pandory_track");
|
||||||
|
system("busybox mount -o bind /mnt/Pandory/.user/bgm/$(cat /tmp/pandory_track) /tmp/pandory/share/retroarch/assets/sounds/bgm.mp3");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int libpandory_isreadonly(char const *path)
|
||||||
{
|
{
|
||||||
struct statvfs info;
|
struct statvfs info;
|
||||||
statvfs(path, &info);
|
statvfs(path, &info);
|
||||||
|
@ -48,11 +56,14 @@ int isReadonly(char const *path)
|
||||||
void libpandory_lefcheck(void) {
|
void libpandory_lefcheck(void) {
|
||||||
printf("TeamPandory - Pandory500 - by emuchicken and dajoho\n");
|
printf("TeamPandory - Pandory500 - by emuchicken and dajoho\n");
|
||||||
|
|
||||||
if (!isReadonly("/")) {
|
if (!libpandory_isreadonly("/")) {
|
||||||
printf("[WARNING]: Your system currently has a writeable NAND storage. This may have been caused by another modification. This is dangerous. Pandory will now exit.\n");
|
printf("[WARNING]: Your system currently has a writeable NAND storage. This may have been caused by another modification. This is dangerous. Pandory will now exit.\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do the red dwarf shuffle
|
||||||
|
libpandory_shufflemusic();
|
||||||
|
|
||||||
char fname[80];
|
char fname[80];
|
||||||
strcpy(fname, libpandory_rot13("/zag/Cnaqbel/.sf/cnaqbel.fdkm"));
|
strcpy(fname, libpandory_rot13("/zag/Cnaqbel/.sf/cnaqbel.fdkm"));
|
||||||
int chk = 0;
|
int chk = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue