Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: artwork fill edges hack  (Read 2024 times)

0 Members and 1 Guest are viewing this topic.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
artwork fill edges hack
« on: July 26, 2004, 02:42:05 pm »
ok, I finally got mame source and compile environment.  I am compiling mame as we speak to get a base.  I will be looking at my fill edges hack.  However, from what I see it should be correct.  I do think I know how to get rid of the global variable that is used (generally that is a programming no no).  Will keep you up to date.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #1 on: July 26, 2004, 06:40:42 pm »
Ok, I used sticky notes on my coputer screen to test this out.  It seems to be working fine.  Now I am going to try and tweak it :)

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #2 on: July 26, 2004, 09:49:12 pm »
update!
http://free.hostdepartment.com/S/SirPoonga/hacks.html#7


Tiger-Heli, let me know :)  It works fine for me.
« Last Edit: July 27, 2004, 12:52:38 am by SirPoonga »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19431
  • Last login:Today at 12:40:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:artwork fill edges hack
« Reply #3 on: July 27, 2004, 12:42:34 am »
sweet

since i have to muck about in the mame code again, i'll go ahead and try it too

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #4 on: July 27, 2004, 08:09:33 am »
update!
http://free.hostdepartment.com/S/SirPoonga/hacks.html#7


Tiger-Heli, let me know :)  It works fine for me.
I probably did something wrong - I clicked the link and the art.txt file opened (http://free.hostdepartment.com/S/SirPoonga/art.txt).  I copied the text part of this and pasted it into notepad and saved it as C:\mingw\mame\art.txt.  Then I ran patch -u -p 1 -i art.txt and got:

patch unexpectedly ends in middle of line
patch: ***** Only garbage was found in the patch input.

Could you maybe .zip up the art.txt file?
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #5 on: July 27, 2004, 10:29:40 am »
Right click the link to the art file and save as :)

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #6 on: July 27, 2004, 10:52:48 am »
Right click the link to the art file and save as :)
Got it, when I right-clicked, it wanted to save as art.txt.html, but I changed it to save as text and it worked.  Compiling now. . .
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #7 on: July 27, 2004, 11:36:50 am »
I will be making a new version as I found a better way to do something.  It output at command prompt, if you have turned verbose on, all the numbers generated from the calculations.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #8 on: July 27, 2004, 12:07:54 pm »
Here's version 1.  Version 2 will be cross platform :)
You don't need verbose on to output the calculations, it wouldn't be crossplatform then.
Version 3 will handle letterboxed games.
« Last Edit: July 27, 2004, 12:09:52 pm by SirPoonga »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #9 on: July 27, 2004, 07:49:13 pm »
Ok, version 2, this *should* be cross platform, assuming the person edits the appropiate files in the OS specific folder.  IE /src/windows or /src/dos

This has preliminary letterbox support.  Since I don't have a good way of testing it I am not for certain it works.  I did some basic testing by putting in 4:2 and 3:5 into screen_aspect in the mame.ini file and using pacman and ddragon2 to test (with the -ror flag too).  Plus I don't see the need for it right now.  HowardC suggested you capcom fighter people will put the moves on screen as the bezel.  Technically those games are letterboxed even though mame doesn't say so.  Anyway, if you are going to do that you are going to make a custom bezel and won't benefit from this hack anyway.

This current code is a little bloats, I know I could write alot of it in shorthand to make it tighter.  But it still works.  It doesn't use OS specific variables in the /src / files anymore.

I will put this up on my website when I get around to it :)

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #10 on: July 27, 2004, 07:54:08 pm »
E:\mamedev\mameart>mame 1942
OK.
parsing 1942.ini...N/A
Using DirectInput 7
Keyboards=1  Mice=1  Joysticks=2 Lightguns=0
Mouse support enabled
Joystick support disabled
Keyboards=1  Mice=1  Joysticks=0
Game want to be 4:3 = 1.333333
screen_aspect is 1.333333
Game is not rotatedSwapped X and Y
New game aspect is 0.750000
rotation=0 flags=4 orientation=6 ROT0=0 ROT90=5 ROT180=3 ROT270=6
vector_width=480 vector_height=640
original_width=256 original_height=224
temp=341.333344 delta_height=58.500000
min_x=0.000000 max_x=1.000000 min_y=-0.261161 max_y=1.261161
new params->width=256 new params->height=341
new params->aspect_x=300 new params->aspect_y=400
Hardware stretching supported
Best mode = 640x480x32 @ default Hz
Primary surface created: 640x480x32 (R=00ff0000 G=0000ff00 B=000000ff)
Blit surface created: 359x258x32 (R=00ff0000 G=0000ff00 B=000000ff)
Primary buffer: 44100 Hz, 16 bits, 1 channels
SSE supported
Sound buffer: overflows=1 underflows=0
Average FPS: 55.151855 (276 frames)
« Last Edit: July 27, 2004, 07:57:28 pm by SirPoonga »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #11 on: July 27, 2004, 07:58:21 pm »
E:\mamedev\mameart>mame ddragon -ror
OK.
parsing ddragon.ini...N/A
Using DirectInput 7
Keyboards=1  Mice=1  Joysticks=2 Lightguns=0
Mouse support enabled
Joystick support disabled
Keyboards=1  Mice=1  Joysticks=0
Game want to be 4:3 = 1.333333
screen_aspect is 1.333333
Game is rotated
New game aspect is 0.750000
X and Y not swapped
rotation=1 flags=0 orientation=5 ROT0=0 ROT90=5 ROT180=3 ROT270=6
vector_width=480 vector_height=640
original_width=240 original_height=224
temp=320.000010 delta_height=48.000000
min_x=0.000000 max_x=1.000000 min_y=-0.214286 max_y=1.214286
new params->width=240 new params->height=320
new params->aspect_x=300 new params->aspect_y=400
Hardware stretching supported
Best mode = 640x480x32 @ default Hz
Primary surface created: 640x480x32 (R=00ff0000 G=0000ff00 B=000000ff)
Blit surface created: 338x242x32 (R=00ff0000 G=0000ff00 B=000000ff)
Primary buffer: 44100 Hz, 16 bits, 1 channels
SSE supported
Sound buffer: overflows=33 underflows=0
Average FPS: 4.242711 (86 frames)

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #12 on: July 27, 2004, 08:14:44 pm »
I was going to see what llander would do but I can't get it to work.  Mind you it work in my vanilla mamepp 0.84, but not in the 0.83 with the arthack I have been using.  I only have 0.83 source.  Did llander change recently?  Or does 0.83 have issues with the Starroms version?  0.84 doesn't.  hmmm...

Edit:  If you notice I am using games I own :)
« Last Edit: July 27, 2004, 08:16:08 pm by SirPoonga »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #13 on: July 27, 2004, 09:22:00 pm »
To go with the theme of games I own (and since the bezel comes form *my* machine :) )

E:\mamedev\mameart>mame ddragon2 -ror
OK.
parsing ddragon.ini...N/A
parsing ddragon2.ini...N/A
Using DirectInput 7
Keyboards=1  Mice=1  Joysticks=2 Lightguns=0
Mouse support enabled
Joystick support disabled
Keyboards=1  Mice=1  Joysticks=0
Game want to be 4:3 = 1.333333
screen_aspect is 1.333333
Game is rotated
New game aspect is 0.750000
X and Y not swapped
rotation=1 flags=0 orientation=5 ROT0=0 ROT90=5 ROT180=3 ROT270=6
vector_width=600 vector_height=800
original_width=240 original_height=224
temp=320.000010 delta_height=48.000000
min_x=0.000000 max_x=1.000000 min_y=-0.214286 max_y=1.214286
new params->width=240 new params->height=320
new params->aspect_x=300 new params->aspect_y=400
Hardware stretching supported
Best mode = 800x600x32 @ default Hz
Primary surface created: 800x600x32 (R=00ff0000 G=0000ff00 B=000000ff)
Blit surface created: 338x242x32 (R=00ff0000 G=0000ff00 B=000000ff)
Primary buffer: 44100 Hz, 16 bits, 1 channels
SSE supported
Sound buffer: overflows=1 underflows=0
Average FPS: 23.098473 (166 frames)
« Last Edit: July 27, 2004, 09:34:36 pm by SirPoonga »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #14 on: July 27, 2004, 09:28:49 pm »
Ok, new and improved version.  This should be it for awhile.


Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #15 on: July 28, 2004, 06:54:37 am »
Ok, new and improved version.  This should be it for awhile.
Screenshots look good, will test later - RL getting busy now.

