Skip to content
Snippets Groups Projects
  • Geo Ster's avatar
    2ad0640f
    Add initial EE/Bus implementations · 2ad0640f
    Geo Ster authored
    * This commit adds a most basic CPU class that acts as a template
    which we will slowly build.
    
    * The architecture is pretty simple; the ComponentManager will create all
    the seperate components (EE, VP, IOP, GS etc) as unique_ptr's since
    it owns them and only it has access to them. All the other components
    must pass through the manager to read/write data to memory.
    To achieve this they are given a pointer to the ComponentManger in their constructor.
    
    * For now the CPU directly accesses the bios which shouldn't
    happen but will be fixed eventually when I implement generic
    read/writes. The goal is to start implementing the CPU as fast as
    possible in order to get to the GPU/VPU's and display something!
    2ad0640f
    History
    Add initial EE/Bus implementations
    Geo Ster authored
    * This commit adds a most basic CPU class that acts as a template
    which we will slowly build.
    
    * The architecture is pretty simple; the ComponentManager will create all
    the seperate components (EE, VP, IOP, GS etc) as unique_ptr's since
    it owns them and only it has access to them. All the other components
    must pass through the manager to read/write data to memory.
    To achieve this they are given a pointer to the ComponentManger in their constructor.
    
    * For now the CPU directly accesses the bios which shouldn't
    happen but will be fixed eventually when I implement generic
    read/writes. The goal is to start implementing the CPU as fast as
    possible in order to get to the GPU/VPU's and display something!
manager.hpp 406 B
#pragma once
#include <array>
#include <memory>
#include <cpu/ee.hpp>

/* This class act as the "motherboard" of sorts */
class ComponentManager {
public:
    ComponentManager();
    ~ComponentManager() = default;

    void tick();

protected:
    void read_bios();

public:
    /* Components */
    std::unique_ptr<EmotionEngine> ee;
    
    /* Memory */
    std::array<uint8_t, 4 * 1024 * 1024> bios;
};