Converted to PIXI and added SA-1 compatibility. Added a screenshot and tags.
The two included shooters have been marked more clearly. The random version has been made more user-friendly (swapping the minimum and maximum interval will not cause problems anymore and making them equal will result in an error because the fixed shooter is better suited for that case).
First of all, I must be apologize to you.
Because I proposed formula as solution, but it will be biassed to low values when range is bigger.
Fortunately, you had used my code in this sprite. so I did change code as follow.
STA $4204 ; \
STZ $4205 ; |
STY $4206 ; | calculate RNG%(Max-Min+1)+Min,
NOP #6 ; | it answer is between from Min to Max.
LDA.b #!timeMin ; |
CLC ; |
ADC $4216 ; /
STA $4202 ;\
STY $4203 ; |
NOP #2 ; | calculate (Max-Min+1)*RNG/256+Min,
LDA.b #!timeMin ; | it answer is between from Min to Max.
CLC ; |
ADC $4217 ;/
This code won't be big biassed like previous code. [explanatory diagram]
Technically, this formula even will be biassed to specific value. but it's better than previous code at least.