diff --git a/Machines/Atari2600/TIA.cpp b/Machines/Atari2600/TIA.cpp new file mode 100644 index 000000000..bac602803 --- /dev/null +++ b/Machines/Atari2600/TIA.cpp @@ -0,0 +1,9 @@ +// +// TIA.cpp +// Clock Signal +// +// Created by Thomas Harte on 28/01/2017. +// Copyright © 2017 Thomas Harte. All rights reserved. +// + +#include "TIA.hpp" diff --git a/Machines/Atari2600/TIA.hpp b/Machines/Atari2600/TIA.hpp new file mode 100644 index 000000000..24d3376ad --- /dev/null +++ b/Machines/Atari2600/TIA.hpp @@ -0,0 +1,58 @@ +// +// TIA.hpp +// Clock Signal +// +// Created by Thomas Harte on 28/01/2017. +// Copyright © 2017 Thomas Harte. All rights reserved. +// + +#ifndef TIA_hpp +#define TIA_hpp + +#include + +namespace Atari2600 { + +class TIA { + public: + void run_for_cycles(int number_of_cycles); + + void set_vsync(bool vsync); + void set_vblank(bool vblank); + void reset_horizontal_counter(); + int get_cycles_until_horizontal_blank(); + + void set_background_colour(uint8_t colour); + + void set_playfield(uint16_t offset, uint8_t value); + void set_playfield_control_and_ball_size(uint8_t value); + void set_playfield_ball_colour(uint8_t colour); + + void set_player_number_and_size(int player, uint8_t value); + void set_player_graphic(int player, uint8_t value); + void set_player_reflected(int player, bool reflected); + void set_player_delay(int player, bool delay); + void set_player_position(int player); + void set_player_motion(int player, uint8_t motion); + void set_player_missile_colour(int player, uint8_t colour); + + void set_missile_enable(int missile, bool enabled); + void set_missile_position(int missile); + void set_missile_position_to_player(int missile); + void set_missile_motion(int missile, uint8_t motion); + + void set_ball_enable(bool enabled); + void set_ball_delay(bool delay); + void set_ball_position(); + void set_ball_motion(uint8_t motion); + + void move(); + void clear_motion(); + + uint8_t get_collision_flags(int offset); + void clear_collision_flags(); +}; + +} + +#endif /* TIA_hpp */ diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 18332f71c..08c8373f8 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -396,6 +396,7 @@ 4BD5F1951D13528900631CD1 /* CSBestEffortUpdater.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD5F1941D13528900631CD1 /* CSBestEffortUpdater.m */; }; 4BD69F941D98760000243FE1 /* AcornADF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BD69F921D98760000243FE1 /* AcornADF.cpp */; }; 4BE77A2E1D84ADFB00BC3827 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE77A2C1D84ADFB00BC3827 /* File.cpp */; }; + 4BE7C9181E3D397100A5496D /* TIA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BE7C9161E3D397100A5496D /* TIA.cpp */; }; 4BEA525E1DF33323007E74F2 /* Tape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BEA525D1DF33323007E74F2 /* Tape.cpp */; }; 4BEA52631DF339D7007E74F2 /* Speaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BEA52611DF339D7007E74F2 /* Speaker.cpp */; }; 4BEA52661DF3472B007E74F2 /* Speaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BEA52641DF3472B007E74F2 /* Speaker.cpp */; }; @@ -923,6 +924,8 @@ 4BD69F931D98760000243FE1 /* AcornADF.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AcornADF.hpp; sourceTree = ""; }; 4BE77A2C1D84ADFB00BC3827 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = File.cpp; path = ../../StaticAnalyser/Commodore/File.cpp; sourceTree = ""; }; 4BE77A2D1D84ADFB00BC3827 /* File.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = File.hpp; path = ../../StaticAnalyser/Commodore/File.hpp; sourceTree = ""; }; + 4BE7C9161E3D397100A5496D /* TIA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TIA.cpp; sourceTree = ""; }; + 4BE7C9171E3D397100A5496D /* TIA.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TIA.hpp; sourceTree = ""; }; 4BEA525D1DF33323007E74F2 /* Tape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tape.cpp; path = Electron/Tape.cpp; sourceTree = ""; }; 4BEA525F1DF333D8007E74F2 /* Tape.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = Tape.hpp; path = Electron/Tape.hpp; sourceTree = ""; }; 4BEA52601DF3343A007E74F2 /* Interrupts.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = Interrupts.hpp; path = Electron/Interrupts.hpp; sourceTree = ""; }; @@ -1094,10 +1097,12 @@ children = ( 4B2E2D971C3A06EC00138695 /* Atari2600.cpp */, 4BEA52641DF3472B007E74F2 /* Speaker.cpp */, + 4BE7C9161E3D397100A5496D /* TIA.cpp */, 4B2E2D991C3A06EC00138695 /* Atari2600Inputs.h */, 4B2E2D981C3A06EC00138695 /* Atari2600.hpp */, - 4BEA52651DF3472B007E74F2 /* Speaker.hpp */, 4BEA52671DF34909007E74F2 /* PIA.hpp */, + 4BEA52651DF3472B007E74F2 /* Speaker.hpp */, + 4BE7C9171E3D397100A5496D /* TIA.hpp */, ); path = Atari2600; sourceTree = ""; @@ -2434,6 +2439,7 @@ 4B643F3A1D77AD1900D431D6 /* CSStaticAnalyser.mm in Sources */, 4B4DC8281D2C2470003C5BF8 /* C1540.cpp in Sources */, 4B5A12571DD55862007A2231 /* Disassembler6502.cpp in Sources */, + 4BE7C9181E3D397100A5496D /* TIA.cpp in Sources */, 4B1E85751D170228001EF87D /* Typer.cpp in Sources */, 4BF829631D8F536B001BAE39 /* SSD.cpp in Sources */, 4B2E2D9D1C3A070400138695 /* Electron.cpp in Sources */,