Jump to content
  • Announcement

    The HyperSpin 2 early access beta is here!

    We’re starting the first public testing phase with Platinum Members to keep the scope manageable while we test the current feature set and begin to add more. In the future, we’ll provide a version for basic members as well.  On behalf of the entire HyperSpin team, we look forward to another exciting adventure with our community.

Calling script to rotate monitor when custom wheel activates/closes


byancey

Recommended Posts

Posted

I've got a rotating monitor setup which I'm planning to integrate with HyperSpin. Since HyperSpin doesn't officially support portrait orientation, what I'm thinking of doing is splitting portrait and landscape MAME games into two separate sub-wheels under MAME. So, for example, selecting MAME from the Main Wheel would take you to a sub-wheel with MAME-Portrait and MAME-Landscape. Selecting MAME-Landscape would take you to the default MAME wheel. Selecting MAME-Portrait would take you to a modified MAME wheel with all graphics rotated and sized to simulate a vertical layout (similar to JeepGuy81's cocktail layout). What I would like to do is run a script (actually, an executable I wrote) each time the MAME-Portrait wheel is activated which puts the monitor in the portrait orientation (and likewise, puts it back to landscape when the wheel is closed). It only takes my monitor about 2 seconds to switch orientations, so it's not a big deal to do this game by game if necessary, but I'd like to try and minimize unnecessary transitions. Grouping all of the portrait games under one wheel and just rotating when accessing this wheel seems like a good way to approach this.

Is what I've proposed above possible with HyperSpin/HyperLaunch?

Thanks!

--

Bryce

Posted

Hopefully someone with a rotating monitor and/or the necessary scripting skills will step in here, but the first thing that springs to mind is that you may need to launch a separate instance of HyperSpin that is configured for vertical games. See this very useful thread about faking subwheels:

http://www.hyperspin-fe.com/forum/showthread.php?33730-Faking-Subwheels-of-Subwheels-with-Multiple-Installs-of-Hyperspin

Posted

Learn how to use this: http://www.hyperspin-fe.com/forum/showthread.php?32782-HyperSpin-Event-Dispatch-System-(EDS)

Using this utility you will be able to know the current system loaded, and by having that you could make a simple script to rotate the screen acording to the system screen orientation.

About using HyperLaunch, the game will run without issues, however the current HL version supports only landscape orientation for fade, hyperpause or any other HL menu.

About that, if you have a little patience you could find a nice reward when the next HL version is released :flute:.

Posted

I have my screen rotating automatically when a vertical game is selected, it rotates back on exit. No need for a portrait version of hyperspin. If this is what you're looking for let me know and I will post details of my method.

Posted
I have my screen rotating automatically when a vertical game is selected, it rotates back on exit. No need for a portrait version of hyperspin. If this is what you're looking for let me know and I will post details of my method.

That's likely the way I'll end up going, but what I was really asking about was grouping all my vertical games on one wheel with rotated graphics, and then rotate vertical once only when that specific wheel is active (and back to horizontal once when the wheel is dismissed) rather than game-by-game. Sounds like Agrajag and bleasby have some interesting ideals for approaches that my work. Don't want to hack too much or enter unexplored territory to make it work that way though.

I would be interested in hearing more details about your approach for rotation. I'm right at the point where I'm ready to start getting my wheels the way I'd like, but since Hypersync and the FTP site have been down since I upgraded to Platinum on Saturday, it appears I'm stuck on that front for now. Might be able to put some immediate energy into getting rotate working on the generic wheels instead, and then come back to the media stuff later.

Thanks!

Posted

I have the following code inside the User Functions.ahk which can be found in ..\HyperSpin\HyperLaunch\Lib

; Use this function to define any code you want to run in every module on start
StartGlobalUserFeatures(){
   Log("StartGlobalUserFeatures - Starting")
     Global emupath, romName, systemName
 if systemName=MAME
     Runwait, %emupath%\Rotation.exe "%romName%"
  return
   Log("StartGlobalUserFeatures - Ending")
}

; Use this function to define any code you may need to stop or clean up in every module on exit
StopGlobalUserFeatures(){
   Log("StopGlobalUserFeatures - Starting")
   Global emupath, romName, systemName
    if systemName=MAME
  Runwait, %emupath%\Rotation.exe "reset"
  return
   Log("StopGlobalUserFeatures - Ending")
}

This calls for Rotation.exe to run when mame system is selected. Rotation.exe is a compiled version of the following ahk.

;[Rotation.exe]

;

;

#SingleInstance force 


romName = %1%

If ((romName = "ace") | (romName = "maze") | (romName = "bang") | (romName = "batman") | (romName = "blasto") | (romName = "bullfgt") | (romName = "cannball") | (romName = "circus") | (romName = "combat") | (romName = "cotton") | (romName = "smash") | (romName = "dday") | (romName = "zero") | (romName = "edf") | (romName = "esb") | (romName = "flyball") | (romName = "gaia") | (romName = "galaxi") | (romName = "gng") | (romName = "grdnstrm") | (romName = "headon") | (romName = "car2") | (romName = "hustle") | (romName = "island") | (romName = "island2") | (romName = "joust") | (romName = "eto") | (romName = "le2") | (romName = "msh") | (romName = "mk") | (romName = "mk2") | (romName = "news") | (romName = "orbit") | (romName = "pass") | (romName = "pgm") | (romName = "phrcraze") | (romName = "popeye") | (romName = "kok") | (romName = "spy") | (romName = "safari") | (romName = "sonic") | (romName = "skyraid") | (romName = "sss") | (romName = "sf") | (romName = "roul") | (romName = "jleague") | (romName = "atetris") | (romName = "tetris") | (romName = "tictac") | (romName = "toki") | (romName = "tm") | (romName = "statriv2") | (romName = "vf") | (romName = "vr") | (romName = "topgun") | (romName = "ws") | (romName = "swa"))
{
goto horizontalrotation
}

param := "%romName%"

;reads verticalRoms controlled roms list

IniRead, verticalRoms, %A_ScriptDir%\Rotation.ini, controls, Set2_vertical

;reads state of vertical, horizontal rotation (user added line in "controls.ini")

iniread, state, %a_scriptdir%\Rotation.ini, Controls, PrevState 

ifnotinstring, verticalRoms, %romname%, gosub, horizontalrotation



verticalrotation:

if ( State = "vertical") 

{

exitapp

} 

else if ( State = "horizontal") 

{ 

[color="#00FF00"]Run, %COMSPEC% /c "smccmd --resume --speed 2050", ,{enter},hide[/color]


iniwrite, vertical, [color="#FF0000"]C:\HyperSpin\Emulators\MAME\Rotation.ini[/color], controls, PrevState 

exitapp

}



horizontalrotation:

if ( State = "horizontal" ) 

{

exitapp

} 

else if ( State = "vertical") 

{ 

[color="#00FF00"]Run, %COMSPEC% /c "smccmd --resume --speed -2050", ,{enter},hide[/color]

iniwrite, horizontal, [color="#FF0000"]C:\HyperSpin\Emulators\MAME\Rotation.ini[/color], controls, PrevState 

exitapp

}



This script looks for Rotation.ini which contains a list of portrait orientated mame roms, when a rom on that list is selected the monitor will rotate. If you find the monitor rotated when it shouldn't have you can add the rom to the top of the Rotation.exe script, or if it didn't rotate and it should have you add it to the Rotation.ini.

The code highlighted in green tells my pololu controller board to rotate my monitor, you may need to change this to suit your setup. The code highlighted in red is the location of the Rotation.ini file, again you may need to change this to suit your setup.

Here is what is contained in the Rotation.ini

[Controls]
PrevState=horizontal
Set2_vertical=005,progolf,mushisam,futari15,pinkswts,batrider,ddpdoj,1941j,1941,1942b,1942a,1942abl,1942,1942w,1943kai,1943j,1943,1943u,1945kiii,19xxa,19xxb,19xxh,19xxjr1,19xxj,19xxd,19xx,39in1,bowl3d,4in1,jantotsu,600,800fath,99lstwar,99lstwara,99lstwark,ad2083,abscam,aceattaca,acrobatm,afighter,aerofgt,aerfboot,aerfboo2,aerofgtb,aerofgtc,aerofgts,superbon,airattck,airattcka,airduel,agallet,agalleth,agalletj,agalletk,agallett,agalletu,ajax,ajaxj,akkanvdr,alcon,alibaba,alieninv,alieninvp2,aafbc,aafbd2p,aafb,alphaho,alphamis,alpine,alpinea,altair,anteatg,horshoes,amidar,amidarb,amidaro,amidars,amidaru,amigo,angelkds,anteater,apbf,apbg,apb1,apb2,apb3,apb4,apb5,apb6,apb,aponow,arabian,arabiana,aracnis,arbalest,lwingsj,argus,arian,arknoid2j,arknoid2u,arknoid2,arkgcbl,arkgcbla,arkmcubl,ark1ball,arkangc,arkangc2,arkanoidj,arkatayt,arktayt2,arkanoidu,arkanoiduo,arkanoid,armchmp2o,armchmp2,armedf,armedff,batridja,batridta,batridj,batridc,batrid,batridk,batridu,armorcar,armorcar2,ashuraj,ashurau,ashura,aso,assault,assaultj,assaultp,abattle,abattle2,astrobg,astrob2,astrob2a,astrob,acombat,acombato,castfant,astrof,astrof2,astrof3,afire,astinvad,laser,asukaj,asuka,asylum,mgolf,acitya,attckufo,avengers,avengers2,azurian,bagman,bagmanmc,bagmans,bagmans2,bakubrkr,ballbomb,baluba,bandido,barrier,batman2,batsugun,batsuguna,batsugunsp,battlnts,battlntsj,bkraiduj,bkraidu,bkraidj,bcruzm12,btlfieldb,btlfield,bgaregganv,bgareggacn,bgareggat2,bgareggahk,bgaregga,bgareggatw,battlane,battlane2,battlane3,atlantisb,atlantis,atlantis2,battles,beastf,blswhstl,bermudatj,bermudata,bermudat,bigbang,bigbucks,bigevglfj,bigevglf,bigkong,bioatack,bking,bking2,bking3,birdtry,blkhole,bladestle,bladestll,bladestl,blastoff,blazer,arkblock,arkbloc2,arkbloc3,block2,blockbl,blockj,block,blockjoy,blockcar,blockgalb,blockgal,blkbustr,bluehawk,bluehawkn,blueprntj,blueprnt,bwcasino,boggy84,boggy84b,bombjack,bombjack2,bjtwin,bjtwina,bongo,boobhack,boomrang,boomranga,brdrline,brdrlinb,brdrlins,botanic,cbdash,bowler,bowlrama,brvbladea,brvbladej,brvbladeu,brvblade,brix,bronx,bucaner,buggychl,buggychlt,bullfgtr,bullfgtrs,bullsdrt,bnj,cbnj,cbtime,btime,btime2,btimem,brubber,cburnrub,cburnrub2,buzzard,bwingsa,bwings,bwingso,calibr50,calipso,cannonb,cannonb2,cannonb3,cannonbp,cannballv,capbowl,capbowl2,capbowl3,capbowl4,capitol,caractn,carjmbre,carnivalc,carnivalh,carnivalha,carnival,caswin,catnmous,catacomb,caterplr,ctrpllrp,cavelon,centtime,centipdb,centiped2,centiped,centipdd,champbwl,chanbara,cairblad,checkman,checkmanj,cheekyms,chqflag,chqflagj,chewing,cfarm,chinhero,chinhero2,chinherot,chopper,choppera,chopperb,legiono,legion,circuscc,circusce,circusc,circusc2,circusc3,citybombj,citybomb,cgraplop,colony7,colony7a,combh,commandob,commsega,commandou,commando,complexx,condor,congo,contrab,contrajb,contraj,contra,contra1,cookrace,clbowl,cosmica2,cosmica1,cosmica,cchasm,cchasm1,cosmicg,cosmicmo,cosmicm2,cosmo,cosmogngj,cosmogng,cosmos,cottong,crbaloon,crbaloon2,crazyblk,crazycop,ckong,ckongalc,ckongg,ckongmc,ckongo,ckongs,ckongpt2b,ckongpt2j,ckongpt2jeu,ckongpt2,ckongpt2a,crzrallyg,crzrally,crzrallya,crushbl,crushbl2,crush3,crush2,crush,crush4,crushs,curvebal,cybattlr,cyvern,dai3wksi,daikaiju,daioh,daisenpu,dambustruk,dambustr,dambustra,dangar,dangar2,dangarb,dangseed,dfeveron,darkwar,darthvdr,darwin,dazzler,ddayjlc,ddayjlca,redufo,redufob,desertbrj,desertbr,desertwr,desterth,destryer,destryera,detatwin,devstors3,devstors2,devstors,devilfsh,devilfsg,devzone,devzone2,digdugat1,digdugat,digsid,digdug1,digdug,digdug2,digdug2o,digger,diggerc,dimahoo,dimahoud,dimahoou,dingo,dirtfoxj,discoboy,disco,cdiscon1,discof,dockman,ddonpach,ddonpachj,ddp3blk,ddp3b,ddp3a,ddp3,dogfight,dogosoke,dogosokb,dogyuun,dogyuunt,dogyuunk,dommy,dkongj,dkongjo,dkongjo1,dkong,dkongo,dkong3b,dkong3j,dkong3,dkongf,dkongx11,dkongx,dkongjrm,dkongjrb,dkongjrj,dkongjre,dkongjnrj,dkongjr,donpachihk,donpachij,donpachikr,donpachi,dorachan,dorodon,dorodon2,dcheese,downtownj,downtownp,downtown,downtown2,drmicro,drtoppelu,drtoppel,drtoppelj,draco,dragnblz,dsaber,dsaberj,dspirita,dspirit,dspirito,drakton,drktnjr,dremshpr,driftout,driveout,drivfrcb,drivfrcg,drivfrcp,dualaslt,dyger,dygera,dynadice,dynamski,dynobop,eagle,eagle2,eagle3,eggor,eggs,8ballact,8ballact2,8bpm,eightfrc,enigma2,enigma2a,equites,equitess,espgal2,esprade,espradejo,espradej,espgal,evilston,excthour,exctsccr,exctsccra,exctsccrb,exctsccrj2,exctsccrj,exctscc2,exedexes,exerion,exerionb,exeriont,exerizer,exerizerb,exodus,explorer,explbrkr,extrmatnj,extrmatnu,extrmatn,eyes,eyes2,eyeszac,fa,f1gp,f1gp2,falcon,falconz,fantasia,fantasyj,fantasyu,fantasy,fantsy95,fantazia,fastfred,fastlane,sqbert,hustlerb2,feversos,fcombat,fghtatck,fhawkj,fhawk,cfghtice,fightrol,fstarfrcj,fstarfrc,finalizr,finalizrb,firebarr,firebatl,fireshrk,fireshrkd,fireshrkdh,firetrapbl,firetrapj,firetrap,firetrk,fitter,fitterbl,fixeightb,flkatck,flyboy,flyboyb,cflyball,fsharkbt,fshark,flytiger,freekickb,freekickb2,freeze,froggers,fspiderb,frogf,frogg,frogger,froggermc,froggers1,froggers2,frontlin,funkybee,funkybeeb,fnkyfish,funnymou,futspy,fx,gaiapols,gaiapolsj,gaiapolsu,ggroundj,gground,galagamf,galagamw,galaga,galagao,galaga3,galaga3a,galaga3m,galaga88,galaga88j,galaxbsf,galaxianm,galaxianmo,galaxian,galaxiana,galaxiant,galap4,galapx,tst_galx,galturbo,galaxygn,grescue,galxwarst,galxwars,galxwars2,galivan2,galivan,gallag,galmedes,galsnewa,galsnewj,galsnewk,galpanic,galsnew,galpani3,galspnbl,gangonta,gbusters,gbustersa,gaplusa,gapluso,gaplus,gardia,gardiab,garuka,gatsbee,gekirido,gekisou,gemini,gmgalax,ghoxj,ghox,gigasb,gigasm2b,gteikoku,gteikokb,gteikob2,yamagchi,goindolk,goindolu,goindol,goldbug,gomoku,gondo,gorf,gorfpgm1,gorfpgm1g,gorkans,gotya,grchamp,gcpinbal,gmahou,gseekeru,gseekerj,gseeker,griffon,grindstm,grindstma,grobda,grobda2,grobda3,gryzor,gryzora,gstream,gwarb,gwar,gwara,gwarj,gulfstrm,gulfstrmm,gulfwar2,gunfront,gunball,gundealr,gundealra,gundealrt,gunfrontj,gunsmokej,gunsmokeu,gunsmokeua,gunsmoke,gnbarich,gunbirdj,gunbirdk,gunbird,gunbird2,gundhara,gunlock,gunnail,gutangtn,guwange,guzzler,gyrodine,gyrodinet,gyrussb,gyrussce,gyruss,hal21,hal21j,halleysc,halleycj,halleys,halley87,hangly,hangly2,hangly3,headoni,heartatk,hbarrel,hbarrelw,spinkick,heiankyo,herbiedk,hero,herodku,herodk,hexpoola,hexpool,hwrace,chwy,himesiki,hishouza,buraiken,hoccer,hoccer2,homo,hopprobo,hotpinbl,hotshock,hotshockb,hstennis10,hstennis,hotdogst,hunchbkd,hunchbkg,hunchbks,hunchbak,hunchbaka,huncholy,hncholms,ibara,igmo,ikarijp,ikarijpb,ikari,ikarinc,ikaria,imgfighto,imgfight,imago,imagoa,imolagp,indianbt,intrepid,intrepid2,intruder,invrvnge,invrvngea,invasiona,invasionb,invasion,invinco,invds,invho2,ipminvad,ixion,jackrabt,jackrabt2,jackrabts,jack,jack2,jack3,jackal,zaxxonb,jspecter,jspecter2,jin,teamqb,teamqb2,joinem,jollyjgr,josvolly,journey,joust2,joyfulr,joyman,jrpacman,jrpacmbl,jumpbug,jumpbugb,jumpcoas,jumpcoast,jumpshot,jumpshotp,jcross,jjack,jungler,junglers,jrking,junofrst,junofrstg,kagekih,kagekij,kageki,kaitei,kaitein,kamakazi3,kamikaze,kamikcab,kangaroo,kangarooa,kangaroob,kaos,kchamp,kchampvs,kchampvs2,karatedo,ketb,keta,ket,kickc,kick,kicker,kickman,horekid,horekidb,kikikai,kingballj,kingball,kingofb,kingdmgp,knightb,knockout,koikoi,konam80a,konam80s,konam80k,konam80u,konam80j,korosuke,kosmokil,legofair,krzybowl,krull,kuhga,kyros,kyrosj,ktiger,ktiger2,lagirl,labyrunr,labyrunrk,ladybug,ladybugg,ladybugb,ladybgb2,ladyfrog,ladykill,ladymstr,lagunar,lsasquad,lasso,lastduelb,lastduelj,lastduel,lastduelo,lastmisnj,lastmisno,lastmisn,bagnard,bagnarda,ledstorm,ledstorm2,lwingsb,lwings,lwings2,crshrace,crshrace2,lethalth,levers,liberate,liberateb,lgtnfghta,lgtnfghtu,lgtnfght,lizwiz,lnc,clocknch,locomotn,locoboot,logger,looping,loopingv,loopingva,losttomb,losttombh,loverboy,cluckypo,luctoday,lrescue,lrescuem,lupin3,lupin3a,machomou,macrossp,madalien,madaliena,madgearj,madgear,mplanets,mplanetsuk,madshark,mbrush,magworm,magspot,magspot2,jongbou,msjiken,mahoudai,majest12,mjleague,maketrax,maketrxb,makyosen,maniach,maniach2,manybloc,mappyj,mappy,marinedt,mariner,mars,marvins,masterwj,masterwu,masterw,matmania,mofflott,mazingerj,mazinger,megaforc,megazonei,megazone,megazonea,megazoneb,megazonec,megadon,myqbert,mercsur1,mercsu,mercs,merlinmm,metafox,msisaac,meteor,mimonkey,mimonscr,mimonsco,mikie,mikiehs,milliped,millipdd,millpac,minefld,mmonkey,mmpork,mirax,miraxa,mspuzzle,m660b,m660j,m660,misncrft,cmissnx,mrviking,mrvikingj,moegonta,moguchan,monymony,monkeyd,monsterb,monsterb2,montecar,moonaln,moonal2,moonal2b,moonbase,moonbasea,mooncrsb,mooncrs2,mooncrs3,mooncrgx,mooncrstg,mooncrstuk,mooncrstu,mooncrst,mooncrsto,mlander,moonqsr,mooncmw,moonwar,moonwara,motorace,motos,mouser,mouserc,douni,mrdo,mrdofix,mrdoy,mrdot,docastleo,docastle,docastle2,mrdu,mrjong,mrkougar,mrkougb,mrkougb2,mrkougar2,mrlo,mrtnt,mspacmat,mspacman,mspacmab,mspacmbe,mspacmnf,mschamps,mschamp,mspacpls,20pacgalr0,20pacgalr1,20pacgalr2,20pacgalr3,20pacgalr4,20pacgal,rocktrv2,mnchmobl,mustache,mx5000,mystston,myststono,ncv1,ncv1j,ncv1j2,ncv2,ncv2j,naughtyb,naughtyba,naughtybc,nmouse,nmouseb,navarone,nebulrayj,nebulray,netwars,newfant,newpuckx,newsin7,nyny,nynyg,newpuc2,newpuc2b,nextfase,nibblero,nibbler,nibblera,nibblerb,cnightst,cnightst2,ninjemak,nitrobal,nomnlnd,nomnlndg,noahsark,nob,nobb,nost,nostj,nostk,nsub,nunchaku,ohpaipee,oigas,olibochu,omega,omegaf,omegafs,omni,orbitron,outzone,outzonea,outzoneb,outzonec,outzoned,outline,ozmawars,ozmawars2,ozon1,pacnpal,pacnpal2,pacgal,pachifev,25pacman,pacnchmp,pacmanbl,pacmanbla,pacheart,pacman,pacmod,pacmanf,pacplus,pacmania,pacmaniaj,paddle2,paddlema,paintrlr,pairlove,pandoras,panther,paprazzi,paradise,para2dx,paradlx,pturn,prtytime,passshtj,passsht16a,passsht,passshta,peggle,pegglet,pengob,pengo,pengo2u,pengo2,pengo3u,pengo4,penta,perestro,perestrof,perfrman,perfrmanu,cppicf,cppicf2,enigma2b,phelios,phoenix,phoenixa,phoenixb,phoenixc,phoenix3,phoenixj,phoenixt,phoenxp2,phozon,phrcrazev,pickin,pignewta,pignewt,pbaction,pbaction2,pbaction3,pbaction4,pbaction5,pinbo,pinboa,pinbos,pballoon,pballoonr,piranha,piranhah,piranhao,pisces,piscesb,pitnrun,pitnruna,plgirls,plgirls2,playball,pleiadbl,pleiadce,pleiads,plusalph,pokrdice,polarisa,polaris,polariso,pollux,polluxa,polluxa2,pootan,pooyan,pooyans,popflamen,popflameb,popflamea,popflame,popeyeman,popper,porky,portman,porter,portrait,portraita,poundforj,poundforu,poundfor,psurge,tryout,cprobowl,prosoccr,cprosocc,prosport,prosporta,cptennis,progress,promutrv,promutrva,promutrvb,promutrvc,psychic5,psychic5a,puckmanh,puckmanf,puckman,puckmana,puckmod,pulsar,puzlclub,qberttst,qbertj,qbert,qberta,qbtrktst,qbertqub,qix,qixb,qixa,qixo,qix2,quantump,quantum1,quantum,quarterb,quarterba,quasar,quasara,quester,questers,qwak,r2dtank,rackemup,radarscp,radarscp1,radarzon,radarzon1,radarzont,raflesia,raiden,raidena,raidenk,raident,raidenu,raidenua,rdftadi,rdftam,rdftau,rdfta,rdftit,rdft,rdftj,rdftu,rdft2,rdft22kc,rdft2a2,rdft2a,rdft2j2,rdft2j,rdft2t,rdft2u,rdft2us,rfjet,rfjet2kc,rfjeta,rfjetj,rfjets,rfjetu,raiders,rallybik,raphero,rayforce,rayforcej,razmataz,reaktor,redalert,redclashk,redclash,redclasha,redhawke,redhawk,redrobin,redlin2p,reguluso,regulus,regulusu,repulse,rescue,retofinv,retofinv1,retofinv2,ridleofp,ringfgt,ringfgt2,ringking,ringking2,ringking3,ringkingw,roadf,roadf2,rockduck,rockn3,rockn4,rockn,rockna,rockn2,rocnrope,rocnropek,rollace,rollace2,rollingc,rtriv,romperso,rompers,clapapa2,clapapa,rotaryf,roundup,route16b,route16,route16a,routex,rcasino,rshark,rugrats,re900,rumba,rundeep,rushcrsh,ryujin,srdmissn,ssmissin,safarir,samesame2,samesame,samurai,samuraia,tsamurai,tsamurai2,tsamuraih,sandscrp,sandscrpb,sandscrpa,searcharj,searcharu,searchar,sasuke,satansat,satansata,shollow,shollow2,saturn,savgbees,scotrsht,scorpionmc,scorpion,scorpionb,scramble,scramblb,scramb2,scramblebf,scrambles,sspiritj,sspirits,scregg,cscrtry,cscrtry2,scudhamm,neobattl,sectrzon,amatelas,seicross,sengekis,sengekisj,sngkace,commandoj,mercsj,senjyo,sexyboom,shaolins,shaolinb,sheriff,shienryu,mikiej,shippumd,shootbul,shtrider,shtridera,shuffle,shuttlei,sidewndr,sindbadm,sinistar1,sinistar2,sinistar,skullfngj,skullfng,skyadvntj,skyadvntu,skyadvnt,skyalert,skyarmy,skybase,skybump,skychut,skyfox,skylancr,skylancre,skylove,skyraidr,skyshark,skysmash,skysoldr,slapfighb1,slapfighb2,slapfighb3,slapfigh,slikshot16,slikshot17,slikshot,slither,slithera,solfight,solarfox,amazon,sonofphx,sonicbom,sonicwi,sncwgltd,sstriker,sstrikera,sos,spaceatt,sspaceatc,sspaceat,sspaceat2,sspaceat3,sspacaho,spaceat2,spacbatt,spacbat2,spacbeam,spacebrd,sbomberb,sbuggera,schaser,schasercv,spacecr,spacedem,spcdrag,spcdraga,sdungeon,spacecho,spacecho2,spacempr,spacefev,spacefevo,spacefevo2,highspltb,highsplt,highsplta,spacefbb,spacefbg,spacefb,spacefbu,spacefbe,spcforce,spcforc2,spacefrt,spaceg,spaceint,spaceintj,sicv,invaderl,invadrmr,sisv2,sisv,sitv,invaders,spcinv95u,spcinv95,invaddlx,galap1,invad2ct,invader4,invadpt2,sinvasnb,sinvasn,spceking,spcking2,spclaser,spaceod2,spaceod,panicger,panich,panic2,panic3,panic,spaceph,spaceplt,spcpostn,sraider,sstrangr,sstrangr2,spctbird,spacetrkc,spacetrk,spcewarl,spcewars,spacewr3,speakres,spclforc,spcfrcii,speedbal,spdcoin,spellbnd,spiders,spiders2,spiders3,spinner,springer,spyhunt,spyhuntp,stagger1,starfght,starforc,starforce,starforcb,starforca,starjack,starjacks,starrkr,starw,stera,stinger,stinger2,stmblade,storming,strfbomb,stratab1,stratab,stratvox,stratvoxb,streakng,streaknga,strtheat,sbowling,stg,s1945bl,s1945a,s1945j,s1945jn,s1945k,s1945,s1945ii,s1945iii,sub,sundance,csuperas,sbagman,sbagmans,superbar,sbaskete,sbasketg,sbasketh,sbasketb,sbdk,superbug,sucasino,scobra,scobrab,scobrase,scobras,scontra,scontraj,sdtennis,supdrapob,supdrapo,supdrapoa,searthin,searthina,sformula,sfkick,sfkicka,superg,suprglob,sprglobp,sprglbpg,suprheli,sia2650,superinv,sinvemag,sinvzen,supmodel,smooncrs,suprmous,superpac,superpacm,spbactnj,spbactn,sqixb1,sqixb2,sqixu,sqixr1,sqix,srdarwinj,srdarwin,suprridr,ssia,ssi,macross,sspeedr,sstarbtl,sstingry,sstrike,supertnk,striv,strvmstr,sxevious,sxeviousj,szaxxon,superbik,superxm,superx,survival,swarm,swat,csweetht,ssingles,ssozumo,tnk3j,tnk3,tacscan,tactcian,tactcian2,tagteam,tail2nos,karatevs,hyhoo,hyhoo2,talbot,tankbatt,tankbust,tharrier,tharrierj,taxidrvr,tazzmang,tazmania,tazmani2,teedoff,telmahjn,tempest1,tempest2,tempest3,tempest,temptube,tenkomorj,tenkomor,protennb,terracren,terracre,terracrea,cterrani,ctsttape,atetrisc,atetrisc2,alphaxz,mrflea,anteatgb,battroad,berenstn,bigprowr,billiard,dealer,thedeep,elecyoyo,elecyoyo2,theend,theends,gametngk,theglob,theglob2,theglobp,theglob3,thehand,thehustlj,thehustl,tinv2650,lastday,lastdaya,darkmist,tnextspc,tnextspcj,percuss,thepit,thepitm,thepitb,thepitc,srumbler,srumbler2,thunderl,thndblst,tdragon1,tdragon,tdragonb,tdragon2a,tdragon2,tndrcade,tictacv,tigerhb1,tigerhb2,tigerhb3,tigerhj,tigerh,timelimt,timeplt,timeplta,timepltc,tp84,tp84a,tp84b,timescan1,timescan,timesold1,timesold,tiptop,tokisens,tokiob,jackalj,tndrcadej,tomahawk1,tomahawk,toobin2e,toobine,toobing,toobin1,toobin2,toobin,topgunbl,topgunr,toprollr,ctornado,torus,tdfeverj,tdfever,tdfever2,toucheme,arkatour,cprogolf,todruaga,todruagao,todruagas,tranqgun,travrusa,treahunt,ctisland,ctisland2,tricktrp,trigon,tdpgal,triplep,tripool,tripoola,trisport,statriv2v,trvwz2,trvwz2a,trvwz3v,trvwz4,trvwz4a,trvwzv,trvwzva,trvgns,trvmstr,trvmstra,trvmstrb,trvmstrc,trvquest,tron4,tron3,tron2,tron,truxton,truxton2,tugboat,turbo,turboa,turbob,turbofrc,turbotag,turpin,turpins,turtles,tutankhm,tutankhms,twincobru,twincobr,tcobra2u,tcobra2,twineagl,twineag2,twinhawku,twinhawk,twinbee,typhoon,earthjkr,usclssic,ultrax,unclepoo,uniwars,upndown,upndownu,valkyrie,valtric,vandykeb,vandykejal,vandykejal2,vandyke,vanguardc,vanguardj,vanguard,vangrd2,vanvan,vanvank,vanvanb,vaportrau,vaportra,vaportra3,vmetal,vmetaln,varthj,varthu,varthr1,varth,vasara,vasara2,vasara2a,vastar,vastar2,vautour,vautourz,venus,vfive,victroad,8ball,8ball1,hustler,videopin,vpool,vimana,vimana1,vimanan,viprp1ot,viprp1hk,viprp1oj,viprp1j,viprp1s,viprp1u,viprp1,volfiedjo,volfiedj,volfiedu,volfied,vortex,vsgongf,hotsmash,vulgusj,vulgus,vulgus2,arcadia,wallst,wanted,wrofaero,warofbug,warpwarp,warpwarpr,warpwarpr2,wmatch,waterski,wiggie,wwestern,wwestern1,wiping,wiz,wizt,wizta,wndrplnt,woodpeck,woodpeca,wtennis,worldwar,wrestwar1,wrestwar2,wrestwar,ww3,wyvernwg,xevios,xeviousa,xeviousb,xeviousc,xevious,xxmissio,yamato,yamato2,yankeedo,yellowcbb,yellowcbj,yosakdon,yosakdona,youjyudn,youma,youma2,zarzon,zaviga,zavigaj,zaxxonj,zaxxon,zaxxon2,zaxxon3,zerohour,zerotime,czeroize,dzigzag,zigzag,zigzag2,zingzip,zipzap,zoar,zodiack,zzyzzyxx,zzyzzyxx2

I have Rotation.exe and Rotation.ini both in the same directory as my mame emu.

This script isnt my work, as far as I can gather it was created by members from here and the BYOAC forums, Chillinwater (HS), DNA Dan (BYOAC) and Nitz (BYOAC), I apologise if I missed someone out.

Posted

Thanks. I've got this mostly working now. I'm actually using one of the channels on my controller board to 'remember' the last state, so I don't need to bother with that in my ahk code. I also found a variant of the code that just uses the ListXMLInfo from the ROM to get the orientation of the games. Seems to work correctly on all the ROMs I tried, and it's one less file to maintain when I add new ROMs. :)

