Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

le2: inputs sent in wrong order? #1592

Closed
StormedBubbles opened this issue May 27, 2023 · 41 comments
Closed

le2: inputs sent in wrong order? #1592

StormedBubbles opened this issue May 27, 2023 · 41 comments

Comments

@StormedBubbles
Copy link

Anecdotally, something seemed a touch off with Lethal Enforcers II (le2) to me when using a lightgun-like device (Sinden Lightgun, in my case). Using the RetroArch pause feature finally allowed me to see what the issue was. I used a trackball to test this to ensure I wasn't accidentally moving the gun crosshairs.

By enabling the crosshairs, pausing the emulation with hotkey+P, moving the trackball a bit, letting go of the trackball, and then holding the trigger button and advancing the emulation frame by frame using hotkey+K, I found that the white flash occurs before the cursor moves. This results in the shot not being aligned with the cursor position even though the cursor was moved first. The shots normally line up exactly with the center of the cursor (i.e., when the cursor is stationary).

In contrast, I tested Area 51 and Crypt Killer and found that the cursor moves before the flash occurs, and the resulting shot lines up correctly.

I hope I have articulated this well enough. I can provide more information if need be. The anecdotal experience was difficulty hitting targets on opposite sides of the screen in rapid succession. The second shot always seemed closer to the center of the screen than it should have been.

@mahoneyt944
Copy link
Collaborator

If I'm understanding what you're saying, the cursor is drawn in the new location but the shot is a frame behind at the old location?

@mahoneyt944
Copy link
Collaborator

I captured a pic of this by holding the dpad and firing then pausing mid movement. I can't see why this happens, but the shot seems to lag behind the crosshairs.
le2-230527-102808

@StormedBubbles
Copy link
Author

Thanks for the screen shot. Yes, to the naked eye, it does appear that the shot location lags behind the crosshair's location. However, I think in terms of what the emulator sees, it's the other way around: the trigger input is activated too early.

The crosshair moved with the same amount of input lag for me in all three of the games I mentioned. If I'm looking at it right, there's 1 frame of input lag for the cursor for me in all three games.

Only in le2 did the trigger input get activated even earlier than that. In Area 51 and Crypt Killer, the cursor was allowed to take the 2 frames to get from point A to point B before the trigger was registered, so the shot appeared at point B. In le2, the trigger input was registered while the cursor was in the midst of moving from point A to point B, so the shot appeared at point C in between them.

@mahoneyt944
Copy link
Collaborator

The way our crosshairs work in this core, we draw the game screen then draw the crosshair on top of it each frame. I think what's happening is the games "bullet splatter" animation is taking longer to draw than how fast we draw the crosshairs. Mind you natively the game doesn't draw crosshairs, so you probably wouldn't notice on a real machine.

I'm curious to see if the shot actually lands at the splatter point or where are crosshairs are.

@mahoneyt944
Copy link
Collaborator

mahoneyt944 commented May 27, 2023

If you use the service buttons to enter the gun check service menu, it seems like this is the case as my crosshair passes a grid line, the bullet point is dead on, but the flash or splatter lags the shot. Also our inputs are polled by the emulated machine so timing between games can vary, which isn't a bug just how responsive those machines are.
le2-230527-113758
le2-230527-113839

@StormedBubbles
Copy link
Author

Oh wow interesting. I hadn't thought of that. I will take a look at the service menu later today with my setup and see if the frame-by-frame test produces a different result from what I got in game.

@MistyDreams
Copy link
Contributor

MistyDreams commented May 27, 2023

The way our crosshairs work in this core, we draw the game screen then draw the crosshair on top of it each frame. I think what's happening is the games "bullet splatter" animation is taking longer to draw than how fast we draw the crosshairs.

thats not quite true the crosshair drawn in an if condition in the video update code instead of unconditionally in this case.

@mahoneyt944
Copy link
Collaborator

The way our crosshairs work in this core, we draw the game screen then draw the crosshair on top of it each frame. I think what's happening is the games "bullet splatter" animation is taking longer to draw than how fast we draw the crosshairs.

thats not quite true the crosshair drawn in an if condition in the video update code instead of unconditionally in this case.

Yes but the if condition is always true for le2.

@MistyDreams
Copy link
Contributor

Perhaps it some backport missing some code seems an odd variable name just to enable a lightgun crosshair as it has no other function.

@mahoneyt944
Copy link
Collaborator

Yeah definitely odd naming, not sure why it's that way. Probably should update it to something more simple but it's functional non the less.

Btw not sure if you've been looking at #1587, but maybe you'd be willing to look into why radr starts up to a network check screen? It requires you to hit a service button to skip it to actually get to the game. Likely a dip switch, or read/write handler but haven't found it.

@MistyDreams
Copy link
Contributor

MistyDreams commented May 27, 2023

havent looked at radr at all but what i will say is the code here.

static READ32_HANDLER( le2_gun_H_r )
{
int p1x = readinputport(9)*290/0xff+20;
int p2x = readinputport(11)*290/0xff+20;
/* make "off the left" reload too */
if (p1x <= 0x15) p1x = 310;
if (p2x <= 0x15) p2x = 310;
return (p1x<<16)|p2x;
}
static READ32_HANDLER( le2_gun_V_r )
{
int p1y = readinputport(10)*224/0xff;
int p2y = readinputport(12)*224/0xff;
/* make "off the bottom" reload too */
if (p1y >= 0xdf) p1y = 0;
if (p2y >= 0xdf) p2y = 0;
return (p1y<<16)|p2y;
}

use these variables for the crosshair draw instead of reading the port directly it could have moved since the last read compared to render time that way youll be in sync with what the game is looking at.

@mahoneyt944
Copy link
Collaborator

I noticed they are slightly different from the reads to the crosshair draw, I think there's some minor scaling going on when we draw the crosshairs to make it where the game thinks it is. It's really accurate in the test menu, always within a pixel.

@MistyDreams
Copy link
Contributor

MistyDreams commented May 27, 2023

you can add another variable just needs to read at the same time so they are in sync for game and drawing cross hairs. Your basically drawing at the cross hair coords at rendered time rather than when the game last read the poll.

