예제 #1
0
파일: files.c 프로젝트: doomglue/aleph
// store scene to sdcard at name
void files_store_scene_name(const char* name, u8 ext) {
  //u32 i;
  void* fp;
  char namebuf[64] = SCENES_PATH;
  u8* pScene;

  app_pause();

  strcat(namebuf, name);

  if(ext) {
    // weird..
    strip_space(namebuf, 32);
    strcat(namebuf, ".scn");
  }

  print_dbg("\r\n opening scene file for writing: ");
  print_dbg(namebuf);

  // fill the scene RAM buffer from current state of system
  scene_write_buf(); 
  // open FP for writing
  fp = fl_fopen(namebuf, "wb");
  pScene = (u8*)sceneData;
  fl_fwrite((const void*)pScene, sizeof(sceneData_t), 1, fp);
  fl_fclose(fp);
  // rescan
  list_scan(&sceneList, SCENES_PATH);
  delay_ms(10);

  app_resume();
}
예제 #2
0
파일: files.c 프로젝트: Someone101/aleph
// store scene to sdcard at name
void files_store_scene_name(const char* name, u8 ext) {
  //u32 i;
  void* fp;
  char namebuf[64] = SCENES_PATH;
  u8* pScene;

  app_pause();

  strcat(namebuf, name);

  if(ext) {
    // weird..
    strip_space(namebuf, 32);
    strcat(namebuf, ".scn");
  }

  print_dbg("\r\n opening scene file for writing: ");
  print_dbg(namebuf);

  // fill the scene RAM buffer from current state of system
  scene_write_buf(); 
  print_dbg("\r\n filled scene binary buffer");

  // open FP for writing
  fp = fl_fopen(namebuf, "wb");
  print_dbg("\r\n opened file for binary write at 0x");
  print_dbg_hex((u32)fp);

  pScene = (u8*)sceneData;
  print_dbg("\r\n writing data from scene buffer at 0x");
  print_dbg_hex((u32)pScene);
  print_dbg(", size : ");
  print_dbg_hex(sizeof(sceneData_t));
  

  // dump the scene data to debug output...

  fl_fwrite((const void*)pScene, sizeof(sceneData_t), 1, fp);
  fl_fclose(fp);

  print_dbg("\r\n ... finished writing, closed file pointer");

  // rescan
  list_scan(&sceneList, SCENES_PATH);
  delay_ms(10);

  print_dbg("\r\n re-scanned scene file list and waited.");

  app_resume();
}
예제 #3
0
파일: files.c 프로젝트: bbnickell/aleph
// store scene to sdcard at name
void files_store_scene_name(const char* name) {
  FILE* f = fopen(name, "w");
  scene_write_buf();
  fwrite((const void*)sceneData, sizeof(sceneData_t), 1, f);
  fclose(f);
}