NESe (pronounced "Nessie") is a NES emulator based on the e6502 emulator, also written in C with a focus on speed and portability for use on embedded platforms, especially ARM.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1014B

  1. #ifndef NESE_STATE_H_
  2. #define NESE_STATE_H_
  3. #include <stdint.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include "input.h"
  7. #include "overlay.h"
  8. #include "render.h"
  9. #include "audio.h"
  10. #include "nes.h"
  11. // Persistent State
  12. typedef struct {
  13. char* filename;
  14. FILE* file;
  15. } cart_info;
  16. void cart_info_done(cart_info*);
  17. typedef enum {
  18. State_Bit_Fullscreen = 0,
  19. State_Bit_Integer_Scale = 1,
  20. State_Bit_CRT_Effect = 2,
  21. } nese_State_Flag_Bits;
  22. typedef struct {
  23. cart_info cart;
  24. uint32_t flags; // nese_State_Flag_Bits
  25. } nese_State;
  26. void nese_state_done(nese_State*);
  27. int load_prefs_file(nese_State*, FILE*);
  28. int save_prefs_file(const nese_State*, FILE*);
  29. int load_prefs_filename(nese_State*, const char*);
  30. int save_prefs_filename(const nese_State*, const char*);
  31. // Running State
  32. typedef struct nese_Components {
  33. nes_Renderer* rend;
  34. nes_Input_Reader* reader;
  35. nes_Audio_Stream* audio;
  36. nes* sys;
  37. nese_State* state;
  38. } nese_Components;
  39. #endif // NESE_STATE_H_