You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SNESEmulator/main.cpp

56 lines
979 B

2 years ago
#include "pixelGameEngine.h"
using namespace olc;
bool USE_DEBUG_DISPLAY=false;
int EMULATOR_SCREEN_WIDTH = 64;
int EMULATOR_SCREEN_HEIGHT = 32;
int EMULATOR_PIXEL_SIZE=5;
2 years ago
class SNESEmulator : public olc::PixelGameEngine
2 years ago
{
public:
//SplashScreen s;
SNESEmulator()
2 years ago
{
sAppName = "SNES Emulator";
2 years ago
}
public:
std::array<uint8_t,128000>memory={}; //128KB RAM
std::array<uint8_t,4000000>cartridge={}; //32 Mb cartidge (seems to be the max)
2 years ago
bool OnUserCreate() override
{
std::ifstream file("/home/niconiconii/Documents/Earthbound (USA).smc",std::ios_base::binary);
uint32_t counter=0x0;
while (file.good()){
uint8_t val = file.get();
if (val!=-1){
memory[counter++]=val;
std::cout<<val<<std::endl;
}
}
2 years ago
return true;
}
bool OnUserUpdate(float fElapsedTime) override
{
return true;
}
bool OnUserDestroy()override{
return true;
}
};
int main()
{
SNESEmulator demo;
if (demo.Construct(64, 32, 10, 10))
2 years ago
demo.Start();
2 years ago
return 0;
}