Author Topic: Emulation Station  (Read 38578 times)

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #30 on: January 30, 2015, 08:26:26 pm »
which font format does it use?

Freetype2 seems to support a wide range of font formats

Anyway, i'm going to start messing with themes. Seems it will be fun!
« Last Edit: January 30, 2015, 08:35:44 pm by hi-ban »

xXFrostXx (OP)

  • * Former Staff
  • Posts: 234
Re: Emulation Station
« Reply #31 on: January 30, 2015, 08:42:15 pm »
Here is a photo. Notice how the text for some games is garbled.
There shouldn't be a problem with FreeType that I know of.




Also, here is a preview of the default theme for the port. Ignore the MEG entry. That's for Sega Mega Drive, but will be removed until we get Picodrive to work.

« Last Edit: January 30, 2015, 08:57:34 pm by xXFrostXx »
Dingoonity is the place to be!

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #32 on: January 30, 2015, 10:03:04 pm »
could i have the files of that theme, so i have something to start from?
Thanks in advance.

Awakened

  • *
  • Posts: 96
Re: Emulation Station
« Reply #33 on: January 31, 2015, 12:10:28 am »
Also, here is a preview of the default theme for the port. Ignore the MEG entry. That's for Sega Mega Drive, but will be removed until we get Picodrive to work.
Have you tried it with the Genesis Plus GX port? That uses gmenu2x for ROM selection, so it might work. It has better emulation for GEN/SCD/SMS/GG than Picodrive, but no options since it was a barebones port that hasn't been updated to include extra features.

xXFrostXx (OP)

  • * Former Staff
  • Posts: 234
Re: Emulation Station
« Reply #34 on: January 31, 2015, 12:46:27 am »
Have you tried it with the Genesis Plus GX port? That uses gmenu2x for ROM selection, so it might work. It has better emulation for GEN/SCD/SMS/GG than Picodrive, but no options since it was a barebones port that hasn't been updated to include extra features.

What we really plan to do is override the emulator's menu when you hold the power slider up, and ES will show a menu where you can continue playing, save a state, load a state, or quit playing. We need every emulator to support save and load state so we can do that.

If someone can add a state function to GX, then we'd be happy to support it instead. It seems like the best option for us, we just need the save and load state support. Otherwise we can't have save/load state support for any emulator.

---

Hi-ban, let me finish up some things and I'll upload what I have.
« Last Edit: January 31, 2015, 01:30:32 am by xXFrostXx »
Dingoonity is the place to be!

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #35 on: January 31, 2015, 01:19:13 am »
No problem, i managed to get a theme working.

As for the garbled text problem, it might be OpenGL ES fault: http://stackoverflow.com/questions/4035718/problem-rendering-characters-with-freetype-and-opengl

xXFrostXx (OP)

  • * Former Staff
  • Posts: 234
Re: Emulation Station
« Reply #36 on: January 31, 2015, 01:22:26 am »
Here is our default theme, still incomplete, but with a bit of digging, you should be able to figure it out. Entries for systems are included.
https://drive.google.com/file/d/0B81YUCHooq0IYWw4dG0yMDJ6TnM/view?usp=sharing

As far as the font, I did try swapping out Opensans with other fonts, but every one that I tried causes ES to crash.
I see the fix on your link, though I don't know where I would add it in. The garbled text in ES itself is fine, but the text in the theme is screwed up.
« Last Edit: January 31, 2015, 01:38:21 am by xXFrostXx »
Dingoonity is the place to be!

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #37 on: January 31, 2015, 01:33:13 am »
that's strange, because i have successfully changed the fonts, in simple.xml and it works.

I'm still trying to find a font type/size combo which renders with no issues

xXFrostXx (OP)

  • * Former Staff
  • Posts: 234
Re: Emulation Station
« Reply #38 on: January 31, 2015, 01:41:10 am »
that's strange, because i have successfully changed the fonts, in simple.xml and it works.

I'm still trying to find a font type/size combo which renders with no issues

What fonts have you tried? Arial, ArcadeClassic, and Helvetica caused crashing.
I have font size set to 0.5, but it will no doubt be too large for the game descriptions, etc.
(That font size can be seen in the preview photo.)
Dingoonity is the place to be!

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #39 on: January 31, 2015, 01:56:05 am »
Arial works for me.

Be sure to include a valid and case-sensitive path/filename (including extension) for the font.
If the font is incorrectly set (wrong name or file does not exist) then emulationstation crashes.

xXFrostXx (OP)

  • * Former Staff
  • Posts: 234
Re: Emulation Station
« Reply #40 on: January 31, 2015, 02:01:23 am »
Arial works for me.

Be sure to include a valid and case-sensitive path/filename (including extension) for the font.
If the font is incorrectly set (wrong name or file does not exist) then emulationstation crashes.

The path and file name are correct. Let me double check everything.
Does Arial look garbled to you?
Dingoonity is the place to be!

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #41 on: January 31, 2015, 02:37:23 am »
Yes, Arial looks garbled.

I see the fix on your link, though I don't know where I would add it in.

Almost for sure, i think it may be in /es-core/src/resources/Font.cpp, around line #300

Code: [Select]
void Font::FontTexture::initTexture()
{
assert(textureId == 0);

glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, textureSize.x(), textureSize.y(), 0, GL_ALPHA, GL_UNSIGNED_BYTE, NULL);
}


I'm noob level at programming, so there are high chances that i'm wrong, but maybe i would try to play with the values of GL_PACK_ALIGNMENT and GL_UNPACK_ALIGNMENT and set values of either 1, 2, or 4. to see if the result is different (better/worse). There are more parameters there which could be changed, but i haven't investigated to that extent.


The most strange about this, is that only the romlist text is garbled. all other texts in ES (menus, headers, etc...) always looks perfect.
« Last Edit: January 31, 2015, 02:41:57 am by hi-ban »

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #42 on: January 31, 2015, 02:54:22 am »
I have also noted that the garbled text only happens when the text is center-aligned.
If you align the romlist text to the left, the garbled text magically disappears.

in the theme.xml from each system folder:

Code: [Select]
<view name="basic">

<textlist name="gamelist">
<pos>0.025 0.22</pos>
<size>0.950 0.68</size>
<alignment>center</alignment>
<horizontalMargin>0.01</horizontalMargin>
</textlist>

change "center" to "left"

Of course, having the text centered looks better, but until the garbled text is fixed, the only way to have proper text is aligning to the left.
« Last Edit: January 31, 2015, 02:59:58 am by hi-ban »

xXFrostXx (OP)

  • * Former Staff
  • Posts: 234
Re: Emulation Station
« Reply #43 on: January 31, 2015, 04:06:56 am »
I have also noted that the garbled text only happens when the text is center-aligned.
If you align the romlist text to the left, the garbled text magically disappears.

in the theme.xml from each system folder:

Code: [Select]
<view name="basic">

<textlist name="gamelist">
<pos>0.025 0.22</pos>
<size>0.950 0.68</size>
<alignment>center</alignment>
<horizontalMargin>0.01</horizontalMargin>
</textlist>

change "center" to "left"

Of course, having the text centered looks better, but until the garbled text is fixed, the only way to have proper text is aligning to the left.

The text for the gamelist is handled in the theme itself, not the ES core. Something in the XML is off, apparently.
If you plan to use the metadata scraper once we implement it, game details are on the left side of the screen, and the gamelist is aligned to the right of the screen.

Unusual solution, but changing alignment to right may just work out.
Dingoonity is the place to be!

hi-ban

  • **
  • Posts: 825
Re: Emulation Station
« Reply #44 on: January 31, 2015, 04:22:24 am »
The text for the gamelist is handled in the theme itself, not the ES core. Something in the XML is off, apparently.

Yeah, the gamelist text is specified in the theme, but the garbled text is not a theme specific issue. it happens always, even when there is no theme. And the text rendering code is not on the XMLs, but in ES's source code.

My guess is that, when rendering certain text strings in centered mode, due to the different text lengths, sometimes the text starts rendering at a non-integer pixel position, and something in the text rendering code doesn't handle it well and goes crazy.
« Last Edit: January 31, 2015, 04:25:20 am by hi-ban »