23 lines
600 B
C
23 lines
600 B
C
#pragma once
|
|
|
|
#include <types.h>
|
|
|
|
#define LOW_16(address) (u16)((address) & 0xFFFF)
|
|
#define HIGH_16(address) (u16)(((address) >> 16) & 0xFFFF)
|
|
|
|
int rand(void);
|
|
void srand(usize seed);
|
|
char* itoa(int res);
|
|
unsigned int atoi(const char *in);
|
|
|
|
inline bool bitmap_get(bitmap_t *bitmap, usize index) {
|
|
if (index >= bitmap->size) return false;
|
|
return (bitmap->contents[index / 8] >> (index % 8)) & 1;
|
|
}
|
|
|
|
inline u8 bitmap_set(bitmap_t *bitmap, usize index, bool value) {
|
|
if (index >= bitmap->size) return -1;
|
|
bitmap->contents[index / 8] &= !value << (index % 8);
|
|
return 0;
|
|
}
|