Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux support #25

Open
Demon0no opened this issue Jan 28, 2019 · 6 comments
Open

Linux support #25

Demon0no opened this issue Jan 28, 2019 · 6 comments

Comments

@Demon0no
Copy link

The readme makes it look like it's just dropping some binaries into the folder to make this work under linux, but says nothing about how to actually run the script on linux?
I compiled the latest version of snes9x-rr for linux to give this a try, but I don't see a way to load lua files anywhere... Has anyone actually ever gotten this to run on a non-windows system?

@mcclure
Copy link
Owner

mcclure commented Jan 30, 2019

I've never run it on a non-windows system. There's someone who has a mac version nearly working but they can't get IUP working there.

SNES9X-RR should have a "load lua" script in the file menu. If it doesn't it either isn't SNES9X-RR or is some very different of SNES9X-RR than the one I use. Here is the one I built on Windows: https://github.com/mcclure/snes9x-coop Which I do not know if that will compile out of the box on Linux.

Compiling SNES9X for Linux is not enough because you will also need Linux versions of Luasocket and IUP [a UI library]. You have to build both of these as .so files and put them in the directory where the .dll files currently are. These are very standard lua libraries so this part should not be hard if you look into it.

I apologize for the difficulty.

@mcclure
Copy link
Owner

mcclure commented Jan 30, 2019

That reminds me— have you seen the main project webpage? It won't help you in this case, but the information on it is much more helpful than the README of this repo.

@Demon0no
Copy link
Author

I've built the libraries and everything, that's not the problem. The problem is, that the win32 target doesn't compile on linux, the unix (commandline version) and gtk targets from that repo both compile and run fine but they don't seem to have any option to load/run lua files.

@mcclure
Copy link
Owner

mcclure commented Feb 1, 2019

Okay. I think I see the problem.

My snes9x-rr fork has this Lua console window
https://github.com/mcclure/snes9x-coop/blob/master/win32/luaconsole.cpp
triggered by this menu item
https://github.com/mcclure/snes9x-coop/blob/master/win32/rsrc/snes9x.rc#L1017

The GTK code
https://github.com/mcclure/snes9x-coop/blob/master/gtk/src/snes9x.ui#L1044
Just… … … doesn't have this. Nobody ever added it.
I think what you would want to do is add a new menu item to snes9x.ui,
and you would want to call RunLuaScriptFile, as on this line
https://github.com/mcclure/snes9x-coop/blob/master/win32/luaconsole.cpp#L662
You would not have to create the big complicated dialog box that the windows version has. For snes9x-coop what we're really interested in is running one script, coop.lua, so you could hardcode that path, and you do not actually need to show the script printout. coop.lua opens its own dialog boxes (using IUP) and it displays text on screen when it needs to tell you something.

I think that this would not be very difficult. But it would be hard for me to do because I do not have a Linux machine to test on.
Since you have a working GTK test machine set up— Do you have C development experience? Do you think you could make a patch if I walked you through it?

@Demon0no
Copy link
Author

Demon0no commented Feb 1, 2019

I have C experience, so no need to walk me through it. The lines you posted should be enough for me to add this feature. Not sure when I'll have time for it, but I'll probably do it at the weekend.

@mcclure
Copy link
Owner

mcclure commented Feb 1, 2019

Cool, curious to know how that works out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants