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

filer extends serialio

This commit is contained in:
Stephen Crane 2019-02-11 18:28:38 +00:00
parent 397f580add
commit d2377f4dbe
7 changed files with 26 additions and 18 deletions

View File

@ -1,6 +1,7 @@
#include <stdint.h>
#include "memory.h"
#include "serialio.h"
#include "acia.h"
void acia::operator=(uint8_t b) {

17
acia.h
View File

@ -1,23 +1,6 @@
#ifndef __ACIA_H__
#define __ACIA_H__
enum parity {
none,
even,
odd,
};
class serialio {
public:
virtual void reset() {}
virtual void framing(unsigned data_bits, unsigned stop_bits, parity p) {}
virtual void write(uint8_t) {}
virtual uint8_t read() =0;
virtual bool more() { return false; }
};
class acia: public Memory::Device {
public:
void operator= (uint8_t);

View File

@ -2,6 +2,7 @@
#include <stdio.h>
#include <string.h>
#include "hardware.h"
#include "serialio.h"
#include "filer.h"
#include "checkpoint.h"

View File

@ -11,6 +11,7 @@
#include <FS.h>
#endif
#include "serialio.h"
#include "filer.h"
#if defined(DISK)

View File

@ -1,7 +1,7 @@
#ifndef __FILER_H__
#define __FILER_H__
class filer {
class filer: public serialio {
public:
virtual const char *advance() =0;
virtual const char *rewind() =0;
@ -10,6 +10,8 @@ public:
virtual void stop() =0;
};
// split into sd_filer and fs_filer
// implement write to new file (like checkpoint)
class flash_filer: public filer {
public:
const char *advance();

View File

@ -9,6 +9,7 @@
#include "ps2drv.h"
#include "tftdisplay.h"
#include "keyboard.h"
#include "serialio.h"
#include "filer.h"
#include "timed.h"
#include "hardware.h"

19
serialio.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef __SERIALIO_H__
#define __SERIALIO_H__
enum parity {
none,
even,
odd,
};
class serialio {
public:
virtual void reset() {}
virtual void framing(unsigned data_bits, unsigned stop_bits, parity p) {}
virtual void write(uint8_t) {}
virtual uint8_t read() =0;
virtual bool more() { return false; }
};
#endif