@mahoneyt944
Copy link
Collaborator

Can they actually be different? These are read once a frame and we only poll inputs once a frame. So I'd assume they would be the same inside the same frame?

@MistyDreams
Copy link
Contributor

yeap mame goes through a loop you shouldnt be manually polling something in a different pace than the mame main loop does.

@mahoneyt944
Copy link
Collaborator

Isn't video update apart of the mame loop? What you're saying doesn't make sense to me, if we are in a certain frame, the game should readinputport, and then video update will readinputport later in the same frame. Mame_frame has to finish before the next loop occurs where the inputs are polled again and the process repeats again and again.

What I think you are saying is readinputport can return different values within the same frame, which I don't believe it can? Though I've never specifically tested such things, so I could be wrong.

@mahoneyt944
Copy link
Collaborator

mahoneyt944 commented May 27, 2023

For reference: we poll then run mame_frame last. So I can't see how readinputport could return differently in the same frame.

void retro_run (void)
{
bool updated = false;
poll_cb(); /* execute input callback */
if (retro_running == 0) /* first time through the loop */
{
retro_running = 1;
log_cb(RETRO_LOG_DEBUG, LOGPRE "Entering retro_run() for the first time.\n");
}
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
update_variables(false);
if (options.cpu_clock_scale)
{
if (cpunum_get_clockscale(0) != options.cpu_clock_scale)
{
log_cb(RETRO_LOG_DEBUG, LOGPRE "changing cpu clock scale from %lf to %lf\n",cpunum_get_clockscale(0),options.cpu_clock_scale);
cpunum_set_clockscale(0, options.cpu_clock_scale);
}
}
mame_frame();
}

@MistyDreams
Copy link
Contributor

MistyDreams commented May 27, 2023

ok this is my last post on this every post with ends up in you disagreeing do you it all the time.

  1. if the game doesnt read the input port the display will still do it manually .
  2. do a simple compare.
