Apple1-esp/io.h
Stephen Crane 05f50a18fd
Serial display (#11)
* extract disp from io

* extract screen_disp

* working

* ...

* working

* refactor

* config
2024-08-29 07:03:46 +01:00

36 lines
595 B
C++

#ifndef _IO_H
#define _IO_H
class serial_kbd;
class disp;
class io: public Memory::Device, public PIA {
public:
io(filer &files, serial_kbd &kbd, disp &dsp):
Memory::Device(Memory::page_size), files(files), _kbd(kbd), _dsp(dsp) {}
void reset();
bool start();
void operator=(uint8_t b) { PIA::write(_acc, b); }
operator uint8_t() { return PIA::read(_acc); }
void checkpoint(Stream &);
void restore(Stream &);
void write_portb(uint8_t);
uint8_t read_cra();
void load();
filer &files;
private:
serial_kbd &_kbd;
disp &_dsp;
void enter(uint8_t);
bool _loading;
};
#endif