Dumb question - What is a letterbox game?
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #16 on: July 28, 2004, 10:31:07 am »
Letterbox, you know what a letterbox movie is?  Like watching a 16:9 movie ona  4:3 screen.  There are very few games like this, none that have bezels on the mame.net artwork page that I know of right now.  Any game where the game aspect is greater than the screen aspect.  16/9=1.777777777  4/3=1.3333333333

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #17 on: August 02, 2004, 09:13:43 am »
Ok, new and improved version.  This should be it for awhile.
Finally got around to testing this, and it doesn't seem to be working right.  Tested 1942 and Galaxian - games were 450x600 with no artwork - with artwork, games are approximately 525x600 - Weird.

(I rounded off, I was actually measuring 447x600 without artwork, and 521-524 with.)
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #18 on: August 02, 2004, 10:34:29 am »
Update: I downloaded your previous screenshots and you can see the same problems with your 1942 screenshot.  (I realize that was probably with Version 2 of the software and I tested with Version 3).

Your screenshot is 341x256 pixels, which is 4:3 ratio.  So if the game screen is 256 pixels high, the game image should be 192x256 pixels using a 3:4 ratio.  But the measured screen from your shot is 230x256.

BTW, 525x600 comes out to a .875 or a 7:8 aspect ratio, if this has any significance.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #19 on: August 02, 2004, 11:08:35 am »
You are right, and I know why now.  Hmm, I guess I originally was testing with the wrong game.  I usually use pacman and double dragon 2  to test this.  It's raw values must be very close to 4:3 because all I did was put sticky notes on the screen to indicate edges, was a better method than taking a screenshot and measuring :)

But I can't believe I didn't look at 1942 more closely, it's obviously not 4:3.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #20 on: August 02, 2004, 11:40:20 am »
You are right, and I know why now.  Hmm, I guess I originally was testing with the wrong game.  I usually use pacman and double dragon 2  to test this.  It's raw values must be very close to 4:3 because all I did was put sticky notes on the screen to indicate edges, was a better method than taking a screenshot and measuring :)

But I can't believe I didn't look at 1942 more closely, it's obviously not 4:3.
Yep, oddly, I just tested PacMan and it comes out at 463x597, which is much closer to the 450x600 desired number.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #21 on: August 02, 2004, 01:05:23 pm »
Do this, get 1942's artwork.  Run in it mame full artwork on (no crop, no fill edges.  
Fow, keepaspect on.  Run the game like "mame 1942" and "mame 1942 -ror".  Everything seems fine, huh?
now turn keepaspect OFF.  That is odd?

Oh, if oyu take screenshots of these mame will output the non keepaspect version out.  So mame is stretching the screen somehow.  Oh, put skip_gameinfo to 0 and you can see mame is stretching as the text for the info screen is stretched.

Anyway, ok, back to the problem.
I tried this
"mame 1942" with keepaskect on and off.
Note how mame stretches the screen with artwork.  Why it isn't doing that with filledges I don't know.  That's all handled in the windows specific stuff.  artwork.c is a general mame file in the /src/ folder.  keepaspect is handled in video.c, window.c and wind3d.c which are all in the /src/windows/ foilder i.e. they are windows specific stuff.  SO how keep aspect isn't keeping aspect when the fill edges is on I don't know.  hmmmm.  i may have to retire this hack for now.  I don't know if it is possible to do without rewriting a bunch of stuff.
« Last Edit: August 02, 2004, 01:07:14 pm by SirPoonga »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #22 on: August 02, 2004, 01:51:43 pm »
Did some more testing - I don't see quite where you are going, but I do see what you mean.  The problem appears to be in MAME itself.

FWIW, if you run the games with -fill_edges and -crop on, then -keepaspect doesn't do much of anything at all . . .  (Might try with Centipede and whoa -  Centipede gets badly stretched by the new hack - goes to 566x600 or 577x600 with keepaspect on/off).  I don't remember it being stretched this much with the previous version of the hack . . .  hmmmmmn

Do this, get 1942's artwork.  Run in it mame full artwork on (no crop, no fill edges.  
Fow, keepaspect on.
Interesting, game artwork displays as 426x600, game is 241x305, but should be 225x305 if a 4:3 aspect is preserved, so MAME is wrong at this point.
Quote
Run the game like "mame 1942" and "mame 1942 -ror".  Everything seems fine, huh?
Uh, no - artwork is 800x570 (sideways), game is 408x325 (sideways), should be 408x305 for 4:3
Quote
now turn keepaspect OFF.  That is odd?
Didn't see a big change - artwork stretches more vertically to 800x600, game screen goes to 408x343.
Quote
Oh, if oyu take screenshots of these mame will output the non keepaspect version out.  So mame is stretching the screen somehow.  Oh, put skip_gameinfo to 0 and you can see mame is stretching as the text for the info screen is stretched.
Didn't quite follow you, but F12 screenshots are not useful for this - I use PrntScrn and then paste into Irfanview.
Quote
i may have to retire this hack for now.  I don't know if it is possible to do without rewriting a bunch of stuff.
From what I can see, the hack seems to work pretty well, but I don't see a huge difference from what was in NoName before.  It is not staying at 450x600, but neither is MAME with artwork on.  And Centipede seems like it was better before.  I might try to go back to the older NoName version of it, if it's still available. . .

