rand.h
Go to the documentation of this file.
#ifndef RAND_INCLUDE
#define RAND_INCLUDE
#include <types.h>
#include <stdint.h>
#if defined(__PORT_sm83) || defined(__PORT_mos6502)
void initrand(uint16_t seed) OLDCALL;
#elif defined(__PORT_z80)
void initrand(uint16_t seed) Z88DK_FASTCALL;
#endif
#define RAND_MAX 255
#define RANDW_MAX 65535
extern uint16_t __rand_seed;
#if defined(__PORT_sm83)
uint8_t rand(void) OLDCALL PRESERVES_REGS(b, c);
#elif defined(__PORT_z80)
uint8_t rand(void) OLDCALL PRESERVES_REGS(b, c, iyh, iyl);
#elif defined(__PORT_mos6502)
uint8_t rand(void);
#endif
#if defined(__PORT_sm83)
uint16_t randw(void) OLDCALL PRESERVES_REGS(b, c);
#elif defined(__PORT_z80)
uint16_t randw(void) OLDCALL PRESERVES_REGS(b, c, iyh, iyl);
#elif defined(__PORT_mos6502)
uint16_t randw(void);
#endif
#if defined(__PORT_sm83) || defined(__PORT_mos6502)
void initarand(uint16_t seed) OLDCALL;
#elif defined(__PORT_z80)
void initarand(uint16_t seed) Z88DK_FASTCALL;
#endif
#if defined(__PORT_sm83)
uint8_t arand(void) OLDCALL PRESERVES_REGS(b, c);
#elif defined(__PORT_z80)
uint8_t arand(void) OLDCALL PRESERVES_REGS(b, c, iyh, iyl);
#elif defined(__PORT_mos6502)
uint8_t arand(void);
#endif
#endif
OLDCALL
#define OLDCALL
Definition: types.h:21
PRESERVES_REGS
#define PRESERVES_REGS(...)
Definition: types.h:32
Z88DK_FASTCALL
#define Z88DK_FASTCALL
Definition: types.h:47
b
void b
Definition: gb.h:748
iyl
static uint8_t iyl
Definition: metasprites.h:49
iyh
void iyh
Definition: msx.h:102
__rand_seed
uint16_t __rand_seed
arand
uint8_t arand(void) OLDCALL PRESERVES_REGS(b
c
uint8_t c
Definition: rand.h:54
initarand
void initarand(uint16_t seed) OLDCALL
initrand
void initrand(uint16_t seed) OLDCALL
rand
uint8_t rand(void) OLDCALL PRESERVES_REGS(b
randw
uint16_t randw(void) OLDCALL PRESERVES_REGS(b
stdint.h
uint16_t
unsigned short int uint16_t
Definition: stdint.h:52
uint8_t
unsigned char uint8_t
Definition: stdint.h:51
types.h