27 #include <sys/cdefs.h>
33 #define __packed__ __attribute__((packed))
347 #define VMUFS_OVERWRITE 1
348 #define VMUFS_VMUGAME 2
349 #define VMUFS_NOCOPY 4
uint8 day
Day of the month.
Definition: vmufs.h:43
int vmufs_dir_write(maple_device_t *dev, vmu_root_t *root, vmu_dir_t *dir_buf)
Given a selected VMU's root block and dir blocks, write the dirty dir blocks back to the VMU...
uint8 month
Month of the year.
Definition: vmufs.h:42
int vmufs_write(maple_device_t *dev, const char *fn, void *inbuf, int insize, int flags)
Write a file to the VMU.
uint16 dir_loc
Directory location.
Definition: vmufs.h:63
uint8 dow
Day of week (0 = monday, etc)
Definition: vmufs.h:47
int vmufs_dir_blocks(vmu_root_t *root_buf)
Given a VMU's root block, return the amount of space in bytes required to hold its directory...
vmu_timestamp_t timestamp
File time.
Definition: vmufs.h:78
uint16 fat_loc
FAT location.
Definition: vmufs.h:61
int vmufs_mutex_unlock()
Unlock the vmufs mutex.
uint16 hdroff
Offset of header, in blocks from start of file.
Definition: vmufs.h:80
int vmufs_root_read(maple_device_t *dev, vmu_root_t *root_buf)
Reads a selected VMU's root block.
uint8 year
Year, within century.
Definition: vmufs.h:41
int vmufs_free_blocks(maple_device_t *dev)
Return the number of user blocks free for file writing.
int vmufs_root_write(maple_device_t *dev, vmu_root_t *root_buf)
Writes a selected VMU's root block.
int vmufs_file_delete(vmu_root_t *root, uint16 *fat, vmu_dir_t *dir, const char *fn)
Given a previously-read FAT and directory, delete the named file.
VMU FS Directory entries, 32 bytes each.
Definition: vmufs.h:73
One maple device.
Definition: maple.h:237
POSIX directory entry structure.
Definition: dirent.h:30
int vmufs_fat_blocks(vmu_root_t *root_buf)
Given a VMU's root block, return the amount of space in bytes required to hold its FAT...
int vmufs_fat_read(maple_device_t *dev, vmu_root_t *root, uint16 *fat_buf)
Given a selected VMU's root block, read its FAT.
Maple Bus driver interface.
uint8 filetype
0x00 = no file; 0x33 = data; 0xcc = a game
Definition: vmufs.h:74
uint16 icon_shape
Icon shape for this VMS.
Definition: vmufs.h:65
int vmufs_readdir(maple_device_t *dev, vmu_dir_t **outbuf, int *outcnt)
Read the directory from a VMU.
vmu_timestamp_t timestamp
BCD timestamp.
Definition: vmufs.h:58
uint8 sec
Seconds.
Definition: vmufs.h:46
unsigned short uint16
16-bit unsigned integer
Definition: types.h:29
void vmufs_dir_fill_time(vmu_dir_t *d)
Fill in the date on a vmu_dir_t for writing.
int vmufs_delete(maple_device_t *dev, const char *fn)
Delete a file from the VMU.
int vmufs_init()
Initialize vmufs.
int vmufs_file_write(maple_device_t *dev, vmu_root_t *root, uint16 *fat, vmu_dir_t *dir, vmu_dir_t *newdirent, void *filebuf, int size)
Given a pointer to a mostly-filled directory struct and a previously loaded directory and FAT...
int vmufs_dir_read(maple_device_t *dev, vmu_root_t *root_buf, vmu_dir_t *dir_buf)
Given a selected VMU's root block, read its directory.
int vmufs_fat_write(maple_device_t *dev, vmu_root_t *root, uint16 *fat_buf)
Given a selected VMU's root block and its FAT, write the FAT blocks back to the VMU.
uint8 dirty
See header notes.
Definition: vmufs.h:81
int vmufs_read_dirent(maple_device_t *dev, vmu_dir_t *dirent, void **outbuf, int *outsize)
Read a file from the VMU, using a pre-read dirent.
VMU FS Root block layout.
Definition: vmufs.h:53
uint8 hour
Hour of the day.
Definition: vmufs.h:44
int vmufs_mutex_lock()
Lock the vmufs mutex.
uint16 dir_size
Directory size in blocks.
Definition: vmufs.h:64
uint8 use_custom
0 = standard, 1 = custom
Definition: vmufs.h:55
uint16 filesize
Size of the file in blocks.
Definition: vmufs.h:79
unsigned char uint8
8-bit unsigned integer
Definition: types.h:30
uint16 fat_size
FAT size in blocks.
Definition: vmufs.h:62
uint8 copyprotect
0x00 = copyable; 0xff = copy protected
Definition: vmufs.h:75
int vmufs_shutdown()
Shutdown vmufs.
uint16 firstblk
Location of the first block in the file.
Definition: vmufs.h:76
BCD timestamp, used several places in the vmufs.
Definition: vmufs.h:39
uint8 cent
Century.
Definition: vmufs.h:40
uint8 min
Minutes.
Definition: vmufs.h:45
int vmufs_dir_add(vmu_root_t *root, vmu_dir_t *dir, vmu_dir_t *newdirent)
Given a previously-read directory, add a new dirent to the dir.
int vmufs_file_read(maple_device_t *dev, uint16 *fat, vmu_dir_t *dirent, void *outbuf)
Given a pointer to a directory struct and a previously loaded FAT, load the indicated file from the V...
int vmufs_dir_free(vmu_root_t *root, vmu_dir_t *dir)
Given a previously-read directory, return the number of dirents available for new files...
int vmufs_fat_free(vmu_root_t *root, uint16 *fat)
Given a previously-read FAT, return the number of blocks available to write out new file data...
uint16 blk_cnt
Number of user blocks.
Definition: vmufs.h:66
int vmufs_read(maple_device_t *dev, const char *fn, void **outbuf, int *outsize)
Read a file from the VMU.
int vmufs_dir_find(vmu_root_t *root, vmu_dir_t *dir, const char *fn)
Given a previously-read directory, locate a file by filename.