All in all, it's working fairly well. However, I do notice that even though I have 'hide' set when I run my app (maestro.exe), I still see a flash of the console window when starting and exiting a game. I usually don't see it when the game starts, but when it exits, it's visible. Just a quick flash, but enough to see that it's doing something in the background. Do you see anything like that with your solution? Would like to hide this if it's possible just to make the whole experience as seamless as possible.

Here's the code I'm using. Any ideas?


StartGlobalUserFeatures(){
Log("StartGlobalUserFeatures - Starting")

Global emupath, romName, systemName


	If ( systemName = "MAME" )
	{
		ListMameTable := []
		ListMameTable := ListXMLInfo%zz%(romName)
		RotationAngle := ListMameTable[2]

		If (RotationAngle != "0") 
                       {  
                               RunWait, %emupath%\maestro -p, %emupath%\, hide	  
			Log("RotateFunctions - Rotating Portrait")				
		} Else {
                               RunWait, %emupath%\maestro -l, %emupath%\, hide	
			Log("RotateFunctions - Rotating Landscape")				
                       }

		return	
	}

Log("StartGlobalUserFeatures - Ending")
}

; Use this function to define any code you may need to stop or clean up in every module on exit
StopGlobalUserFeatures(){
Log("StopGlobalUserFeatures - Starting")
Global emupath, systemName

If ( systemName = "MAME" )
{ 
               Run, %emupath%\maestro -l, %emupath%\, hide 		
	Log("RotateFunctions - Rotating Landscape")				

	return
}

Log("StopGlobalUserFeatures - Ending")
}

