1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-25 17:29:40 +00:00

Stubs video switches into the IIgs.

This commit is contained in:
Thomas Harte 2020-10-31 20:39:32 -04:00
parent 531a3bb7e6
commit 45f5896b76
7 changed files with 97 additions and 6 deletions

View File

@ -6,8 +6,8 @@
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef Video_hpp
#define Video_hpp
#ifndef Apple_II_Video_hpp
#define Apple_II_Video_hpp
#include "../../../Outputs/CRT/CRT.hpp"
#include "../../../ClockReceiver/ClockReceiver.hpp"
@ -462,4 +462,4 @@ template <class BusHandler, bool is_iie> class Video: public VideoBase {
}
}
#endif /* Video_hpp */
#endif /* Apple_II_Video_hpp */

View File

@ -31,7 +31,7 @@ constexpr bool is_double_mode(GraphicsMode m) { return int(m) & 1; }
template <typename TimeUnit> class VideoSwitches {
public:
/*!
Constructs a new instance of VideoSwitches in which changes to the switch
Constructs a new instance of VideoSwitches in which changes to relevant switches
affect the video mode only after @c delay cycles.
*/
VideoSwitches(TimeUnit delay, std::function<void(TimeUnit)> &&target) : delay_(delay), deferrer_(std::move(target)) {}

View File

@ -13,6 +13,7 @@
#include "../../../Analyser/Static/AppleIIgs/Target.hpp"
#include "MemoryMap.hpp"
#include "Video.hpp"
#include "../../../Components/8530/z8530.hpp"
#include "../../../Components/AppleClock/AppleClock.hpp"
@ -169,6 +170,7 @@ class ConcreteMachine:
#define SwitchRead(s) *value = memory_.s ? 0x80 : 0x00
#define LanguageRead(s) SwitchRead(language_card_switches().state().s)
#define AuxiliaryRead(s) SwitchRead(auxiliary_switches().switches().s)
#define VideoRead(s) video_.s
case 0xc011: LanguageRead(bank1); break;
case 0xc012: LanguageRead(read); break;
case 0xc013: AuxiliaryRead(read_auxiliary_memory); break;
@ -176,10 +178,37 @@ class ConcreteMachine:
case 0xc015: AuxiliaryRead(internal_CX_rom); break;
case 0xc016: AuxiliaryRead(alternative_zero_page); break;
case 0xc017: AuxiliaryRead(slot_C3_rom); break;
case 0xc018: VideoRead(get_80_store()); break;
// case 0xc019: VideoRead(get_is_vertical_blank(cycles_since_video_update_)); break;
case 0xc01a: VideoRead(get_text()); break;
case 0xc01b: VideoRead(get_mixed()); break;
case 0xc01c: VideoRead(get_page2()); break;
case 0xc01d: VideoRead(get_high_resolution()); break;
case 0xc01e: VideoRead(get_alternative_character_set()); break;
case 0xc01f: VideoRead(get_80_columns()); break;
case 0xc046: VideoRead(get_annunciator_3()); break;
#undef VideoRead
#undef AuxiliaryRead
#undef LanguageRead
#undef SwitchRead
// Video switches.
case 0xc050: case 0xc051:
video_.set_text(address & 1);
break;
case 0xc052: case 0xc053:
video_.set_mixed(address & 1);
break;
case 0xc054: case 0xc055:
video_.set_page2(address&1);
break;
case 0xc056: case 0xc057:
video_.set_high_resolution(address&1);
break;
case 0xc05e: case 0xc05f:
video_.set_annunciator_3(!(address&1));
break;
// The SCC.
case 0xc038: case 0xc039: case 0xc03a: case 0xc03b:
if(isReadOperation(operation)) {
@ -193,7 +222,6 @@ class ConcreteMachine:
// TODO: subject to read data? Does vapour lock apply?
case 0xc000: case 0xc001: case 0xc002: case 0xc003: case 0xc004: case 0xc005:
case 0xc006: case 0xc007: case 0xc008: case 0xc009: case 0xc00a: case 0xc00b:
case 0xc054: case 0xc055: case 0xc056: case 0xc057:
break;
// Interrupt ROM addresses; Cf. P25 of the Hardware Reference.
@ -261,7 +289,9 @@ class ConcreteMachine:
private:
CPU::WDC65816::Processor<ConcreteMachine, false> m65816_;
MemoryMap memory_;
Apple::Clock::ParallelClock clock_;
Apple::IIgs::Video::Video video_;
int fast_access_phase_ = 0;
int slow_access_phase_ = 0;

View File

@ -18,7 +18,6 @@
namespace Apple {
namespace IIgs {
class MemoryMap {
public:
// MARK: - Initial construction and configuration.

View File

@ -0,0 +1,18 @@
//
// Video.cpp
// Clock Signal
//
// Created by Thomas Harte on 31/10/2020.
// Copyright © 2020 Thomas Harte. All rights reserved.
//
#include "Video.hpp"
using namespace Apple::IIgs::Video;
VideoBase::VideoBase() :
VideoSwitches<Cycles>(Cycles(2), [] (Cycles) {}) {
}
void VideoBase::did_set_annunciator_3(bool) {}
void VideoBase::did_set_alternative_character_set(bool) {}

View File

@ -0,0 +1,36 @@
//
// Video.hpp
// Clock Signal
//
// Created by Thomas Harte on 31/10/2020.
// Copyright © 2020 Thomas Harte. All rights reserved.
//
#ifndef Apple_IIgs_Video_hpp
#define Apple_IIgs_Video_hpp
#include "../AppleII/VideoSwitches.hpp"
namespace Apple {
namespace IIgs {
namespace Video {
class VideoBase: public Apple::II::VideoSwitches<Cycles> {
public:
VideoBase();
private:
void did_set_annunciator_3(bool) override;
void did_set_alternative_character_set(bool) override;
};
class Video: public VideoBase {
public:
using VideoBase::VideoBase;
};
}
}
}
#endif /* Video_hpp */

View File

@ -454,6 +454,8 @@
4B89453E201967B4007DE474 /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B894517201967B4007DE474 /* StaticAnalyser.cpp */; };
4B89453F201967B4007DE474 /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B894517201967B4007DE474 /* StaticAnalyser.cpp */; };
4B8DF4D825465B7500F3433C /* IIgsMemoryMapTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DF4D725465B7500F3433C /* IIgsMemoryMapTests.mm */; };
4B8DF4F9254E36AE00F3433C /* Video.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DF4F7254E36AD00F3433C /* Video.cpp */; };
4B8DF4FA254E36AE00F3433C /* Video.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DF4F7254E36AD00F3433C /* Video.cpp */; };
4B8FE21B1DA19D5F0090D3CE /* Atari2600Options.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2131DA19D5F0090D3CE /* Atari2600Options.xib */; };
4B8FE21C1DA19D5F0090D3CE /* MachineDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2151DA19D5F0090D3CE /* MachineDocument.xib */; };
4B8FE21D1DA19D5F0090D3CE /* QuickLoadCompositeOptions.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2171DA19D5F0090D3CE /* QuickLoadCompositeOptions.xib */; };
@ -1316,6 +1318,8 @@
4B8DF4D725465B7500F3433C /* IIgsMemoryMapTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = IIgsMemoryMapTests.mm; sourceTree = "<group>"; };
4B8DF4ED254B840B00F3433C /* AppleClock.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AppleClock.hpp; sourceTree = "<group>"; };
4B8DF4F2254E141700F3433C /* VideoSwitches.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = VideoSwitches.hpp; sourceTree = "<group>"; };
4B8DF4F7254E36AD00F3433C /* Video.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Video.cpp; sourceTree = "<group>"; };
4B8DF4F8254E36AD00F3433C /* Video.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Video.hpp; sourceTree = "<group>"; };
4B8E4ECD1DCE483D003716C3 /* KeyboardMachine.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = KeyboardMachine.hpp; sourceTree = "<group>"; };
4B8EF6071FE5AF830076CCDD /* LowpassSpeaker.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LowpassSpeaker.hpp; sourceTree = "<group>"; };
4B8FE2141DA19D5F0090D3CE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/Atari2600Options.xib"; sourceTree = SOURCE_ROOT; };
@ -3922,8 +3926,10 @@
isa = PBXGroup;
children = (
4BE21214253FCE9C00435408 /* AppleIIgs.cpp */,
4B8DF4F7254E36AD00F3433C /* Video.cpp */,
4BE2120E253FCE9C00435408 /* AppleIIgs.hpp */,
4B8DF4D62546561300F3433C /* MemoryMap.hpp */,
4B8DF4F8254E36AD00F3433C /* Video.hpp */,
);
path = AppleIIgs;
sourceTree = "<group>";
@ -4529,6 +4535,7 @@
4B055AD51FAE9B0B0060FFFF /* Video.cpp in Sources */,
4B894521201967B4007DE474 /* StaticAnalyser.cpp in Sources */,
4B8318B522D3E548006DB630 /* Macintosh.cpp in Sources */,
4B8DF4FA254E36AE00F3433C /* Video.cpp in Sources */,
4B7BA03123C2B19C00B98D9E /* Jasmin.cpp in Sources */,
4B7F188F2154825E00388727 /* MasterSystem.cpp in Sources */,
4B055AA51FAE85EF0060FFFF /* Encoder.cpp in Sources */,
@ -4796,6 +4803,7 @@
4BC57CD92436A62900FBC404 /* State.cpp in Sources */,
4BDA00E622E699B000AC3CD0 /* CSMachine.mm in Sources */,
4B4518831F75E91A00926311 /* PCMTrack.cpp in Sources */,
4B8DF4F9254E36AE00F3433C /* Video.cpp in Sources */,
4B0ACC3223775819008902D0 /* Atari2600.cpp in Sources */,
4B45189F1F75FD1C00926311 /* AcornADF.cpp in Sources */,
4B7BA03023C2B19C00B98D9E /* Jasmin.cpp in Sources */,