home *** CD-ROM | disk | FTP | other *** search
/ Millennium Time Capsule / AC2000.BIN / disks / ac13disk / centscrn / dev / devel_e.txt
Encoding:
Text File  |  1998-06-10  |  22.6 KB  |  1,214 lines

  1.                      *---------------------------*
  2.                      *    Coder Documentation    *
  3.                      *---------------------------*
  4.                      *       Video system        *
  5.                      *           of              *
  6.                      *       CENTScreen          *
  7.                      *    DOLMEN Compatible      *
  8.                      *---------------------------*
  9.  
  10.                                                    Author: Sacha Hnatiuk
  11.                                                       ASM: Sacha Hnatiuk
  12.                                                    C: David René-Loiseau
  13.                                                  Hotline from 21h to 23h
  14.                                                     form mardi to samedi
  15.                                                           at 344-746-330
  16.                                             or e-mail centek@graphity.fr
  17. Introduction
  18. ------------
  19.  
  20.   It will come later...
  21.  
  22.                 *--------start of the functions----------*
  23.  
  24. Getrez ($04)
  25. ------------
  26.   
  27.   Return the current resolution
  28.  
  29.     It's the old call to know the current resolution.
  30.       0 for Low ST
  31.       1 for Med ST
  32.       2 for High ST 
  33.     In the other case, it return 3, the default value for Falcon modes.
  34.  
  35.   Parameters:
  36.     Nothing
  37.  
  38.   Answer:
  39.     D0 (word): resolution
  40.   
  41.   ASM 1: 
  42.     move.w    #4,-(sp)
  43.     trap    #14
  44.     addq.l    #2,sp
  45.        
  46.   ASM 2:
  47.       include    XBIOS.EQU
  48.       
  49.       XBIOS    Getrez
  50.  
  51.   C:  
  52.       #include    <tos.h>
  53.     int    Getrez( void )
  54.  
  55.  
  56. Setscreen ($05)
  57. ---------------
  58.  
  59.   Change the resolution:
  60.  
  61.     Use this function in priority for all changement of resolution because
  62.   it realloc the screen an initialise the VDI.
  63.  
  64.     Whatever the screen adress composed of 0, the reallocation of the screen is
  65.   doing.
  66.  
  67.   Parameters:
  68.     Log (long): Pointeur to the logical screen or 0 to realloc the screen
  69.     Phys (long): Pointeur to the physical screen or 0 to realloc the screen
  70.     Rez (word): 3 for Falcon mode
  71.     Mode (word): video mode
  72.  
  73.   Answer:
  74.     D0 (word): the old video mode
  75.  
  76.   ASM 1: 
  77.     move    #mode_video,-(sp)
  78.     move    #3,-(sp)
  79.     move.l    #log_base,-(sp)
  80.     move.l    #phys_base,-(sp)
  81.     move.w    #5,-(sp)
  82.     trap    #14
  83.     addq.l    #14,sp
  84.        
  85.   ASM 2:
  86.       include    XBIOS.EQU
  87.       
  88.     move    #mode_video,-(sp)
  89.     move    #3,-(sp)
  90.     move.l    #log_base,-(sp)
  91.     move.l    #phys_base,-(sp)
  92.       XBIOS    Setscreen
  93.   C:
  94.     #include    <tos.h>
  95.     void    Setscreen( void *laddr, void *paddr, int rez );
  96.  
  97.  
  98. Vread ($41)
  99. -----------
  100.  
  101.   Inquire on the actual video mode:
  102.  
  103.     In one call, you can know all the informations on the video mode
  104.   installed.
  105.  
  106.   Parameters:
  107.     Long: pointeur to an array:
  108.  
  109.           word: handle
  110.           word: video mode like on Falcon
  111.           word: width of the physical screen
  112.           word: height of the physical screen
  113.           word: number of plane
  114.           word: width of the virtual screen
  115.           word: height of the virtual screen
  116.           word: delay in seconds before shut down
  117.           word: delay in seconds between the shut down and the Energy
  118.                Star mode
  119.           bytes: name of the video mode (32 bytes maxi) terminated
  120.                   by a 0.
  121.  
  122.   Answer:
  123.     the array is full.
  124.  
  125.   ASM 1: 
  126.     move.l    #Result,-(sp)
  127.     move.w    #$41,-(sp)
  128.     trap    #14
  129.     addq.l    #6,sp
  130.        
  131.   ASM 2:
  132.       include    XBIOS.EQU
  133.       
  134.     move.l    #Result,-(sp)
  135.       XBIOS    Vread
  136.   C:        
  137.       #include    <dolmen.h>
  138.     void    Vread(VDO_PARAM *Result);
  139.  
  140. Vwrite ($42)
  141. ------------
  142.  
  143.   Change the screen resolution
  144.  
  145.     It is possible to initialized the VDI to use its functions directly.
  146.   It make an realloc at the same time.
  147.  
  148.     With the in-array (see the desciptor in the last function), you can
  149.   send the new desire resolution:
  150.  
  151.     - handle <>-1: it's the handle of a known video mode (like the
  152.       start resolution). You can give the virtual size with a value different
  153.       of -1, else it take the original virtual size.
  154.     - handle = -1: the resolution must be given and could be adjust by virtual
  155.       size like before. The search of your resolution take the resolution
  156.       smaller or equal and add virtual screen if needed.
  157.  
  158.     After the call, the out-array contains the real resolution made.
  159.  
  160.     If an error occur, the actual resolution is return with -1 for d0.
  161.  
  162.   parameters:
  163.     word: reset the VDI if different of 0
  164.     Long: in parameters
  165.     Long: out parameters
  166.  
  167.   Answer:
  168.     the out-arry is full.
  169.     D0=0 : no error
  170.     D0=-1: error
  171.     
  172.   ASM 1: 
  173.     move.l    #OutParam,-(sp)
  174.     move.l    #InParam,-(sp)
  175.     move.w    #$42,-(sp)
  176.     trap    #14
  177.     lea    10(sp),sp
  178.        
  179.   ASM 2:
  180.       include    XBIOS.EQU
  181.       
  182.     move.l    #OutParam,-(sp)
  183.     move.l    #InParam,-(sp)
  184.       XBIOS    Vwrite
  185.   C:
  186.       #include    <dolmen.h>
  187.     int     Vwrite(int InitVDI, VDO_PARAM *InParam, VDO_PARAM *OutParam);
  188.     
  189. Vattrib ($43)
  190. -------------
  191.  
  192.   Change the attributs of a video mode
  193.  
  194.     You can change the original mode with this function.
  195.     
  196.     ...
  197.  
  198.   parameters:
  199.     Long: in parameters
  200.     Long: out parameters
  201.  
  202.   Answer:
  203.     the out-array is full.
  204.  
  205.   ASM 1: 
  206.     move.l    #OutParam,-(sp)
  207.     move.l    #InParam,-(sp)
  208.     move.w    #$43,-(sp)
  209.     trap    #14
  210.     lea    10(sp),sp
  211.        
  212.   ASM 2:
  213.       include    XBIOS.EQU
  214.       
  215.     move.l    #OutParam,-(sp)
  216.     move.l    #InParam,-(sp)
  217.       XBIOS    Vattrib
  218.   C:        
  219.       #include    <dolmen.h>
  220.     void    Vattrib (VDO_PARAM *InParam, VDO_PARAM *OutParam);
  221.  
  222. Vcreate ($44)
  223. -------------
  224.  
  225.   Add a video mode
  226.  
  227.     It take directly the videl parameters and  affect a new handle on it with
  228.   your parameters.
  229.     
  230.     It use by CENTvidel.
  231.     
  232.     ...
  233.     
  234.   parameters:
  235.     Long: in parameters
  236.     Long: out parameters
  237.  
  238.   Answer:
  239.     The out array is full.
  240.  
  241.   ASM 1: 
  242.     move.l    #OutParam,-(sp)
  243.     move.l    #InParam,-(sp)
  244.     move.w    #$44,-(sp)
  245.     trap    #14
  246.     lea    10(sp),sp
  247.        
  248.   ASM 2:
  249.       include    XBIOS.EQU
  250.       
  251.     move.l    #OutParam,-(sp)
  252.     move.l    #InParam,-(sp)
  253.       XBIOS    Vcreate
  254.   C:        
  255.       #include    <dolmen.h>
  256.     void    Vcreate (VDO_PARAM *InParam, VDO_PARAM *OutParam);
  257.  
  258.  
  259. Vdelete ($45)
  260. -------------
  261.  
  262.   Delete a video mode
  263.     
  264.     Don't move the handles but compress the internal data. After a save-load
  265.   sequence, the handles may be change.
  266.  
  267.   parameters:
  268.     word: handle to delete.
  269.  
  270.   Answer:
  271.     D0=0 : no error.
  272.     D0=-1 : bad handle.
  273.  
  274.   ASM 1: 
  275.     move.w    #Handle,-(sp)
  276.     move.w    #$45,-(sp)
  277.     trap    #14
  278.     addq.l    #4,sp
  279.        
  280.   ASM 2:
  281.       include    XBIOS.EQU
  282.       
  283.     move.w    #Handle,-(sp)
  284.       XBIOS    Vdelete
  285.   C:        
  286.       #include    <dolmen.h>
  287.     int    Vdelete(int Handle);
  288.  
  289. Vfirst ($46)
  290. ------------
  291.  
  292.   Search the first video mode
  293.  
  294.     ...
  295.  
  296.   parameters:
  297.     long: in-mask
  298.     long: out-array
  299.  
  300.   Answer:
  301.     D0=0 : the out-array is full. 
  302.     D0=-1 : no mode match
  303.  
  304.   ASM 1: 
  305.     move.l    #Mode,-(sp)
  306.     move.l    #Mask,-(sp)
  307.     move.w    #$46,-(sp)
  308.     trap    #14
  309.     lea    10(sp),sp
  310.        
  311.   ASM 2:
  312.       include    XBIOS.EQU
  313.       
  314.     move.l    #Mode,-(sp)
  315.     move.l    #Mask,-(sp)
  316.       XBIOS    Vfirst
  317.   C:
  318.       #include    <dolmen.h>
  319.     int    Vfirst(VDO_PARAM *Mask, VDO_PARAM *Mode);
  320.  
  321.  
  322. Vnext ($47)
  323. -----------
  324.  
  325.   Next video mode
  326.  
  327.     ...
  328.   
  329.   parameters:
  330.     long: in-mask with the last handle found
  331.     long: out-array
  332.  
  333.   Answer:
  334.     D0=0: the array is full
  335.     D0=-1: no mode match.
  336.  
  337.   ASM 1: 
  338.     move.l    #Mode,-(sp)
  339.     move.l    #Mask,-(sp)
  340.     move.w    #$47,-(sp)
  341.     trap    #14
  342.     lea    10(sp),sp
  343.        
  344.   ASM 2:
  345.       include    XBIOS.EQU
  346.       
  347.     move.l    #Mode,-(sp)
  348.     move.l    #Mask,-(sp)
  349.       XBIOS    Vnext
  350.   C:        
  351.       #include    <dolmen.h>
  352.     int    Vnext(VDO_PARAM *Mask, VDO_PARAM *Mode);
  353.  
  354. Vvalid ($48)
  355. ------------
  356.  
  357.   Valid a video mode
  358.  
  359.     ...
  360.     
  361.   parameters:
  362.     word: handle to be tested.
  363.  
  364.   Answer:
  365.     D0=0 If the mode exist.
  366.     D0=-1 no mode for this hanlde.
  367.     
  368.   ASM 1: 
  369.     move.w    #Handle,-(sp)
  370.     move.w    #$48,-(sp)
  371.     trap    #14
  372.     addq.l    #4,sp
  373.        
  374.   ASM 2:
  375.       include    XBIOS.EQU
  376.       
  377.     move.w    #Handle,-(sp)
  378.       XBIOS    Vvalid
  379.   C:
  380.       #include    <dolmen.h>
  381.     int    Vvalid(int Handle);
  382.  
  383. Vload ($49)
  384. -----------
  385.  
  386.   Load VIDEO.DAT
  387.  
  388.     ...
  389.     
  390.   parameters:
  391.     Nothing
  392.  
  393.   Answer:
  394.     D0=0 : no error.
  395.     D0=-1 : file not found.
  396.  
  397.   ASM 1: 
  398.     move.w    #$49,-(sp)
  399.     trap    #14
  400.     addq.l    #2,sp
  401.        
  402.   ASM 2:
  403.       include    XBIOS.EQU
  404.       
  405.       XBIOS    Vload
  406.   C:
  407.       #include    <dolmen.h>
  408.     int    Vload(void);
  409.  
  410. Vsave ($4a)
  411. -----------
  412.  
  413.   Save VIDEO.DAT
  414.  
  415.     ...
  416.   
  417.   parameters:
  418.     Nothing
  419.  
  420.   Answer:
  421.     D0=0 : no error.
  422.     D0=-1 : save impossible.
  423.  
  424.   ASM 1: 
  425.     move.w    #$4a,-(sp)
  426.     trap    #14
  427.     addq.l    #2,sp
  428.        
  429.   ASM 2:
  430.       include    XBIOS.EQU
  431.       
  432.       XBIOS    Vsave
  433.   C:
  434.       #include    <dolmen.h>
  435.     int    Vsave(void);
  436.  
  437. Vopen ($4b)
  438. -----------
  439.  
  440.   Wake up the screen
  441.  
  442.     ...
  443.     
  444.   parameters:
  445.     Nothing
  446.  
  447.   Answer:
  448.     D0=0 : no error.
  449.     D0=-1 : improbable.
  450.  
  451.   ASM 1: 
  452.     move.w    #$4b,-(sp)
  453.     trap    #14
  454.     addq.l    #2,sp
  455.        
  456.   ASM 2:
  457.       include    XBIOS.EQU
  458.       
  459.       XBIOS    Vopen
  460.   C:
  461.       #include    <dolmen.h>
  462.     int    Vopen(void);
  463.  
  464. Vclose ($4c)
  465. ------------
  466.  
  467.   Shut down
  468.  
  469.     ...
  470.    
  471.   parameters:
  472.     Nothing
  473.  
  474.   Answer:
  475.     D0=0 : no error.
  476.     D0=-1 : improbable.
  477.  
  478.   ASM 1: 
  479.     move.w    #$4c,-(sp)
  480.     trap    #14
  481.     addq.l    #2,sp
  482.        
  483.   ASM 2:
  484.       include    XBIOS.EQU
  485.       
  486.       XBIOS    Vclose
  487.   C:
  488.       #include    <dolmen.h>
  489.     int    Vclose(void);
  490.  
  491. Vscroll ($4d)
  492. -------------
  493.  
  494.   Choose the method of scrolling
  495.  
  496.     ...
  497.     
  498.   parameters:
  499.     word: new methode to use
  500.  
  501.            0: edge scrolling (default methode)
  502.            1: proportionnal scrolling
  503.            2: focus scrolling
  504.  
  505.   Answer:
  506.     D0: the old methode
  507.  
  508.   ASM 1: 
  509.     move.w    #ScrollMode,-(sp)
  510.     move.w    #$4d,-(sp)
  511.     trap    #14
  512.     addq.l    #4,sp
  513.        
  514.   ASM 2:
  515.       include    XBIOS.EQU
  516.       
  517.     move.w    #ScrollMode,-(sp)
  518.       XBIOS    Vscroll
  519.   C:
  520.       #include    <dolmen.h>
  521.     int    Vscroll(int ScrollMode);
  522.  
  523.  
  524. Voffset ($4e)
  525. -------------
  526.  
  527.   Locating of the virtual screen
  528.  
  529.     It return the position in relation to the top left corner of the physical
  530.   screen in the virtual screen.
  531.     
  532.   parameters:
  533.     Nothing
  534.  
  535.   Answer:
  536.     D0 hold the actual position with x in the high word and y in the low
  537.        word.
  538.  
  539.  
  540.   ASM 1: 
  541.     move.w    #$4e,-(sp)
  542.     trap    #14
  543.     addq.l    #2,sp
  544.        
  545.   ASM 2:
  546.       include    XBIOS.EQU
  547.       
  548.       XBIOS    Voffset
  549.   C:
  550.       #include    <dolmen.h>
  551.     int    Voffset(void);
  552.  
  553. Vseek ($4f)
  554. -----------
  555.  
  556.   Locate the virtual screen
  557.  
  558.     ...
  559.  
  560.   parameters:
  561.     word: x
  562.     word: y
  563.  
  564.   Answer:
  565.     D0 hold the old position with x in the high word and y in the low
  566.        word.
  567.  
  568.  
  569.   ASM 1: 
  570.     move.w    #$4f,-(sp)
  571.     trap    #14
  572.     addq.l    #2,sp
  573.        
  574.   ASM 2:
  575.       include    XBIOS.EQU
  576.       
  577.       XBIOS    Vseek
  578.   C:
  579.       #include    <dolmen.h>
  580.       VPOS    result;
  581.         *(long *)&result = Vseek(10, 10);
  582.     
  583.     VPOS    Voffset(void);
  584.  
  585. Vlock ($50)
  586. -----------
  587.  
  588.   Lock the virtual screen
  589.  
  590.     ...
  591.  
  592.   parameters:
  593.     word: command
  594.          0: the mouse can move the virtual screen
  595.          1: the mouse can not mode the virtual screen
  596.  
  597.   Answer:
  598.     D0 the old configuration.
  599.  
  600.   ASM 1: 
  601.     move.w    #Cmd,-(sp)
  602.     move.w    #$50,-(sp)
  603.     trap    #14
  604.     addq.l    #4,sp
  605.        
  606.   ASM 2:
  607.       include    XBIOS.EQU
  608.       
  609.     move.w    #Cmd,-(sp)
  610.       XBIOS    Vlock
  611.   C:
  612.       #include    <dolmen.h>
  613.     int    Vlock(int Cmd);
  614.  
  615. SetMon ($51)
  616. ------------
  617.  
  618.   Set the monitor's kind
  619.  
  620.     ...
  621.  
  622.   parameters:
  623.     word: new kind of monitor
  624.            0: SM124 ( prehistorical screen of the ST )
  625.            1: RGB ( TV's like screen, ideal to make blind... )
  626.            2: VGA ( a real monitor to work! )
  627.            3: TV ( worst RGB, all user are blind... )
  628.  
  629.   Answer:
  630.     D0: the kind of screen.
  631.  
  632.   ASM 1: 
  633.     move.w    #MonType,-(sp)
  634.     move.w    #$51,-(sp)
  635.     trap    #14
  636.     addq.l    #4,sp
  637.        
  638.   ASM 2:
  639.       include    XBIOS.EQU
  640.       
  641.     move.w    #MonType,-(sp)
  642.       XBIOS    SetMon
  643.  
  644.   C:
  645.       #include    <dolmen.h>
  646.     int    SetMon(int MontType);
  647.  
  648. MultiMon ($52)
  649. --------------
  650.  
  651.   Multisynchro mode
  652.  
  653.     You can authorise the switch between RGB and VGA.
  654.  
  655.   parameters:
  656.     word:
  657.         0 : forbidden the switchs.
  658.         >0 : authorise the switchs.
  659.         -1: the actual mode.
  660.  
  661.   Answer:
  662.     D0: the old mode.
  663.  
  664.   ASM 1: 
  665.     move.w    #Cmd,-(sp)
  666.     move.w    #$52,-(sp)
  667.     trap    #14
  668.     addq.l    #4,sp
  669.        
  670.   ASM 2:
  671.       include    XBIOS.EQU
  672.       
  673.     move.w    #Cmd,-(sp)
  674.       XBIOS    MultiMon
  675.  
  676.   C:
  677.       #include    <dolmen.h>
  678.     int    MultiMon(int Cmd);
  679.  
  680. SizeComp ($53)
  681. --------------
  682.  
  683.   Vgetsize compatibility
  684.  
  685.     ...
  686.     
  687.   parameters:
  688.     word:
  689.         0 : return the real size of the original screen. Put the hight bit to 1
  690.             to return the extended size of the video mode.
  691.         >0 : return the extended size.
  692.         -1: the actual mode.
  693.  
  694.   Answer:
  695.     D0: the old mode.
  696.  
  697.   ASM 1: 
  698.     move.w    #$53,-(sp)
  699.     trap    #14
  700.     addq.l    #2,sp
  701.        
  702.   ASM 2:
  703.       include    XBIOS.EQU
  704.       
  705.       XBIOS    VSizeComp
  706.   C:
  707.       #include    <dolmen.h>
  708.     int    VSizeComp(void);
  709.  
  710. Vsize ($54)
  711. -----------
  712.  
  713.   Return the size of the screen
  714.  
  715.     This functions allow you to know the size of a screen with input
  716.   parameters.
  717.   
  718.     If you put -1 for handle, the current handle is take by default and
  719.   reference.
  720.   
  721.     The function read only the logical parameter (no if -1) and the virtual
  722.   flag (no if -1).
  723.  
  724.   Parameters:
  725.     Long: in-array
  726.  
  727.   Answer:
  728.     D0 hold the size in bytes.
  729.     0 for error (bad parameters ?!)
  730.  
  731.   ASM 1: 
  732.     move.l    #Mode,-(sp)
  733.     move.w    #$53,-(sp)
  734.     trap    #14
  735.     addq.l    #6,sp
  736.        
  737.   ASM 2:
  738.       include    XBIOS.EQU
  739.       
  740.       pea    Mode
  741.       XBIOS    Vsize
  742.   C:
  743.           To do ...
  744.           
  745. Vsetmode ($58)
  746. --------------
  747.  
  748.   Set a new resolution
  749.  
  750.     if the high bit of the video mode is put to 1, it run an extended screen
  751.   like Setscreen.
  752.  
  753.   parameters:
  754.     Mode (word): the new mode
  755.   Answer:
  756.     D0 (word): the old mode
  757.  
  758.   ASM 1: 
  759.     move.w    #ModeVideo,-(sp)
  760.     move.w    #$58,-(sp)
  761.     trap    #14
  762.     addq.l    #4,sp
  763.        
  764.   ASM 2:
  765.       include    XBIOS.EQU
  766.       
  767.     move.w    #ModeVideo,-(sp)
  768.       XBIOS    Vsetmode
  769.   C:
  770.       #include    <tos.h>
  771.  
  772.  
  773. Montype ($59)
  774. -------------
  775.  
  776.   What kind of monitor is connected
  777.  
  778.   parameters:
  779.     Nothing
  780.     
  781.   Answer:
  782.     D0 (word):
  783.              0 -> SM124
  784.              1 -> RGB screen
  785.              2 -> VGA screen
  786.              3 -> TV screen
  787.  
  788.   ASM 1: 
  789.     move.w    #$59,-(sp)
  790.     trap    #14
  791.     addq.l    #2,sp
  792.        
  793.   ASM 2:
  794.       include    XBIOS.EQU
  795.       
  796.       XBIOS    MonType
  797.  
  798.   C:
  799.       #include    <tos.h>
  800.  
  801. VsetSync ($5a)
  802. --------------
  803.  
  804.   Set the video synchronisation
  805.  
  806.     ...
  807.  
  808.   parameters:
  809.     External (word): xxxx xxxx xxxx xHVC
  810.                     x réservé (à 0)
  811.                     H: external horizontal synchronisation
  812.                     V: idem in vertical
  813.                     C: external clock
  814.  
  815.   Answer:
  816.     D0=0 : no error.
  817.     D0=-1 : improbable.
  818.  
  819.   ASM 1: 
  820.     move.w    #Sync,-(sp)
  821.     move.w    #$5a,-(sp)
  822.     trap    #14
  823.     addq.l    #4,sp
  824.        
  825.   ASM 2:
  826.       include    XBIOS.EQU
  827.       
  828.     move.w    #Sync,-(sp)
  829.       XBIOS    VsetSync
  830.   C:
  831.       #include    <tos.h>
  832.  
  833. VgetSize ($5b)
  834. --------------
  835.  
  836.   Return the size of the actual screen
  837.   
  838.     ...
  839.  
  840.   parameters:
  841.     word: video mode
  842.  
  843.   Answer:
  844.     D0 (long): the size in bytes
  845.     
  846.   ASM 1: 
  847.     move.w    #$5b,-(sp)
  848.     trap    #14
  849.     addq.l    #2,sp
  850.        
  851.   ASM 2:
  852.       include    XBIOS.EQU
  853.       
  854.       XBIOS    VgetSize
  855.  
  856.   C:
  857.       #include    <tos.h>
  858.  
  859. VmodeValid ($5f)
  860. ----------------
  861.  
  862.   Valid a video mode
  863.  
  864.     It's an hidden call of the TOS.
  865.  
  866.     ...
  867.   
  868.   parameters:
  869.     word: video mode.
  870.     
  871.   Answer:
  872.     D0: the goog video mode.
  873.  
  874.   ASM 1: 
  875.     move.w    #$5f,-(sp)
  876.     trap    #14
  877.     addq.l    #2,sp
  878.        
  879.   ASM 2:
  880.       include    XBIOS.EQU
  881.       
  882.       XBIOS    VmodeValid
  883.  
  884.   C:
  885.       #include    <tos.h>
  886.  
  887.                 *--------End of the functions----------*
  888.  
  889. *-------------------------------------------------------------------------*
  890. *        STRUCTURE OF VIDEO XBIOS
  891. *-------------------------------------------------------------------------*
  892.  
  893.         *----------*
  894.         * Structure of parameters for cookie "_VID"
  895.  
  896.         * the start is made for Dolmen
  897.         
  898.         RSRESET
  899.  
  900. sys_id        rs.l    1    ;name of the librairy or number
  901.                 ; ex: "_VID"
  902. sys_ver        rs.l    1    ;version of the librairy
  903.                 ; ex: 1.0.1 ($101)
  904. sys_date        rs.l    1    ;date of the librairy
  905.                 ; ex: $01061997(01/06/1997)
  906. sys_version    rs.l    1    ;pointeur to a text...
  907.  
  908. sys_install    rs.l    1    ;install rout of the driver
  909.  
  910. sys_open        rs.l    1    ;call at the start
  911.  
  912. sys_close        rs.l    1    ;...a the end
  913.                 
  914. sys_extend    rs.l    1    ;Local vars of the librairy
  915.  
  916.         *----------*
  917.         RSSET    sys_extend
  918.  
  919. vid_maj_vars    rs.l    1    ;pointeur of the main vars
  920. vid_cur_vars    rs.l    1    ;pointeur of the cur vars
  921.  
  922. vid_shut_down    rs.l    1    ;shut down rout
  923. vid_wake_up    rs.l    1    ;wake up rout
  924.  
  925.         *----------*
  926.  
  927. *-------------------------------------------------------------------------*
  928.  
  929.         *----------*
  930.         * Structure of parameters for cookie "CNTS"
  931.  
  932.         RSRESET
  933.  
  934. cnts_name        rs.l    1    ;name of the cookie
  935. cnts_version    rs.l    1    ;number of the version 
  936.                 ; ex: 1.0.1 ($101)
  937. cnts_kbd_on    rs.b    1    ;flag for keyboard wake up
  938. cnts_midi_on    rs.b    1    ;idem for midi
  939. cnts_mouse_on    rs.b    1    ;idem for mouse
  940. cnts_joy_on    rs.b    1    ;idem for joysticks
  941. cnts_tst_eco    rs.b    1    ;hotkeys to shut down
  942. cnts_turbo_on    rs.b    1    ;turbo mouse
  943.  
  944. *-------------------------------------------------------------------------*
  945.  
  946.         *-------------*
  947.         * CURENTS VARS
  948.         *-------------*
  949.  
  950.         RSRESET
  951.  
  952. vid_BUG_DAT    rs.b    1    ;error during load VIDEO.DAT
  953. vid_new_dat    rs.b    1    ;...
  954. vid_OK_VBL    rs.b    1    ;VBL flag
  955. vid_OK_TIMERC    rs.b    1    ;TIMERC flag
  956.  
  957. vid_monitor    rs.w    1    ;...
  958. vid_pal        rs.w    1    ;flag pal/ntsc
  959. vid_xbios_mode    rs.w    1    ;video mode system
  960. vid_cur_mode    rs.w    1    ;current video mode
  961.  
  962. vid_multisync    rs.b    1    ;...
  963. vid_size_comp    rs.b    1    ;...
  964.  
  965. vid_vdi_chg    rs.b    1    ;Initialise the VDI
  966. vid_col_chg    rs.b    1    ;...
  967. vid_palst        rs.b    1    ;...
  968.         
  969. vid_BIG_FLAG    rs.b    1    ;Virtual mode
  970. vid_SCROLL    rs.b    1    ;scoll...
  971. vid_newpos    rs.b    1    ;new coordinate
  972. vid_freeze    rs.b    1    ;no scrolling
  973.         rs.b    1    ;reserved
  974. vid_scroll_mth    rs.w    1    ;methode of scrolling from 0 to 2
  975.  
  976. vid_ECO_FLAG    rs.b    1    ;ECO mode run
  977.         rs.b    1    
  978.  
  979. vid_NIGHT_FLAG    rs.b    1    ;...
  980. vid_ENERGY_FLAG    rs.b    1    ;...
  981. vid_eco2_extinction    rs.b    1    ;...
  982. vid_eco2_night_flag    rs.b    1    ;...
  983.  
  984. vid_eco_delay    rs.l    1    ;...
  985. vid_eco2_delay    rs.l    1    ;...
  986. vid_eco_counter    rs.l    1    ;... 
  987.  
  988. *-------------------------------------------------------------------------*
  989.  
  990.         *-------------*
  991.         * VARIABLES PRINCIPALES
  992.         *-------------*
  993.  
  994.         RSRESET
  995.  
  996. vid_dat_adr    rs.l    1    ;...
  997. vid_dat_len    rs.l    1    ;...
  998. vid_dat_len_MAX    rs.l    1    ;...
  999. vid_cfg_adr    rs.l    1    ;...
  1000. max_handle    rs.w    1    ;...
  1001.  
  1002.         *-------------*
  1003.  
  1004. vid_cfg_param    rs.l    1    ;...
  1005.  
  1006. vid_screen_param    rs.l    1    ;...
  1007. vid_videl_param    rs.l    1    ;...
  1008.  
  1009. vid_phys_adr    rs.l    1    ;...
  1010. vid_log_adr    rs.l    1    :...
  1011.  
  1012.         *-------------*
  1013.         
  1014. vid_handle    rs.w    1    ;...
  1015.  
  1016. vid_phys_w    rs.w    1    ;...
  1017. vid_phys_h    rs.w    1    ;...
  1018. vid_plan        rs.w    1    ;...
  1019. vid_log_w        rs.w    1    ;...
  1020. vid_log_h        rs.w    1    ;...
  1021.  
  1022. vid_scrn_size    rs.l    1    ;...
  1023.         
  1024.         *-------------*
  1025.         * for virtual screen ...
  1026.  
  1027. vid_newx        rs.w    1    ;...
  1028. vid_newy        rs.w    1    ;...
  1029.  
  1030.         *-------------*
  1031.  
  1032. *-------------------------------------------------------------------------*
  1033.  
  1034.         *-------------*
  1035.         * Structure of .DAT file
  1036.         *-------------*
  1037.  
  1038.         * Hardware address
  1039.         
  1040. _HHT        EQU    $FFFF8282
  1041. _HBB        EQU    $FFFF8284
  1042. _HBE        EQU    $FFFF8286
  1043. _HDB        EQU    $FFFF8288
  1044. _HDE        EQU    $FFFF828A
  1045. _HSS        EQU    $FFFF828C
  1046. _HFS        EQU    $FFFF828E
  1047. _HEE        EQU    $FFFF8290
  1048.  
  1049. _VFT        EQU    $FFFF82A2
  1050. _VBB        EQU    $FFFF82A4
  1051. _VBE        EQU    $FFFF82A6
  1052. _VDB        EQU    $FFFF82A8
  1053. _VDE        EQU    $FFFF82AA
  1054. _VSS        EQU    $FFFF82AC
  1055.  
  1056. _VCO        EQU    $FFFF82C0
  1057. _VMODE        EQU    $FFFF82C2
  1058.  
  1059. _SYNC        EQU    $FFFF820A
  1060. _OFFSET        EQU    $FFFF820E
  1061. _VWRAP        EQU    $FFFF8210
  1062.  
  1063. _SHIFT        EQU    $FFFF8260
  1064. _SPSHIFT        EQU    $ffff8266
  1065.  
  1066.         * bits position
  1067.         
  1068. flag_80c        EQU    3
  1069. flag_vga        EQU    4
  1070. flag_pal        EQU    5
  1071. flag_over        EQU    6
  1072. flag_st        EQU    7
  1073. flag_vert        EQU    8
  1074. flag_eco2        EQU    9
  1075. flag_eco        EQU    10
  1076. flag_virt        EQU    11
  1077. flag_extclk    EQU    12
  1078. flag_ext        EQU    13
  1079. flag_std        EQU    14
  1080. flag_set        EQU    15
  1081.  
  1082.         * masks
  1083.             ;FSOPV8NNN
  1084. _cols        equ    %000000111
  1085. _80c        equ    %000001000
  1086. _vga        equ    %000010000
  1087. _pal        equ    %000100000
  1088. _over        equ    %001000000
  1089. _st        equ    %010000000
  1090. _vert        equ    %100000000
  1091. _eco2        equ    %1000000000
  1092. _eco        equ    %10000000000
  1093. _virt        equ    %100000000000
  1094. _extclk        equ    %1000000000000
  1095. _ext        equ    %10000000000000
  1096. _std        equ    %100000000000000
  1097. _set        equ    %1000000000000000
  1098.  
  1099.             ;FSOPV8NNN
  1100. _setmod        equ    %110111111
  1101. _setvga        equ    %110011111
  1102. _setrgb        equ    %110101111
  1103. _setext        equ    $fe00
  1104. _setopt        equ    _set+_eco+_eco2+_virt
  1105.  
  1106.         *-------------*
  1107.         * struture of DAT
  1108.         *-------------*
  1109.         * header 1.00
  1110.         
  1111.         RSRESET
  1112. dat_id        rs.l    1    ;name: "VDAT"
  1113.  
  1114. dat_ver        rs.w    1    ;version of the file
  1115. dat_head        rs.w    1    ;offset to the first mode
  1116.  
  1117. dat_multisync    rs.b    1    ;...
  1118. dat_size_comp    rs.b    1    ;...
  1119. dat_scroll    rs.b    1    ;...
  1120. dat_kbd_on    rs.b    1    ;...
  1121. dat_midi_on    rs.b    1    ;...
  1122. dat_mouse_on    rs.b    1    ;...
  1123. dat_joy_on    rs.b    1    ;...
  1124. dat_tst_eco    rs.b    1    ;...
  1125. dat_turbo_on    rs.b    1    ;...
  1126.  
  1127.         rs.b    1    ;reserved
  1128.         
  1129. dat_modes        rs.l    0    ;the first mode
  1130.  
  1131.         RSRESET
  1132. dat_offset    rs.w    1    ;offset to the next mode
  1133. dat_datas        rs.l    0    ;datas of the mode
  1134.  
  1135.         *-------------*
  1136.         * video mode 1.00
  1137.         *-------------*
  1138.         
  1139.         RSRESET
  1140. dat_mode        rs.w    1    ;mode code xxxx xxxF SOPV 8NNN
  1141.                 ; STANDARD:
  1142.                 ; bit 0 à 2: NNN (nombre de plan)
  1143.                 ;    0-> monochrome
  1144.                 ;    1-> 2 planes
  1145.                 ;    2-> 4 planes
  1146.                 ;    3-> 8 planes
  1147.                 ;    4-> 16 planes (Near True Color)
  1148.                 ; bit 3: Flag 80 colums (8)
  1149.                 ; bit 4: Flag VGA (V)
  1150.                 ; bit 5: Flag Pal (P)
  1151.                 ; bit 6: Flag overscan (O)
  1152.                 ; bit 7: Flag ST compatible (S)
  1153.                 ; bit 8: Flag Vertical (F)
  1154.                 ; ETENDU:
  1155.                 ; bit 9: energy star on/off
  1156.                 ; bit 10: screen saver on/off
  1157.                 ; bit 11: virtual screen on/off
  1158.                 ; bit 12: external clock 32/36MHz (CT2)
  1159.                 ; bit 13: external clock on/off
  1160.                 ; bit 14: standard resolution (not deletable)
  1161.                 ; bit 15: default video mode for old functions
  1162.  
  1163. dat_physx        rs.w    1    ;physical x
  1164. dat_physy        rs.w    1    ;physical y
  1165. dat_plan        rs.w    1    ;number of plane
  1166. dat_logx        rs.w    1    ;virtual x
  1167. dat_logy        rs.w    1    ;virtual y
  1168.  
  1169. dat_eco_delay    rs.w    1    ;delay in seconds
  1170. dat_eco2_delay    rs.w    1    ;delay in seconds
  1171.  
  1172.         * VIDEL registers
  1173. dat_videl        rs.l    0
  1174. dat_SPSHIFT    rs.w    1    ;...
  1175. dat_shift_write    rs.b    1    ;...
  1176. dat_SHIFT        rs.b    1    ;...
  1177. dat_VCO        rs.w    1    ;...
  1178. dat_VMODE        rs.w    1    ;...
  1179. dat_Hxx        rs.w    8    ;...
  1180. dat_Vxx        rs.w    6    ;...
  1181. dat_name        rs.b    33    ;comments
  1182.         rs.b    1    ;reserved (0)
  1183. dat_maxlength    rs.l    0    ;maximum lenght of a video mode
  1184.  
  1185.         *-------------*
  1186.  
  1187.  
  1188. *-------------------------------------------------------------------------*
  1189.  
  1190.         *-------------------*
  1191.         * Structure of an array for Vxxxx functions
  1192.         *-------------------*
  1193.         
  1194.         RSRESET
  1195.         
  1196. V_Hdl        rs.w    1    ;handle of video mode
  1197. V_mode        rs.w    1    ;Falcon video mode
  1198.  
  1199. V_physx        rs.w    1    ;physical width
  1200. V_physy        rs.w    1    ;physical height
  1201. V_plan        rs.w    1    ;planes number
  1202. V_logx        rs.w    1    ;virtual width
  1203. V_logy        rs.w    1    ;virtual height
  1204. v_eco        rs.w    1    ;eco delay
  1205. v_eco2        rs.w    1    ;Energy Star delay
  1206. V_name        rs.b    33    ;name of the mode (32 bytes)+0 for the end
  1207.         rs.b    1    ;reserved (0)
  1208. V_length        rs.l    0    ;len of the array
  1209.  
  1210. *-------------------------------------------------------------------------*
  1211.  
  1212.  
  1213.                       *----------END----------*
  1214.