diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index d08c678000..46cc07c3df 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -2029,7 +2029,7 @@ sys_end: iglobal align 4 sys_system_table: - dd 0 ; 1 = system shutdown + dd exit_for_anyone ; 1 = obsolete dd sysfn_terminate ; 2 = terminate thread dd sysfn_activate ; 3 = activate window dd sysfn_getidletime ; 4 = get idle time diff --git a/kernel/trunk/video/vesa20.inc b/kernel/trunk/video/vesa20.inc index 1709468355..c49f630350 100644 --- a/kernel/trunk/video/vesa20.inc +++ b/kernel/trunk/video/vesa20.inc @@ -864,7 +864,7 @@ vesa20_drawbackground_stretch: call [disable_mouse] pushad ; Helper variables -; calculate 2^32*(BgrDataWidth-1) mod (Screen_Max_X-1) +; calculate 2^32*(BgrDataWidth-1) mod (ScreenWidth-1) mov eax, [BgrDataWidth] dec eax xor edx, edx @@ -908,7 +908,7 @@ vesa20_drawbackground_stretch: mov eax, ebx imul ebx, dword [esp+12] mul dword [esp+8] - add edx, ebx ; edx:eax = y * 2^32*(BgrDataHeight-1)/(Screen_Max_Y-1) + add edx, ebx ; edx:eax = y * 2^32*(BgrDataHeight-1)/(ScreenHeight-1) mov esi, edx imul esi, [BgrDataWidth] push edx @@ -919,7 +919,7 @@ vesa20_drawbackground_stretch: mov eax, [esp+12] mul dword [esp+28] add [esp], edx - pop edx ; edx:eax = x * 2^32*(BgrDataWidth-1)/(Screen_Max_X-1) + pop edx ; edx:eax = x * 2^32*(BgrDataWidth-1)/(ScreenWidth-1) add esi, edx lea esi, [esi*3] add esi, [img_background] @@ -957,13 +957,13 @@ sdp3: ; esi = offset in current line, edi -> output ; ebp = offset in WinMapAddress ; dword [esp] = offset in bgr data -; qword [esp+4] = x * 2^32 * (BgrDataWidth-1) / (Screen_Max_X-1) -; qword [esp+12] = y * 2^32 * (BgrDataHeight-1) / (Screen_Max_Y-1) +; qword [esp+4] = x * 2^32 * (BgrDataWidth-1) / (ScreenWidth-1) +; qword [esp+12] = y * 2^32 * (BgrDataHeight-1) / (ScreenHeight-1) ; dword [esp+20] = x ; dword [esp+24] = y ; precalculated constants: -; qword [esp+28] = 2^32*(BgrDataHeight-1)/(Screen_Max_Y-1) -; qword [esp+36] = 2^32*(BgrDataWidth-1)/(Screen_Max_X-1) +; qword [esp+28] = 2^32*(BgrDataHeight-1)/(ScreenHeight-1) +; qword [esp+36] = 2^32*(BgrDataWidth-1)/(ScreenWidth-1) sdp3a: cmp [ebp+WinMapAddress], byte 1 jnz snbgp diff --git a/programs/develop/fasm/trunk/fasm.asm b/programs/develop/fasm/trunk/fasm.asm index e3cb8ce77f..c6b566c6a7 100644 --- a/programs/develop/fasm/trunk/fasm.asm +++ b/programs/develop/fasm/trunk/fasm.asm @@ -43,6 +43,11 @@ START: ; Start of execution mov ecx, (fileinfos_end-fileinfos)/4 or eax, -1 rep stosd + push 68 + pop eax + push 11 + pop ebx + mcall cmp [params],0 jz red @@ -586,6 +591,7 @@ program_base dd ? buffer_address dd ? memory_setting dd ? start_time dd ? +memblock dd ? predefinitions rb 1000h diff --git a/programs/develop/fasm/trunk/system.inc b/programs/develop/fasm/trunk/system.inc index 17b6199c90..fb610f453e 100644 --- a/programs/develop/fasm/trunk/system.inc +++ b/programs/develop/fasm/trunk/system.inc @@ -59,26 +59,29 @@ filepos dd 0x0 ; ~5/8 - main memory init_memory: mcall 18, 16 - cmp eax, 0xFFFFFFFF shr 9 + cmp ecx, 0x38000000 shr 9 jbe @f - mov eax, 0xFFFFFFFF shr 9 + mov ecx, 0x38000000 shr 9 @@: - shl eax, 9 - lea ecx, [eax+stacktop] - mcall 64, 1 - mov [memory_start], stacktop - mov [additional_memory_end], ecx - sub ecx, stacktop + shl ecx, 9 + mcall 68, 12 + mov [memory_start], eax + mov [memblock], eax + push eax + add eax, ecx + mov [additional_memory_end], eax + pop eax shr ecx, 3 - lea ecx, [ecx*5+stacktop] - mov [memory_end],ecx - mov [additional_memory],ecx + add eax, ecx + lea eax, [ecx*4+eax] + mov [memory_end],eax + mov [additional_memory],eax ret exit_program: cmp [_mode],NORMAL_MODE jne @f - mcall 64, 1, stacktop + mcall 68, 13, [memblock] jmp still @@: or eax,-1