File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
desmume/src/frontend/interface Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,28 @@ EXPORTED char* desmume_savestate_slot_date(int index)
287287 return savestates[index].date ;
288288}
289289
290+ EXPORTED BOOL desmume_backup_import_file (const char *filename, unsigned int force_size) {
291+ if (!nds.backupDevice .isBackupDeviceAvailable ()) {
292+ return FALSE ;
293+ }
294+
295+ bool success = nds.backupDevice .importData (filename, force_size);
296+
297+ if (success) {
298+ NDS_Reset ();
299+ }
300+
301+ return success ? TRUE : FALSE ;
302+ }
303+
304+ EXPORTED BOOL desmume_backup_export_file (const char *filename) {
305+ if (!nds.backupDevice .isBackupDeviceAvailable ()) {
306+ return FALSE ;
307+ }
308+
309+ return nds.backupDevice .exportData (filename) ? TRUE : FALSE ;
310+ }
311+
290312EXPORTED BOOL desmume_gpu_get_layer_main_enable_state (int layer_index)
291313{
292314 return GPU->GetEngineMain ()->GetLayerEnableState (layer_index);
Original file line number Diff line number Diff line change @@ -106,6 +106,27 @@ EXPORTED void desmume_savestate_slot_save(int index);
106106EXPORTED BOOL desmume_savestate_slot_exists (int index);
107107EXPORTED char * desmume_savestate_slot_date (int index);
108108
109+ // Battery save (backup memory) import/export
110+
111+ /* *
112+ * Import battery save file with optional size override.
113+ * Supports .sav (raw), .dsv (DeSmuME), .duc (Action Replay), .dss (DSOrganize).
114+ * The emulator will automatically reset after successful import.
115+ *
116+ * @param filename Path to battery save file
117+ * @param force_size Backup size in bytes (0 = auto-detect, or explicit size like 524288 for 512KB)
118+ * @return TRUE on success, FALSE on failure
119+ */
120+ EXPORTED BOOL desmume_backup_import_file (const char *filename, unsigned int force_size);
121+
122+ /* *
123+ * Export current battery save to .dsv file.
124+ *
125+ * @param filename Destination path for .dsv file
126+ * @return TRUE on success, FALSE on failure
127+ */
128+ EXPORTED BOOL desmume_backup_export_file (const char *filename);
129+
109130EXPORTED BOOL desmume_gpu_get_layer_main_enable_state (int layer_index);
110131EXPORTED BOOL desmume_gpu_get_layer_sub_enable_state (int layer_index);
111132EXPORTED void desmume_gpu_set_layer_main_enable_state (int layer_index, BOOL the_state);
You can’t perform that action at this time.
0 commit comments