MAME 1.20 & 1.48 overlay messy screen problem
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    Hello

    After long absence due lack of proper hardware i'm back as MorphOS user.
    I had Pegasos 2 which died almost 9 years ago and was with MorphOS 2.5.
    Now i have PowerMac G5 with MorphOS 3.11.

    But after running MAME, even older 1.20 version which was working fine on Peg2/MOS2.5, now i have problem with some games with vertical screen (e.g. Cyvern and Air Gallet). When running in window mode everything is ok, but in fullscreen overlay mode game have messed screen. It looks like vertical synchronization is wrongly made with every next line and picture is "twisted" or "bended" to right. It's probably some differences in overlay handling between 2.x and 3.x system versions.

    Is there any possibility to "backward compatibility" with overlay or something like this?
    Or maybe patch for this?

    If someone is interested in helping/fixing/etc i can make full list of games with this problem.

    [ Edited by Solo_Kazuki 26.04.2019 - 08:26 ]
  • »20.04.19 - 10:53
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    KennyR
    Posts: 636 from 2003/3/4
    From: #AmigaZeux, Gu...
    It actually sounds more a bug in the driver for your graphics card than it does a non backward-compatible function. You weren't clear, but was the newer version of Mame working correctly?

    What card is it, and is everything that uses full screen modes effected?
  • »20.04.19 - 20:17
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    Hello

    No, both versions are working the same in these cases. It's standard Radeon 9600 64MB version from PowerMac G5. It's only in some games, mainly (or only) in games with vertical screens, so mostly vertical shooters.
  • »20.04.19 - 20:42
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    KennyR
    Posts: 636 from 2003/3/4
    From: #AmigaZeux, Gu...
    Are we talking fully diagonal skewing or the screen, or just ordinary screen tearing?

    If it's screen tearing, it means your graphics card mode refresh rate and your monitor refresh rate aren't synced. The fix for that is to fix the frame rate, if possible, in the application. And make sure all your defined screenmodes are the same as your monitor (mainly 60 Hz for LCD).

    If it's not screen tearing, it's a bug. I don't have direct contact with the MorphOS developers but your problem has been passed on nonetheless.
  • »21.04.19 - 14:43
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Stevo
    Posts: 819 from 2004/1/24
    From: #AmigaZeux
    Quote:

    KennyR wrote:
    Are we talking fully diagonal skewing or the screen, or just ordinary screen tearing?

    If it's screen tearing, it means your graphics card mode refresh rate and your monitor refresh rate aren't synced. The fix for that is to fix the frame rate, if possible, in the application. And make sure all your defined screenmodes are the same as your monitor (mainly 60 Hz for LCD).

    If it's not screen tearing, it's a bug. I don't have direct contact with the MorphOS developers but your problem has been passed on nonetheless.


    I have it from our MorphOS developing overlords that screenshots of the problem would be very helpful...
    ---
    http://www.iki.fi/sintonen/logs/its_only_football.txt
  • »21.04.19 - 16:36
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    Problem is that screenshot (F12 in MAME) is perfect clear. Here is screenshot:

    suNBWax.png

    but real picture is here:

    y0fETzL.jpg

    This is the same screen.
    Same as screenshot is windowed mode.

    [ Edited by Solo_Kazuki 25.04.2019 - 19:50 ]
  • »25.04.19 - 18:48
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    KennyR
    Posts: 636 from 2003/3/4
    From: #AmigaZeux, Gu...
    Ok, definitely not screen tearing.

    Are you absolutely sure your monitor can support the screenmode that Mame is choosing? It looks a bit like an out of range signal. Some monitors will tell you that a mode is out of range on OSD or show black screen. Some won't, and display something very much like your screenshot. Many LCD monitors cannot display a low res screenmode and don't even attempt to scale it up. (The problem is less noticable on Windows and Linux because a. low res was rarely used even in 1995 on PC, and b. graphics card drivers on PC will generally scale up anyway.)

    Don't worrry, I'm not trying to deny this is a bug. It almost certainly is. Just trying to narrow out some alternatives first that you would be able to fix at home.

    [ Edited by KennyR 25.04.2019 - 20:30 ]
  • »25.04.19 - 20:29
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    No, most of games are ok, only some have this problem. If there is out of range signal, monitor switch off vision and "no signal" or similar text popup. Moreover, game have low res (see png screenshot, it's 1:1 pixel perfect one) but there are games with even lower resolution which don't have any problems - in overlay fullscreen game is scaled.



    [ Edited by Solo_Kazuki 25.04.2019 - 21:45 ]
  • »25.04.19 - 20:37
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 401 from 2003/2/24
    From: finland, the l...
    This is likely due to wrong modulo. Mame code should be checked for valid VOA_Modulo value being passed to CreateVLayerTagList call.
  • »26.04.19 - 11:24
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    I just discuss about video problems in MAME with one of my pals, and he said that problems begins after some update of MorphOS. He have similar problems and it looks that it may be because some changes in MorphOS overlay handling.

    Probably some changes in overlay handling are not "accepted" by MAME and it might be cause of problems.

    [ Edited by Solo_Kazuki 28.04.2019 - 15:47 ]
  • »28.04.19 - 14:43
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 401 from 2003/2/24
    From: finland, the l...
    Quote:

    Solo_Kazuki wrote:
    I just discuss about video problems in MAME with one of my pals, and he said that problems begins after some update of MorphOS. He have similar problems and it looks that it may be because some changes in MorphOS overlay handling.

    The problem is in MAME itself. Unfortunately it doesn't do overlay properly. It assumes that the overlay modulo equals to width passed to VOA_SrcWidth. This might be true for some width values but not for others.

    Technical details follow. In the overlay blit code the code does the following to advance to the next row:
    Code:
    dst+= amiga_width;


    That is incorrect since the actual memory layout of the overlay might be different (that is: the modulo is larger than the requested width). It should instead do something like:

    Code:
    const LONG modulo = GetVLayerAttr(VLHandle, VOA_Modulo); // NOTE: one before the loop

    ...

    dst = (void *) (((char *) dst) + modulo);


    [ Edited by Piru 30.04.2019 - 00:28 ]
  • »28.04.19 - 16:34
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    The same problem have Hu-Go! and TGEmu with (what i find) two games: Aoi Blink and Samurai Ghost. It's weird that two different emulators (not counting that's not MAME) have same problem with same games.

    [ Edited by Solo_Kazuki 02.05.2019 - 15:13 ]
  • »02.05.19 - 13:48
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Jeckel
    Posts: 132 from 2007/3/11
    Quote:

    Solo_Kazuki wrote:
    The same problem have Hu-Go! and TGEmu with (what i find) two games: Aoi Blink and Samurai Ghost. It's weird that two different emulators (not counting that's not MAME) have same problem with same games.


    Nothing weird, like Piru said, it is an implementation issue in these emulators. Both are not taking care of the modulo, it was just working by chance with older MorphOS versions.

    It was fixed in E-UAE as well:
    https://gist.github.com/chainq/afedae4d90f7e1b5dd4f034416f4ee00

    [ Edited by Jeckel 03.05.2019 - 11:01 ]
  • »03.05.19 - 09:59
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 10448 from 2003/5/22
    From: Germany
    > these emulators [...] are not taking care of the modulo [...]. It was fixed in E-UAE as well

    Indeed, I remember that thread (also with mention of MAME).
  • »04.05.19 - 02:18
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    realstar
    Posts: 287 from 2003/2/24
    From: Canada
    I posted a small fix to Hu-Go! making the overlay modulo correct. Aoi Blink and Samurai Ghost are both displaying ok now.

    Download: Realstar Software Hu-Go! page
  • »08.05.19 - 08:45
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    Thank You very much. I'll test it later today.

    Edit: It works now ok.

    [ Edited by Solo_Kazuki 10.05.2019 - 16:14 ]
  • »10.05.19 - 08:29
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    Quote:

    Andreas_Wolf wrote:
    > these emulators [...] are not taking care of the modulo [...]. It was fixed in E-UAE as well

    Indeed, I remember that thread (also with mention of MAME).


    Sadly, MAME still have this issue. Maybe someona can fix it?
  • »10.05.19 - 15:17
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Solo_Kazuki
    Posts: 109 from 2006/7/24
    From: Universe:Milky...
    I suppose there is problem with releasing fixed version of MAME. But maybe this modulo issue can be solved by some patch?
  • »24.05.19 - 08:08
    Profile Visit Website