+int testh;
+int testv;
 static READ32_HANDLER( le2_gun_H_r )
 {
+       
+       testh = readinputport(9);
        int p1x = readinputport(9)*290/0xff+20;
        int p2x = readinputport(11)*290/0xff+20;
-
        /* make "off the left" reload too */
        if (p1x <= 0x15) p1x = 310;
        if (p2x <= 0x15) p2x = 310;
@@ -919,6 +921,7 @@ static READ32_HANDLER( le2_gun_H_r )
 
 static READ32_HANDLER( le2_gun_V_r )
 {
+       testv = readinputport(10);
        int p1y = readinputport(10)*224/0xff;
        int p2y = readinputport(12)*224/0xff;
 
diff --git a/src/vidhrdw/konamigx_vidhrdw.c b/src/vidhrdw/konamigx_vidhrdw.c
index ea2a1f4f..63a2cf5a 100644
--- a/src/vidhrdw/konamigx_vidhrdw.c
+++ b/src/vidhrdw/konamigx_vidhrdw.c
@@ -428,6 +428,8 @@ VIDEO_START(racinfrc)
 
        return 0;
 }
+extern int testh; 
+extern int testv; 
 
 VIDEO_UPDATE(konamigx)
 {
@@ -460,7 +462,7 @@ VIDEO_UPDATE(konamigx)
        }
        else
        {
-               /* K056832 does all the tracking in mode 1 for accuracy (Twinbee needs this)*/
+
        }
 
        /* sub2 is PSAC colorbase on GX*/
@@ -488,6 +490,7 @@ VIDEO_UPDATE(konamigx)
 
        if( gx_invertlayersBC )
        {
+               if(testh !=readinputport(9) || testv !=readinputport(10))  printf("p1h:(%d %d) p1v:(%d %d)\n",testh,readinputport(9), testv,readinputport(10) );
                draw_crosshair( 1, bitmap, readinputport( 9)*287/0xff+24, readinputport(10)*223/0xff+16, cliprect );
                draw_crosshair( 2, bitmap, readinputport(11)*287/0xff+24, readinputport(12)*223/0xff+16, cliprect );
        }
1h:(0 134) p1v:(0 123)
p1h:(0 140) p1v:(0 115)
p1h:(0 155) p1v:(0 94)
p1h:(0 162) p1v:(0 83)
p1h:(0 168) p1v:(0 72)
p1h:(0 174) p1v:(0 64)
p1h:(0 179) p1v:(0 58)
p1h:(0 190) p1v:(0 44)
p1h:(0 190) p1v:(0 44)
p1h:(0 190) p1v:(0 44)
p1h:(0 197) p1v:(0 35)
p1h:(0 201) p1v:(0 32)
p1h:(0 203) p1v:(0 30)
p1h:(0 206) p1v:(0 28)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 207) p1v:(0 27)
p1h:(0 206) p1v:(0 28)
p1h:(0 206) p1v:(0 28)
p1h:(0 206) p1v:(0 28)
p1h:(0 204) p1v:(0 32)
p1h:(0 200) p1v:(0 36)
p1h:(0 190) p1v:(0 51)
p1h:(0 187) p1v:(0 57)
p1h:(0 180) p1v:(0 75)
p1h:(0 178) p1v:(0 78)
p1h:(0 177) p1v:(0 80)
p1h:(0 176) p1v:(0 82)
p1h:(0 175) p1v:(0 84)
p1h:(0 175) p1v:(0 86)
p1h:(0 175) p1v:(0 86)
p1h:(0 175) p1v:(0 90)
p1h:(0 175) p1v:(0 91)
p1h:(0 175) p1v:(0 92)
p1h:(0 174) p1v:(0 92)
p1h:(0 174) p1v:(0 93)
p1h:(0 174) p1v:(0 93)
p1h:(0 174) p1v:(0 94)
p1h:(0 174) p1v:(0 94)
p1h:(0 174) p1v:(0 94)
p1h:(0 174) p1v:(0 94)
p1h:(0 175) p1v:(0 94)
p1h:(0 177) p1v:(0 92)
p1h:(0 179) p1v:(0 91)
p1h:(0 179) p1v:(0 91)
p1h:(0 180) p1v:(0 89)
p1h:(0 181) p1v:(0 88)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 182) p1v:(0 87)
p1h:(0 181) p1v:(0 84)
p1h:(0 180) p1v:(0 83)
p1h:(0 180) p1v:(0 80)
p1h:(0 177) p1v:(0 72)
p1h:(0 177) p1v:(0 69)
p1h:(0 177) p1v:(0 68)
p1h:(0 177) p1v:(0 67)
p1h:(0 177) p1v:(0 67)
p1h:(0 177) p1v:(0 67)
p1h:(0 177) p1v:(0 67)
p1h:(0 177) p1v:(0 67)
p1h:(0 176) p1v:(0 63)
p1h:(0 175) p1v:(0 63)
p1h:(0 174) p1v:(0 59)
p1h:(0 173) p1v:(0 57)
p1h:(0 171) p1v:(0 55)
p1h:(0 170) p1v:(0 54)
p1h:(0 169) p1v:(0 54)
p1h:(0 169) p1v:(0 54)
p1h:(0 169) p1v:(0 54)
p1h:(0 169) p1v:(0 54)
p1h:(0 169) p1v:(0 54)
p1h:(0 169) p1v:(0 54)
p1h:(0 169) p1v:(0 55)
p1h:(0 169) p1v:(0 55)
p1h:(0 169) p1v:(0 55)
p1h:(0 169) p1v:(0 55)
p1h:(0 169) p1v:(0 55)
p1h:(0 169) p1v:(0 58)
p1h:(0 169) p1v:(0 58)
p1h:(0 169) p1v:(0 58)
p1h:(0 169) p1v:(0 59)
p1h:(0 169) p1v:(0 59)
p1h:(0 168) p1v:(0 60)
p1h:(0 168) p1v:(0 61)
p1h:(0 168) p1v:(0 61)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 168) p1v:(0 66)
p1h:(0 172) p1v:(0 63)
p1h:(0 172) p1v:(0 63)
p1h:(0 172) p1v:(0 63)
p1h:(0 172) p1v:(0 63)
p1h:(0 173) p1v:(0 60)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 173) p1v:(0 59)
p1h:(0 169) p1v:(0 62)
p1h:(0 169) p1v:(0 62)
p1h:(0 165) p1v:(0 66)
p1h:(0 165) p1v:(0 66)
p1h:(0 165) p1v:(0 66)
p1h:(0 157) p1v:(0 77)
p1h:(0 153) p1v:(0 85)
p1h:(0 147) p1v:(0 95)
p1h:(0 138) p1v:(0 111)
p1h:(0 135) p1v:(0 118)
p1h:(0 134) p1v:(0 123)
p1h:(0 133) p1v:(0 128)
p1h:(0 134) p1v:(0 134)
p1h:(0 134) p1v:(0 134)
p1h:(0 140) p1v:(0 144)
p1h:(0 148) p1v:(0 152)
p1h:(0 152) p1v:(0 155)
p1h:(0 156) p1v:(0 156)
p1h:(0 159) p1v:(0 156)
p1h:(0 170) p1v:(0 151)
p1h:(0 170) p1v:(0 151)
p1h:(0 170) p1v:(0 151)
p1h:(0 179) p1v:(0 141)
p1h:(0 187) p1v:(0 131)
p1h:(0 195) p1v:(0 118)
p1h:(0 198) p1v:(0 111)
p1h:(0 200) p1v:(0 106)
p1h:(0 204) p1v:(0 93)
p1h:(0 204) p1v:(0 93)
p1h:(0 204) p1v:(0 93)
p1h:(0 204) p1v:(0 93)
p1h:(0 204) p1v:(0 93)
p1h:(0 201) p1v:(0 90)
p1h:(0 201) p1v:(0 90)
p1h:(0 199) p1v:(0 89)
p1h:(0 198) p1v:(0 88)
p1h:(0 196) p1v:(0 88)
p1h:(0 193) p1v:(0 88)
p1h:(0 187) p1v:(0 88)
p1h:(0 182) p1v:(0 89)
p1h:(0 177) p1v:(0 93)
p1h:(0 173) p1v:(0 97)
p1h:(0 168) p1v:(0 103)
p1h:(0 164) p1v:(0 109)
p1h:(0 164) p1v:(0 109)
p1h:(0 162) p1v:(0 113)
p1h:(0 160) p1v:(0 117)
p1h:(0 160) p1v:(0 117)
p1h:(0 160) p1v:(0 117)
p1h:(0 161) p1v:(0 121)
p1h:(0 162) p1v:(0 124)
p1h:(0 170) p1v:(0 130)
p1h:(0 175) p1v:(0 131)
p1h:(0 175) p1v:(0 131)
p1h:(0 175) p1v:(0 131)
p1h:(0 179) p1v:(0 129)
p1h:(0 183) p1v:(0 125)
p1h:(0 187) p1v:(0 119)
p1h:(0 187) p1v:(0 119)
p1h:(0 187) p1v:(0 119)
p1h:(0 189) p1v:(0 112)
p1h:(0 189) p1v:(0 112)
p1h:(0 189) p1v:(0 112)
p1h:(0 189) p1v:(0 112)
p1h:(0 189) p1v:(0 112)
p1h:(0 189) p1v:(0 110)
p1h:(0 189) p1v:(0 110)
p1h:(0 189) p1v:(0 110)
p1h:(0 188) p1v:(0 110)
p1h:(0 186) p1v:(0 110)
p1h:(0 186) p1v:(0 110)
p1h:(0 185) p1v:(0 110)
p1h:(0 184) p1v:(0 110)
p1h:(0 184) p1v:(0 110)
p1h:(0 184) p1v:(0 110)
p1h:(0 184) p1v:(0 110)
p1h:(0 184) p1v:(0 110)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
p1h:(0 182) p1v:(0 115)
[libretro INFO] [MAME 2003+] loading le2.hi hiscore memory file...
p1h:(161 160) p1v:(109 109)
p1h:(148 147) p1v:(91 90)
p1h:(130 130) p1v:(71 70)
p1h:(113 112) p1v:(62 62)
p1h:(99 98) p1v:(65 66)
p1h:(88 87) p1v:(87 88)
p1h:(85 85) p1v:(97 98)
p1h:(85 85) p1v:(112 113)
p1h:(93 94) p1v:(116 116)
p1h:(111 112) p1v:(108 108)
p1h:(123 123) p1v:(102 101)
p1h:(135 136) p1v:(95 94)
p1h:(172 173) p1v:(70 69)
p1h:(203 204) p1v:(43 42)
p1h:(217 217) p1v:(26 25)
p1h:(223 223) p1v:(16 15)
p1h:(198 197) p1v:(13 13)
p1h:(185 184) p1v:(16 16)
p1h:(165 164) p1v:(28 29)
p1h:(136 135) p1v:(60 61)
p1h:(124 123) p1v:(79 80)
p1h:(113 113) p1v:(95 96)
p1h:(110 109) p1v:(101 101)
p1h:(106 106) p1v:(110 111)
p1h:(109 110) p1v:(114 114)
p1h:(118 119) p1v:(119 119)
p1h:(138 139) p1v:(120 120)
p1h:(189 190) p1v:(89 88)
p1h:(200 200) p1v:(65 64)
p1h:(198 197) p1v:(65 65)
p1h:(194 194) p1v:(68 69)
p1h:(192 191) p1v:(71 71)
p1h:(172 172) p1v:(87 88)
p1h:(160 159) p1v:(93 93)
p1h:(144 143) p1v:(103 104)
p1h:(135 135) p1v:(107 108)
p1h:(103 102) p1v:(126 126)
p1h:(83 83) p1v:(134 135)
p1h:(72 72) p1v:(138 139)
p1h:(68 68) p1v:(141 140)
p1h:(76 76) p1v:(136 135)
p1h:(86 87) p1v:(129 129)
p1h:(99 100) p1v:(121 121)
p1h:(112 113) p1v:(114 114)
p1h:(132 131) p1v:(109 109)
p1h:(129 128) p1v:(110 110)
p1h:(116 116) p1v:(113 114)
p1h:(96 96) p1v:(119 120)

