                          OXYRON-Patcher documentation
                         ==============================

                             Copyright (c) 1996/97 
                                      by
                                  Achim Koyen



        1.      Introduction
        1.1     Features
        1.2     Requirements
        1.3     Installation

        2.      Control screen
        2.1     The MMU-Mode

        3.      Help, SOS or whatever
        3.1     Known problems

        4.      Supported instructions
        4.1     Not supported instructions
        4.2     Adressing modes
        4.3     Speed of the OxyPatcher
        4.4     Tested systems

        5.      Law

        6.      Thanks
        6.1     Author adress


********************************************************************************

        1.      Introduction
        --------------------

        Maybe you are one of the owners of an 68040/60 accelarator
        board and you thought you have a powerful processor.
        But lots of software products are not that fast as you had
        expected them to be.
        The reason therefor are the not implemented instructions, which
        are emulated by the 68040/60.library in a slow way.
        Especially the amount FPU instructions has been extremly lowered.
        This means the implemented instructions are lots faster, but when
        a program hits an unimplemented instructions, this will cause
        lots of rastertime for the emulation.
        Thats the reason for the OXYRON-Patcher. This program is doing 
        all the emulations of the unimplemented instructions in a very 
        fast way.


********************************************************************************

        1.1     Features
        ----------------

        The Patcher does the following:
        - it can handle all unimplemented instructions of the 68040/60
          integer-unit and FPU (Floating Point Unit)
        - it can handle the umimplemented DATA.X FFP-format
        - if can handle all adressing modes except for some very special
          adressing modes

        The highest effectivity you will get with the patcher while 
        using programs like Raytracers, Fractal programs and all other
        programs which take high use of the FPU.
        At games or programs which don't use the FPU you won't get a
        much faster result, but our experiences have shown that there are
        not much programs which can do their job without any emulated
        instructions.

        The patcher works with something which can be described like
        'code which codes the code'.
        That means, for every command which should be emulated a special
        code will be generated and be written to a buffer, so if a
        command appears more than one time, the patcher uses the already
        generated code.

        You can control the buffer-size for the max. emulateable instructions
        at the control screen. Thats the reason for the possiblity 
        of a visual colorflash for each emulated command.

        The patcher creates a list of all emulated instructions, which
        will be very interesting for all coders to know, as they
        can optimize their code, that there isn't a single emulated
        instructions left.

        If you don't want the patcher at the startup you can press the
        left mousebutton while booting, then the patcher will not be
        started. If the patcher noticed that you don't want him to
        start, it shows it by a short blue screen.
        If you want the patcher start later, just doubleclick the icon
        and the patcher will start.


********************************************************************************

        1.2     Requirements
        --------------------

        Required is an 68040/60 processor and at least Kickstart 2.0.
        You should have some FastRam as it would speed up the emulation,
        but its not neccesary.


********************************************************************************

        1.3     Installation
        --------------------

        The following files are included:
        OxyPatcher
        OxyPatcher.info
        OxyPatcher.pref
        OxyPatcher.catalog   (German programtexts)
        OpenOxyPPort

        If you want the patcher at you startup sequence copy the files
        `OxyPatcher`, `OxyPatcher.info` and `OxyPatcher.pref` to the
        WBStartup directory at your boot patition or your workbench-
        disk.
        If you don't want the patcher at your startup, you can copy
        it anywhere you like, but all files have to be at the same
        dierectory.

        If you want german texts you have to copy the file
        `OxyPatcher.catalog` to 'Locate/Catalogs/Deutsch' at your
        boot partition.

        The file `OpenOxyPPort` has to be copied to the `C` directory
        at your boot partition.

        Now you have to do an entry at your StartUp-Sequence:
        Enter at the FIRST position the line `OpenOxyPPort`.
        !!! It is strongly recommended that it is the first line !!!
        !!! Don't make this entry at the User-Startup !!!

        Now you just have to reset your Amiga and the patcher will be
        installed (If the program is a the WBStartup directory)
        Otherwise activate it by doubleclicking the icon.

        Attention: When the patcher is installed your computer will
        ========== do a second reset after booting for the first time.
                   It was not possible to avoid this 2nd reset as there
                   has to be a resistant code which handles the exceptions.


