Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 8494 → Rev 8493

/contrib/sdk/sources/SDL-1.2.2_newlib/src/Makefile
50,7 → 50,7
mv -f libSDL.a $(SDK_DIR)/lib
libSDL.a: $(OBJS)
$(AR) $(ARFLAGS) libSDL.a $(OBJS) SYSCALL/src/os.o
$(AR) $(ARFLAGS) libSDL.a $(OBJS) SYSCALL/src/*.o
%.o : %.asm Makefile
nasm -f coff $< $
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/os.c
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/backgr.c
0,0 → 1,26
#include<menuet/os.h>
 
void __menuet__set_background_size(__u32 xsz,__u32 ysz)
{
__asm__ __volatile__("int $0x40"::"a"(15),"b"(1),"c"(xsz),"d"(ysz));
}
 
void __menuet__write_background_mem(__u32 pos,__u32 color)
{
__asm__ __volatile__("int $0x40"::"a"(15),"b"(2),"c"(pos),"d"(color));
}
 
void __menuet__draw_background(void)
{
__asm__ __volatile__("int $0x40"::"a"(15),"b"(3));
}
 
void __menuet__set_background_draw_type(int type)
{
__asm__ __volatile__("int $0x40"::"a"(15),"b"(3),"c"(type));
}
 
void __menuet__background_blockmove(char * src_ptr,__u32 bgr_dst,__u32 count)
{
__asm__ __volatile__("int $0x40"::"a"(15),"b"(3),"c"(src_ptr),"d"(bgr_dst),"S"(count));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/bar.c
0,0 → 1,9
#include<menuet/os.h>
 
void __menuet__bar(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,__u32 color)
{
__u32 a,b;
a=(x1<<16)|xsize;
b=(y1<<16)|ysize;
__asm__ __volatile__("int $0x40"::"a"(13),"b"(a),"c"(b),"d"(color));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/button.c
0,0 → 1,17
#include<menuet/os.h>
 
void __menuet__make_button(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,
int id,__u32 color)
{
__u32 a,b;
a=(x1<<16)|xsize;
b=(y1<<16)|ysize;
__asm__ __volatile__("int $0x40"::"a"(8),"b"(a),"c"(b),"d"(id),"S"(color));
}
 
int __menuet__get_button_id(void)
{
__u16 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(17));
if((__ret & 0xFF)==0) return (__ret>>8)&0xFF; else return -1;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/clock.c
0,0 → 1,8
#include<menuet/os.h>
 
__u32 __menuet__getsystemclock(void)
{
__u32 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(3));
return __ret;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/cofflib.c
0,0 → 1,15
#include <menuet/os.h>
#include <stdio.h>
#include <string.h>
 
IMP_TABLE __kolibri__cofflib_load(const char* name){
__asm__ __volatile__("int $0x40"::"a"(68L),"b"(19L),"c"((__u32)name));
}
 
__u32 __kolibri__cofflib_getproc(IMP_TABLE lib, const char* name){
if(!name || !name[0]) return 0;
int i;
for(i = 0; lib[i].name && strcmp(name, lib[i].name); i++);
if(lib[i].name) return (__u32)lib[i].pointer;
else return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/date.c
0,0 → 1,8
#include<menuet/os.h>
 
__u32 __menuet__get_date(void)
{
__u32 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(29));
return __ret;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/debug.c
0,0 → 1,5
#include <menuet/os.h>
void __menuet__debug_out(const char* str){
while(*str)
__menuet__debug_out_byte(*str++);
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/delay.c
0,0 → 1,11
#include<menuet/os.h>
 
void __menuet__delay100(int m)
{
__asm__ __volatile__("int $0x40"::"a"(5),"b"(m));
}
 
void __menuet__idle(void)
{
__menuet__delay100(10);
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/dga.c
0,0 → 1,19
#include<menuet/os.h>
 
void __menuet__dga_get_caps(int * xres,int * yres,int * bpp,int * bpscan)
{
int p;
__asm__ __volatile__("int $0x40":"=a"(p):"0"(61),"b"(1));
if(xres) *xres=(p>>16)&0xFFFF;
if(yres) *yres=p & 0xFFFF;
if(bpp)
{
__asm__ __volatile__("int $0x40":"=a"(p):"0"(61),"b"(2));
*bpp=p;
}
if(bpscan)
{
__asm__ __volatile__("int $0x40":"=a"(p):"0"(61),"b"(3));
*bpscan=p;
}
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/event.c
0,0 → 1,20
#include<menuet/os.h>
 
int __menuet__wait_for_event(void)
{
__u32 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(10));
return __ret;
}
 
int __menuet__check_for_event(void)
{
__u32 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(11));
return __ret;
}
 
void __menuet__set_bitfield_for_wanted_events(__u32 ev)
{
__asm__ __volatile__("int $0x40"::"a"(40),"b"(ev));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/exit.c
0,0 → 1,6
#include<menuet/os.h>
 
void __menuet__sys_exit(void)
{
__asm__ __volatile__("int $0x40"::"a"(0xFFFFFFFF));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/file.c
0,0 → 1,45
#include<menuet/os.h>
#include<stdio.h>
#include<stdarg.h>
#include<string.h>
 
__u32 __menuet__open(char * name,char * data)
{
__u32 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(6),"b"((__u32)name),"c"(0),"d"(0xFFFFFFFF),"S"((__u32)data));
return __ret;
}
 
void __menuet__save(char * name,char * data,__u32 count)
{
__asm__ __volatile__("int $0x40"::"a"(33),"b"((__u32)name),"c"((__u32)data),"d"(count),"S"(0));
}
 
void __menuet__exec_ramdisk(char * filename,char * args,...)
{
va_list argz;
char buffer[1024];
memset(buffer,0,1024);
if(args)
{
va_start(argz,args);
vsprintf(buffer,args,argz);
}
va_end(argz);
__asm__ __volatile__("int $0x40"::"a"(19),"b"(filename),"c"((args ? buffer : NULL)));
}
 
void __menuet__exec_hd(char * filename,char * args,...)
{
va_list argz;
char buffer[1024];
char work_area[0xFFFF];
memset(buffer,0,1024);
if(args)
{
va_start(argz,args);
vsprintf(buffer,args,argz);
}
va_end(argz);
__asm__ __volatile__("int $0x40"::"a"(19),"b"(filename),"c"(args ? buffer : NULL),"d"(work_area));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/image.c
0,0 → 1,9
#include<menuet/os.h>
 
void __menuet__putimage(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,char * image)
{
__u32 a,b;
a=(xsize<<16)|ysize;
b=(x1<<16)|y1;
__asm__ __volatile__("int $0x40"::"a"(7),"b"(image),"c"(a),"d"(b));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/ipc.c
0,0 → 1,11
#include<menuet/os.h>
 
void send_message(int pid,void * msg_ptr,int message_size)
{
__asm__ __volatile__("int $0x40"::"a"(60),"b"(2),"c"(pid),"d"(msg_ptr),"S"(message_size));
}
 
void define_receive_area(msgrcva_t * rcva_ptr,int size)
{
__asm__ __volatile__("int $0x40"::"a"(60),"b"(1),"c"(rcva_ptr),"d"(size));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/irq.c
0,0 → 1,62
#include<menuet/os.h>
 
__u32 __menuet__get_irq_owner(__u32 irq)
{
__u32 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(41),"b"(irq));
return __ret;
}
 
int __menuet__get_data_read_by_irq(__u32 irq,__u32 * num_bytes_in_buf,__u8 * data)
{
__u32 a,b,c;
__asm__ __volatile__("int $0x40":"=a"(a),"=b"(b),"=c"(c):"0"(42),"1"(irq));
if(num_bytes_in_buf) *num_bytes_in_buf=a;
if(data) *data=b & 0xFF;
return c;
}
 
int __menuet__send_data_to_device(__u16 port,__u8 val)
{
int __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(43),"b"(port),"c"(val));
return __ret;
}
 
void __menuet__program_irq(void * intr_table,__u32 irq_num)
{
__asm__ __volatile__("int $0x40"::"a"(44),"b"(intr_table),"c"(irq_num));
}
 
int __menuet__reserve_irq(int irqno)
{
int __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(45),"b"(0),"c"(irqno));
return __ret;
}
 
int __menuet__free_irq(int irqno)
{
int __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(45),"b"(1),"c"(irqno));
return __ret;
}
 
int __menuet__reserve_port_area(__u32 start,__u32 end)
{
int __ret;
__asm__("int $0x40":"=a"(__ret):"a"(45),"b"(0),"c"(start),"d"(end));
return __ret;
}
 
int __menuet__free_port_area(__u32 start,__u32 end)
{
int __ret;
__asm__("int $0x40":"=a"(__ret):"a"(45),"b"(1),"c"(start),"d"(end));
return __ret;
}
 
void __menuet__define_app_internal_intrs(void * intr_table)
{
__asm__("int $0x40"::"a"(49),"b"(0),"c"(intr_table));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/keyb.c
0,0 → 1,8
#include<menuet/os.h>
 
int __menuet__getkey(void)
{
__u16 __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(2));
if(!(__ret & 0xFF)) return (__ret>>8)&0xFF; else return 0;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/line.c
0,0 → 1,9
#include<menuet/os.h>
 
void __menuet__line(__u16 x1,__u16 y1,__u16 x2,__u16 y2,__u32 color)
{
__u32 b,c;
b=(x1<<16)|x1;
c=(y1<<16)|y2;
__asm__ __volatile__("int $0x40"::"a"(38),"b"(b),"c"(c),"d"(color));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/mpu401.c
0,0 → 1,11
#include<menuet/os.h>
 
void __menuet__reset_mpu401(void)
{
__asm__ __volatile__("int $0x40"::"a"(20),"b"(1));
}
 
void __menuet__write_mpu401(__u8 d)
{
__asm__ __volatile__("int $0x40"::"a"(20),"b"(2),"c"(d));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/param.c
0,0 → 1,7
#include<menuet/os.h>
 
#define APP_PARAM_SZ (1024)
#define APP_PATH_SZ (1024)
 
char __menuet__app_param_area[APP_PARAM_SZ];
char __menuet__app_path_area[APP_PATH_SZ];
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pci.c
0,0 → 1,50
#include<menuet/os.h>
 
#define PCI_FN 62
 
void get_pci_version(__u8 * major,__u8 * minor)
{
int r;
__asm__ __volatile__("int $0x40":"=a"(r):"0"(PCI_FN),"b"(0));
*minor=r&0xFF;
*major=(r>>8)&0xFF;
}
 
void pci_get_last_bus(__u8 * last_bus)
{
__asm__ __volatile__("int $0x40":"=a"(*last_bus):"0"(PCI_FN),"b"(1));
}
 
void get_pci_access_mechanism(__u8 * mechanism)
{
__asm__ __volatile__("int $0x40":"=a"(*mechanism):"0"(PCI_FN),"b"(2));
}
 
#define read_config(x,c,bits) \
__u##bits pci_read_config_##x (__u8 bus,__u8 dev,__u8 fn,__u8 reg) \
{ \
__u##bits __ret; \
__u16 cx; \
__u16 bx; \
cx=(((fn&7)|(((dev)&~7)<<3))<<8)|reg; \
bx=(bus<<8)|(c); \
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(PCI_FN),"b"(bx),"c"(cx)); \
return __ret; \
}
 
#define write_config(x,c,bits) \
void pci_write_config_##x (__u8 bus,__u8 dev,__u8 fn,__u8 reg,__u##bits val) \
{ \
__u16 cx,bx; \
cx=(((fn&7)|(((dev)&~7)<<3))<<8)|reg; \
bx=(bus<<8)|(c); \
__asm__ __volatile__("int $0x40"::"a"(PCI_FN),"b"(bx),"c"(cx),"d"(val)); \
}
 
#define rw_config(x,c,bits) \
read_config(x,4+c,bits) \
write_config(x,7+c,bits)
rw_config(byte,0,8)
rw_config(word,1,16)
rw_config(dword,2,32)
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pixel.c
0,0 → 1,6
#include<menuet/os.h>
 
void __menuet__putpixel(__u32 x,__u32 y,__u32 color)
{
__asm__ __volatile__("int $0x40"::"a"(1),"b"(x),"c"(y),"d"(color));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/process.c
0,0 → 1,8
#include<menuet/os.h>
 
int __menuet__get_process_table(struct process_table_entry * proctab,int pid)
{
int __ret;
__asm__ __volatile__("int $0x40":"=a"(__ret):"0"(9),"b"((__u32)proctab),"c"(pid));
return __ret;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/screen.c
0,0 → 1,9
#include<menuet/os.h>
 
void __menuet__get_screen_max(__u16 * x,__u16 * y)
{
__u32 v;
__asm__ __volatile__("int $0x40":"=a"(v):"0"(14));
if(x) *x=v>>16;
if(y) *y=v & 0xFFFF;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/sound.c
0,0 → 1,11
#include<menuet/os.h>
 
void __menuet__sound_load_block(char * blockptr)
{
__asm__ __volatile__("int $0x40"::"a"(55),"b"(0),"c"(blockptr));
}
 
void __menuet__sound_play_block(void)
{
__asm__ __volatile__("int $0x40"::"a"(55),"b"(1));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/systree.c
0,0 → 1,16
#include<menuet/os.h>
 
int __kolibri__system_tree_access(struct systree_info * info)
{
int __ret;
int d0;
__asm__ __volatile__("int $0x40":"=a"(__ret),"=&b"(d0):"0"(70),"1"((__u32)info));
return __ret;
}
int __kolibri__system_tree_access2(struct systree_info2 * info)
{
int __ret;
int d0;
__asm__ __volatile__("int $0x40":"=a"(__ret),"=&b"(d0):"0"(70),"1"((__u32)info));
return __ret;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/text.c
0,0 → 1,6
#include<menuet/os.h>
 
void __menuet__write_text(__u16 x,__u16 y,__u32 color,char * text,int len)
{
__asm__ __volatile__("int $0x40"::"a"(4),"b"((x<<16)|y),"c"(color),"d"((__u32)text),"S"(len));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/thread.c
0,0 → 1,12
#include<menuet/os.h>
#include<stdio.h>
#include<stdlib.h>
 
void * __menuet__exec_thread(void (* func_ptr)(void),__u32 stack_size,int * retp)
{
void * __stk, * __ret;
__ret=__stk=malloc(stack_size);
__stk+=stack_size-1;
__asm__ __volatile__("int $0x40":"=a"(*retp):"0"(51L),"b"(1L),"c"((__u32)func_ptr),"d"((__u32)__stk));
return __ret;
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/window.c
0,0 → 1,16
#include<menuet/os.h>
 
void __menuet__define_window(__u16 x1,__u16 y1,__u16 xsize,__u16 ysize,
__u32 body_color,__u32 grab_color,__u32 frame_color)
{
__u32 a,b;
a=(x1<<16)|xsize;
b=(y1<<16)|ysize;
__asm__ __volatile__("int $0x40"::"a"(0),"b"(a),"c"(b),"d"(body_color),"S"(grab_color),
"D"(frame_color));
}
 
void __menuet__window_redraw(int status)
{
__asm__ __volatile__("int $0x40"::"a"(12),"b"(status));
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetevents.c
1,5 → 1,4
#include <menuet/os.h>
#include <kos32sys.h>
#include <stdlib.h>
#include <stdio.h>
#include "SDL.h"
199,7 → 198,7
SDL_PrivateKeyboard(code,&key);
break;
case 3:
if(get_os_button()==1) exit(0);
if(__menuet__get_button_id()==1) exit(0);
break;
case 6: {
int __tmp,mx,my;
/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetvideo.c
1,7 → 1,6
#include <stdlib.h>
#include <stdio.h>
#include <menuet/os.h>
#include <kos32sys.h>
#include "SDL.h"
#include "SDL_error.h"
#include "SDL_video.h"
151,7 → 150,7
}
else
{
set_wanted_events_mask(0x27);
__menuet__set_bitfield_for_wanted_events(0x27);
was_initialized=1;
MenuetOS_SDL_RepaintWnd();
}
/contrib/sdk/sources/SDL-1.2.2_newlib/src/timer/dummy/SDL_systimer.c
31,7 → 31,6
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <kos32sys.h>
 
#include "SDL_error.h"
#include "SDL_timer.h"
89,7 → 88,7
 
void SDL_Delay (Uint32 ms)
{
delay(ms);
__menuet__delay100(ms);
/* Uint32 start = SDL_GetTicks();
do
__asm__("int $0x40" :: "a"(68),"b"(1));
/contrib/sdk/sources/SDL-1.2.2_newlib/src/audio/SDL_kolibri_audio.c
1,5 → 1,4
#include "SDL_audio.h"
#include <kos32sys.h>
#include <menuet/os.h>
#include <stdlib.h>
#include <string.h>
87,7 → 86,7
if (CreateBuffer(used_format|PCM_RING, 0, &hBuff))
{
audio_response=1;
exit(0);
__menuet__sys_exit();
}
GetBufferSize(hBuff, &mix_size);
SDL_printf("buffer created, size is %d\n",mix_size);
94,7 → 93,7
mix_size >>= 1;
data = malloc(mix_size);
audio_response=1;
if (!data) exit(0);
if (!data) __menuet__sys_exit();
// wait for resume
while (audio_command!=AUDIO_RESUME)
Yield();
131,7 → 130,7
audio_response = 1;
StopBuffer(hBuff);
DestroyBuffer(hBuff);
exit(0);
__menuet__sys_exit();
}
else
{
143,7 → 142,7
}
}
if (bPaused)
delay(5);
__menuet__delay100(5);
else
{
GetNotify(event);