If you move the mouse fast you probably get bigger jumps with a lightgun. I manage to get 5 difference without really trying. I think your ignoring completely what mame actually does during a loop and a game could skip a read during the frame but manually poling wont account for that. The frame could be dropped you need to see what mame processed not your last libretro manual poll.

@mahoneyt944
Copy link
Collaborator

I'm not arguing with you I stated I could be wrong, just a discussion. I happen to run my own test and agree with your notion. If you want PR a change I'll push it later. Headed out right now.

[MAME 2003+] le2_gun_H_r( frame455 ) readinputport(9)126  readinputport(10)171
[MAME 2003+] le2_gun_H_r( frame455 ) readinputport(9)126  readinputport(10)171
[MAME 2003+] video_update( frame455 ) readinputport(9)126  readinputport(10)170
[MAME 2003+] le2_gun_H_r( frame456 ) readinputport(9)118  readinputport(10)139
[MAME 2003+] le2_gun_H_r( frame456 ) readinputport(9)118  readinputport(10)139
[MAME 2003+] video_update( frame456 ) readinputport(9)118  readinputport(10)138
[MAME 2003+] le2_gun_H_r( frame457 ) readinputport(9)108  readinputport(10)129
[MAME 2003+] le2_gun_H_r( frame457 ) readinputport(9)108  readinputport(10)129
[MAME 2003+] video_update( frame457 ) readinputport(9)108  readinputport(10)129
[MAME 2003+] le2_gun_H_r( frame458 ) readinputport(9)76  readinputport(10)96
[MAME 2003+] le2_gun_H_r( frame458 ) readinputport(9)76  readinputport(10)96
[MAME 2003+] video_update( frame458 ) readinputport(9)75  readinputport(10)95
[MAME 2003+] le2_gun_H_r( frame459 ) readinputport(9)63  readinputport(10)4
[MAME 2003+] le2_gun_H_r( frame459 ) readinputport(9)63  readinputport(10)4
[MAME 2003+] video_update( frame459 ) readinputport(9)63  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame460 ) readinputport(9)63  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame460 ) readinputport(9)63  readinputport(10)0
[MAME 2003+] video_update( frame460 ) readinputport(9)63  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame461 ) readinputport(9)60  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame461 ) readinputport(9)60  readinputport(10)0
[MAME 2003+] video_update( frame461 ) readinputport(9)59  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame462 ) readinputport(9)54  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame462 ) readinputport(9)54  readinputport(10)0
[MAME 2003+] video_update( frame462 ) readinputport(9)53  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame463 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame463 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] video_update( frame463 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame464 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame464 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] video_update( frame464 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame465 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame465 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] video_update( frame465 ) readinputport(9)51  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame466 ) readinputport(9)7  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame466 ) readinputport(9)7  readinputport(10)0
[MAME 2003+] video_update( frame466 ) readinputport(9)6  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame467 ) readinputport(9)6  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame467 ) readinputport(9)6  readinputport(10)0
[MAME 2003+] video_update( frame467 ) readinputport(9)6  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame468 ) readinputport(9)0  readinputport(10)113
[MAME 2003+] le2_gun_H_r( frame468 ) readinputport(9)0  readinputport(10)113
[MAME 2003+] video_update( frame468 ) readinputport(9)0  readinputport(10)117
[MAME 2003+] le2_gun_H_r( frame469 ) readinputport(9)10  readinputport(10)127
[MAME 2003+] le2_gun_H_r( frame469 ) readinputport(9)10  readinputport(10)127
[MAME 2003+] video_update( frame469 ) readinputport(9)11  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame470 ) readinputport(9)11  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame470 ) readinputport(9)11  readinputport(10)128
[MAME 2003+] video_update( frame470 ) readinputport(9)11  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame471 ) readinputport(9)33  readinputport(10)129
[MAME 2003+] le2_gun_H_r( frame471 ) readinputport(9)33  readinputport(10)129
[MAME 2003+] video_update( frame471 ) readinputport(9)34  readinputport(10)129
[MAME 2003+] le2_gun_H_r( frame472 ) readinputport(9)62  readinputport(10)142
[MAME 2003+] le2_gun_H_r( frame472 ) readinputport(9)62  readinputport(10)142
[MAME 2003+] video_update( frame472 ) readinputport(9)63  readinputport(10)143
[MAME 2003+] le2_gun_H_r( frame473 ) readinputport(9)86  readinputport(10)165
[MAME 2003+] le2_gun_H_r( frame473 ) readinputport(9)86  readinputport(10)165
[MAME 2003+] video_update( frame473 ) readinputport(9)86  readinputport(10)166
[MAME 2003+] le2_gun_H_r( frame474 ) readinputport(9)111  readinputport(10)197
[MAME 2003+] le2_gun_H_r( frame474 ) readinputport(9)111  readinputport(10)197
[MAME 2003+] video_update( frame474 ) readinputport(9)112  readinputport(10)198
[MAME 2003+] le2_gun_H_r( frame475 ) readinputport(9)121  readinputport(10)212
[MAME 2003+] le2_gun_H_r( frame475 ) readinputport(9)121  readinputport(10)212
[MAME 2003+] video_update( frame475 ) readinputport(9)121  readinputport(10)212
[MAME 2003+] le2_gun_H_r( frame476 ) readinputport(9)131  readinputport(10)204
[MAME 2003+] le2_gun_H_r( frame476 ) readinputport(9)131  readinputport(10)204
[MAME 2003+] video_update( frame476 ) readinputport(9)132  readinputport(10)204
[MAME 2003+] le2_gun_H_r( frame477 ) readinputport(9)150  readinputport(10)169
[MAME 2003+] le2_gun_H_r( frame477 ) readinputport(9)150  readinputport(10)169
[MAME 2003+] video_update( frame477 ) readinputport(9)151  readinputport(10)167
[MAME 2003+] le2_gun_H_r( frame478 ) readinputport(9)208  readinputport(10)140
[MAME 2003+] le2_gun_H_r( frame478 ) readinputport(9)208  readinputport(10)140
[MAME 2003+] video_update( frame478 ) readinputport(9)210  readinputport(10)139
[MAME 2003+] le2_gun_H_r( frame479 ) readinputport(9)210  readinputport(10)139
[MAME 2003+] le2_gun_H_r( frame479 ) readinputport(9)210  readinputport(10)139
[MAME 2003+] video_update( frame479 ) readinputport(9)210  readinputport(10)139
[MAME 2003+] le2_gun_H_r( frame480 ) readinputport(9)253  readinputport(10)131
[MAME 2003+] le2_gun_H_r( frame480 ) readinputport(9)253  readinputport(10)131
[MAME 2003+] video_update( frame480 ) readinputport(9)255  readinputport(10)131
[MAME 2003+] le2_gun_H_r( frame481 ) readinputport(9)255  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame481 ) readinputport(9)255  readinputport(10)128
[MAME 2003+] video_update( frame481 ) readinputport(9)255  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame482 ) readinputport(9)255  readinputport(10)122
[MAME 2003+] le2_gun_H_r( frame482 ) readinputport(9)255  readinputport(10)122
[MAME 2003+] video_update( frame482 ) readinputport(9)255  readinputport(10)121
[MAME 2003+] le2_gun_H_r( frame483 ) readinputport(9)255  readinputport(10)94
[MAME 2003+] le2_gun_H_r( frame483 ) readinputport(9)255  readinputport(10)94
[MAME 2003+] video_update( frame483 ) readinputport(9)255  readinputport(10)93
[MAME 2003+] le2_gun_H_r( frame484 ) readinputport(9)235  readinputport(10)38
[MAME 2003+] le2_gun_H_r( frame484 ) readinputport(9)235  readinputport(10)38
[MAME 2003+] video_update( frame484 ) readinputport(9)233  readinputport(10)36
[MAME 2003+] le2_gun_H_r( frame485 ) readinputport(9)197  readinputport(10)1
[MAME 2003+] le2_gun_H_r( frame485 ) readinputport(9)197  readinputport(10)1
[MAME 2003+] video_update( frame485 ) readinputport(9)196  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame486 ) readinputport(9)156  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame486 ) readinputport(9)156  readinputport(10)0
[MAME 2003+] video_update( frame486 ) readinputport(9)155  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame487 ) readinputport(9)129  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame487 ) readinputport(9)129  readinputport(10)0
[MAME 2003+] video_update( frame487 ) readinputport(9)128  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame488 ) readinputport(9)126  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame488 ) readinputport(9)126  readinputport(10)0
[MAME 2003+] video_update( frame488 ) readinputport(9)126  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame489 ) readinputport(9)126  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame489 ) readinputport(9)126  readinputport(10)0
[MAME 2003+] video_update( frame489 ) readinputport(9)126  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame490 ) readinputport(9)117  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame490 ) readinputport(9)117  readinputport(10)0
[MAME 2003+] video_update( frame490 ) readinputport(9)117  readinputport(10)0
[MAME 2003+] le2_gun_H_r( frame491 ) readinputport(9)96  readinputport(10)79
[MAME 2003+] le2_gun_H_r( frame491 ) readinputport(9)96  readinputport(10)79
[MAME 2003+] video_update( frame491 ) readinputport(9)95  readinputport(10)83
[MAME 2003+] le2_gun_H_r( frame492 ) readinputport(9)82  readinputport(10)113
[MAME 2003+] le2_gun_H_r( frame492 ) readinputport(9)82  readinputport(10)113
[MAME 2003+] video_update( frame492 ) readinputport(9)81  readinputport(10)114
[MAME 2003+] le2_gun_H_r( frame493 ) readinputport(9)88  readinputport(10)127
[MAME 2003+] le2_gun_H_r( frame493 ) readinputport(9)88  readinputport(10)127
[MAME 2003+] video_update( frame493 ) readinputport(9)88  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame494 ) readinputport(9)108  readinputport(10)133
[MAME 2003+] le2_gun_H_r( frame494 ) readinputport(9)108  readinputport(10)133
[MAME 2003+] video_update( frame494 ) readinputport(9)109  readinputport(10)133
[MAME 2003+] le2_gun_H_r( frame495 ) readinputport(9)119  readinputport(10)148
[MAME 2003+] le2_gun_H_r( frame495 ) readinputport(9)119  readinputport(10)148
[MAME 2003+] video_update( frame495 ) readinputport(9)120  readinputport(10)148
[MAME 2003+] le2_gun_H_r( frame496 ) readinputport(9)124  readinputport(10)159
[MAME 2003+] le2_gun_H_r( frame496 ) readinputport(9)124  readinputport(10)159
[MAME 2003+] video_update( frame496 ) readinputport(9)124  readinputport(10)160
[MAME 2003+] le2_gun_H_r( frame497 ) readinputport(9)127  readinputport(10)183
[MAME 2003+] le2_gun_H_r( frame497 ) readinputport(9)127  readinputport(10)183
[MAME 2003+] video_update( frame497 ) readinputport(9)128  readinputport(10)184
[MAME 2003+] le2_gun_H_r( frame498 ) readinputport(9)128  readinputport(10)184
[MAME 2003+] le2_gun_H_r( frame498 ) readinputport(9)128  readinputport(10)184
[MAME 2003+] video_update( frame498 ) readinputport(9)128  readinputport(10)184
[MAME 2003+] le2_gun_H_r( frame499 ) readinputport(9)132  readinputport(10)184
[MAME 2003+] le2_gun_H_r( frame499 ) readinputport(9)132  readinputport(10)184
[MAME 2003+] video_update( frame499 ) readinputport(9)133  readinputport(10)184
[MAME 2003+] le2_gun_H_r( frame500 ) readinputport(9)203  readinputport(10)153
[MAME 2003+] le2_gun_H_r( frame500 ) readinputport(9)203  readinputport(10)153
[MAME 2003+] video_update( frame500 ) readinputport(9)206  readinputport(10)152
[MAME 2003+] le2_gun_H_r( frame501 ) readinputport(9)253  readinputport(10)136
[MAME 2003+] le2_gun_H_r( frame501 ) readinputport(9)253  readinputport(10)136
[MAME 2003+] video_update( frame501 ) readinputport(9)255  readinputport(10)135
[MAME 2003+] le2_gun_H_r( frame502 ) readinputport(9)255  readinputport(10)135
[MAME 2003+] le2_gun_H_r( frame502 ) readinputport(9)255  readinputport(10)135
[MAME 2003+] video_update( frame502 ) readinputport(9)255  readinputport(10)135
[MAME 2003+] le2_gun_H_r( frame503 ) readinputport(9)255  readinputport(10)129
[MAME 2003+] le2_gun_H_r( frame503 ) readinputport(9)255  readinputport(10)129
[MAME 2003+] video_update( frame503 ) readinputport(9)255  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame504 ) readinputport(9)255  readinputport(10)128
[MAME 2003+] le2_gun_H_r( frame504 ) readinputport(9)255  readinputport(10)128
[MAME 2003+] video_update( frame504 ) readinputport(9)255  readinputport(10)128

