djhackersdev / bemanitools

Runs recent Konami arcade games and emulates various arcade hardware.
The Unlicense
79 stars 15 forks source link

Fix stretched BGAs in 9th and 10th style #249

Closed JeffPaine4890 closed 1 year ago

JeffPaine4890 commented 1 year ago

Resolves #238

Only a couple things I'm not sure about:

  1. This greatly expands the range of where the vertices can be for the function to identify it as a BGA that needs to be fixed. I doubt this will be an issue because I can't think of any situation where any of the games play a video even remotely in those positions outside of a song, but you'd probably know better than me if there would be any issues on that front

  2. I did notice you were checking a lot of the vertex positions to a specific value +/- 0.1, in my implementation I simply used the values as the edge of a >= or <= case. Is that extra 0.1 margin of error necessary, or was that just implemented as a "just in case?" If you think it's necessary we could probably just bump the edges another 0.1 (i.e. instead of checking for between 164 and 168 we check for between 163.9 and 168.1)

If you need it for anything, here are the vertex positions for the 9th/10th videos:


single (9th and 10th)
165,0 476,0 476,415 165,415

double UL
 (9th) 11,24 137,24 137,192 11,192
(10th) 11,26 137,26 137,214 11,214

double DL
 (9th) 11,200 137,200, 137,368 11,368
(10th) 11,206 137,206, 137,394 11,394

double UR
 (9th) 500,24 626,24 626,192 500,192
(10th) 500,26 626,26 626,214 500,214

double DR
 (9th) 500,200 626,200 626,368 500,368
(10th) 500,206 626,206 626,394 500,394
icex2 commented 1 year ago

Thanks for the effort. I will squash merge that one later as the amont of changes is very small and the commit history is too detailed in this case. I will also try to improve readibility on that if-block because it's in pretty bad shape now.

Some learning/reading resources for future contributions as we see great value in a linear and well broken down git history for future reference:

There is a lot more out there, but these should serve as entry points to the different topics and knowing what you need to google for.

Take some time and have a read, I hope these are valuable and help.

JeffPaine4890 commented 1 year ago

Thanks for the links

As for the if block, when I was working on it I found it a great help just to put an empty line between the checks for vertices[0].x, vertices[0].y, vertices[1].x, etc. I wasn't sure if that would conflict with the existing code style so I removed all the blank lines before I committed. But maybe just putting some comments in there to separate things would help.

icex2 commented 1 year ago

Sorry for the late reply, life kept me busy during the week. I will move forward and merge your branch once I wrapped up some work of my own. I found a nice way to de-clutter the module and also improve the UV patching code to make it more readable.

If you are interested, you can take a peek at these helpers on my PR already. I want to copy-paste and tweak them for the UV patching.