Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
- index a695478..ad88bde 100644
- --- a/apps/plugins/SOURCES
- +++ b/apps/plugins/SOURCES
- @@ -47,6 +47,7 @@ disktidy.c
- flipit.c
- #ifdef HAVE_LCD_BITMAP /* Not for the Player */
- +bench_scaler.c
- rockblox1d.c
- brickmania.c
- maze.c
- diff --git a/apps/plugins/bench_scaler.c b/apps/plugins/bench_scaler.c
- index c24807d..d2d82a4 100644
- --- a/apps/plugins/bench_scaler.c
- +++ b/apps/plugins/bench_scaler.c
- @@ -86,6 +86,9 @@ do { \
- /* this is the plugin entry point */
- enum plugin_status plugin_start(const void* parameter)
- {
- + int fd;
- + char logfilename[MAX_PATH];
- + char *ext;
- size_t plugin_buf_len;
- plugin_buf = (unsigned char *)rb->plugin_get_buffer(&plugin_buf_len);
- struct bitmap bm;
- @@ -96,13 +99,24 @@ enum plugin_status plugin_start(const void* parameter)
- };
- (void)parameter;
- + rb->strcpy(logfilename, rb->plugin_get_current_filename());
- + ext = logfilename + rb->strlen(logfilename) - 5;
- + if (rb->strcasecmp(ext, ".rock"))
- + ext += 5;
- + DEBUGF("ext: %s\n", ext);
- + rb->strncpy(ext, ".log", MAX_PATH - (ext - logfilename));
- + logfilename[MAX_PATH - 1] = 0;
- + DEBUGF("logfilename: %s\n", logfilename);
- + fd = rb->open(logfilename, O_APPEND|O_WRONLY|O_CREAT);
- + if (fd < 0)
- + return PLUGIN_ERROR;
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- rb->lcd_fillrect(0, 0, LCD_WIDTH, LCD_HEIGHT);
- rb->lcd_set_drawmode(DRMODE_SOLID);
- rb->lcd_getstringsize("A", NULL, &font_h);
- bm.data = plugin_buf;
- int in, out;
- - for (in = 64; in < 1025; in <<= 2)
- + for (in = 64; in < 257; in <<= 2)
- {
- for (out = 64; out < 257; out <<= 1)
- {
- @@ -128,11 +142,12 @@ enum plugin_status plugin_start(const void* parameter)
- t1 = t2 / 1000;
- t2 -= t1 * 1000;
- lcd_printf("%01d.%03d secs/scale", (int)t1, (int)t2);
- + rb->fdprintf(fd,"%dx%d->%dx%d took %d.%03d secs/scale\n", in, in, out, out, (int)t1, (int)t2);
- if (!(bm.width && bm.height))
- break;
- }
- }
- -
- + rb->close(fd);
- while (rb->get_action(CONTEXT_STD,1) != ACTION_STD_OK) rb->yield();
- return PLUGIN_OK;
- }
Add Comment
Please, Sign In to add comment