From d6dcd6eccbab772184012e76aa47cb04cb2a307c Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Tue, 29 Dec 2020 14:04:01 +0000 Subject: [PATCH] SDL newlib: clean git-svn-id: svn://kolibrios.org@8494 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../sdk/sources/SDL-1.2.2_newlib/src/Makefile | 2 +- .../SDL-1.2.2_newlib/src/SYSCALL/src/backgr.c | 26 -------- .../SDL-1.2.2_newlib/src/SYSCALL/src/bar.c | 9 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/button.c | 17 ----- .../SDL-1.2.2_newlib/src/SYSCALL/src/clock.c | 8 --- .../src/SYSCALL/src/cofflib.c | 15 ----- .../SDL-1.2.2_newlib/src/SYSCALL/src/date.c | 8 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/debug.c | 5 -- .../SDL-1.2.2_newlib/src/SYSCALL/src/delay.c | 11 ---- .../SDL-1.2.2_newlib/src/SYSCALL/src/dga.c | 19 ------ .../SDL-1.2.2_newlib/src/SYSCALL/src/event.c | 20 ------ .../SDL-1.2.2_newlib/src/SYSCALL/src/exit.c | 6 -- .../SDL-1.2.2_newlib/src/SYSCALL/src/file.c | 45 -------------- .../SDL-1.2.2_newlib/src/SYSCALL/src/image.c | 9 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/ipc.c | 11 ---- .../SDL-1.2.2_newlib/src/SYSCALL/src/irq.c | 62 ------------------- .../SDL-1.2.2_newlib/src/SYSCALL/src/keyb.c | 8 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/line.c | 9 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/mpu401.c | 11 ---- .../SDL-1.2.2_newlib/src/SYSCALL/src/os.c | 39 ++++++++++++ .../SDL-1.2.2_newlib/src/SYSCALL/src/param.c | 7 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/pci.c | 50 --------------- .../SDL-1.2.2_newlib/src/SYSCALL/src/pixel.c | 6 -- .../src/SYSCALL/src/process.c | 8 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/screen.c | 9 --- .../SDL-1.2.2_newlib/src/SYSCALL/src/sound.c | 11 ---- .../src/SYSCALL/src/systree.c | 16 ----- .../SDL-1.2.2_newlib/src/SYSCALL/src/text.c | 6 -- .../SDL-1.2.2_newlib/src/SYSCALL/src/thread.c | 12 ---- .../SDL-1.2.2_newlib/src/SYSCALL/src/window.c | 16 ----- .../src/audio/SDL_kolibri_audio.c | 9 +-- .../src/timer/dummy/SDL_systimer.c | 3 +- .../src/video/menuetos/SDL_menuetevents.c | 5 +- .../src/video/menuetos/SDL_menuetvideo.c | 3 +- 34 files changed, 52 insertions(+), 449 deletions(-) delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/backgr.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/bar.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/button.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/clock.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/cofflib.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/date.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/debug.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/delay.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/dga.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/event.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/exit.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/file.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/image.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/ipc.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/irq.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/keyb.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/line.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/mpu401.c create mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/os.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/param.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pci.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pixel.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/process.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/screen.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/sound.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/systree.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/text.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/thread.c delete mode 100755 contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/window.c diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/Makefile b/contrib/sdk/sources/SDL-1.2.2_newlib/src/Makefile index fb20d94b1c..bd182f32ec 100755 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/Makefile +++ b/contrib/sdk/sources/SDL-1.2.2_newlib/src/Makefile @@ -50,7 +50,7 @@ install: libSDL.a mv -f libSDL.a $(SDK_DIR)/lib libSDL.a: $(OBJS) - $(AR) $(ARFLAGS) libSDL.a $(OBJS) SYSCALL/src/*.o + $(AR) $(ARFLAGS) libSDL.a $(OBJS) SYSCALL/src/os.o %.o : %.asm Makefile nasm -f coff $< $ diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/backgr.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/backgr.c deleted file mode 100755 index f9aa07fbf3..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/backgr.c +++ /dev/null @@ -1,26 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/bar.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/bar.c deleted file mode 100755 index 828ad043fa..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/bar.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/button.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/button.c deleted file mode 100755 index 25af0cfce5..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/button.c +++ /dev/null @@ -1,17 +0,0 @@ -#include - -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; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/clock.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/clock.c deleted file mode 100755 index 38b2e582af..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/clock.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -__u32 __menuet__getsystemclock(void) -{ - __u32 __ret; - __asm__ __volatile__("int $0x40":"=a"(__ret):"0"(3)); - return __ret; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/cofflib.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/cofflib.c deleted file mode 100755 index 9b3cfe553d..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/cofflib.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include - -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; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/date.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/date.c deleted file mode 100755 index a2ca956fdf..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/date.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -__u32 __menuet__get_date(void) -{ - __u32 __ret; - __asm__ __volatile__("int $0x40":"=a"(__ret):"0"(29)); - return __ret; -} \ No newline at end of file diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/debug.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/debug.c deleted file mode 100755 index d3916bb8a3..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/debug.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -void __menuet__debug_out(const char* str){ - while(*str) - __menuet__debug_out_byte(*str++); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/delay.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/delay.c deleted file mode 100755 index 91365b2481..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/delay.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - -void __menuet__delay100(int m) -{ - __asm__ __volatile__("int $0x40"::"a"(5),"b"(m)); -} - -void __menuet__idle(void) -{ - __menuet__delay100(10); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/dga.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/dga.c deleted file mode 100755 index 7b1386d427..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/dga.c +++ /dev/null @@ -1,19 +0,0 @@ -#include - -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; - } -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/event.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/event.c deleted file mode 100755 index f5c8fc5f04..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/event.c +++ /dev/null @@ -1,20 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/exit.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/exit.c deleted file mode 100755 index e893e5bf43..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/exit.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -void __menuet__sys_exit(void) -{ - __asm__ __volatile__("int $0x40"::"a"(0xFFFFFFFF)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/file.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/file.c deleted file mode 100755 index e6e462ebf0..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/file.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include -#include - -__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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/image.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/image.c deleted file mode 100755 index 5f7daa1319..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/image.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/ipc.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/ipc.c deleted file mode 100755 index 1cd818d82b..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/ipc.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/irq.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/irq.c deleted file mode 100755 index 372322501d..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/irq.c +++ /dev/null @@ -1,62 +0,0 @@ -#include - -__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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/keyb.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/keyb.c deleted file mode 100755 index 10f05b4ba3..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/keyb.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int __menuet__getkey(void) -{ - __u16 __ret; - __asm__ __volatile__("int $0x40":"=a"(__ret):"0"(2)); - if(!(__ret & 0xFF)) return (__ret>>8)&0xFF; else return 0; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/line.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/line.c deleted file mode 100755 index d5aff6b364..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/line.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/mpu401.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/mpu401.c deleted file mode 100755 index 14a25ab488..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/mpu401.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/os.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/os.c new file mode 100755 index 0000000000..e5d784f2ac --- /dev/null +++ b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/os.c @@ -0,0 +1,39 @@ +#include + +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)); +} + +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)); +} + +int __menuet__getkey(void) +{ + __u16 __ret; + __asm__ __volatile__("int $0x40":"=a"(__ret):"0"(2)); + if(!(__ret & 0xFF)) return (__ret>>8)&0xFF; else return 0; +} + + +int __menuet__check_for_event(void) +{ + __u32 __ret; + __asm__ __volatile__("int $0x40":"=a"(__ret):"0"(11)); + return __ret; +} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/param.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/param.c deleted file mode 100755 index 18de968c97..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/param.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -#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]; diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pci.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pci.c deleted file mode 100755 index 13c9e8bf72..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pci.c +++ /dev/null @@ -1,50 +0,0 @@ -#include - -#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) diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pixel.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pixel.c deleted file mode 100755 index ed7d34f022..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/pixel.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -void __menuet__putpixel(__u32 x,__u32 y,__u32 color) -{ - __asm__ __volatile__("int $0x40"::"a"(1),"b"(x),"c"(y),"d"(color)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/process.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/process.c deleted file mode 100755 index 98bb310994..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/process.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -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; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/screen.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/screen.c deleted file mode 100755 index 8d3e30c8cf..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/screen.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -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; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/sound.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/sound.c deleted file mode 100755 index 2fee9b1568..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/sound.c +++ /dev/null @@ -1,11 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/systree.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/systree.c deleted file mode 100755 index 77411a5e42..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/systree.c +++ /dev/null @@ -1,16 +0,0 @@ -#include - -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; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/text.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/text.c deleted file mode 100755 index 7769d88887..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/text.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/thread.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/thread.c deleted file mode 100755 index cf15b66f81..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/thread.c +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include -#include - -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; -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/window.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/window.c deleted file mode 100755 index 5ab0db8dbb..0000000000 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/SYSCALL/src/window.c +++ /dev/null @@ -1,16 +0,0 @@ -#include - -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)); -} diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/audio/SDL_kolibri_audio.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/audio/SDL_kolibri_audio.c index 3b99fe5faa..e72ab5c077 100755 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/audio/SDL_kolibri_audio.c +++ b/contrib/sdk/sources/SDL-1.2.2_newlib/src/audio/SDL_kolibri_audio.c @@ -1,4 +1,5 @@ #include "SDL_audio.h" +#include #include #include #include @@ -86,14 +87,14 @@ static void audio_thread(void) if (CreateBuffer(used_format|PCM_RING, 0, &hBuff)) { audio_response=1; - __menuet__sys_exit(); + exit(0); } GetBufferSize(hBuff, &mix_size); SDL_printf("buffer created, size is %d\n",mix_size); mix_size >>= 1; data = malloc(mix_size); audio_response=1; - if (!data) __menuet__sys_exit(); + if (!data) exit(0); // wait for resume while (audio_command!=AUDIO_RESUME) Yield(); @@ -130,7 +131,7 @@ static void audio_thread(void) audio_response = 1; StopBuffer(hBuff); DestroyBuffer(hBuff); - __menuet__sys_exit(); + exit(0); } else { @@ -142,7 +143,7 @@ static void audio_thread(void) } } if (bPaused) - __menuet__delay100(5); + delay(5); else { GetNotify(event); diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/timer/dummy/SDL_systimer.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/timer/dummy/SDL_systimer.c index 4230b0651e..a078c5a162 100755 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/timer/dummy/SDL_systimer.c +++ b/contrib/sdk/sources/SDL-1.2.2_newlib/src/timer/dummy/SDL_systimer.c @@ -31,6 +31,7 @@ static char rcsid = #include #include #include +#include #include "SDL_error.h" #include "SDL_timer.h" @@ -88,7 +89,7 @@ Uint32 SDL_GetTicks (void) void SDL_Delay (Uint32 ms) { - __menuet__delay100(ms); + delay(ms); /* Uint32 start = SDL_GetTicks(); do __asm__("int $0x40" :: "a"(68),"b"(1)); diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetevents.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetevents.c index a4e94e89d2..248a245054 100755 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetevents.c +++ b/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetevents.c @@ -1,4 +1,5 @@ -#include +#include +#include #include #include #include "SDL.h" @@ -198,7 +199,7 @@ void MenuetOS_PumpEvents(_THIS) SDL_PrivateKeyboard(code,&key); break; case 3: - if(__menuet__get_button_id()==1) exit(0); + if(get_os_button()==1) exit(0); break; case 6: { int __tmp,mx,my; diff --git a/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetvideo.c b/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetvideo.c index 9a69457b33..48ac1cf637 100755 --- a/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetvideo.c +++ b/contrib/sdk/sources/SDL-1.2.2_newlib/src/video/menuetos/SDL_menuetvideo.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "SDL.h" #include "SDL_error.h" #include "SDL_video.h" @@ -150,7 +151,7 @@ SDL_Surface * MenuetOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int } else { - __menuet__set_bitfield_for_wanted_events(0x27); + set_wanted_events_mask(0x27); was_initialized=1; MenuetOS_SDL_RepaintWnd(); }