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

Pages: [1]
1
Scripting / Transitions and tick callbacks
« on: June 24, 2020, 02:50:31 PM »
In my theme here:
http://forum.attractmode.org/index.php?topic=3387.0

The conveyor module is used and updates on certain transitions. There's a configurable transition speed.

I'm also using tick callbacks to update the "time" for a background GL shader.

The conveyor (wheel spin) transition affects the tick callback - the longer the transition the more the shader slows down as well.

I don't want this. I want the shader to animate independently of any transition animation, exactly like a video plays.

Could anyone give me a hint what I need to be doing, as I've been stumped with this for a couple of weeks  :-\

2
Themes / Verticools Deluxe
« on: April 29, 2020, 03:21:34 PM »
Finally got around to smartening up Verticools. Designed on and for a vertical 15KHz 240p 4:3 CRT display, but will work anywhere - set your aspect ratio and rotation if required in the options. Will use wheel images if you have them enabled in the emulator configuration.

The below filter rules work nicely to clean out the cruft for MAME 222 as far as vertical, joystick playable games go.

Code: [Select]
global_filter       
exception            Name equals batsugunsp|cyvernj|driftout|ddpdojblk|dkongjrj|dogosokb|downtownj|ghoxj|gwarb|ikarijpb|omegafs
rule                 Rotation equals 90|270
rule                 DisplayType equals raster
rule                 DisplayCount equals 1
rule                 Control contains joystick|dial
rule                 Control not_contains gambling|positional
rule                 Category not_contains Mature|Casino|MultiGame|Redemption
rule                 Status not_equals preliminary
rule                 Title not_contains bootleg|internal build|\(prototype|prototype\)|China|Raiden II New
rule                 Manufacturer not_contains bootleg|Promat
rule                 CloneOf not_contains .
rule                 AltRomname not_equals decocass|cedmag
rule                 Year not_contains ?
rule                 Name not_equals batsugun|cyvern|ddp3|ddpdojt|dkongjr|ghox|ikari|gwar|mjleague|metlhawk|alleymas|omegaf
filter               "All Games"
filter               "Most Played"
sort_by              PlayedTime
reverse_order        true
list_limit           25
filter               "Breakout Games"
rule                 Category contains Breakout
filter               "Driving Games"
rule                 Category equals Driving.+
filter               "Fighting Games"
rule                 Category equals Fight.+
filter               "Maze Games"
rule                 Category equals Maze.+
filter               "Platform Games"
rule                 Category equals Platform.+
filter               "Puzzle Games"
rule                 Category equals Puzzle.+
filter               "Shooting Games"
rule                 Category equals Shooter.+
filter               "Sports Games"
rule                 Category equals Sport.+
filter               "© Alpha Denshi"
rule                 Manufacturer equals (Alpha.Densh.*)|(.*/.Alpha.Densh.*)
filter               "© Bally/Midway"
rule                 Manufacturer equals (Ball.*)|(Midwa.*)|(.*/.Ball.*)|(.*/.Midwa.*)
filter               "© Capcom"
rule                 Manufacturer equals (Capco.*)|(.*/.Capco.*)
filter               "© Cave"
rule                 Manufacturer equals (Cav.*)|(.*/.Cav.*)
filter               "© Data East"
rule                 Manufacturer equals (Data.Eas.*)|(.*/.Data.Eas.*)
filter               "© Irem"
rule                 Manufacturer equals (Ire.*)|(.*/.Ire.*)
filter               "© Jaleco"
rule                 Manufacturer equals (Jalec.*)|(.*/.Jalec.*)
filter               "© Kaneko"
rule                 Manufacturer equals (Kanek.*)|(.*/.Kanek.*)
filter               "© Konami"
rule                 Manufacturer equals (Konam.*)|(.*/.Konam.*)
filter               "© Namco"
rule                 Manufacturer equals (Namc.*)|(.*/.Namc.*)
filter               "© Nintendo"
rule                 Manufacturer equals (Nintend.*)|(.*/.Nintend.*)
filter               "© Psikyo"
rule                 Manufacturer equals (Psiky.*)|(.*/.Psiky.*)
filter               "© Raizing / Eighting"
rule                 Manufacturer equals (Raizin.*)|(Eightin.*)|(.*/.Raizin.*)|(.*/.Eightin.*)
filter               "© Seibu Kaihatsu"
rule                 Manufacturer equals (Seibu.Kaihats.*)|(.*/.Seibu.Kaihats.*)
filter               "© Sega"
rule                 Manufacturer equals (Seg.*)|(.*/.Seg.*)
filter               "© SNK"
rule                 Manufacturer equals (SN.*)|(.*/.SN.*)
filter               "© Taito"
rule                 Manufacturer equals (Tait.*)|(.*/.Tait.*)
filter               "© Technos"
rule                 Manufacturer equals (Techno.*)|(.*/.Techno.*)
filter               "© Tecmo"
rule                 Manufacturer equals (Tecm.*)|(.*/.Tecm.*)
filter               "© Toaplan"
rule                 Manufacturer equals (Toapla.*)|(.*/.Toapla.*)
filter               "© Universal"
rule                 Manufacturer equals (Universa.*)|(.*/.Universa.*)
filter               "© Video System Co."
rule                 Manufacturer equals (Visc.*)|(Video.System.Co.*)|(.*/.Visc.*)|(.*/.Video.System.C.*)
filter               "© Zaccaria"
rule                 Manufacturer equals (Zaccari.*)|(.*/.Zaccari.*)
filter               "Released 1970 - 1979"
rule                 Year equals 197.
filter               "Released 1980"
rule                 Year equals 1980
filter               "Released 1981"
rule                 Year equals 1981
filter               "Released 1982"
rule                 Year equals 1982
filter               "Released 1983"
rule                 Year equals 1983
filter               "Released 1984 - 1985"
rule                 Year equals 1984|1985
filter               "Released 1986 - 1987"
rule                 Year equals 1986|1987
filter               "Released 1988 - 1989"
rule                 Year equals 1988|1989
filter               "Released 1990 - 1994"
rule                 Year equals 1990|1991|1992|1993|1994
filter               "Released 1995 - 1999"
rule                 Year equals 1995|1996|1997|1998|1999
filter               "Released 2000 - 2020"
rule                 Year equals 20..

