ModKeen 2 + Fin2Bmp Windows/Linux port: LModKeen 2

ModKeen mods Tiles and Sprites in all episodes of Commander Keen.
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

ModKeen 2 + Fin2Bmp Windows/Linux port: LModKeen 2

Post by Shadow Master »

Warning: this post is outdated. Please refer to the last post on this topic for updated information. The latest LModKeen version is 2 release one.

---- original text ----

1. http://shadowm2006.sitesled.com/src/fin ... nux.tar.gz (5.51 KB)
2. http://shadowm2006.sitesled.com/src/lmodkeen-i.tar.gz (29.45 KB)

I don't think there are many Linux users around here, but anyway I returned to this nice Operating System and decided that I shouldn't depend on WinXP to run ModKeen and Fin2BMP.

THIS IS LMODKEEN MARK I.
The first GNU/Linux port of Andy's ModKeen 2.0.1. (NOTE: this is the vanilla ModKeen 2.0.1, without Keen dreams support, which, at least for me, hampers Keen4-6 importing/exporting under WinXP)
It was easy at the start, but I had to do some ncurses programming and related stuff to make it work without DJGPP's conio.h and libraries. It runs natively in Linux from any text terminal, and has an extra parameter. (Read the included text file for more info on that)
It successfully imports and exports Keen4 data from and to my Keen4 mod, Shikadi4. Apart from that, I don't know. It should work fine anyway.
I made this because DOSBox doesn't like DJGPP's DPMI manager and DJGPP's programs. :(

THIS IS FIN2BMP - LINUX PORT BY SHADOW MASTER.
Sucessfully imports/exports FINALE.CK1 of Shikadi1. No new features, works exactly the same.

If you use these utilities in a non-FAT volume, it's your responisibility not to rename generated files because of UNIX's case sensivity.

General Recommendation: Use these tools on FAT/VFAT (FAT32) volumes.

Thanks go out to Andy Durdin for making publicly avaiable his utilities' source code!
End of Announcement.

BTW, have a happy Keen day. It's 3/13 here, but well. :P
Last edited by Shadow Master on Tue May 08, 2007 4:58 pm, edited 3 times in total.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Wonderful. I'm back in WinXP for now, but this'll help a lot someday.
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin »

Fantastic! I'll have to see how this works on OS X.

I'd like to take the work you've done on this and the older ModKeen32 work and bring them all together so we've got a single cross-platform ModKeen2 codebase.

Edit: Seems to extract data without any problem.
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

Post by Shadow Master »

It exports and imports my Shikadi4 data files from and to Keen4 successfully. The only bug I've noticed so far is the help screen. If you use:

modkeen --help

It displays a help screen but ends the program immediately due to a "segment violation". I'll see if I can move the help screen code from the command line parser to another part so that it doesn't use ncurses and... welll. I'll also try to add some "conditional" compile code so that it compiles with Linux using GCC and Windows with MS VC++ 2005.
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

Post by Shadow Master »

Shadow Master, today, in the PCKF wrote: LModKeen Mark II is coming. New features:
- Uses FIN2BMP code to export from PREVIEW?.CKx, FINALE.CKx, and import from xEXTyyyy.BMP files (were x is the episode number and yyyy is the image number) automatically on Keen 1-3.
- Fixes some ugly bugs in the ncurses initialization section.
- Experimental Keen Dreams support using MultiMania's code.

I have all that written by now. I just have to test it :)
I wrote the ModKeen code that calls copied-and-pasted FIN2BMP code in 25 minutes. It currently exports the CKx files to xFINyyyy.BMP files instead, but I'm gonna replace "FIN" (stands for "finale") with "EXT" (which stands for "external", because these are external images that are not located in EGA*.CKx files).
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Will there be Dangerous Dave and Shadow Knights support?
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

Post by Shadow Master »

This answer might be very different to the one I gave you in the PCKF.
Do you know why it's called "Modkeen"???

If you really want support for those, write it yourself. That's what open-source programs are for.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

I try, but it never gets anywhere, and LL said she's not going to even look at it anymore.
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

Post by Shadow Master »

Talking of her, where the hell is her? I'm still waiting for some tasty patches for SHIKADI1.

Ah, new release:

LModKeen mark II (beta 1) is out!
Download the sources:
http://shadowm2006.sitesled.com/src/lmo ... src.tar.gz (GNU/Linux only; if you get it to work on other platforms, notify me here!)

Read its online readme file (http://shadowm2006.sitesled.com/lmk2-readme.htm) (which is also included with the source code package) to get the news (use the online Readme link if you don't want to download those 0.1 MB of source code ;)

It compiles and the help system no longer crashes (woohoo!). Unfortunately, I haven't had enough time to test it in action.

However, its source code might be of interest for some of you since it has two new features: FIN2BMP integration and KDreams support (EXPERIMENTAL AND HIGHLY UNSTABLE!!! MAKE BACKUPS!).

I could compile it, but I'm distributing the source code without binaries. Since the makefile is automatically generated by Eclipse CDT, I'm not sure if it can be "make"-ed without the whole Development Environment. Try it if you have time. :)

This week I'm gonna work on making the KDreams support work correctly, and if Sarah gives me the code for Shadow Knights and Dangerous Dave compatability, I'll also start working on LModKeen III (which will have a text-based graphical user interface too).

And remember, it is the first BETA of LModKeen II!

BTW, yesterday, I just noticed this port was created around the date of ModKeen's 3rd or 4th anniversary. What a coincidence. Believe me, coincidence.

