2017-06-04 20:37:03 +00:00
|
|
|
//
|
|
|
|
// ZX80O.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/06/2017.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-06-04 20:37:03 +00:00
|
|
|
//
|
|
|
|
|
2017-06-12 01:38:32 +00:00
|
|
|
#ifndef ZX80O81P_hpp
|
|
|
|
#define ZX80O81P_hpp
|
2017-06-04 20:37:03 +00:00
|
|
|
|
|
|
|
#include "../Tape.hpp"
|
2017-08-27 19:43:09 +00:00
|
|
|
|
2017-06-04 20:37:03 +00:00
|
|
|
#include "../../FileHolder.hpp"
|
2017-08-27 19:19:03 +00:00
|
|
|
#include "../../TargetPlatforms.hpp"
|
2017-06-12 01:35:09 +00:00
|
|
|
|
2017-06-04 20:37:03 +00:00
|
|
|
#include <cstdint>
|
2018-04-06 21:42:24 +00:00
|
|
|
#include <string>
|
2017-06-12 01:35:09 +00:00
|
|
|
#include <vector>
|
2017-06-04 20:37:03 +00:00
|
|
|
|
|
|
|
namespace Storage {
|
|
|
|
namespace Tape {
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Provides a @c Tape containing a ZX80-format .O tape image, which is a byte stream capture.
|
|
|
|
*/
|
2017-11-03 02:32:00 +00:00
|
|
|
class ZX80O81P: public Tape, public TargetPlatform::TypeDistinguisher {
|
2017-06-04 20:37:03 +00:00
|
|
|
public:
|
|
|
|
/*!
|
2017-07-11 01:43:58 +00:00
|
|
|
Constructs a @c ZX80O containing content from the file with name @c file_name.
|
2017-06-04 20:37:03 +00:00
|
|
|
|
2017-07-11 01:43:58 +00:00
|
|
|
@throws ErrorNotZX80O81P if this file could not be opened and recognised as a valid ZX80-format .O.
|
2017-06-04 20:37:03 +00:00
|
|
|
*/
|
2018-04-06 21:42:24 +00:00
|
|
|
ZX80O81P(const std::string &file_name);
|
2017-06-04 20:37:03 +00:00
|
|
|
|
|
|
|
enum {
|
2017-06-12 01:38:32 +00:00
|
|
|
ErrorNotZX80O81P
|
2017-06-04 20:37:03 +00:00
|
|
|
};
|
|
|
|
|
2017-08-27 19:19:03 +00:00
|
|
|
private:
|
2017-06-04 20:37:03 +00:00
|
|
|
// implemented to satisfy @c Tape
|
|
|
|
bool is_at_end();
|
|
|
|
|
2017-08-27 19:19:03 +00:00
|
|
|
// implemented to satisfy TargetPlatform::TypeDistinguisher
|
|
|
|
TargetPlatform::Type target_platform_type();
|
|
|
|
TargetPlatform::Type platform_type_;
|
|
|
|
|
2017-06-04 20:37:03 +00:00
|
|
|
void virtual_reset();
|
|
|
|
Pulse virtual_get_next_pulse();
|
2017-06-09 01:31:54 +00:00
|
|
|
bool has_finished_data();
|
2017-06-04 20:59:26 +00:00
|
|
|
|
|
|
|
uint8_t byte_;
|
|
|
|
int bit_pointer_;
|
|
|
|
int wave_pointer_;
|
2017-06-09 01:31:54 +00:00
|
|
|
bool is_past_silence_, has_ended_final_byte_;
|
2017-06-04 20:59:26 +00:00
|
|
|
bool is_high_;
|
|
|
|
|
2017-06-12 01:35:09 +00:00
|
|
|
std::vector<uint8_t> data_;
|
2017-11-11 20:28:40 +00:00
|
|
|
std::size_t data_pointer_;
|
2017-06-04 20:37:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* ZX80O_hpp */
|