3
I rebuilt my vertical cabinet over the weekend, including updating Windows to 7 (from XP) and AttractMode to 2.2.1 (from 1.6.1).

Rather than use my existing verticools layout.nut, I used the one in the download zip. Needed to make a few tweaks (stripped out the rotation code entirely as the OS is portrait), but anything where I used the shadow trick - draw shadow then text afterwards inheriting the properties of the shadow did not work.

Code: [Select]
local slgsh=fe.add_text("[Title]",lbx+1,lby+1,lbw,ith);
slgsh.set_rgb(0,0,0);
local selgame=fe.add_text(slgsh.msg,slgsh.x-1,slgsh.y-1,slgsh.width,slgsh.height);

I ended up modifying this code to the below, which works.
Code: [Select]
local slgsh=fe.add_text("[Title]",lbx+1,lby+1,lbw,ith);
slgsh.set_rgb(0,0,0);
local selgame=fe.add_text(slgsh.msg,lbx,lby,lbw,ith);

Just wondering if something changed or if there's something weird going on with my setup.

4
Edit screensaver.nut and find the first instance of
Code: [Select]
ScreenWidth Change it to
Code: [Select]
(ScreenWidth/2) This will fix overlay images aspect ratio.

5
Scripting / Transitions without transitions?
« on: August 05, 2014, 04:32:46 PM »
Example below displays a list box whilst up/down are being pressed (any way of reading the global key configuration to find out what's in use?), and fades it out when the key is released. We avoid getting trapped waiting for transitions to complete before we can select another game.

Only weirdness is when in the configuration menu - I can't seem to reliably capture a "Tab" event to toggle on a "pause fake transition" part, so it just keeps flashing the menu up (but not moving) when you're in config.

Code: [Select]
local flw=fe.layout.width;
local flh=fe.layout.height;

local gamesurface=fe.add_surface(flw,flh);
gamesurface.alpha=0;
local gamesnap=gamesurface.add_artwork("snap",0,0,flw,flh);
gamesnap.video_flags=Vid.ImagesOnly;
local listsurface=fe.add_surface(flw,flh);
listsurface.add_listbox(0,0,flw,flh);
listsurface.alpha=0;
const LISTTIME=50;
local listtimer=0;

function displaylist (ticks)
{
 if (fe.get_input_state("Up")==true)
 {
  listtimer=LISTTIME;
  listsurface.alpha=255;
  gamesurface.alpha=0;
 }
 else if (fe.get_input_state("Down")==true)
 {
  listtimer=LISTTIME;
  listsurface.alpha=255;
  gamesurface.alpha=0;
 }
 else
 {
  listtimer-=1;
  if (listsurface.alpha>(255/LISTTIME))
  {
   listsurface.alpha-=255/LISTTIME;
  }
  if (gamesurface.alpha<255-(255/LISTTIME))
  {
   gamesurface.alpha+=255/LISTTIME;
  }
 }
}

fe.add_ticks_callback ("displaylist");

6
Scripting / I'm doing something wrong - why doesn't my text change?
« on: July 28, 2014, 12:54:07 PM »
Trying to build a simple list routine so I can alter the selected game height.

Only lists the first 9 games. Using up/down changes the preview image appropriately but the list doesn't change.

Code: [Select]
// Layout by cools / Arcade Otaku
// Layout User Options
class UserConfig {
 </ label="Preview Image", help="Choose snap/video snap, title, flyer or none.", options="snap,video,title,flyer,none" /> preview_image = "snap";
}
local my_config = fe.get_config();

// Layout Constants
// Font found on 9031.com
fe.layout.font="Arcade-Regular"
local rot=(fe.layout.base_rotation+fe.layout.toggle_rotation)%4;
local flw=fe.layout.width;
local flh=fe.layout.height;
switch (rot) {
 case RotateScreen.Right:
 case RotateScreen.Left:
  fe.layout.width=flh;
  fe.layout.height=flw;
  flw=fe.layout.width;
  flh=fe.layout.height;
  break;
}

// Preview image
local preview=fe.add_artwork (my_config["preview_image"],0,0,flw,flh/3);

// List
local lbx=0;
local lby=flh/3;
local lbw=flw;
local lbh=flh-lby;
local itn=9;
local ith=lbh/itn;
lby+=(ith*(itn/2));

for (local i=(itn/2)*-1;i<(itn/2);i+=1){
 if (i==0) {
  fe.add_text(fe.game_info (Info.Title),lbx,lby+(ith*i)-5,lbw,ith+10);
 }
 else {
  fe.add_text(fe.game_info (Info.Title,i),lbx,lby+(ith*i),lbw,ith);
 }
}

Actually, just doing this doesn't work as I'd expect:
Code: [Select]
fe.add_text(fe.game_info (Info.Title),0,0,fe.layout.width,fe.layout.height/25);
Even throwing the latter part alone into a "local game=" statement fails for it to update.

Pages: [1]