mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Adds composite monochrome output for the Oric. At least temporarily.
This commit is contained in:
parent
6b2e1fe62b
commit
6c1d94beaa
@ -28,18 +28,18 @@ VideoOutput::VideoOutput(uint8_t *memory) :
|
||||
counter_period_(PAL50Period) {
|
||||
crt_.set_visible_area(crt_.get_rect_for_area(54, 224, 16 * 6, 40 * 6, 4.0f / 3.0f));
|
||||
crt_.set_phase_linked_luminance_offset(-1.0f / 8.0f);
|
||||
display_type_ = Outputs::Display::DisplayType::RGB;
|
||||
data_type_ = Outputs::Display::InputDataType::Red1Green1Blue1;
|
||||
}
|
||||
|
||||
void VideoOutput::set_display_type(Outputs::Display::DisplayType display_type) {
|
||||
if(display_type_ != display_type) {
|
||||
display_type_ = display_type;
|
||||
const auto data_type =
|
||||
(display_type == Outputs::Display::DisplayType::RGB) ?
|
||||
Outputs::Display::InputDataType::Red1Green1Blue1 :
|
||||
Outputs::Display::InputDataType::PhaseLinkedLuminance8;
|
||||
if(data_type_ != data_type) {
|
||||
data_type_ = data_type;
|
||||
crt_.set_display_type(display_type);
|
||||
crt_.set_input_data_type(
|
||||
(display_type == Outputs::Display::DisplayType::RGB) ?
|
||||
Outputs::Display::InputDataType::Red1Green1Blue1 :
|
||||
Outputs::Display::InputDataType::PhaseLinkedLuminance8
|
||||
);
|
||||
crt_.set_input_data_type(data_type_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,8 +102,11 @@ void VideoOutput::run_for(const Cycles cycles) {
|
||||
use_alternative_character_set_ = use_double_height_characters_ = blink_text_ = false;
|
||||
set_character_set_base_address();
|
||||
|
||||
if(display_type_ == Outputs::Display::DisplayType::RGB) rgb_pixel_target_ = reinterpret_cast<uint8_t *>(crt_.begin_data(240));
|
||||
else composite_pixel_target_ = reinterpret_cast<uint32_t *>(crt_.begin_data(240));
|
||||
if(data_type_ == Outputs::Display::InputDataType::Red1Green1Blue1) {
|
||||
rgb_pixel_target_ = reinterpret_cast<uint8_t *>(crt_.begin_data(240));
|
||||
} else {
|
||||
composite_pixel_target_ = reinterpret_cast<uint32_t *>(crt_.begin_data(240));
|
||||
}
|
||||
|
||||
if(!counter_) {
|
||||
frame_counter_++;
|
||||
@ -136,7 +139,7 @@ void VideoOutput::run_for(const Cycles cycles) {
|
||||
pixels &= blink_mask;
|
||||
|
||||
if(control_byte & 0x60) {
|
||||
if(display_type_ == Outputs::Display::DisplayType::RGB && rgb_pixel_target_) {
|
||||
if(data_type_ == Outputs::Display::InputDataType::Red1Green1Blue1 && rgb_pixel_target_) {
|
||||
const uint8_t colours[2] = {
|
||||
uint8_t(paper_ ^ inverse_mask),
|
||||
uint8_t(ink_ ^ inverse_mask)
|
||||
@ -147,7 +150,7 @@ void VideoOutput::run_for(const Cycles cycles) {
|
||||
rgb_pixel_target_[3] = colours[(pixels >> 2)&1];
|
||||
rgb_pixel_target_[4] = colours[(pixels >> 1)&1];
|
||||
rgb_pixel_target_[5] = colours[(pixels >> 0)&1];
|
||||
} else if(display_type_ == Outputs::Display::DisplayType::CompositeColour && composite_pixel_target_) {
|
||||
} else if(composite_pixel_target_) {
|
||||
const uint32_t colours[2] = {
|
||||
colour_forms_[paper_ ^ inverse_mask],
|
||||
colour_forms_[ink_ ^ inverse_mask]
|
||||
@ -196,11 +199,11 @@ void VideoOutput::run_for(const Cycles cycles) {
|
||||
default: break;
|
||||
}
|
||||
|
||||
if(display_type_ == Outputs::Display::DisplayType::RGB && rgb_pixel_target_) {
|
||||
if(data_type_ == Outputs::Display::InputDataType::Red1Green1Blue1 && rgb_pixel_target_) {
|
||||
rgb_pixel_target_[0] = rgb_pixel_target_[1] =
|
||||
rgb_pixel_target_[2] = rgb_pixel_target_[3] =
|
||||
rgb_pixel_target_[4] = rgb_pixel_target_[5] = paper_ ^ inverse_mask;
|
||||
} else if(display_type_ == Outputs::Display::DisplayType::CompositeColour && composite_pixel_target_) {
|
||||
} else if(composite_pixel_target_) {
|
||||
composite_pixel_target_[0] = composite_pixel_target_[1] =
|
||||
composite_pixel_target_[2] = composite_pixel_target_[3] =
|
||||
composite_pixel_target_[4] = composite_pixel_target_[5] = colour_forms_[paper_ ^ inverse_mask];
|
||||
|
@ -40,7 +40,7 @@ class VideoOutput {
|
||||
uint8_t *rgb_pixel_target_;
|
||||
uint32_t *composite_pixel_target_;
|
||||
uint32_t colour_forms_[8];
|
||||
Outputs::Display::DisplayType display_type_;
|
||||
Outputs::Display::InputDataType data_type_;
|
||||
|
||||
// Registers
|
||||
uint8_t ink_, paper_;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@ -13,17 +13,17 @@
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Options" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="ZW7-Bw-4RP" customClass="MachinePanel" customModule="Clock_Signal" customModuleProvider="target">
|
||||
<window title="Options" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="ZW7-Bw-4RP" customClass="MachinePanel" customModule="Clock_Signal" customModuleProvider="target">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" utility="YES" nonactivatingPanel="YES" HUD="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="80" y="150" width="200" height="83"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="900"/>
|
||||
<view key="contentView" id="tpZ-0B-QQu">
|
||||
<rect key="frame" x="0.0" y="0.0" width="200" height="83"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="222" height="83"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="zPG-yW-4Gy">
|
||||
<rect key="frame" x="18" y="47" width="164" height="18"/>
|
||||
<rect key="frame" x="18" y="47" width="186" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Load Quickly" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="alI-Mw-35c">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@ -33,7 +33,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rh8-km-57n">
|
||||
<rect key="frame" x="18" y="17" width="165" height="26"/>
|
||||
<rect key="frame" x="18" y="17" width="187" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="SCART" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="tJM-kX-gaK" id="8SX-c5-ud1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
@ -41,6 +41,7 @@
|
||||
<items>
|
||||
<menuItem title="SCART" state="on" id="tJM-kX-gaK"/>
|
||||
<menuItem title="Composite" tag="1" id="fFm-fS-rWG"/>
|
||||
<menuItem title="Composite Monochrome" tag="3" id="hjs-qh-WKP"/>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
|
Loading…
Reference in New Issue
Block a user