gbemu/include/common.h

20 lines
454 B
C
Raw Normal View History

2025-01-30 14:30:19 -07:00
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
#define BIT(a, n) ((a & (1 << n)) ? 1 : 0)
2025-01-31 17:07:09 -07:00
#define BIT_SET(a, n, on) {if(on) a |= (1 << n); else a &= ~(1 << n);}
2025-01-30 14:30:19 -07:00
#define BETWEEN(a, b, c) ((a >= b) && (a <= c))
2025-01-30 16:27:27 -07:00
void delay(u32 ms);
2025-02-01 00:48:49 -07:00
u32 get_ticks();
2025-01-30 16:27:27 -07:00
#define NO_IMPL { fprintf(stderr, "NOT YET IMPLEMENTED\n"); exit(-5); }