Build Your Own Arcade Controls Forum
Front End Support => MaLa Frontend => Topic started by: TheShanMan on March 28, 2009, 01:58:38 pm
-
I'm trying to import a mameui style ini folder, and it doesn't like it when the section has a "_" in it, like "[ROOT_FOLDER]". It just ignores sections that have that, but since that's what mameui uses, it makes the mameui import useless (unless you know to manually edit the file and remove the "_").
Really, what I'm trying to do is find a way to import a list of rom names from a text file to create a game list. Is this the only way to do this? It would be nice if you could import a plain text file, without having to create an ini-style file to do it through the mameui import. Or even if you could add games by pasting a comma separated list into a text box.
Do you think either of these ideas would be good to add? And can you fix the "_" bug?
Thanks!
-
I'm trying to import a mameui style ini folder, and it doesn't like it when the section has a "_" in it, like "[ROOT_FOLDER]". It just ignores sections that have that, but since that's what mameui uses, it makes the mameui import useless (unless you know to manually edit the file and remove the "_").
Really, what I'm trying to do is find a way to import a list of rom names from a text file to create a game list. Is this the only way to do this? It would be nice if you could import a plain text file, without having to create an ini-style file to do it through the mameui import. Or even if you could add games by pasting a comma separated list into a text box.
Do you think either of these ideas would be good to add? And can you fix the "_" bug?
Thanks!
I have not done this before. Are you using Import MAME32 custom list?
I just did a few more quick tests , and it seems to be the name 'ROOT_FOLDER' that causes it to be ignored. [ROOT_folder] , [R_FOLDER], [RO_FOLDER], [ROO_FOLDER], [ROOT_FOLER] are OK
It has nothing to do with underscore
See Code Below. It seems to be deliberate to ignore ?? Why would this be? Could it be you are not supposed to put game in root, only in subfolders?
Here is an ini file in my mame32 :
[FOLDER_SETTINGS]
RootFolderIcon cust1
SubFolderIcon cust2
[ROOT_FOLDER]
[Golden Age]
amidar
armora
astdelux
asteroid
astrob
astrof
bagman
berzerk
bosco
btime
bubbles
buckrog
bzone
carnival
cavenger
ccastles
This is the code, so it should not be hard to make a variation to load comma separated , and to allow ROOT_FOLDER to be visible.
While I was in the code I just added:
- Text to remind on items in 'all games' list would be imported
- Stop duplicates being added (eg running the import twice)
What do you think?
This is the unmodified code:
procedure TfrmMain.ImportMAME32customlist1Click(Sender: TObject);
var
inifile, gamestoadd: TStringList;
dlg: TfrmMAME32Import;
i, gamesadded: Integer;
listname, line: string;
readgame: Boolean;
game: TGame;
begin
if dlgImportMAME32List.Execute then begin
inifile := TStringList.Create;
inifile.LoadFromFile(dlgImportMAME32List.Filename);
dlg := TfrmMAME32Import.Create(self);
for i := 0 to inifile.Count - 1 do begin
if (Pos('[', inifile.Strings[i]) > 0)
and (Pos(']', inifile.Strings[i]) > 0)
and (Pos('FOLDER_SETTINGS', inifile.Strings[i]) = 0)
and (Pos('ROOT_FOLDER', inifile.Strings[i]) = 0) then
dlg.lbxLists.Items.Add(Copy(inifile.Strings[i], 2, Length(inifile.Strings[i]) - 2));
end;
if dlg.ShowModal = mrOK then begin
if dlg.lbxLists.ItemIndex > -1 then begin
gamestoadd := TStringList.Create;
listname := dlg.lbxLists.Items[dlg.lbxLists.ItemIndex];
readgame := False;
// get rom names
for i := 0 to inifile.Count - 1 do begin
line := inifile.Strings[i];
if readgame and (Trim(line) <> '') then gamestoadd.Add(Trim(line));
if Trim(line) = '[' + listname + ']' then readgame := True
else begin
if (Pos('[', inifile.Strings[i]) > 0)
and (Pos(']', inifile.Strings[i]) > 0)
and readgame then readgame := False;
end;
end;
gamesadded := 0;
for i := 0 to gamestoadd.Count - 1 do begin
if FAllGames.GetIndexFromName(gamestoadd.Strings[i]) > -1 then begin
game := FAllGames.GetCopy(FAllGames.GetIndexFromName(gamestoadd.Strings[i]));
FGamelist.Add(game);
Inc(gamesadded);
end;
end;
DisplayGamelist;
gamestoadd.Free;
ShowMessage('Added ' + IntToStr(gamesadded) + ' games to the list.');
end;
end;
dlg.Free;
inifile.Free;
end;
end;
-
for what it's worth, romlister has a new feature in the latest build which can take your existing ROM zip files and create a new xml file based off that list. Then you could do a fake search of roms from there, and output it as a mala list.
IWO, if you have the .zip files of the roms you're trying to make a mala list from, romlister can, in a roundabout way, create a mala list off that.
I can step you through the details if you want.
-
OK, I just saw that if I removed "_" it would work. I wouldn't have guessed that it would explicitly filter that section, as that seems to be completely relevant to me. If I put games in the "Favorites" folder and then open favorites.ini in notepad I see this:
[FOLDER_SETTINGS]
RootFolderIcon golden
SubFolderIcon golden
[ROOT_FOLDER]
centiped
dkong
pacman
simpsons
spyhunt
I don't think you need to add a special note about it. MaLa still prompts you after you pick the file, and asks which section you want to import. So you still have to choose "ROOT_FOLDER" or some other section, if another one is present.
It should filter out "FOLDER_SETTINGS" though (and it is).
NOP, thanks for the suggestion. I was able to get my list imported just fine by changing the name of the section. I just wanted to raise this issue in an attempt to have it become a little more user friendly with regard to importing.
-
OK I have changed the code to allow ROOT_FOLDER. Do you still need comma separated?
Attached is the new version
Have a Try!
-
Cool.
"Need" is a strong word. I was just posting a couple of different ideas for ways to import a list of games that I might find handy on rare occasions (like today). I'm thinking that perhaps others would find it handy (have you ever heard requests like this?). If you think it would be then it would be a nice feature to have. But it's certainly not something I "need". I can always format a mameui style file and import that, even though it seems kinda silly to have to do that.
I know you have bigger fish to fry! ::)
-
Cool.
"Need" is a strong word. I was just posting a couple of different ideas for ways to import a list of games that I might find handy on rare occasions (like today). I'm thinking that perhaps others would find it handy (have you ever heard requests like this?). If you think it would be then it would be a nice feature to have. But it's certainly not something I "need". I can always format a mameui style file and import that, even though it seems kinda silly to have to do that.
I know you have bigger fish to fry! ::)
Yeah I do. :'(
I was frustrated by the lack of progress with MaLa. I had the great need to achive something. :P The MaLa gamelist is nice n easy. ;D
Did you try the new version attached to the last post?
;)
Anyway, I have later today spent some time on mala and have have integrated the new Video Engine. It is running the startup video and the screen saver so far. The old engine is still driving the layouts.
I should have a new MaLa beta tonight (Aus time)
-
No, I haven't downloaded it. Because attachments are STILL broken on the BYOAC forums! Why is it taking so darn long to fix this? :soapbox: I've already imported the list so it's not something I need at this point, though I'd be glad to test it in the next beta.
And speaking of which... a new beta is coming soon? Coooool. :afro: You know I'll be thrilled just to finally get the fix for "use mouse" after standby! ;D
-
You know I'll be thrilled just to finally get the fix for "use mouse" after standby! ;D
Yep, I put a hack fix in there, to not enable the mouse for a few secs after resuming from standby and that worked for me.
-
Very very useful thread. Thank you! :) I now have my mameui favorites list in Mala. Life is good. :)