Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. ld de,vram+x+y*320
  2.  
  3. Boucle:
  4. push de
  5. call _getkey
  6. pop de
  7.  
  8. di ; Disable OS interrupts
  9. ld hl,0F50200h
  10. ld (hl),h ; Set Single Scan mode
  11.  
  12. xor a,a
  13. scan_wait:
  14. cp a,(hl) ; Wait for Idle mode
  15. jr nz,scan_wait
  16.  
  17. ; Read data registers here as needed
  18. ld l,$1E
  19. bit 0,(hl) ;down
  20. call routinedown
  21.  
  22. bit 1,(hl) ;left
  23. call routineleft
  24.  
  25. bit 2,(hl) ;right
  26. call routineright
  27.  
  28. bit 3,(hl) ;up
  29. call routineup
  30.  
  31. jr Boucle
  32.  
  33. ret
  34.  
  35. routineright:
  36. inc de
  37. ld hl,sprite
  38. ld a,8
  39. spriteb:
  40. ld bc,x
  41. ldir
  42. ld bc,320-x
  43. ex de,hl
  44. add hl,bc
  45. ex de,hl
  46. dec a
  47. jr nz,Spriteb
  48. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement