Sort of working OS allocator, except freeing is impossible
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
#include "cpu.hpp"
|
||||
#include "helpers.hpp"
|
||||
@@ -8,6 +9,10 @@
|
||||
#include "SFML/Window.hpp"
|
||||
#include "SFML/Graphics.hpp"
|
||||
|
||||
enum class ROMType {
|
||||
None, ELF, Cart
|
||||
};
|
||||
|
||||
class Emulator {
|
||||
CPU cpu;
|
||||
Memory memory;
|
||||
@@ -16,6 +21,10 @@ class Emulator {
|
||||
sf::RenderWindow window;
|
||||
static constexpr u32 width = 400;
|
||||
static constexpr u32 height = 240 * 2; // * 2 because 2 screens
|
||||
ROMType romType = ROMType::None;
|
||||
|
||||
// Keep the handle for the ROM here to reload when necessary and to prevent deleting it
|
||||
std::ifstream loadedROM;
|
||||
|
||||
public:
|
||||
Emulator() : window(sf::VideoMode(width, height), "Alber", sf::Style::Default, sf::ContextSettings(0, 0, 0, 4, 3)),
|
||||
@@ -31,4 +40,5 @@ public:
|
||||
void runFrame();
|
||||
|
||||
bool loadELF(std::filesystem::path& path);
|
||||
bool loadELF(std::ifstream& file);
|
||||
};
|
||||
Reference in New Issue
Block a user