Main > Software Forum
artwork fill edges hack
Tiger-Heli:
--- Quote from: SirPoonga on August 02, 2004, 11:59:51 pm ---hmmm, well, that sounds like something that needs to be reported to the mamedev if the game isn't keeping aspect. because you can definately tell it is trying when you turn on and off keepaspect while the artwork is on. (no crop with hwstretch).
--- End quote ---
It's trying to, but it's not getting there. Agree that it makes a difference. Just from reference I ran 1942 with hwstretch and no crop and no keep aspect:
Artwork: 800x600 pixels
Game screen: 455x307 pixels (it's not even a vertical game anymore).
I would guess it might have something to do with the "open area" on the artwork, but I think I previously tried making this area 4:3 and it didn't help.
I'll ask on www.mame.net about this and see what happens. . .
UPDATE: mame.net post is here
Tiger-Heli:
No bites on the www.mame.net thread, but I think I know what is happening. I also think the best option would be to go back to what NNM was previously using as it was less complicated and actually seemed to work better.
Now, this is all ASSumption. No replies on MAME.net. I don't understand the source, and I haven't done any empirical testing, but it SEEMS logical to me. (on the other hand, when I was modifying art files to get this set up, MAME seems to be 50 pixels too wide with art turned on, and I was modifying the art for what I thought MAME should see, so I might be completely off here.)
What I do know is MAME only uses 4 points to scale the artwork. The upper left corner of the bezel, the lower right corner of the bezel, the upper left corner of the bezel cutout (alpha mask), and the lower right corner of the bezel cutout.
What I THINK is happening is MAME is scaling the artwork to fit the screen (with or without keep aspect) and then scaling the gamescreen to fit the scaled bezel cutout space. The problem is that the bezel cutout (in the .png file and in real life) may not be in the proper 4:3 ratio.
For an exaggerated example, lets ASSume we have a vertical game with a square bezel of 300x300 with a cutout of 100x100. What I THINK will happen is:
With -keepaspect on, MAME will stretch the artwork vertically to 600 pixels and horizontally to 600 pixels. This results in a 200x200 cutout which MAME will display the game in.
With -keepaspect off, MAME will stretch the artwork to 800x600, stretching it horizontally, and will stretch the game screen to 800/300*100 or 266x200 pixels and display the game on this screen.
To preserve the games aspect ratio, one of the following four options could be implemented (in the example above):
1) You could change the .art file to specify a 75x100 pixel cutout. This would result in a 150x200 game image with -keepaspect on, and 25 pixel black vertical bars on either side of the image. (You would likely get "letterboxing" with this method in any case, unless your art just happened to have a perfect 4:3 cutout area.)
2) You could add a new function -keep_game_aspect ratio, which would just recalculate this inside of MAME and do the same thing.
3) You could Photoshop the art to expand the artwork to ensure the cutout conformed to the 4:3 ratio and re-calculate the .art file values. This might look funny, and might not be accurate, and would probably never be able to be posted to www.mame.net.
4) You could add a new function to MAME to do the above, but I think the calculations would be complicated, and I don't know that the end result would be desirable.
In summary, I will try to test this out, but I suspect that the 5-10% stretch or shrink looks better than the letterboxing that would result from the above, so we probably should go back to how artwork_fill_edges used to work.
Tiger-Heli:
Ignore my previous post, I'm totally confused now - I did some testing. . .
First - for the five games I tested earlier, I compared the bezel cutout aspect ratio to the game displayed aspect ratio. Based on the previous post, I would expect these to be similar. They weren't, but without "reverse engineering" the .art file numbers I can't say this is wrong.
Now the interesting second test - I took 1943's artwork and modified it to be 1000 pixels by 1000 pixels with a 500x500 pixel game image. This created a .art file with the following values: -0.5000,-0.5000,1.5000,1.5000
Then I ran MAME:
With keep aspect on - the artwork displayed at 450x600, or exactly 3:4 (instead of 600x600 like I predicted) and the game displayed at 225x300, or exactly 3:4, instead of 300x300 like I would have predicted.
With keep aspect off, the artwork stretched to 800x600 and the game stretched to 400x300 (4:3) more or less as expected.
I'm pretty lost now.
SirPoonga:
Basically it comes down to what I said. keep aspect code is trying to keep the aspect, but doesn't always do it right.
Howard_Casto:
Keep aspect has always had problems. It probably always will. However I believe some major overhauling of the artwork.c happened in 84u6. That might help some I dunno.