Advertisement
glokyfull

c2p table halftone

Oct 6th, 2020
3,420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. c2p halftone table at the end
  4.  
  5. pcstart
  6.     jmp init
  7. ;usec2p
  8. ;   move.l d0,a6
  9. ;   move.l (a6),d4
  10. ;   move.l d1,a6
  11. ;   or.l (a6),d4
  12. ;   move.l d2,a6
  13. ;   move.l (a6),d5
  14. ;   move.l d3,a6
  15. ;   or.l (a6),d5
  16. ;   movep d4,0(a0)
  17. ;   movep d5,161(a0)
  18.  
  19. ; CODe that calculate c2phalftone   data
  20. ; once the value calculated in debugger
  21. ; it cost less byte to put the data directly in dc.l
  22. ; then no need for the code below and the c2ptable
  23. ;
  24. ; and the code is deprecated but i need to keep this routine for the futur
  25. init
  26.     move.l #$55555555,d2
  27.     move.l d2,d3
  28.     not.l d3
  29.    
  30.     lea c2ptable,a0
  31.     lea mem,a1
  32.     moveq #15,d7
  33.     move.l (a0)+,d0
  34. toto
  35.     move.l (a0)+,d1
  36.     move.l d0,(a1)+
  37.     move.l d0,d4
  38.     and.l d2,d4
  39.     move.l d1,d5
  40.     and.l d3,d5
  41.     or.l d4,d5
  42.     move.l d5,(a1)+
  43.    
  44.     move.l d1,d0
  45.     dbf d7,toto
  46.     illegal
  47. c2ptable    DC.L $00000000
  48.             DC.L $FF000000
  49.             DC.L $00FF0000
  50.             DC.L $FFFF0000
  51.             DC.L $0000FF00
  52.             DC.L $FF00FF00
  53.             DC.L $00FFFF00
  54.             DC.L $FFFFFF00
  55.             DC.L $000000FF
  56.             DC.L $FF0000FF
  57.             DC.L $00FF00FF
  58.             DC.L $FFFF00FF
  59.             DC.L $0000FFFF
  60.             DC.L $FF00FFFF
  61.             DC.L $00FFFFFF
  62.             DC.L $FFFFFFFF
  63. mem    
  64. c2phalftone
  65.             dc.l $00000000
  66.             dc.l $AA000000
  67.             dc.l $FF000000
  68.             dc.l $55AA0000
  69.             dc.l $00FF0000
  70.             dc.l $AAFF0000
  71.             dc.l $5555AA00
  72.             dc.l $0000FF00
  73.             dc.l $AA00FF00
  74.             dc.l $FF00FF00
  75.             dc.l $55AAFF00
  76.             dc.l $00FFFF00
  77.             dc.l $AAFFFF00
  78.             dc.l $FFFFFF00
  79.             dc.l $555555AA
  80.             dc.l $000000FF
  81.             dc.l $AA0000FF
  82.             dc.l $FF0000FF
  83.             dc.l $55AA00FF
  84.             dc.l $00FF00FF
  85.             Dc.l $AAFF00FF
  86.             DC.L $FFFF00FF
  87.             DC.L $5555AAFF
  88.             DC.L $0000FFFF
  89.             DC.L $AA00FFFF
  90.             DC.L $FF00FFFF
  91.             DC.L $55AAFFFF
  92.             DC.L $00FFFFFF
  93.             DC.L $AAFFFFFF
  94.             DC.L $FFFFFFFF
  95.            
  96.             dc.l $FFFFFFFF      ; repeated to have 32 value
  97.            
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement