xevi/simulation/src/simeeprom.cpp
Mikael Degerfält 266b3334cb Simple simulation code
Builds a native program on MacOS that runs the NuEVI firmware compiled for x86_64.
Only input is arrow keys for menu buttons for now. Only output is console and display.

Copied some more library files into the simulation folder, and renamed the modified *.cpp files from the libraries to *_sim.cpp.
2019-06-13 20:51:45 +02:00

30 lines
No EOL
525 B
C++

#include <stdint.h>
#include "EEPROM.h"
// TODO: Fake eeprom a bit better, maybe even save to file.
static char someFakeEEPROM_memory[4096];
uint8_t EEPROMClass::read( int idx )
{
return someFakeEEPROM_memory[idx];
}
void EEPROMClass::write( int idx, uint8_t val )
{
someFakeEEPROM_memory[idx] = val;
}
void EEPROMClass::update( int idx, uint8_t val )
{
someFakeEEPROM_memory[idx] = val;
}
uint16_t EEPROMClass::length()
{
return sizeof(someFakeEEPROM_memory);
}
// TODO: Add missing functioality..