@mahoneyt944
Copy link
Collaborator

mahoneyt944 commented May 28, 2023

Had a second to make a branch for this , https://github.com/libretro/mame2003-plus-libretro/compare/Le2

On a quick test the game doesn't read the input during startup so it's locked out for a little. The input doesn't feel any different to me. I'll wait to see how @StormedBubbles tests go in the service menu before pushing anything.

@StormedBubbles
Copy link
Author

Sorry for the delay, and thank you both for looking into this. My experience in the service menu is exactly the same as in game when I do the procedure I mentioned earlier. The shot lags behind where the cursor location is by an amount that appears to be the same as during normal gameplay (so the splat effect appears to be where the shot actually lands).

@MistyDreams
Copy link
Contributor

I dont see anything in that branch linked did your get time to test that?

@StormedBubbles
Copy link
Author

StormedBubbles commented May 28, 2023

Sorry I may have misunderstood the request. I tested the main branch of lr-mame2003plus. Would you like me to take a look at that le2 branch and test?

And I'm also not seeing differences with that branch

@MistyDreams
Copy link
Contributor

I think the branch may have been accidentally deleted.

@MistyDreams
Copy link
Contributor

MistyDreams commented May 28, 2023

@StormedBubbles try this. It works fine on a wii mote how aligned it is is another story but you can dial it in with your gun. Just offset the crosshair draws. Youll need to goto the right screen to reload leaving that out out the testing for now.

