MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

Mamesick
Troll Lamer
Reged: 09/21/03
Posts: 1649
Loc: Italy
Send PM


A humble question about MAME video emulation...
#308235 - 05/03/13 09:18 AM


Sorry, but the documentation in source is pretty vague. What I'd like to know is which is the default for the VIDEO_UPDATE calls in MAME. I mean: if I want the screen redrawn *after* VBLANK, have I to specify the attribute VIDEO_UPDATE_AFTER_VBLANK or is this already the default? You know that the other option is VIDEO_UPDATE_BEFORE_VBLANK. And also, does it call a particular function (e.g. SCREEN_EOF) and have I to specify it or is it enough define a SCREEN_UPDATE with the necessary routines to draw the screen and then leave MAME do the rest by itself?
Last (maybe more stupid) question: to have a perfect VBLANK, is it enough have SCREEN_REFRESH and SCREEN_SIZE parameters or is better use the macro VIDEO_RAW_PARAMETERS? Which of the two options could be more accurate?
Note that I used the old macros in this post to be the clearest possible, I know they are changed during the C++ rewrite but this is not a problem.
Thanks thanks in advance.



Phil Bennett
L'Emuchat
Reged: 04/20/04
Posts: 888
Send PM


Re: A humble question about MAME video emulation... new [Re: Mamesick]
#308237 - 05/03/13 10:54 AM


> Sorry, but the documentation in source is pretty vague. What I'd like to know is
> which is the default for the VIDEO_UPDATE calls in MAME. I mean: if I want the screen
> redrawn *after* VBLANK, have I to specify the attribute VIDEO_UPDATE_AFTER_VBLANK or
> is this already the default? You know that the other option is
> VIDEO_UPDATE_BEFORE_VBLANK.

In the absence of documentation, screen.c/h is the place to look as it's where much of the video magic happens.

VIDEO_UPDATE_BEFORE_VBLANK is the default attribute.


> And also, does it call a particular function (e.g.
> SCREEN_EOF) and have I to specify it or is it enough define a SCREEN_UPDATE with the
> necessary routines to draw the screen and then leave MAME do the rest by itself?

The screen update callback is always called. You can however specify additional callbacks that will trigger at both the start and end of VBLANK using MCFG_SCREEN_VBLANK_STATIC(...) or screen_device::register_vblank_callback().


> Last (maybe more stupid) question: to have a perfect VBLANK, is it enough have
> SCREEN_REFRESH and SCREEN_SIZE parameters or is better use the macro
> VIDEO_RAW_PARAMETERS? Which of the two options could be more accurate?
> Note that I used the old macros in this post to be the clearest possible, I know they
> are changed during the C++ rewrite but this is not a problem.
> Thanks thanks in advance.

SCREEN_RAW_PARAMETERS should be used if video timings are known. While not necessarily more accurate at this point in time, it better documents the hardware.

Edited by Phil Bennett (05/03/13 11:01 AM)



Mamesick
Troll Lamer
Reged: 09/21/03
Posts: 1649
Loc: Italy
Send PM


Re: A humble question about MAME video emulation... new [Re: Phil Bennett]
#308239 - 05/03/13 12:52 PM


Great explanation. You deserve a beer from me. Thank you.


Pages: 1

MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

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