1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-17 21:30:14 +00:00

Do just enough to include x86 code in the main build.

This commit is contained in:
Thomas Harte 2023-11-15 11:01:28 -05:00
parent 70a4d59517
commit e927fd00d8
6 changed files with 94 additions and 2 deletions

View File

@ -25,6 +25,7 @@ enum class Machine {
MasterSystem,
MSX,
Oric,
PCCompatible,
Vic20,
ZX8081,
ZXSpectrum,

View File

@ -163,7 +163,7 @@ class Flags {
set_from<Flag::Interrupt>(value & FlagValue::Interrupt);
set_from<Flag::Direction>(value & FlagValue::Direction);
set_from<uint8_t, Flag::Sign>(value);
set_from<uint8_t, Flag::Sign>(uint8_t(value));
set_from<Flag::Zero>((~value) & FlagValue::Zero);
set_from<Flag::ParityOdd>((~value) & FlagValue::Parity);

View File

@ -0,0 +1,43 @@
//
// PCCompatible.cpp
// Clock Signal
//
// Created by Thomas Harte on 15/11/2023.
// Copyright © 2023 Thomas Harte. All rights reserved.
//
#include "PCCompatible.hpp"
#include "../../InstructionSets/x86/Instruction.hpp"
#include "../../InstructionSets/x86/Perform.hpp"
#include "../TimedMachine.hpp"
namespace PCCompatible {
class ConcreteMachine:
public Machine,
public MachineTypes::TimedMachine
{
public:
ConcreteMachine(
[[maybe_unused]] const Analyser::Static::Target &target,
[[maybe_unused]] const ROMMachine::ROMFetcher &rom_fetcher
) {
// This is actually a MIPS count; try 3 million.
set_clock_rate(3'000'000);
}
void run_for([[maybe_unused]] const Cycles cycles) override {}
};
}
using namespace PCCompatible;
// See header; constructs and returns an instance of the Amstrad CPC.
Machine *Machine::PCCompatible(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) {
return new PCCompatible::ConcreteMachine(*target, rom_fetcher);
}
Machine::~Machine() {}

View File

@ -0,0 +1,33 @@
//
// PCCompatible.hpp
// Clock Signal
//
// Created by Thomas Harte on 15/11/2023.
// Copyright © 2023 Thomas Harte. All rights reserved.
//
#ifndef PCCompatible_hpp
#define PCCompatible_hpp
#include "../../Analyser/Static/StaticAnalyser.hpp"
#include "../ROMMachine.hpp"
namespace PCCompatible {
/*!
Models a PC compatible.
*/
class Machine {
public:
virtual ~Machine();
/// Creates and returns a PC Compatible.
static Machine *PCCompatible(
const Analyser::Static::Target *target,
const ROMMachine::ROMFetcher &rom_fetcher
);
};
}
#endif /* PCCompatible_hpp */

View File

@ -13,7 +13,6 @@
#include "../ClockReceiver/TimeTypes.hpp"
#include "AudioProducer.hpp"
#include "ScanProducer.hpp"
#include <cmath>

View File

@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
423BDC4A2AB24699008E37B6 /* 8088Tests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 423BDC492AB24699008E37B6 /* 8088Tests.mm */; };
42437B332AC70833006DFED1 /* HDV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6FD0342923061300EC4760 /* HDV.cpp */; };
425739382B051EA800B7D1E4 /* PCCompatible.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 425739372B051EA800B7D1E4 /* PCCompatible.cpp */; };
425739392B051EA800B7D1E4 /* PCCompatible.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 425739372B051EA800B7D1E4 /* PCCompatible.cpp */; };
4281683A2A37AFB4008ECD27 /* DispatcherTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 428168392A37AFB4008ECD27 /* DispatcherTests.mm */; };
42A5E80C2ABBE04600A0DD5D /* NeskellTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42A5E80B2ABBE04600A0DD5D /* NeskellTests.swift */; };
42A5E8442ABBE16F00A0DD5D /* illegal_rmw_test.bin in Resources */ = {isa = PBXBuildFile; fileRef = 42A5E8332ABBE16F00A0DD5D /* illegal_rmw_test.bin */; };
@ -1138,6 +1140,8 @@
4257392E2AFBE2BC00B7D1E4 /* Repetition.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Repetition.hpp; sourceTree = "<group>"; };
4257392F2AFBE36B00B7D1E4 /* LoadStore.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = LoadStore.hpp; sourceTree = "<group>"; };
425739302AFBE47700B7D1E4 /* InOut.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = InOut.hpp; sourceTree = "<group>"; };
425739362B051EA800B7D1E4 /* PCCompatible.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = PCCompatible.hpp; sourceTree = "<group>"; };
425739372B051EA800B7D1E4 /* PCCompatible.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PCCompatible.cpp; sourceTree = "<group>"; };
4281572E2AA0334300E16AA1 /* Carry.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Carry.hpp; sourceTree = "<group>"; };
428168372A16C25C008ECD27 /* LineLayout.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = LineLayout.hpp; sourceTree = "<group>"; };
428168392A37AFB4008ECD27 /* DispatcherTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DispatcherTests.mm; sourceTree = "<group>"; };
@ -2353,6 +2357,15 @@
path = Implementation;
sourceTree = "<group>";
};
425739352B051EA800B7D1E4 /* PCCompatible */ = {
isa = PBXGroup;
children = (
425739362B051EA800B7D1E4 /* PCCompatible.hpp */,
425739372B051EA800B7D1E4 /* PCCompatible.cpp */,
);
path = PCCompatible;
sourceTree = "<group>";
};
42A5E8322ABBE16F00A0DD5D /* Neskell Tests */ = {
isa = PBXGroup;
children = (
@ -4475,6 +4488,7 @@
4B7F188B2154825D00388727 /* MasterSystem */,
4B79A4FC1FC8FF9800EEDAD5 /* MSX */,
4BCF1FA51DADC3E10039D2E7 /* Oric */,
425739352B051EA800B7D1E4 /* PCCompatible */,
4B0F1BC92602F17B00B85C66 /* Sinclair */,
4B2B3A461F9B8FA70062DABF /* Utility */,
);
@ -5733,6 +5747,7 @@
4BD424E62193B5830097291A /* Shader.cpp in Sources */,
4BC080CB26A238CC00D03FD8 /* AmigaADF.cpp in Sources */,
4B4B1A3D200198CA00A0F866 /* KonamiSCC.cpp in Sources */,
425739392B051EA800B7D1E4 /* PCCompatible.cpp in Sources */,
4B055AC31FAE9AE80060FFFF /* AmstradCPC.cpp in Sources */,
4B055A9E1FAE85DA0060FFFF /* G64.cpp in Sources */,
4B055AB81FAE860F0060FFFF /* ZX80O81P.cpp in Sources */,
@ -5951,6 +5966,7 @@
4B643F3F1D77B88000D431D6 /* DocumentController.swift in Sources */,
4BDA00E422E663B900AC3CD0 /* NSData+CRC32.m in Sources */,
4B9EC0E626AA4A660060A31F /* Chipset.cpp in Sources */,
425739382B051EA800B7D1E4 /* PCCompatible.cpp in Sources */,
4BB8616E24E22DC500A00E03 /* BufferingScanTarget.cpp in Sources */,
4BB4BFB022A42F290069048D /* MacintoshIMG.cpp in Sources */,
4B05401E219D1618001BF69C /* ScanTarget.cpp in Sources */,