Author Topic: Version 1.6 Released!  (Read 5227 times)

hermine.potter

  • Sr. Member
  • ****
  • Posts: 298
    • View Profile
Re: Version 1.6 Released!
« Reply #15 on: December 01, 2015, 11:41:21 PM »
@Bgoulette
There is a way playing swf-files / flash-files in AM:
1) Download and install firefox and adobe flashplayer
2) set firefox as default to open swf-files (navigate to firefox.exe)
3) install the addon customizable shortcuts and set ESC-button as 'Close Tab'
4) set fullscreen-button in firefox too
5) now close firefox and create a emulator in AM:
Code: [Select]
executable           C:\attract\EMU\flash\Firefox\firefox.exe
args                 "[romfilename]"
rompath              C:\attract\EMU\flash\roms\
romext               .swf
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 356
    • View Profile
Re: Version 1.6 Released!
« Reply #16 on: December 03, 2015, 10:45:54 PM »
Is there any elaboration on "swf support"? Specifically, I'd like to know if it's possible to pass data from AM to a SWF (and back, potentially). I'm comfortable with the Actionscript side of things: just wondering if AM includes an implementation of the Flash player or something that responds to ExternalInterface arguments.


Hi Bgoulette, the built-in SWF support is very much alpha quality at this time (rough, buggy, entire features missing).  I'm not even sure if it was a good idea to merge it in for version 1.6.  However it is there now and hopefully someone will be interested in playing around with it and trying to get it working.  The passing of data between AM and SWF has not been implemented at this point, but I recall that the library that is being used (gameswf) has an API for such things available...

more info on gameswf: http://tulrich.com/textweb.pl?path=geekstuff/gameswf.txt

rsn8887

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Version 1.6 Released!
« Reply #17 on: December 04, 2015, 03:14:29 PM »
I tried to modify fe.layout.width and height, but it doesn't affect the aspect ratio, which I guess is normal...

To fix the aspect ratio of your layout on any screen:
- set your layout size to the screensize
- draw everything on a surface of the size you want, set keep_aspect_ratio of the surface to true.

In the following example, the aspect ratio is determined by surfaceWidth and surfaceHeight, and I set those using the height of the display as a reference.

//top of your layout:
fe.layout.width=ScreenWidth;
fe.layout.height=ScreenHeight;

local screenAspect=(1.0*ScreenWidth)/ScreenHeight;

local layoutAspect=4.0/3.0;
local surfaceWidth=layoutAspect*ScreenHeight;
local surfaceHeight=ScreenHeight;

local fs=fe.add_surface(surfaceWidth,surfaceHeight)
fs.preserve_aspect_ratio=true;
fs.set_pos(0,0,ScreenWidth,ScreenHeight);

//now draw all your stuff using fs.xxx instead of fe.xxx