Advertisement
Runer112

Untitled

Jul 10th, 2011
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;###################################
  2.  
  3. #define FWAIT   in f, (c) \ jp m, $-2
  4.  
  5. grayCopy:
  6.     push    ix
  7.     ld  a, (grayB)
  8.     ld  b,a
  9.     ld  de, (grayDE)
  10.     ld  c, $10
  11.  
  12.     ld  a, $80
  13.     ld  ixl, a
  14.  
  15. outerGray:
  16.     FWAIT
  17.     out ($10), a
  18.  
  19.     ld  a, $20
  20.     FWAIT
  21.     out ($10), a
  22.  
  23.     ld  ixh, 4
  24.  
  25. grayLoop:
  26.     ld  a, (hl)
  27.     inc hl
  28.     xor (hl)
  29.     and b
  30.     xor (hl)
  31.     inc hl
  32.    
  33.     FWAIT
  34.     out ($11), a
  35.  
  36.     ld  a, (hl)
  37.     inc hl
  38.     xor (hl)
  39.     and d
  40.     xor (hl)
  41.     inc hl
  42.  
  43.     FWAIT
  44.     out ($11), a
  45.  
  46.     ld  a, (hl)
  47.     inc hl
  48.     xor (hl)
  49.     and e
  50.     xor (hl)
  51.     inc hl
  52.    
  53.     FWAIT
  54.     out ($11), a
  55.  
  56.     dec ixh
  57.     jp  nz, grayLoop
  58.  
  59.     ld  a, b
  60.     ld  b, d
  61.     ld  d, e
  62.     ld  e, a
  63.  
  64.     inc ixl
  65.     ld  a, ixl
  66.     cp  C0h
  67.     jp  c,outerGray
  68.  
  69.  
  70.  
  71. grayQuit:
  72.     ld  a,b
  73.     ld  (grayB), a
  74.     ld  (grayDE), de
  75.     pop ix
  76.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement