So, okay. I just noticed that I had no idea of how to get a random
number. I took Marcus' Tetris out, but it looks like he's
implementing his own. I only sorta know how RNGs work; not well
enough to write my own in a high-level language, and certainly not in
ASM, which I'm just now learning. I can't follow Marcus' RNG without
comments, I think.
What's more, when I go and look for RNGs, I tend to get big complex
ones that are suitable for mathematicians, or for statisticians, or
for cryptographers - things that it would just be stupid to implement
on the VMU. The basic ones that are built into most languages are
sufficient for things like this, and thus don't seem to get
duplicated
often enough for me to find them on the World Wide Mess.
I was wondering if anyone has a good, simple RNG? I'd like to have
an
8-bit and a 16-bit one, but if the 8-bit one has a good distribution
(or however you'd say that), it seems like I ought to be able to
juststick two outputs together and call it a bigger variable, and
there I am.
If not, does anyone know where there's a reasonable overview on the
web somewhere of how RNGs work, so I can try to create my own? If
they give examples, I'd really prefer something normal like C,
Pascal,
Lisp, or shell, or something; ALGOL-90 isn't going to do me any good
(I say this only because I can't find an example in a normal
language,
so this may well be a useful differentiation to make).
On a seperate note, I'm beginning to wrestle with the notion of
having
to actually plan *where* my variables go. Out of all of the examples
I have, the addresses pretty much don't coincide - this guy uses $30,
that guy uses $40, and so on.
I'm a little worried because I don't know how to figure out how big
the code that my instructions are going to create is, and my project
is going to use a *lot* of instructions; how do I make sure that the
instructions don't run into the space I've got defined for my
variables? will the assembler move around them, or do I have to take
that into account?
One thing that occurred to me would be to begin defining variables at
the end of the possible program space, and move towards the
beginning.
That way, the only problem that would ever occur is if the two don't
fit together, and then I know what the nessecary solution is
immediately (no "maybe I can just move this here..."-ing).
I've seen people do some pad thing with nop to $200; is that them
putting no-ops in up to the address $200, implicating $200 as the
point to start defining backwards from? Am I reading that wrong?
Lastly, does anyone have any clue how to get two VMUs to talk to each
other over the link?
Thanks.
- StoneCypher