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: resolution question for bezels/backdrops  (Read 1297 times)

0 Members and 1 Guest are viewing this topic.

sshaw10

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 42
  • Last login:July 11, 2021, 12:51:40 am
  • Oops!
resolution question for bezels/backdrops
« on: July 03, 2015, 02:38:33 pm »
I'm using a 27" LCD monitor in my cab, the windows resolution is 1366x768.  I was going to make a wood bezel and block out part of the screen that's not 4:3/3:4 but then I read about bezels and backdrops and figured I could create one that fills up the screen and have the game run in the center on top.  Then I could put control setup and game instructions or anything else on the sides instead of wasting that space. 

After much reading I made a lay file which works but here's what I can't figure out.  It appears the screen tag sets the resolution for the whole view.  I can't seem to set the backdrop to take up the whole screen and then get the game to run at it's default, optimal, resolution in the center.  Seems I need to set two bounds and w/h parameters for the backdrop and the game but you can only set one for the whole screen.  I wondered if I could define a second screen but that doesn't seem correct.  Hope this makes sense and many thanks to MrDo for all his efforts.

nexusmtz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 489
  • Last login:June 01, 2022, 03:14:22 am
Re: resolution question for bezels/backdrops
« Reply #1 on: July 04, 2015, 04:42:55 am »
You didn't include your layout file, so I can't be specifically helpful, but in general terms, the outermost bounds across all of the elements in the view (or the bounds of the view itself) set the 'canvas', if you will. The elements are then placed based on their own bounds, and everything scales up or down to your screen, keeping aspect.

In your case, your backdrop defines the overall canvas, and you want to place your game screen in the center of that canvas.

Here's a test layout, discussed below:
Code: [Select]
<!-- test.lay -->

<mamelayout version="2">
<element name="myback">
<image file="mybackdrop.png" />
</element>

<view name="Simple 4 3 in 16 9">
<screen index="0">
<bounds left="2" top="0" right="14" bottom="9" />
</screen>
<backdrop element="myback">
<bounds left="0" top="0" right="16" bottom="9" />
</backdrop>
</view>

<view name="Simple 3 4 in 16 9">
<screen index="0">
<bounds left="18.5" top="0" right="45.5" bottom="36" />
</screen>
<backdrop element="myback">
<bounds left="0" top="0" right="64" bottom="36" />
</backdrop>
</view>


</mamelayout>


Centering a full-height 4:3 (horizontal) screen on a 16:9 backdrop is easy to figure out. 4:3 is the same as 12:9, 16 total width minus 12 game-screen width equals 4, half of that is 2, so you need to start 2 in from the left (2), and end two in from the right (14).

For 3:4 (vertical), you can try to figure it out by 9ths, but it's easier to convert both ratios to 36ths (27:36 and 64:36) then apply the same math as above. 64-27=37, 37/2=18.5, start 18.5 from the left, end 18.5 from the right (45.5)

As you can see, MAME only needs the proportions. You could use actual numbers of pixels if that would make it easier, as would be the case if you had a picture of an arcade machine open in a paint program and could measure distances between elements, but it's all the same to MAME.


big10p

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 698
  • Last login:May 01, 2023, 01:46:23 pm
  • Mmmm, arcade classics!
Re: resolution question for bezels/backdrops
« Reply #2 on: July 04, 2015, 10:49:35 am »
I made some 'virtual cab' artwork packs specifically for use with widescreen LCD displays. They're all 1920x1080 but should work OK at lower res. May not be of use to you as your monitor is in a cab (so you'd have a virtual cab inside a cab  :P) but they're here for anyone to download, if you like:

http://www.jammaplus.co.uk/forum/forum_posts.asp?TID=62800&title=mame-virtual-cab-widescreen-artwork

sshaw10

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 42
  • Last login:July 11, 2021, 12:51:40 am
  • Oops!
Re: resolution question for bezels/backdrops
« Reply #3 on: July 04, 2015, 03:16:43 pm »
Thanks Nexus and Big, I did download the virutal's, they are amazing and very helpful!

I've managed to get what I want but I think I'm doing it the hard way.  Here's a simple lay file and my thoughts how I came up with it below.

<mamelayout version="2">
   <element name="backdrop">
      <image file="testbdrop.png" />
   </element>
   <view name="test_view">      
         <backdrop element="backdrop">
         <bounds left="0" top="0" right="1366" bottom="768" />
         </backdrop>      
   <screen index="0">
                 <bounds left="171" top="0" right="1195" bottom="768" />
         </screen>
         </view>
</mamelayout>

Here's how I put it together.  Windows resolution is 1366x768, LCD 16:9 monitor.  I made a png file that size, testbdrop.png.  I'm testing on Asteroids Deluxe, game is 4:3.  I want the game to fill the Y, so I know Y will be 768, at 4:3 the X should be 1024.  I made a 0 transparency square 1024x768 starting at 171, ending 1195.

It works but from what I've read I think I'm making it too complicated.  And I realize it would only work on this setup wtih specific pixel callouts.  If you can offer any other advice I'd be grateful.  Thanks for taking the time!

Steve

nexusmtz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 489
  • Last login:June 01, 2022, 03:14:22 am
Re: resolution question for bezels/backdrops
« Reply #4 on: July 04, 2015, 05:47:20 pm »
Steve,

You've got the concept, and doing it in pixels isn't any more complicated nor is it less valid. It'll look the same as mine. Your logic is fine.

Keep in mind that MAME scales the whole layout. It's just math. Your view isn't locked into 1366x768 any more than mine is locked to a 16 pixel by 9 pixel monitor(!). Both views would look basically the same on a 1920x1080 monitor as they do on your monitor. The game screen would be marginally sharper, and your backdrop could have slight resizing artifacts, but everything would be where you want it to be. If you run on something like a 1920x1200 monitor (16:10), you'll have 60px horizontal bars on the top and bottom, but otherwise, the output will be the same as on the 1920x1080.

One thing I'd suggest is that although my example used a backdrop, what you're doing is more of a bezel. Since you've already put the transparency square in, just change the view to use your element as a bezel instead of backdrop.

sshaw10

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 42
  • Last login:July 11, 2021, 12:51:40 am
  • Oops!
Re: resolution question for bezels/backdrops
« Reply #5 on: July 05, 2015, 02:29:16 am »
Yea, had the same thought about bezel but started with backdrop so kept it that way.  Thanks so much Nexus, greatly appreciated!