Guest User

Untitled

a guest
Mar 7th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. Basic timing testing method:
  2.  
  3. ; a = register
  4. ; d = value
  5. WriteRegister:
  6. out (MSXMusic.ADDRESS),a
  7. REPT 13
  8. nop
  9. ENDM
  10. ld a,d
  11. out (MSXMusic.DATA),a
  12. ret
  13.  
  14. Reducing the REPT by 1 causes music playback glitches.
  15.  
  16. To test e.g. LD A,(IX), I did this:
  17.  
  18. ; a = register
  19. ; d = value
  20. WriteRegister:
  21. out (MSXMusic.ADDRESS),a
  22. ld a,(ix)
  23. REPT 13-7
  24. nop
  25. ENDM
  26. ld a,d
  27. out (MSXMusic.DATA),a
  28. ret
  29.  
  30. In the REPT, this value would not glitch, and if I changed the 7 to 8, it would.
  31.  
  32. Similarly, to test CALL, I did this:
  33.  
  34. ; a = register
  35. ; d = value
  36. WriteRegister:
  37. out (MSXMusic.ADDRESS),a
  38. call BLAAT
  39. ret
  40. BLAAT:
  41. REPT 13-8
  42. nop
  43. ENDM
  44. ld a,d
  45. out (MSXMusic.DATA),a
  46. ret
  47.  
  48. Changing the 8 to 9 would cause it to glitch.
Advertisement
Add Comment
Please, Sign In to add comment