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 4 ... 7
16
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.



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

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

19
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" );







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

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

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

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


24
Scripting / A plugin to choose and run a random ROM...
« on: November 02, 2020, 01:28:45 AM »
It's always driven me a bit nuts that the "random" button in Attract Mode doesn't actually run the ROM, it just chooses it. Maybe there should be a second "random" control to choose and then run it?

Anyway, in the meantime, I made a plugin to choose *and* run the ROM. Whoo hoo! Loving having it choose all these crappy old games for me, ha.

EDIT: attaching the updated version here, this should work on all platforms. The rest of the thread is about the old version, before rand0m helped fix it and made it cross platform.

To use, put this plugin in Attract Mode's plugin folder, then go to AM's Controls menu and assign whatever key you'd like to "custom2", which is what the plugin listens for. You can edit the plugin to change that.


25
Scripting / Re: Possible to have two text sizes in rom list?
« on: October 31, 2020, 02:14:21 PM »
Maybe it's possible to draw two different romlists on the same Display, so I can have large header text between them?

26
General / Re: Good emulator for SNES and AM?
« on: October 31, 2020, 01:04:52 PM »
Thanks again for the advice to stick with Retroarch. Now that I wrapped my head around Retroarch I don't even know what the problem was, ha. One thing that really helped is using it through Teamviewer, as opposed to sitting at a cocktail cabinet straining to see.

Once I got it working it was super easy to install other emulators. So now I'm using it for NES, SNES, Odyssey2, Colecovision and Atari 2600. Each just works.

In case it's useful to anyone, attached are my Attract Mode emulator files for bluemsx (Colecovision), ecwolf (Odyssey2), nestopia (NES), snex9x (SNES), and stella (Atari 2600), in case they're useful to anyone. Inside  each are my installation notes (which bios files to install, etc).

27
Scripting / Possible to have two text sizes in rom list?
« on: October 28, 2020, 08:20:17 PM »
I'm trying to modify my layout.nut to have category headings in the ROM list.

For example:


Quote
*** Atari 2600 ***

Pitfall
Combat
Adventure


*** NES ***

Mario Brothers
Maniac Mansion

The ***text*** would be larger.

Is there some way to do that?

Maybe there's some way to process the romlist text, and I could look for special characters that would indicate a different text size?

28
General / Re: Good emulator for SNES and AM?
« on: October 28, 2020, 04:24:05 PM »
I posted to the Retroarch forum, probably a better place for this:

https://forums.libretro.com/t/possible-to-map-an-input-from-another-joystick-encoder/30635

That forum is hilarious by the way. Took a ridiculous amount of time to figure out how to post. Turns out they prevent new users from posting until they've read 10 postings. They say so in the FAQ, but of course everyone reads the FAQ for new forums they join...

An endless thread of complaints about the policy:

https://forums.libretro.com/t/how-can-i-create-a-new-topic/8416

Anyway, Retroarch sure is interesting.  Making progress in it is a lot like making progress in a video game.

29
General / Re: Good emulator for SNES and AM?
« on: October 28, 2020, 02:18:16 AM »
Thanks for all the great tips. Especially the one about not trying to learn this program in a day! Slowing down has definitely helped.

I'm setting this up on my other cabinet and trying to do it correctly, as opposed to the bare minimum to get Super Mario World running passably, ha.

I'm wondering what the correct way to map my control panel is. This cabinet is a standup cabinet with a Mortal Kombat control panel that looks like the attached.

Under the hood, each player's buttons and joystick is a single joystick encoder. So for example player 1's joystick and 5 buttons are the first joystick encoder, and player 2's joystick and 5 buttons are the other one.

For now I'm using the SNES9X core.

I don't imagine anyone has any advice about how to map my control panel for SNES? I've got the exit button mapped (thanks progets).

To make matters slightly worse I don't actually have much experience with SNES.

30
General / Re: Snapshots for Atari roms?
« on: October 16, 2020, 11:18:53 AM »
My Attract Mode menu for Atari 2600 games is looking purdy with pics of the cartridges in the bg...

Pages: 1 [2] 3 4 ... 7