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

Pages: [1] 2
1
Themes / Re: If statements using magic tokens
« on: May 19, 2017, 01:58:15 PM »
Thanks! I'll give this a shot. Just from a quick look it does what it's supposed to but the formatting is weird - it adds the text, but doesn't place it. THe refresehes on changing a filter, but not a romlist. I'll play with it. Thanks for the help!

2
Themes / Re: If statements using magic tokens
« on: May 11, 2017, 07:49:53 PM »
Gave this a shot: but it performed a redraw regardless of what was going on.

Code: [Select]
    local console = fe.list.name;
    fe.add_transition_callback(this, "on_transition");
    function transition_callback(ttype, var, ttime)
    {
    local last_console = console;
      console = fe.list.name;
      switch ( ttype )
      {
          case Transition.ToNewList:
              switch ( fe.list.name )
              {             
          case "Nintendo Entertainment System":
                local textnestest = fe.add_text( "nes test", flx*0.30, fly*0.88, flw*0.68, flh*0.06  );
                if (last_console != console)
                {
                    fe.signal("reload");
                }
                break;
          case "Super Nintendo":
                local textnestest = fe.add_text( "snes test", flx*0.30, fly*0.88, flw*0.68, flh*0.06  );
                if (last_console != console)
                {
                    fe.signal("reload");
                }
                break; 
              }
          break;
        }
    }
    fe.add_transition_callback("transition_callback" );

3
Themes / Re: If statements using magic tokens
« on: May 11, 2017, 05:46:56 PM »
The other thing to remember is that the layout options for one theme are universal.

Yeah, I'm hoping that there aren't any options that will be needed with the theme once I'm done - it should be all automatic.

4
Themes / Re: If statements using magic tokens
« on: May 11, 2017, 07:00:17 AM »
Huh. I'm basically reverse engineering your theme without realizing it existed!

I'm using robospin 4 and trying to make it universal. It needs to make a cabinet image, snap surface and image logo for each theme type. I have all the artwork and theme types done, but I want this universal thing working before I release it.

I'll have a look at your old room and see if this helps thanks so much!

5
Themes / Re: If statements using magic tokens
« on: May 09, 2017, 08:56:28 PM »
It's also only adding the text when you transition away from the list, not when you transition into the list.

I also tried
Transition.ToNewSelection
Transition.FromOldSelection

Neither of them seemed to work at all. I'm not sure if I have the language right, but I am transitioning from one emulator to another (i.e. one romlist to another.)

6
Themes / Re: If statements using magic tokens
« on: May 09, 2017, 08:50:34 PM »
So this works,

Code: [Select]
function transition_callback(ttype, var, ttime)
  {
    switch ( ttype )
    {
        case Transition.ToNewList:
            switch ( fe.list.name )
            {             
        case "Nintendo Entertainment System":
            local textnestest = fe.add_text( "nes test", flx*0.30, fly*0.88, flw*0.68, flh*0.06  );
            break;
        case "Super Nintendo":
            local textnestest = fe.add_text( "snes test", flx*0.30, fly*0.88, flw*0.68, flh*0.06  );
            break; 
            }
        break;
    }
}
fe.add_transition_callback("transition_callback" );

It won't clear (redraw) the text once the layout transitions to a new list. It will add "nes test" on top of "snes test"

Looking at the documentation it seems I need to add
Code: [Select]
return true; to clear it? When I did that it crashed the layout. Super confused.

in http://attractmode.org/docs/Layouts.html#add_transition_callback

This is the example they use to illustrate how to redraw, but it doesn't make sense to me.

Code: [Select]
function transition( ttype, var, transition_time )
{
   local redraw_needed = false;

   // do stuff...

   if ( redraw_needed )
      return true;

   return false;
}

7
Themes / Re: Directory fallback?
« on: May 09, 2017, 08:11:33 PM »
That's not quite what I mean, but I maybe this will work? Brute force it to find. I was hoping there might have been a better way to check

Code: [Select]
    if ( my_config["enable_boxart"] == "yes" )
    {
    local surface_boxart = fe.add_surface( 480, 480 );
    local boxart = FadeArt("boxart", 0,0, 480, 480, surface_boxart);  // check here first
    local boxart = FadeArt("flyer", 0,0, 480, 480, surface_boxart);  // If nothing, then go here
    boxart.trigger = Transition.EndNavigation;
    boxart.preserve_aspect_ratio = true;
    surface_boxart.set_pos(flx*0.35, fly*0.05, flw*0.40, flh*0.40 );
    surface_boxart.rotation = 12;
    }

