1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Strung up an empty shell that eventually should contain the 8272, and added appropriate IO decoding to the Amstrad.

This commit is contained in:
Thomas Harte 2017-08-05 19:45:52 -04:00
parent 9e8645ca7a
commit 3e984e75b6
4 changed files with 73 additions and 2 deletions

18
Components/8272/i8272.cpp Normal file
View File

@ -0,0 +1,18 @@
//
// i8272.cpp
// Clock Signal
//
// Created by Thomas Harte on 05/08/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#include "i8272.hpp"
using namespace Intel;
void i8272::set_register(int address, uint8_t value) {
}
uint8_t i8272::get_register(int address) {
return 0xff;
}

26
Components/8272/i8272.hpp Normal file
View File

@ -0,0 +1,26 @@
//
// i8272.hpp
// Clock Signal
//
// Created by Thomas Harte on 05/08/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#ifndef i8272_hpp
#define i8272_hpp
#include <cstdint>
namespace Intel {
class i8272 {
public:
void set_register(int address, uint8_t value);
uint8_t get_register(int address);
};
}
#endif /* i8272_hpp */

View File

@ -10,9 +10,10 @@
#include "../../Processors/Z80/Z80.hpp"
#include "../../Components/8255/i8255.hpp"
#include "../../Components/AY38910/AY38910.hpp"
#include "../../Components/6845/CRTC6845.hpp"
#include "../../Components/8255/i8255.hpp"
#include "../../Components/8272/i8272.hpp"
#include "../../Components/AY38910/AY38910.hpp"
#include "../../Storage/Tape/Tape.hpp"
@ -601,6 +602,11 @@ class ConcreteMachine:
if(!(address & 0x800)) {
i8255_.set_register((address >> 8) & 3, *cycle.value);
}
// Check for an FDC access
if(has_fdc_ && (address & 0x580) == 0x100) {
i8272_.set_register(address & 1, *cycle.value);
}
break;
case CPU::Z80::PartialMachineCycle::Input:
// Default to nothing answering
@ -619,6 +625,11 @@ class ConcreteMachine:
if(!(address & 0x800)) {
*cycle.value = i8255_.get_register((address >> 8) & 3);
}
// Check for an FDC access
if(has_fdc_ && (address & 0x580) == 0x100) {
*cycle.value = i8272_.get_register(address & 1);
}
break;
case CPU::Z80::PartialMachineCycle::Interrupt:
@ -737,6 +748,8 @@ class ConcreteMachine:
i8255PortHandler i8255_port_handler_;
Intel::i8255::i8255<i8255PortHandler> i8255_;
Intel::i8272 i8272_;
InterruptTimer interrupt_timer_;
Storage::Tape::BinaryTapePlayer tape_player_;

View File

@ -395,6 +395,7 @@
4BB73EB71B587A5100552FC2 /* AllSuiteATests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB73EB61B587A5100552FC2 /* AllSuiteATests.swift */; };
4BB73EC21B587A5100552FC2 /* Clock_SignalUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB73EC11B587A5100552FC2 /* Clock_SignalUITests.swift */; };
4BBB14311CD2CECE00BDB55C /* IntermediateShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBB142F1CD2CECE00BDB55C /* IntermediateShader.cpp */; };
4BBC951E1F368D83008F4C34 /* i8272.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBC951C1F368D83008F4C34 /* i8272.cpp */; };
4BBF49AF1ED2880200AB3669 /* FUSETests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF49AE1ED2880200AB3669 /* FUSETests.swift */; };
4BBF99141C8FBA6F0075DAFB /* TextureBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF99081C8FBA6F0075DAFB /* TextureBuilder.cpp */; };
4BBF99151C8FBA6F0075DAFB /* CRTOpenGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF990A1C8FBA6F0075DAFB /* CRTOpenGL.cpp */; };
@ -954,6 +955,8 @@
4BBB142F1CD2CECE00BDB55C /* IntermediateShader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntermediateShader.cpp; sourceTree = "<group>"; };
4BBB14301CD2CECE00BDB55C /* IntermediateShader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = IntermediateShader.hpp; sourceTree = "<group>"; };
4BBC34241D2208B100FFC9DF /* CSFastLoading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSFastLoading.h; sourceTree = "<group>"; };
4BBC951C1F368D83008F4C34 /* i8272.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = i8272.cpp; path = 8272/i8272.cpp; sourceTree = "<group>"; };
4BBC951D1F368D83008F4C34 /* i8272.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = i8272.hpp; path = 8272/i8272.hpp; sourceTree = "<group>"; };
4BBF49AE1ED2880200AB3669 /* FUSETests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FUSETests.swift; sourceTree = "<group>"; };
4BBF99081C8FBA6F0075DAFB /* TextureBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextureBuilder.cpp; sourceTree = "<group>"; };
4BBF99091C8FBA6F0075DAFB /* TextureBuilder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TextureBuilder.hpp; sourceTree = "<group>"; };
@ -1982,6 +1985,15 @@
path = ../../Processors;
sourceTree = "<group>";
};
4BBC951F1F368D87008F4C34 /* 8272 */ = {
isa = PBXGroup;
children = (
4BBC951C1F368D83008F4C34 /* i8272.cpp */,
4BBC951D1F368D83008F4C34 /* i8272.hpp */,
);
name = 8272;
sourceTree = "<group>";
};
4BBF49B41ED2881600AB3669 /* FUSE */ = {
isa = PBXGroup;
children = (
@ -2048,6 +2060,7 @@
4B4A762D1DB1A35C007AAE2E /* AY38910 */,
4BE845221F2FF7F400A5EA22 /* 6845 */,
4BD9137C1F3115AC009BCF85 /* 8255 */,
4BBC951F1F368D87008F4C34 /* 8272 */,
);
name = Components;
path = ../../Components;
@ -2738,6 +2751,7 @@
4B8FE2291DA1EDDF0090D3CE /* ElectronOptionsPanel.swift in Sources */,
4B55CE5D1C3B7D6F0093A61B /* CSOpenGLView.m in Sources */,
4BB697CB1D4B6D3E00248BDF /* TimedEventLoop.cpp in Sources */,
4BBC951E1F368D83008F4C34 /* i8272.cpp in Sources */,
4BF1354C1D6D2C300054B2EA /* StaticAnalyser.cpp in Sources */,
4B4A76301DB1A3FA007AAE2E /* AY38910.cpp in Sources */,
4B2A53A31D117D36003C6002 /* CSVic20.mm in Sources */,