home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / LEDGERS / LEDG_04.MSA / UTILS / ACCESSOR.YS / RATTRAP.ACC < prev   
Text File  |  1985-11-20  |  3KB  |  129 lines

  1. .l    (a1)+,(a2)+
  2.     move.l    (a1)+,(a2)+
  3.     move.l    (a1)+,(a2)+    ; quick draw onto logical
  4.     move.l    (a1)+,(a2)+
  5.     move.l    (a1)+,(a2)+
  6.     move.l    (a1)+,(a2)+
  7.     move.l    (a1)+,(a2)+
  8.     dbra    d0,.qdraw
  9.  
  10. scan:    cmpi.b    #$1,$fffffc02.w    ; wait for ESC
  11.     beq.s    exit
  12.     bra.s    scan
  13.  
  14. * and now we exit...
  15. exit:    pea    gempal(pc)
  16.     call    6,14,6
  17.     pea    on(pc)
  18.     clr.w    -(sp)        ; mousey on
  19.     call    $19,14,8
  20.     move.b    #-1,$484.w    ; Restore console vectors
  21.     move.w    rez(pc),-(sp)    ; Back to old resolution
  22.     move.l    $44e.w,-(sp)
  23.     move.l    $44e.w,-(sp)
  24.     call    5,14,12
  25.     move.l    oldssp(pc),-(sp)
  26.     call    $20,1,6        ; User mode
  27.     pea    0
  28.     call    $4c,1        ; Function 'P_Term'
  29.  
  30.  
  31. ; the de-packing code !
  32. tiny:    movem.l    d1-d6/a2-a5,-(sp)
  33.     bsr    t_getpal        ; read resolution and palette
  34.     move.l    a4,d5
  35.     move.l    a1,d6
  36.     addi.l    #$7d00,d6
  37.     move.l    a1,d4
  38.     addi.l    #$a0,d4
  39.     bra.s    t17a0a
  40. t179be:    moveq    #0,d0
  41.     move.b    (a5)+,d0
  42.     beq.s    t179ce
  43.     cmpi.b    #1,d0
  44.     beq.s    t179d6
  45.     ext.w    d0
  46.     bra.s    t179de
  47. t179ce:    move.b    (a5)+,d0
  48.     lsl.w    #8,d0
  49.     move.b    (a5)+,d0
  50.     bra.s    t179de
  51. t179d6:    move.b    (a5)+,d0
  52.     lsl.w    #8,d0
  53.     move.b    (a5)+,d0
  54.     neg.w    d0
  55. t179de:    tst.w    d0
  56.     bmi.s    t179ea
  57.     move.b    (a4)+,d3
  58.     lsl.w    #8,d3
  59.     move.b    (a4)+,d3
  60.     bra.s    t17a2e
  61. t179ea:    neg.w    d0
  62.     bra.s    t17a06
  63. t179ee:    move.b    (a4)+,(a1)+
  64.     move.b    (a4)+,(a1)+
  65.     lea    $9e(a1),a1
  66.     cmpa.l    d6,a1
  67.     blt.s    t17a06
  68.     lea    $ffff8308(a1),a1
  69.     cmp.l    d4,a1
  70.     blt.s    t17a06
  71.     lea    $ffffff62(a1),a1
  72. t17a06:    dbra    d0,t179ee
  73. t17a0a:    cmp.l    d5,a5
  74.     blt.s    t179be
  75.     moveq    #1,d0
  76. t_end:    movem.l    (sp)+,d1-d6/a2-a5
  77.     rts
  78. t17a18:    move.w    d3,(a1)+
  79.     lea    $9e(a1),a1
  80.     cmp.l    d6,a1
  81.     blt.s    t17a2e
  82.     lea    $ffff8308(a1),a1
  83.     cmp.l    d4,a1
  84.     blt.s    t17a2e
  85.     lea    $ffffff62(a1),a1
  86. t17a2e:    dbra    d0,t17a18
  87.     cmpa.l    d5,a5
  88.     blt.s    t179be
  89.     moveq    #1,d0
  90.     movem.l    (sp)+,d1-d6/a2-a5
  91.     rts
  92.  
  93. ; find out resolution and palette
  94. t_getpal: cmpi.b    #2,(a0)+        ; Color mode?
  95.     ble.s    t_color
  96.     addq.l    #4,a0
  97. t_color:    moveq    #31,d0        ; install palette
  98.     lea    tinpal(pc),a2
  99. t_copypal:move.b    (a0)+,(a2)+
  100.     dbra    d0,t_copypal
  101.     move.b    (a0)+,d1
  102.     lsl.w    #8,d1
  103.     move.b    (a0)+,d1
  104.     addq.l    #2,a0
  105.     movea.l    a0,a5        ; beginning of Data
  106.     ext.l    d1
  107.     adda.l    d1,a0
  108.     movea.l    a0,a4        ; end of Data
  109.     moveq    #1,d0
  110.     rts
  111.  
  112.  
  113. *    Constants & values    *
  114.     section    bss
  115. oldssp:    ds.l    1
  116. rez:    ds.w    1
  117. tinpal:    ds.w    16
  118.  
  119.     section    data
  120. off:    even
  121.     dc.b    $12,0
  122. on:    dc.b    $8,0
  123. gempal:    even    ; 4th color = $770 for low res. !
  124.     dc.w    $777,$700,$070,$000,$007,$707,$077,$555
  125.     dc.w    $333,$733,$373,$773,$337,$737,$377,$000
  126.     even
  127. picture:    incbin    a:\tiny\union.tn4
  128.     even