1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Rebranded ZX80O as ZX80O81P, with an eye to making it accept ZX81 .p files. Adjusted the initial selection part of the static analyser appropriately.

This commit is contained in:
Thomas Harte 2017-06-11 21:38:32 -04:00
parent ee0283c985
commit 77aa3c187e
4 changed files with 25 additions and 23 deletions

View File

@ -19,7 +19,7 @@
4B14145E1B5887AA00E04248 /* 6502AllRAM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1414591B58879D00E04248 /* 6502AllRAM.cpp */; };
4B1414601B58885000E04248 /* WolfgangLorenzTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B14145F1B58885000E04248 /* WolfgangLorenzTests.swift */; };
4B1414621B58888700E04248 /* KlausDormannTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1414611B58888700E04248 /* KlausDormannTests.swift */; };
4B1497881EE4A1DA00CE2596 /* ZX80O.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1497861EE4A1DA00CE2596 /* ZX80O.cpp */; };
4B1497881EE4A1DA00CE2596 /* ZX80O81P.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1497861EE4A1DA00CE2596 /* ZX80O81P.cpp */; };
4B14978B1EE4AC5E00CE2596 /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1497891EE4AC5E00CE2596 /* StaticAnalyser.cpp */; };
4B14978F1EE4B4D200CE2596 /* CSZX8081.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B14978E1EE4B4D200CE2596 /* CSZX8081.mm */; };
4B1497921EE4B5A800CE2596 /* ZX8081.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1497901EE4B5A800CE2596 /* ZX8081.cpp */; };
@ -472,8 +472,8 @@
4B14145A1B58879D00E04248 /* 6502AllRAM.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = 6502AllRAM.hpp; sourceTree = "<group>"; };
4B14145F1B58885000E04248 /* WolfgangLorenzTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WolfgangLorenzTests.swift; sourceTree = "<group>"; };
4B1414611B58888700E04248 /* KlausDormannTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KlausDormannTests.swift; sourceTree = "<group>"; };
4B1497861EE4A1DA00CE2596 /* ZX80O.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZX80O.cpp; sourceTree = "<group>"; };
4B1497871EE4A1DA00CE2596 /* ZX80O.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ZX80O.hpp; sourceTree = "<group>"; };
4B1497861EE4A1DA00CE2596 /* ZX80O81P.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZX80O81P.cpp; sourceTree = "<group>"; };
4B1497871EE4A1DA00CE2596 /* ZX80O81P.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ZX80O81P.hpp; sourceTree = "<group>"; };
4B1497891EE4AC5E00CE2596 /* StaticAnalyser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StaticAnalyser.cpp; path = ../../StaticAnalyser/ZX8081/StaticAnalyser.cpp; sourceTree = "<group>"; };
4B14978A1EE4AC5E00CE2596 /* StaticAnalyser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = StaticAnalyser.hpp; path = ../../StaticAnalyser/ZX8081/StaticAnalyser.hpp; sourceTree = "<group>"; };
4B14978D1EE4B4D200CE2596 /* CSZX8081.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSZX8081.h; sourceTree = "<group>"; };
@ -1395,8 +1395,8 @@
4B2BFC5E1D613E0200BA3AA9 /* TapePRG.hpp */,
4B59199A1DAC6C46005BB85C /* OricTAP.cpp */,
4B59199B1DAC6C46005BB85C /* OricTAP.hpp */,
4B1497861EE4A1DA00CE2596 /* ZX80O.cpp */,
4B1497871EE4A1DA00CE2596 /* ZX80O.hpp */,
4B1497861EE4A1DA00CE2596 /* ZX80O81P.cpp */,
4B1497871EE4A1DA00CE2596 /* ZX80O81P.hpp */,
);
path = Formats;
sourceTree = "<group>";
@ -2609,7 +2609,7 @@
4B5FADBA1DE3151600AEC565 /* FileHolder.cpp in Sources */,
4B6C73BD1D387AE500AFCFCA /* DiskController.cpp in Sources */,
4B643F3A1D77AD1900D431D6 /* CSStaticAnalyser.mm in Sources */,
4B1497881EE4A1DA00CE2596 /* ZX80O.cpp in Sources */,
4B1497881EE4A1DA00CE2596 /* ZX80O81P.cpp in Sources */,
4B4DC8281D2C2470003C5BF8 /* C1540.cpp in Sources */,
4B5A12571DD55862007A2231 /* Disassembler6502.cpp in Sources */,
4BE7C9181E3D397100A5496D /* TIA.cpp in Sources */,

View File

@ -33,7 +33,7 @@
#include "../Storage/Tape/Formats/OricTAP.hpp"
#include "../Storage/Tape/Formats/TapePRG.hpp"
#include "../Storage/Tape/Formats/TapeUEF.hpp"
#include "../Storage/Tape/Formats/ZX80O.hpp"
#include "../Storage/Tape/Formats/ZX80O81P.hpp"
typedef int TargetPlatformType;
enum class TargetPlatform: TargetPlatformType {
@ -41,7 +41,7 @@ enum class TargetPlatform: TargetPlatformType {
Atari2600 = 1 << 1,
Commodore = 1 << 2,
Oric = 1 << 3,
ZX80 = 1 << 4,
ZX8081 = 1 << 4,
};
using namespace StaticAnalyser;
@ -89,7 +89,8 @@ std::list<Target> StaticAnalyser::GetTargets(const char *file_name)
if(lowercase_extension)
{
Format("80", tapes, Tape::ZX80O, TargetPlatform::ZX80) // 80
Format("80", tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // 80
Format("81", tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // 81
Format("a26", cartridges, Cartridge::BinaryDump, TargetPlatform::Atari2600) // A26
Format("adf", disks, Disk::AcornADF, TargetPlatform::Acorn) // ADF
Format("bin", cartridges, Cartridge::BinaryDump, TargetPlatform::Atari2600) // BIN
@ -97,7 +98,8 @@ std::list<Target> StaticAnalyser::GetTargets(const char *file_name)
Format("dsd", disks, Disk::SSD, TargetPlatform::Acorn) // DSD
Format("dsk", disks, Disk::OricMFMDSK, TargetPlatform::Oric) // DSK
Format("g64", disks, Disk::G64, TargetPlatform::Commodore) // G64
Format("o", tapes, Tape::ZX80O, TargetPlatform::ZX80) // O
Format("o", tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // O
Format("p", tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // O
// PRG
if(!strcmp(lowercase_extension, "prg"))
@ -130,7 +132,7 @@ std::list<Target> StaticAnalyser::GetTargets(const char *file_name)
if(potential_platforms & (TargetPlatformType)TargetPlatform::Atari2600) Atari::AddTargets(disks, tapes, cartridges, targets);
if(potential_platforms & (TargetPlatformType)TargetPlatform::Commodore) Commodore::AddTargets(disks, tapes, cartridges, targets);
if(potential_platforms & (TargetPlatformType)TargetPlatform::Oric) Oric::AddTargets(disks, tapes, cartridges, targets);
if(potential_platforms & (TargetPlatformType)TargetPlatform::ZX80) ZX8081::AddTargets(disks, tapes, cartridges, targets);
if(potential_platforms & (TargetPlatformType)TargetPlatform::ZX8081) ZX8081::AddTargets(disks, tapes, cartridges, targets);
free(lowercase_extension);
}

View File

@ -6,12 +6,12 @@
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#include "ZX80O.hpp"
#include "ZX80O81P.hpp"
#include "../../Data/ZX8081.hpp"
using namespace Storage::Tape;
ZX80O::ZX80O(const char *file_name) :
ZX80O81P::ZX80O81P(const char *file_name) :
Storage::FileHolder(file_name) {
// Check that contents look like a ZX80 file
@ -19,7 +19,7 @@ ZX80O::ZX80O(const char *file_name) :
fread(whole_file.data(), 1, (size_t)file_stats_.st_size, file_);
std::shared_ptr<::Storage::Data::ZX8081::File> file = Storage::Data::ZX8081::FileFromData(whole_file);
if(!file || file->isZX81) throw ErrorNotZX80O;
if(!file || file->isZX81) throw ErrorNotZX80O81P;
data_ = file->data;
@ -27,7 +27,7 @@ ZX80O::ZX80O(const char *file_name) :
virtual_reset();
}
void ZX80O::virtual_reset() {
void ZX80O81P::virtual_reset() {
data_pointer_ = 0;
is_past_silence_ = false;
has_ended_final_byte_ = false;
@ -35,15 +35,15 @@ void ZX80O::virtual_reset() {
bit_pointer_ = wave_pointer_ = 0;
}
bool ZX80O::has_finished_data() {
bool ZX80O81P::has_finished_data() {
return (data_pointer_ == data_.size()) && !wave_pointer_ && !bit_pointer_;
}
bool ZX80O::is_at_end() {
bool ZX80O81P::is_at_end() {
return has_finished_data() && has_ended_final_byte_;
}
Tape::Pulse ZX80O::virtual_get_next_pulse() {
Tape::Pulse ZX80O81P::virtual_get_next_pulse() {
Tape::Pulse pulse;
// Start with 1 second of silence.

View File

@ -6,8 +6,8 @@
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#ifndef ZX80O_hpp
#define ZX80O_hpp
#ifndef ZX80O81P_hpp
#define ZX80O81P_hpp
#include "../Tape.hpp"
#include "../../FileHolder.hpp"
@ -21,17 +21,17 @@ namespace Tape {
/*!
Provides a @c Tape containing a ZX80-format .O tape image, which is a byte stream capture.
*/
class ZX80O: public Tape, public Storage::FileHolder {
class ZX80O81P: public Tape, public Storage::FileHolder {
public:
/*!
Constructs an @c ZX80O containing content from the file with name @c file_name.
@throws ErrorNotZX80O if this file could not be opened and recognised as a valid ZX80-format .O.
*/
ZX80O(const char *file_name);
ZX80O81P(const char *file_name);
enum {
ErrorNotZX80O
ErrorNotZX80O81P
};
// implemented to satisfy @c Tape