From 6381e4e1b041c3e93a5f52eb59e16b1acfca73f7 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 11 Feb 2017 13:34:36 -0500 Subject: [PATCH] All that's happened to position is that numbers have been added to it. So it can't be negative, given that it wasn't before. So a regular modulo will do. --- Machines/Atari2600/TIA.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/Atari2600/TIA.cpp b/Machines/Atari2600/TIA.cpp index b46ccbc29..e545e279d 100644 --- a/Machines/Atari2600/TIA.cpp +++ b/Machines/Atari2600/TIA.cpp @@ -595,7 +595,7 @@ void TIA::draw_player(Player &player, CollisionType collision_identity, const in { position += (motion ^ 8); is_moving_[position_identity] = false; - position = (position + 160)%160; + position %= 160; } // check for initial trigger; player.position is guaranteed to be less than 160 so this is easy