EDIT: fixed a typo and bad link URL to readme.
EDIT2: please read the Readme, there are some links to UNP, UNLZEXE and CKPatch that I'm not 100% sure that they are still valid (or that they'll be avaiable in the future).
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

She's out and about, she may not post here anymore; and I don't think she has anything to actually *do* to post here anyway. I guess you can consider her official on hiatus. What patches did you ask for? Are they secret?
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

Post by Shadow Master »

LModKeen mark II (beta 2) is out!
Download the sources:
http://shadowm2006.sitesled.com/src/lmo ... src.tar.gz (GNU/Linux only; if you get it to work on other platforms, notify me here!)

Read its online readme file (http://shadowm2006.sitesled.com/lmodkeen2-readme.htm) (which is also included with the source code package) to get the news (use the online Readme link if you don't want to download those 0.1 MB of source code ;)

It compiles, as the beta1 did, and doesn't crash, except when you try to use the experimental Keen Dreams support. I tested Keen1 export/import last night... it works fine, and the FIN2BMP (and BMP2FIN) operation is successful, without any errors.

You can consider it stable for Keen 1 importing/exporting. Other Keens (2, 3, 4, 5, 6) have to be tested, and Keen Dreams support crashes LModKeen. Additionally, I included build instructions for this beta (you don't need Eclipse at all, just the GNU C compiler and some standard C library headers).

If you're going to test Keen 2-6 or Kdreams with this beta, make backups first.

Some modifications to the code:

- get_exe_image_size() has been extended so that you can provide a known DOS exe header length if you're not gonna use Keen1-6 exes (for example, KDreams.exe, which has a 0x1C00 bytes long header, instead of the standard 0x2E00 for other Keens; if I wrote wrong numbers here, don't worry, in the code I made sure to write the right ones). This way we can provide support for Dangerous Dave, Bio Menace, or any other games that use Keen algorithms and file formats (in the future).

For the next week I *should* have tested it with every Keen and improve the Keen Dreams exporting code. I'm also planning to write a GUI (front-end, that is, a separate program that uses lmodkeen) using Qt/C++. I read somewhere that Qt is perfectly portable to Win32 btw.

In the readme, there are some links to UNP, UNLZEXE and CKPatch that don't work. Could you give me new links?
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

Post by Shadow Master »

I'm starting to think that I'm speaking only for myself. Ah, well :)

LModKeen mark II beta 3 is out!

The sources are here: http://shadowm2006.sitesled.com/src/lmo ... src.tar.gz
Online README file here: http://shadowm2006.sitesled.com/lmodkeen2-readme.htm

There are really big changes on this version. From the embedded changelog:

Code: Select all

2007-04-01: LModKeen II beta3:
      - Lots of code optimizations.
      - Removed unused code.
      - Added console output coloring.
      - Fixed quit() not displaying messages properly under ncurses mode.
      - Fixed keen456_import_begin() and keen456_export_begin() bugs that caused improper detection
        of EXE information and segment violations.
      - UNIX switches style compatibility (i.e. --episode=3 is the same as -episode=3).
      - Extended --episode parameter to support Dangerous Dave 2 and Bio Menace.
      - Added --debug parameter to add "debug mode" functionality.
      - Renamed keen123_export_finaleimg() to keen123_export_external(). Added progress info to procedure.
      - Renamed keen123_import_finaleimg() to keen123_import_external(). Added progress info to procedure.
      - Marked as stable with Keen 1-3, Keen 4-6 (not Dreams) for importing/exporting data.
In fact, Keen1-3 and Keen4-6 data importing/exporting have been successfully tested (including the new FIN2BMP integration) and they're now stable. The only unstable feature is Keen Dreams data manipulation. The not-yet-written stuff includes Dangerous Dave 2, Shadow Knights and Bio Menace support, although I'm waiting for Levellass instructions for the former two.

Have fun, and if you happen to have MINGW installed on your Windows, try to compile the stuff using the included makefile (./Release/makefile) and tell me if it works, and how to make it work. ;)

BTW, there's a precompiled GNU/Linux x86 binary in the root directory of the archive. It seems to work without problems under Fedora Core 4, although it was compiled under Mandriva Linux 2007.
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin »

Even if no-one else is, I am excited by your progress here. If I find time, I'd like to port the updated version back to Win32 and OS X at least, perhaps also DOS (with djgpp).
User avatar
grafix
Posts: 199
Joined: Fri Oct 29, 2004 8:38 am

Post by grafix »

After removing the stuff specific to your machine from the provided makefiles (like the reference to "/home/shadowm/"), I compiled ModKeen on my Mac and successfully extracted everything from Keen 1. Nice job, Shadow Master! :)
User avatar
Shadow Master
Posts: 129
Joined: Fri Oct 20, 2006 3:14 pm
Location: Santiago, Chile
Contact:

Post by Shadow Master »

I thought Eclipse wrote $HOME or ~ instead of /home/shadowm there.
Thanks for the info, grafix. With that, I can make sure the beta4 makefile will work with any Linux installation (and perhaps Mingw if I work on porting some code for it).
EDIT:
It was surely your lucky day, grafix. I always have problems with filenames, specially in FAT32 partitions. I think I'll write some code that helps us to "normalize" the case on them.

keen1.exe -> KEEN1.EXE
egagraph.ck1 -> EGAGRAPH.CK1
etc.

I'll probably add the --fixnames parameter for that. :P
Post Reply