Author Topic: Why LemEdit won't work under XP  (Read 18626 times)

0 Members and 1 Guest are viewing this topic.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Why LemEdit won't work under XP
« on: April 21, 2005, 11:51:56 PM »




Notice that on the first screenshot (Win98), there is a line that states " -MS Windows 04.0A detected. Drivers run in compatibility mode ...   Done." Also notice that this line is missing when LemEdit is run under XP (second screenshot).

Also, this program demonstrates that DOS applications can only detect Windows versions below XP. If it is run under Windows 98 it will tell you that "Windows is running." If it is run under XP it will tell you that "Windows is not running." This program genuinely tries to detect all versions of Windows.

Therefore if LemEdit could detect XP, it would probably run in compatablity mode. (The mouse would work.)

Conway

  • Guest
Re: Why LemEdit won't work under XP
« Reply #1 on: April 22, 2005, 02:05:35 PM »
Okay, but what is that program, and how is it used?

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Why LemEdit won't work under XP
« Reply #2 on: April 22, 2005, 06:59:56 PM »
Basicly it's a compiled alteration of this
Code: [Select]
     '$INCLUDE: 'QB.BI'
     
     DIM InRegs AS RegType
     DIM OutRegs AS RegType
     
     InRegs.AX = &H160A
     CALL INTERRUPT(&H2F, InRegs, OutRegs)
     
     IF OutRegs.AX = 0 THEN
           'Windows is running.
     ELSE
           'Windows is not running.
     END IF

The only changes are...
     a) changed first line to be compatable w/ QBX
     b) changed the two "Windows is..." lines so that they PRINT the message

Windows XP hides itself from this type of detection, which I think LemEdit uses.

Conway

  • Guest
Re: Why LemEdit won't work under XP
« Reply #3 on: April 22, 2005, 08:02:51 PM »
So is it useful for running Lemedit in DOS?

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Why LemEdit won't work under XP
« Reply #4 on: April 23, 2005, 01:25:41 AM »
No, it's useful for proving my point.

To find the solution, you must first state the problem.

guest

  • Guest
Re: Why LemEdit won't work under XP
« Reply #5 on: April 23, 2005, 11:22:19 AM »
Going upon your findings, I hacked my version of LemEdit to bypass the check and had LemEdit always run in compatibility mode.

To my surprise, it works!  I was able to get the mouse working after the change.  HOWEVER...

1) Although LemEdit now respond to the mouse, its response is very sluggish, at least on my particular machine.  It required extreme movements for me to get the cursor to move a small distance.  So usability is still very poor, but still, better than no mouse at all.

2) It seems to work best if you run LemEdit from a Command Prompt window.  If you try to run LemEdit directly by double-clicking from a Windows Explorer window, it will run and it will even show the "compatible mode..." message, but the "hardware timer" line will still fail every now and then.  This might also just be specific to my machine.

So anyway, we now have a start towards a possible solution in getting LemEdit to work under XP.  But just beause I got it to work on my machine doesn't necessarily mean anything, so all of you should try it out and see whether it works on your machine or not, and how usable your mouse was if you get it to work.

The hacked version of LemEdit can be downloaded at http://www.geocities.com/guestlevels/lemmings/lemedit2.zip.  I purposely renamed the program to lemedit2.exe just in case it works worse on your particular machine.  You definitely should keep your original copy of lemedit.exe around just in case.

I also have not yet tried it under DOSBox to see what happens.

guest

  • Guest
Re: Why LemEdit won't work under XP
« Reply #6 on: April 23, 2005, 11:40:24 AM »
Now for the really good news:

LemEdit2 works perfectly under DOSBox!!!  Not only does the mouse work, but unlike running LemEdit2 directly, the mouse response is not sluggish at all.  On my machine the mouse is basically fully usable when runing LemEdit2 under DOSBox.

Thank you Mindless for your valuable information.  I can finally use LemEdit again!  :party:

As before, for the rest of you, please report if you have the same success as I do with LemEdit2.

Offline Shvegait

  • Posts: 772
    • View Profile
Re: Why LemEdit won't work under XP
« Reply #7 on: April 23, 2005, 04:23:58 PM »
 :party:

YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSS!!!!

You sir, are a genius.


