Advertisement
AnthonyCagliano

Untitled

Apr 5th, 2022
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. csrand_init:
  2. ; ix = selected byte
  3. ; de = current deviation
  4. ; hl = starting address
  5. ; bc = bytes to check
  6. ; outputs: hl = address
  7. push ix
  8. ld ix, 0
  9. ld de, _max_deviation
  10. ld hl, $D65800
  11. ld bc, 513
  12. .test_range_loop:
  13. push bc
  14. push hl
  15. call _test_byte
  16. pop hl
  17. pop bc
  18. inc hl
  19. dec bc
  20. ld a,c
  21. or a,b
  22. jq nz,.test_range_loop
  23. push ix
  24. pop hl
  25. ld (_sprng_read_addr), hl
  26. add hl, de
  27. sbc hl, de
  28. jr nc, .retzero
  29. ld a, 1
  30. jr .return
  31. .retzero:
  32. xor a
  33. .return
  34. pop ix
  35. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement