Browse Source

Emu: Convert Emu class to singleton

master
Riyyi 2 years ago
parent
commit
38c053e2d8
  1. 34
      src/emu.h
  2. 0
      src/processing-unit.cpp
  3. 0
      src/processing-unit.h

34
src/emu.h

@ -2,25 +2,29 @@
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
#include "processing_unit.h"
class Emu { #include "processing-unit.h"
#include "ruc/singleton.h"
class Emu : ruc::Singleton<Emu> {
public: public:
void WriteRAM(int location, int length); Emu(s) {}
void WriteVRAM(int location, int length);
void WriteROM(int location, int length); void WriteRAM(int location, int length);
void WriteVRAM(int location, int length);
void WriteROM(int location, int length);
void ReadRAM(int location, int length); void ReadRAM(int location, int length);
void ReadVRAM(int location, int length); void ReadVRAM(int location, int length);
void ReadROM(int location, int length); void ReadROM(int location, int length);
private: private:
float m_frequency; float m_frequency;
int m_cycle = 0; int m_cycle = 0;
uint8_t m_ram[1024]; uint8_t m_ram[1024];
uint8_t m_vram[1024]; uint8_t m_vram[1024];
uint8_t m_rom[1024]; uint8_t m_rom[1024];
std::vector<ProcessingUnit> m_processing_units; std::vector<ProcessingUnit> m_processing_units;
}; };

0
src/processingunit.cpp → src/processing-unit.cpp

0
src/processingunit.h → src/processing-unit.h

Loading…
Cancel
Save