Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to index page
Thread view  Board view
Zyzzle

26.03.2014, 22:31
 

Compilation Woes: A study in frustration. (Emulation)

I'm trying my utmost to compile the MS-DOS version of Marat Fayzullin's ColEm 2.6 under DGJPP using pure DOS 6.22:

http://fms.komkon.org/ColEm/
http://fms.komkon.org/ColEm/ColEm26-Source.zip

since I can't run the precompiled binary included in the distribution, due to its using the DOS/32A extender and the binary being compressed by DOS32A's SC.EXE executable compression program.

So, I wanted to compile an unstubbed, *uncompressed* binary using GCC 4.73 under DJGPP. The source is all portable C. Then, it could be stubbed with CWSDPMI or even DOS 4GW or PMODE/W. Anything but DOS32A!

I can't even get MAKE to process the makefile, it errors out with an unrecognized redundency in the $OBJECTS part. I edited the makefile under the /colem/msdos directory, commented out the part where SC.EXE was invoked to compress the compiled DOS 32a COLEM.exe.

I'm using GCC 4.73, bnu 2.24, make 3.79, and DJGPP 2.03 of course. I believe it also uses the Allergo library, which I've downloaded and compiled as well.

I wrote the author, and he could not provide any help, and couldn't remember which version of GCC the DOS port was originally compiled under, and had moved on from DOS in 2010.

The author says in the docs that he switched from DOS 4GW to DOS32a in Colem v. 2.20.

Can anyone provide some gracious help in getting a DOS binary of ColEm compiled without compression and using any DOS extender other than DOS 32A?

Many thanks, I've been pulling my hair out trying to get this to compile!

RayeR

Homepage

CZ,
27.03.2014, 03:59
(edited by RayeR, 27.03.2014, 04:15)

@ Zyzzle
 

Compilation Woes: A study in frustration.

Couldn't it be unstubbed and decompressed? I don't know this case but upx and cwsdstub can be reversed...
Quick look: I can't see makefiles for djgpp, just for watcom

---
DOS gives me freedom to unlimited HW access.

Zyzzle

27.03.2014, 04:48

@ RayeR
 

Compilation Woes: A study in frustration.

> Couldn't it be unstubbed and decompressed? I don't know this case but upx
> and cwsdstub can be reversed...
> Quick look: I can't see makefiles for djgpp, just for watcom

I can get Colem.exe unstubbed, but it's not compressed with UPX, but with DOS32/A's SC.exe compression program, which doesn't have a decompressor.

Should I try Open Watcom instead of DJGPP to compile it?

Zyzzle

27.03.2014, 06:00

@ Zyzzle
 

Compilation Woes: A study in frustration.

Alright, I tried Open Watcom and I can get further, but using the supplied makefile under the directory /COLEM/MSDOS, when I execute WMAKE, I get

"The command list is not part of any target" error.

I'm stumped.

Rugxulo

Homepage

Usono,
27.03.2014, 15:47

@ Zyzzle
 

Compilation Woes: A study in frustration.

> I'm trying my utmost to compile the MS-DOS version of Marat Fayzullin's
> ColEm 2.6 under DGJPP using pure DOS 6.22:
>
> http://fms.komkon.org/ColEm/
> http://fms.komkon.org/ColEm/ColEm26-Source.zip

If you're impatient, see the far bottom of this post. I did get "something" to compile, but I have no idea if it really works. (I don't have a Colecovision machine, never tried any emulators, and I'm not sure of the legality in U.S. of getting the .ROMs without permission.)

> since I can't run the precompiled binary included in the distribution, due
> to its using the DOS/32A extender and the binary being compressed by
> DOS32A's SC.EXE executable compression program.
>
> So, I wanted to compile an unstubbed, *uncompressed* binary using GCC 4.73
> under DJGPP. The source is all portable C. Then, it could be stubbed with
> CWSDPMI or even DOS 4GW or PMODE/W. Anything but DOS32A!

Why can't you use the pre-existing binary? I blindly (but maybe incorrectly) assume the DOS port was tested to work correctly for whoever compiled it officially back in the day.

Maybe the real problem is your machine setup? Have you tried under DOSBox, DOSEMU, WinXP, etc.? Have you tried fiddling with your memory managers (i.e. no EMM386)? Have you tried other DOS clones (FreeDOS, EDR-DOS) or even other physical computers (old 486)? Try to isolate the problem.

