
                          ===========================
                           Martin Kiewitz's IDPATCHR
                          ===========================

                             Released on 07.11.2001

                        Written and (c) by Martin Kiewitz
                      Dedicated to Maryse and Gerd Kiewitz
-------------------------------------------------------------------------------

        This software is 'e-mail ware'. This means, if you use it, please send
         me an e-mail or a greeting card. I just want to see, how much people
         are using it.

  ============
  | FOREWORD |
  ============

        I'm *really* proud to release this.

        I hated that Doom and those iD software games did not run with
         Soundblaster sound under OS/2 Warp and I never thought that I would be
         the one that made them run under that platform :)

        The bug, that made that game freeze under OS/2 Warp was *NOT* the fault
         of IBM's VDM. Their VDM is actually really the best, I have ever seen.
         It's 32-bit code that *DOES NOT* conform to DPMI specification.

        To illustrate this: There is an Interrupt-Enable flag, which can be
         cleared by an application. Under non-multitask OS, like bare DOS or
         WinDoze, this flag is not virtualized. So the program can clear it
         without any problems. The problems arise, when the OS makes this flag
         "virtual". The OS has no other choice, otherwise a bad program could
         take down the whole system.

        Now the actual problem. To clear/set this flag, there are 2 opcodes
         the processor knows about. They are CLI and STI (Clear/Set).
        This flag is stored in (E)Flags. A programmer can push that register
         to the stack. If he pops it back, he restores under bare DOS the
         Interrupt-Flag as well.

        Now THIS is the problem. CLI and STI can be virtualized. BUT it's not
         possible to virtualize PUSHFD/POPFD (the stack operations).

        You see, where the problem is. If a programmer does the following:

        PUSHFD
        CLI
        POPFD

        It's logical correct code. The problem is the virtualisation. The OS
         only gets to know, that the program wants to DISABLE interrupts. It
         will never get to know that the program ENABLES them later.

        And *that* was the problem with Doom. It has some similar code in it,
         which does exactly this. So Doom freezes, cause another routine needs
         an interrupt to go further.

        THANX TO iD Software for not fixing this silly bug. If I would be
         paranoid, I would guess Microsoft paid them for it, so Win95/98 would
         be able to run Doom, but OS/2 would fail.

  ==================
  | IDPATCHR USAGE |
  ==================

        Simply run IDPATCHR in your Doom/Doom2/Heretic/Hexen/Strife directory.
        It will do the rest by itself.

  ===========
  | CONTACT |
  ===========

        There are several ways to contact me.
        All-time favourite is my e-mail adresse 'kiewitz@fuckMicrosoft.com'.
        Well, you can use 'martin@kiewitz.de' or 'kiewitz@netlabs.org' as well.

        OS/2 World has some content of mine.
         Look at: http://www.os2world.com/games

        Or you may visit my own private homepage.
         Surf to: http://www.kiewitz.de

  ==========================
  | GREETZ AND DEDICATIONS |
  ==========================

        I'm dedicating IDPATCHR to 2 different people.

        First: My daddy Gerd Kiewitz. He died some time ago and I will never
                ever stop loving him
        Second: Maryse...a really great (half-french) girl, that I'm currently
                 really missing much.

        I'm currently really happy, cause I finally got it working. I can't
         actually believe it :) I'm really glad, that this game is now working
         under OS/2. The OS of the future.

        I want to thank Prodigy for their great music. I had them running, when
         I first managed to patch Doom. I LOVE YOUR MUSIC.

 - Martin Kiewitz
