From da9c9ad51a44aeb37f50f0484e7d0ed7165c8ed9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 14 Oct 2016 22:39:27 -0400 Subject: [PATCH] Added in the missing keys; added variable phase to the video. --- Machines/Oric/Video.cpp | 14 ++++++++++---- Machines/Oric/Video.hpp | 4 +++- .../Mac/Clock Signal/Machine/Wrappers/CSOric.mm | 10 ++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Machines/Oric/Video.cpp b/Machines/Oric/Video.cpp index 6f5c7f43a..6f8ec7388 100644 --- a/Machines/Oric/Video.cpp +++ b/Machines/Oric/Video.cpp @@ -15,7 +15,8 @@ VideoOutput::VideoOutput(uint8_t *memory) : _frame_counter(0), _counter(0), _state(Sync), _cycles_in_state(0), _is_graphics_mode(false), - _character_set_base_address(0xb400) + _character_set_base_address(0xb400), + _phase(0) { _crt.reset(new Outputs::CRT::CRT(64*6, 6, Outputs::CRT::DisplayType::PAL50, 1)); @@ -27,6 +28,8 @@ VideoOutput::VideoOutput(uint8_t *memory) : "texValue >>= 4 - (int(icoordinate.x * 8) & 4);" "return vec3( uvec3(texValue) & uvec3(4u, 2u, 1u));" "}"); + + _crt->set_output_device(Outputs::CRT::Television); } std::shared_ptr VideoOutput::get_crt() @@ -50,6 +53,7 @@ void VideoOutput::run_for_cycles(int number_of_cycles) _paper = 0x00; _use_alternative_character_set = _use_double_height_characters = _blink_text = false; set_character_set_base_address(); + _phase += 64; if(!_counter) _frame_counter++; } @@ -58,15 +62,17 @@ void VideoOutput::run_for_cycles(int number_of_cycles) if( (h_counter >= 48 && h_counter <= 53) || (_counter >= 256*64 && _counter <= 259*64)) new_state = Sync; + else if(h_counter >= 54 && h_counter <= 56) new_state = ColourBurst; else if(_counter < 224*64 && h_counter < 40) new_state = Pixels; if(_state != new_state) { switch(_state) { - case Sync: _crt->output_sync(_cycles_in_state * 6); break; - case Blank: _crt->output_blank(_cycles_in_state * 6); break; - case Pixels: _crt->output_data(_cycles_in_state * 6, 2); break; + case ColourBurst: _crt->output_colour_burst(_cycles_in_state * 6, _phase, 128); break; + case Sync: _crt->output_sync(_cycles_in_state * 6); break; + case Blank: _crt->output_blank(_cycles_in_state * 6); break; + case Pixels: _crt->output_data(_cycles_in_state * 6, 2); break; } _state = new_state; _cycles_in_state = 0; diff --git a/Machines/Oric/Video.hpp b/Machines/Oric/Video.hpp index d0e313825..77d31821d 100644 --- a/Machines/Oric/Video.hpp +++ b/Machines/Oric/Video.hpp @@ -28,7 +28,7 @@ class VideoOutput { // Output state enum State { - Blank, Sync, Pixels + Blank, Sync, Pixels, ColourBurst } _state; unsigned int _cycles_in_state; uint8_t *_pixel_target; @@ -48,6 +48,8 @@ class VideoOutput { bool _use_alternative_character_set; bool _use_double_height_characters; bool _blink_text; + + uint8_t _phase; }; } diff --git a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSOric.mm b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSOric.mm index 21afc3a53..1a726c4df 100644 --- a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSOric.mm +++ b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSOric.mm @@ -89,6 +89,16 @@ case VK_Space: _oric.set_key_state(Oric::Key::KeySpace, isPressed); break; case VK_Return: _oric.set_key_state(Oric::Key::KeyReturn, isPressed); break; case VK_ANSI_Minus: _oric.set_key_state(Oric::Key::KeyMinus, isPressed); break; + case VK_ANSI_Equal: _oric.set_key_state(Oric::Key::KeyEquals, isPressed); break; + case VK_ANSI_Backslash: + _oric.set_key_state(Oric::Key::KeyBackSlash, isPressed); break; + case VK_ANSI_Slash: _oric.set_key_state(Oric::Key::KeyForwardSlash, isPressed); break; + + case VK_ANSI_LeftBracket: + _oric.set_key_state(Oric::Key::KeyOpenSquare, isPressed); break; + case VK_ANSI_RightBracket: + _oric.set_key_state(Oric::Key::KeyCloseSquare, isPressed); break; + case VK_ANSI_Quote: _oric.set_key_state(Oric::Key::KeyQuote, isPressed); break; case VK_RightArrow: _oric.set_key_state(Oric::Key::KeyRight, isPressed); break; case VK_LeftArrow: _oric.set_key_state(Oric::Key::KeyLeft, isPressed); break;