********************************************************************************

        2.      Control Screen
        ----------------------

        You will get into the control screen by doubleclicking the Icon
        of the Oxypatcher, if the patcher is already active.

        Top/left you see three boxes with numbers, which are:
        - patched instructions
        - different emulated instructions (here you have the amount which
          is actually in your buffer)
          If the amount increases at the first box, but not at the
          2nd, this means an already emulated instructions has been found.
        - the 3rd box tells how much unpatched instructions have been
          found, in general this box shows '0'

        Below those 3 boxes you see 5 yes/no buttons. What we have there:
        - 'Fetch new inst.', which decides if the patcher will patch
          new instructions.
          If this button is OFF the patcher will only patch instructions,
          which are already at the instruction buffer. All other
          instructions are done by the 68040/60.library then.
          If this button is ON, thep patcher will emulate each instruction
          until the buffer is full. If the buffer is full this button
          will be automatically set to OFF.
        - 'Fetch A7 inst.', will tell the patcher if critical A7 instructions
          will be emulated or done by the library. If one of these
          instrcutions is done by the library, the box unpatched inst.
          will be increased by one.
        - 'startup remove/message' will de/activate the startup-message
          of the patcher
        - 'inst patched info' and 'inst unpatched info' will active a 
          visual information (colorflash) if a patched or an unpatched
          instruction occured. If it is a patched instruction it will be
          a green flash, if the library will be activated it is a red
          flash.
          (Attention: this will not ne viewable with GFX-Boards)
         
        - below that button we have the cycle gadget 'buffer limit'
          which shows the amount of the maximum different patched
          instructions, below that you have the memory (in kb) which
          will be used for that emulations
         
        - the 'flush inst buffer' button will remove all emulation
          codes, which are not neccesary anymore, this will free some
          memory for new ones

          Attention: This may cause a high amount of rastertime and
          ========== it is critical if there are still some acitve 
                     programs, so please be careful and save all data
                     of the still running programs.
                  
        - 'About the Patcher', hmm, no explanation needed i guess.
        - on the right we have a box called 'Instruction Buffer'
          There you will find all instructions which are actually at
          the instruction buffer and where the patcher has generated an
          emualtion code.

        - with the gadget 'Hide old' you can hide all instructions which
          are actually at the buffer.

        - with the cycle gadget on the right you can choose which
          instructions will be shown.
          'Show New' will show those instructions which are patched
          for the first time or where the patcher uses one of the
          already generated instructions.
          'Show All' will show all instructions which have been patched
          'Show Old' shows all instructions which are hidden actually

        - the 'Save' gadget you can save your preferences to the harddisk
          (or Workbench disk), so that the patcher will notice them after
          a reset

        - with 'Exit and Use' the patcher will go on with all new 
          prefs except for the 'buffer limit' if it was changed.
          A changed buffer limit will need a reset before the patcher
          can use it.

        - 'Remove patcher', will remove the patcher ;-)

          Attention: if there are still patched instructions in use
          ========== the patcher will show a security requester.
                     If you will ignore the requester your system will
                     crash for 99.5% :-(


********************************************************************************

        2.1     The MMU-Mode
        --------------------

        The MMU-Mode has influence on the speed of the patched instructions.
        The speedup is about 5-40%. You should activate this every time!
        It can be possible in some software (68040/60.lib)/hardware
        combinations that the MMU-Mode will not run (System crash at
        startup). Then you will have to deactivate it with setting the
        Tooltype 'UseMMU=0' at the patcher icon. If you have done this
        reset and the MMU-Mode is off.
        If you set the 'Startup/remove message' on, the patcher will
        inform you at the startup about the status of the MMU-Mode.
        - 'MMU-Mode enabled...' means the MMU-Mode is active
        - 'Sorry, MMU-Mode not possible...' means that the MMU-Mode
          is not possible. This could have the following reasons:
          - your CPU hasn't got a full MMU
          - the 68040/60 is not compatible (by now it had worked on
            all machines without any problems.)
        - 'MMU-Mode disabled by user...' means the Tooltype 'UseMMU' is
          '0'


********************************************************************************

        3.      Help, SOS or whatever
        -----------------------------

        - at the startup the following message appears
          'Can't open Oxyron Patchport'

        Make sure:
        - that 'OpenOxyPPort' is at the first position of the StartUp-
          Sequence (refer to: 1.3 Installation)

        - don't forget to do a reset right after any new installation

        - the patcher crashes at the startup (hopefully not :-)
          Try without MMU-Mode (refer to: 2.1 MMU-Mode)
       
        - the patcher crashes while doing his work
          Deactivate 'Fetch A7 inst.' and restart
          (refer to: 2. Control Screen)


*******************************************************************************

        3.1     Known problems
        ----------------------

        While using Maxon Cinema 4D V4.0 with the OxyPatcher it could
        be possible that an error occures (Trap #48).
        We have tried hard to find that bug, but we were not able to
        get a solution for it yet. The amount of this error was decreased
        but it can still occure.
         

********************************************************************************

        4.      Supported instructions
        ------------------------------

        The OxyPatcher supports the following integer instructions:
        MULU.L
        MULS.L
        DIVU.L
        DIVS.L
        MOVEP
        CMP2

        and the following FPU instructions:
        FMOVECR                 (all const.)
        FDBcc                   (all Condition-Codes)
        FScc                    (all Condition-Codes)
        FSIN
        FCOS
        FATAN
        FLOGN
        FLOG2
        FLOG10
        FTAN
        FETOX
        FTWOTOX
        FTENTOX
        FETOXM1
        FLOGNP1
        FCOSH
        FSINH
        FASIN
        FACOS
        FTANH
        FATANH
        FGETEXP
        FGETMAN
        FINTRZ
        FINT
        FSINCOS
        FSCALE
        FMOD
        FREM

        The Data.X FFP-Format, e.g.:
        FMOVE.X #Data,FPn
        FCMP.X  #Data,FPn
        FSIN.X  #Data,FPn
        FMOD.X  #Data,FPn


********************************************************************************

        4.1     Not supported instructions
        ----------------------------------

        Because of some technical problems it was not possible to 
        implement all instructions, the not supported ones are: 
        CAS2
        CHK2


********************************************************************************

        4.2     Adressing Modes
        -----------------------

        In normal cases all adressing modes are patched by the OxyPatcher.
        Exceptions are those where the Stackpointer is used the wrong way:
        These are:
        -read -(A7)
        -write (A7)+

        The patcher will Never! patched instructions with those adressing
        modes, but in general no application will use this.
        If there will be such an instructions it will be done by the
        installed 68040/60.library.

        Supported adressing modes are:
        #Data
        Rn
        (An)
        (d16,An)
        (d16,PC)
        (d8,An,Xi)
        (d8,PC,Xi)
        (An)+
        -(An)
        Abs.W
        Abs.L
        (bd,An,Xi)
        (bd,PC,Xi)
        ([bd,An,Xi],od)
        ([bd,PC,Xi],od)
        ([bd,An],Xi,od)
        ([bd,PC],Xi,od)

        For all adressing mode where An=A7 it is possible to deactivate
        the patching, so that the 68040/60.library will do that work.
        (refer to: 2. Control Screen)

        These are the possibilities:
        FScc    (A7)+
        FSIN    -(A7),FPn
        FCOS    -(A7),FPn
        FATAN   -(A7),FPn
        FLOGN   -(A7),FPn
        FLOG2   -(A7),FPn
        FLOG10  -(A7),FPn
        FTAN    -(A7),FPn
        FETOX   -(A7),FPn
        FTWOTOX -(A7),FPn
        FTENTOX -(A7),FPn
        FETOXM1 -(A7),FPn
        FLOGNP1 -(A7),FPn
        FCOSH   -(A7),FPn
        FSINH   -(A7),FPn
        FASIN   -(A7),FPn
        FACOS   -(A7),FPn
        FTANH   -(A7),FPn
        FATANH  -(A7),FPn
        FGETEXP -(A7),FPn
        FGETMAN -(A7),FPn
        FINTRZ  -(A7),FPn
        FINT    -(A7),FPn
        FSINCOS -(A7),FPx:FPy
        FSCALE  -(A7),FPn
        FMOD    -(A7),FPn
        FREM    -(A7),FPn
        MULU.L  -(A7),DHi:DLo
        MULS.L  -(A7),DHi:DLo
        DIVU.L  -(A7),DHi:DLo
        DIVS.L  -(A7),DHi:DLo
        MOVEP   Dn,(-d16,A7)
        MOVEP   (-d16,A7),Dn


********************************************************************************

        4.3     Speed of the OxyPatcher
        --------------------------------

        The following table will show the speed of the OxyPatcher:
        
        For the 68040 Processor:
        ------------------------
         
        Program                 unpatched       patched
        ===================================================

        MaxonC4D_V4.0
        -------------
        Scene1                  00:07:52        00:02:52
        Scene2                  00:21:37        00:09:21
        Scene3                  01:04:36        00:32:56

        WCS_V2.04
        ---------
        Scene1                  00:13:00        00:05:28
        Scene2                  01:25:23        00:42:41

        Lightwave_V5.0
        --------------
        Scene1                  00:21:39        00:17:45
        Scene2                  01:32:38        01:20:28

        SceneryAnimator_V4.0
        --------------------
        Scene1                  00:03:31        00:02:09
        Scene2                  00:03:16        00:01:46

        Reflections_V3.05
        -----------------
        Scene1                  00:03:21        00:02:38
        Scene2                  00:18:43        00:15:06
        Scene3                  00:13:53        00:04:29

        Real3D_V3
        ---------
        Scene1                  00:56:04        00:37:16

        Fractuality_V1.10d
        ------------------
        UrApfel/640*512
        DoubleFP/It.max=128     00:06:44        00:00:53
         

    
    
        For the 68060 Processor:
        ------------------------
         
        Program                 unpatched       patched
        ===================================================

        MaxonC4D_V4.0
        -------------
        Scene1                  00:10:58        00:01:13
        Scene2                  01:14:32        00:04:38
        Scene3                  05:56:03        00:16:58

        WCS_V2.04
        ---------
        Scene1                  00:10:13        00:02:02
        Scene2                  01:13:36        00:18:08

        Lightwave_V5.0
        --------------
        Scene1                  00:17:57        00:06:03
        Scene2                  01:24:06        00:26:31

        SceneryAnimator_V4.0
        --------------------
        Scene1                  00:19:24        00:01:23
        Scene2                  00:13:26        00:01:07

        Reflections_V3.05
        -----------------
        Scene1                  00:02:10        00:01:07
        Scene2                  00:11:18        00:06:17
        Scene3                  00:04:02        00:01:40

        Real3D_V3
        ---------
        Scene1                  00:34:14        00:14:51

        Fractuality_V1.10d
        ------------------
        UrApfel/640*512
        DoubleFP/It.max=128     00:06:59        00:00:18

         
********************************************************************************

        4.4     Tested Systems
        ----------------------

        The OxyPatcher has been tested on the following configurations:
         
        -A1200/Blizard1260/48MB-FastRAM/SCSI-Controller
        -A1200/Apollo1240-40MHz/16MB-FastRAM
        -A1200/Apollo1260/16MB-FastRAM
        -A4000/Apollo4060/Picasso4/40MB-FastRAM
        -A4000/Cyberstorm-MK2/Picasso4/32MB-FastRAM
        -A4000/Cyberstorm-MK2/Cybervison/112MB-FastRAM


********************************************************************************

        5.      Law
        -----------

        The OxyPatcher is a program which causes large modification 
        to the system-structure of your machine!
        Although the OxyPatcher was tested on different systems, I
        can't guarantee the correct function of the OxyPatcher on
        your equipment.
        I hereby reject all liability or responsibility for any 
        consequences following any incorrect function of the OxyPatcher.

        The author
        Achim Koyen


********************************************************************************


        6.      Thanks
        --------------
         
        Here i want to say thanks for the help, critic and the hints
        they gave me.
        
        Thanks, warm beer and cold handshakes to:
        Michael Piepgras
        Daniel Trompetter
        Michael Zimmer
        Alex Talmann
         
         
********************************************************************************

        6.1     Author Adress
        ----------------------

        I would be very nice to hear about your opinion or any problems
        which are caused by the OxyPatcher.
        Please contact me if you have questions, tips or any information
        you want me to know
        
        Achim Koyen
        Nübelfeld 49
        D-24972 Quern
        