sdtape -> filer

This commit is contained in:
Stephen Crane 2019-02-13 07:47:59 +00:00
parent 4f4955b2fb
commit c73efc8d09
3 changed files with 12 additions and 11 deletions

View File

@ -29,7 +29,7 @@ void reset() {
io.reset(); io.reset();
if (sd) if (sd)
io.tape.start(PROGRAMS); io.files.start(PROGRAMS);
else else
io.status("No SD Card"); io.status("No SD Card");
} }
@ -67,22 +67,22 @@ void loop() {
reset(); reset();
break; break;
case PS2_F2: case PS2_F2:
filename = io.tape.advance(); filename = io.files.advance();
io.status(filename); io.status(filename);
break; break;
case PS2_F3: case PS2_F3:
filename = io.tape.rewind(); filename = io.files.rewind();
io.status(filename); io.status(filename);
break; break;
case PS2_F4: case PS2_F4:
io.load(); io.load();
break; break;
case PS2_F6: case PS2_F6:
io.status(checkpoint(io.tape, PROGRAMS)); io.status(io.files.checkpoint());
break; break;
case PS2_F7: case PS2_F7:
if (filename) if (filename)
restore(io.tape, PROGRAMS, filename); io.files.restore(filename);
break; break;
default: default:
io.up(key); io.up(key);

11
io.cpp
View File

@ -2,7 +2,8 @@
#include <stdint.h> #include <stdint.h>
#include <memory.h> #include <memory.h>
#include <tftdisplay.h> #include <tftdisplay.h>
#include <sdtape.h> #include <serialio.h>
#include <filer.h>
#include <keyboard.h> #include <keyboard.h>
#include <timed.h> #include <timed.h>
@ -31,9 +32,9 @@ void io::reset() {
} }
void io::load() { void io::load() {
if (tape.more()) { if (files.more()) {
_loading = true; _loading = true;
enter(tape.read()); enter(files.read());
} }
} }
@ -150,8 +151,8 @@ uint8_t io::read_porta_cr() {
return b; return b;
if (_loading) { if (_loading) {
if (tape.more()) if (files.more())
enter(tape.read()); enter(files.read());
else else
_loading = false; _loading = false;
} }

2
io.h
View File

@ -15,7 +15,7 @@ public:
virtual uint8_t read_porta_cr(); virtual uint8_t read_porta_cr();
void load(); void load();
sdtape tape; flash_filer files;
private: private:
void display(uint8_t); void display(uint8_t);
void draw(char, int, int); void draw(char, int, int);