1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-21 12:29:51 +00:00

break hardware_reset() out of hardware_init()

This commit is contained in:
Stephen Crane 2014-10-31 08:44:28 +00:00
parent 3337dd8646
commit 53cbb2cc3d
2 changed files with 14 additions and 8 deletions

View File

@ -14,15 +14,10 @@ spiram sram(SPIRAM_SIZE);
UTFT utft(TFT_MODEL, TFT_RS, TFT_WR, TFT_CS, TFT_RST);
static CPU *_cpu;
bool hardware_init(CPU &cpu) {
_cpu = &cpu;
ps2.begin(KBD_DATA, KBD_IRQ);
pinMode(SD_CS, OUTPUT);
bool hardware_reset() {
bool sd = SD.begin(SD_CS, 3, SD_SPI);
#if defined(TFT_BACKLIGHT)
pinMode(TFT_BACKLIGHT, OUTPUT);
digitalWrite(TFT_BACKLIGHT, HIGH);
#endif
utft.InitLCD();
@ -31,10 +26,20 @@ bool hardware_init(CPU &cpu) {
sram.begin(SPIRAM_CS, SPIRAM_SPI);
cpu.reset();
_cpu->reset();
return sd;
}
void hardware_init(CPU &cpu) {
_cpu = &cpu;
memory.begin();
ps2.begin(KBD_DATA, KBD_IRQ);
pinMode(SD_CS, OUTPUT);
#if defined(TFT_BACKLIGHT)
pinMode(TFT_BACKLIGHT, OUTPUT);
#endif
}
void hardware_checkpoint(Stream &s) {
unsigned ds = 0;
for (unsigned i = 0; i < 0x10000; i += ds) {

View File

@ -32,7 +32,8 @@
#define SD_CS PF_3
#define SD_SPI 1
bool hardware_init(class CPU &);
bool hardware_reset();
void hardware_init(class CPU &);
void hardware_checkpoint(Stream &); // FIXME: make a path?
void hardware_restore(Stream &);