mirror of
https://github.com/jscrane/r65emu.git
synced 2024-06-12 04:29:28 +00:00
Compare commits
2 Commits
bfb6b379d0
...
7c9b978012
Author | SHA1 | Date | |
---|---|---|---|
|
7c9b978012 | ||
|
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
|
||||||
|
|
10
display.cpp
10
display.cpp
|
@ -1,3 +1,4 @@
|
||||||
|
#include <stdarg.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
@ -150,6 +151,15 @@ void Display::status(const char *s) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Display::statusf(const char *fmt, ...) {
|
||||||
|
va_list args;
|
||||||
|
char buf[80];
|
||||||
|
va_start(args, fmt);
|
||||||
|
vsnprintf(buf, sizeof(buf), fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
status(buf);
|
||||||
|
}
|
||||||
|
|
||||||
void Display::drawPixel(unsigned x, unsigned y, colour_t col) {
|
void Display::drawPixel(unsigned x, unsigned y, colour_t col) {
|
||||||
x += _xoff;
|
x += _xoff;
|
||||||
y += _yoff;
|
y += _yoff;
|
||||||
|
|
|
@ -34,6 +34,7 @@ public:
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
void status(const char *s);
|
void status(const char *s);
|
||||||
|
void statusf(const char *fmt, ...);
|
||||||
|
|
||||||
void drawPixel(unsigned x, unsigned y, colour_t col);
|
void drawPixel(unsigned x, unsigned y, colour_t col);
|
||||||
void drawString(const char *s, unsigned x, unsigned y);
|
void drawString(const char *s, unsigned x, unsigned y);
|
||||||
|
|
|
@ -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…
Reference in New Issue
Block a user