home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / gms_dev.lha / GMS / Source / Asm / Screens / HiResScreen.s < prev    next >
Encoding:
Text File  |  1997-01-10  |  2.7 KB  |  120 lines

  1. ;-------T-------T------------------------T---------------------------------;
  2. ;HiRes Interlaced Picture Display
  3. ;--------------------------------
  4. ;Opens a screen in HIRES and LACED modes.  You can even try SuperHiRes
  5. ;(SHIRES) if you change the appropriate flag in the GameScreen structure.
  6.  
  7.     INCDIR    "INCLUDES:"
  8.     INCLUDE    "exec/exec_lib.i"
  9.     INCLUDE    "games/games_lib.i"
  10.     INCLUDE    "games/games.i"
  11.  
  12. CALL    MACRO
  13.     jsr    _LVO\1(a6)
  14.     ENDM
  15.  
  16.     SECTION    "HiResLaced",CODE
  17.  
  18. ;===========================================================================;
  19. ;                             INITIALISE DEMO
  20. ;===========================================================================;
  21.  
  22. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  23.     move.l    ($4).w,a6
  24.     lea    GMS_Name(pc),a1
  25.     moveq    #$00,d0
  26.     CALL    OpenLibrary
  27.     move.l    d0,GMS_Base
  28.     beq.s    .Error_GMS
  29.  
  30.     move.l    GMS_Base(pc),a6
  31.     sub.l    a0,a0
  32.     CALL    SetUserPrefs
  33.  
  34.     lea    Screen(pc),a0
  35.     CALL    AddScreen
  36.     tst.l    d0
  37.     bne.s    .Error_Screen
  38.  
  39.     lea    Picture(pc),a1
  40.     move.l    GS_MemPtr1(a0),PIC_Data(a1)
  41.     CALL    LoadPic
  42.     tst.w    d0
  43.     bne.s    .Error_Picture
  44.  
  45.     move.l    PIC_Palette(a1),GS_Palette(a0)
  46.     CALL    UpdatePalette
  47.  
  48.     CALL    ShowScreen
  49.  
  50.     bsr.s    Main
  51.  
  52. .ReturnToDOS
  53.     move.l    GMS_Base(pc),a6
  54.     lea    Picture(pc),a1
  55.     CALL    FreePic
  56. .Error_Picture
  57.     move.l    GMS_Base(pc),a6
  58.     lea    Screen(pc),a0
  59.     CALL    DeleteScreen
  60. .Error_Screen
  61.     move.l    GMS_Base(pc),a1
  62.     move.l    ($4).w,a6
  63.     CALL    CloseLibrary
  64. .Error_GMS
  65.     MOVEM.L    (SP)+,A0-A6/D1-D7
  66.     moveq    #$00,d0
  67.     rts
  68.  
  69. ;===========================================================================;
  70. ;                                MAIN LOOP
  71. ;===========================================================================;
  72.  
  73. Main:    CALL    WaitSVBL
  74.     moveq    #JPORT1,d0
  75.     CALL    ReadMouse
  76.     btst    #MB_LMB,d0
  77.     beq.s    Main
  78.     rts
  79.  
  80. ;===========================================================================;
  81. ;                                  DATA
  82. ;===========================================================================;
  83.  
  84. GMS_Name:
  85.     dc.b    "games.library",0
  86.     even
  87. GMS_Base:
  88.     dc.l    0
  89.  
  90. AMT_PLANES =    4
  91.  
  92. Screen:    dc.l    GSV1,0
  93.     dc.l    0,0,0    ;Screen memory 1/2/3.
  94.     dc.l    0    ;Screen link.
  95.     dc.l    0    ;Address of palette.
  96.     dc.l    0    ;Address of rasterlist.
  97.     dc.l    16    ;Amount of colours in palette.
  98.     dc.w    640,256    ;Screen Width and Height. 
  99.     dc.w    0,0,0    ;Picture Widths and Height.
  100.     dc.w    AMT_PLANES    ;Amount of planes.
  101.     dc.w    0,0    ;X/Y screen offset.
  102.     dc.w    0,0    ;X/Y picture offset.
  103.     dc.l    CENTRE    ;Special attributes.
  104.     dc.w    HIRES|COL12BIT|LACED    ;Screen mode.
  105.     dc.w    ILBM    ;Screen type
  106.     even
  107.  
  108. Picture    dc.l    PCV1,0    ;Version header.
  109.     dc.l    0    ;Source data.
  110.     dc.w    640,0,256    ;Width, Height.
  111.     dc.w    AMT_PLANES    ;Amount of Planes.
  112.     dc.l    16    ;Amount of colours.
  113.     dc.l    0    ;Source palette (remap).
  114.     dc.w    HIRES|COL12BIT    ;Screen mode.
  115.     dc.w    ILBM    ;Destination
  116.     dc.l    GETPALETTE    ;Parameters.
  117.     dc.l    .File
  118. .File    dc.b    "GAMESLIB:data/IFF.Pic640x256",0
  119.     even
  120.