From 14b2927275bcf7a819d3dd27ebc461f89cfae789 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 8 Mar 2016 20:59:16 -0500 Subject: [PATCH] Made further attempts to tidy up; trying to demarcate between public interface and private. --- .../Clock Signal.xcodeproj/project.pbxproj | 68 ++++++++++++------- Outputs/CRT/CRT.hpp | 59 ++-------------- .../CRTInputBufferBuilder.cpp} | 48 +++---------- .../CRT/Internals/CRTInputBufferBuilder.hpp | 48 +++++++++++++ Outputs/CRT/{ => Internals}/CRTOpenGL.cpp | 0 Outputs/CRT/{ => Internals}/CRTOpenGL.hpp | 0 Outputs/CRT/Internals/CRTRunBuilder.cpp | 33 +++++++++ Outputs/CRT/Internals/CRTRunBuilder.hpp | 43 ++++++++++++ Outputs/CRT/{ => Internals}/Flywheel.hpp | 0 Outputs/CRT/{ => Internals}/OpenGL.hpp | 0 Outputs/CRT/{ => Internals}/Shader.cpp | 0 Outputs/CRT/{ => Internals}/Shader.hpp | 0 Outputs/CRT/{ => Internals}/TextureTarget.cpp | 0 Outputs/CRT/{ => Internals}/TextureTarget.hpp | 0 14 files changed, 181 insertions(+), 118 deletions(-) rename Outputs/CRT/{CRTBuilders.cpp => Internals/CRTInputBufferBuilder.cpp} (62%) create mode 100644 Outputs/CRT/Internals/CRTInputBufferBuilder.hpp rename Outputs/CRT/{ => Internals}/CRTOpenGL.cpp (100%) rename Outputs/CRT/{ => Internals}/CRTOpenGL.hpp (100%) create mode 100644 Outputs/CRT/Internals/CRTRunBuilder.cpp create mode 100644 Outputs/CRT/Internals/CRTRunBuilder.hpp rename Outputs/CRT/{ => Internals}/Flywheel.hpp (100%) rename Outputs/CRT/{ => Internals}/OpenGL.hpp (100%) rename Outputs/CRT/{ => Internals}/Shader.cpp (100%) rename Outputs/CRT/{ => Internals}/Shader.hpp (100%) rename Outputs/CRT/{ => Internals}/TextureTarget.cpp (100%) rename Outputs/CRT/{ => Internals}/TextureTarget.hpp (100%) diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 06a8aad27..049ef77ea 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -8,15 +8,12 @@ /* Begin PBXBuildFile section */ 4B0CCC451C62D0B3001CAC5F /* CRT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B0CCC421C62D0B3001CAC5F /* CRT.cpp */; }; - 4B0CCC471C62D1A8001CAC5F /* CRTOpenGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B0CCC461C62D1A8001CAC5F /* CRTOpenGL.cpp */; }; 4B0EBFB81C487F2F00A11F35 /* AudioQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B0EBFB71C487F2F00A11F35 /* AudioQueue.m */; }; 4B14145B1B58879D00E04248 /* CPU6502.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1414571B58879D00E04248 /* CPU6502.cpp */; }; 4B14145D1B5887A600E04248 /* CPU6502.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1414571B58879D00E04248 /* CPU6502.cpp */; }; 4B14145E1B5887AA00E04248 /* CPU6502AllRAM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1414591B58879D00E04248 /* CPU6502AllRAM.cpp */; }; 4B1414601B58885000E04248 /* WolfgangLorenzTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B14145F1B58885000E04248 /* WolfgangLorenzTests.swift */; }; 4B1414621B58888700E04248 /* KlausDormannTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1414611B58888700E04248 /* KlausDormannTests.swift */; }; - 4B2039941C67E20B001375C3 /* TextureTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2039921C67E20B001375C3 /* TextureTarget.cpp */; }; - 4B2039991C67FA92001375C3 /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2039971C67FA92001375C3 /* Shader.cpp */; }; 4B2409551C45AB05004DA684 /* Speaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2409531C45AB05004DA684 /* Speaker.cpp */; }; 4B2E2D951C399D1200138695 /* ElectronDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B2E2D931C399D1200138695 /* ElectronDocument.xib */; }; 4B2E2D9A1C3A06EC00138695 /* Atari2600.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2E2D971C3A06EC00138695 /* Atari2600.cpp */; }; @@ -31,7 +28,6 @@ 4B69FB3D1C4D908A00B5F0AA /* Tape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B69FB3B1C4D908A00B5F0AA /* Tape.cpp */; }; 4B69FB441C4D941400B5F0AA /* TapeUEF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B69FB421C4D941400B5F0AA /* TapeUEF.cpp */; }; 4B69FB461C4D950F00B5F0AA /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B69FB451C4D950F00B5F0AA /* libz.tbd */; }; - 4B7BFEFE1C6446EF00089C1C /* CRTBuilders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B7BFEFD1C6446EF00089C1C /* CRTBuilders.cpp */; }; 4B92EACA1B7C112B00246143 /* TimingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B92EAC91B7C112B00246143 /* TimingTests.swift */; }; 4BB298EE1B587D8400A49093 /* 6502_functional_test.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4BB297E01B587D8300A49093 /* 6502_functional_test.bin */; }; 4BB298EF1B587D8400A49093 /* AllSuiteA.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4BB297E11B587D8300A49093 /* AllSuiteA.bin */; }; @@ -307,6 +303,11 @@ 4BB73EAC1B587A5100552FC2 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4BB73EAA1B587A5100552FC2 /* MainMenu.xib */; }; 4BB73EB71B587A5100552FC2 /* AllSuiteATests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB73EB61B587A5100552FC2 /* AllSuiteATests.swift */; }; 4BB73EC21B587A5100552FC2 /* Clock_SignalUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB73EC11B587A5100552FC2 /* Clock_SignalUITests.swift */; }; + 4BBF99141C8FBA6F0075DAFB /* CRTInputBufferBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF99081C8FBA6F0075DAFB /* CRTInputBufferBuilder.cpp */; }; + 4BBF99151C8FBA6F0075DAFB /* CRTOpenGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF990A1C8FBA6F0075DAFB /* CRTOpenGL.cpp */; }; + 4BBF99161C8FBA6F0075DAFB /* CRTRunBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF990C1C8FBA6F0075DAFB /* CRTRunBuilder.cpp */; }; + 4BBF99171C8FBA6F0075DAFB /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF99101C8FBA6F0075DAFB /* Shader.cpp */; }; + 4BBF99181C8FBA6F0075DAFB /* TextureTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBF99121C8FBA6F0075DAFB /* TextureTarget.cpp */; }; 4BE5F85E1C3E1C2500C43F01 /* basic.rom in Resources */ = {isa = PBXBuildFile; fileRef = 4BE5F85C1C3E1C2500C43F01 /* basic.rom */; }; 4BE5F85F1C3E1C2500C43F01 /* os.rom in Resources */ = {isa = PBXBuildFile; fileRef = 4BE5F85D1C3E1C2500C43F01 /* os.rom */; }; /* End PBXBuildFile section */ @@ -331,7 +332,6 @@ /* Begin PBXFileReference section */ 4B0CCC421C62D0B3001CAC5F /* CRT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CRT.cpp; sourceTree = ""; }; 4B0CCC431C62D0B3001CAC5F /* CRT.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CRT.hpp; sourceTree = ""; }; - 4B0CCC461C62D1A8001CAC5F /* CRTOpenGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CRTOpenGL.cpp; sourceTree = ""; }; 4B0EBFB61C487F2F00A11F35 /* AudioQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioQueue.h; sourceTree = ""; }; 4B0EBFB71C487F2F00A11F35 /* AudioQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioQueue.m; sourceTree = ""; }; 4B1414501B58848C00E04248 /* ClockSignal-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ClockSignal-Bridging-Header.h"; sourceTree = ""; }; @@ -341,11 +341,6 @@ 4B14145A1B58879D00E04248 /* CPU6502AllRAM.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CPU6502AllRAM.hpp; sourceTree = ""; }; 4B14145F1B58885000E04248 /* WolfgangLorenzTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WolfgangLorenzTests.swift; sourceTree = ""; }; 4B1414611B58888700E04248 /* KlausDormannTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KlausDormannTests.swift; sourceTree = ""; }; - 4B2039921C67E20B001375C3 /* TextureTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextureTarget.cpp; sourceTree = ""; }; - 4B2039931C67E20B001375C3 /* TextureTarget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TextureTarget.hpp; sourceTree = ""; }; - 4B2039951C67E2A3001375C3 /* OpenGL.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = OpenGL.hpp; sourceTree = ""; }; - 4B2039971C67FA92001375C3 /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; - 4B2039981C67FA92001375C3 /* Shader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Shader.hpp; sourceTree = ""; }; 4B2409531C45AB05004DA684 /* Speaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Speaker.cpp; path = ../../Outputs/Speaker.cpp; sourceTree = ""; }; 4B2409541C45AB05004DA684 /* Speaker.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Speaker.hpp; path = ../../Outputs/Speaker.hpp; sourceTree = ""; }; 4B24095A1C45DF85004DA684 /* Stepper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Stepper.hpp; sourceTree = ""; }; @@ -372,7 +367,6 @@ 4B69FB421C4D941400B5F0AA /* TapeUEF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TapeUEF.cpp; sourceTree = ""; }; 4B69FB431C4D941400B5F0AA /* TapeUEF.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TapeUEF.hpp; sourceTree = ""; }; 4B69FB451C4D950F00B5F0AA /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - 4B7BFEFD1C6446EF00089C1C /* CRTBuilders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CRTBuilders.cpp; sourceTree = ""; }; 4B92EAC91B7C112B00246143 /* TimingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimingTests.swift; sourceTree = ""; }; 4BAE587D1C447B7A005B9AF0 /* KeyCodes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeyCodes.h; sourceTree = ""; }; 4BB297DF1B587D8200A49093 /* Clock SignalTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Clock SignalTests-Bridging-Header.h"; sourceTree = ""; }; @@ -658,10 +652,20 @@ 4BB73EC11B587A5100552FC2 /* Clock_SignalUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Clock_SignalUITests.swift; sourceTree = ""; }; 4BB73EC31B587A5100552FC2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 4BB73ECF1B587A6700552FC2 /* Clock Signal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Clock Signal.entitlements"; sourceTree = ""; }; - 4BCC142A1C6FFD6F0033C621 /* CRTOpenGL.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = CRTOpenGL.hpp; sourceTree = ""; }; + 4BBF99081C8FBA6F0075DAFB /* CRTInputBufferBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CRTInputBufferBuilder.cpp; sourceTree = ""; }; + 4BBF99091C8FBA6F0075DAFB /* CRTInputBufferBuilder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CRTInputBufferBuilder.hpp; sourceTree = ""; }; + 4BBF990A1C8FBA6F0075DAFB /* CRTOpenGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CRTOpenGL.cpp; sourceTree = ""; }; + 4BBF990B1C8FBA6F0075DAFB /* CRTOpenGL.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CRTOpenGL.hpp; sourceTree = ""; }; + 4BBF990C1C8FBA6F0075DAFB /* CRTRunBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CRTRunBuilder.cpp; sourceTree = ""; }; + 4BBF990D1C8FBA6F0075DAFB /* CRTRunBuilder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CRTRunBuilder.hpp; sourceTree = ""; }; + 4BBF990E1C8FBA6F0075DAFB /* Flywheel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Flywheel.hpp; sourceTree = ""; }; + 4BBF990F1C8FBA6F0075DAFB /* OpenGL.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = OpenGL.hpp; sourceTree = ""; }; + 4BBF99101C8FBA6F0075DAFB /* Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shader.cpp; sourceTree = ""; }; + 4BBF99111C8FBA6F0075DAFB /* Shader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Shader.hpp; sourceTree = ""; }; + 4BBF99121C8FBA6F0075DAFB /* TextureTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextureTarget.cpp; sourceTree = ""; }; + 4BBF99131C8FBA6F0075DAFB /* TextureTarget.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TextureTarget.hpp; sourceTree = ""; }; 4BE5F85C1C3E1C2500C43F01 /* basic.rom */ = {isa = PBXFileReference; lastKnownFileType = file; path = basic.rom; sourceTree = ""; }; 4BE5F85D1C3E1C2500C43F01 /* os.rom */ = {isa = PBXFileReference; lastKnownFileType = file; path = os.rom; sourceTree = ""; }; - 4BEDD0F41C6D70B800F6257C /* Flywheel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Flywheel.hpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -693,17 +697,9 @@ 4B0CCC411C62D0B3001CAC5F /* CRT */ = { isa = PBXGroup; children = ( + 4BBF99071C8FBA6F0075DAFB /* Internals */, 4B0CCC421C62D0B3001CAC5F /* CRT.cpp */, 4B0CCC431C62D0B3001CAC5F /* CRT.hpp */, - 4B0CCC461C62D1A8001CAC5F /* CRTOpenGL.cpp */, - 4B7BFEFD1C6446EF00089C1C /* CRTBuilders.cpp */, - 4B2039921C67E20B001375C3 /* TextureTarget.cpp */, - 4B2039931C67E20B001375C3 /* TextureTarget.hpp */, - 4B2039951C67E2A3001375C3 /* OpenGL.hpp */, - 4B2039971C67FA92001375C3 /* Shader.cpp */, - 4B2039981C67FA92001375C3 /* Shader.hpp */, - 4BEDD0F41C6D70B800F6257C /* Flywheel.hpp */, - 4BCC142A1C6FFD6F0033C621 /* CRTOpenGL.hpp */, ); name = CRT; path = ../../Outputs/CRT; @@ -1193,6 +1189,25 @@ path = ../../Processors; sourceTree = ""; }; + 4BBF99071C8FBA6F0075DAFB /* Internals */ = { + isa = PBXGroup; + children = ( + 4BBF99081C8FBA6F0075DAFB /* CRTInputBufferBuilder.cpp */, + 4BBF99091C8FBA6F0075DAFB /* CRTInputBufferBuilder.hpp */, + 4BBF990A1C8FBA6F0075DAFB /* CRTOpenGL.cpp */, + 4BBF990B1C8FBA6F0075DAFB /* CRTOpenGL.hpp */, + 4BBF990C1C8FBA6F0075DAFB /* CRTRunBuilder.cpp */, + 4BBF990D1C8FBA6F0075DAFB /* CRTRunBuilder.hpp */, + 4BBF990E1C8FBA6F0075DAFB /* Flywheel.hpp */, + 4BBF990F1C8FBA6F0075DAFB /* OpenGL.hpp */, + 4BBF99101C8FBA6F0075DAFB /* Shader.cpp */, + 4BBF99111C8FBA6F0075DAFB /* Shader.hpp */, + 4BBF99121C8FBA6F0075DAFB /* TextureTarget.cpp */, + 4BBF99131C8FBA6F0075DAFB /* TextureTarget.hpp */, + ); + path = Internals; + sourceTree = ""; + }; 4BE5F85A1C3E1C2500C43F01 /* Resources */ = { isa = PBXGroup; children = ( @@ -1616,21 +1631,22 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 4BBF99151C8FBA6F0075DAFB /* CRTOpenGL.cpp in Sources */, 4B55CE541C3B7ABF0093A61B /* CSElectron.mm in Sources */, 4B0CCC451C62D0B3001CAC5F /* CRT.cpp in Sources */, 4B55CE591C3B7D360093A61B /* ElectronDocument.swift in Sources */, 4B55CE4B1C3B3B0C0093A61B /* CSAtari2600.mm in Sources */, + 4BBF99161C8FBA6F0075DAFB /* CRTRunBuilder.cpp in Sources */, 4B55CE581C3B7D360093A61B /* Atari2600Document.swift in Sources */, - 4B0CCC471C62D1A8001CAC5F /* CRTOpenGL.cpp in Sources */, - 4B2039941C67E20B001375C3 /* TextureTarget.cpp in Sources */, 4B0EBFB81C487F2F00A11F35 /* AudioQueue.m in Sources */, - 4B7BFEFE1C6446EF00089C1C /* CRTBuilders.cpp in Sources */, + 4BBF99181C8FBA6F0075DAFB /* TextureTarget.cpp in Sources */, 4B55CE5F1C3B7D960093A61B /* MachineDocument.swift in Sources */, 4B69FB441C4D941400B5F0AA /* TapeUEF.cpp in Sources */, + 4BBF99141C8FBA6F0075DAFB /* CRTInputBufferBuilder.cpp in Sources */, 4B2409551C45AB05004DA684 /* Speaker.cpp in Sources */, 4B55CE4E1C3B3BDA0093A61B /* CSMachine.mm in Sources */, 4B2E2D9D1C3A070400138695 /* Electron.cpp in Sources */, - 4B2039991C67FA92001375C3 /* Shader.cpp in Sources */, + 4BBF99171C8FBA6F0075DAFB /* Shader.cpp in Sources */, 4B69FB3D1C4D908A00B5F0AA /* Tape.cpp in Sources */, 4B55CE5D1C3B7D6F0093A61B /* CSOpenGLView.m in Sources */, 4B2E2D9A1C3A06EC00138695 /* Atari2600.cpp in Sources */, diff --git a/Outputs/CRT/CRT.hpp b/Outputs/CRT/CRT.hpp index 434dc6946..8a6de7327 100644 --- a/Outputs/CRT/CRT.hpp +++ b/Outputs/CRT/CRT.hpp @@ -6,8 +6,8 @@ // Copyright © 2015 Thomas Harte. All rights reserved. // -#ifndef CRT_cpp -#define CRT_cpp +#ifndef CRT_hpp +#define CRT_hpp #include #include @@ -15,7 +15,9 @@ #include #include -#include "Flywheel.hpp" +#include "Internals/Flywheel.hpp" +#include "Internals/CRTInputBufferBuilder.hpp" +#include "Internals/CRTRunBuilder.hpp" namespace Outputs { namespace CRT { @@ -49,57 +51,6 @@ enum OutputDevice { Television }; -struct CRTInputBufferBuilder { - CRTInputBufferBuilder(unsigned int number_of_buffers, va_list buffer_sizes); - ~CRTInputBufferBuilder(); - - void allocate_write_area(size_t required_length); - void reduce_previous_allocation_to(size_t actual_length); - uint8_t *get_write_target_for_buffer(int buffer); - - // a pointer to the section of content buffer currently being - // returned and to where the next section will begin - uint16_t _next_write_x_position, _next_write_y_position; - uint16_t _write_x_position, _write_y_position; - size_t _write_target_pointer; - size_t _last_allocation_amount; - - struct Buffer { - uint8_t *data; - size_t bytes_per_pixel; - } *buffers; - unsigned int number_of_buffers; - - // Storage for the amount of buffer uploaded so far; initialised correctly by the buffer - // builder but otherwise entrusted to the CRT to update. - unsigned int last_uploaded_line; -}; - -struct CRTRunBuilder { - CRTRunBuilder(size_t vertex_size) : _vertex_size(vertex_size) { reset(); } - - // Resets the run builder. - void reset(); - - // Getter for new storage plus backing storage; in RGB mode input runs will map directly - // from the input buffer to the screen. In composite mode input runs will map from the - // input buffer to the processing buffer, and output runs will map from the processing - // buffer to the screen. - uint8_t *get_next_run(size_t number_of_vertices); - std::vector _runs; - - // Container for total length in cycles of all contained runs. - uint32_t duration; - - // Storage for the length of run data uploaded so far; reset to zero by reset but otherwise - // entrusted to the CRT to update. - size_t uploaded_vertices; - size_t number_of_vertices; - - private: - size_t _vertex_size; -}; - struct OpenGLState; class CRT { diff --git a/Outputs/CRT/CRTBuilders.cpp b/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp similarity index 62% rename from Outputs/CRT/CRTBuilders.cpp rename to Outputs/CRT/Internals/CRTInputBufferBuilder.cpp index 342e3e963..75e54ebc4 100644 --- a/Outputs/CRT/CRTBuilders.cpp +++ b/Outputs/CRT/Internals/CRTInputBufferBuilder.cpp @@ -1,21 +1,18 @@ // -// CRTFrameBuilder.cpp +// CRTInputBufferBuilder.cpp // Clock Signal // -// Created by Thomas Harte on 04/02/2016. +// Created by Thomas Harte on 08/03/2016. // Copyright © 2016 Thomas Harte. All rights reserved. // -#include "CRT.hpp" +#include "CRTInputBufferBuilder.hpp" #include "CRTOpenGL.hpp" +#include -using namespace Outputs; +using namespace Outputs::CRT; -/* - CRTInputBufferBuilder -*/ - -CRT::CRTInputBufferBuilder::CRTInputBufferBuilder(unsigned int number_of_buffers, va_list buffer_sizes) +CRTInputBufferBuilder::CRTInputBufferBuilder(unsigned int number_of_buffers, va_list buffer_sizes) { this->number_of_buffers = number_of_buffers; buffers = new CRTInputBufferBuilder::Buffer[number_of_buffers]; @@ -30,7 +27,7 @@ CRT::CRTInputBufferBuilder::CRTInputBufferBuilder(unsigned int number_of_buffers last_uploaded_line = 0; } -CRT::CRTInputBufferBuilder::~CRTInputBufferBuilder() +CRTInputBufferBuilder::~CRTInputBufferBuilder() { for(int buffer = 0; buffer < number_of_buffers; buffer++) delete[] buffers[buffer].data; @@ -38,7 +35,7 @@ CRT::CRTInputBufferBuilder::~CRTInputBufferBuilder() } -void CRT::CRTInputBufferBuilder::allocate_write_area(size_t required_length) +void CRTInputBufferBuilder::allocate_write_area(size_t required_length) { _last_allocation_amount = required_length; @@ -54,7 +51,7 @@ void CRT::CRTInputBufferBuilder::allocate_write_area(size_t required_length) _next_write_x_position += required_length + 2; } -void CRT::CRTInputBufferBuilder::reduce_previous_allocation_to(size_t actual_length) +void CRTInputBufferBuilder::reduce_previous_allocation_to(size_t actual_length) { for(int c = 0; c < number_of_buffers; c++) { @@ -70,32 +67,7 @@ void CRT::CRTInputBufferBuilder::reduce_previous_allocation_to(size_t actual_len _next_write_x_position -= (_last_allocation_amount - actual_length); } - -uint8_t *CRT::CRTInputBufferBuilder::get_write_target_for_buffer(int buffer) +uint8_t *CRTInputBufferBuilder::get_write_target_for_buffer(int buffer) { return &buffers[buffer].data[_write_target_pointer * buffers[buffer].bytes_per_pixel]; } - -/* - CRTRunBuilder -*/ -void CRT::CRTRunBuilder::reset() -{ - number_of_vertices = 0; - uploaded_vertices = 0; - duration = 0; -} - -uint8_t *CRT::CRTRunBuilder::get_next_run(size_t number_of_vertices_in_run) -{ - // get a run from the allocated list, allocating more if we're about to overrun - if((number_of_vertices + number_of_vertices_in_run) * _vertex_size >= _runs.size()) - { - _runs.resize(_runs.size() + _vertex_size * 100); - } - - uint8_t *next_run = &_runs[number_of_vertices * _vertex_size]; - number_of_vertices += number_of_vertices_in_run; - - return next_run; -} diff --git a/Outputs/CRT/Internals/CRTInputBufferBuilder.hpp b/Outputs/CRT/Internals/CRTInputBufferBuilder.hpp new file mode 100644 index 000000000..738c02a9b --- /dev/null +++ b/Outputs/CRT/Internals/CRTInputBufferBuilder.hpp @@ -0,0 +1,48 @@ +// +// CRTInputBufferBuilder.hpp +// Clock Signal +// +// Created by Thomas Harte on 08/03/2016. +// Copyright © 2016 Thomas Harte. All rights reserved. +// + +#ifndef CRTInputBufferBuilder_hpp +#define CRTInputBufferBuilder_hpp + +#include +#include +#include + +namespace Outputs { +namespace CRT { + +struct CRTInputBufferBuilder { + CRTInputBufferBuilder(unsigned int number_of_buffers, va_list buffer_sizes); + ~CRTInputBufferBuilder(); + + void allocate_write_area(size_t required_length); + void reduce_previous_allocation_to(size_t actual_length); + uint8_t *get_write_target_for_buffer(int buffer); + + // a pointer to the section of content buffer currently being + // returned and to where the next section will begin + uint16_t _next_write_x_position, _next_write_y_position; + uint16_t _write_x_position, _write_y_position; + size_t _write_target_pointer; + size_t _last_allocation_amount; + + struct Buffer { + uint8_t *data; + size_t bytes_per_pixel; + } *buffers; + unsigned int number_of_buffers; + + // Storage for the amount of buffer uploaded so far; initialised correctly by the buffer + // builder but otherwise entrusted to the CRT to update. + unsigned int last_uploaded_line; +}; + +} +} + +#endif /* CRTInputBufferBuilder_hpp */ diff --git a/Outputs/CRT/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp similarity index 100% rename from Outputs/CRT/CRTOpenGL.cpp rename to Outputs/CRT/Internals/CRTOpenGL.cpp diff --git a/Outputs/CRT/CRTOpenGL.hpp b/Outputs/CRT/Internals/CRTOpenGL.hpp similarity index 100% rename from Outputs/CRT/CRTOpenGL.hpp rename to Outputs/CRT/Internals/CRTOpenGL.hpp diff --git a/Outputs/CRT/Internals/CRTRunBuilder.cpp b/Outputs/CRT/Internals/CRTRunBuilder.cpp new file mode 100644 index 000000000..b67356eb3 --- /dev/null +++ b/Outputs/CRT/Internals/CRTRunBuilder.cpp @@ -0,0 +1,33 @@ +// +// CRTFrameBuilder.cpp +// Clock Signal +// +// Created by Thomas Harte on 04/02/2016. +// Copyright © 2016 Thomas Harte. All rights reserved. +// + +#include "CRT.hpp" +#include "CRTOpenGL.hpp" + +using namespace Outputs::CRT; + +void CRTRunBuilder::reset() +{ + number_of_vertices = 0; + uploaded_vertices = 0; + duration = 0; +} + +uint8_t *CRTRunBuilder::get_next_run(size_t number_of_vertices_in_run) +{ + // get a run from the allocated list, allocating more if we're about to overrun + if((number_of_vertices + number_of_vertices_in_run) * _vertex_size >= _runs.size()) + { + _runs.resize(_runs.size() + _vertex_size * 100); + } + + uint8_t *next_run = &_runs[number_of_vertices * _vertex_size]; + number_of_vertices += number_of_vertices_in_run; + + return next_run; +} diff --git a/Outputs/CRT/Internals/CRTRunBuilder.hpp b/Outputs/CRT/Internals/CRTRunBuilder.hpp new file mode 100644 index 000000000..ad67b2689 --- /dev/null +++ b/Outputs/CRT/Internals/CRTRunBuilder.hpp @@ -0,0 +1,43 @@ +// +// CRTRunBuilder.h +// Clock Signal +// +// Created by Thomas Harte on 08/03/2016. +// Copyright © 2016 Thomas Harte. All rights reserved. +// + +#ifndef CRTRunBuilder_h +#define CRTRunBuilder_h + +namespace Outputs { +namespace CRT { + +struct CRTRunBuilder { + CRTRunBuilder(size_t vertex_size) : _vertex_size(vertex_size) { reset(); } + + // Resets the run builder. + void reset(); + + // Getter for new storage plus backing storage; in RGB mode input runs will map directly + // from the input buffer to the screen. In composite mode input runs will map from the + // input buffer to the processing buffer, and output runs will map from the processing + // buffer to the screen. + uint8_t *get_next_run(size_t number_of_vertices); + std::vector _runs; + + // Container for total length in cycles of all contained runs. + uint32_t duration; + + // Storage for the length of run data uploaded so far; reset to zero by reset but otherwise + // entrusted to the CRT to update. + size_t uploaded_vertices; + size_t number_of_vertices; + + private: + size_t _vertex_size; +}; + +} +} + +#endif /* CRTRunBuilder_h */ diff --git a/Outputs/CRT/Flywheel.hpp b/Outputs/CRT/Internals/Flywheel.hpp similarity index 100% rename from Outputs/CRT/Flywheel.hpp rename to Outputs/CRT/Internals/Flywheel.hpp diff --git a/Outputs/CRT/OpenGL.hpp b/Outputs/CRT/Internals/OpenGL.hpp similarity index 100% rename from Outputs/CRT/OpenGL.hpp rename to Outputs/CRT/Internals/OpenGL.hpp diff --git a/Outputs/CRT/Shader.cpp b/Outputs/CRT/Internals/Shader.cpp similarity index 100% rename from Outputs/CRT/Shader.cpp rename to Outputs/CRT/Internals/Shader.cpp diff --git a/Outputs/CRT/Shader.hpp b/Outputs/CRT/Internals/Shader.hpp similarity index 100% rename from Outputs/CRT/Shader.hpp rename to Outputs/CRT/Internals/Shader.hpp diff --git a/Outputs/CRT/TextureTarget.cpp b/Outputs/CRT/Internals/TextureTarget.cpp similarity index 100% rename from Outputs/CRT/TextureTarget.cpp rename to Outputs/CRT/Internals/TextureTarget.cpp diff --git a/Outputs/CRT/TextureTarget.hpp b/Outputs/CRT/Internals/TextureTarget.hpp similarity index 100% rename from Outputs/CRT/TextureTarget.hpp rename to Outputs/CRT/Internals/TextureTarget.hpp