|
Post by Chris on Mar 6, 2002 20:48:33 GMT -5
i'm working on an asm slots program, i've already made a BASIC version of this program, but i'm going to try to make a version with decent speed, but i still need to know somethings...first off, how do i use 9-byte vars in asm (and i don't mean loading BASIC vars into the program), how do you do random number, and how do u do program write back (i need to save the cash)
|
|
|
Post by Jbirk on Mar 7, 2002 19:25:41 GMT -5
The number in reg A is usually random.
|
|
|
Post by Chris on Mar 7, 2002 19:28:19 GMT -5
i mean the bcall(_) for it
|
|
|
Post by Jbirk on Mar 9, 2002 2:40:35 GMT -5
I don't remember it, but You can always read the source to another asm program that creates random numbers.
|
|
|
Post by Chris on Mar 9, 2002 7:32:04 GMT -5
yeah, but i don't really like looking at other people's source, it's like looking at other people's BASIC programs when i could barely program...it doesn't make any difference, cause i didn't understand it anyway
|
|
|
Post by David L on Mar 9, 2002 12:14:47 GMT -5
There isn't any random rom call that will store a number in a register. You would have to write your own routine or borrow someone elses.
|
|
|
Post by Chris on Mar 9, 2002 22:10:25 GMT -5
really? maybe it was an ion call then
|
|
|
Post by Jbirk on Mar 10, 2002 4:03:26 GMT -5
David knows how to do it, but I don't.
|
|
|
Post by David L on Mar 11, 2002 12:42:03 GMT -5
I'm feeling to lazy to create a random number routine right now, but I can give you some hints:
If you have APD enabled, the byte at (apdsubtimer) will change value all the time.
|
|
|
Post by Jbirk on Mar 16, 2002 18:12:41 GMT -5
Oh, yeah, it decrements all the time!
|
|
|
Post by Jbirk on Mar 16, 2002 18:13:19 GMT -5
The only problem is that everytime you press a key the random number generator will be reset.
|
|
|
Post by David L on Mar 17, 2002 4:09:27 GMT -5
Yes, you're right. The APD is usually disabled in asm games, so I now realize that we have to use another method. The interrupt register 'R' decrements/increments after each Z80 instruction; maybe you could use it in a random number routine.
|
|
|
Post by Chris on Mar 17, 2002 14:44:26 GMT -5
ok, but what about using vars other than registers?
|
|
|
Post by Jbirk on Mar 24, 2002 6:00:34 GMT -5
Whats wrong with registers?
Maybe you should disassemble TI-OS and legally borrow the assembly commands that make up the randint( function.
|
|
|
Post by David L on Mar 24, 2002 11:45:16 GMT -5
That wouldn't be a good idea...
|
|