diff --git a/src/drivers/konamigx.c b/src/drivers/konamigx.c
index d2c92b54..1bb011be 100644
--- a/src/drivers/konamigx.c
+++ b/src/drivers/konamigx.c
@@ -904,27 +904,27 @@ static WRITE32_HANDLER( adc0834_w )
 
 	analog_prevclk = clk;
 }
-
+int p1x, p2x, p1y, p2y;
 static READ32_HANDLER( le2_gun_H_r )
 {
-	int p1x = readinputport(9)*290/0xff+20;
-	int p2x = readinputport(11)*290/0xff+20;
+	p1x = readinputport(9)*290/0xff+20;
+	p2x = readinputport(11)*290/0xff+20;
 
 	/* make "off the left" reload too */
-	if (p1x <= 0x15) p1x = 310;
-	if (p2x <= 0x15) p2x = 310;
+	//if (p1x <= 0x15) p1x = 310;
+	//if (p2x <= 0x15) p2x = 310;
 
 	return (p1x<<16)|p2x;
 }
 
 static READ32_HANDLER( le2_gun_V_r )
 {
-	int p1y = readinputport(10)*224/0xff;
-	int p2y = readinputport(12)*224/0xff;
+	p1y = readinputport(10)*224/0xff;
+	p2y = readinputport(12)*224/0xff;
 
 	/* make "off the bottom" reload too */
-	if (p1y >= 0xdf) p1y = 0;
-	if (p2y >= 0xdf) p2y = 0;
+	//if (p1y >= 0xdf) p1y = 0;
+	//if (p2y >= 0xdf) p2y = 0;
 
 	return (p1y<<16)|p2y;
 }
