mirror of
https://github.com/jscrane/r65emu.git
synced 2025-01-09 11:31:17 +00:00
renaming
This commit is contained in:
parent
984692ad95
commit
397f580add
6
acia.h
6
acia.h
@ -7,7 +7,7 @@ enum parity {
|
||||
odd,
|
||||
};
|
||||
|
||||
class SerialDevice {
|
||||
class serialio {
|
||||
public:
|
||||
virtual void reset() {}
|
||||
virtual void framing(unsigned data_bits, unsigned stop_bits, parity p) {}
|
||||
@ -23,7 +23,7 @@ public:
|
||||
void operator= (uint8_t);
|
||||
operator uint8_t();
|
||||
|
||||
acia(SerialDevice *d): Memory::Device(256), _device(d) {}
|
||||
acia(serialio &d): Memory::Device(256), _device(&d) {}
|
||||
|
||||
// status bits
|
||||
//
|
||||
@ -63,6 +63,6 @@ public:
|
||||
static const uint8_t eri = 1 << 7; // enable receive interrupt
|
||||
|
||||
private:
|
||||
SerialDevice *_device;
|
||||
serialio *_device;
|
||||
};
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "hardware.h"
|
||||
#include "sdtape.h"
|
||||
#include "filer.h"
|
||||
#include "checkpoint.h"
|
||||
|
||||
#if defined(USE_SD)
|
||||
@ -17,9 +17,9 @@ static char buf[32];
|
||||
static char chkpt[] = { "CHKPOINT" };
|
||||
static int cpid = 0;
|
||||
|
||||
const char *checkpoint(sdtape &tape, const char *dir) {
|
||||
const char *checkpoint(filer &f, const char *dir) {
|
||||
#if defined(USE_SD) || defined(USE_SPIFFS) || defined(ESP8266)
|
||||
tape.stop();
|
||||
f.stop();
|
||||
snprintf(buf, sizeof(buf), "%s%s.%03d", dir, chkpt, cpid++);
|
||||
|
||||
#if defined(USE_SD)
|
||||
@ -31,14 +31,14 @@ const char *checkpoint(sdtape &tape, const char *dir) {
|
||||
#endif
|
||||
hardware_checkpoint(file);
|
||||
file.close();
|
||||
tape.start(dir);
|
||||
f.start(dir);
|
||||
#endif
|
||||
return buf;
|
||||
}
|
||||
|
||||
void restore(sdtape &tape, const char *dir, const char *filename) {
|
||||
void restore(filer &f, const char *dir, const char *filename) {
|
||||
#if defined(USE_SD) || defined(USE_SPIFFS) || defined(ESP8266)
|
||||
tape.stop();
|
||||
f.stop();
|
||||
snprintf(buf, sizeof(buf), "%s%s", dir, filename);
|
||||
|
||||
#if defined(USE_SD)
|
||||
@ -53,5 +53,5 @@ void restore(sdtape &tape, const char *dir, const char *filename) {
|
||||
int n = sscanf(buf + strlen(dir), "%[A-Z0-9].%d", chkpt, &cpid);
|
||||
cpid = (n == 1)? 0: cpid+1;
|
||||
#endif
|
||||
tape.start(dir);
|
||||
f.start(dir);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __CHECKPOINT_H__
|
||||
|
||||
// utility checkpoint functions
|
||||
const char *checkpoint(sdtape &tape, const char *dir);
|
||||
void restore(sdtape &tape, const char *dir, const char *filename);
|
||||
const char *checkpoint(filer &f, const char *dir);
|
||||
void restore(filer &f, const char *dir, const char *filename);
|
||||
|
||||
#endif
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <FS.h>
|
||||
#endif
|
||||
|
||||
#include "sdtape.h"
|
||||
#include "filer.h"
|
||||
|
||||
#if defined(DISK)
|
||||
static File file, dir;
|
||||
@ -23,7 +23,7 @@ static const char *programs;
|
||||
|
||||
#define STORAGE defined(USE_SD) || defined(USE_SPIFFS) || defined(USE_FS)
|
||||
|
||||
bool sdtape::start(const char *programs)
|
||||
bool flash_filer::start(const char *programs)
|
||||
{
|
||||
#if defined(USE_FS)
|
||||
::programs = programs;
|
||||
@ -38,14 +38,14 @@ bool sdtape::start(const char *programs)
|
||||
return true;
|
||||
}
|
||||
|
||||
void sdtape::stop()
|
||||
void flash_filer::stop()
|
||||
{
|
||||
#if STORAGE
|
||||
file.close();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool sdtape::more()
|
||||
bool flash_filer::more()
|
||||
{
|
||||
if (_pos >= _len) {
|
||||
_pos = 0;
|
||||
@ -58,7 +58,7 @@ bool sdtape::more()
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *sdtape::advance() {
|
||||
const char *flash_filer::advance() {
|
||||
#if STORAGE
|
||||
bool rewound = false;
|
||||
file.close();
|
||||
@ -94,7 +94,7 @@ const char *sdtape::advance() {
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *sdtape::rewind() {
|
||||
const char *flash_filer::rewind() {
|
||||
#if defined(DISK)
|
||||
dir.rewindDirectory();
|
||||
#endif
|
28
filer.h
Normal file
28
filer.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef __FILER_H__
|
||||
#define __FILER_H__
|
||||
|
||||
class filer {
|
||||
public:
|
||||
virtual const char *advance() =0;
|
||||
virtual const char *rewind() =0;
|
||||
|
||||
virtual bool start(const char *) =0;
|
||||
virtual void stop() =0;
|
||||
};
|
||||
|
||||
class flash_filer: public filer {
|
||||
public:
|
||||
const char *advance();
|
||||
const char *rewind();
|
||||
|
||||
bool start(const char *);
|
||||
void stop();
|
||||
|
||||
uint8_t read() { return _buf[_pos++]; }
|
||||
bool more();
|
||||
|
||||
private:
|
||||
unsigned _pos, _len;
|
||||
uint8_t _buf[128];
|
||||
};
|
||||
#endif
|
2
r65emu.h
2
r65emu.h
@ -9,7 +9,7 @@
|
||||
#include "ps2drv.h"
|
||||
#include "tftdisplay.h"
|
||||
#include "keyboard.h"
|
||||
#include "sdtape.h"
|
||||
#include "filer.h"
|
||||
#include "timed.h"
|
||||
#include "hardware.h"
|
||||
#include "checkpoint.h"
|
||||
|
Loading…
Reference in New Issue
Block a user