> I can't even get MAKE to process the makefile, it errors out with an
> unrecognized redundency in the $OBJECTS part. I edited the makefile under
> the /colem/msdos directory, commented out the part where SC.EXE was invoked
> to compress the compiled DOS 32a COLEM.exe.
>
> I'm using GCC 4.73, bnu 2.24, make 3.79, and DJGPP 2.03 of course. I
> believe it also uses the Allergo library, which I've downloaded and
> compiled as well.

It's not really portable in the sense that any compiler or OS or Make is automatically supported. In fact, as has already been mentioned here, it's not able to compile with DJGPP for DOS (by default), only OpenWatcom. I don't see any references to Allegro at all, and it actually says "NMAKE" re: EMULib for MSDOS. I'm not sure if that means OpenWatcom's WMake in some compatibility mode or not. Even if target DOS is supported, that doesn't mean it automatically can be built under any host OS.

> I wrote the author, and he could not provide any help, and couldn't
> remember which version of GCC the DOS port was originally compiled under,
> and had moved on from DOS in 2010.

You're not wrong to ask DOS users here. But it seems more likely to get help from one of several others places. Presumably somebody would have to be experienced with either OpenWatcom and/or EMULib itself. So if the original author (who ported it back in the day) can't remember or be bothered to try again (and it can't be that hard for him, but I guess he's busy), you'll have a much much harder time with it.

Though he does have a Google Group about all his emulators, which is still very active, so you may have better luck asking all others there:

https://groups.google.com/forum/#!forum/EMUL8

Otherwise I dunno. Besides us here, you could ask on one of the FreeDOS mailing lists. Or the OpenWatcom newsgroups. Or new://comp.os.msdos.programmer or similar. I'm just saying, keep your options open.

> The author says in the docs that he switched from DOS 4GW to DOS32a in
> Colem v. 2.20.

Of course in this case (also) using UPX would've been safer since you can unpack.

> Can anyone provide some gracious help in getting a DOS binary of ColEm
> compiled without compression and using any DOS extender other than DOS
> 32A?

Have you tried other Coleco emulators? Also, Wikipedia mentions two commercial ones (Windows) from way back (1997, 1998). Also, do you not have a real Colecovision machine? Can't you get one on eBay? Again, I'm just listing some more possibilities here.

Oh, I almost forgot, you can try to search GameFAQs to see if whatever game you want to play was ported to another machine you have (or is better supported). Though in that case, it's probably easier to use a pre-existing (working, supported) port of ColEm like Windows or Android.

But "Just use ...", I hate advice like that! :-P Still, anything is better than nothing.

> Many thanks, I've been pulling my hair out trying to get this to compile!
>
> ............
>
> Alright, I tried Open Watcom and I can get further, but using the supplied
> makefile under the directory /COLEM/MSDOS, when I execute WMAKE, I get
>
> "The command list is not part of any target" error.
>
> I'm stumped.

Maybe he used NMAKE and not WMAKE. Maybe he had a quirky layout, but I don't see any obvious hints on which subdir to sit in when running wmake -f whatever. The few things I tried also didn't work. Maybe the sources are broken and don't compile out of the box. It may be a mistake to assume it works at all if he hasn't maintained it lately.

Okay, so here's what I did. I grepped for "main(" to find the main source file. I compiled and linked that and checked the linker errors. Then I'd grep for such a function to find what file it was in. Then I compiled and linked that. Rinse and repeat, and eventually it builds. Granted, you have to be somewhat careful, just because it compiles and links doesn't mean it works. And obviously supporting multiple OSes means duplicate functions. But anyways, that's what I did.

Here's a quick .BAT, may not work 100%, caveat emptor, but at least it seems to build.


@echo off
echo unix wget http://fms.komkon.org/ColEm/ColEm26-Source.zip
if "%WATCOM%"=="" goto end
md colem
cd colem
unzip -qCjn ..\colem26-source.zip
for %%a in (colem coleco menu msdos sound libmsdos console emulib z80 image tms9918 drv9918 sn76489) do ren %%a.c *.c~
del *.exe >NUL
del *.c >NUL
ren *.c~ *.c
wcl386 -zq -zp4 -5r -otexan -l=dos4g -fe=colem.exe -DBPP16 -DMSDOS -DCOLEM *.c
if exist colem.exe dir colem.exe
REM COLEM    EXE       219,362  03-27-14  9:28a colem.exe
:end

Zyzzle

28.03.2014, 03:56

@ Rugxulo
 

Compilation Woes: A study in frustration.

