Mod Archive Forums

Music Production => MilkyTracker => Tracking => MilkyTracker Community => Topic started by: shai on August 28, 2008, 13:09:50

Title: MilkyTracker ported to OS/2
Post by: shai on August 28, 2008, 13:09:50
Hi,
I've ported MilkyTracker to OS/2 Warp (includes eComStation).
Compiling the SVN trunk version took me some time because I had to set up a whole new build environment and update a lot of stuff (you know, autotools have to be installed properly...). But otherwise the posix/SDL version compiled more or less out of the box.
However, I noticed the following issues with the build system:

There were no other adaptions necessary. I know I've told something different in the IRC channel. Usually one has to add SDLCALL macros for SDL callbacks and you have to take care of atexit(SDL_Quit)-like statements because the SDL library calling convention (OS/2 syscall) differs from the C calling convention. Nevertheless it compiled and worked fine without it which even surprised me. Only explanation: GCC on OS/2 uses the syscall calling convention, too. I usually work with Open Watcom C on OS/2 and you have to care about the calling conventions there. So the change (you already committed it to the trunk) wasn't really necessary. It doesn't hurt though - and it might become necessary on other platforms/compiler/libsdl combinations.
Also, the crash-on-startup issue I've talked about in IRC is gone in the trunk version. Nice. Dialogue windows are movable, too... :)

The following OS/2-specific issues remain:
I could of course implement native OS/2 filebrowser and message box support, too. But as I would almost consider this a misfeature I'd like to request a new MilkyTracker feature: Add an option which lets the user choose whether native dialogues should be used at all. If not fallback to the dialogues enabled in the SDL version. The "internal browser" option would be independent. If activated the "internal" browser would be used always.

Hope, I get the time to actually use the program one day :)

ps: screenshots coming soon

cheers,
Robin
Title: Re: MilkyTracker ported to OS/2
Post by: Deltafire on August 29, 2008, 00:09:01
Hi shai,

Congratulations on the port.  I'll try to address some of the issues you experienced:

