Skip to content

Commit

Permalink
- Read FAT attributes from FlippyDrive.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Jan 12, 2025
1 parent c1ce6e8 commit e2b6e46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ s32 deviceHandler_Flippy_readDir(file_handle* ffile, file_handle** dir, u32 type
}
memset(&(*dir)[i], 0, sizeof(file_handle));
if(concat_path((*dir)[i].name, ffile->name, entry.name) < PATHNAME_MAX && entry.size <= UINT32_MAX) {
(*dir)[i].size = entry.size;
(*dir)[i].fileType = (entry.type == FLIPPY_TYPE_DIR) ? IS_DIR : IS_FILE;
(*dir)[i].size = entry.size;
(*dir)[i].fileType = (entry.type == FLIPPY_TYPE_DIR) ? IS_DIR : IS_FILE;
(*dir)[i].fileAttrib = entry.attributes;
++i;
}
}
Expand Down
9 changes: 8 additions & 1 deletion cube/swiss/source/devices/flippydrive/flippy.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
#define FLIPPY_FLAG_WRITE 0x08
#define FLIPPY_FLAG_DEFAULT (FLIPPY_FLAG_DISABLE_CACHE | FLIPPY_FLAG_DISABLE_FASTSEEK | FLIPPY_FLAG_DISABLE_DVDSPEED)

#define FLIPPY_ATTRIBUTE_READONLY 0x01
#define FLIPPY_ATTRIBUTE_HIDDEN 0x02
#define FLIPPY_ATTRIBUTE_SYSTEM 0x04
#define FLIPPY_ATTRIBUTE_DIRECTORY 0x10
#define FLIPPY_ATTRIBUTE_ARCHIVE 0x20

#define FLIPPY_FLASH_HANDLE 64

#define FLIPPY_MAX_HANDLES 31
Expand Down Expand Up @@ -94,7 +100,8 @@ typedef struct {
u32 date;
u32 time;
u32 result;
u8 padding[10];
u8 attributes;
u8 padding[9];
} ATTRIBUTE_PACKED flippyfilestat;

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ int main(int argc, char *argv[])
wait_press_A();
DrawDispose(msgBox);
}
else if(flippy_version < FLIPPY_VERSION(1,3,2)) {
else if(flippy_version < FLIPPY_VERSION(1,3,3)) {
uiDrawObj_t *msgBox = DrawPublish(DrawMessageBox(D_INFO, "A firmware update is available.\nflippydrive.com/updates"));
wait_press_A();
DrawDispose(msgBox);
Expand Down

0 comments on commit e2b6e46

Please sign in to comment.