(I don't have a
> Colecovision machine, never tried any emulators, and I'm not sure of the
> legality in U.S. of getting the .ROMs without permission.)

I actually still have my old machine, but it no longer works reliably, hence the outreach for an emulator of sorts...

> Though he does have a Google Group about all his emulators, which is still
> very active, so you may have better luck asking all others there:
>
> https://groups.google.com/forum/#!forum/EMUL8

I discovered that newsgroup myself, but it seems swamped with Android and / or other cell phone emulator talk.


> Maybe he used NMAKE and not WMAKE. Maybe he had a quirky layout, but I
> don't see any obvious hints on which subdir to sit in when running wmake -f
> whatever. The few things I tried also didn't work. Maybe the sources are
> broken and don't compile out of the box. It may be a mistake to assume it
> works at all if he hasn't maintained it lately.

Actually, the possibility that NMAKE was needed to compile the makefile was not lost on me, but I couldn't locate a DOS version of NMAKE, only a 32-bit Windows version of NMAKE v. 1.5. So I was stuck with wmake from Open Watcom. I did notice it had an -ms switch which purported to make it compabible with NMAKE, but it didn't solve the problem.


>
> @echo off
> echo unix wget http://fms.komkon.org/ColEm/ColEm26-Source.zip
> if "%WATCOM%"=="" goto end
> md colem
> cd colem
> unzip -qCjn ..\colem26-source.zip
> for %%a in (colem coleco menu msdos sound libmsdos console emulib z80 image
> tms9918 drv9918 sn76489) do ren %%a.c *.c~
> del *.exe >NUL
> del *.c >NUL
> ren *.c~ *.c
> wcl386 -zq -zp4 -5r -otexan -l=dos4g -fe=colem.exe -DBPP16 -DMSDOS -DCOLEM
> *.c
> if exist colem.exe dir colem.exe
> REM COLEM    EXE       219,362  03-27-14  9:28a colem.exe
> :end
>


cro
Thanks for that ingenious batch file. I managed to compile it, but I had to set #define LSB_FIRST 0x1 in the file COLECO.h as your version produced a little-endian one (did you cross-compile on a Linux machine?). After a recompile with your batch file, it loaded with DOS4G but issued the same behavior as the precompiled DOS32A COLEM.EXE binary included in author's original package.

I did some more digging and found that a bug / incompability was introduced somewhere between v. 2.2 and 2.3 which prevents the ROMs from loading. Versions 2.2 and below work great for me in plain DOS. If I could find the source to version 2.3, I might be able to troubleshoot the problem, but it seems to have vanished.

So, I came round full circle and realized it is a newly-introduced bug and NOT any system incompatibility and / or DOS extender problem! What progress.

Thanks for your hints, help and pointers, it provided the impetus to troubleshoot this.

In the meantime, I've found a Windoze emulator called BlueMSX which will emulate the Coleco machine.

Looks like if I want to run it in good ol' DOS, I'm stuck with ColEm 2.2 instead of the 2.6 version.

Rugxulo

Homepage

Usono,
30.05.2014, 08:28

@ Zyzzle
 

Compilation Woes: A study in frustration.

> > Though he does have a Google Group about all his emulators, which is
> still
> > very active, so you may have better luck asking all others there:
> >
> > https://groups.google.com/forum/#!forum/EMUL8
>
> I discovered that newsgroup myself, but it seems swamped with Android and /
> or other cell phone emulator talk.

(May 21) ColEm 2.9 for Windows and Linux

Unfortunately ... "I am no longer supporting MSDOS, Symbian, Maemo, and Meego ports, due to the demise of the respective platforms. Older ColEm versions for these platforms are still available from the web site though."

But I don't even see a 2.6 DOS binary .ZIP anymore! (And it's probably moot to try to say, "But FreeDOS 1.1 was released in 2012". If the guy ain't already sympathetic, it's no use.) Very unlikely that (re)porting the [Linux] "portable source code" is worth anyone's time. You could try mentioning it on the Google Group, but people these days just don't care if it's not one of the popular mainstream OSes.

His "Address Book" says Marcel de Kogel was the original author of the DOS port. However, I'm assuming that was long, long ago. (A very superficial search shows releases as far back as 1996, maybe older, indeed using DJGPP + Allegro.)

> I did some more digging and found that a bug / incompability was introduced
> somewhere between v. 2.2 and 2.3 which prevents the ROMs from loading.
> Versions 2.2 and below work great for me in plain DOS. If I could find the
> source to version 2.3, I might be able to troubleshoot the problem, but it
> seems to have vanished.