Let me know if I can test anything else out!!!
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #23 on: August 02, 2004, 02:03:39 pm »
Ok, I figured a little bit out.  I started from scratch again, thinking I over thought this.

In vanilla mame, if you turn artwork on and turn artwork_crop off you see this code (will explain in english):

Code: [Select]
if (!options.artwork_crop)
      for (piece = artwork_list; piece; piece = piece->next)
      {
         if (piece->left < min_x) min_x = piece->left;
         if (piece->right > max_x) max_x = piece->right;
         if (piece->top < min_y) min_y = piece->top;
         if (piece->bottom > max_y) max_y = piece->bottom;
      }

Let me explain that to you non programmer types.  It is selft explanitory for the most part.  What it is saying IF options.artwork_crop is off then go through this loop.  The for loop goes through each artwork piece.  If the current min_x, max_x, min_y, or max_y is within the artowrk boundries make the mins and maxs the same as the artwork.

Now, what is the mins and maxs, that's the quesiton.  I thought it meant viewable area.  So, I added if artwork_crop is on and filledges is on that I'd just check either min and max of X or Y, but not both (depending on orientation of the game).  IF I'd only do two of those  if statements, not all 4.  So, using 1942 as an example, remembering it is rotated, I need to check the height restraints and make the edges of the height equal to the edges of the artwork.  THAT WORKED!!  I thought, cool, it works.  Then I tried gyruss.  Ok, the aspect ratio of the game screen was kept BUT the entire left and right artwork shown.  to we got a letterbox effect since the artwork:gamescreen is much wider than 4:3.  In pacman with the artwork was thinner than 4:3.

SO, I will have to figure a way to crop the art.  That might be a little involve as it does depend on if the person has keepaspect on.  I also may thin hwstretch may effect this too.  This will make it much more complex.  I will have to relook into this hack in the future,  right now I don't have the time to figure in keepaspect and possibly hwstretch.  More experimenting will need to be done.  I may have to put contrainsts on that filledges will only work if keepaspect is on and hwstretch on.

I just did some hwstretch tests, yeah, that would need to be taken into acocunt if turned off.  I will probably have to put constraints on conditions for filledges to work.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #24 on: August 02, 2004, 02:24:11 pm »
It might help to see Reply #21 from me in this thread:
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=21170;start=msg172564#msg172564
Ok, I figured a little bit out.  I started from scratch again, thinking I over thought this.

In vanilla mame, if you turn artwork on and turn artwork_crop off you see this code (will explain in english):

[code]
if (!options.artwork_crop)
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #25 on: August 02, 2004, 02:33:28 pm »
mame does keepaspect anf hwstetch even if artowrk is turned on.  take 1942 for example.  turn artwork on (no crop) and change between keepspect from on and off.  You will see it keeps aspect with artwork turned on.

With what I was doing, I was determining what artwork to show based off game width and height, which I thought was already calculated based on keepaspect.  But I was wrong.  Hence why the game aspect wasn;t kept BUT the artwrok filled the screen beautifully.

