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.


Messages - farique

Pages: [1] 2
1
Hi.
On my layout I need to get the filters names as strings to work with them. So I am using fe.filters (Magic Tokens do not pass as a variable as far as I know). So far so good.

The problem is: when I move from a display to another (with different emulators, lists and filters) that are using the same layout, the contents of the fe.filters array do not update, it keeps using the filter information of the previous display. If I move to a display using a different layout and back or I use the toggle layout key (refreshing it), the array is filled correctly.

Here is a little layout that shows this happening:

Code: [Select]
function transition_callback( ttype, var, ttime )
{
switch ( ttype )
{
case Transition.FromOldSelection:
case Transition.StartLayout:
case Transition.ToNewList:
print ( "\n"+fe.filters.len()+"\n" )
for (local f=0; f < fe.filters.len(); f++) {
print ( fe.filters[f].name+"\n" )
}
print ( fe.filters[fe.list.filter_index].size+"\n" )
break
}
return false
}
fe.add_transition_callback( "transition_callback" )

And the console output:

Code: [Select]
*** Initializing display: 'Atari 2600'
 - Loaded master romlist 'Atari 2600' in 47 ms (539 entries kept, 0 discarded)
 - Constructed 6 filters in 0 ms (3234 comparisons)

6
All
Favourites
Homebrew
Commercial
Prototype
Adult
539

*** Initializing display: 'Odyssey2'
 - Loaded master romlist 'Odyssey2' in 6 ms (121 entries kept, 0 discarded)
 - Constructed 4 filters in 0 ms (484 comparisons)

6
All
Favourites
Homebrew
Commercial
Prototype
Adult
539

This console output is the result of opening AM on the Atari 2600 display and moving to the Odyssey2 display (both using the same layout). As you can see, AM fills fe.filters with the correct Atari 2600 information but when I move to the Odyssey2 display it finds the correct filters and entries but do not update the fe.filters array.

What am I missing?
Thanks.

2
Scripting / Re: first_line_hint not working on 2.4.x
« on: September 11, 2018, 12:21:26 PM »
AND, to wrap up the monologue (and for future reference):

Got it working by using a variable instead of altering first_line_hint directly.
Like this:

Code: [Select]
local _overview = fe.add_text( "[Overview]",0,0,600,1000)
_overview.charsize = 40

local line = 0

print (line+" "+_overview.first_line_hint+"\n")

function update_realtime( ttime )
{
local is_PovYposK = fe.get_input_state ("W")
if (is_PovYposK) {
line += 1
_overview.first_line_hint = line
print (line+" "+_overview.first_line_hint+"\n")
}

local is_PovYnegK = fe.get_input_state ("S")
if (is_PovYnegK) {
line += -1
_overview.first_line_hint = line
print (line+" "+_overview.first_line_hint+"\n")
}
}
fe.add_ticks_callback( this, "update_realtime" )

There is still the problem of aligning the line variable with the first_line_hint position (you can see what a mean on the console output) but I can live with it for now.

3
Scripting / Re: first_line_hint not working on 2.4.x ?
« on: September 11, 2018, 10:41:31 AM »
Ok, narrowed it down to .charsize

If I set a .charsize to the [Overview] text box ( _overview.charsize = 20 for instance ), first_line_hint stops working. Every time I dynamically change it, it goes to 0.
If I don't set a character size the font becomes huge but first_line_hint works.

This simple layout demonstrates it. Use W and S to scroll the overview with and without the second line commented.

I'm using Windows 10 64, AM 2.4.1

Code: [Select]
local _overview = fe.add_text( "[Overview]",0,0,300,600)
_overview.charsize = 20

print (_overview.charsize+"\n")

function update_realtime( ttime )
{
local is_PovYposK = fe.get_input_state ("W")
if (is_PovYposK) {
print (_overview.first_line_hint+"\n")
_overview.first_line_hint++
}

local is_PovYnegK = fe.get_input_state ("S")
if (is_PovYnegK) {
print (_overview.first_line_hint+"\n")
_overview.first_line_hint--
}
}
fe.add_ticks_callback( this, "update_realtime" )

Anyone?

4
Scripting / first_line_hint working differently on 2.4.x
« on: September 04, 2018, 11:54:04 AM »
Hi, guys.

Is it just me or does first_line_hint stopped working on [Overview] texts on Attract Mode 2.4.x?

The same script works on scrolling the text up and down on 2.3 but not on 2.4.

Thanks.

5
First and foremost, thanks for sharing your work with the community.

I had to download the zip to check which operating system(s) it is for. It would be nice if you'd add that to your announcement.
Any chance of MacOS and Linux versions, or the source code so that others may try to compile them?

You are right, Favdeacon, my bad on specifying the supported system. Fixed.

As for the other OSs. I have programmed it on Autoit, a very Windows integrated script language, so I think a direct conversion will not be possible one my part for now.
I can send the source (messy, amateurish, badly commented) if you, or someone else, want to take a look.

6
Thank you, keilmillerjr and raygun for the ideas. If I ever decide to publish my frontend I will sure adopt one of these approaches.

