MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

Jfarro
MAME Fan
Reged: 02/24/14
Posts: 13
Send PM


Mame LUA extensibility - emu.gamename() returning "Nintendo" instead of cartridge name
#371450 - 11/28/17 12:14 PM


This may be by design, if so I am looking for help on a workaround.

When using the lua extensibility engine for Mame, and when I have a nes game loaded...when I query for
emu.gamename() when a nes game is loaded (Legend of Zelda in this case)

I get back:

Nintendo Entertainment System / Famicom (NTSC).

I'd like to either get back "Legend of Zelda". Is this a bug in the lua extensability engine, or am I just doing it wrong? Does anyone know of a workaround to detect which nes game is loaded from the LUA plugin system?

Thanks in advance



crazyc
MAME Fan
Reged: 06/23/16
Posts: 62
Send PM


Re: Mame LUA extensibility - emu.gamename() returning "Nintendo" instead of cartridge name new [Re: Jfarro]
#371454 - 11/28/17 04:02 PM


Gamename gives the romset fullname. For the software name use can use emu.softname() for the short loaded software list entry name or manager:machine().images[*imagedev*]:longname() for the softlist entry description (*imagedev* is the image device the softlist entry is loaded into "cart" for the nes). This works only for softlist images, for fullpath loaded images you're on your own.

Edited by crazyc (11/28/17 04:03 PM)



Jfarro
MAME Fan
Reged: 02/24/14
Posts: 13
Send PM


Re: Mame LUA extensibility - emu.gamename() returning "Nintendo" instead of cartridge name new [Re: crazyc]
#371478 - 11/29/17 12:17 PM


Thanks crazyc!

For both emu.softname() and print(manager:machine().images["cart"]:longname()) (as well as print(manager:machine().images["cartridge"]:longname()) )

I'm getting back blank (not nil...just...blank). This is while the legend of Zelda rom is running.

I'll try with another rom and see if it works there, also I will try with a super nes emu to see if it's working there



crazyc
MAME Fan
Reged: 06/23/16
Posts: 62
Send PM


Re: Mame LUA extensibility - emu.gamename() returning "Nintendo" instead of cartridge name new [Re: Jfarro]
#371482 - 11/29/17 05:18 PM


Are you loading from the softlist or fullpath?

With softlist loading you'll get something like:

Code:

mess64 -debug nes smb -plugin console
_/ _/ _/_/ _/ _/ _/_/_/_/
_/_/ _/_/ _/ _/ _/_/ _/_/ _/
_/ _/ _/ _/_/_/_/ _/ _/ _/ _/_/_/
_/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/_/_/_/

mess 0.191
Copyright (C) Nicola Salmoria and the MAME team

Lua 5.3
Copyright (C) Lua.org, PUC-Rio

[MAME]>

MESS debugger version 0.191 (unknown)
Currently targeting nes (Nintendo Entertainment System / Famicom (NTSC))
[MAME]> print(emu.softname())
smb
[MAME]> print(manager:machine().images["cart"]:longname())
Super Mario Bros. (Euro, Rev. A)
[MAME]>


With fullpath loading you'll get empty strings for both. manager:machine().images["cart"]:filename() will get you the file name but that's all that's available.



Jfarro
MAME Fan
Reged: 02/24/14
Posts: 13
Send PM


Re: Mame LUA extensibility - emu.gamename() returning "Nintendo" instead of cartridge name new [Re: crazyc]
#371781 - 12/11/17 09:46 AM


Thankyou! I should've researched what softlist was beforehand...i was loading it by passing the path, and as you said that's why I was seeing nothing come back. Thanks again, you've unblocked me and I can work on finishing this up!


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 28 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1283