Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9210 → Rev 9211

/contrib/sdk/sources/SDL-1.2.2_newlib/src/SDL_kos.h
9,6 → 9,7
typedef unsigned short __u16;
typedef unsigned long __u32;
 
#pragma pack(push)
struct process_table_entry
{
__u32 cpu_usage;
28,6 → 29,15
__u8 reserved3[1024-71];
};
 
typedef union{
unsigned val;
struct{
short h;
short w;
};
}__kos__screen_t;
#pragma pack(pop)
 
static inline
void __kos__define_window(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,
__u32 body_color,__u32 grab_color,__u32 frame_color)
73,7 → 83,7
static inline
int __kos__set_events_mask(__u32 mask)
{
register __u32 val;
__u32 val;
asm volatile ("int $0x40":"=a"(val):"a"(40), "b"(mask));
return val;
}
99,8 → 109,54
return val>>8;
}
 
 
static inline
void __kos__change_window(int new_x, int new_y, int new_w, int new_h)
{
__asm__ __volatile__(
"int $0x40"
::"a"(67), "b"(new_x), "c"(new_y), "d"(new_w),"S"(new_h)
);
}
 
static inline
__kos__screen_t __kos__screen_size(void)
{
__kos__screen_t size;
__asm__ __volatile__(
"int $0x40"
:"=a"(size)
:"a"(14)
:"memory"
);
return size;
}
 
static inline
int __kos__get_skinh(void)
{
int res;
__asm__ ("int $0x40" : "=a"(res) : "a"(48),"b"(4));
return res;
}
 
static inline
void __kos__dbg_write_byte(const char ch){
__asm__ __volatile__(
"int $0x40"
::"a"(63), "b"(1), "c"(ch)
);
}
 
static inline
void __kos__dbg_write_str(const char* str){
while(*str){
__kos__dbg_write_byte(*str++);
}
}
 
#ifdef __cplusplus
}
#endif
 
#endif
#endif
/contrib/sdk/sources/SDL-1.2.2_newlib/src/timer/dummy/SDL_systimer.c
85,13 → 85,11
return (curtime-starttime)*10;
}
 
void SDL_Delay (Uint32 ms)
{
__kos__delay100(ms);
/* Uint32 start = SDL_GetTicks();
do
__asm__("int $0x40" :: "a"(68),"b"(1));
while (SDL_GetTicks()-start < ms);*/
void SDL_Delay(unsigned ms){
unsigned start = SDL_GetTicks();
do{
__kos__delay100(1);
}while (SDL_GetTicks()-start < ms);
}
 
int SDL_SYS_TimerInit(void)
/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetvideo.c
17,13 → 17,6
static int has_null_cursor=0;
static int null_cursor;
 
inline int get_skinh(void)
{
int res;
__asm__ ("int $0x40" : "=a"(res) : "a"(48),"b"(4));
return res;
}
 
//#define KEEP_OBSOLETE_STYLE3
 
#ifdef KEEP_OBSOLETE_STYLE3
33,7 → 26,7
void MenuetOS_SDL_RepaintWnd(void)
{
__kos__window_redraw(1);
__kos__define_window(1,1,vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+get_skinh()+4,
__kos__define_window(1, 1, vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+__kos__get_skinh()+4,
#ifdef KEEP_OBSOLETE_STYLE3
IsStyle4Available?0x34000000:0x33000000
#else
100,17 → 93,6
if(was_initialized) __asm__("int $0x40"::"a"(71),"b"(1),"c"(title));
}
 
void debug_board_write_byte(const char ch){
__asm__ __volatile__(
"int $0x40"
::"a"(63), "b"(1), "c"(ch));
}
 
void debug_board_write_str(const char* str){
while(*str)
debug_board_write_byte(*str++);
}
 
SDL_Surface * MenuetOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
{
int ly;
123,7 → 105,7
 
char info[100];
sprintf(info, "width = %d, height = %d, pitch = %d, bpp = %d\n", current->w, current->h, current->pitch, bpp);
debug_board_write_str(info);
__kos__dbg_write_str(info);
// __asm__ __volatile__("int3");
current->pixels=this->hidden->__video_buffer=realloc(this->hidden->__video_buffer,
138,11 → 120,14
this->hidden->win_size_x=width;
this->hidden->win_size_y=height;
vm_suf=this;
 
 
if (was_initialized)
{
unsigned newheight = height+get_skinh()+4;
unsigned newheight = height+__kos__get_skinh()+4;
unsigned newwidth = width+9;
__asm__("int $0x40"::"a"(67),"b"(-1),"c"(-1),"d"(newwidth),"S"(newheight));
 
__kos__change_window(-1, -1, newwidth, newheight);
}
else
{