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

Pages: [1] 2 3 ... 7
1
Themes / Possible to format text in a layout? Trying to make "headers"
« on: April 12, 2021, 10:34:24 PM »
I'm trying to make section headers inside my layout's romlist. For example, in the following screenshot:



In that layout, the "Just the Classics" stays at the top of the screen, which is great. And the romlist scrolls, which is great. But I'd like to be able to have different sized entries in that romlist.

For example, maybe there would be a large item called "vertical games" in the romlist, that kind of thing. It would scroll with the other items in the romlist, but would be larger.

Is anything like that possible currently in the theme scripting?

Thanks for any help.

2
General / Re: Issue when changing screen resolution
« on: March 30, 2021, 11:41:20 AM »
Thank you! Works great.

3
General / Issue when changing screen resolution
« on: March 30, 2021, 03:13:37 AM »
I have a game that changes the screen resolution, and when I exit the game AM is no longer fullscreen. In other words:

- I start Attract Mode in 1024x768 resolution

- I launch a game that changes the screen resolution to 1680x1050

- when AM exits the game (and the screen resolution is still 1680x1050) the AM window now only takes up a small part of the screen.

I think I remember seeing a setting for dealing with this, maybe redrawing the window after exiting a game? I can't remember though.

Does anyone happen to have an idea?

Thanks for any help.

4
General / Re: Good emulator for SNES and AM?
« on: November 07, 2020, 07:56:11 AM »
That makes a lot of sense. And my experience (cabinets, since the 90s) and main use (mame) is the same as yours. But I do have one section of my cabinet for the best few games from each classic console. Fun to fire up Colecovision or NES or whatever when a friend who had that growing up is visiting and watch the memories come flooding back. And Retroarch sure is good for that, once I got past the learning curve. And once I learned to stop expecting it to behave like a normal emulator.

And yeah it was pretty mind boggling that I couldn't map controls from my second joystick encoder to player 1 controls. For example not being able to map Player 2 start to the global start button... The game pad theory makes a lot of sense, but really I think there's some design decisions that really get in that program's way. There's a lot of cases of form over function. Ultimately I can't complain, because with a little retooling (re-wiring a few buttons to use the first joystick encoder) I got great results from it. Ok maybe I can complain a little, ha.

5
Scripting / Re: Ultimarc Servo-Stik plugin for Linux
« on: November 04, 2020, 03:55:25 PM »
Awesome! And that reminds me, here's the updated Sero-Stik plugin that controls the Servo-Stik directly (as opposed to using a relay).

To use, download SetServoStik from here http://users.telenet.be/rgbcommander/ and place in the utils subfolder of Attract Mode (which you'll probably need to create. Or put it somewhere else and adjust the path below.


6
Scripting / Re: Joystick button to choose and launch a random game?
« on: November 04, 2020, 03:51:28 PM »
Thanks again rand0m. For anyone stumbling on this thread, I posted the working plugin here:

http://forum.attractmode.org/index.php?topic=3752.0

7
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 04, 2020, 10:39:57 AM »
I know all that, but what does the & between the two signals you're sending do? I assume it's supposed to allow sending both signals in one line but it throws an error for me.  "bitwise op between 'null' and 'null'"

8
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 03, 2020, 11:43:06 AM »
And looking closer, I see that both versions you posted with the line 'fe.signal("random_game") & fe.signal("select")' throw this error:

Code: [Select]
LOCALS
[sig] "random_game"
[this] TABLE
Script Error in signal handler: random_press - bitwise op between 'null' and 'null'

AN ERROR HAS OCCURED [bitwise op between 'null' and 'null']

CALLSTACK
*FUNCTION [random_press()] /home/wrybread/.attract/plugins/Random ROM2.nut line [9]


And they throw the error over and over again, without exiting, freezing the system, so the recursion issue is still there. Odd that that would work in Windows but not Linux.

What is the & supposed to do here?

"fe.signal("random_game") & fe.signal("select")"

No biggie, all working fine with the version that listens for one of the "custom" signals, just curious.



9
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 02, 2020, 08:37:17 PM »
That's really odd, both of those freeze my system. As does:

Code: [Select]
function random_press(sig)
{
if (sig == "random_game")
{
fe.signal("random_game");
fe.signal("select");
return true;
        }
  return false;
}

fe.add_signal_handler( "random_press" );

Hmm.

10
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 02, 2020, 08:10:54 PM »
And thank you! Been wanting to solve that forever.

11
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 02, 2020, 08:07:24 PM »
I think I figured it out. I think it keeps firing again and again (recursion) because it's sending the "select" signal, which in turn gets caught by the function again so it fires the "select" signal, and on and on.

This works for me as a plugin, note that it's now intercepting the "custom2" signal.

Code: [Select]
function random_press(sig)
{
if (sig == "custom2")
{
//print ("choosing something....");
fe.signal("random_game");
fe.signal("select");
return true;
}
  return false;
}

fe.add_signal_handler( "random_press" );







12
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 02, 2020, 07:44:41 PM »
And looks like it's the same freeze when running it as a plugin. It's just firing that event over and over. So I guess if we solve the issue in the layouts it'll work as a plugin too.

13
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 02, 2020, 07:41:50 PM »
Aha.

Still doesn't work for me though, looks like it continually runs the code without exiting. Adding this print statement makes that clear:

Code: [Select]
function random_press(sig)
{
if (sig == "random_game")
{
print ("choosing random game...");
fe.signal("random_game");
fe.signal("select");
    }
  return false;
}

fe.add_signal_handler( "random_press" );

Adding the above to my layout.nut and it freezes, and keeps printing "choosing random game".

I see the docs for add_signal_handler() show having to return true at some point, but I'm not clear on exactly how that's used:

https://attractmode.gitlab.io/wiki/reference/functions/#feadd_signal_handler

Also, any idea how to make this work in a plugin, so it works across multiple layouts? No biggie if not, but I think the functionality would be better as a plugin if possible.

14
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 02, 2020, 07:15:23 PM »
[Edit: this is outdated, don't use this version.]

Thanks! Not sure if I'm just implementing it incorrectly, but it freezes AM for me.

I made an AM plugin with your code, attached.

I then enable it and press the random signal (the R key on my system) and then AM freezes. Nothing printed to console.

Not sure if it matters but that's on Linux.

Any ideas?

15
Scripting / Re: A plugin to choose and run a random ROM...
« on: November 02, 2020, 02:45:12 PM »
[Edit: this is outdated, don't use this verison]

I made a Windows version, it uses an Auto Hot Key script to send the keys, but it's weird, Attract Mode freezes when the compiled AHK script runs. The AHK script is as simple as it gets:

Code: [Select]
Send r

Sleep, 500

Send {Enter}

Works great when I run it outside Attract Mode (will even choose and select a ROM), but when run from the plugin it freezes the AM interface. Hmm.

I don't use AM on Windows, I just installed it to test the plugin, so it's possible it's something wrong with my AM installation? Or maybe antivirus? (I disabled AVG for the test, but still had the issue).

Does anyone have any ideas?

Attaching all the files.


Pages: [1] 2 3 ... 7