1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-01 13:58:20 +00:00

Switched the nascent TZX to use the new PulseQueuedTape.

This commit is contained in:
Thomas Harte 2017-07-16 22:06:56 -04:00
parent 8f72fc4a44
commit 7327da6350
2 changed files with 7 additions and 26 deletions

View File

@ -12,9 +12,7 @@ using namespace Storage::Tape;
TZX::TZX(const char *file_name) :
Storage::FileHolder(file_name),
is_high_(false),
is_at_end_(false),
pulse_pointer_(0) {
is_high_(false) {
// Check for signature followed by a 0x1a
char identifier[7];
@ -29,21 +27,12 @@ TZX::TZX(const char *file_name) :
// Reject if an incompatible version
if(major_version != 1 || minor_version > 20) throw ErrorNotTZX;
// seed initial block contents
parse_next_chunk();
}
bool TZX::is_at_end() {
return true;
}
Tape::Pulse TZX::virtual_get_next_pulse() {
return Tape::Pulse();
}
void TZX::virtual_reset() {
clear();
fseek(file_, SEEK_SET, 0x0a);
}
void TZX::parse_next_chunk() {
void TZX::get_next_pulses() {
}

View File

@ -9,7 +9,7 @@
#ifndef TZX_hpp
#define TZX_hpp
#include "../Tape.hpp"
#include "../PulseQueuedTape.hpp"
#include "../../FileHolder.hpp"
namespace Storage {
@ -18,7 +18,7 @@ namespace Tape {
/*!
Provides a @c Tape containing a CSW tape image, which is a compressed 1-bit sampling.
*/
class TZX: public Tape, public Storage::FileHolder {
class TZX: public PulseQueuedTape, public Storage::FileHolder {
public:
/*!
Constructs a @c TZX containing content from the file with name @c file_name.
@ -31,19 +31,11 @@ class TZX: public Tape, public Storage::FileHolder {
ErrorNotTZX
};
// implemented to satisfy @c Tape
bool is_at_end();
private:
Pulse virtual_get_next_pulse();
void virtual_reset();
// std::vector<Pulse> queued_pulses_;
size_t pulse_pointer_;
bool is_at_end_;
void get_next_pulses();
bool is_high_;
void parse_next_chunk();
};
}