Build Your Own Arcade Controls Forum
Main => Main Forum => Topic started by: sshaw10 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.
-
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:
<!-- 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.
-
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 (http://www.jammaplus.co.uk/forum/forum_posts.asp?TID=62800&title=mame-virtual-cab-widescreen-artwork)
-
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
-
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.
-
Yea, had the same thought about bezel but started with backdrop so kept it that way. Thanks so much Nexus, greatly appreciated!