8
Themes / If statements using magic tokens
« on: May 08, 2017, 11:31:19 PM »
I can't figure this out.

I want to make a function that runs if a particular emulator is showing. Is this possible?

Code: [Select]
emu = [Emulator]
if ( emu == "nes|Nintendo Entertainment System|Nintendo") {
    blah blah
}

9
Themes / Directory fallback?
« on: May 08, 2017, 09:06:23 PM »
I have a box art call

Code: [Select]
    if ( my_config["enable_boxart"] == "yes" )
    {
    local surface_boxart = fe.add_surface( 480, 480 );
    local boxart = FadeArt("flyer", 0,0, 480, 480, surface_boxart);
    boxart.trigger = Transition.EndNavigation;
    boxart.preserve_aspect_ratio = true;
    surface_boxart.set_pos(flx*0.35, fly*0.05, flw*0.40, flh*0.40 );
    surface_boxart.rotation = 12;
    }

How do I create this so it checks /boxart first, and falls back to /flyer if it can't find anything?

10
Can a display tell if a game is tagged as a favorite? I want to have a credit dot show up on the layout if the game in the list is tagged as a fave so I can see if it's saved when browsing through a collection or the full set.

11
Romlister and lightspeed are similar. I didn't realize romlister collected and presented country info too.

Definitely, making your lister spit out a list of rom names, and saving as a .tag is a lot easier than adding a country it to the text file. The nice thing about tag files is you don't even have to narrow it down by your collection. Just make a tag file for all Japanese, US, Europe or World games and have AM do all the comparisons against what roms you own. 

If your romlister can't pop out a list of rom names, you can use regex to delete everything but the names by searching for a new line, and any characters up to the an unescaped semicolon, and replace it with a new line.

12
Easier:. Make the romlister spit out names only, make it into a tag list and filter using that.

13
OK, this is a tough one. I want to sort my arcade games by country. Unfortunately the front end text files don't contain that info.

eg:
Code: [Select]
#Name;Title;Emulator;CloneOf;Year;Manufacturer;Category;Players;Rotation;Control;Status;DisplayCount;DisplayType;AltRomname;AltTitle;Extra;Buttons
1944;1944: The Loop Master;Arcade;;2000;Eighting;Shooter;2 Players (Sim);Horizontal;8-Way Joystick;good;1;Raster;;;;

So, I look at catver.ini

Code: [Select]
1944=Shooter / Flying Vertical
nothing

The XML file that emulation scrapes?

Code: [Select]
<game>
<path>./1944.zip</path>
<name>1944: The Loop Master (USA 000620) </name>
<desc>North American release. Game developed in Japan. For more information about the game itself, please see the original Japanese release entry; "1944 - The Loop Master [Green Board]" (Japan 000620).

</desc>
<image>./images/1944.png</image>
<rating>0.8460000000000001</rating>
<releasedate>2000</releasedate>
<developer>Eighting / Raizing (Capcom license)</developer>
<publisher />
<genre>Shooter / Flying Vertical</genre>
<players>2</players>
</game>

nope (I know the description and name field has Japan in this one example, but this is totally not consistent - only for games that have revisions or alts, not games that are Japan exclusive)

Mame XML??

