Skip to content

Commit

Permalink
.dol+cli support
Browse files Browse the repository at this point in the history
  • Loading branch information
emukidid committed Apr 25, 2018
1 parent 2a2830b commit c4ed625
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cube/swiss/source/devices/filemeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ void populate_meta(file_handle *f) {
else if(endsWith(f->name,".dol")) { //DOL
f->meta = create_basic_meta(dolimg_tpl, dolimg_tpl_size);
}
else if(endsWith(f->name,".dol+cli")) { //DOL+CLI
f->meta = create_basic_meta(dolcliimg_tpl, dolcliimg_tpl_size);
}
else {
f->meta = create_basic_meta(fileimg_tpl, fileimg_tpl_size);
}
Expand Down
9 changes: 4 additions & 5 deletions cube/swiss/source/gui/FrameBufferMagic.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,13 @@ void DrawFileBrowserButton(int x1, int y1, int x2, int y2, char *message, file_h
memset(file_name, 0, 1024);
strcpy(&file_name[0], message);

// Hide extension when rendering ISO/GCM files
// Hide extension when rendering certain files
if(file->fileAttrib == IS_FILE) {
if(endsWith(file_name,".gcm")
|| endsWith(file_name,".iso")
|| endsWith(file_name,".dol")) {
if(strlen(file_name) > 4) {
file_name[strlen(file_name)-4] = '\0';
}
|| endsWith(file_name,".dol")
|| endsWith(file_name,".dol+cli")) {
file_name[((u32)strrchr(file_name, '.'))-((u32)&file_name)] = '\0';
}
}
float scale = GetTextScaleToFitInWidth(file_name, (x2-x1-96-35)-(borderSize*2));
Expand Down
1 change: 1 addition & 0 deletions cube/swiss/source/gui/FrameBufferMagic.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ extern int whichfb;
#include "pal.h"
#include "mp3img_tpl.h"
#include "dolimg_tpl.h"
#include "dolcliimg_tpl.h"
#include "dirimg_tpl.h"
#include "fileimg_tpl.h"
#include "checked_32_tpl.h"
Expand Down
Binary file added cube/swiss/source/images/DOLcli.psd
Binary file not shown.
Binary file added cube/swiss/source/images/dolcli.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions cube/swiss/source/images/dolcliimg.scf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<filepath="dolcli.png" id="dolcliimg" colfmt=6 />
2 changes: 1 addition & 1 deletion cube/swiss/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int curSelection = 0; //game selection
int needsDeviceChange = 0;
int needsRefresh = 0;
SwissSettings swissSettings;
char *knownExtensions[] = {".dol\0", ".iso\0", ".gcm\0", ".mp3\0", ".fzn\0", ".gci\0"};
char *knownExtensions[] = {".dol\0", ".iso\0", ".gcm\0", ".mp3\0", ".fzn\0", ".gci\0", ".dol+cli\0"};

int endsWith(char *str, char *end) {
if(strlen(str) < strlen(end))
Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/swiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ void load_file()

//if it's a DOL, boot it
if(strlen(fileName)>4) {
if(endsWith(fileName,".dol")) {
if(endsWith(fileName,".dol") || endsWith(fileName,".dol+cli")) {
boot_dol();
// if it was invalid (overlaps sections, too large, etc..) it'll return
DrawFrameStart();
Expand Down

0 comments on commit c4ed625

Please sign in to comment.