From 1694847103c777bb93db7e342911f78d0ab05a4c Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Thu, 30 Oct 2003 23:48:36 +0000 Subject: play .ch8 files with the Chip-8 emulator git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3997 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 14 ++++++++++++-- apps/tree.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/tree.c b/apps/tree.c index 6424b3e509..fb62b0ede8 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -310,8 +310,13 @@ struct entry* load_and_sort_directory(char *dirname, int *dirfilter, else if (!strcasecmp(&entry->d_name[len-5], ".rock")) dptr->attr |= TREE_ATTR_ROCK; else if (!strcasecmp(&entry->d_name[len-4], ".ucl")) - dptr->attr |= TREE_ATTR_UCL; } - + dptr->attr |= TREE_ATTR_UCL; +#ifdef HAVE_LCD_BITMAP + else if (!strcasecmp(&entry->d_name[len-4], ".ch8")) + dptr->attr |= TREE_ATTR_CH8; +#endif + } + /* memorize/compare details about the boot file */ if ((currdir[1] == 0) && !strcmp(entry->d_name, BOOTFILE)) { if (boot_size) { @@ -1025,6 +1030,11 @@ static bool dirbrowse(char *root, int *dirfilter) break; #ifdef HAVE_LCD_BITMAP + /* chip-8 game */ + case TREE_ATTR_CH8: + plugin_load("/.rockbox/rocks/chip8.rock",buf); + break; + case TREE_ATTR_FONT: font_load(buf); set_file(buf, global_settings.font_file, diff --git a/apps/tree.h b/apps/tree.h index dea0496508..3086c8914b 100644 --- a/apps/tree.h +++ b/apps/tree.h @@ -37,6 +37,7 @@ struct entry { #define TREE_ATTR_LNG 0x1000 /* binary lang file */ #define TREE_ATTR_ROCK 0x2000 /* binary rockbox plugin */ #define TREE_ATTR_UCL 0x4000 /* rockbox flash image */ +#define TREE_ATTR_CH8 0x8000 /* chip-8 game */ #define TREE_ATTR_MASK 0xffd0 /* which bits tree.c uses (above + DIR) */ void tree_init(void); -- cgit v1.2.3