2024-11-23 12:35:37 +00:00
|
|
|
#pragma once
|
2014-11-11 17:13:25 +00:00
|
|
|
|
2024-08-22 15:02:42 +00:00
|
|
|
class serial_kbd;
|
2024-08-29 06:03:46 +00:00
|
|
|
class disp;
|
2024-08-22 15:02:42 +00:00
|
|
|
|
2024-11-23 12:35:37 +00:00
|
|
|
class io: public Memory::Device {
|
2014-11-11 17:13:25 +00:00
|
|
|
public:
|
2024-08-29 06:03:46 +00:00
|
|
|
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 09:35:18 +00:00
|
|
|
|
2024-11-23 12:35:37 +00:00
|
|
|
void operator=(uint8_t b) { _pia.write(_acc, b); }
|
|
|
|
operator uint8_t() { return _pia.read(_acc); }
|
2023-09-27 12:55:10 +00:00
|
|
|
|
|
|
|
void checkpoint(Stream &);
|
|
|
|
void restore(Stream &);
|
|
|
|
|
2024-11-23 12:35:37 +00:00
|
|
|
void poll();
|
2014-11-14 11:45:28 +00:00
|
|
|
void load();
|
2019-03-27 18:25:41 +00:00
|
|
|
filer &files;
|
2023-09-27 09:35:18 +00:00
|
|
|
|
2014-11-11 17:13:25 +00:00
|
|
|
private:
|
2024-11-23 12:35:37 +00:00
|
|
|
PIA _pia;
|
2024-08-22 15:02:42 +00:00
|
|
|
serial_kbd &_kbd;
|
2024-08-29 06:03:46 +00:00
|
|
|
disp &_dsp;
|
2024-08-22 15:02:42 +00:00
|
|
|
|
2018-08-14 10:00:03 +00:00
|
|
|
void enter(uint8_t);
|
2024-08-29 06:03:46 +00:00
|
|
|
bool _loading;
|
2024-11-23 12:35:37 +00:00
|
|
|
uint8_t _ch;
|
2014-11-11 17:13:25 +00:00
|
|
|
};
|