Code: [Select]
<game name="1944">
<description>1944: The Loop Master (US 000620)</description>
<year>2000</year>
<manufacturer>Capcom, supported by Eighting/Raizing</manufacturer>
<category>Shooter / Flying Vertical</category>
<nplayers>Shooter / Flying Vertical</nplayers>
<verAdded>.66</verAdded>
<controls_info>numPlayers="2" alternating="0" mirrored="1" usesService="0" tilt="0" cocktail="0"</controls_info>
<player number="1" numButtons="2">
<controls>
<control name="8-way Joystick">
<constant name="joy8way"/>
</control>
</controls>
<labels>
<label name="P1_BUTTON1" value="Shoot"/>
<label name="P1_BUTTON2" value="Bomb"/>
<label name="P1_JOYSTICK_UP" value="Up"/>
<label name="P1_JOYSTICK_DOWN" value="Down"/>
<label name="P1_JOYSTICK_LEFT" value="Left"/>
<label name="P1_JOYSTICK_RIGHT" value="Right"/>
</labels>
</player>
<rom name="nffu.03" size="524288" crc="9693cf8f" sha1="c296cb008e282f77b44374d1c3638a3f4d5d5d4e" region="cpu1" offset="0"/>
<rom name="nff.04" size="524288" crc="dba1c66e" sha1="4764e77d4da5d19d9acded27df1e1bcba06b0fcf" region="cpu1" offset="80000"/>
<rom name="nffu.05" size="524288" crc="ea813eb7" sha1="34e0175a5f22d08c3538369b4bfd077a7427a128" region="cpu1" offset="100000"/>
<rom name="nffux.03" size="524288" crc="675c8109" sha1="ab9756dc81c231e75050f22c8cdd3759a592bbe1" region="user1" offset="0"/>
<rom name="nff.13" size="4194304" crc="c9fca741" sha1="1781d4fc18b6d6f79b7b39d9bcace750fb61a5cf" region="gfx1" offset="0"/>
<rom name="nff.15" size="4194304" crc="f809d898" sha1="a0b6af49e1780678d808c317b875161cedddb314" region="gfx1" offset="2"/>
<rom name="nff.17" size="4194304" crc="15ba4507" sha1="bed6a82bf1dc1aa501d4c2d098115a15e18d446a" region="gfx1" offset="4"/>
<rom name="nff.19" size="4194304" crc="3dd41b8c" sha1="676078baad789e25f6e5a79de29672587be7ff00" region="gfx1" offset="6"/>
<rom name="nff.14" size="1048576" crc="3fe3a54b" sha1="0a8e5cae141d24fd8b3cb11796c44728b0acd69e" region="gfx1" offset="1000000"/>
<rom name="nff.16" size="1048576" crc="565cd231" sha1="0aecd433fb4ca2de1aca9fbb1e314fb1f6979321" region="gfx1" offset="1000002"/>
<rom name="nff.18" size="1048576" crc="63ca5988" sha1="30137fa77573c84bcc24570bccb7dba61ddb413c" region="gfx1" offset="1000004"/>
<rom name="nff.20" size="1048576" crc="21eb8f3b" sha1="efa69f19a958047dd91a294c88857ed3133fcbef" region="gfx1" offset="1000006"/>
<rom name="nff.01" size="131072" crc="d2e44318" sha1="33e45f6fe9fed098a4c072b8c39406aef1a949b2" region="cpu2" offset="0"/>
<rom name="nff.11" size="4194304" crc="243e4e05" sha1="83281f7290ac105a3f9a7507cbc11317d45ba706" region="sound1" offset="0"/>
<rom name="nff.12" size="4194304" crc="4fcf1600" sha1="36f18c5d92b79433bdf7088b29a244708929d48e" region="sound1" offset="400000"/>
<chip type="cpu" name="68000" clock="11800000"/>
<chip type="cpu" name="Z80" clock="8000000"/>
<chip type="audio" name="QSound" clock="4000000"/>
<video screen="raster" orientation="horizontal" width="384" height="224" aspectx="4" aspecty="3" refresh="59.633331"/>
<sound channels="2"/>
<input players="2" control="joy8way" buttons="2" coins="2" service="yes"/>
<driver status="good" color="good" sound="good" palettesize="4096"/>
</game>
<game name="19xx">
<description>19XX: The War Against Destiny (US 951207)</description>
<year>1996</year>
<manufacturer>Capcom</manufacturer>
<category>Shooter / Flying Vertical</category>
<nplayers>Shooter / Flying Vertical</nplayers>
<verAdded>.37b13</verAdded>
<controls_info>numPlayers="2" alternating="0" mirrored="1" usesService="0" tilt="0" cocktail="0"</controls_info>
<player number="1" numButtons="2">
<controls>
<control name="8-way Joystick">
<constant name="joy8way"/>
</control>
</controls>
<labels>
<label name="P1_BUTTON1" value="Shoot"/>
<label name="P1_BUTTON2" value="Bomb"/>
<label name="P1_JOYSTICK_UP" value="Up"/>
<label name="P1_JOYSTICK_DOWN" value="Down"/>
<label name="P1_JOYSTICK_LEFT" value="Left"/>
<label name="P1_JOYSTICK_RIGHT" value="Right"/>
</labels>
</player>
<rom name="19xu.03" size="524288" crc="05955268" sha1="d3b6b416f1f9eb1c1cbca6647630d1155647082d" region="cpu1" offset="0"/>
<rom name="19xu.04" size="524288" crc="3111ab7f" sha1="8bbce20ae7ba47949f4939b2f35014fb6decd283" region="cpu1" offset="80000"/>
<rom name="19xu.05" size="524288" crc="38df4a63" sha1="1303f7ab6296f1454907a24d64878bdbd1ef88a7" region="cpu1" offset="100000"/>
<rom name="19xu.06" size="524288" crc="5c7e60d3" sha1="26bf0936962051be871d7a7776cf78abfca5b5ee" region="cpu1" offset="180000"/>
<rom name="19x.07" size="524288" crc="61c0296c" sha1="9e225beccffd14bb53a32f8c0f2aef7f331dae30" region="cpu1" offset="200000"/>
<rom name="19xux.03" size="524288" crc="239a08ae" sha1="a57e5a0cef351485569cf5c3c79ca0cc7ce439cf" region="user1" offset="0"/>
<rom name="19xux.04" size="524288" crc="c13a1072" sha1="e5c1c85cb77d69d5f43f8cfa6bcc894bd31e0b68" region="user1" offset="80000"/>
<rom name="19xux.05" size="524288" crc="8c066ec3" sha1="a540a773e1cb04a814feb4be8cf22b0eb3121cee" region="user1" offset="100000"/>
<rom name="19xux.06" size="524288" crc="4b1caeb9" sha1="8f965054e5b1c3f1dcaa20279a3348d63a94c1d6" region="user1" offset="180000"/>
<rom name="19x.13" size="524288" crc="427aeb18" sha1="901029b5423e4bda85f592735036c06b7d426680" region="gfx1" offset="0"/>
<rom name="19x.15" size="524288" crc="63bdbf54" sha1="9beb64ef0a8c92490848599d5d979bf42532609d" region="gfx1" offset="2"/>
<rom name="19x.17" size="524288" crc="2dfe18b5" sha1="8a44364d9af6b9e1664b44b9235dc172182c9eb8" region="gfx1" offset="4"/>
<rom name="19x.19" size="524288" crc="cbef9579" sha1="172413f220b242411218c7865e04014ec6417537" region="gfx1" offset="6"/>
<rom name="19x.14" size="2097152" crc="e916967c" sha1="3f937022166149a80585f91388de521055ca88ca" region="gfx1" offset="800000"/>
<rom name="19x.16" size="2097152" crc="6e75f3db" sha1="4e1c8466eaa612102d0807d2e8bf1004e97476ea" region="gfx1" offset="800002"/>
<rom name="19x.18" size="2097152" crc="2213e798" sha1="b1a9d5547f3f6c3ab59e8b761d224793c6ca33cb" region="gfx1" offset="800004"/>
<rom name="19x.20" size="2097152" crc="ab9d5b96" sha1="52b755da401fde90c13181b02ab33e5e4b2aa1f7" region="gfx1" offset="800006"/>
<rom name="19x.01" size="131072" crc="ef55195e" sha1="813f465f2d392f6abeadbf661c54cf51171fa006" region="cpu2" offset="0"/>
<rom name="19x.11" size="2097152" crc="d38beef3" sha1="134e961b926a97cca5e45d3558efb98f6f278e08" region="sound1" offset="0"/>
<rom name="19x.12" size="2097152" crc="d47c96e2" sha1="3c1b5563f8e7ee1c450b3592fcb319e928caec3c" region="sound1" offset="200000"/>
<chip type="cpu" name="68000" clock="11800000"/>
<chip type="cpu" name="Z80" clock="8000000"/>
<chip type="audio" name="QSound" clock="4000000"/>
<video screen="raster" orientation="vertical" width="224" height="384" aspectx="3" aspecty="4" refresh="59.633331"/>
<sound channels="2"/>
<input players="2" control="joy8way" buttons="2" coins="2" service="yes"/>
<driver status="good" color="good" sound="good" palettesize="4096"/>
</game>
<game name="280zzzap">
<description>Datsun 280 Zzzap</description>
<year>1976</year>
<manufacturer>Midway</manufacturer>
<category>Driving / 1st Person</category>
<nplayers>Driving / 1st Person</nplayers>
<verAdded>.31</verAdded>
<rom name="zzzaph" size="1024" crc="1fa86e1c" sha1="b9cf16eb037ada73631ed24297e9e3b3bf6ab3cd" region="cpu1" offset="0"/>
<rom name="zzzapg" size="1024" crc="9639bc6b" sha1="b2e2497e421e79a411d07ebf2eed2bb8dc227003" region="cpu1" offset="400"/>
<rom name="zzzapf" size="1024" crc="adc6ede1" sha1="206bf2575696c4b14437f3db37a215ba33211943" region="cpu1" offset="800"/>
<rom name="zzzape" size="1024" crc="472493d6" sha1="ae5cf4481ee4b78ca0d2f4d560d295e922aa04a7" region="cpu1" offset="c00"/>
<rom name="zzzapd" size="1024" crc="4c240ee1" sha1="972475f80253bb0d24773a10aec26a12f28e7c23" region="cpu1" offset="1000"/>
<rom name="zzzapc" size="1024" crc="6e85aeaf" sha1="ffa6bb84ef1f7c2d72fd26c24bd33aa014aeab7e" region="cpu1" offset="1400"/>
<chip type="cpu" name="8080" clock="2000000"/>
<video screen="raster" orientation="horizontal" width="256" height="224" aspectx="4" aspecty="3" refresh="60.000000"/>
<sound channels="0"/>
<input players="1" control="paddle" buttons="2" coins="1"/>
<dipswitch name="Coinage">
<dipvalue name="2 Coins/1 Credit"/>
<dipvalue name="1 Coin/1 Credit" default="yes"/>
<dipvalue name="2 Coins/3 Credits"/>
<dipvalue name="1 Coin/3 Credits"/>
</dipswitch>
<dipswitch name="Time">
<dipvalue name="60"/>
<dipvalue name="80" default="yes"/>
<dipvalue name="99"/>
<dipvalue name="Test Mode"/>
</dipswitch>
<dipswitch name="Extended Time">
<dipvalue name="Score >= 2.5" default="yes"/>
<dipvalue name="Score >= 2"/>
<dipvalue name="None"/>
</dipswitch>
<dipswitch name="Language">
<dipvalue name="English" default="yes"/>
<dipvalue name="German"/>
<dipvalue name="French"/>
<dipvalue name="Spanish"/>
</dipswitch>
<driver status="good" color="good" sound="preliminary" palettesize="2"/>
</game>

Oh my god, so much info, but none of it the country!

So how do you sort your arcade machines by country?
My horrible  solution

I use a program called LightSpeed Mamelister. It can output attractmode front end files, and it includes all sorts of weird additional info, including region.

  • I feed it the mame.xml and catver.ini and everything you need to get it going.
  • Tell it where you keep your final roms (I am assuming you had filtered them out already, and kept only the good ones)
  • Then tell it to only compare it against the roms you own.

Once you have done this, export it as an XML file and region will be filled in. You can also use the program to select a region or whatever and make an attractmode.txt file if you want to make a display that's just Japan or USA or World, etc.

I use filters so I

  • Made a japan text file
  • added a new country category
  • added japan to each line in the text do using regex
  • Repeated it for each region I wanted
  • Added all text files to one document, and sorted the lines alphabetically.

My question to you, friend

Is there an easier way???

14
Ok I figures this out, but not by turning on and off USB ports.

My issue was attract mode maps js0 - the dragonrise differently than the Logitech game pads. Up on the dragonrise is actually mapped as "upos" and down is "uneg". When I started attract with the Logitech game pads in up and down don't work because up isn't "upos" it's just up.

I was trying to figure out how to make it so am never used the game pads as 0 or 1 but I couldn't do it. Then I realized I don't have to turn anything off at all. I just need to map all the premutations and variations of up and down on to every joystick in the cfg.

Up is now:
Joy0 Upos
Joy0 Up
Joy0 YNeg

Etc. No more issues.

15
Scripting / Script to turn USB on and off
« on: April 29, 2017, 04:29:30 PM »
Raspberry Pi:

I'm trying to reset my USB plugs so that I can reset my controllers in case I leave one plugged in when I start attract mode.

I made a .sh file that looks like this, as per @hermine.potter awesome suggestion.

Code: [Select]
#!/usr/bin/env bash
echo 0 > /sys/devices/platform/bcm2708_usb/buspower
echo 1 > /sys/devices/platform/bcm2708_usb/buspower

The issue is the index has changed, and that folder can't be found AND i'm not entirely sure if this is what I need - I actually need to turn on the USB ports in a particular order so Attract mode doesn't get confused.

I'm not familiar with how the pi works, but

Would this help inspire a solution?
   
Code: [Select]
echo suspend > /sys/bus/usb/devices/usb1/power/level   # turn off
echo on > /sys/bus/usb/devices/usb1/power/level            # turn on

These are the USB devices I have...


Pages: [1] 2