Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - zpaolo11x

Pages: [1] 2 3
1
Scripting / Debugging a layout that crashes AM with no console output
« on: June 06, 2019, 12:16:04 AM »
I'm having a bit of troubles with my layout: for some reason the latest changes I made are breaking havoc on windows, and the layout often crashes when reloading. But instead of crashing leaving a nice console output (--loglevel debug) it just hangs, and when it's closed by windows there's no useful output on the console. Any idea on how to understand what happens? On MacOs I can see a debug log but I can't get much out of that :/

2
Scripting / Dispay size from mame xml list
« on: June 03, 2019, 08:27:52 AM »
In MAME listxml there's a field for each game like this:

<display tag="screen" type="raster" rotate="0" width="384" height="224" refresh="59.637405" pixclock="8000000" htotal="512" hbend="64" hbstart="448" vtotal="262" vbend="16" vbstart="240" />

I think the Info.Rotation data comes from this, but is there a way in AM to get also the width and height data from this tag? This is the "native" resolution of the machine and could be useful for CRT filters if your screenshots are not pixel perfect...

3
Scripting / Changing the source of an artwork
« on: May 24, 2019, 05:14:13 AM »
Let's say I have something like

testobject = fe.add_artwork("snap",0,0,200,200)

is it possible to change the "source" of the artwork data, for example from snap to flyer, on the fly?

4
Scripting / Displays Menu and layout reload...
« on: May 21, 2019, 06:26:53 AM »
When Displays Menu is not using a custom layout but is set to default, and you select a new display that shares the same layout as the old display, what exactly happens? My experience is that the list is updated like it was a "ToNewList" transition and nothing more. The trouble is that if the new displays uses a different emulator, the metadata is not updated so category etc are not consistent.

Is there a way to force a layout reload each time a display is updated?

5
Scripting / Foreach item oreder
« on: April 12, 2019, 04:57:24 AM »
I have this simple code:

Code: [Select]
local key_names = { "1": "A", "2": "B", "3": "C", "4": "D"}

foreach (key,val in key_names){
   print (key + " " + val +"\n")
}

Maybe I don't get it right but the console output of this code is

Code: [Select]
1 A
3 C
2 B
4 D

I would expect it to return

Code: [Select]
1 A
2 B
3 C
4 D

Also speaking of tables, what is the difference between something like this:

Code: [Select]
local aTable = { "first_key" : "Max Normal",
                 "second_key" : 42,
                 "third_key" : true};

and this:

Code: [Select]
local aTable = { "first_key" = "Max Normal",
                 "second_key" = 42,
                 "third_key" = true};

6
Scripting / CRT shaders and Intel 620 graphics adapter
« on: March 28, 2019, 11:34:28 AM »
I'm trying AM and my Arcadeflow layout on an HP spectre with Intel 620 integrated graphics. Performance is very good (it puts my Macbook Pro to shame :D ) but there's an issue with Lotte CRT shaders: they simply look transparent. Usually when a shader doesn't work I see the unmodified image, while here the image is simply absent. Is there a way to have a detailed log from GLSL shaders? Last but not least, I tried an old version of Arcadeflow with CGWG shader and it works :( suggetsions?

7
Scripting / zorder and performance
« on: March 21, 2019, 08:50:28 AM »
Excuse my complete ignorance... is there a performance hit if one "abuses" of zorder? Let's say my layout has a lot of zorder explicit declarations going on, is this worse than having everything layied out correctly in the first place?

8
Scripting / Changing filter vs changing search rule...
« on: February 12, 2019, 08:21:10 AM »
Is there a difference in the implementation of the response to those commands? In my theme when I bind a key to a command like

Code: [Select]
fe.list.filter_index = 2
I get the correct effect in any case, the list is updated, the layout responds as programmed and everything seems fine.
On the other hand if I bind a key to

Code: [Select]
fe.list.search_string = "Title contains Bubble"
I get weird results, sometimes it works, sometimes, especially if the current index is the first (the same as the filtered list), it updates everything but the first image. Generally it seems it updates all the metadata but not the artworks.

I know my theme is pretty complex and maybe I'm overlooking something but looking at the debug log it seems both method trigger the same transitions callbacks therefore I don't understand where the difference is :/

