Need some help with crossplatform file managment and screen

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
Anes
Posts: 702
Joined: Tue Dec 21, 2004 8:35 pm
Location: Mendoza, Argentina

Need some help with crossplatform file managment and screen

Post by Anes »

Well, this is not an emu question (altough it is relationated).

Im using allegro 5 in linux and im not too savy to linux.

Since im doing (trying to do) a crossplatform emu i need the win32 api "FindFirstFile()" / "FileNextFile()".
1- Im doing the GUI now for my emu, but Not SDL neither Allegro 5 have this facilities. It's all ok these libs don't need to have a feature like that.I know there is boost lib. Im really havent tried it yet.
2 - I need linux (in my case Ubuntu with GTK3) don't let the maching go and turn off the screen and neither let it sleep.

How can be done for this 2 things?

Help and posiblly code is appreciated.
ANes
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Need some help with crossplatform file managment and screen

Post by tepples »

POSIX (the common API implemented by Linux, *BSD, and proprietary UNIX) has opendir() and friends.

Allegro 5 itself has al_open_directory() and friends. This presumably calls opendir() on POSIX or FindFirstFile() on Windows.,
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Need some help with crossplatform file managment and screen

Post by rainwarrior »

I don't know a specific answer to your question about preventing sleep / screen-off, but when I've had similar questions in the past I often look to SDL 2's implementation, because it tends to cover stuff like this for many platforms.

e.g. Searching its github repository for "suspend_screensaver" leads to a few things that might be relevant:

https://github.com/libsdl-org/SDL/searc ... creensaver
User avatar
Anes
Posts: 702
Joined: Tue Dec 21, 2004 8:35 pm
Location: Mendoza, Argentina

Re: Need some help with crossplatform file managment and screen

Post by Anes »

Ok thanks guys.

The thing is that i need to have something that "list" the directory. All this becouse i want to make a GUI for my emu. And saying that we have a "/roms" path i need to list that path so i can have a "rom selector" for the user.
ANes
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Need some help with crossplatform file managment and screen

Post by Dwedit »

I think users might prefer the native Win32 file dialog for picking files.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
Anes
Posts: 702
Joined: Tue Dec 21, 2004 8:35 pm
Location: Mendoza, Argentina

Re: Need some help with crossplatform file managment and screen

Post by Anes »

Dwedit wrote: Thu Mar 31, 2022 4:20 pm I think users might prefer the native Win32 file dialog for picking files.
Well thats the fact, so Allegro 5 has an option (which i use) of showing the linux/windows openfiledialog().
But i would like to make a "rom list".
ANes
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Need some help with crossplatform file managment and screen

Post by tepples »

Point of internationalization (i18n):

In what font would you be displaying the ROM list? For ROMs whose title contains Chinese characters (e.g. 匹诺曹的复苏), would this font include all commonly used Chinese characters? Or would they display as boxes (e.g. ������) if the user doesn't transliterate (e.g. Pinuocao de fusu) or translate (e.g. The Recovery of Pinocchio) the title?
User avatar
Anes
Posts: 702
Joined: Tue Dec 21, 2004 8:35 pm
Location: Mendoza, Argentina

Re: Need some help with crossplatform file managment and screen

Post by Anes »

tepples wrote: Fri Apr 01, 2022 3:53 pm Point of internationalization (i18n):

In what font would you be displaying the ROM list? For ROMs whose title contains Chinese characters (e.g. 匹诺曹的复苏), would this font include all commonly used Chinese characters? Or would they display as boxes (e.g. ������) if the user doesn't transliterate (e.g. Pinuocao de fusu) or translate (e.g. The Recovery of Pinocchio) the title?
Very, very good question. I think i would have to use unicode what is utf16?? i don't know.
ANes
Post Reply