Previous Thread
Next Thread
Print Thread
print out CLI options for slots configuration #117976 10/14/20 11:08 AM
Joined: Feb 2014
Posts: 468
G
Golden Child Online Content OP
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 468
Hi guys,

I was configuring a machine's slots using the UI, and getting everything "just right", with the different devices and options and then having to figure out the CLI options to launch that from a command line.

Sometimes its really difficult to get the options and names just right.

It should be possible to use the manager:machine().devices table to extract the slot options from the device tag:

Code
function printt(t) for i,j in pairs(t) do print(i,j) end end
printt(manager:machine().devices)

function match_string(a) for word in string.gmatch(a,"([%a%d_]+)") do print(word) end end
for i,j in pairs(manager:machine().devices) do print("device "..i) match_string(i) end

Code
device :sl1:parallel:pic_ctx:ap2000
sl1
parallel
pic_ctx
ap2000

which map to the options:

-sl1 parallel -sl1:parallel:pic_ctx ap2000

Of course, there's a lot of devices that aren't relevant and would need to be filtered out like:
Code
device :sl1:parallel:pic_ctx:ap2000:cr_stepper
sl1
parallel
pic_ctx
ap2000
cr_stepper

and you could inspect the images table to get the mounted floppies and hard drives:

Code
for i,j in pairs(manager:machine().images) do 
         print("device "..i) match_string(i) 
         print("filename = "..manager:machine().images[i]:filename()) 
end

device flop1
flop1
filename = /home/Downloads/ColorPrintShop.DSK



Just an idea I was playing with.

Re: print out CLI options for slots configuration [Re: Golden Child] #117977 10/14/20 11:38 AM
Joined: Mar 2001
Posts: 16,590
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,590
I'm not quite sure what you're going for here, but -listslots and -listmedia do those things.

Re: print out CLI options for slots configuration [Re: Golden Child] #117978 10/14/20 11:42 AM
Joined: Feb 2004
Posts: 2,172
Vas Crabb Offline
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,172
You can also view it dynamically in a front-end, or using the minimaws sample script.

Re: print out CLI options for slots configuration [Re: R. Belmont] #117979 10/14/20 01:24 PM
Joined: Feb 2014
Posts: 468
G
Golden Child Online Content OP
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 468
To give more of an example:

I use the UI to configure the slots of the ct486 just the way I like it, then I reset to use that configuration:

[Linked Image from i.imgur.com]

and then I spend a bit of time to figure out how to reproduce that config from the command line.


True, -listslots will give you a list of all the options.

Ohh, ok, you can also change the configuration from the default to see all of the possibilities (I didn't know that, well I learned something)

./mame64 ct486 -isa1 ultra14f -listslots

isa1:ultra14f:scsi:0 cdd2000 Philips CDD2000 CD-R
cdr4210 Creative Technology Blaster CD-R 4210
cdrn820s Caravelle CDR-N820s
cdrom SCSI CD-ROM
cw7501 Panasonic CW-7501 CD-R
harddisk SCSI Hard Disk
s1410 Xebec S1410 5.25 Inch Winchester Disk Controller
smoc501 Sony SMO-C501 MO Disk Controller


and specifying your files with file manager:

[Linked Image from i.imgur.com]


and then a lua script could take all of the slots and files you set up in the UI and give you a command line that would reproduce exactly that configuration.

-board4:lpt:lpt:centronics ap2000 -hard1 hd128MB -hard2 hd128MBpt



Hmmm, minimaws looks very interesting, thanks for the pointer, Vas. (now I have to look up the word elide 8-)

Re: print out CLI options for slots configuration [Re: Golden Child] #117980 10/14/20 01:38 PM
Joined: Mar 2001
Posts: 16,590
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,590
Yeah, -listslots and -listmedia do change according to the other slot options you specify. That's how frontends that support it (I think only QMC2 still, but I may be wrong) dynamically change the options.

For instance, if you remove the Disk II controller from the default apple2e configuration, -listmedia will only show the cassette.


Who's Online Now
4 registered members (Golden Child, Cpt. Pugwash, R. Belmont, Dorando), 52 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,817
Posts116,073
Members4,915
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3