summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-10-30 23:48:36 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-10-30 23:48:36 +0000
commit1694847103c777bb93db7e342911f78d0ab05a4c (patch)
tree7ab8fe1237b58eb5ae61c42d19970735e1163804
parent0860a4d6d17b86772b388c69d42c49d33e3a0898 (diff)
downloadrockbox-1694847103c777bb93db7e342911f78d0ab05a4c.zip
rockbox-1694847103c777bb93db7e342911f78d0ab05a4c.tar.gz
rockbox-1694847103c777bb93db7e342911f78d0ab05a4c.tar.bz2
rockbox-1694847103c777bb93db7e342911f78d0ab05a4c.tar.xz
play .ch8 files with the Chip-8 emulator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3997 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tree.c14
-rw-r--r--apps/tree.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 6424b3e..fb62b0e 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 dea0496..3086c89 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);