1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-10-08 22:54:38 +00:00
r65emu/flash_filer.h

41 lines
690 B
C
Raw Normal View History

#ifndef __FLASH_FILER_H__
#define __FLASH_FILER_H__
2023-10-20 12:01:15 +00:00
#define MAX_FILES 5
class flash_file: virtual public serialio {
public:
flash_file(uint8_t fd = 0): _fd(fd) {}
virtual bool more();
virtual uint8_t read();
virtual void write(uint8_t);
bool seek(uint32_t pos);
2023-10-20 12:01:15 +00:00
operator bool() const;
private:
const uint8_t _fd;
};
class flash_filer: public filer, public flash_file {
public:
flash_filer(const char *programs): _programs(programs) {}
const char *advance();
const char *rewind();
const char *checkpoint();
void restore(const char *);
bool start();
void stop();
void select(uint8_t f) { _current = f; }
private:
const char *_programs;
uint8_t _current;
};
#endif