diff --git a/src/vidhrdw/konamigx_vidhrdw.c b/src/vidhrdw/konamigx_vidhrdw.c
index ea2a1f4f..f992230c 100644
--- a/src/vidhrdw/konamigx_vidhrdw.c
+++ b/src/vidhrdw/konamigx_vidhrdw.c
@@ -429,6 +429,7 @@ VIDEO_START(racinfrc)
 	return 0;
 }
 
+extern p1x, p2x, p1y, p2y;
 VIDEO_UPDATE(konamigx)
 {
 	int i, newbank, newbase, dirty, unchained;
@@ -488,8 +489,8 @@ VIDEO_UPDATE(konamigx)
 
 	if( gx_invertlayersBC )
 	{
-		draw_crosshair( 1, bitmap, readinputport( 9)*287/0xff+24, readinputport(10)*223/0xff+16, cliprect );
-		draw_crosshair( 2, bitmap, readinputport(11)*287/0xff+24, readinputport(12)*223/0xff+16, cliprect );
+		draw_crosshair( 1, bitmap, p1x+2, p1y +16, cliprect );
+		draw_crosshair( 2, bitmap, p2x+2, p2y +16, cliprect );
 	}
 }
 

@mahoneyt944
Copy link
Collaborator

Yeah I must have deleted it I can write it back up if need be, when I tested the crosshairs (input read) is locked out while the game boots up. And it felt the same to me in the menu and in game. Many drivers read the port directly in draw_crosshair, so its a common practice here for what it's worth. I think this is just how the game feels. Seems like the gun is very accurate to me, not sure what your experience is misty with tests you've done

@MistyDreams
Copy link
Contributor

MistyDreams commented May 28, 2023

I guess it depends how good your gun is. I mean a wiimote more like a shotgun haha. The reload check isint needed for lightun not sure about the other modes though.

For a wii-mote or andriod screen I guess its like using a shotgun for aiming anyway. A sniper gunner like @StormedBubbles would only be more able to to make a preference.

As for the difference when wagging the wiimote around. p1h:246 mamereadh:254 p1v:245 mamereadv:253 is the difference plus the processing to be added thats just a plain port read.

@StormedBubbles
Copy link
Author

StormedBubbles commented May 29, 2023

The code changes posted above appear to rescale/shift the position of the emulator's cursor if I'm reading that right. I should have mentioned that I actually play with the cursor off and was just using the cursor as a means of explaining the issue I experienced. I tried said code changes with le2 and still had the same issue. Here are some screen shots of lethalen and le2 (both in this emulator) to hopefully give a better idea of what I mean. lethalen does NOT have the same issue. This was all done by pausing emulation and advancing frame by frame. To my naked eye, lethalen feels fine, but le2's shots seem to drag behind the cursor when moving. I hope that this helps clarify/quantify what I mean.

lethalen first, to show expected behavior:

Initial shot to show expected alignment
lethalen-230528-235639

Cursor left alone after that shot
lethalen-230528-235656

Move cursor with trackball, take hand off trackball, fire shot, advance 1 frame
lethalen-230528-235700

Advance 1 frame. Cursor has moved, but shot has not yet appeared
lethalen-230528-235702

Advance 1 frame. Shot appears in correct spot with correct alignment
lethalen-230528-235705

Now for le2:

Initial shot to show expected alignment
le2-230529-000424

Cursor left alone after that shot
le2-230529-000427

Move cursor with trackball, take hand off trackball, fire shot, advance 1 frame
le2-230529-000440

Advance 1 frame. Cursor has moved, but shot has not yet appeared
le2-230529-000444

Advance 1 frame. Cursor moves again, and shot appears at previous location
le2-230529-000446

Advance 1 frame to show completion of shot and misalignment
le2-230529-000449

I ran the same test with Area 51 and Crypt Killer in this emulator as well as a few other games in other emulators, and they all behave like lethalen does. le2 seems to take 2 steps to go from position A to position B while the others jump immediately from position A to position B.

@MistyDreams
Copy link
Contributor

MistyDreams commented May 29, 2023

Im not sure how accurate the pause method is. But the game will place the shot and allow you to move cursor after shot you wouldnt be able to move this fast without pause. If you move the mouse right across the screen it will be the other side depends how long you travel where the new target appears during the pause. The shots always on the right target thoughbut its does end up in the same place.

There is lag its could be the way the game is or the code needs tweaked how are you finding fbneo and mame with this? I struggle to even notice 1 or two frames cause its takes me more than 3 frames to aim and shoot and wouldnt notice this without a frameskip.

Its does seem better on mame current on although it running really slow on on a i5 in RA. Neither plus or mame current le2 work on fbneo dont know if it supports this game. I think the video code might be an issue on this one something is cause a delay that mame doesnt seem to have with the pause method used.

@MistyDreams
Copy link
Contributor

MistyDreams commented May 29, 2023

@StormedBubbles did a bit of testing on this core and mame its game mechanics its not a misaligned shot. Mame is a frame ahead compared to our core. The game needs 8 or 9 frames with the trigger not pressed after a shot during gameplay to take another shot. This doesnt happen in gun testing mode in the service menu. So around a 160ms between shots for the revolver anyway dont know about the other weapons.

@mahoneyt944
Copy link
Collaborator

@MistyDreams sounds like this is just how it is for this game here.

@MistyDreams
Copy link
Contributor

Thats the danger of frame advance and runahead some mechanics shouldn't react instantly. Its still interesting with the draw cross hairs everything else goes through the game mechanics loop. Its like drawing a jump animation in the video code instead of using the mechanics not too fussed about when its read but worth keeping in mind for people with decent guns.

@StormedBubbles
Copy link
Author

StormedBubbles commented May 30, 2023

The best comparison I found was lr-mame2010. le2 passes the "pause test" I have been doing and also seems to perform better in the service menu if I start at one end of the screen and do my best to move the gun to the other side at a constant speed and fire multiple times. The bullet splats there in lr-mame2010 (MAME .139) follow my line of sight more closely than in lr-mame2003-plus. The cursor is aligned with my line of sight at all times in both emulators. The downside is that there are numerous graphical glitches in the game in that version of MAME for whatever reason. Later versions of MAME give me a poor frame rate for le2 on my Raspberry Pi 4B.

