Apple1-esp/io.h

36 lines
595 B
C
Raw Normal View History

2014-11-11 17:13:25 +00:00
#ifndef _IO_H
#define _IO_H
class serial_kbd;
class disp;
class io: public Memory::Device, public PIA {
2014-11-11 17:13:25 +00:00
public:
io(filer &files, serial_kbd &kbd, disp &dsp):
Memory::Device(Memory::page_size), files(files), _kbd(kbd), _dsp(dsp) {}
2019-03-26 19:34:49 +00:00
2023-09-27 12:55:10 +00:00
void reset();
bool start();
2023-09-27 12:55:10 +00:00
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();
2014-11-11 17:13:25 +00:00
2014-11-14 11:45:28 +00:00
void load();
2019-03-27 18:25:41 +00:00
filer &files;
2014-11-11 17:13:25 +00:00
private:
serial_kbd &_kbd;
disp &_dsp;
2018-08-14 10:00:03 +00:00
void enter(uint8_t);
bool _loading;
2014-11-11 17:13:25 +00:00
};
#endif