-
Notifications
You must be signed in to change notification settings - Fork 2k
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
video/epic12.cpp: Fix clipping of CV1K games #11227
Conversation
Change clipping for CV1K games to draw 32 pixels surrounding the visible area. This can be easily seen in Muchi Muchi Pork, which has a VRAM viewer in Special mode (Object Test), which will show 32 px drawn around the visible areas of framebuffers. For most gamers, this wont really matter at all... except for in Muchi Muchi Pork, where changing this actually fixes a bug for Rafute. When Bombing with Rafute, the screen background will go wavy in a sine-like pattern. Currently in mame, the top of screen will show black pixels when this happens. With this fix for clipping, the background will instead be visible correctly. Also renamed the "scroll registers" to have it more clear which one of these are actually used as a "scroll register" (or rather offset for drawing), and which one is strictly used for clipping.
@buffis Hi, wanted to let you know about an issue with your new blitter timing code and Mushihime-Sama Futari 1.5, this bug discovery is by el_rika Game settings: Maniac Mode, w/ Reco (Normal) PCB Proof: https://www.youtube.com/watch?v=gg53yGaRXHQ Notice slowdown when shot is tapped, starting @ Get there in MAME easily: using Pugsy's cheat.7z, start the game w/above settings then go into cheat menu and select P1 Invincibility & Maximum firepower. hold down ffwd (insert key) and fire until you get to st.3's boss, as the boss starts shooting at you, pulse fire once. .. or play normal if feeling inclined :) Second Issue: best regards,
|
@dinkc64 Hi! I don't think there's any bug here really. See below. I did some checks on S1 boss, and here's an example. It's probably not lined up frame-by-frame, but it should work ok as a comparison. Looks alright to me. In this example, left is playing with the new blitter code in MAME. Right is PCB footage that you linked. MAME is faster here, but thats due to the PCB player hitting a big cancel which causes more gem slow down. I have been unable to reproduce anything that seems particularily broken here. Regarding S3 boss, I can have a look, but in terms of missing slowdown, it's very plausible that it could be due to the lack of SH3 Wait state emulation. For many games, this is a bigger factor than blitter, and there's no way to set it up to match pcb currently. It should probably be mentioned that the new Blitter code is not perfect (see TODO's and comments in #10849), so if this is in fact blitter related slowdown, it can be due to being right at the edge of it triggering, and the edge cases being sufficient to make a difference. That's not really unexpected. Either way it is significantly better than the previous logic which had very little to do with hardware behavior :) I do appreciate people looking at it though. I looked up el_rikas videos on youtube, and it does look like he is not using mame, but instead fbneo on some gameboy-looking device, so i cant really say much if that has any impact or not. Might be fine, but i've never tried that. |
Hi Buffi, best regards,
|
Thanks, I agree that it seems slightly sluggish in that area. There can be more sprites drawn by the code under "Sprites fully outside of clipping area should not be drawn." Will test some things and see if I can figure out whats up! :) Thanks! |
I’ll tell you one thing, it sure feels weird getting slowdown in Muchi Muchi Pork after getting used to playing without it. |
Actually, I don't think the clipping change was merged in MAME 254 so that should be unrelated. Will look at it a bit more to see whats up, and dig out my futari pcb MMP has quite a lot of slowdown on PCB :) |
Hooked up Futari to my test-rig and yes, I agree that there should not be any Blitter slowdown prior to S1 boss. I have a good capture of that sequence with AbPalm on Maniac now, so I should be able to figure out what's up. Very useful bug report, thank you! http://img.buffis.com/misc/futariblit.jpg Must be some edge case I'm handling slightly wrong. Will investigate further :) |
@buffis you're the best :) thanks for listening! |
@cuavas Muchi really benefits from the new blitter timing; stage 4 is actually enjoyable now :) |
The clipping is definitely related to this, with the recent clipping change, there's a lot more slowdown than without it. That's awkward. |
Fix issue where some games do very large over-draws which when utilized in Blitter calculations will cause more delay than whats seen on hardware. The fog in S1 of Mushi Futari 1.5 is a good example of this. On Mushi Futari 1.5, in the section before the boss, the Blitter delay seen on PCB is aprox 12 milliseconds at peaks. With this fix, it matches that quite well! It's not 100% clear to me this is exactly how things behave, but this should be closer to the truth, until I can figure out a more reliable and reproducible test-case. See discussions on this PR for background : mamedev#11227 For reference, Saleae logic analyzer output is available in: http://img.buffis.com/misc/futaris.sal
I believe #11295 should fix the issue before the S1 boss in Futari. |
excellent!! so far, so good! :) best regards,
|
Change clipping for CV1K games to draw 32 pixels surrounding the visible area. This can be easily seen in Muchi Muchi Pork, which has a VRAM viewer in Special mode (Object Test), which will show 32 px drawn around the visible areas of framebuffers. For most gamers, this wont really matter at all... except for in Muchi Muchi Pork, where changing this actually fixes a bug for Rafute. When Bombing with Rafute, the screen background will go wavy in a sine-like pattern. Currently in mame, the top of screen will show black pixels when this happens. With this fix for clipping, the background will instead be visible correctly. Also renamed the "scroll registers" to have it more clear which one of these are actually used as a "scroll register" (or rather offset for drawing), and which one is strictly used for clipping.
Change clipping for CV1K games to draw 32 pixels surrounding the visible area.
This can be easily seen in Muchi Muchi Pork, which has a VRAM viewer in Special mode (Object Test), which will show 32 px drawn around the visible areas of framebuffers.
See: https://www.arcade-projects.com/threads/research-into-cv1000-blitter-performance-and-behavior.24385/#post-364121
For most gamers, this wont really matter at all... except for in Muchi Muchi Pork, where changing this actually fixes a bug for Rafute (yellow ship).
When Bombing with Rafute (not the other two character), the screen background will go wavy in a sine-like pattern. Currently in mame, the top of screen will show black pixels when this happens.
Like this: http://img.buffis.com/mmppatch/without_patch.png
With this fix for clipping, the background will instead be visible correctly.
Like this: http://img.buffis.com/mmppatch/with_patch.png
Theres still some potential for artifacts though, both at top and on right side of screen... but this happens on PCB too.
Mame with patch, top artifact: http://img.buffis.com/mmppatch/mame_top_artifacts.png
Mame with patch, right artifact: http://img.buffis.com/mmppatch/mame_top_artifacts.png
PCB top artifact: http://img.buffis.com/mmppatch/pcb_top.jpg and http://img.buffis.com/mmppatch/pcb_top2.jpg
PCB right artifact: http://img.buffis.com/mmppatch/pcb_right.png
PCB footage of some bombs for reference: http://img.buffis.com/mmppatch/pcb_footage.mp4
Also renamed the "scroll registers" to have it more clear which one of these are actually used as a "scroll register" (or rather offset for drawing), and which one is strictly used for clipping.