Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- csrand_init:
- ; ix = selected byte
- ; de = current deviation
- ; hl = starting address
- ; bc = bytes to check
- ; outputs: hl = address
- push ix
- ld ix, 0
- ld de, _max_deviation
- ld hl, $D65800
- ld bc, 513
- .test_range_loop:
- push bc
- push hl
- call _test_byte
- pop hl
- pop bc
- inc hl
- dec bc
- ld a,c
- or a,b
- jq nz,.test_range_loop
- push ix
- pop hl
- ld (_sprng_read_addr), hl
- add hl, de
- sbc hl, de
- jr nc, .retzero
- ld a, 1
- jr .return
- .retzero:
- xor a
- .return
- pop ix
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement