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: MAME in native low res and blurred text in vertical games  (Read 4742 times)

0 Members and 1 Guest are viewing this topic.

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
MAME in native low res and blurred text in vertical games
« on: October 15, 2009, 03:50:54 pm »
I mean the text in the tab menus, etc. It happens in all vertical games. Any idea why this happens? Any way to fix it? In horizontals the text is perfectly crisp. In CPS2 games I've noticed some blur/stretch. I have not a clue what's the reason for MAME to stretch the menus... More information and pictures depicting the problem here:

http://www.mameworld.info/ubbthreads/showthreaded.php?Cat=&Number=204187&page=0&view=expanded&sb=5&o=&fpart=1&vc=1

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: MAME in native low res and blurred text in vertical games
« Reply #1 on: October 16, 2009, 01:24:21 am »
Interesting.  Have you tried different fonts?  Tried making a smaller point font with the linked otf2bdf app?  Are you using d3d, ddraw, or gdi?

I would think that a small point font would do the trick, but the three rendering ways all do it differently.
Robin
Knowledge is Power

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: MAME in native low res and blurred text in vertical games
« Reply #2 on: October 16, 2009, 02:39:49 am »
I've tried that. Using a 48 pt font looks better in horizontal and bad in verticals, and a 12 pt font looks better in verticals and small and blury in horizontals. The point is in both cases you still can see stretch. Having a big font on screen hides a little the bad stretching in low res modes. Actually, I think everything seems to have to do with aspect. Although the text looks ok in horizontal games, they are actually filtered and stretched. However, if you try a game with a 1/1 aspect ration (same horizontal pixels than vertical pixels), you can see me menus are completelly pixel perfect, as the rest of the game display. In that case the test is absolutelly crisp. Eg: Kung Fu Master. I'm trying with render.c There's a part of the code that has an effect. Unfortunatelly, since I can't read C, it's all a matter of trial and error. If I delete the final part, which is about extreme proportions, I can get it to compile and the nasty effect in vertical games is reduced a little. I'd like to know how to change the code so as to ignore aspect or tell mame that all games are 1/1, so as to get perfect text in the menus.


/*-------------------------------------------------
render_get_ui_aspect - return the aspect
ratio for UI fonts
-------------------------------------------------*/

float render_get_ui_aspect(void)
{
render_target *target = render_get_ui_target();
if (target != NULL)
{
int orient = orientation_add(target->orientation, ui_container->orientation);
float aspect;

/* based on the orientation of the target, compute height/width or width/height */
if (!(orient & ORIENTATION_SWAP_XY))
aspect = (float)target->height / (float)target->width;
else
aspect = (float)target->width / (float)target->height;

/* if we have a valid pixel aspect, apply that and return */
if (target->pixel_aspect != 0.0f)
return aspect / target->pixel_aspect;

/* if not, clamp for extreme proportions */
if (aspect < 0.66f)
aspect = 0.66f;
if (aspect > 1.5f)
aspect = 1.5f;
return aspect;
}

return 1.0f;
}

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: MAME in native low res and blurred text in vertical games
« Reply #3 on: October 16, 2009, 02:47:15 am »
See, this is how to text looks in Kung Fu Master. That's unstretched pixel-perfect. (drag to a new window to see full resolution).

« Last Edit: October 16, 2009, 02:49:20 am by Stormrider »

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: MAME in native low res and blurred text in vertical games
« Reply #4 on: October 16, 2009, 02:58:38 am »
So, my conclusion at the moment is that the problem gets worse as the difference between horizontal and vertical pixels is increased. If you notice, in Kung Fu Master (256x256), it's totally perfect. In Robocop, it's almost perfect (256x224), in Neogeo games (320x224), it looks good but now you can see that some letters are touching others (tr, in...) so the proble starts to be evident, and in cps2 games (384x224) the blur is more evident and looks bad. In vertical games, the problem is extreme, maybe because the aspect ratio is calculated like this: 224/320. So, now that the problem has been found and identified, anyone dares to find a solution?

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: MAME in native low res and blurred text in vertical games
« Reply #5 on: October 16, 2009, 04:56:43 am »
Don't get me wrong, it's nice to have these things perfect, but does it really matter? As long as the games looks how it should surely the menu isn't on display very often?

