disp.src 459 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ;;
  2. ;; setPixel() function.
  3. ;; Sets the color of a pixel on the screen.
  4. ;;
  5. .global _setPixel
  6. _setPixel:
  7. mov.l #127,r1
  8. cmp/hi r1,r4
  9. bt end
  10. mov.l #63,r1
  11. cmp/hi r1,r5
  12. bt end
  13. mov r4,r0
  14. shll2 r5
  15. shll2 r5
  16. mov #-3,r1
  17. shld r1,r4
  18. add r4,r7
  19. add r5,r7
  20. mov.b @r7,r1
  21. mov #7,r2
  22. and r0,r2
  23. neg r2,r2
  24. mov.l #128,r3
  25. shld r2,r3
  26. tst r6,r6
  27. bt white
  28. black:
  29. or r3,r1
  30. rts
  31. mov.b r1,@r7
  32. white:
  33. not r3,r3
  34. and r3,r1
  35. rts
  36. mov.b r1,@r7
  37. end:
  38. rts
  39. nop
  40. .end