MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM
Re: Another annoying MAME code question
02/11/11 07:55 PM


> You're missing that MAME scales the game to appear in the correct aspect ratio on
> your monitor. If you're using a common 16:9 or 16:10 flat panel, that's going to skew
> the calculations (but the results are correct). One of the video options in the tab
> menu turns that off, I forget what it's called off hand.

Thanks guys, I really appreciate the quick feedback.

I am using my own custom SDL implementation; and as far as I know I've never told MAME the aspect ratio of my monitor, and I don't know how it would ever know. I am just calling:

render_target_set_bounds(g_state.target, 10000, 10000, 1.0);

My goal is to get MAME to fit the game perfectly into a 10000 x 10000 square; then in my SDL implementation I divide the render primitive's bounds coordinates by 10000 to bring it into a unit square. I'm using OpenGL to render the pixmap as a texture on the screen and having the bounds of the texture be circumscribed in a unit square just fits with the way I do things (I render the running game in a virtual arcade cabinet off in the distance and when the user wants to play I 'zoom' into it and bring it to full screen).

I use 10000x10000 for the render_target because I want to try to avoid rounding errors when MAME generates bounding coordinates internally.

Maybe there is some other call or something that I am supposed to be using to tell MAME the aspect ratio of the virtual screen to which it should be rendering? Is it assuming 4:3 internally somewhere unless I tell it otherwise? And if so, why isn't setting the render_target to being perfectly square and with a 1.0 pixel aspect ratio sufficient for this?

As it stands what I do is just take the game's aspect ratio and use that to compute my own region circumscribed by a unit square into which to render each frame's texture. This works great for all of the games I have tried, but a) it is duplicating something that I think MAME is already doing, which is computing how to circumscribe the game in a screen, and b) I wouldn't be surprised if there are multi-texture games in which MAME generates two textures per frame, one for each half of the screen, due to having to video chips being emulated which each in the original game rendered half the screen, and in that case, my technique is going to fail because I'll put both textures to full screen.







Entire thread
Subject Posted by Posted on
* Another annoying MAME code question Bryan Ischo 02/11/11 10:45 AM
. * Re: Another annoying MAME code question Bryan Ischo  02/11/11 08:31 PM
. * Re: Another annoying MAME code question Bryan Ischo  02/11/11 08:41 PM
. * Re: Another annoying MAME code question R. Belmont  02/12/11 01:29 AM
. * Re: Another annoying MAME code question AaronGiles  02/11/11 05:21 PM
. * Re: Another annoying MAME code question Bryan Ischo  02/11/11 08:13 PM
. * Re: Another annoying MAME code question AaronGiles  02/11/11 08:58 PM
. * Re: Another annoying MAME code question Bryan Ischo  02/11/11 09:08 PM
. * Re: Another annoying MAME code question R. Belmont  02/11/11 10:50 PM
. * Re: Another annoying MAME code question Bryan Ischo  02/12/11 01:05 AM
. * Re: Another annoying MAME code question R. Belmont  02/11/11 05:15 PM
. * Re: Another annoying MAME code question Bryan Ischo  02/11/11 07:55 PM
. * Re: Another annoying MAME code question R. Belmont  02/11/11 10:51 PM
. * Re: Another annoying MAME code question Bryan Ischo  02/12/11 01:38 AM
. * Re: Another annoying MAME code question AaronGiles  02/12/11 02:59 AM
. * Re: Another annoying MAME code question R. Belmont  02/13/11 03:37 AM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 33 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2679