"it requires SDL- and ALSA-check m4 macros (sdl.m4 and alsa.m4)"
These are included in the source distribution archive, they are purposel omitted from the svn repository (anything that is autogenerated isn't stored on the svn).

"use macros to check for libzzip and remove it from the source archive (you probably know that as you already hardcoded in the automake files to link the binary against libzzip and don't use the internal version anymore)."
Again, this is on the svn development trunk only - it will be altered when the next version is released. Pailes is reluctant to remove it from the source archive at present due to various reasons.  It's worth pointing out that the automake build system is currently only used for the SDL version, OSX and Windows go there own way.

"you should really check whether SDL supports OpenGL in configure.in"
Development version only.. The opengl support was just a test, and will probably be dropped altogether as it offered no advantages.

"Usually one has to add SDLCALL macros for SDL callbacks and you have to take care of atexit(SDL_Quit)-like statements because the SDL library calling convention (OS/2 syscall) differs from the C calling convention. Nevertheless it compiled and worked fine without it which even surprised me."
Are you sure? I had already made those changes to the trunk before you downloaded it.

Regarding the mouse pointer flicker, blame SDL - it must not be using the hardware pointer, you'd be better patching SDL to fix this rather than writing a workaround specific to Milkytracker.

Posix or native path handling? You decide! Native might be better.

I prefer Milkytracker's internal filebrowser/message box rather than the OS provided ones. Makes it feel more integrated. :)
Title: Re: MilkyTracker ported to OS/2
Post by: shai on August 29, 2008, 01:46:55
Hi shai,

Congratulations on the port.  I'll try to address some of the issues you experienced:

"it requires SDL- and ALSA-check m4 macros (sdl.m4 and alsa.m4)"
These are included in the source distribution archive, they are purposel omitted from the svn repository (anything that is autogenerated isn't stored on the svn).
Couldn't find them in the latest source archive (v.0.90.80). They should be there, somewhere, expanded to shell script in 'configure' however. Also, I think they aren't generated (at least they state copyright/authorship at their beginnings).
Quote
"use macros to check for libzzip and remove it from the source archive (you probably know that as you already hardcoded in the automake files to link the binary against libzzip and don't use the internal version anymore)."
Again, this is on the svn development trunk only - it will be altered when the next version is released. Pailes is reluctant to remove it from the source archive at present due to various reasons.  It's worth pointing out that the automake build system is currently only used for the SDL version, OSX and Windows go there own way.
Yes, sorry. I know that most of the stuff I mentioned is trunk-only and that you already know about it.
Quote
"you should really check whether SDL supports OpenGL in configure.in"
Development version only.. The opengl support was just a test, and will probably be dropped altogether as it offered no advantages.

"Usually one has to add SDLCALL macros for SDL callbacks and you have to take care of atexit(SDL_Quit)-like statements because the SDL library calling convention (OS/2 syscall) differs from the C calling convention. Nevertheless it compiled and worked fine without it which even surprised me."
Are you sure? I had already made those changes to the trunk before you downloaded it.
Yes, the first version I checked out (and which was still up to date when I built it) didn't have the changes - I recall that I looked it up. It was introduced with a later changeset.
Quote
Regarding the mouse pointer flicker, blame SDL - it must not be using the hardware pointer, you'd be better patching SDL to fix this rather than writing a workaround specific to Milkytracker.
You are right.
Quote
Posix or native path handling? You decide! Native might be better.
The performance difference should be insignificant (although it is one layer above the bare OS/2 API, yes...). It's just that you have a lot of "#ifdef __OS2__"s in your otherwise posix-only code. I would prefer it because using more platform-independent APIs means less code to maintain and less for me to write in the first place!
Quote
I prefer Milkytracker's internal filebrowser/message box rather than the OS provided ones. Makes it feel more integrated. :)
I agree and I probably won't spend an effort until I know that I want to stay with MilkyTracker.

cheers,
Robin
Title: Re: MilkyTracker ported to OS/2
Post by: pailes on August 30, 2008, 11:39:24
I could of course implement native OS/2 filebrowser and message box support, too. But as I would almost consider this a misfeature I'd like to request a new MilkyTracker feature: Add an option which lets the user choose whether native dialogues should be used at all. If not fallback to the dialogues enabled in the SDL version. The "internal browser" option would be independent. If activated the "internal" browser would be used always.

There are actually three reasons for the native dialogs:

1. Native dialogs usually offer more functionality than the internal ones (e.g. on Windows you can create new folders, move files around etc.).

2. Native dialogs show non-ASCII characters correctly.

3. The MilkyTracker core hasn't got modal "event loops". I know there are internal dialogs which appear to be modal, but they aren't. Basically this means when you invoke a file selection dialog, the program should block until the file dialog is discarded. If you invoke an internal modal dialog, the program flow continues normally without blocking. The SDL port provides an additional workaround based on a modal event loop which uses the internal dialogs to create "real" modal dialogs.

So currently it's not possible to choose between native/internal dialogs because only SDL has got those internal modal dialogs.
Title: Re: MilkyTracker ported to OS/2
Post by: shai on September 08, 2008, 10:52:38
Hi,
the drive/directory sorting works now. Don't ask me why. Maybe it was just that I didn't rebuild enough files because the autogenerated Makefiles don't include all dependencies. After initial problems - a DLL hook caused problems and you need the "swap" option - MilkyTracker works fine on my Medion Akoya (rebranded MSI Wind), too. Have a look at the attachments. MilkyTracker (trunk version) running on eComStation (OS/2 Warp 4.52) on a Medion Akoya Mini :).

cheers,
Robin

ps: This is a Mac-OS-inspired theme only. OS/2 has nothing to do with Mac OS X.
Title: Re: MilkyTracker ported to OS/2
Post by: pailes on September 08, 2008, 11:12:50
Pretty cool :D. Send me the changes and I will integrate them.
Title: Re: MilkyTracker ported to OS/2
Post by: shai on September 08, 2008, 11:31:54
ok,
I could simply commit them, too. But I don't have the permissions with anonymous access, have I? I'll simply send you the two files, should be sufficient as you're still working on the build system...
Title: Re: MilkyTracker ported to OS/2
Post by: pailes on September 09, 2008, 09:26:45
I think I will not merge the POSIX file path stuff with yours, I'll simply create an OS2 directory and put it in there.