  Linux XFree-to-Xinside mini-HOWTO
   (by Marco Melgazzi, s64912@athena.polito.it,
   version 1.1 / 1996 July)
   (ҒFMarco Melgazzi ̎僁CAhX 1997 NA
  1݁Amarco@techie.com ɂȂĂ܂)

  XFree86-XInside.euc
   aF͂(hara@access.co.jp), 1997 Jan.27th

    XFree86 [hC XInside ̂̂ɕϊ@

    1.Cg_NV

    ̐A XFree86 ƏƐï XInside Ƃ̊Ԃłǂ
  ăBfI[hϊ邩Ƃ₪ comp.os.linux.x 
  񓊍eĂ܂B
    ͂̐ȋO̕]łgĂA̕]ł܂
  n[hfBXNɎcĂ܂B͖̂D
  ̂ŁA̖͂Ă݂悤ƌSāAAOԂ
  ݂āAvZʁA炭LȋL𑦍ɓe邱Ƃ
  ܂B
    ̕ϊ̕@ɂĂ̋c_͂ɏĂ܂܂A
  ͂͂̕ɂĂ̊ӂ̃CʁA󂯎܂B
  ŁA̐A܂̒N̏KvƂ邩ȂƎv
  A͂̓eȂǂł邱 mini-HOWTO ɏ
  Ƃɂ̂łB
    ܂ŏɂqׂĂF
   XInside ̂߂ɓĂ̂ł́u܂vA
  Linux p̕]Ń@[W 1.2 ɃANZX邱Ƃł܂
  łBj^[̃^C~O邱Ƃ͊댯ȂƂɂȂ肤
  邵A̗RA͐ΓIɂȂۏ؂܂B
  łȂ܂΁A\ȂƂłAȂ̃Rs
  [^΂𐁂ĂA͂ɂĂ̑Ή͂Ȃł傤B
    Ȃ̖OCtȂ悤ɁA͉p̃l
  CeBuXs[J[ł͂Ȃ̂ŁAɊԈႢ邩
  ܂B͂ɂĎӍ߂܂B炨肢łA
  C{bNX֌W̘_ňtɂ肵ȂŉB
  ӁI

    2. Ȃ͂ꂪKv

    ́AȂɃBfI[h邽߂̃[eBeB(xvidtune
  ̂悤)^A/܂́AȂ XFree ̂̂]
  ( AFAIK i)ɃC|[g郆[eBeB^ȂƂ
  XInside ̃|V[͕słƎ͎v܂B́Aꏏ
  ɂ̂3Ԃ炢Ă܂܂A(ƈꌾF
  ͓̃tH[}bg VESA 1024x768@70Hz ̍ڂr܂
  (Ď͍AقƂǓd@Zp҂ł ;-) )AXinside ̃vO}
  Ȃ炱̎Ԃ̂ق̂ƂgŁAƓ悤ȕ͂
  ͂Ȃ̂ɁAAA
     1.3 ]ł_E[hĂ܂񂪁A͔ޓ̓_
  ĂĂ邱Ƃ{Ɋ]Ă܂BmɁAĂ΁A
   mini-HOWTO ͗pɂȂĂ܂܂񂪁AA
  AȂǂ񂾂ȂASĂǂ̂悤ɓĂ邩
  ̎dg݈ȏ̉wł邱Ƃł傤AAA

    3.  Ă݂悤

    Ȃ̂܂܂ XFree86 [hĂāA
   XInside Ă݂Ɖ肵܂傤B
    ȉ̃Xebvɏ]Ă΁Aꂪłł傤B
    X͎ۂ̗ƂĎ̃ftHg̃BfI[hgpāA
  ϊɂ͂Ȃׂ܂B

    XFree86 ̃Gg[͂ȕɂȂĂ܂F

    Modeline "blahblah" DOTCLK  A B C D  a b c d

   A-B  1-4 ̐͂ǂӖĂ܂F
  Ȃ΁ÄӖ 'The Hitchhiker's Guide to
  X386/XFree86 Video Timing'(/usr/lib/X11/doc/VideoModes.doc)
  Œׂ邱Ƃłł傤A܂ϊ邽߂ɂ͂̑S
  ̔wɂ闝_mKv͂ȂłB

   /usr/lib/X11/XF86Config ɂ鎄̃[hC͈ȉ̂悤
  ȂĂ܂F

         Modeline "1168x876" 105  1168 1256 1544 1640  876 877 891 900
                              |     |    |    |    |    |   |   |   |
                           DOT_CLK  A    B    C    D    a   b   c   d

    XInside ł́AȂ Xtimings t@CɃGg[t
  Ȃ΂܂B̃t@C etc/ ɂĂׂłB
  (ȉł́AȂ Xaccel fBNg̈ԏɂ̂Ɖ
  ܂B /usr/X11/lib/X11/AcceleratedX ̂悤ɂȂĂ
  ͂ł)

    !    Somewhere in the file, put here the name you want
    ! ̃t@ĈǂAȂ̍DȖOɏ

    [PREADJUSTED_TIMING]
        PreadjustedTimingName = "1168x876 @ 72Hz";

    !
    !    These four are obvious
    !
    !     4 ͖

        HorPixel          = 1168;         // pixels
        VerPixel          = 876;          // lines
        PixelWidthRatio   = 4;
        PixelHeightRatio  = 3;

    !
    !   hsync: DOT_CLK / D * 1000 [KHz]
    !
    !   hsync = 105 / 1640 * 1000 = 64.024 KHz
    !
    !   vsync: ( 1 / (( D / DOT_CLK ) * d) ) * 1,000,000 [Hz]
    !
    !   vsync: ( 1 / (( 1640 / 105 ) * 900) ) * 1,000,000
    !           ( 1 / 14057.1428571 ) * 1,000,000 = 71.138 Hz
    !

        HorFrequency      = 64.180;        // kHz
        VerFrequency      = 71.138;        // Hz

    !   Obvious
    !   炩

        ScanType          = NONINTERLACED;

    !
    !   Put here the +/-hsync +/-vsync XFree86 options
    !
    !   ɁA+/-hsync +/-vsinc XFree86 IvV

        HorSyncPolarity   = POSITIVE;
        VerSyncPolarity   = POSITIVE;

    !   Shouldn't change
    !   ςׂł͂Ȃ

        CharacterWidth    = 8;             // pixels

    !   DOT_CLK here

        PixelClock        = 105.000;       // MHz
    !
    !
    !   horizontal timings section: [usec]
    !
        HorTotalTime  = D / DOT_CLK                  = 15.619;
        HorAddrTime   = A / DOT_CLK                  = 11.124;
        HorBlankStart = A / DOT_CLK                  = 11.124;
        HorBlankTime  = HorTotalTime - HorBlankStart =  4.495;
        HorSyncStart  = B / DOT_CLK                  = 11.962;
        HorSyncTime   = C / DOT_CLK - HorSyncStart   =  2.743;

     !
     !  vertical timings section:    [msec]
     !

        VerTotalTime  = ( HorTotalTime * d ) / 1000  = 14.057;
        VerAddrTime   = ( HorTotalTime * a ) / 1000  = 13.682;
        VerBlankStart = ( HorTotalTime * a ) / 1000  = 13.682;
        VerBlankTime  = VerTotalTime - VerBlankStart =  0.375;
        VerSyncStart  = ( HorTotalTime * b ) / 1000  = 13.698;
        VerSyncTime   = ( HorTotalTime * ( c - b ) ) / 1000
                                                     = 0.219
     ! Finished !
     ! ܂ !

    āAȂ͂̐V[hK؂ȏꏊ̈ȉɎ
  Ăt@C̒ɒuȂ΂܂B

    4.  ꂱݒ肷

    ȉŎĂ excerpts ł́A-> ̋L͕ύX̂\
  Ă܂F
   Ȃ̃t@C̒ɂ̋L܂߂Ȃ悤ɁI

    j^[Gg[(̂ monitors/mfreq/mfreq64.vda)

             [ESTABLISHED_TIMINGS]
                 "640x480 @ 60Hz",
                 "640x480 @ 72Hz",
                 "640x480 @ 75Hz",
                 "800x600 @ 56Hz",
                 "800x600 @ 60Hz",
                 "800x600 @ 72Hz",
                 "800x600 @ 75Hz",
                 "1024x768 Interlaced",
                 "1024x768 @ 60Hz",
                 "1024x768 @ 70Hz",
                 "1024x768 @ 75Hz",
             "1152x900 Interlaced",
                 "1152x900 @ 60Hz",
                 "1152x900 @ 67Hz",
         ->      "1168x876 @ 72Hz",
                 "1280x1024 Interlaced",
                 "1280x1024 @ 60Hz",
             "1600x1200 Interlaced";

    {[ht@C(̏ꍇ boards/s3/764-2.xqa łA
  ǂĔޓقƂǑS Hercules {[hpӂĂ
  ̂ɁA Terminator 64/Dram ͂łȂ̂svcł)

    [VISUAL]
        BitsPerPixel   = 8;
        MemoryModel    = Packed;
        ColorModel     = Indexed;
        BitsRGB        = 6;
        NumberOfColors = 256;

        [RESOLUTIONS]
        640x480,
        800x600,
        1024x768,
    ->  1168x876,
        1152x900,
        1280x1024

        [DESKTOPS]
        640x480,
        800x600,
        1024x768,
        1152x900,
    ->  1168x876,
        1280x1024,
        1600x1200

   hbgNbN[ႢȂ(̃{[h̏ꍇ͈ǂ)A
  Gg[ 16bpp  32bpp sections ɒuƂł܂B

   /etc/Xaccel.ini ͈ȉ̂悤ɂȂĂł傤B

         --------------------------------------------------------------
             Board   = "s3/764-2.xqa";
             Monitor = "mfreq/mfreq64.vda";
             Depth   = 8;
         ->  Desktop = 1168x876;

             [RESOLUTIONS]
         ->      1168x876,
                 1024x768;

    ۂ XInside [hGg[ etc/Xtimings ɂ܂B

    --------------------------------------------------------------
    [PREADJUSTED_TIMING]
        PreadjustedTimingName = "1168x876 @ 72Hz";

        HorPixel          = 1168;          // pixels
        VerPixel          = 876;           // lines
        PixelWidthRatio   = 4;
        PixelHeightRatio  = 3;
        HorFrequency      = 64.024;        // kHz
        VerFrequency      = 71.138;        // Hz
        ScanType          = NONINTERLACED;
        HorSyncPolarity   = POSITIVE;
        VerSyncPolarity   = POSITIVE;
        CharacterWidth    = 8;             // pixels
        PixelClock        = 105.000;       // MHz
        HorTotalTime      = 15.619;        // (usec) =  205 chars
        HorAddrTime       = 11.124;        // (usec) =  146 chars
        HorBlankStart     = 11.124;        // (usec) =  146 chars
        HorBlankTime      =  4.495;        // (usec) =   59 chars
        HorSyncStart      = 11.962;        // (usec) =  157 chars
        HorSyncTime       =  2.743;        // (usec) =   36 chars
        VerTotalTime      = 14.057;        // (msec) =  900 lines
        VerAddrTime       = 13.682;        // (msec) =  876 lines
        VerBlankStart     = 13.682;        // (msec) =  876 lines
        VerBlankTime      =  0.375;        // (msec) =   24 lines
        VerSyncStart      = 13.698;        // (msec) =  877 lines
        VerSyncTime       =  0.219;        // (msec) =   14 lines

    Xinside T[oĂԁAp[^ vgaset vO
  𑖂点āAȂ̕ϊ`FbN邱Ƃł܂FŁAXFree
  ̎̂悤ȃCo͂Ăł傤ASĂ܂s
  ΁ÃC͂Ȃ̍ŏ̃CƓł傤(A
   b  c ΁A Xinside ł̏󋵂mF邱Ƃł
  ܂łFłǂꍇ c=b+1 ̎ł)

    5. ŌɁAAA

   őSłAFI ͂͂̕Ȃ̖ɗƂ
  ҂Ă܂B Xinside 𔃂ǂ킩܂F
  Xinside ͂ȂȂǂÃeLXgx XFree ɔׂĖ{
  ɐMقǂł( xterm EChE xteddy 𓮂Ă݂
  ΁ǍĂ邱Ƃ킩ł傤)A͂̊wŕ
  ܂Ȃ̂łAAAA
   A Xinside ̒N mini-HOWTO 炩̃T|[g
  󂯂鉿lƍlȂA 1.3 SŃT[oeXg
  ĂĂ̖Ȃł :)

    6.  ̃vZX

   ̏ȃXNvg͎d̂قƂǂĂ܂B
   ScanType 2 Polarity ̃Cɏ[ɋCĂF
  ̃XNvg͂ZbgȂAȂ܂ɂȂ
  ̂𒼂Ȃ̂ȂAȂ̃j^𔚔댯͔
  ɑ傷ł傤B
   ́u_uXLvtbO Xinside ňӖĂ邩
  mȂƂ𒍈ӂĉFȂ𑜓x̃_u
  XLϊȂAvӂłItbV[gd
  ȂĂ܂߁AȒPɃj^[󂵂Ă܂ł傤B(ہA
   400x300@72Hz  400x300@144Hz ɂȂĂ܂܂I)

         #!/bin/sh
         ###################################################################
         # XF2XInside
         #
         # This script converts modelines from XF86Config format to XInside
         # format as needed for the etc/Xtiming file.
         #
         # This is a quick hack, so don't expect much error checking (not to
         # speak of anything like user friendlyness).
         #
         # If you call it without arguments it should tell you what to do.
         #
         #                               ( July 1996, hcz@tazlwurm.bb.bawue.de)
         #
         # Btw: New modes created as described in the HOWTO work, but don't
         # show up in Xsetup's menu. Anybody who knows why?
         #
         ####################################################################
         # ̃XNvg etc/Xtiming t@CɂāAKvɉ
         #XF86Config tH[}bg XInside tH[}bg
         #[hCϊ̂łB
         #
         # ͂dȂ̂ŁÃG[`FbN҂Ȃ
         #B([UthlX݂ȂƂȂł)
         #
         # c_͂ȂŁAgĂ΁AĂ̂
         #킩ł傤B
         #
         # ƂŁFV[h HOWTO ̎d̒ɏĂ悤
         #܂AXsetup ̃j[ɂ͕\܂BN̂
         #mĂ܂H
         #
         ###################################################################
         #----------------------------------------------- Here we go:
         # Change this if your modeline file lives somewhere else:
         #----------------------------------------------- sF
         # Ȃ̃[hCt@Cǂ̏ꏊɂȂ
         # ւĂB
         XF=/usr/X11/lib/X11/XF86Config
         if [ $# -ne 1 ] ; then
           echo "usage: ${0##*/} <mode>"
           echo " example: ${0##*/} 1024x764"
   echo -e " function: converts $XF modeline entry into\n Xinside Format (stdout
  )"         exit 1
         fi
         egrep -i "^[\t ]*modeline.+\"$1\""  /usr/X11/lib/X11/XF86Config |
         gawk '
         NF < 11  { print "! invalid Modeline:\n! " $0 "\n!"; next }
         {
           print "//", $0  ":"
           name = $2
           DOT_CLK = $3;
           A = $4;
           B = $5;
           C = $6;
           D = $7;
           a = $8;
           b = $9;
           c = $10;
           d = $11;
           VerFrequency =  1000000 / ((D / DOT_CLK) * d)
           print "[PREADJUSTED_TIMING]"
           printf "  PreadjustedTimingName = \"%dx%d @ %.0dHz\";\n", A, a, VerFrequency
           print "  HorPixel\t\t= " A ";"
           print "  VerPixel\t\t= " a ";"
           print "  PixelWidthRatio\t= 4;\n  PixelHeightRatio\t= 3;"
           print "  HorFrequency\t\t= " DOT_CLK / D * 1000 ";\t// kHz"
           print "  VerFrequency\t\t= " VerFrequency  ";\t// Hz"
           print "  ScanType\t\t= NONINTERLACED;\t\t// *CHECK*"
           print "  HorSyncPolarity\t= NEGATIVE;\t\t\t// *CHECK*"
           print "  VerSyncPolarity\t= NEGATIVE;\t\t\t// *CHECK*"
           print "  CharacterWidth\t= 8;"
           print "  PixelClock\t\t= " DOT_CLK ";"
           HorTotalTime = D / DOT_CLK
           print "  HorTotalTime\t\t= " HorTotalTime ";"
           print "  HorAddrTime \t\t= " A / DOT_CLK ";"
           print "  HorBlankStart\t\t= " A / DOT_CLK ";"
           print "  HorBlankTime\t\t= " D / DOT_CLK - A / DOT_CLK ";"
           print "  HorSyncStart\t\t= " B / DOT_CLK ";"
           print "  HorSyncTime\t\t= " C / DOT_CLK - B / DOT_CLK ";"
           VerTotalTime  = ( HorTotalTime * d ) / 1000
           print "  VerTotalTime\t\t= " VerTotalTime ";"
           print "  VerAddrTime\t\t= " ( HorTotalTime * a ) / 1000 ";"
           VerBlankStart = ( HorTotalTime * a ) / 1000
      print "  VerBlankStart\t\t= " VerBlankStart ";"
      print "  VerBlankTime\t\t= " VerTotalTime - VerBlankStart ";"
      print "  VerSyncStart\t\t= " ( HorTotalTime * b ) / 1000 ";"
      print "  VerSyncTime\t\t= " ( HorTotalTime * ( c - b ) ) / 1000
      print ""
    }'

    7.  

    Heike Claudia Zimmerer hcz@tazlwurm.bb.bawue.de AȖ
  wEAd̂قƂǂĂXNvg𑗂Ăꂽ
  Ƃӂ܂B

    8. Rs[Cg/@֌W

    Marco Melgazzi (s64912@athena.polito.it) 쌠(1996)L
  -- GPL(Gnu Public License)KpBGPL ̃Rs[𓾂ɂ͈ȉ̏Z
  AĂBFree Software Foundation, Inc., 675 Mass Ave,
  Cambridge, MA 02139, USA.
   eW͂̏L҂̂̂łB͂̏̐̕mALp
  Ă͉̕ۏ؂܂B

  ȉAB
    (c)opyright 1996 by Marco Melgazzi (s64912@athena.polito.it) - the GPL
    (Gnu Public License) applies. To obtain a copy of the GPL write to the
    Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
    USA.
    Trademarks are owned by their owners. There is no warranty on the
    accuracy and/or the usefulness of the information given in this
    document.

  (ҒF Marco Melgazzi ̃CAhX͌݁Amarco@techie.com
  ɂȂĂ܂)