Posted

Found a solution to my issue with the console popping up. Thought I'd post it here for anyone else who encounters the same issue. I was able to capture a screenshot and discovered it was actually the mame window popping up, not the window that my rotation app runs in...however, the issue only happens if I do run my rotation app. That led me to look into issues with the mame console window showing up, and I found This suggestion from djvj. It didn't help the problem the original poster in the other thread had...but it fixed my problem. :)

For now, try adding this line:

WinMinimize, ahk_class ConsoleWindowClass

above this line:

WinSet, Transparent, 0, ahk_class ConsoleWindowClass

Posted
I too get a flash of the console window but only with my rotated games, will try this fix later.

It would make sense that you only see it with your rotated games, since you use an ini file to track the rotate state and only call the rotate executable if you actually need to rotate. My executable/controller board tracks the rotate state, so I just always call the executable and let it decide if I need to rotate.

Didnt work for me, not too fussed. :)

Didn't work for the original guy it was suggested for either. Glad it worked for me, it's the kind of thing that I'd spend endless hours trying to eliminate.

Posted
It would make sense that you only see it with your rotated games, since you use an ini file to track the rotate state and only call the rotate executable if you actually need to rotate. My executable/controller board tracks the rotate state, so I just always call the executable and let it decide if I need to rotate.

