#ifndef MACHINE_H #define MACHINE_H #include "Sound.h" #include "Graphics/Graphics.h" #include "Interpreter/Interpreter.h" #include "SDL3/SDL_events.h" #include "UI/Display.h" #include "UI/UIManager.h" class Machine { std::shared_ptr machine_state; std::shared_ptr graphics; std::unique_ptr sound; std::shared_ptr callback_manager; std::shared_ptr interpreter; std::unique_ptr ui_manager; int ips; uint64_t last_update_time; double accumulator; double target_cycle_time; uint64_t last_timer_time; double timer_accumulator; double timer_cycle_time; std::string rom; bool running; void execute_interpreter(); void update_timers(); void on_rom_load(const std::string& path); void on_reset() const; void on_stop(); void on_resume(); void on_step(int steps); void on_speed_change(int ips); void on_reload(); public: void register_callbacks(); Machine(); void iterate(); bool on_event(const SDL_Event* event) const; }; #endif //MACHINE_H