Dunno, I see some files at http://patpend.net/ftp/emulators/coleco/ that may prove interesting, for comparison, if you're bored:

ColEm22-Windows-src.zip 134K
ColEm24-Windows-src.zip 235K

Zyzzle

12.03.2015, 23:27

@ Rugxulo
 

Compilation Woes: A study in frustration.

> Dunno, I see some files at http://patpend.net/ftp/emulators/coleco/ that
> may prove interesting, for comparison, if you're bored:
>
> ColEm22-Windows-src.zip
> 134K
> ColEm24-Windows-src.zip
> 235K

Almost one year later, I decided to give it another try. This time, I succeeded. The secret I found by trial and error was to included these options in the makefile:

wcl386 -zq -zp4 -5r -otexan -l=dos4g -fe=colem.exe -DLSB_FIRST -DBPP8 -DMSDOS -DCOLEM *.c

The BPP8 limits graphics output to only 8 bits, which is all that is necessary for emulating a Colecovision console. That was the key for me.

I compiled v. 2.6 which is the last available version which has the DOS source available.

Then, I noticed that v. 3.3 is the current release, which has Windows source only. It seemed possible to combine the fixes and enhancements of v 3.3 (added cheat search engine!) with the DOS parts of the C source of v. 2.6 (ie, MSDOS.C), so I tried and it worked!

The only trouble is Colem MS-DOS only supports Soundblaster family for sound (no modern PCI cards), but otherwise it runs perfectly, fast, and now I don't need to load Windoze to get my Colecovision fix...

Furthermore, I've got the UPX'd version of 3.3 down to only 70 kb compressed with the StubX (d3stub.exe).

So, if anyone's interested (probably no one?), if you want a version of the latest Colem 3.3 ported to DOS, let me know!

Rugxulo

Homepage

Usono,
13.03.2015, 05:32

@ Zyzzle
 

Compilation Woes: A study in frustration.

> So, if anyone's interested (probably no one?), if you want a version of the
> latest Colem 3.3 ported to DOS, let me know!

I don't know why Marat deleted the older DOS version. I also don't know why he wouldn't host this newer patched version for you.

http://fms.komkon.org/ColEm/

"If you find a bug, have an idea on the further ColEm improvement, or would like to port ColEm to a new platform, please, let me know."

Unless he's just being disingenuous here, he seems open to patches.

The main problem (obviously) is licensing (both system ROM and games themselves), not to mention the emulator itself ("not commercial", i.e. not "open source" nor "free software" despite his confusing use of "open" and "free" to describe it). I guess he's really afraid of people selling it. Which is odd because (AFAIK) he doesn't own anything. I have no idea if he's a licensee or not (or whether that's even needed in his country or whatever). I'm not a lawyer, but it's a pretty big worry, sadly.

Anyways, a naive web search shows that one company is now producing "ColecoVision Flashback" hardware (plug and play for tv) with 60 games.

http://www.atgames.us/ColecoVision-Flashback-CV450.htm

DOS386

30.03.2014, 14:55

@ Zyzzle
 

Compilation Woes: A study in frustration | evil DOS32A

> since I can't run the precompiled binary included in the distribution, due
> to its using the DOS/32A extender and the binary being compressed by
> DOS32A's SC.EXE executable compression program

what's the problem? doesn't it run?

> So, I wanted to compile an unstubbed, *uncompressed* binary using GCC 4.73
> under DJGPP. The source is all portable C. Then, it could be stubbed with
> CWSDPMI or even DOS 4GW or PMODE/W

Probably NOT with DOG/4SW or PMODE/W ...

> Anything but DOS32A!

What's the problem with DOS32A? (OK, it doesn't like external DPMI hosts, but this doesn't make it a priori unusable)

> author says in the docs that he switched from DOS 4GW to DOS32a in Colem v. 2.20.

This is good, isn't it?

> Can anyone provide some gracious help in getting a DOS binary of ColEm
> compiled without compression and using any DOS extender other than DOS32A

Options (other than compiling):
- find a decompressor (I'm not aware of any)
- decompress manually (it's open source)
- stub in another version of DOS32A (7.xx instead of 9.xx)
- get the DOS32A working, as there is no reason why it wouldn't work

---
This is a LOGITECH mouse driver, but some software expect here
the following string:*** This is Copyright 1983 Microsoft ***

Back to index page
Thread view  Board view
22049 Postings in 2034 Threads, 396 registered users, 131 users online (0 registered, 131 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum