2016-06-25 16:09:32 -04:00
|
|
|
//
|
|
|
|
// CommodoreTAP.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 25/06/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CommodoreTAP_hpp
|
|
|
|
#define CommodoreTAP_hpp
|
|
|
|
|
|
|
|
#include "../Tape.hpp"
|
2016-11-21 20:14:09 +08:00
|
|
|
#include "../../FileHolder.hpp"
|
|
|
|
#include <cstdint>
|
2016-06-25 16:09:32 -04:00
|
|
|
|
|
|
|
namespace Storage {
|
2016-08-27 17:09:45 -04:00
|
|
|
namespace Tape {
|
2016-06-25 16:09:32 -04:00
|
|
|
|
2016-08-01 06:04:55 -04:00
|
|
|
/*!
|
2016-08-15 19:37:21 -04:00
|
|
|
Provides a @c Tape containing a Commodore-format tape image, which is simply a timed list of downward-going zero crossings.
|
2016-08-01 06:04:55 -04:00
|
|
|
*/
|
2017-11-02 22:32:00 -04:00
|
|
|
class CommodoreTAP: public Tape {
|
2016-06-25 16:09:32 -04:00
|
|
|
public:
|
2016-08-01 06:04:55 -04:00
|
|
|
/*!
|
|
|
|
Constructs a @c CommodoreTAP containing content from the file with name @c file_name.
|
|
|
|
|
|
|
|
@throws ErrorNotCommodoreTAP if this file could not be opened and recognised as a valid Commodore-format TAP.
|
|
|
|
*/
|
2016-06-25 16:09:32 -04:00
|
|
|
CommodoreTAP(const char *file_name);
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ErrorNotCommodoreTAP
|
|
|
|
};
|
|
|
|
|
2016-08-01 06:04:55 -04:00
|
|
|
// implemented to satisfy @c Tape
|
2016-08-29 21:53:06 -04:00
|
|
|
bool is_at_end();
|
2016-08-01 06:04:55 -04:00
|
|
|
|
2016-06-25 16:09:32 -04:00
|
|
|
private:
|
2017-11-02 22:32:00 -04:00
|
|
|
Storage::FileHolder file_;
|
2016-09-11 17:09:00 -04:00
|
|
|
void virtual_reset();
|
|
|
|
Pulse virtual_get_next_pulse();
|
|
|
|
|
2016-11-21 20:14:09 +08:00
|
|
|
bool updated_layout_;
|
|
|
|
uint32_t file_size_;
|
2016-06-25 16:09:32 -04:00
|
|
|
|
2016-11-21 20:14:09 +08:00
|
|
|
Pulse current_pulse_;
|
2017-11-10 22:08:40 -05:00
|
|
|
bool is_at_end_ = false;
|
2016-06-25 16:09:32 -04:00
|
|
|
};
|
|
|
|
|
2016-08-27 17:09:45 -04:00
|
|
|
}
|
2016-06-25 16:09:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CommodoreTAP_hpp */
|