|
libtonc
|
Modules | |
| DMA | |
| Timer | |
Macros | |
| #define | STR(x) #x |
| #define | XSTR(x) STR(x) |
| Create text string from a literal. | |
Variables | |
| const u8 | oam_sizes [3][4][2] |
| const BG_AFFINE | bg_aff_default |
| COLOR * | vid_page |
| int | __qran_seed |
Sector checking | |
| u32 | octant (int x, int y) |
| Get the octant that (x, y) is in. | |
| u32 | octant_rot (int x0, int y0) |
| Get the rotated octant that (x, y) is in. | |
Random numbers | |
| int | sqran (int seed) |
| Quick (and very dirty) pseudo-random number generator. | |
| INLINE int | qran (void) |
| Quick (and very dirty) pseudo-random number generator. | |
| INLINE int | qran_range (int min, int max) |
| Ranged random number. | |
| #define | QRAN_SHIFT 15 |
| Quick (and very dirty) pseudo-random number generator. | |
| #define | QRAN_MASK ((1<<QRAN_SHIFT)-1) |
| Quick (and very dirty) pseudo-random number generator. | |
| #define | QRAN_MAX QRAN_MASK |
| Quick (and very dirty) pseudo-random number generator. | |
| #define QRAN_MASK ((1<<QRAN_SHIFT)-1) |
Quick (and very dirty) pseudo-random number generator.
| #define QRAN_MAX QRAN_MASK |
Quick (and very dirty) pseudo-random number generator.
| #define QRAN_SHIFT 15 |
Quick (and very dirty) pseudo-random number generator.
| u32 octant | ( | int | x, |
| int | y | ||
| ) |
Get the octant that (x, y) is in.
This function divides the circle in 8 parts. The angle starts at the y=0 line and then moves in the direction of the x=0 line. On the screen, this would be like starting at the 3 o'clock position and moving clockwise
| u32 octant_rot | ( | int | x0, |
| int | y0 | ||
| ) |
Get the rotated octant that (x, y) is in.
Like octant() but with a twist. The 0-octant starts 22.5° earlier so that 3 o'clock falls in the middle of octant 0, instead of at its start. This can be useful for 8 directional pointing.
| INLINE int qran | ( | void | ) |
Quick (and very dirty) pseudo-random number generator.
References QRAN_MAX.
Referenced by qran_range().
| INLINE int qran_range | ( | int | min, |
| int | max | ||
| ) |
Ranged random number.
References max(), min(), qran(), and QRAN_SHIFT.