From cab0bdbe42fc2c13159fe0b7149d1e8ae58bec10 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Fri, 12 Oct 2018 17:19:03 +0200 Subject: [PATCH] Fix light gun y position in VGA mode --- core/hw/pvr/spg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hw/pvr/spg.cpp b/core/hw/pvr/spg.cpp index ed02c0a0e..0cf4c4d0b 100755 --- a/core/hw/pvr/spg.cpp +++ b/core/hw/pvr/spg.cpp @@ -244,7 +244,7 @@ void read_lightgun_position(int x, int y) lightgun_line = 0xffff; else { - lightgun_line = y / 2 + SPG_VBLANK_INT.vblank_out_interrupt_line_number; + lightgun_line = y / (SPG_CONTROL.interlace ? 2 : 1) + SPG_VBLANK_INT.vblank_out_interrupt_line_number; lightgun_hpos = x * (SPG_HBLANK.hstart - SPG_HBLANK.hbend) / 640 + SPG_HBLANK.hbend * 2; // Ok but why *2 ???? lightgun_hpos = min((u32)0x3FF, lightgun_hpos); }