summaryrefslogtreecommitdiff
path: root/apps/plugins/chip8.c
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2008-05-13 09:57:56 +0000
committerSteve Bavin <pondlife@pondlife.me>2008-05-13 09:57:56 +0000
commit652657781805d9cc10d744a49fb23eb17019fbbf (patch)
tree2d1a6ae597a17531f726b57fd9f8cbaa2a46a07f /apps/plugins/chip8.c
parenta94e40d5153ab698fa8a1b6b57d91fcb6acc905e (diff)
downloadrockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.gz
rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.zip
Plugin parameters should be const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chip8.c')
-rw-r--r--apps/plugins/chip8.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index e00e4213e8..d62ff5a7bf 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -24,7 +24,7 @@
24 24
25PLUGIN_HEADER 25PLUGIN_HEADER
26 26
27static struct plugin_api* rb; /* here is a global api struct pointer */ 27static const struct plugin_api* rb; /* here is a global api struct pointer */
28 28
29#define EXTERN static 29#define EXTERN static
30#define STATIC static 30#define STATIC static
@@ -1287,7 +1287,7 @@ static void chip8_interrupt (void)
1287 starttimer = newtimer - runtime; 1287 starttimer = newtimer - runtime;
1288} 1288}
1289 1289
1290static bool chip8_init(char* file) 1290static bool chip8_init(const char* file)
1291{ 1291{
1292 int numread; 1292 int numread;
1293 int fd; 1293 int fd;
@@ -1307,14 +1307,16 @@ static bool chip8_init(char* file)
1307 1307
1308 rb->close(fd); 1308 rb->close(fd);
1309 /* is there a c8k file (chip8 keys) ? */ 1309 /* is there a c8k file (chip8 keys) ? */
1310 char c8kname[MAX_PATH];
1311 rb->strcpy(c8kname, file);
1310 for(i=0; i<16; i++) { 1312 for(i=0; i<16; i++) {
1311 chip8_virtual_keys[i] = 0; 1313 chip8_virtual_keys[i] = 0;
1312 chip8_keymap[i] = i; 1314 chip8_keymap[i] = i;
1313 } 1315 }
1314 len = rb->strlen(file); 1316 len = rb->strlen(c8kname);
1315 file[len-2] = '8'; 1317 c8kname[len-2] = '8';
1316 file[len-1] = 'k'; 1318 c8kname[len-1] = 'k';
1317 fd = rb->open(file, O_RDONLY); 1319 fd = rb->open(c8kname, O_RDONLY);
1318 if (fd!=-1) { 1320 if (fd!=-1) {
1319 rb->lcd_puts(0, 6, "File&Keymap OK."); 1321 rb->lcd_puts(0, 6, "File&Keymap OK.");
1320 numread = rb->read(fd, chip8_keymap, 16); 1322 numread = rb->read(fd, chip8_keymap, 16);
@@ -1340,7 +1342,7 @@ static bool chip8_init(char* file)
1340 return true; 1342 return true;
1341} 1343}
1342 1344
1343bool chip8_run(char* file) 1345bool chip8_run(const char* file)
1344{ 1346{
1345 int ok; 1347 int ok;
1346 1348
@@ -1406,9 +1408,9 @@ bool chip8_run(char* file)
1406 1408
1407/***************** Plugin Entry Point *****************/ 1409/***************** Plugin Entry Point *****************/
1408 1410
1409enum plugin_status plugin_start(struct plugin_api* api, void* parameter) 1411enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
1410{ 1412{
1411 char* filename; 1413 const char* filename;
1412 1414
1413 rb = api; /* copy to global api pointer */ 1415 rb = api; /* copy to global api pointer */
1414 1416