mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Minor cleaning.
This commit is contained in:
parent
b769f22ca0
commit
144d6b70d9
@ -176,15 +176,6 @@ void TIA::set_output_mode(Atari2600::TIA::OutputMode output_mode)
|
||||
/* speaker_->set_input_rate((float)(get_clock_rate() / 38.0));*/
|
||||
}
|
||||
|
||||
TIA::~TIA()
|
||||
{
|
||||
}
|
||||
|
||||
// justification for +5: "we need to wait at least 71 [clocks] before the HMOVE operation is complete";
|
||||
// which will take 16*4 + 2 = 66 cycles from the first compare, implying the first compare must be
|
||||
// in five cycles from now
|
||||
|
||||
|
||||
void TIA::run_for_cycles(int number_of_cycles)
|
||||
{
|
||||
// if part way through a line, definitely perform a partial, at most up to the end of the line
|
||||
@ -457,11 +448,11 @@ void TIA::output_for_cycles(int number_of_cycles)
|
||||
int latent_start = output_cursor + 4;
|
||||
int latent_end = horizontal_counter_ + 4;
|
||||
draw_playfield(latent_start, latent_end);
|
||||
draw_player(player_[0], CollisionType::Player0, output_cursor, horizontal_counter_);
|
||||
draw_player(player_[1], CollisionType::Player1, output_cursor, horizontal_counter_);
|
||||
draw_missile(missile_[0], CollisionType::Missile0, output_cursor, horizontal_counter_);
|
||||
draw_missile(missile_[1], CollisionType::Missile1, output_cursor, horizontal_counter_);
|
||||
draw_ball(output_cursor, horizontal_counter_);
|
||||
draw_object<Player>(player_[0], (uint8_t)CollisionType::Player0, output_cursor, horizontal_counter_);
|
||||
draw_object<Player>(player_[1], (uint8_t)CollisionType::Player1, output_cursor, horizontal_counter_);
|
||||
draw_object<Missile>(missile_[0], (uint8_t)CollisionType::Missile0, output_cursor, horizontal_counter_);
|
||||
draw_object<Missile>(missile_[1], (uint8_t)CollisionType::Missile1, output_cursor, horizontal_counter_);
|
||||
draw_object<Ball>(ball_, (uint8_t)CollisionType::Ball, output_cursor, horizontal_counter_);
|
||||
|
||||
// convert to television signals
|
||||
|
||||
@ -746,20 +737,3 @@ template<class T> void TIA::draw_object_visible(T &object, const uint8_t collisi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Player output
|
||||
|
||||
void TIA::draw_player(Player &player, CollisionType collision_identity, int start, int end)
|
||||
{
|
||||
draw_object<Player>(player, (uint8_t)collision_identity, start, end);
|
||||
}
|
||||
|
||||
void TIA::draw_missile(Missile &missile, CollisionType collision_identity, int start, int end)
|
||||
{
|
||||
draw_object<Missile>(missile, (uint8_t)collision_identity, start, end);
|
||||
}
|
||||
|
||||
void TIA::draw_ball(int start, int end)
|
||||
{
|
||||
draw_object<Ball>(ball_, (uint8_t)CollisionType::Ball, start, end);
|
||||
}
|
||||
|
@ -17,13 +17,10 @@ namespace Atari2600 {
|
||||
class TIA {
|
||||
public:
|
||||
TIA();
|
||||
~TIA();
|
||||
|
||||
// The supplied hook is for unit testing only; if instantiated with a line_end_function then it will
|
||||
// be called with the latest collision buffer upon the conclusion of each line. What's a collision
|
||||
// buffer? It's an implementation detail. If you're not writing a unit test, leave it alone.
|
||||
TIA(std::function<void(uint8_t *output_buffer)> line_end_function);
|
||||
TIA(bool create_crt);
|
||||
|
||||
enum class OutputMode {
|
||||
NTSC, PAL
|
||||
@ -79,6 +76,7 @@ class TIA {
|
||||
virtual std::shared_ptr<Outputs::CRT::CRT> get_crt() { return crt_; }
|
||||
|
||||
private:
|
||||
TIA(bool create_crt);
|
||||
std::shared_ptr<Outputs::CRT::CRT> crt_;
|
||||
std::function<void(uint8_t *output_buffer)> line_end_function_;
|
||||
|
||||
@ -275,15 +273,11 @@ class TIA {
|
||||
// drawing methods and state
|
||||
template<class T> void draw_object(T &, const uint8_t collision_identity, int start, int end);
|
||||
template<class T> void draw_object_visible(T &, const uint8_t collision_identity, int start, int end);
|
||||
inline void draw_playfield(int start, int end);
|
||||
|
||||
inline void output_for_cycles(int number_of_cycles);
|
||||
inline void output_line();
|
||||
|
||||
inline void draw_playfield(int start, int end);
|
||||
inline void draw_player(Player &player, CollisionType collision_identity, int start, int end);
|
||||
inline void draw_missile(Missile &missile, CollisionType collision_identity, int start, int end);
|
||||
inline void draw_ball(int start, int end);
|
||||
|
||||
int pixels_start_location_;
|
||||
uint8_t *pixel_target_;
|
||||
inline void output_pixels(int start, int end);
|
||||
|
Loading…
x
Reference in New Issue
Block a user