Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
  2. index a695478..ad88bde 100644
  3. --- a/apps/plugins/SOURCES
  4. +++ b/apps/plugins/SOURCES
  5. @@ -47,6 +47,7 @@ disktidy.c
  6. flipit.c
  7.  
  8. #ifdef HAVE_LCD_BITMAP /* Not for the Player */
  9. +bench_scaler.c
  10. rockblox1d.c
  11. brickmania.c
  12. maze.c
  13. diff --git a/apps/plugins/bench_scaler.c b/apps/plugins/bench_scaler.c
  14. index c24807d..d2d82a4 100644
  15. --- a/apps/plugins/bench_scaler.c
  16. +++ b/apps/plugins/bench_scaler.c
  17. @@ -86,6 +86,9 @@ do { \
  18. /* this is the plugin entry point */
  19. enum plugin_status plugin_start(const void* parameter)
  20. {
  21. + int fd;
  22. + char logfilename[MAX_PATH];
  23. + char *ext;
  24. size_t plugin_buf_len;
  25. plugin_buf = (unsigned char *)rb->plugin_get_buffer(&plugin_buf_len);
  26. struct bitmap bm;
  27. @@ -96,13 +99,24 @@ enum plugin_status plugin_start(const void* parameter)
  28. };
  29. (void)parameter;
  30.  
  31. + rb->strcpy(logfilename, rb->plugin_get_current_filename());
  32. + ext = logfilename + rb->strlen(logfilename) - 5;
  33. + if (rb->strcasecmp(ext, ".rock"))
  34. + ext += 5;
  35. + DEBUGF("ext: %s\n", ext);
  36. + rb->strncpy(ext, ".log", MAX_PATH - (ext - logfilename));
  37. + logfilename[MAX_PATH - 1] = 0;
  38. + DEBUGF("logfilename: %s\n", logfilename);
  39. + fd = rb->open(logfilename, O_APPEND|O_WRONLY|O_CREAT);
  40. + if (fd < 0)
  41. + return PLUGIN_ERROR;
  42. rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  43. rb->lcd_fillrect(0, 0, LCD_WIDTH, LCD_HEIGHT);
  44. rb->lcd_set_drawmode(DRMODE_SOLID);
  45. rb->lcd_getstringsize("A", NULL, &font_h);
  46. bm.data = plugin_buf;
  47. int in, out;
  48. - for (in = 64; in < 1025; in <<= 2)
  49. + for (in = 64; in < 257; in <<= 2)
  50. {
  51. for (out = 64; out < 257; out <<= 1)
  52. {
  53. @@ -128,11 +142,12 @@ enum plugin_status plugin_start(const void* parameter)
  54. t1 = t2 / 1000;
  55. t2 -= t1 * 1000;
  56. lcd_printf("%01d.%03d secs/scale", (int)t1, (int)t2);
  57. + rb->fdprintf(fd,"%dx%d->%dx%d took %d.%03d secs/scale\n", in, in, out, out, (int)t1, (int)t2);
  58. if (!(bm.width && bm.height))
  59. break;
  60. }
  61. }
  62. -
  63. + rb->close(fd);
  64. while (rb->get_action(CONTEXT_STD,1) != ACTION_STD_OK) rb->yield();
  65. return PLUGIN_OK;
  66. }
Add Comment
Please, Sign In to add comment