2014-11-11 17:13:25 +00:00
|
|
|
#ifndef _IO_H
|
|
|
|
#define _IO_H
|
|
|
|
|
2024-08-22 16:02:42 +01:00
|
|
|
class serial_kbd;
|
|
|
|
|
|
|
|
class io: public Memory::Device, public Display, public PIA {
|
2014-11-11 17:13:25 +00:00
|
|
|
public:
|
2024-08-22 16:02:42 +01:00
|
|
|
io(filer &files, serial_kbd &kbd): Memory::Device(Memory::page_size), files(files), _kbd(kbd) {}
|
2019-03-26 19:34:49 +00:00
|
|
|
|
2023-09-27 13:55:10 +01:00
|
|
|
void reset();
|
|
|
|
bool start();
|
2023-09-27 10:35:18 +01:00
|
|
|
|
2023-09-27 13:55:10 +01:00
|
|
|
static void on_tick();
|
2014-11-11 17:13:25 +00:00
|
|
|
|
2023-09-27 13:55:10 +01: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;
|
2023-09-27 10:35:18 +01:00
|
|
|
|
|
|
|
static const uint8_t ROWS = 24;
|
|
|
|
static const uint8_t COLS = 40;
|
|
|
|
|
2014-11-11 17:13:25 +00:00
|
|
|
private:
|
2024-08-22 16:02:42 +01:00
|
|
|
serial_kbd &_kbd;
|
|
|
|
|
2023-09-27 13:55:10 +01:00
|
|
|
void cursor(bool on);
|
2018-08-14 11:00:03 +01:00
|
|
|
void display(uint8_t);
|
2014-11-12 08:28:32 +00:00
|
|
|
void draw(char, int, int);
|
2018-08-14 11:00:03 +01:00
|
|
|
void enter(uint8_t);
|
2014-11-11 17:13:25 +00:00
|
|
|
|
2023-09-27 10:35:18 +01:00
|
|
|
bool _shift, _loading;
|
|
|
|
uint8_t r, c;
|
|
|
|
char screen[ROWS][COLS];
|
2014-11-11 17:13:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|