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 / main.asm < prev    next >
Encoding:
Assembly Source File  |  2001-05-02  |  1.9 KB  |  136 lines

  1.  
  2. ;- [ MAIN loop ] -
  3.  
  4. ;///XDEF
  5.     xdef    _Main
  6.     xdef    _fx
  7.     xdef    _chunky
  8.     xdef    _starttime
  9.     xdef    _timer
  10. ;///
  11. ;///XREF
  12.     xref    _CGX
  13.     xref    _blit
  14.     xref    _window
  15.     xref    _newpal
  16.     xref    _gettime
  17.     xref    _P61_Pos
  18. ;///
  19. ;///Include
  20.     include    basemacros.i
  21.  
  22.         incdir    include:
  23.  
  24.     include    intuition/intuition.i
  25.     include LVO/exec_lib.i
  26.     include    LVO/intuition_lib.i
  27.     include    LVO/graphics_lib.i
  28. ;///
  29. ;///time macro
  30. time    macro
  31.     jsr    _gettime
  32.     move.l    _starttime,d1
  33.     sub.l    d1,d0
  34.     move.l    d0,_timer
  35.     endm
  36. ;///
  37.  
  38. _Main
  39.     ;Initialization
  40.     ;-------------------------------[ init ]---------------------
  41.  
  42.         ;Set palette
  43.     lea    pal,a0
  44.     move.l    a0,_newpal    
  45.  
  46.  
  47.     ;Initialize timer
  48.     jsr    _gettime
  49.     move.l    d0,_starttime
  50.  
  51.  
  52.  
  53.     bsr.s    ShowTESTPic
  54.  
  55.     
  56.         ;Main demo loop
  57. .mainloop
  58.         move.w    _P61_Pos,_fx
  59.  
  60.     move.w    _fx,d0
  61.     bne.s    .fx1
  62. .fx0    ;-------------------------------[ fx #0 ]--------------------
  63.  
  64.     ;do the first effect
  65.  
  66.     bra.s    .refresh
  67.     
  68. .fx1    ;-------------------------------[ fx #1 ]--------------------
  69.     cmp.w    #1,d0
  70.     bne.s    .fx2
  71.  
  72.         ;do the second effect
  73.  
  74.     bra.s    .refresh
  75.  
  76. .fx2    ;-------------------------------[ fx #2 ]--------------------
  77.  
  78.     ;...
  79.     ;...
  80.  
  81.  
  82.  
  83.  
  84.     ;--------------------------[ refresh screen ]----------------
  85. .refresh
  86.         ;Blit graphics
  87.     lea    _chunky,a0
  88.     jsr     _blit
  89.  
  90.         ;Check for pressed mouse buttons/close window
  91.     move.l    _window,a0
  92.     move.l    wd_UserPort(a0),a0
  93.     callExe    GetMsg
  94.     tst.l    d0
  95.     bne.s    .getout
  96.  
  97.     bra.s    .mainloop
  98. .getout
  99.     rts
  100.  
  101.  
  102. _starttime
  103.     dc.l    0
  104. _timer     dc.l     0
  105.  
  106. _fx    dc.w    0
  107.  
  108. ;--------------------------------[ effects ]-------------------
  109. ;///ShowTESTPic
  110. ShowTESTPic
  111.     lea    _chunky,a0
  112.     lea    pic,a1
  113.  
  114.         move.w    #320*250/4-1,d0
  115. .l      move.l    (a1)+,(a0)+
  116.         dbf    d0,.l
  117.  
  118.     
  119.         rts
  120. ;///
  121. ;--------------------------------[ various data ]--------------
  122.  
  123. ;///Test Graphics
  124.     even
  125. pal    incbin  gfx/test.pal
  126. pic    incbin    gfx/test.chunky
  127. ;///
  128.     section bss,bss
  129. ;///_chunky
  130.     ds.b    320*10    ;SECURITY AREA 4 BAD CODERS ;>
  131. _chunky    ds.b    320*256
  132.     ds.b    320*10  ;SECURITY AREA
  133. ;///
  134.  
  135.  
  136.