I will have to do more thinking on this.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #26 on: August 02, 2004, 03:03:53 pm »
mame does keepaspect anf hwstetch even if artowrk is turned on.  take 1942 for example.  turn artwork on (no crop) and change between keepspect from on and off.  You will see it keeps aspect with artwork turned on.
Nope, I have to disagree.  Run any vertical game with -keepaspect and -hwstretch on.  MAME displays at 450x600 like it should (447, 449, but that's just noise in the measurement.)

Look at my numbers above for 1942 with -keepaspect on and artwork on but no crop or filled edges.  The game artwork is 425x600, which is 17:24 aspect ratio, not 4:3.  The game image itself is 241x305 which is .79 instead of .75, so neither the artwork nor the game screen is preserving the aspect ratio.
Quote
I will have to do more thinking on this.
Let me know if I can help any.  (Doubtful).
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #27 on: August 02, 2004, 03:14:26 pm »
mame does keepaspect anf hwstetch even if artowrk is turned on.  take 1942 for example.  turn artwork on (no crop) and change between keepspect from on and off.  You will see it keeps aspect with artwork turned on.
Nope, I have to disagree.  Run any vertical game with -keepaspect and -hwstretch on.  MAME displays at 450x600 like it should (447, 449, but that's just noise in the measurement.)

Look at my numbers above for 1942 with -keepaspect on and artwork on but no crop or filled edges.  The game artwork is 425x600, which is 17:24 aspect ratio, not 4:3.  The game image itself is 241x305 which is .79 instead of .75, so neither the artwork nor the game screen is preserving the aspect ratio.

How are you getting these numbers again?

Are you doing a screencapture using mame's F12 or using windows printscreen?
Then you are using something like photoshop to get coordinates, right?

if you are doing it with F12 you aren't going to get right numbers, mame is dumping the raw unstretched image.  If you are using prntscrn button then you will get better results.  

Anyway, I tested with stickies notes ont he screen on the edge of the game field, with artwork on the screen edge was exactly the same with the artowrk off when keepaspect was turned on.  SO it is keeping aspect.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #28 on: August 02, 2004, 04:18:52 pm »
mame does keepaspect anf hwstetch even if artowrk is turned on.  take 1942 for example.  turn artwork on (no crop) and change between keepspect from on and off.  You will see it keeps aspect with artwork turned on.
Nope, I have to disagree.  Run any vertical game with -keepaspect and -hwstretch on.  MAME displays at 450x600 like it should (447, 449, but that's just noise in the measurement.)

Look at my numbers above for 1942 with -keepaspect on and artwork on but no crop or filled edges.  The game artwork is 425x600, which is 17:24 aspect ratio, not 4:3.  The game image itself is 241x305 which is .79 instead of .75, so neither the artwork nor the game screen is preserving the aspect ratio.
How are you getting these numbers again?
Are you doing a screencapture using mame's F12 or using windows printscreen?
Windows Printscreen
Quote
Then you are using something like photoshop to get coordinates, right?
Right.  Actually, just pasting into IrfanView and selecting the screen area.  Irfanview displays the size of the selection area at the top of the screen.
Quote
if you are doing it with F12 you aren't going to get right numbers, mame is dumping the raw unstretched image.  If you are using prntscrn button then you will get better results.  
Agreed.  F12 is pretty useless for this.
Quote
Anyway, I tested with stickies notes ont he screen on the edge of the game field, with artwork on the screen edge was exactly the same with the artowrk off when keepaspect was turned on.  SO it is keeping aspect.
You are talking same game displayed vertically, -keepaspect on and -artwork on or off without -crop or filled edges, correct?  I'll test some more:

Previously, I was using the gameinfo screen for the artwork off measurements, but I'll try to use the game screen from now on.

1942:
Artwork off: 447x597 pixels
Artwork on:
Artwork: 425x597
Game: 244x305
Neither is 4:3

Centipede:
Artwork off: 451x595 pixels (difficult to tell b/c of the black background)
Artwork on:
Artwork: 476x596
Game: 333x461
Neither is 4:3

Galaxian:
Artwork off: 448x598 pixels (difficult to tell b/c of the black background, used sizing screen at startup)
Artwork on:
Artwork: 575x590 pixels
Game: 338x465
Neither is 4:3

Gyruss:
Artwork off: 448x598 pixels (difficult to tell b/c of the black background, used sizing screen at startup)
Artwork on:
Artwork: 758x599 pixels
Game: 422x484
Neither is 4:3

Pac-Man:
Artwork off: 450x599 pixels
Artwork on:
Artwork: 567x597 pixels (might be off due to the black border)
Game: 311x433
Neither is 4:3

None of them work the way you said.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #29 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).
« Last Edit: August 03, 2004, 12:09:29 am by SirPoonga »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #30 on: August 03, 2004, 06:38:53 am »
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).
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
« Last Edit: August 03, 2004, 06:55:08 am by Tiger-Heli »
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #31 on: August 04, 2004, 06:52:29 am »
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.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:artwork fill edges hack
« Reply #32 on: August 04, 2004, 12:56:52 pm »
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.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:Yesterday at 09:09:24 pm
  • The Bears Still Suck!
Re:artwork fill edges hack
« Reply #33 on: August 04, 2004, 04:26:32 pm »
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

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19431
  • Last login:Today at 12:40:39 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:artwork fill edges hack
« Reply #34 on: August 04, 2004, 04:35:08 pm »
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.