From 30d4a7c66272dba9a69acf46e0041ab3d5c1bd98 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 24 Oct 2016 21:58:15 -0400 Subject: [PATCH 1/3] Fixed: blinking means ink vanishing and appearing. Nothing else. --- Machines/Oric/Video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/Oric/Video.cpp b/Machines/Oric/Video.cpp index ba2b25c07..ec31bd1a6 100644 --- a/Machines/Oric/Video.cpp +++ b/Machines/Oric/Video.cpp @@ -116,7 +116,7 @@ void VideoOutput::run_for_cycles(int number_of_cycles) } uint8_t inverse_mask = (control_byte & 0x80) ? 0x77 : 0x00; - if(_blink_text) inverse_mask ^= (_frame_counter&32) ? 0x77 : 0x00; + if(_blink_text && (_frame_counter&32)) pixels = 0; if(control_byte & 0x60) { From d3634488e6dfeef84ce54e9fb1c7396700f74902 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 24 Oct 2016 21:59:06 -0400 Subject: [PATCH 2/3] Made an attempt better to deal with multiple-file TAPs; also started using a zero level for the header/data gap. --- Storage/Tape/Formats/OricTAP.cpp | 38 ++++++++++++++++++-------------- Storage/Tape/Formats/OricTAP.hpp | 3 ++- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Storage/Tape/Formats/OricTAP.cpp b/Storage/Tape/Formats/OricTAP.cpp index f36a8cca6..95bbb349f 100644 --- a/Storage/Tape/Formats/OricTAP.cpp +++ b/Storage/Tape/Formats/OricTAP.cpp @@ -42,7 +42,7 @@ OricTAP::~OricTAP() void OricTAP::virtual_reset() { -// fseek(_file, 0, SEEK_SET); + fseek(_file, 0, SEEK_SET); _bit_count = 13; _phase = _next_phase = LeadIn; _phase_counter = 0; @@ -69,6 +69,10 @@ Tape::Pulse OricTAP::virtual_get_next_pulse() _phase_counter++; if(_phase_counter == 259) // 256 artificial bytes plus the three in the file = 259 { + while(1) + { + if(fgetc(_file) != 0x16) break; + } _next_phase = Header; } break; @@ -106,20 +110,18 @@ Tape::Pulse OricTAP::virtual_get_next_pulse() case Data: next_byte = (uint8_t)fgetc(_file); - if(feof(_file)) _phase = End; -// _phase_counter++; -// if(_phase_counter == (_data_end_address - _data_start_address)+1) -// { -// _phase_counter = 0; -// if((size_t)ftell(_file) == _file_length) -// { -// _next_phase = End; -// } -// else -// { -// _next_phase = LeadIn; -// } -// } + _phase_counter++; + if(_phase_counter >= (_data_end_address - _data_start_address)+1) + { + if(next_byte == 0x16) + { + _next_phase = LeadIn; + } + else if(feof(_file)) + { + _next_phase = End; + } + } break; case End: @@ -148,8 +150,10 @@ Tape::Pulse OricTAP::virtual_get_next_pulse() return pulse; case Gap: - next_bit = 1; - break; + _bit_count = 13; + pulse.type = Pulse::Zero; + pulse.length.length = 100; + return pulse; default: next_bit = _current_value & 1; diff --git a/Storage/Tape/Formats/OricTAP.hpp b/Storage/Tape/Formats/OricTAP.hpp index af3eaf7f4..f425b6541 100644 --- a/Storage/Tape/Formats/OricTAP.hpp +++ b/Storage/Tape/Formats/OricTAP.hpp @@ -42,14 +42,15 @@ class OricTAP: public Tape { FILE *_file; size_t _file_length; + // byte serialisation and output uint16_t _current_value; int _bit_count; int _pulse_counter; - int _phase_counter; enum Phase { LeadIn, Header, Data, Gap, End } _phase, _next_phase; + int _phase_counter; uint16_t _data_end_address, _data_start_address; }; From 013f0c53171f9a86f99ee296d392b0c0861501ce Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 24 Oct 2016 22:08:24 -0400 Subject: [PATCH 3/3] Finally forced emulation window to front. Also removed min/max heights where they'd crept in and got explicit about the OpenGL view being first responder. --- OSBindings/Mac/Clock Signal/Base.lproj/Atari2600Options.xib | 4 +--- OSBindings/Mac/Clock Signal/Base.lproj/ElectronOptions.xib | 2 -- OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib | 1 + OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift | 3 +++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/Base.lproj/Atari2600Options.xib b/OSBindings/Mac/Clock Signal/Base.lproj/Atari2600Options.xib index 50926faf4..875298900 100644 --- a/OSBindings/Mac/Clock Signal/Base.lproj/Atari2600Options.xib +++ b/OSBindings/Mac/Clock Signal/Base.lproj/Atari2600Options.xib @@ -12,12 +12,10 @@ - + - - diff --git a/OSBindings/Mac/Clock Signal/Base.lproj/ElectronOptions.xib b/OSBindings/Mac/Clock Signal/Base.lproj/ElectronOptions.xib index 20ebefd9a..2e05438f5 100644 --- a/OSBindings/Mac/Clock Signal/Base.lproj/ElectronOptions.xib +++ b/OSBindings/Mac/Clock Signal/Base.lproj/ElectronOptions.xib @@ -16,8 +16,6 @@ - - diff --git a/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib b/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib index ba4710992..5dd259d78 100644 --- a/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib +++ b/OSBindings/Mac/Clock Signal/Base.lproj/MachineDocument.xib @@ -36,6 +36,7 @@ + diff --git a/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift b/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift index 8f54d6884..193c7bc31 100644 --- a/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift +++ b/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift @@ -67,6 +67,9 @@ class MachineDocument: setupClockRate() self.machine.delegate = self self.optionsPanel?.establishStoredOptions() + + // bring OpenGL view-holding window on top of the options panel + self.openGLView.window!.makeKeyAndOrderFront(self) } func machineDidChangeClockRate(_ machine: CSMachine!) {