Software Support > Automated Projects

Lua os.execute()rotates display in console.. why not in vertical.ini .lay file

<< < (2/2)

10yard:
Great stuff cimedaca! 
Happy to see you have a working solution.

I've messed around with plugins before.  They're a neat way to wrap up a script...and I will make more use of them in the future.  Thanks for providing the detail :cheers:

pageygeeza@yahoo.co.uk:

--- Quote from: 10yard on August 12, 2021, 10:10:15 am ---I'm not familiar with layout files.  Maybe you can achieve the same with a simple LUA script.   os.execute definitely works in LUA script files.  It's just an idea and worth a try for you.


--- Code: ---if not driver then
driver = emu.driver_find(emu.romname())
if driver.orientation == "rot90" or driver.orientation == "rot270" then
os.execute("powershell.exe -file vertical.ps1")
end
end

--- End code ---

This would check the drivers expected orientation when the rom starts up.
The script file should be extracted from the zip and saved into the same location as your vertical.ps1.
You can then update your mame command line arguments to include "-script rotate.lua".  You may need to provide the full path to the rotate.lua.

Jon

--- End quote ---

This code actually works for me!

The other code is checking the PC system for screen rotation changes, MAME doesn't physically rotate the screen, looks like it just rotates its output. Yours is actually polling rom data.

This leads me to my first question, this is the first time I've dabbled with Lua, so please be gentle:

How do I add a ROM close routine to reset the screen once a portrait game has been ended, I'm not 100% sure how the first two lines work in regards to activating the vertical file.

Navigation

[0] Message Index

[*] Previous page

Go to full version