flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.3k stars 162 forks source link

Fix for reload shooting outside the screen? Naomi #1406

Open Trihy opened 5 months ago

Trihy commented 5 months ago

Platform / OS / Hardware:

Windows 11

Hardware: i7 9700 AMD GPU

Description of the Issue

Some games doesnt register shooting outside the screen to reload. Some works fine. Not sure the difference between them and if we can use this for a proper fix, to make it work like their arcade counterparts.

Debugging Steps Tested

Naomi Games working correctly when shoot outsise screen:

-Death Crimson OX -Ninja Assault -Lupin the third shooting

Games NOT working correctly when shoot outside screen:

-Confidential Mission -The House of the Dead 2 (edit. it works, need a calibration trick) -The House of the Dead 2 (Prototype) (edit. it works, need a calibration trick)

Atomiswave Extreme hunting 1 and 2 doesnt work shooting outside screen too, but Im not sure if this games had shoot outside screen on arcades. Probably not.

Logs Gathered


Please paste the contents of the log / logs here
You may leave this field blank if you have none.

Screenshots

(Replace this line with any issue screenshots)

flyinghead commented 5 months ago

All games that support it can reload by shooting outside of the screen, or they wouldn't be playable. However you need to do proper lightgun calibration for it to work. hotd2 is tricky in that regard.

Trihy commented 5 months ago

I was not able to fix this on my end. Will try more recalibration on test menu. But I can see the crosshair reaching all corners, but it just won't reload.

flyinghead commented 5 months ago

Also see https://github.com/flyinghead/flycast/issues/460

Trihy commented 5 months ago

Thanks. Mapping a button works fine. But lightgun is just one button.

Do you think there is any difference between hotd and ie lupin? (hardware button for reload or something else) The games that works fine, works fine even doing anything on calibration screen, even with 5cm deviation, reload outside screen keep working.

I will try a couple of more recalibrations on hotd2 and confmiss in case they are way too picky, but never get any close to make it work.

Thanks for your help.

Trihy commented 5 months ago

Oh damn, they are way too picky. Didnt notice the test menu has some testing area and will show out of screen text when you are on reload area.

The only way to make this area appear, was pointing a little more near the center of the screen than the calibration target point. With around 1cm far from point target will make the job.

Thanks for your help. Been dealing with this problem for months.

With confmiss seems to be even harder.

Trihy commented 5 months ago

Well I was able to make Naomi hotd2 works with shoot outside screen (prototype version doesnt seem to boot at all, but can be me)

On the other side, Naomi Confmiss was impossible, tried many calibrations, even using nonsense values, but nothing.

Trihy commented 5 months ago

Thanks for so detailed information.

Yes, hotd2 can be fixed with that calibration trick. I was always pointing exactly to the targets making impossible to shoot outside screen. But doing that little offset, does the trick.

Hope that can be sticky so people with the same problem can easily fix this.

About confmiss, since there is a hw button for reloading, maybe flycast can set an area on the borders of the screen which trigger this button instead the shoot button, when pressing the shoot button.

But not sure how easy to do can be and just for one game, maybe is not worth it.

Maybe mame has some kind of this implementation. That could explain why works the same for all games, even from different platforms.

StormedBubbles commented 4 months ago

Hello,

My 2¢ as someone who encountered these same issues:

I was able to calibrate every NAOMI and Atomiswave gun game by the various methods listed above (usually shooting off-center on the intended calibration targets). The result is that every game is calibrated to the Flycast cursors, which I then aligned with my line of sight through the lightgun software I'm using (Sinden). I can share the resulting NVRAM files if that is allowed.

Reloading also works in all games that require reloading too for me (I am using the Libretro version). Note that some games have differing reloading mechanics. For example, see this graphic from the House of the Dead 2 operator manual:

image

It only mentions pointing outside of the screen to reload, which is what happens in a calibrated Flycast setup.

This is as opposed to the corresponding information in Sports Shooting USA's manual:

image

It specifically says to shoot offscreen to reload, and that also works in Flycast. I did not check the manual for EVERY game but instead trusted the result the emulator gave me (some expect you to shoot, some expect you to just point, and then some other ones have a pump mechanic which is just a button anyway and is unaffected by where you're pointing).

Trihy commented 4 months ago

Thanks for so detailed info.

kihato commented 4 months ago

Confidential missions seem to require Screen-In to be turned out when reloading. I tested the following code and it seems to work fine. However, since it is experimental, only one-Player will work.

The House of Dead 2 will no longer require adjustments.

case 0x20:  // Read digital input
    {
...
for (int player = 0; player < buffer_in[cmdi + 1]; player++)
{
    u32 axis = 0;
    int playerNum = first_player + axis / 2;
    const MapleInputState& inputState = mapleInputState[std::min(playerNum, (int)   std::size(mapleInputState) - 1)];
...
    if ((inputState.absPos.x < 0 || inputState.absPos.x > 639           
        || inputState.absPos.y < 0 || inputState.absPos.y > 479) 
        && player == 0)
    {
        JVS_OUT(1);
    }
    else
        JVS_OUT(inputs[player] >> 8);
EvoRetroGame commented 3 months ago

Hi why my ninja assault not working off screen?