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 / Transition.ChangedTag when is this triggered?
« on: August 28, 2019, 08:42:09 AM »
I was trying to understand how this transition works: if I go into the tags menu and add or remove a tag I don't get any Transition.ChangedTag, only ShowOverlay, NewSelOverlay, HideOverlay... any idea?

2
Scripting / Regular expressions and word wrapping
« on: August 21, 2019, 05:39:53 AM »
In my experiments regarding word wrap I tried to use a regex. The simplest incarnation would be a regular expression that matches, say, 10 characters at a time. the code I used is:

Code: [Select]
local es = "(.{10})"
local cs = "Contrary to popular belief Lorem Ipsum is not simply random text"
local r = regexp(es)
local rs = r.capture(cs)

if (rs) {
    foreach (index, value in rs) {
        print(format("Match %02d: %s", index + 1, cs.slice(value.begin, value.end))+"\n")
    }
}

but the output is just:

Code: [Select]
Match 01: Contrary t
Match 02: Contrary t

It seams that after the first match it doesn't create other matches... any idea?

3
Scripting / msg_wrapped... does it work?
« on: August 21, 2019, 04:16:29 AM »
I read from fe.text properties:

msg_wrapped - Get the text label's message after word wrapping

but in my experiments it doesn't seem to work, I get the error "the index msg_wrapped does not exist". Anyone had luck with this?

4
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 :/

5
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...

6
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?

7
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?

8
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};

9
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?

10
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?

11
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 :/

12
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!

13
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?

14
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


15
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 :(

Pages: [1] 2 3