22 #ifndef MADS_CORE_GENERAL_H 23 #define MADS_CORE_GENERAL_H 25 #include "common/stream.h" 32 #define aggressive true 45 static constexpr
size_t SIZE = 3;
53 typedef byte PaletteMap[256][3];
55 #define pal_color(p,i,c) (*(((byte *)&p[i])+c)) 63 #define far_string(v,s) char _based(_segname("FARSTRING")) v[] = s; 70 extern long _timer_clock;
71 #define clock_address (&_timer_clock) 72 #define dos_timer_address (&_timer_clock) 74 #define interrupt_controller 0x20 75 #define end_of_interrupt 0x20 77 #define timer_controller 0x43 78 #define timer_channel_0 0x40 79 #define timer_channel_1 0x41 80 #define timer_channel_2 0x42 84 #define timer_speed_600 1880 85 #define timer_speed_300 3920 86 #define timer_speed_60 19600 96 #define mcga_video (byte *)g_engine->getScreen()->getPixels() 98 #define text_mode 0x03 99 #define mono_text_mode 0x07 100 #define tandy_mode 0x09 101 #define ega_mode 0x0d 102 #define mcga_mode 0x13 104 #define secret_video_area ((color_text_video) + (PACK_EXPLODE_SIZE)) 105 #define secret_video_size (32768L - PACK_EXPLODE_SIZE) 109 #define dos_memory (byte *)0x00400013 110 #define abs_memory (byte *)0x00400015 113 #define yes true //(-1) 120 constexpr
int none = 0;
121 constexpr
int stop = 99;
126 #define getrandom( min, max ) ((rand() % (int)(((max)+1) - (min))) + (min)) 129 #define hibyte(x) ( (byte) ( (x) >> 8 ) ) 130 #define lobyte(x) ( (byte) ( ( (word) ( (x) << 8 ) ) >> 8 ) ) 132 #define neg(x) ((~(x))+1) 133 #define abs(x) ( ((x)>0) ? (x) : neg(x) ) 135 #define sgn(x) ( ((x)>0) ? 1 : ( ((x)<0) ? -1 : 0 ) ) 136 #define sign(x) ( ((x) > 0.0) ? 1 : ( ((x) < 0.0) ? -1 : 0 ) ) 138 #define sgn_in(x,s) ( ((s) >= 0) ? (x) : (neg(x)) ) 140 inline char *mads_strupr(
char *str) {
141 for (
char *s = str; *s; ++s)
146 inline char *mads_strlwr(
char *str) {
147 for (
char *s = str; *s; ++s)
152 inline char *mads_itoa(
int value,
char *buffer,
int radix) {
158 inline void mads_fullpath(
char *buffer,
const char *path, uint bufferCount) {
161 inline char *mads_getcwd(
char *buffer,
int count) {
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
byte readByte()
Definition: stream.h:434
Definition: anim_timer.h:27
void strcpy_s(char *dst, size_t size, const char *src)
Definition: atari-screen.h:42