mirror of
https://github.com/jscrane/r65emu.git
synced 2025-02-15 07:30:43 +00:00
minor updates
This commit is contained in:
parent
bfb6b379d0
commit
2c2d8146d2
3
acia.h
3
acia.h
@ -9,6 +9,7 @@ public:
|
|||||||
uint8_t read(Memory::address);
|
uint8_t read(Memory::address);
|
||||||
|
|
||||||
ACIA(serialio &s): _serial(&s) {}
|
ACIA(serialio &s): _serial(&s) {}
|
||||||
|
void set_device(serialio *s) { _serial = s; }
|
||||||
|
|
||||||
// status bits
|
// status bits
|
||||||
//
|
//
|
||||||
@ -55,6 +56,6 @@ protected:
|
|||||||
virtual void write_data(uint8_t);
|
virtual void write_data(uint8_t);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class serialio *_serial;
|
serialio *_serial;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,6 +29,38 @@ bool flash_file::seek(uint32_t pos)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool flash_file::more()
|
||||||
|
{
|
||||||
|
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
||||||
|
return files[_fd].available() > 0;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t flash_file::read() {
|
||||||
|
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
||||||
|
return files[_fd].read();
|
||||||
|
#else
|
||||||
|
return 0xff;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
flash_file::operator bool() const {
|
||||||
|
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
||||||
|
return files[_fd];
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void flash_file::write(uint8_t b) {
|
||||||
|
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
||||||
|
files[_fd].write(b);
|
||||||
|
files[_fd].flush();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool flash_filer::start()
|
bool flash_filer::start()
|
||||||
{
|
{
|
||||||
#if defined(USE_LITTLEFS)
|
#if defined(USE_LITTLEFS)
|
||||||
@ -50,30 +82,6 @@ void flash_filer::stop()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool flash_file::more()
|
|
||||||
{
|
|
||||||
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
|
||||||
return files[_fd].available() > 0;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t flash_file::read() {
|
|
||||||
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
|
||||||
return files[_fd].read();
|
|
||||||
#else
|
|
||||||
return 0xff;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void flash_file::write(uint8_t b) {
|
|
||||||
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
|
||||||
files[_fd].write(b);
|
|
||||||
files[_fd].flush();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *flash_filer::advance() {
|
const char *flash_filer::advance() {
|
||||||
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
|
||||||
bool rewound = false;
|
bool rewound = false;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef __FLASH_FILER_H__
|
#ifndef __FLASH_FILER_H__
|
||||||
#define __FLASH_FILER_H__
|
#define __FLASH_FILER_H__
|
||||||
|
|
||||||
#define MAX_FILES 3
|
#define MAX_FILES 5
|
||||||
|
|
||||||
class flash_file: virtual public serialio {
|
class flash_file: virtual public serialio {
|
||||||
public:
|
public:
|
||||||
@ -12,6 +12,7 @@ public:
|
|||||||
virtual void write(uint8_t);
|
virtual void write(uint8_t);
|
||||||
|
|
||||||
bool seek(uint32_t pos);
|
bool seek(uint32_t pos);
|
||||||
|
operator bool() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const uint8_t _fd;
|
const uint8_t _fd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user