From 46851141b8b1088636c5ff8eb8a01dc2609b5948 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Sat, 26 Oct 2013 03:51:40 +0000 Subject: [PATCH] newsdk: update git-svn-id: svn://kolibrios.org@4102 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/libraries/newlib/Makefile | 2 +- .../libraries/newlib/include/kos32sys.h | 25 ++++++++ .../libraries/newlib/sdk/fasm/mpg123.asm | 60 ++++++------------- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/programs/develop/libraries/newlib/Makefile b/programs/develop/libraries/newlib/Makefile index d9aff6fb1..0fd89f1eb 100644 --- a/programs/develop/libraries/newlib/Makefile +++ b/programs/develop/libraries/newlib/Makefile @@ -375,7 +375,7 @@ $(NAME).dll: $(LIB_OBJS) $(SRC_DEP) Makefile $(LD) $(LDFLAGS) --exclude-symbols __chkstk,__chkstk_ms,_alloca -Map libcmap -L. -o $@ $(LIB_OBJS) -lgcc --version-script libc.ver sed -e "s/ @[^ ]*//" libc.orig.def > libc.def sed -f cmd1.sed libc.def > mem - sed -f cmd2.sed mem >libc.inc + sed -f newlib.sed mem >libc.inc libcrt.a: $(LIBCRT_OBJS) Makefile diff --git a/programs/develop/libraries/newlib/include/kos32sys.h b/programs/develop/libraries/newlib/include/kos32sys.h index 61a5c4d55..0bf23dedc 100644 --- a/programs/develop/libraries/newlib/include/kos32sys.h +++ b/programs/develop/libraries/newlib/include/kos32sys.h @@ -45,6 +45,21 @@ typedef struct int out_size; }ioctl_t; + +static inline +void DefineButton(uint32_t x_w, uint32_t y_h, uint32_t id, uint32_t color) +{ + __asm__ __volatile__( + "int $0x40" + ::"a"(8), + "b"(x_w), + "c"(y_h), + "d"(id), + "S"(color)); + + +}; + static inline void BeginDraw(void) { @@ -166,6 +181,16 @@ oskey_t get_key(void) return val; } +static inline +uint32_t get_os_button() +{ + uint32_t val; + __asm__ __volatile__( + "int $0x40" + :"=a"(val) + :"a"(17)); + return val>>8; +}; static inline uint32_t get_service(char *name) { diff --git a/programs/develop/libraries/newlib/sdk/fasm/mpg123.asm b/programs/develop/libraries/newlib/sdk/fasm/mpg123.asm index 87f7246c9..f1fd58aa9 100644 --- a/programs/develop/libraries/newlib/sdk/fasm/mpg123.asm +++ b/programs/develop/libraries/newlib/sdk/fasm/mpg123.asm @@ -129,59 +129,31 @@ main: xor ebx, ebx ;totalcount .inner: + ; int3 + mov [count], 0 call [mpg123_read] + mov ebx, [count] test eax, eax jz @F - mov [done], eax - jmp .check_done + test ebx, ebx + jz .done @@: - mov eax, [count] - add [esp+4], eax - add ebx, eax - sub [esp+8], eax - shl eax, 1 - cmp eax, [esp+8] - jb .inner - -.check_done: - cmp [done], 0 - je @F - - cmp ebx, 4096 - jae .write_out - - mov edi, [esp+16] - mov ecx, 4096 - sub ecx, ebx - rep movsb - mov ebx, 4096 - - jmp .write_out -@@: - mov [count], 0 - cmp ebx, 8192 - jb .inner - .write_out: - + add ebx, 4095 + and ebx, -4096 mov esi, [esp+16] -@@: - cmp ebx, 4096 - jb @F - - stdcall WaveOut, [hBuff], esi, 4096 - sub ebx, 4096 - add esi, 4096 - add [esp+8], dword 4096 - jmp @B -@@: + stdcall WaveOut, [hBuff], esi, ebx + mov [esp+8], dword 0x40000 mov edi, [esp+16] - mov ecx, ebx - rep movsb mov [esp+4], edi jmp .inner - .done: + mov edi, [esp+16] + mov ecx, 4096 + xor eax, eax + rep stosd + mov esi, [esp+16] + stdcall WaveOut, [hBuff], esi, 16384 add esp, 20 pop edi pop esi @@ -691,3 +663,5 @@ __pgmname: rb 1024 rb 16 __stack: __bssend: + +