@MistyDreams
Copy link
Contributor

Try it with the crosshair off if its hitting where it should its the draw cross hair that needs adjusting to match the green dots.

@mahoneyt944
Copy link
Collaborator

mahoneyt944 commented May 30, 2023

Yeah I patched the colors up for le2 awhile ago in this core, otherwise it would probably have more issues here too.

@StormedBubbles
Copy link
Author

StormedBubbles commented May 30, 2023

My previous comment minus the sentence with the "C" word is my experience with line of sight. The shots lag behind my sight in this core by maybe half of a service-menu square more than in 2010 when moving. It actually looks like what I show in my screen shots above.

@mahoneyt944 are you referring to the color hack from November of 2021? That was originally implemented in a MAME version predating 2010's and is already in that libretro core. Also, what were the changes that you originally proposed before? I can take a look at those too. After looking at that, I can just close the issue if no one else seems to be having a similar experience.

@mahoneyt944
Copy link
Collaborator

The change I made here was a color palette shift, can't recall the mame version it was from.
b52ed08

The change I had in my branch was basically the same as what misty had, I just kept the scaling the same. But it you saw no difference with his, it won't be better with what I had

@MistyDreams
Copy link
Contributor

MistyDreams commented May 30, 2023

Checked the code the scaling should be good. have no idea why this is happening to you and the other games are fine.

this code is identical on all mame versions so it must be good.

static READ32_HANDLER( le2_gun_H_r )
{
int p1x = readinputport(9)*290/0xff+20;
int p2x = readinputport(11)*290/0xff+20;
/* make "off the left" reload too */
if (p1x <= 0x15) p1x = 310;
if (p2x <= 0x15) p2x = 310;
return (p1x<<16)|p2x;
}
static READ32_HANDLER( le2_gun_V_r )
{
int p1y = readinputport(10)*224/0xff;
int p2y = readinputport(12)*224/0xff;
/* make "off the bottom" reload too */
if (p1y >= 0xdf) p1y = 0;
if (p2y >= 0xdf) p2y = 0;
return (p1y<<16)|p2y;
}

MDRV_SCREEN_SIZE(64*8, 32*8)
MDRV_VISIBLE_AREA(24, 24+288-1, 16, 16+224-1)

screen is 512 x 256
visible area 24 and 16 added

scales here appropriately.

draw_crosshair( 1, bitmap, readinputport( 9)*287/0xff+24, readinputport(10)*223/0xff+16, cliprect );
draw_crosshair( 2, bitmap, readinputport(11)*287/0xff+24, readinputport(12)*223/0xff+16, cliprect );

The only thing I can think of is check any frameskip options. One more thing to note the draw_cross hair is drawing from the current input and its ahead of the mames internal gun read you can see it play catch up sometimes. I only read the x axis bit it will print directly below your normal crosshair to see if it differs much for you. Test it in the calibration screen as the game mechanics throw things off. If you get a chance can you test on a pc. Its probably best to leave the issue open is a strange one.

this will render mame internal read value and mames last data received. If they both are offset wrong the problem must be somewhere else. I out of ideas might be easier to put an issue in 2010 for someone fix the driver.

diff --git a/src/drivers/konamigx.c b/src/drivers/konamigx.c
index d2c92b54..62422163 100644
--- a/src/drivers/konamigx.c
+++ b/src/drivers/konamigx.c
@@ -905,9 +905,12 @@ static WRITE32_HANDLER( adc0834_w )
        analog_prevclk = clk;
 }
 
+int mame_read_x1;
 static READ32_HANDLER( le2_gun_H_r )
 {
-       int p1x = readinputport(9)*290/0xff+20;
+       mame_read_x1=readinputport(9);
+       
+       int p1x = mame_read_x1 *290/0xff+20;
        int p2x = readinputport(11)*290/0xff+20;
 
        /* make "off the left" reload too */
diff --git a/src/vidhrdw/konamigx_vidhrdw.c b/src/vidhrdw/konamigx_vidhrdw.c
index ea2a1f4f..48789c65 100644
--- a/src/vidhrdw/konamigx_vidhrdw.c
+++ b/src/vidhrdw/konamigx_vidhrdw.c
@@ -429,6 +429,7 @@ VIDEO_START(racinfrc)
        return 0;
 }
 
+extern int mame_read_x1;
 VIDEO_UPDATE(konamigx)
 {
        int i, newbank, newbase, dirty, unchained;
@@ -488,8 +489,10 @@ VIDEO_UPDATE(konamigx)
 
        if( gx_invertlayersBC )
        {
-               draw_crosshair( 1, bitmap, readinputport( 9)*287/0xff+24, readinputport(10)*223/0xff+16, cliprect );
+               /*these seem to deviate at times with a mouse.*/
+               draw_crosshair( 1, bitmap, readinputport(9)*287/0xff+24, readinputport(10)*223/0xff+16, cliprect );
                draw_crosshair( 2, bitmap, readinputport(11)*287/0xff+24, readinputport(12)*223/0xff+16, cliprect );
+               draw_crosshair( 3, bitmap, mame_read_x1*287/0xff+24, readinputport(10)*223/0xff+16*2, cliprect ); //mame crosshair data
        }
 }

@mahoneyt944
Copy link
Collaborator

Does the game require so many frames of the trigger to register?

@MistyDreams
Copy link
Contributor

MistyDreams commented Jun 4, 2023

no it requires the frames after youshoot with the trigger released to shoot again ingame . Its a revolver probably to make it more authentic. If you see no flash the shot wasnt ready an its still the last shot your seeing. mame current requires the gap as well bewteen shots.I cant reproduce the target being off though. All test are fine in the test menu for me. Zero lag is a meme older hardware had it.

@mahoneyt944
Copy link
Collaborator

Seemed fine by my tests, but I don't use an actual lightgun. Idk probably nothing we can do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants