home *** CD-ROM | disk | FTP | other *** search
/ Supremacy 1 / Supremacy-1.iso / DEMOS / G-H / GSC65.ZIP / SOURCES / TINY.S < prev   
Encoding:
Text File  |  1986-02-05  |  1.9 KB  |  94 lines

  1. ; Source for unpacking Tiny-pictures - Written by Axe of Delight
  2. ; Assemble with Devpac 2.08, Tab-position: 10
  3. ; You need source (packed tiny screen) and destination (screen address)
  4. ; for unpacking. After unpacking, the palette is saved at tinpal.
  5.  
  6.     lea    source,a0    ; source
  7.     lea    destination,a1    ; destination
  8.     bsr    tiny
  9.  
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11. tiny:    movem.l    d1-d6/a2-a5,-(sp)
  12.     bsr    t_getpal        ; read resolution and palette
  13.     move.l    a4,d5
  14.     move.l    a1,d6
  15.     add.l    #$7d00,d6
  16.     move.l    a1,d4
  17.     add.l    #$a0,d4
  18.     bra.s    t17a0a
  19. t179be:    moveq    #0,d0
  20.     move.b    (a5)+,d0
  21.     beq.s    t179ce
  22.     cmp.b    #1,d0
  23.     beq.s    t179d6
  24.     ext.w    d0
  25.     bra.s    t179de
  26. t179ce:    move.b    (a5)+,d0
  27.     lsl.w    #8,d0
  28.     move.b    (a5)+,d0
  29.     bra.s    t179de
  30. t179d6:    move.b    (a5)+,d0
  31.     lsl.w    #8,d0
  32.     move.b    (a5)+,d0
  33.     neg.w    d0
  34. t179de:    tst.w    d0
  35.     bmi.s    t179ea
  36.     move.b    (a4)+,d3
  37.     lsl.w    #8,d3
  38.     move.b    (a4)+,d3
  39.     bra.s    t17a2e
  40. t179ea:    neg.w    d0
  41.     bra.s    t17a06
  42. t179ee:    move.b    (a4)+,(a1)+
  43.     move.b    (a4)+,(a1)+
  44.     lea    $9e(a1),a1
  45.     cmp.l    d6,a1
  46.     blt.s    t17a06
  47.     lea    $ffff8308(a1),a1
  48.     cmp.l    d4,a1
  49.     blt.s    t17a06
  50.     lea    $ffffff62(a1),a1
  51. t17a06:    dbf    d0,t179ee
  52. t17a0a:    cmp.l    d5,a5
  53.     blt.s    t179be
  54.     moveq    #1,d0
  55. t_end:    movem.l    (sp)+,d1-d6/a2-a5
  56.     rts
  57. t17a18:    move.w    d3,(a1)+
  58.     lea    $9e(a1),a1
  59.     cmp.l    d6,a1
  60.     blt.s    t17a2e
  61.     lea    $ffff8308(a1),a1
  62.     cmp.l    d4,a1
  63.     blt.s    t17a2e
  64.     lea    $ffffff62(a1),a1
  65. t17a2e:    dbf    d0,t17a18
  66.     cmp.l    d5,a5
  67.     blt.s    t179be
  68.     moveq    #1,d0
  69.     movem.l    (sp)+,d1-d6/a2-a5
  70.     rts
  71.  
  72. t_getpal: cmpi.b    #2,(a0)+        ; Color mode?
  73.     ble.s    t_color
  74.     addq.l    #4,a0
  75. t_color:    moveq    #31,d0        ; install palette
  76.     lea    tinpal(pc),a2
  77. t_copypal:move.b    (a0)+,(a2)+
  78.     dbra    d0,t_copypal
  79.     move.b    (a0)+,d1
  80.     lsl.w    #8,d1
  81.     move.b    (a0)+,d1
  82.     addq.l    #2,a0
  83.     movea.l    a0,a5        ; beginning of Data
  84.     ext.l    d1
  85.     adda.l    d1,a0
  86.     movea.l    a0,a4        ; end of Data
  87.     moveq    #1,d0
  88.     rts
  89.  
  90. tinpal:    ds.w 16
  91. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  92.  
  93.  
  94.