mirror of
https://github.com/jscrane/Apple1.git
synced 2024-11-22 06:31:37 +00:00
05f50a18fd
* extract disp from io * extract screen_disp * working * ... * working * refactor * config
36 lines
595 B
C++
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
|