newsdk: update

git-svn-id: svn://kolibrios.org@4102 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2013-10-26 03:51:40 +00:00
parent 8c99f46b7d
commit 46851141b8
3 changed files with 43 additions and 44 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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: