emulator.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. struct Emulator : higan::Platform {
  2. higan::Node::Object root;
  3. //emulator.cpp
  4. auto create(shared_pointer<higan::Interface>, string location) -> void;
  5. auto unload() -> void;
  6. auto main() -> void;
  7. auto quit() -> void;
  8. auto power(bool on) -> void;
  9. auto validateConfiguration(Markup::Node, Markup::Node) -> void;
  10. auto connected(string location) -> higan::Node::Port;
  11. //platform.cpp
  12. auto attach(higan::Node::Object) -> void override;
  13. auto detach(higan::Node::Object) -> void override;
  14. auto open(higan::Node::Object, string name, vfs::file::mode mode, bool required) -> shared_pointer<vfs::file> override;
  15. auto event(higan::Event) -> void override;
  16. auto log(string_view message) -> void override;
  17. auto video(higan::Node::Screen, const uint32_t* data, uint pitch, uint width, uint height) -> void override;
  18. auto audio(higan::Node::Stream) -> void override;
  19. auto input(higan::Node::Input) -> void override;
  20. //video.cpp
  21. auto videoUpdate() -> void;
  22. auto videoUpdateColors() -> void;
  23. auto videoUpdateShader() -> void;
  24. auto videoToggleFullscreen() -> void;
  25. //audio.cpp
  26. auto audioUpdate() -> void;
  27. auto audioUpdateEffects() -> void;
  28. //input.cpp
  29. auto inputUpdate() -> void;
  30. //states.cpp
  31. auto saveState(uint slot) -> bool;
  32. auto loadState(uint slot) -> bool;
  33. //status.cpp
  34. auto updateMessage() -> void;
  35. auto showMessage(const string& message = {}) -> void;
  36. auto setCaption(const string& caption = {}) -> void;
  37. //utility.cpp
  38. auto captureScreenshot(const uint32_t* data, uint pitch, uint width, uint height) -> void;
  39. struct System {
  40. string name;
  41. string data;
  42. string templates;
  43. bool power = false;
  44. file_buffer log;
  45. } system;
  46. struct Events {
  47. bool power = false;
  48. } events;
  49. struct Requests {
  50. bool captureScreenshot = false;
  51. } requests;
  52. struct State {
  53. struct Message {
  54. uint64_t timestamp = 0;
  55. string text;
  56. } message;
  57. } state;
  58. vector<higan::Node::Screen> screens;
  59. vector<higan::Node::Stream> streams;
  60. };
  61. extern Emulator emulator;