Rev 5024 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5024 | Rev 5061 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | __asm__ __volatile__( |
69 | __asm__ __volatile__( |
70 | "int $0x40 \n\t" |
70 | "int $0x40 \n\t" |
71 | :"=a"(height) |
71 | :"=a"(height) |
72 | :"a"(48),"b"(4)); |
72 | :"a"(48),"b"(4)); |
73 | return height; |
73 | return height; |
74 | } |
74 | }; |
- | 75 | static inline uint32_t GetSkinHeight(void) __attribute__ ((alias ("get_skin_height"))); |
|
Line 75... | Line 76... | ||
75 | 76 | ||
76 | static inline |
77 | static inline |
77 | void BeginDraw(void) |
78 | void BeginDraw(void) |
78 | { |
79 | { |
Line 99... | Line 100... | ||
99 | "d"((style << 24) | (workcolor & 0xFFFFFF)), |
100 | "d"((style << 24) | (workcolor & 0xFFFFFF)), |
100 | "D"(name), |
101 | "D"(name), |
101 | "S"(0)); |
102 | "S"(0)); |
102 | }; |
103 | }; |
Line 103... | Line -... | ||
103 | - | ||
104 | static inline |
- | |
105 | pos_t get_mouse_pos(void) |
- | |
106 | { |
- | |
107 | pos_t val; |
- | |
108 | - | ||
109 | __asm__ __volatile__( |
104 | |
110 | "int $0x40 \n\t" |
105 | #define POS_SCREEN 0 |
111 | "rol $16, %%eax" |
- | |
112 | :"=a"(val) |
- | |
113 | :"a"(37),"b"(1)); |
- | |
114 | return val; |
- | |
Line 115... | Line 106... | ||
115 | } |
106 | #define POS_WINDOW 1 |
116 | 107 | ||
117 | static inline |
108 | static inline |
118 | pos_t get_cursor_pos(void) |
109 | pos_t get_mouse_pos(int origin) |
Line 119... | Line 110... | ||
119 | { |
110 | { |
120 | pos_t val; |
111 | pos_t val; |
121 | 112 | ||
122 | __asm__ __volatile__( |
113 | __asm__ __volatile__( |
123 | "int $0x40 \n\t" |
114 | "int $0x40 \n\t" |
124 | "rol $16, %%eax" |
115 | "rol $16, %%eax" |
125 | :"=a"(val) |
116 | :"=a"(val) |
- | 117 | :"a"(37),"b"(origin)); |
|
Line 126... | Line 118... | ||
126 | :"a"(37),"b"(0)); |
118 | return val; |
127 | return val; |
119 | } |
128 | } |
120 | static inline pos_t GetMousePos(int origin) __attribute__ ((alias ("get_mouse_pos"))); |
129 | 121 | ||
Line 136... | Line 128... | ||
136 | "int $0x40" |
128 | "int $0x40" |
137 | :"=a"(val) |
129 | :"=a"(val) |
138 | :"a"(37),"b"(2)); |
130 | :"a"(37),"b"(2)); |
139 | return val; |
131 | return val; |
140 | }; |
132 | }; |
- | 133 | static inline uint32_t GetMouseButtons(void) __attribute__ ((alias ("get_mouse_buttons"))); |
|
Line 141... | Line 134... | ||
141 | 134 | ||
142 | static inline |
135 | static inline |
143 | uint32_t get_mouse_wheels(void) |
136 | uint32_t get_mouse_wheels(void) |
144 | { |
137 | { |
Line 148... | Line 141... | ||
148 | "int $0x40 \n\t" |
141 | "int $0x40 \n\t" |
149 | :"=a"(val) |
142 | :"=a"(val) |
150 | :"a"(37),"b"(7)); |
143 | :"a"(37),"b"(7)); |
151 | return val; |
144 | return val; |
152 | }; |
145 | }; |
- | 146 | static inline uint32_t GetMouseWheels(void) __attribute__ ((alias ("get_mouse_wheels"))); |
|
Line 153... | Line 147... | ||
153 | 147 | ||
154 | static inline |
148 | static inline |
155 | uint32_t wait_for_event(uint32_t time) |
149 | uint32_t wait_for_event(uint32_t time) |
156 | { |
150 | { |
Line 179... | Line 173... | ||
179 | "int $0x40" |
173 | "int $0x40" |
180 | :"=a"(val) |
174 | :"=a"(val) |
181 | :"a"(10)); |
175 | :"a"(10)); |
182 | return val; |
176 | return val; |
183 | }; |
177 | }; |
- | 178 | static inline uint32_t GetOsEvent(void) __attribute__ ((alias ("get_os_event"))); |
|
Line 184... | Line 179... | ||
184 | 179 | ||
185 | static inline |
180 | static inline |
186 | uint32_t get_tick_count(void) |
181 | uint32_t get_tick_count(void) |
187 | { |
182 | { |
Line 304... | Line 299... | ||
304 | "int $0x40" |
299 | "int $0x40" |
305 | :"=a"(val) |
300 | :"=a"(val) |
306 | :"a"(68),"b"(12),"c"(size)); |
301 | :"a"(68),"b"(12),"c"(size)); |
307 | return val; |
302 | return val; |
308 | } |
303 | } |
- | 304 | static inline void *UserAlloc(size_t size) __attribute__ ((alias ("user_alloc"))); |
|
Line 309... | Line 305... | ||
309 | 305 | ||
310 | static inline |
306 | static inline |
311 | int user_free(void *mem) |
307 | int user_free(void *mem) |
312 | { |
308 | { |
Line 315... | Line 311... | ||
315 | "int $0x40" |
311 | "int $0x40" |
316 | :"=a"(val) |
312 | :"=a"(val) |
317 | :"a"(68),"b"(13),"c"(mem)); |
313 | :"a"(68),"b"(13),"c"(mem)); |
318 | return val; |
314 | return val; |
319 | } |
315 | } |
- | 316 | static inline int UserFree(void *mem) __attribute__ ((alias ("user_free"))); |
|
Line 320... | Line 317... | ||
320 | 317 | ||
321 | static inline |
318 | static inline |
322 | int *user_unmap(void *base, size_t offset, size_t size) |
319 | int *user_unmap(void *base, size_t offset, size_t size) |
323 | { |
320 | { |
324 | int *val; |
321 | int *val; |
325 | __asm__ __volatile__( |
322 | __asm__ __volatile__( |
326 | "int $0x40" |
323 | "int $0x40" |
327 | :"=a"(val) |
324 | :"=a"(val) |
328 | :"a"(68),"b"(26),"c"(base),"d"(offset),"S"(size)); |
325 | :"a"(68),"b"(26),"c"(base),"d"(offset),"S"(size)); |
329 | return val; |
326 | return val; |
- | 327 | }; |
|
Line 330... | Line 328... | ||
330 | } |
328 | static inline int *UserUnmap(void *base, size_t offset, size_t size) __attribute__ ((alias ("user_unmap"))); |
331 | 329 | ||
332 | typedef union |
330 | typedef union |
333 | { |
331 | { |
Line 349... | Line 347... | ||
349 | :"=A"(uf.raw) |
347 | :"=A"(uf.raw) |
350 | :"a" (68), "b"(27),"c"(path)); |
348 | :"a" (68), "b"(27),"c"(path)); |
Line 351... | Line 349... | ||
351 | 349 | ||
352 | return uf; |
350 | return uf; |
353 | }; |
- | |
- | 351 | }; |
|
Line 354... | Line 352... | ||
354 | 352 | static inline ufile_t LoadFile(const char *path) __attribute__ ((alias ("load_file"))); |
|
355 | 353 | ||
356 | static inline int GetScreenSize() |
354 | static inline int GetScreenSize() |
Line 372... | Line 370... | ||
372 | "int $0x40" |
370 | "int $0x40" |
373 | :"=a"(val) |
371 | :"=a"(val) |
374 | :"a"(37), "b"(4), "c"(path), "d"(flags)); |
372 | :"a"(37), "b"(4), "c"(path), "d"(flags)); |
375 | return val; |
373 | return val; |
376 | } |
374 | } |
- | 375 | static inline |
|
- | 376 | uint32_t LoadCursor(void *path, uint32_t flags) __attribute__ ((alias ("load_cursor"))); |
|
Line 377... | Line 377... | ||
377 | 377 | ||
378 | static inline |
378 | static inline |
379 | uint32_t set_cursor(uint32_t cursor) |
379 | uint32_t set_cursor(uint32_t cursor) |
380 | { |
380 | { |
381 | uint32_t old; |
381 | uint32_t old; |
382 | __asm__ __volatile__( |
382 | __asm__ __volatile__( |
383 | "int $0x40" |
383 | "int $0x40" |
384 | :"=a"(old) |
384 | :"=a"(old) |
385 | :"a"(37), "b"(5), "c"(cursor)); |
385 | :"a"(37), "b"(5), "c"(cursor)); |
386 | return old; |
386 | return old; |
- | 387 | }; |
|
Line 387... | Line 388... | ||
387 | } |
388 | static inline uint32_t SetCursor(uint32_t cursor) __attribute__ ((alias ("set_cursor"))); |
388 | 389 | ||
389 | static inline |
390 | static inline |
390 | int destroy_cursor(uint32_t cursor) |
391 | int destroy_cursor(uint32_t cursor) |
Line 395... | Line 396... | ||
395 | :"=a"(ret) |
396 | :"=a"(ret) |
396 | :"a"(37), "b"(6), "c"(cursor) |
397 | :"a"(37), "b"(6), "c"(cursor) |
397 | :"memory"); |
398 | :"memory"); |
398 | return ret; |
399 | return ret; |
399 | }; |
400 | }; |
- | 401 | static inline int DestroyCursor(uint32_t cursor) __attribute__ ((alias ("destroy_cursor"))); |
|
Line 400... | Line 402... | ||
400 | 402 | ||
401 | static inline void get_proc_info(char *info) |
403 | static inline void get_proc_info(char *info) |
402 | { |
404 | { |
403 | __asm__ __volatile__( |
405 | __asm__ __volatile__( |
404 | "int $0x40" |
406 | "int $0x40" |
405 | : |
407 | : |
406 | :"a"(9), "b"(info), "c"(-1)); |
408 | :"a"(9), "b"(info), "c"(-1)); |
- | 409 | }; |
|
Line 407... | Line 410... | ||
407 | } |
410 | static inline void GetProcInfo(char *info) __attribute__ ((alias ("get_proc_info"))); |
408 | 411 | ||
409 | static inline |
412 | static inline |
410 | void* user_realloc(void *mem, size_t size) |
413 | void* user_realloc(void *mem, size_t size) |
Line 415... | Line 418... | ||
415 | :"=a"(val) |
418 | :"=a"(val) |
416 | :"a"(68),"b"(20),"c"(size),"d"(mem) |
419 | :"a"(68),"b"(20),"c"(size),"d"(mem) |
417 | :"memory"); |
420 | :"memory"); |
Line 418... | Line 421... | ||
418 | 421 | ||
419 | return val; |
422 | return val; |
420 | } |
- | |
- | 423 | }; |
|
Line 421... | Line 424... | ||
421 | 424 | static inline void* UserRrealloc(void *mem, size_t size) __attribute__ ((alias ("user_realloc"))); |
|
Line 422... | Line 425... | ||
422 | 425 | ||
423 | void *get_resource(void *data, uint32_t id); |
426 | void *get_resource(void *data, uint32_t id); |