From 3e984e75b6709df8ff5552a9bf679683fc7d7ebf Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 5 Aug 2017 19:45:52 -0400 Subject: [PATCH] Strung up an empty shell that eventually should contain the 8272, and added appropriate IO decoding to the Amstrad. --- Components/8272/i8272.cpp | 18 +++++++++++++ Components/8272/i8272.hpp | 26 +++++++++++++++++++ Machines/AmstradCPC/AmstradCPC.cpp | 17 ++++++++++-- .../Clock Signal.xcodeproj/project.pbxproj | 14 ++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 Components/8272/i8272.cpp create mode 100644 Components/8272/i8272.hpp diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp new file mode 100644 index 000000000..b391b6897 --- /dev/null +++ b/Components/8272/i8272.cpp @@ -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; +} diff --git a/Components/8272/i8272.hpp b/Components/8272/i8272.hpp new file mode 100644 index 000000000..4e9a29b0f --- /dev/null +++ b/Components/8272/i8272.hpp @@ -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 + +namespace Intel { + +class i8272 { + public: + + void set_register(int address, uint8_t value); + uint8_t get_register(int address); +}; + +} + + +#endif /* i8272_hpp */ diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 0662ceb29..92b6d5887 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -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 i8255_; + Intel::i8272 i8272_; + InterruptTimer interrupt_timer_; Storage::Tape::BinaryTapePlayer tape_player_; diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 8170445ee..b53fc7c7c 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -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 = ""; }; 4BBB14301CD2CECE00BDB55C /* IntermediateShader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = IntermediateShader.hpp; sourceTree = ""; }; 4BBC34241D2208B100FFC9DF /* CSFastLoading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSFastLoading.h; sourceTree = ""; }; + 4BBC951C1F368D83008F4C34 /* i8272.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = i8272.cpp; path = 8272/i8272.cpp; sourceTree = ""; }; + 4BBC951D1F368D83008F4C34 /* i8272.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = i8272.hpp; path = 8272/i8272.hpp; sourceTree = ""; }; 4BBF49AE1ED2880200AB3669 /* FUSETests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FUSETests.swift; sourceTree = ""; }; 4BBF99081C8FBA6F0075DAFB /* TextureBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextureBuilder.cpp; sourceTree = ""; }; 4BBF99091C8FBA6F0075DAFB /* TextureBuilder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TextureBuilder.hpp; sourceTree = ""; }; @@ -1982,6 +1985,15 @@ path = ../../Processors; sourceTree = ""; }; + 4BBC951F1F368D87008F4C34 /* 8272 */ = { + isa = PBXGroup; + children = ( + 4BBC951C1F368D83008F4C34 /* i8272.cpp */, + 4BBC951D1F368D83008F4C34 /* i8272.hpp */, + ); + name = 8272; + sourceTree = ""; + }; 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 */,