KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
browse.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <dirent.h>
#include <libgen.h>
#include <sys/stat.h>
#include <dc/video.h>
#include <fat/fs_fat.h>
#include <kos/string.h>
#include <kos/fs_romdisk.h>
#include <kos/fs_ramdisk.h>
#include <dc/sd.h>
#include <dc/biosfont.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
#include <dc/maple/vmu.h>
#include "browse.h"

Macros

#define SCREEN_WIDTH   640
 
#define SCREEN_HEIGHT   480
 

Functions

int main (int argc, char **argv)
 
static bool mount_sd_fat ()
 
static void unmount_sd_fat ()
 
static void show_prompt (char *current_directory, bool mounted_sd, bool highlight_yes)
 
static void delete_file (char *filename, bool mounted_sd)
 
static int browse_directory (char *directory, directory_file_t *directory_contents)
 
static void prompt_message (char *message, bool highlight_yes)
 
static void draw_directory_selector (int index)
 
static void draw_directory_contents (directory_file_t *directory_contents, int num)
 
static bool draw_stat (const char *path)
 
static cont_state_tget_cont_state ()
 
static bool button_pressed (unsigned int current_buttons, unsigned int changed_buttons, unsigned int button)
 

Variables

static kos_blockdev_t sd_dev
 
static uint8_t partition_type
 

Macro Definition Documentation

◆ SCREEN_HEIGHT

#define SCREEN_HEIGHT   480

Referenced by draw_directory_contents().

◆ SCREEN_WIDTH

#define SCREEN_WIDTH   640

Function Documentation

◆ browse_directory()

static int browse_directory ( char * directory,
directory_file_t * directory_contents )
static

◆ button_pressed()

static bool button_pressed ( unsigned int current_buttons,
unsigned int changed_buttons,
unsigned int button )
static

Referenced by main().

◆ delete_file()

static void delete_file ( char * filename,
bool mounted_sd )
static

References basename(), free(), fs_ramdisk_detach(), and NULL.

Referenced by main().

◆ draw_directory_contents()

static void draw_directory_contents ( directory_file_t * directory_contents,
int num )
static

◆ draw_directory_selector()

static void draw_directory_selector ( int index)
static

◆ draw_stat()

static bool draw_stat ( const char * path)
static

References bfont_draw_str_fmt(), BFONT_HEIGHT, SCREEN_WIDTH, vram_s, x, and y.

Referenced by main().

◆ get_cont_state()

static cont_state_t * get_cont_state ( )
static

◆ main()

◆ mount_sd_fat()

static bool mount_sd_fat ( )
static

◆ prompt_message()

static void prompt_message ( char * message,
bool highlight_yes )
static

◆ show_prompt()

static void show_prompt ( char * current_directory,
bool mounted_sd,
bool highlight_yes )
static

References prompt_message().

Referenced by main().

◆ unmount_sd_fat()

static void unmount_sd_fat ( )
static

References fs_fat_shutdown(), fs_fat_unmount(), and sd_shutdown().

Referenced by main().

Variable Documentation

◆ partition_type

uint8_t partition_type
static

Referenced by main(), and mount_sd_fat().

◆ sd_dev

kos_blockdev_t sd_dev
static

Referenced by main(), mount_sd_fat(), and run_speed_test().