I already have 9 emulators with 2 alternates using a single, very adaptive, layout. Although there are some advantages to the keilmillerjr method, the apps I made to manage my setup are very dependent on the romlists and a duplicate emulator would complicate things a bit so I'll stick to the file approach for now. Will look into the ultrastick method, tho.

And I look forward to developments on your idea, raygun!

ps. This is my layout. The screens might seems similar but everything changes from one to another, from the font to the spacing and the way they display the overviews, for instance. (the two screens on the right are the alternate VB and Vectrex)

7
That is actually a good idea, keilmillerjr!

Would, maybe, be a little overkill on my current layout/support apps setup but surely deserves a thought.

Still curious about passing arguments, tho. Seems to be an useful feature.

8
Hi.
Is there a way to pass arguments directly from the layout Squirrel code to the emulator on Windows?
I am not talking about calling an emulator with args from code (like with fe.plugin_command) but to pass arguments to the emulator being called from Attract Mode itself.

I thought it would be a common need but I could find nothing here nor on the documentation.

The problem is my front end has "Alternate" modes for the Virtual boy (to call the emulator with or without the anaglyph mode) and for the Vectrex (to call games with or without the overlays) and the way it is working now is whenever I press the key to change the mode (the layout changes to indicate which mode it is in) I rename a file accordingly. Then, when I run a game, an AHK script checks the file and according to its name calls the emulator with the appropriate settings.

It works but is far from neat and elegant and may cause problems in the future (apart from having to change the code on the layout and both AHK script whenever the path changes).

Preemptive thanks!

9
Ok, then...
Here is another app I think some of you guys might find useful.

This one shows a list of all years, publishers and genres on your AM romlists and the amount of games using them.
Then you can look for discrepancies and similarities and fix/consolidate/standardize the information across the games/systems.

You can see the games using them and also can edit the information from within the app if you wish.

You can read more about it on the Readme.txt.

*Windows only.

Just one thing:
Be careful if you decide to use the Change feature as it will actually edit your romlists.
(make a backup, please, the app has a button for that)
Last app came with some surprises and bugs. I am the only one actually using them so far and it is hard to infere discrepancies on different systems.

That is it. As always I would love to hear some feedback.

10
Is this only for the windows build of AM?

It will only run on Windows and it uses the emulator configuration files and romlists of Attract Mode to get the paths and info it needs.

It will pull the assets paths from the emulators config and use them to look for the files, so they probably have to be on the same machine (the same absolute path must work for both)

If your setup (asset files) are INSIDE the AM path and depending on how you access it through Windows (mapped drive?), it might work. It might also work for the information on the romlists (Year, Publisher and Manufacturer) and the Overviews as they are on the same relative path as Attract Mode.

I have no way of testing, tho.

11
Think I've solved the problem, ryuuji. It is working with your mame.cfg.
Should work with most setups now.
v1.3 on original post.

12
AM 2.4 selected AM path and the results:
attached the mame.cfg also

Found the problem. Turns out the configuration loading algorithm is a complete mess!
It is totally dependent upon MY kind of setup and expects a Working Directory and, as I sai above, cannot deal with $HOME and the like.
A lot of the people must be having problems, tanks for the report.

I am working on a solution and will post soon.

13
General / Re: overview Q"
« on: August 21, 2018, 03:46:55 PM »
Hi,
Not a direct solution to your problem but if you have the old overviews you can use the program on the link below to convert them to text.

The new overview files must be .txt and be at:
\<Attract Mode>\scraper\<emulator>\overview\<romname>.txt
Copy your old .cfg files there and use the program to convert them.
The program will replace the files so if you want to preserve them, make a backup.

Just be sure to convert them to "Text" and not "New Overview". I made the program without AM2.4 for testing, turns out it wants just plain txt files.

http://forum.attractmode.org/index.php?topic=2334.msg16111#msg16111

14
tried it today but it shows that I have only 4 roms (none of which are correct because they are on a different location: local disk(d) and they are not even mame roms or any roms at all). I do have a up to date mame set.

* EDIT: Think I found it. AMLS is not programmed to look into variables such as $HOME or $PROGDIR. Would generate a problem consistent with yours. Working in a a solution.

And that is why smart people code log files.
Thanks for the feedback. Let's do it the hard way then.
(starting with the stupid questions)

- Are you using AM 2.3 or 2.4? It should work fine on 2.4 (apart from not finding the overviews) but I just copied all my config files over from 2.3 and so might be missing something.

- You had to click and find your AM path, right?  I mistakenly sent this copy with my AM path on the configuration, it should't be a problem as yours are probably different anyway, but mine is very generic, so...

- Are there anything unusual on your roms and assets paths that may be confusing for a dumb program?

- When you click on "Sys config info" (top right) does it shows the correct information and paths. Can you post it so I can see?

That is all I can think for now.

[starts working a log output]

15
Hi people,

Updated the program and it is MUCH faster now.
Down from ~5min to ~13sec scanning all my ~8k roms.
The lists also should take almost no time to generate.

Enjoy and if you catch any bugs, let me know.

Pages: [1] 2