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

Pages: [1] 2
General / MOVED: help game boy advance
« on: March 01, 2021, 02:45:21 PM »

General / MOVED: attract mode openbor
« on: February 26, 2021, 12:14:09 AM »

General / MOVED: help with Wii u loadiine game
« on: February 26, 2021, 12:11:58 AM »

Themes / Boardwalk-NeoGeo A NeoGeo Themed Layout
« on: February 01, 2021, 12:31:10 AM »

Neo Geo themed

This is a basic layout styled after NeoGeo look and feel.

- File module
- Preserve Art module

- snap: video snaps ideally
- instructions: 2d instruction files  (recommended:
- wheel: wheel logos
- marquee: neogeo marquees (recommended:

- Selectable or randomized T-Molding
- 3 Selectable or randomized Bezels
- Randomized backgrounds (add your own to the backgrounds folder and they'll show up as well)
- Themes is scalable to any size
- Does not use a spinning wheel (but does use wheel logos)

This uses my Pos (positioning) module, so it works at most any size

Scripting / history scroller WIP
« on: January 25, 2021, 12:02:48 AM »
I started writing a scroller for the history.dat info in one of my layouts. It works pretty well, but I know for a fact that I need to get a little more sophisticated with it before it manages every scenario correctly.

So far it's useful, but not 100%, so I figured I'd share the basic premise in the hope that it might spark an idea for someone else.

What this does is use the font size to guess the height of the text that comes back from the history.dat plugin and then scroll that amount up off the screen before resetting it at the bottom

The calculation so far is this:

total character count of the history data / (assumed/guessed) average # of characters per line of text (this gets a guess on the total number of lines of text) *  font height = overall guestimate of the text box height

This doesn't account for text boxes that are wide enough to allow for more characters per line than a standard book / article might be (this is usally 56-70 characters, my guess is set at 75). It would make more sense for me to set it based on how wide a character is in pixels and how many chars could fit in the current text box than assume number of characters per line.

I suppose there's some way to calculate the size of 1 average character like X and make a guestimate based on that. There's probably some greedy algorithm out there for this purpose too, but I haven't had time to look for it.

Anyway, let me know if you have any ideas or experiment. The attached file may have bugs in it... I culled it from a layout I was working on and tried to distill it down to a minimum so you could see what i was doing, I haven't had time to JUST test this script on its own.

Scripting / Pos Positioning Module
« on: January 20, 2021, 07:06:48 PM »

The Pos (Layout Scaling) Module module for AttractMode helps position, scale or stretch items to fit a wide variety of screen dimensions using easy-to-reference pixel values. The goal of this module is to make it easier to design a layout using pixels in a layout editor like Photoshop and then scale it dynamically to fit any format, whether it's 16x9, 4x3 or vertical.

Basically you can tell the pos module your original sizes and positioning in Photoshop and the pos module will scale or stretch your content smartly to fit the current screen size. I like to think of this as something like the Preserve_Art module, except for any positioning and scaling. It also handles font scaling without stretching, and does some basic work to handle the differences between font sizes needed on a horizontal monitor vs. a vertical one.

It basically works in place of existing x,y,width,height values. The basics look like this:

Code: [Select]
fe.load_module("pos") // positioning & scaling module

local posData =  {
    base_width = 1440.0, /* the width of my photoshop design */
    base_height = 1080.0, /* the height of my photoshop design */
    layout_width = fe.layout.width,
    layout_height = fe.layout.height,
    scale= config['scale'], /* set to stretch or scale */
    debug = false,
local scalepos = Pos(posData)

local boxart = fe.add_artwork("boxart", scalepos .x(100), scalepos .y(100), scalepos .width(500), scalepos .height(500));

The code above will dynamically scale to any size or position. There are also methods to handle alignment against the screen and other objects.

I've been using some version of this code for the last few years to make it simpler for me to design a layout in Photoshop and then build it for AttractMode. Recently I updated a bunch of my layouts to use it while testing it. For detailed example of how it works, you can reference those layouts.

These were originally designed to fit 4:3 screens, but will now work on 16:9 or vertically, using the same code.

Lots of details are available in the readme. Check it out when you get a chance.

Here's some pics of what it can do.

Themes / Verted -- Layout for Vertical Cabinets
« on: January 08, 2021, 06:27:17 PM »
Verted Layout

Can be downloaded here:

This layout is intended primarily for vertical cabinets, but can be used for different sized screens. This layout will scale to any size, but is intended for use on vertical cabinets. This theme includes tabs to show snaps, flyers, cabinets, and history info (requires history.dat plugin be installed, configured, and enabled)

This layout is based off of a previous theme called "The Invaders", though largely uses different code. Primary differences from the original include bug fixes, the ability to show or hide the games list, improved tab interface with options to show/hide tabs and will disable tabs without content on a per-game basis, dynamic scaling, and selectable colors for bezel and tabs. The design is basically the same, but the code is nearly all new. I started using The Invaders theme on my cabinet, but I wanted some more flexibility, and I wanted a reason to fine-tune my Pos (dynamic positioning) module. Also, the original had some font-stretching due to differences in the sizes of my vertical monitors versus the layout. This version will scale fonts rather than stretch them.


1. Add the animate2 and pos modules to AttractMode's modules folder.
Though I've included those 2 modules:
You can find the latest version of the animate2 module here:
The latest version of the Pos module can be found here:

2. You'll need to have artwork set up for the following: cabinet, flyer, marquee, snap, wheel if you want to use all of the functionality

3. To use the History/Info tab, take a look at the setup instructions under the "Show History Info Tab" instructions below


Show Games list

Off by default

If enabled, shows list of games on the left-hand side.


The tabs feature requires custom1 control be configured in AttractMode. To add a custom control go to: AttractMode Settings > controls > custom1 > add input. Once the input has been added, you can use this control to select available tabs. Tabs that have been enabled, but do not have content will be dimmed and unselectable

Show History Info Tab
Off by default

If enabled, shows the History/Info tab. To use this feature:

1. History.dat plugin must be enabled and working.
2. You must generate the History.dat plugin's index. After generating the index the first time, you may need to restart AttractMode
3. You must set the history.dat location in the layout options (even though it's already set up in the history.dat plugin)
Show Flyers Tab

Enabled by default

If enabled, shows the Flyer tab

Show Cabinets Tab

Enabled by default

If enabled, shows the Cabinets tab

Bezel Style/Color

This sets the colors for the bezel and the tabs. The bezel is the image that wraps around the snap image.

Blink the PLAY NOW graphic

When set to yes, the play now graphic will pulse


Controls how the flyers & cabinet artwork should be scaled. Stretch will fill the entire space. Scale will scale up/down to fit the space.


Controls how the layout should be rotated

Credit to: "The Invaders" by MarkC74,  with enhancements by FrizzleFried, ArcadeBliss and others... original posting: for the layout and concepts, animation, and more.

Also, this theme uses some of the history.dat code from here:


Scripting / Callback Segmentation Fault
« on: November 15, 2020, 09:53:25 AM »
I'm getting a segmentation fault when I use the check_key callback in a layout. I'm assuming it's because I'm calling other functions and objects from the callback, but not doing it correctly.

I'll look at some other layouts later to maybe learn a thing or two, but for now I need a break.  ;D Any suggestions would be appreciated.

Code: [Select]

local key = config['key'];
local slide_time = "350ms";

local key_delay = 250;
local last_check = 0;
function check_key( ttime )
    local is_down = fe.get_input_state( key );

    if (is_down)
        if ( ttime - last_check > key_delay )
            last_check = ttime;

            if (info_view==0) {

                if ( config["show_games_list"] == "Yes" )
                    // SEGFAULT IF THIS LINE EXISTS ////////////////////////////////////

Scripting / LEDSpicer Emitter Plugin & LEDSpicer Tutorial
« on: November 05, 2020, 07:45:10 PM »
For those that use LEDSpicer on Linux platforms, I've written a plugin to interact with it. Updated 12/16/2020

This plugin:
  • Changes light profiles while navigating AM based on the currently shown rom.
  • Changes light and joystick profiles when a rom is launched.

Plugin Options

Delay Time:
The amount of inactivity (in microseconds) before Launching Emitter

Reset Time:
This is the period of time until the profile resets to the default (if set)

Default Profile:
The name of the profile that should be sent after a game exits & after the reset time. This should be a valid profile name set up in LEDSpicer. If you use dynamic joysticks, the profile should include a rotator profile

Joystick Default Position:
If using dynamic joysticks, you can set a default joystick mode to use while in AttractMode. If you have a default profile set, this option will override it.

The options available for this setting are: Use profile default, Vertical 2-way, 4-way, 8-way, Analog. Your joystick must support the selected mode, or the closest mode will be used instead. In my case, I only have one layout, so my joystick is set to Vertical 2-way by default

Activation Mode:
There are two modes for use in the AM user interface. Manual and Automatic.
Automatic mode: lighting profiles will be changed based on the currently selected rom after an editable period of inactivity.
Manual mode: a button press will change the profile based on currently selected rom.

The key that will activate the Emitter plugin when in Manual mode

Attract Mode User Interface Navigation

FOR ARCADE SYSTEMS: Emulator System Name must include one of the following words (case doesn't matter), arcade, mame, neo geo, neogeo, fba, final burn, or daphne. Emulator Systems including one of these names will call LEDSpicer to use an arcade profile
Code: [Select]
emitter LoadProfileByEmulator romname arcade --no_rotate

FOR CONSOLES: Emulator System Name must match the LEDSPicer profile name, for instance a system named "Nintendo Entertainment System" will launch a profile named "Nintendo Entertainment System.xml" from the LEDSpicer profiles directory.

Code: [Select]
emitter LoadProfile systemname --no_rotate
Launching a Game
FOR ARCADE SYSTEMS: This does the same thing as in the user interface, but will allow rotators/restrictors to work.
Code: [Select]
emitter LoadProfileByEmulator romname arcade

FOR CONSOLES: This does the same thing as in the user interface, but will allow rotators/restrictors to work.
Code: [Select]
emitter LoadProfile systemname
Please check github for other important information.

About LEDSpicer:
LEDSpicer is used to dynamically change LED colors, manage Joystick profiles (for U360, GGG 49-way, servostiks) and it can also interact with MAME's output system to drive things like Knockers and LCD panels. LEDSpicer has support for controls.ini as well as colors.ini to set LED colors to the original joystick and button colors.

Quick-start tutorial is available a few posts down.

When I generate a romlist for MAME using extras (Catver.ini, players.ini, mame.xml, etc) I get a list that's duplicated. The first set of roms is correct, then at the end there's a second set of the same roms, but missing all of the information. It looks something like this:

Code: [Select]
1943;1943: The Battle of Midway (Euro);Arcade;;1987;Capcom;Shooter / Flying Vertical;2;270;joystick (8-way),joystick (8-way);good;1;raster;;;;2;;;;
... (a bunch of roms in this format)
... (a bunch of roms in this format)

Any ideas?

Scripting / [SOLVED] Read directory contents to an array
« on: June 05, 2017, 08:13:21 PM »
I reviewed the docs, and the squirrel docs themselves.... I could use help scanning the contents of a directory into an array.

Basically, I have about 10 files, and I want one of them to randomly display. Any help would be appreciated. Meanwhile, I'll keep reviewing the docs.

Scripting / [SOLVED] Screensaver Info?
« on: June 02, 2017, 07:02:38 PM »
I'm working on a custom screensaver. I was hoping to add the play count and playtime of the displayed game, rather than the *current* game behind the screen saver. Is this possible? Looking in the docs I didn't find anything obvious, but I may be looking in the wrong docs. Any help would be greatly appreciated.

Scripting / [SOLVED] Configure AM using script instead of Tab key
« on: May 30, 2017, 08:54:37 PM »
I would like to be able to pick a menu item to launch the "tab" menu, rather than having to hit the tab key itself. Why? So I don't have to have a dedicated key just for "tab" or a keyboard, and I would only like setup to launch from the setup screen itself.

So I started poking around the internet... before I go off deep in the weeds testing a bunch of stuff out, I wondered if anyone had any input on this.

I was wondering if setting the "!! Press TAB to configure" to be a bash script with some kind of xdotools or something similar would work. I haven't poked around in the code too much yet, just wondered if someone else had already done something like this.

General / RGBcommander 0.4 released
« on: March 17, 2017, 10:30:59 PM »
Just wanted to let you know about something that isn't directly AttractMode related per sé, but it is relevant to Raspberry Pi users that want LEDs on their cabinets or dynamic UltraStiks from Ultimarc. Gijsbrecht released the RGBcommander .4 in the last few days which handles both of those things. As one of the testers, I can confirm it works on Raspberry Pi, and works just fine in conjunction with AttractMode.

One of the things that was potentially keeping me from going full AttractMode, full Raspberry PI was lack of support for Led-Wiz and the fact that try as I might, I couldn't get dynamic mode changing to work on the RPI with the UltraStik. RGBcommander takes care of both of those issues. So now... I'm officially switching my four cabinets over to AttractMode and Raspberry PIs.

Here's a link to the latest:

Also of note, RGBcommander works on Windows (though needs more version testing) as well as linux and Raspberry Pi. Take a look at the link above for more info.

Scripting / Display an image after game quit
« on: March 14, 2017, 04:42:09 AM »
Is there a script floating around to display a game over image after you quit a game? I started messing with a script with transition.fromgame (and it works) but it's too fast. Before I start investigating all the properties and methods, I was curious if there was a "known" script out there that does this already.

Pages: [1] 2