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

Jurassic Park: transparency gitch on the first stage #1718

Open
vanfanel opened this issue Mar 13, 2024 · 13 comments
Open

Jurassic Park: transparency gitch on the first stage #1718

vanfanel opened this issue Mar 13, 2024 · 13 comments

Comments

@vanfanel
Copy link

Hello there,

Running latest FBNeo GIT code here.
I've noticed a transparency glitch on the first stage of Jurassic Park, where brown-ish transparent bands move up and down with the cursor.
I recorded a video of it:

jpark_glitch.mp4

Seems like a Sega System 32 emulation bug.

@dinkc64
Copy link
Collaborator

dinkc64 commented Mar 14, 2024

Hi vanfanel,
Here's how it's supposed to look:
https://youtu.be/Mx0fHZOThlo?si=pflfqBvwG1VW1Y6R&t=153

I'll try to figure it out, but I can't promise anything, the Sega System 32 is kinda complex!

best regards,

  • dink

@mahoneyt944
Copy link

mahoneyt944 commented Jun 13, 2024

I believe it's related to row scroll. I managed to get it working for player 2 but not player 1 in mame2003+. Player 1 might just be a priority issue though as its not shown at all but I never got any further with it. Maybe this will help here though.

https://github.com/libretro/mame2003-plus-libretro/blob/3206819c48567e759f993134ac27491b11b3dd80/src/vidhrdw/system32_vidhrdw.c#L1327-L1331
jpark-240613-021406

@dinkc64
Copy link
Collaborator

dinkc64 commented Jun 13, 2024

Hi mahoneyt944, thanks for the tip!
I'll see if this can be improved upon,

best regards,

  • dink

@mahoneyt944
Copy link

@dinkc64 I went down the rabbit hole a little by porting newer segas32 video code over to mame2003+.... I get the same issue noted here. Curiously it's not broken for player 2 in any code base, so I'm hopeful that it's a minor adjustment needed for player 1. This issue has been present since the beginning of this video code (around mame 97u2), so it's unlikely my previous comment will help here. Player 2's render might point us in the right direction though.

@mahoneyt944
Copy link

mahoneyt944 commented Nov 14, 2024

So this effect is created by update_tilemap_rowscroll(&layer_data[MIXER_LAYER_NBG2], cliprect, 2); during update_tilemaps() and seemingly works for player 2 (when player 1 is alive) but doesn't work correctly for player 1.

@mahoneyt944
Copy link

mahoneyt944 commented Dec 11, 2024

I found this video which describes hooking up a generic jamma harness to a jpark board and notes that moving the joystick up and down changed the camera view, and button 2 lowered the health bars. I confirmed this behavior by swapping the inputs on jpark with a generic two player set. This makes me think that the "flash light" effect issue in the raptor tunnel might not be the video code at all but an input issue since the effect follows the positioning of the input.

Panning higher and lower:
jpark-241210-234240
jpark-241210-234210

Video starting around 1:50
https://youtu.be/l__YufFcaSQ?si=7NPpF26CkZO8tiwz

@dinkc64
Copy link
Collaborator

dinkc64 commented Dec 11, 2024

Nice find :)

@dinkc64
Copy link
Collaborator

dinkc64 commented Dec 15, 2024

lately I've been up a barrage of sh*t, which explains my inactivity. When things hopefully get better, I'd really like to check into your changes and possibly help out, or at least merge the fixes you've made. I really dig the work and findings you've come up with on s32! :)

best regards,

  • dink

@mahoneyt944
Copy link

mahoneyt944 commented Dec 15, 2024

If you want to try my fix up for the backgrounds in harddunk we use this macro in place of the utility function in current mame. You'd just need to port the dozen or so places it's used then add the change for the resolution in update_tilemap_zoom(). Here's the PR in Mame to reference

mamedev/mame#13047

/*************************************
 *
 *  Utility Macro
 *
 *************************************/

#define SEXT(value, width) (((int64_t)((value) & ((1ULL << (width)) - 1)) ^ (int64_t)(1ULL << ((width) - 1))) - (1ULL << ((width) - 1)))

@dinkc64
Copy link
Collaborator

dinkc64 commented Dec 16, 2024

Thanks :) (I also have a sign extender macro in drv/snes/cx4.cpp)
I have an idea I'd like to explore with the 0x200 default, maybe there is a problem with the math up above which is requiring the sign extend change to begin with? Could be wrong about this, but, it's worth investigating.

best regards,

  • dink

@mahoneyt944
Copy link

If there's not a math issue, I also theorize that the sign extend amount might be dynamically set based on the zoom value instead of hard coding 9 and 10. But these values seem to at least generate the correct result.

Let me know if you figure anything out.

@mahoneyt944
Copy link

mahoneyt944 commented Dec 17, 2024

Also a side note, it seems one of the main issues in general is sprite transparency. I noticed in rad mobile the title should be transparent when it flips. I was able to get a real hardware capture of this vs the emulation of. Edit: I think the blendmask needs controlled by a register?
Screenshot_20241208-161937
radm-241208-162921

There's also sprite priority issues such as the cars showing in the rear view mirror are displaying over the mirror
radm-241217-005603

@mahoneyt944
Copy link

Some more digging with jpark,

The effect width for player 1 is being set here. There seems to be a conflict with this extent and the one used by player2. This effect does not track with player1 X analog. You can also override the min and max here to 100 and 200 respectively to see what I mean. There's seems to be an error with this extents list.

else
{
*extent++ = cur.nMinx;
*extent++ = cur.nMaxx;
}

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