home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / testi / corsoasm / sorgenti_darkcoder / include / mvstartup.s < prev    next >
Encoding:
Text File  |  1998-02-19  |  2.6 KB  |  151 lines

  1. ************************************
  2. *       /\/\                       *
  3. *      /    \                      *
  4. *     / /\/\ \ O R B_I D           *
  5. *    / /    \ \   / /              *
  6. *   / /    __\ \ / /               *
  7. *   ¯¯     \ \¯¯/ / I S I O N S    *
  8. *           \ \/ /                 *
  9. *            \  /                  *
  10. *             \/                   *
  11. *     Feel the DEATH inside!       *
  12. ************************************
  13.  
  14. * Simple startup for Infamia
  15.  
  16.     include    include/custom.i
  17.     include    include/exec_lib.i
  18.     include    include/graphics_lib.i
  19.  
  20. ***********************
  21. *   Codice generale   *
  22. ***********************
  23.  
  24. custom = $dff000
  25.  
  26. StartUp:
  27.     move.l    $4.w,a6
  28.  
  29.     btst    #0,$129(a6)        ; setta flag se c'e` 68010
  30.     sne    FlagCpu            ; o superiore
  31.  
  32.     beq.s    .done            ; se 68000 non legge VBR
  33.     lea    supercode(pc),a5
  34.     jsr    _LVOSupervisor(a6)    ; altrimenti leggi VBR
  35. .done
  36.  
  37.     jsr    _LVODisable(a6)
  38.  
  39.     lea    GfxName(pc),a1
  40.     moveq    #0,d0
  41.     jsr    _LVOOpenLibrary(a6)
  42.     move.l    a6,a4
  43.     move.l    d0,a6
  44.  
  45.     move.l    34(a6),-(a7)        ; gb_Actiview
  46.     move.l    d0,-(a7)
  47.  
  48.     jsr    _LVOOwnBlitter(a6)
  49.     jsr    _LVOWaitBlit(a6)
  50.  
  51.     sub.l    a1,a1
  52.     jsr    _LVOLoadView(a6)
  53.     jsr    _LVOWaitTOF(a6)
  54.     jsr    _LVOWaitTOF(a6)
  55.  
  56.     lea    custom,a5
  57. .wait    move.l    vposr(a5),d0
  58.     lsr.l    #8,d0
  59.     and    #$1FF,d0
  60.     cmp    #$132,d0
  61.     bne.s    .wait
  62.  
  63.     move    intenar(a5),-(a7)
  64.     move    #$7fff,intena(a5)
  65.     move    dmaconr(a5),-(a7)
  66.     move    #$7fff,dmacon(a5)
  67.     move    adkconr(a5),-(a7)
  68.     move    #$7fff,adkcon(a5)
  69.  
  70. ; salva il vettore int. livello 3 dell'OS
  71.     move.l    StoreVBR(pc),a0
  72.     move.l    $6c(a0),-(a7)
  73.  
  74. ; aga-reset
  75.     move    #0,fmode(a5)
  76.     move.w    #$0c00,bplcon3(a5)
  77.     move    #$0011,bplcon4(a5)
  78.  
  79.     bsr    Start
  80.  
  81. ; A5=$dff000
  82. Uscita
  83.     move    #$7fff,d2
  84.     move    d2,intena(a5)    ; blocca interrupt
  85.  
  86. ; ripristina vettore int. livello 3 dell'OS
  87.     move.l    StoreVBR(pc),a0
  88.     move.l    (a7)+,$6c(a0)
  89.  
  90.  
  91. .wait    move.l    vposr(a5),d0
  92.     lsr.l    #8,d0
  93.     and    #$1FF,d0
  94.     cmp    #$132,d0
  95.     bne.s    .wait
  96.  
  97.     move    #$8000,d1
  98.     move    (a7)+,d0
  99.     or    d1,d0
  100.     move    d2,adkcon(a5)
  101.     move    d0,adkcon(a5)
  102.  
  103. .waitblit
  104.     btst    #6,dmaconr(a5)        ; niente test preliminare
  105.     bne.s    .waitblit        ; si tratta di un bug OCS
  106.  
  107.     move    d2,dmacon(a5)
  108.     move    (a7)+,d0
  109.     or    d1,d0
  110.     move    d0,dmacon(a5)
  111.  
  112.     move    d2,intreq(a5)
  113.     move    (a7)+,d0
  114.     or    d1,d0
  115.     move    d0,intena(a5)
  116.  
  117.     move.l    (a7)+,a6
  118.     move.l    (a7)+,a1
  119.     jsr    _LVOLoadView(a6)
  120.  
  121.     move.l    38(a6),cop1lc(a5)    ; legge gb_copinit
  122.  
  123.     jsr    _LVODisownBlitter(a6)
  124.  
  125.     move.l    a6,a1
  126.     move.l    $4.w,a6
  127.     jsr    _LVOCloseLibrary(a6)
  128.  
  129.     jsr    _LVOEnable(a6)
  130.  
  131.     moveq    #0,d0
  132.     rts
  133.  
  134. **************************
  135. * Routine che legge il VBR 
  136. * e lo memorizza in
  137. * StoreVBR
  138.  
  139.     cnop    0,4
  140. SuperCode:
  141.     movec    VBR,a0
  142.     move.l    a0,StoreVBR
  143.     rte
  144.  
  145. * dati
  146. StoreVBR    dc.l    0        ; contenuto registro VBR
  147. GfxName    dc.b    'graphics.library',0    ; nome GFX library
  148. FlagCpu    dc.b    0            ; se settato cpu 68010 o superiore
  149.  
  150.  
  151.