home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmiSoft / Dev / asm / DemoStartUP.lha / DemoStartUPv1.0 / sources / aslscrmodereq.asm < prev    next >
Encoding:
Assembly Source File  |  2000-12-28  |  1.8 KB  |  121 lines

  1.     xdef    _AslCgxModeRequester
  2.     xdef    _displayid
  3.  
  4.     xref    _DosBase
  5.     xref    _IntuitionBase
  6.     xref    _GfxBase
  7.     xref    _CyberGfxBase
  8.  
  9.     include    "basemacros.i"
  10.  
  11.     incdir    include:
  12.  
  13.     include utility/tagitem.i
  14.  
  15.     include LVO/exec_lib.i
  16.     include    LVO/cybergraphics_lib.i
  17.     include    LVO/asl_lib.i
  18.  
  19.     include    libraries/asl.i
  20.  
  21.     include cybergraphx/cybergraphics.i
  22.  
  23. _AslCgxModeRequester
  24.  
  25.     ;Open asl.library
  26.     lea.l    ASLName(pc),a1
  27.     moveq.l    #39,d0
  28.     callExe    OpenLibrary
  29.     move.l    d0,_AslBase
  30.     beq.w    .noasl
  31.  
  32.     ;Allocate ASL requester
  33.     move.l    #ASL_ScreenModeRequest,d0
  34.     lea    aslreqtaglist,a0
  35.     callAsl    AllocAslRequest
  36.     move.l    d0,aslrequest
  37.     beq.s    .closeasl
  38.  
  39.     ;Show ASL requester
  40.     move.l    aslrequest(pc),a0
  41.     move.l    #0,a1
  42.     callAsl    AslRequest
  43.     move.l    #0,_displayid
  44.     tst.l    d0
  45.     beq.w    .closeasl
  46.  
  47.     move.l    aslrequest(pc),a0
  48.     move.l    sm_DisplayID(a0),_displayid
  49.  
  50. .closeasl
  51.         ;Close asl.library
  52.     move.l    _AslBase(pc),a1
  53.     callExe    CloseLibrary
  54. .noasl
  55.     rts
  56.  
  57. ASLName    dc.b    'asl.library',0
  58.     even
  59. _AslBase dc.l     0
  60.  
  61. aslrequest
  62.     dc.l    0
  63.  
  64. aslreqtaglist
  65.     dc.l    ASLSM_TitleText,asl_title
  66.     dc.l    ASLSM_FilterFunc,smfilterhook
  67.     dc.l    TAG_END
  68.  
  69. asl_title
  70.     dc.b    'Select CGX/P96 screen mode (320x256)',0
  71.     even
  72. smfilterhook
  73.     dc.l    0,0
  74.     dc.l    smfilterfunc
  75.     dc.l    0,0
  76.  
  77.  
  78. smfilterfunc
  79.     move.l    a1,_displayid
  80.  
  81.     ;Check if it is CGX mode
  82.     move.l    a1,d0
  83.     callCgx    IsCyberModeID
  84.         tst.l    d0
  85.         beq.s    .false
  86.  
  87.     ;Check if it is LUT8
  88.     move.l    #CYBRIDATTR_PIXFMT,d0
  89.     move.l    _displayid,d1
  90.     callCgx    GetCyberIDAttr
  91.     cmp.l    #PIXFMT_LUT8,d0
  92.     bne.s   .false
  93.  
  94.     rept    0
  95.  
  96.     ;Check if width is 320
  97.     move.l  #CYBRIDATTR_WIDTH,d0
  98.     move.l  _displayid,d1
  99.     callCgx    GetCyberIDAttr
  100.     cmp.l   #SCREEN_WIDTH,d0
  101.     bne.s   .false
  102.  
  103.     ;Check if height is 256
  104.     move.l    #CYBRIDATTR_HEIGHT,d0
  105.     move.l    _displayid,d1
  106.     callCgx    GetCyberIDAttr
  107.     cmp.l    #SCREEN_HEIGHT,d0
  108.     bne.s    .false
  109.  
  110.     endr
  111.  
  112.     moveq    #TRUE,d0
  113.     rts
  114. .false
  115.     moveq    #FALSE,d0
  116.     rts
  117.  
  118. _displayid
  119.     dc.l    0
  120.  
  121.