1,6 → 1,7 |
#ifndef __KOS_32_SYS_H__ |
#define __KOS_32_SYS_H__ |
|
|
#include <newlib.h> |
#include <stdint.h> |
#include <stddef.h> |
11,8 → 12,6 |
// #define DBG(format,...) |
//#endif |
|
#define TYPE_3_BORDER_WIDTH 5 |
|
typedef unsigned int color_t; |
|
typedef union __attribute__((packed)) |
62,18 → 61,6 |
}; |
|
static inline |
uint32_t get_skin_height(void) |
{ |
uint32_t height; |
|
__asm__ __volatile__( |
"int $0x40 \n\t" |
:"=a"(height) |
:"a"(48),"b"(4)); |
return height; |
} |
|
static inline |
void BeginDraw(void) |
{ |
__asm__ __volatile__( |
87,7 → 74,7 |
"int $0x40" ::"a"(12),"b"(2)); |
}; |
|
static inline void DrawWindow(int x, int y, int w, int h, const char *name, |
static inline void DrawWindow(int x, int y, int w, int h, char *name, |
color_t workcolor, uint32_t style) |
{ |
|
94,8 → 81,8 |
__asm__ __volatile__( |
"int $0x40" |
::"a"(0), |
"b"((x << 16) | ((w-1) & 0xFFFF)), |
"c"((y << 16) | ((h-1) & 0xFFFF)), |
"b"((x << 16) | (w & 0xFFFF)), |
"c"((y << 16) | (h & 0xFFFF)), |
"d"((style << 24) | (workcolor & 0xFFFFFF)), |
"D"(name)); |
}; |
172,16 → 159,6 |
return val; |
}; |
|
static inline uint32_t get_os_event() |
{ |
uint32_t val; |
__asm__ __volatile__( |
"int $0x40" |
:"=a"(val) |
:"a"(10)); |
return val; |
}; |
|
static inline |
uint32_t get_tick_count(void) |
{ |