52,8 → 52,34 |
int out_size; |
}ioctl_t; |
|
static inline void begin_draw(void) |
{ |
__asm__ __volatile__( |
"int $0x40" ::"a"(12),"b"(1)); |
}; |
|
static inline |
void end_draw(void) |
{ |
__asm__ __volatile__( |
"int $0x40" ::"a"(12),"b"(2)); |
}; |
|
static inline |
void sys_create_window(int x, int y, int w, int h, const char *name, |
color_t workcolor, uint32_t style) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(0), |
"b"((x << 16) | ((w-1) & 0xFFFF)), |
"c"((y << 16) | ((h-1) & 0xFFFF)), |
"d"((style << 24) | (workcolor & 0xFFFFFF)), |
"D"(name), |
"S"(0) : "memory"); |
}; |
|
static inline |
void define_button(uint32_t x_w, uint32_t y_h, uint32_t id, uint32_t color) |
{ |
__asm__ __volatile__( |
64,49 → 90,75 |
"d"(id), |
"S"(color)); |
}; |
static inline void DefineButton(void) __attribute__ ((alias ("define_button"))); |
|
static inline |
uint32_t get_skin_height(void) |
void draw_line(int xs, int ys, int xe, int ye, color_t color) |
{ |
uint32_t height; |
__asm__ __volatile__( |
"int $0x40" |
::"a"(38), "d"(color), |
"b"((xs << 16) | xe), |
"c"((ys << 16) | ye)); |
} |
|
static inline |
void draw_bar(int x, int y, int w, int h, color_t color) |
{ |
__asm__ __volatile__( |
"int $0x40 \n\t" |
:"=a"(height) |
:"a"(48),"b"(4)); |
return height; |
}; |
static inline uint32_t GetSkinHeight(void) __attribute__ ((alias ("get_skin_height"))); |
"int $0x40" |
::"a"(13), "d"(color), |
"b"((x << 16) | w), |
"c"((y << 16) | h)); |
} |
|
static inline |
void BeginDraw(void) |
void draw_bitmap(void *bitmap, int x, int y, int w, int h) |
{ |
__asm__ __volatile__( |
"int $0x40" ::"a"(12),"b"(1)); |
}; |
"int $0x40" |
::"a"(7), "b"(bitmap), |
"c"((w << 16) | h), |
"d"((x << 16) | y)); |
} |
|
static inline |
void EndDraw(void) |
void draw_text_sys(const char *text, int x, int y, int len, color_t color) |
{ |
__asm__ __volatile__( |
"int $0x40" ::"a"(12),"b"(2)); |
}; |
"int $0x40" |
::"a"(4),"d"(text), |
"b"((x << 16) | y), |
"S"(len),"c"(color) |
:"memory"); |
} |
|
static inline void DrawWindow(int x, int y, int w, int h, const char *name, |
color_t workcolor, uint32_t style) |
static inline |
uint32_t get_skin_height(void) |
{ |
uint32_t height; |
|
__asm__ __volatile__( |
"int $0x40" |
::"a"(0), |
"b"((x << 16) | ((w-1) & 0xFFFF)), |
"c"((y << 16) | ((h-1) & 0xFFFF)), |
"d"((style << 24) | (workcolor & 0xFFFFFF)), |
"D"(name), |
"S"(0) : "memory"); |
"int $0x40 \n\t" |
:"=a"(height) |
:"a"(48),"b"(4)); |
return height; |
}; |
|
static inline void BeginDraw(void) __attribute__ ((alias ("begin_draw"))); |
static inline void EndDraw(void) __attribute__ ((alias ("end_draw"))); |
static inline void DrawWindow(int x, int y, int w, int h, const char *name, |
color_t workcolor, uint32_t style) |
__attribute__ ((alias ("sys_create_window"))); |
static inline void DefineButton(void) __attribute__ ((alias ("define_button"))); |
static inline void DrawLine(int xs, int ys, int xe, int ye, color_t color) |
__attribute__ ((alias ("draw_line"))); |
static inline void DrawBar(int x, int y, int w, int h, color_t color) |
__attribute__ ((alias ("draw_bar"))); |
static inline void DrawBitmap(void *bitmap, int x, int y, int w, int h) |
__attribute__ ((alias ("draw_bitmap"))); |
static inline uint32_t GetSkinHeight(void) __attribute__ ((alias ("get_skin_height"))); |
|
|
#define POS_SCREEN 0 |
#define POS_WINDOW 1 |
|
122,7 → 174,6 |
:"a"(37),"b"(origin)); |
return val; |
} |
static inline pos_t GetMousePos(int origin) __attribute__ ((alias ("get_mouse_pos"))); |
|
static inline |
uint32_t get_mouse_buttons(void) |
135,7 → 186,6 |
:"a"(37),"b"(2)); |
return val; |
}; |
static inline uint32_t GetMouseButtons(void) __attribute__ ((alias ("get_mouse_buttons"))); |
|
static inline |
uint32_t get_mouse_wheels(void) |
148,8 → 198,47 |
:"a"(37),"b"(7)); |
return val; |
}; |
|
static inline uint32_t load_cursor(void *path, uint32_t flags) |
{ |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(37), "b"(4), "c"(path), "d"(flags)); |
return val; |
} |
|
static inline uint32_t set_cursor(uint32_t cursor) |
{ |
uint32_t old; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(old) |
:"a"(37), "b"(5), "c"(cursor)); |
return old; |
}; |
|
static inline int destroy_cursor(uint32_t cursor) |
{ |
int ret; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(ret) |
:"a"(37), "b"(6), "c"(cursor) |
:"memory"); |
return ret; |
}; |
|
static inline pos_t GetMousePos(int origin) __attribute__ ((alias ("get_mouse_pos"))); |
static inline uint32_t GetMouseButtons(void) __attribute__ ((alias ("get_mouse_buttons"))); |
static inline uint32_t GetMouseWheels(void) __attribute__ ((alias ("get_mouse_wheels"))); |
|
static inline uint32_t LoadCursor(void *path, uint32_t flags) __attribute__ ((alias ("load_cursor"))); |
static inline uint32_t SetCursor(uint32_t cursor) __attribute__ ((alias ("set_cursor"))); |
static inline int DestroyCursor(uint32_t cursor) __attribute__ ((alias ("destroy_cursor"))); |
|
|
static inline |
uint32_t wait_for_event(uint32_t time) |
{ |
252,49 → 341,6 |
}; |
|
|
static inline |
void draw_line(int xs, int ys, int xe, int ye, color_t color) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(38), "d"(color), |
"b"((xs << 16) | xe), |
"c"((ys << 16) | ye)); |
} |
|
|
|
static inline |
void draw_bar(int x, int y, int w, int h, color_t color) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(13), "d"(color), |
"b"((x << 16) | w), |
"c"((y << 16) | h)); |
} |
|
static inline |
void draw_bitmap(void *bitmap, int x, int y, int w, int h) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(7), "b"(bitmap), |
"c"((w << 16) | h), |
"d"((x << 16) | y)); |
} |
|
static inline |
void draw_text_sys(const char *text, int x, int y, int len, color_t color) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(4),"d"(text), |
"b"((x << 16) | y), |
"S"(len),"c"(color) |
:"memory"); |
} |
|
static inline void yield(void) |
{ |
__asm__ __volatile__( |
320,7 → 366,6 |
:"a"(68),"b"(12),"c"(size)); |
return val; |
} |
static inline void *UserAlloc(size_t size) __attribute__ ((alias ("user_alloc"))); |
|
static inline |
int user_free(void *mem) |
332,9 → 377,21 |
:"a"(68),"b"(13),"c"(mem)); |
return val; |
} |
static inline int UserFree(void *mem) __attribute__ ((alias ("user_free"))); |
|
static inline |
void* user_realloc(void *mem, size_t size) |
{ |
void *val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(68),"b"(20),"c"(size),"d"(mem) |
:"memory"); |
|
return val; |
}; |
|
static inline |
int *user_unmap(void *base, size_t offset, size_t size) |
{ |
int *val; |
344,6 → 401,10 |
:"a"(68),"b"(26),"c"(base),"d"(offset),"S"(size)); |
return val; |
}; |
|
static inline void *UserAlloc(size_t size) __attribute__ ((alias ("user_alloc"))); |
static inline int UserFree(void *mem) __attribute__ ((alias ("user_free"))); |
static inline void* UserRealloc(void *mem, size_t size) __attribute__ ((alias ("user_realloc"))); |
static inline int *UserUnmap(void *base, size_t offset, size_t size) __attribute__ ((alias ("user_unmap"))); |
|
typedef union |
356,7 → 417,6 |
unsigned long long raw; |
}ufile_t; |
|
|
static inline ufile_t load_file(const char *path) |
{ |
ufile_t uf; |
381,44 → 441,7 |
return retval; |
} |
|
static inline |
uint32_t load_cursor(void *path, uint32_t flags) |
{ |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(37), "b"(4), "c"(path), "d"(flags)); |
return val; |
} |
static inline |
uint32_t LoadCursor(void *path, uint32_t flags) __attribute__ ((alias ("load_cursor"))); |
|
static inline |
uint32_t set_cursor(uint32_t cursor) |
{ |
uint32_t old; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(old) |
:"a"(37), "b"(5), "c"(cursor)); |
return old; |
}; |
static inline uint32_t SetCursor(uint32_t cursor) __attribute__ ((alias ("set_cursor"))); |
|
static inline |
int destroy_cursor(uint32_t cursor) |
{ |
int ret; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(ret) |
:"a"(37), "b"(6), "c"(cursor) |
:"memory"); |
return ret; |
}; |
static inline int DestroyCursor(uint32_t cursor) __attribute__ ((alias ("destroy_cursor"))); |
|
static inline void get_proc_info(char *info) |
{ |
__asm__ __volatile__( |
429,22 → 452,7 |
}; |
static inline void GetProcInfo(char *info) __attribute__ ((alias ("get_proc_info"))); |
|
static inline |
void* user_realloc(void *mem, size_t size) |
{ |
void *val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(68),"b"(20),"c"(size),"d"(mem) |
:"memory"); |
|
return val; |
}; |
static inline void* UserRealloc(void *mem, size_t size) __attribute__ ((alias ("user_realloc"))); |
|
void *get_resource(void *data, uint32_t id); |
|
struct blit_call |
{ |
int dstx; |
483,6 → 491,8 |
::"a"(73),"b"(0),"c"(&bc.dstx)); |
}; |
|
int create_thread(int (*proc)(void *param), void *param, int stack_size); |
|
void* load_library(const char *name); |
|
void* get_proc_address(void *handle, const char *proc_name); |