Mercurial > repos > blastem
comparison blastem.c @ 1489:637fbc3b5063 nuklear_ui
Added code to persist config back to a file
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 29 Nov 2017 08:41:37 -0800 |
parents | 6a35815cc409 |
children | c59adc305e46 |
comparison
equal
deleted
inserted
replaced
1488:f29bd94ffa76 | 1489:637fbc3b5063 |
---|---|
282 menu_system->next_context = game_system; | 282 menu_system->next_context = game_system; |
283 } | 283 } |
284 game_system->next_context = menu_system; | 284 game_system->next_context = menu_system; |
285 setup_saves(&cart, &info, game_system); | 285 setup_saves(&cart, &info, game_system); |
286 update_title(info.name); | 286 update_title(info.name); |
287 } | |
288 | |
289 static void save_config(void) | |
290 { | |
291 persist_config(config); | |
287 } | 292 } |
288 | 293 |
289 int main(int argc, char ** argv) | 294 int main(int argc, char ** argv) |
290 { | 295 { |
291 set_exe_str(argv[0]); | 296 set_exe_str(argv[0]); |
518 menu_system = current_system; | 523 menu_system = current_system; |
519 } else { | 524 } else { |
520 game_system = current_system; | 525 game_system = current_system; |
521 } | 526 } |
522 } | 527 } |
528 | |
529 atexit(save_config); | |
523 | 530 |
524 #ifndef DISABLE_NUKLEAR | 531 #ifndef DISABLE_NUKLEAR |
525 if (use_nuklear) { | 532 if (use_nuklear) { |
526 blastem_nuklear_init(!menu); | 533 blastem_nuklear_init(!menu); |
527 current_system = game_system; | 534 current_system = game_system; |