Didn't work for the original guy it was suggested for either. Glad it worked for me, it's the kind of thing that I'd spend endless hours trying to eliminate.

How do you track the 'rotation' state ?

Posted
How do you track the 'rotation' state ?

The answer requires a bit of explanation....

I'm using a Pololu Micro Mistro servo controller to drive a servo rather than the more typical stepper motor and controller. The micro maestro board supports up to 6 channels and remembers the last position of each servo. In a perfect world, I could just read back the last position of my servo to determine if I need to move it or not...but it's not a perfect world. One caveat with using a servo is that there can be a variance of a millimeter or two when the monitor settles into it's final portrait/landscape orientation. It's not enough to see with the naked eye, but in these cases the servo will continually try and move to the requested position. From a stationary state, the servo can't actually move the entire monitor assembly that small of an amount, but it's constant attempt to try results in a chattering noise. The solution to the chattering is to simply turn the servo off when it gets to its final position and only turn it back on when it needs to move again. However, when you turn a channel off, the controller board effectively forgets the last position of the servo.

Since I'm only using 1 channel on the Maestro board, the solution I implemented was to use channel 2 to shadow the position of my actual servo on channel 1 (basically, when I write a position to channel 1, I also write it to channel 2). Since there's not actually a servo on channel 2, I never need to power it down, and it always remember's the last state of channel 1. When I call my rotation executable (maestro.exe) to request a specific orientation, it first reads the state of channel 2, and if the monitor is already in the requested state, it just returns. I actually considered using a file to track the state, but at the time I was coding this up it was quicker to just use use 2nd channel as "memory".

This solution does not retain monitor state across a power-cycle, so the monitor just returns to the default landscape state at power-on...which is the state it wants to be in when HyperSpin starts up in any case.

If you're curious, I posted

a couple weeks back with rotating monitor assembly...no cabinet yet.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...