diff --git a/cube/swiss/source/devices/memcard/deviceHandler-CARD.c b/cube/swiss/source/devices/memcard/deviceHandler-CARD.c index f4c3cf83..54036305 100644 --- a/cube/swiss/source/devices/memcard/deviceHandler-CARD.c +++ b/cube/swiss/source/devices/memcard/deviceHandler-CARD.c @@ -101,7 +101,7 @@ device_info* deviceHandler_CARD_info() { s32 deviceHandler_CARD_readDir(file_handle* ffile, file_handle** dir, u32 type){ - int num_entries = 1, ret = 0, i = 0, slot = (!strncmp((const char*)initial_CARDB.name, ffile->name, 7)); + int num_entries = 1, ret = 0, i = 1, slot = (!strncmp((const char*)initial_CARDB.name, ffile->name, 7)); card_dir *memcard_dir = NULL; if(!card_init[slot]) { //if some error @@ -116,7 +116,9 @@ s32 deviceHandler_CARD_readDir(file_handle* ffile, file_handle** dir, u32 type){ memset(memcard_dir, 0, sizeof(card_dir)); /* Convert the Memory Card "file" data to fileBrowser_files */ - *dir = malloc( num_entries * sizeof(file_handle) ); + *dir = calloc(sizeof(file_handle), 1); + (*dir)[0].fileAttrib = IS_SPECIAL; + strcpy((*dir)[0].name, ".."); int usedSpace = 0; ret = CARD_FindFirst (slot, memcard_dir, true); diff --git a/cube/swiss/source/gui/FrameBufferMagic.c b/cube/swiss/source/gui/FrameBufferMagic.c index fa270a1c..6e958cb6 100644 --- a/cube/swiss/source/gui/FrameBufferMagic.c +++ b/cube/swiss/source/gui/FrameBufferMagic.c @@ -992,10 +992,10 @@ static void _DrawFileBrowserButton(uiDrawObj_t *evt) { sprintf(fbTextBuffer,"Partition: %i, ISO: %i", isoInfo->iso_partition,isoInfo->iso_number); } else if(devices[DEVICE_CUR] == &__device_card_a || devices[DEVICE_CUR] == &__device_card_b) { - sprintf(fbTextBuffer,"%.2fKB (%ul blocks)", (float)file->size/1024, file->size/8192); + sprintf(fbTextBuffer,"%.2fKB (%d blocks)", (float)file->size/1024, file->size/8192); } else if(devices[DEVICE_CUR] == &__device_qoob) { - sprintf(fbTextBuffer,"%.2fKB (%ul blocks)", (float)file->size/1024, file->size/0x10000); + sprintf(fbTextBuffer,"%.2fKB (%d blocks)", (float)file->size/1024, file->size/0x10000); } else { sprintf(fbTextBuffer,"%.2f %s",file->size > (1024*1024) ? (float)file->size/(1024*1024):(float)file->size/1024,file->size > (1024*1024) ? "MB":"KB"); @@ -1376,6 +1376,12 @@ void DrawCheatsSelector(char *fileName) { DrawDispose(container); } + +void DrawGetTextEntry(int mode, void *src, int size) { + // TODO +} + + static void videoDrawEvent(uiDrawObj_t *videoEvent) { //print_gecko("Draw event: %08X (type %s)\r\n", (u32)videoEvent, typeStrings[videoEvent->type]); drawInit(); diff --git a/cube/swiss/source/gui/FrameBufferMagic.h b/cube/swiss/source/gui/FrameBufferMagic.h index 1a8c9034..ec59f5c0 100644 --- a/cube/swiss/source/gui/FrameBufferMagic.h +++ b/cube/swiss/source/gui/FrameBufferMagic.h @@ -127,6 +127,16 @@ enum TextureId TEX_UNCHECKED }; +typedef struct kbBtn_ { + int supportedEntryMode; + char *val; +} kbBtn; + +#define ENTRYMODE_ALPHA (1) +#define ENTRYMODE_NUMERIC (1<<1) +#define ENTRYMODE_IP (1<<2) +#define ENTRYMODE_MASKED (1<<3) + uiDrawObj_t* DrawImage(int textureId, int x, int y, int width, int height, int depth, float s1, float s2, float t1, float t2, int centered); uiDrawObj_t* DrawTexObj(GXTexObj *texObj, int x, int y, int width, int height, int depth, float s1, float s2, float t1, float t2, int centered); uiDrawObj_t* DrawProgressBar(bool indeterminate, int percent, char *message); @@ -150,6 +160,7 @@ uiDrawObj_t* DrawFileBrowserButton(int x1, int y1, int x2, int y2, char *message uiDrawObj_t* DrawVertScrollBar(int x, int y, int width, int height, float scrollPercent, int scrollHeight); void DrawArgsSelector(char *fileName); void DrawCheatsSelector(char *fileName); +void DrawGetTextEntry(int entryMode, void *src, int size); void DrawInit(); void DrawShutdown();