Fix the Justifier

This commit is contained in:
Rupert Carmichael 2021-12-13 11:33:40 -05:00 committed by Screwtapello
parent 43e42b2dca
commit c0c60c83a8
1 changed files with 2 additions and 5 deletions

View File

@ -90,9 +90,7 @@ auto Justifier::latch(bool data) -> void {
} }
auto Justifier::latch() -> void { auto Justifier::latch() -> void {
/* active value is inverted here ... */ if(!active) {
if(active != 0) {
int nx = platform->inputPoll(port, device, 0 + X); int nx = platform->inputPoll(port, device, 0 + X);
int ny = platform->inputPoll(port, device, 0 + Y); int ny = platform->inputPoll(port, device, 0 + Y);
player1.x = max(-16, min(256 + 16, nx + player1.x)); player1.x = max(-16, min(256 + 16, nx + player1.x));
@ -100,8 +98,7 @@ auto Justifier::latch() -> void {
bool offscreen = (player1.x < 0 || player1.y < 0 || player1.x >= 256 || player1.y >= (int)ppu.vdisp()); bool offscreen = (player1.x < 0 || player1.y < 0 || player1.x >= 256 || player1.y >= (int)ppu.vdisp());
if(!offscreen) ppu.latchCounters(player1.x, player1.y); if(!offscreen) ppu.latchCounters(player1.x, player1.y);
} }
else {
if(active != 1) {
int nx = platform->inputPoll(port, device, 4 + X); int nx = platform->inputPoll(port, device, 4 + X);
int ny = platform->inputPoll(port, device, 4 + Y); int ny = platform->inputPoll(port, device, 4 + Y);
player2.x = max(-16, min(256 + 16, nx + player2.x)); player2.x = max(-16, min(256 + 16, nx + player2.x));