That said I don't think I've had this problem...but maybe I just haven't noticed as I haven't loaded up any vertical games lately.

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: MAME in native low res and blurred text in vertical games
« Reply #6 on: October 16, 2009, 05:47:32 am »
My point of view is different: if it can be improved, why not improve it? After all, I compile my own MAME. It would be just another change to add to the list. Those who appreciate the beauty and glory of low resolution graphics cannot stand that atrocity of stretched and blurred menus , even when that is not necessary at all. I enjoy low resolution even in my layout. My eyes hurt when I press tab in a vertical game, that's all. The bad news for me is that people tend to be so lazy and conformist these days that almost nobody cares about issues like this, and therefore, I feel alone, with no hope in finding any help. And that's a shame, because my philosophy is share the knowledge and help if you can. Anyway, I'll keep on investigating how t fix this. If I find any solution, I'll post in the forum, as usually.

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: MAME in native low res and blurred text in vertical games
« Reply #7 on: October 16, 2009, 06:34:27 am »
From the documentation of render.h....


  23      Theory of operation
   24      -------------------
   25  
   26      A render "target" is described by 5 parameters:
   27  
   28          - width = width, in pixels
   29          - height = height, in pixels
   30          - bpp = depth, in bits per pixel
   31          - orientation = orientation of the target
   32          - pixel_aspect = aspect ratio of the pixels
   33  
   34      Width, height, and bpp are self-explanatory. The remaining parameters
   35      need some additional explanation.
   36  
   37      Regarding orientation, there are three orientations that need to be
   38      dealt with: target orientation, UI orientation, and game orientation.
   39      In the current model, the UI orientation tracks the target orientation
   40      so that the UI is (in theory) facing the correct direction. The game
   41      orientation is specified by the game driver and indicates how the
   42      game and artwork are rotated.
   43  
   44      Regarding pixel_aspect, this is the aspect ratio of the individual
   45      pixels, not the aspect ratio of the screen. You can determine this by
   46      dividing the aspect ratio of the screen by the aspect ratio of the
   47      resolution. For example, a 4:3 screen displaying 640x480 gives a
   48      pixel aspect ratio of (4/3)/(640/480) = 1.0, meaning the pixels are
   49      square. That same screen displaying 1280x1024 would have a pixel
   50      aspect ratio of (4/3)/(1280/1024) = 1.06666, meaning the pixels are
   51      slightly wider than they are tall.
   52  
   53      Artwork is always assumed to be a 1.0 pixel aspect ratio. The game
   54      screens themselves can be variable aspect ratios.


So I have to try with 1.33, not with 1 nor 0. In Kung Fu Master, the aspect ratio of the pixels is 1.33, that is 4/3, since the game res is 256/256. In that case no stretch at all is induced. Interesting...
« Last Edit: October 16, 2009, 06:37:53 am by Stormrider »

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: MAME in native low res and blurred text in vertical games
« Reply #8 on: October 16, 2009, 08:21:43 am »
Those who appreciate the beauty and glory of low resolution graphics cannot stand that atrocity of stretched and blurred menus , even when that is not necessary at all. I enjoy low resolution even in my layout. My eyes hurt when I press tab in a vertical game, that's all.

I'm the same, I have a low res layout and I'm quite opposed to stretching and blurring. My point was more along the lines of why do you need to go in to the tab menu? Controls and such can be setup without running Mame so the tab menu doesn't serve much purpose for me generally...in cabinet setup that is.

Anyway good luck, I hope you figure it out :)

Ummon

  • Trade Count: (+13)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5244
  • Last login:June 09, 2010, 06:37:18 pm
Re: MAME in native low res and blurred text in vertical games
« Reply #9 on: October 17, 2009, 04:45:08 pm »
It's readable, so....   But, this phenomenon is due to the video re-write. Was just fine before it.
Yo. Chocolate.


"Theoretical physics has been the most successful and cost-effective in all of science."

Stephen Hawking


People often confuse expressed observations with complaint, ridicule, or - even worse - self-pity.

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: MAME in native low res and blurred text in vertical games
« Reply #10 on: October 18, 2009, 07:34:30 am »
I've been all the weekend trying with different values. Editing that part of render.c will not be the solution. I think I should look somewhere else, maybe ui.c There must be some part of the code that has to do with ui scaling. What I need is MAME to stop scaling the ui depending on aspect ratios, etc. The ui should be in the font native pixels, no matter if it looks with different proportions depending on the game resolution. Honestly, I'm starting to loose hope in making this possible. My head and my eyes hurt, and I'm a little tired of all this. The best results so far are with this values. Everything is stretched and blurred, but the differences between games are not important, and verticals look a little better too:

float render_get_ui_aspect(void)
{
   render_target *target = render_get_ui_target();
   if (target != NULL)
   {
      int orient = orientation_add(target->orientation, ui_container->orientation);
      float aspect;

      /* based on the orientation of the target, compute height/width or width/height */
      if (!(orient & ORIENTATION_SWAP_XY))
         aspect = (float)target->height / (float)target->width;
      else
         aspect = (float)target->width / (float)target->height;

      /* if we have a valid pixel aspect, apply that and return */
      if (target->pixel_aspect != 0.0f)
         return aspect / target->pixel_aspect;

   }

   return 1.42f;
}