// // Created by anonymus-raccoon on 1/27/20. // #ifndef COMSQUARE_SNES_HPP #define COMSQUARE_SNES_HPP #include "Memory/MemoryBus.hpp" #include "CPU/CPU.hpp" #include "Cartridge/Cartridge.hpp" #include "Ram/Ram.hpp" #include "PPU/PPU.hpp" #include "APU/APU.hpp" #include "Renderer/IRenderer.hpp" #ifdef DEBUGGER_ENABLED #include "Debugger/MemoryViewer.hpp" #include "Debugger/HeaderViewer.hpp" #endif namespace ComSquare { //! @brief Container of all the components of the SNES. class SNES { private: #ifdef DEBUGGER_ENABLED //! @brief The window that allow the user to view a memory. std::shared_ptr _ramViewer; //! @brief The window that allow the user to view the cartridge's header. std::shared_ptr _headerViewer; #endif std::shared_ptr _bus; public: //! @brief Cartridge containing instructions (ROM). std::shared_ptr cartridge; //! @brief Work Ram shared by all the components. std::shared_ptr wram; //! @brief Save Ram residing inside the Cartridge in a real SNES. std::shared_ptr sram; //! @brief External Ram used only by the Audio Processing Unit std::shared_ptr apuRam; //! @brief Central Processing Unit of the SNES. std::shared_ptr cpu; //! @brief Picture Processing Unit of the SNES std::shared_ptr ppu; //! @brief Audio Processing Unit if the SNES std::shared_ptr apu; //! @brief Call this function to update all the components void update(); //! @brief Disable the CPU's debugging window. void disableCPUDebugging(); //! @brief Enable the CPU's debugging window. void enableCPUDebugging(); //! @brief Disable the Ram's debugging window. void disableRamViewer(); //! @brief Enable the Ram's debugging window. void enableRamViewer(); //! @brief Disable the Header's debugging window. void disableHeaderViewer(); //! @brief Enable the Header's debugging window. void enableHeaderViewer(); //! @brief Disable the APU's debugging window. void disableAPUDebugging(); //! @brief Enable the APU's debugging window. void enableAPUDebugging(); //! @brief Create all the components using a common memory bus for all of them. SNES(const std::shared_ptr &bus, const std::string &ramPath, Renderer::IRenderer &renderer); SNES(const SNES &) = default; SNES &operator=(const SNES &) = default; ~SNES() = default; }; } #endif //COMSQUARE_SNES_HPP