It seems a little sluggish in DOSBox, but I am not going to complain about that!

w0000000000000000000000t!!!

Time to go fix my pack :)

Edit: Under XP, my mouse doesn't move, but it responds to clicks. Under DOSBox, it is VERY slow when there are a lot of terrain pieces on the screen. I'll probably hold out until I go home in 2 weeks to work in LemEdit for real, but it's really cool that you can at least use it now! :) It might be slow just because of my computer though, I don't know...

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Why LemEdit won't work under XP
« Reply #8 on: April 23, 2005, 07:03:11 PM »
Quote from: guest  link=1114127516/0#5 date=1114255339
Going upon your findings, I hacked my version of LemEdit to bypass the check and had LemEdit always run in compatibility mode.

I would have done this myself, but I have no skills at disassembling/patching/whatever it is.

Anyway, I'm glad I can finally use LemEdit on my computer.

guest

  • Guest
Re: Why LemEdit won't work under XP
« Reply #9 on: April 23, 2005, 08:01:27 PM »
Quote from: Shvegait  link=1114127516/0#7 date=1114273438
Under DOSBox, it is VERY slow when there are a lot of terrain pieces on the screen.

Have you tried increasing the emulation speed?

Here's a snippet of the relevant info from the DOSBox readme:

CTRL-F7       Decrease frameskip.
CTRL-F8       Increase frameskip.
CTRL-F9       Kill dosbox.
CTRL-F10      Capture/Release the mouse.
CTRL-F11      Slow down emulation (Decrease DOSBox Cycles).
CTRL-F12      Speed up emulation (Increase DOSBox Cycles).

I found that using CTRL-F12 until "Cpu Cycles" gets above 10000 seems to help (the default was only 3000).  Of course the faster your machine is, the higher you can afford to get that number up to.  You'll have to experiment and see.  You can also try CTRL-F8 to increase the frameskip.

Oh, do the adjustments only AFTER LemEdit starts (eg. after it goes into graphics mode), otherwise it'll complain about the timer again.  Basically you need to get the "Cpu Cycles" to read somewhere near 3000 for the "timer test" to pass when LemEdit is initializing.

(Again, I've only tried everything I said on my machine; hope it helps!)

Conway

  • Guest
Re: Why LemEdit won't work under XP
« Reply #10 on: April 23, 2005, 09:46:14 PM »
:party:

Guest and Mindless, this is an outstanding contribution to Lemmings fans worldwide! :D  It's very slow on its own, but in DosBox, with the emulation speed turned up to about 15000, it's near bloody perfect!

 Out of curiosity, how did you get it to bypass the OS check? :???:

guest

  • Guest
Re: Why LemEdit won't work under XP
« Reply #11 on: April 23, 2005, 11:13:40 PM »
Quote from: Conway  link=1114127516/0#10 date=1114292774
Out of curiosity, how did you get it to bypass the OS check? :???:

It's all thanks to that snippet of code that Mindless posted, particularly this one line:

Code: [Select]
CALL INTERRUPT(&H2F, InRegs, OutRegs)
So I basically searched in a hex editor for the bytes of the machine instruction for calling interrupt 2F (CD 2F), then took the surrounding few bytes and examine them in a debugger to see what the surrounding machine instructions do.

Then I changed a few bytes so that the call-interrupt instruction is skipped, and instead the program will always jump to the case where it thinks it detected Windows.  That's it!

All in all only 3 bytes were changed in the program.  Amazing what a world of difference 3 bytes makes!  B)

Offline Shvegait

  • Posts: 772
    • View Profile
Re: Why LemEdit won't work under XP
« Reply #12 on: April 23, 2005, 11:18:04 PM »
Thanks guest. It still runs a little sluggish with the increased number of cycles, but it's better. :)

guest

  • Guest
Re: Why LemEdit won't work under XP
« Reply #13 on: April 23, 2005, 11:21:50 PM »
Quote from: Mindless  link=1114127516/0#8 date=1114282991
~ The Lemmings File Archive ~

That reminds me, Mindless:  since you manage that site, feel free to post either a link to or a copy of lemedit2.zip, when you get around to updating the site.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Why LemEdit won't work under XP
« Reply #14 on: April 24, 2005, 02:41:04 AM »
Site updated.