9
Scripting / Drop shadow layout, may be turned into something useful?
« on: January 20, 2019, 08:37:54 AM »
I've put together a simple layout to demonstrate my drop shadow code, here it works for wheel art but you can use it on any image. I'm not a good programmer but I'm sure someone might like the code and maybe build something useful with that (a class?) so that it can be used and re-used.

The parameters to play with to define the shadow are in the code, they are self explanatory except from shadow_downsample, this is a float parameter < 1.0 so that the shadow surface is built smaller than the original image and then enlarged. Since the shadow is smooth you won't loose detail and gain speed because the shader will be faster on a smaller image.

Have fun!

10
Scripting / Too many locals
« on: January 16, 2019, 08:35:28 AM »
Ok, I'm not a good programmer, I put everything in a single 3000 lines long layout file, the net result is that I sometimes get the "too many locals" error when running my layout. I have partially solved that consolidating variables into tables, but is it something that can be fixed?

11
General / Restyling of AM forums
« on: January 10, 2019, 02:14:04 AM »
I have played a bit with Firefox extension xStyle (it's like Stylish but without the privacy concerns :D ) and restyled the look of AM forums to look cleaner, smoother and also a bit dull so it doesn't catches the attention of coworkers LOL. I can share the CSS code if someone is interested :D


12
Scripting / Search string syntax
« on: December 27, 2018, 12:24:51 PM »
It would be great to have more info regarding the syntax of the search string, I know for example that you can use [] to insert variations of a string (so [Pp]latform equals Platform or platform) but other than that? Can I craft a string that finds games where Category is Something OR Something Else? Is there a way to insert an AND operator?

There's also an issue with special characters, for example I want to find all the games where category equals "Driving / Race (Chase View)" but the "(" and ")" seems to mess with the search string :(

13
Scripting / Changing the ordering of a list on the fly
« on: December 19, 2018, 06:12:51 AM »
Is there a way to change the order of a list from, say, "by name" to "by year"? The only thing I can do right now is create in AM two filters, one with sorting by year and one with sorting by title, but it would be really convenient if a layout could change this order on the fly...

14
Scripting / Check file existance with relative path
« on: November 27, 2018, 12:34:39 AM »
There are many ways to check if a file exists: one is

Code: [Select]
fe.path_test(fullpathfilename , PathTest.IsFile)

another is

Code: [Select]
try {file(fullpathfilename, "r" );return true;}catch(e){return false;}

Both work well if you have a full pathname but, AFAIK, they don't work on relative paths. You can get the AM working directory with FeConfigDirectory, which is fine, but I want to check if a file exists inside a folder of the current theme, without having to hardcode the theme name or having the user insert a variable with the theme full path.

Is there a way or a workaround to get at least the current theme folder name?

15
Themes / [RELEASED] Genres/Category artwork for Mame
« on: November 19, 2018, 08:56:25 AM »
I've completed a project to implement in the next version of my theme. The idea is to create genre or category icon for all my games. I had some rules to follow:

1) Being my theme Mame and arcade based I tried to find all the category names that are available, in catlist.ini, category.ini, catver.ini etc, then I parsed the genres/subgenre format so that, for example, Sports / Boxings becomes sportsboxing.png.

2) I wanted some retro look and a stylized vibe so I decided to limit myself to 16x16 pixels artwork with only one "color" (plus transparent background).

I decided to do all the subgenres and not only the main category, you can see a preview of the artwork here:

http://mixandmatch.it/catpic

Overall it's great fun trying to convey a category idea with that reduced resolution, also because if you want to reference a famous game for the genre sometimes you need to reinvent and scale down the sprites :)

In the attached archive you'll find all the PNGs in white on transparent (so you can change the color using set_rgb ), plus a nut to incorporate in your layout. The nut contains two function, one is category_pic() and is used as a magic token, so if you want to add a cat image just use

fe.add_image("[!category_pic]", etc

the other function in the nut is category_list() and you can call it at the beginning of your layout, it will output on the console the whole list of categories that are not present in the PNG folder. If you want me to add some just let me know!

Feel free to incorporate this icons (with credit) in your works and let me know if you like them :)

Pages: [1] 2 3