fix life2, update life3

git-svn-id: svn://kolibrios.org@8199 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2020-11-16 07:55:40 +00:00
parent 74a3bc7a32
commit 2e185e713d
8 changed files with 36 additions and 74 deletions

View File

@ -197,7 +197,6 @@ extra_files = {
{"kolibrios/emul/kwine/lib/", PROGS .. "/emulator/kwine/bin/lib/*"},
{"kolibrios/demos/ak47.lif", "common/demos/ak47.lif"},
{"kolibrios/demos/life2", "common/demos/life2"},
{"kolibrios/demos/life3tb.png", PROGS .. "/games/life3/trunk/life3tb.png"},
{"kolibrios/demos/relay.lif", "common/demos/relay.lif"},
{"kolibrios/demos/rpento.lif", "common/demos/rpento.lif"},
{"kolibrios/games/BabyPainter", "common/games/BabyPainter"},

Binary file not shown.

View File

@ -101,19 +101,11 @@ end if
movsd
Kolibri_Put_MovEaxVal_Ret @Kolibri@GetPid$qv,edx
if defined KolibriHeapInit
mov ecx,esp
push ebx
push ecx
push U_END
call KolibriHeapInit ; Initialize a dynamic heap and create new memory in its begin.
pop ecx ; Parameters: begin of a new heap, end of data to create in
mov [esp+4],eax ; the begin of a heap. Return address of the created data.
mov dword [esp],0
else
call KolibriHeapInit ; Initialize a dynamic heap
end if
xor eax,eax
push eax
push eax
end if
call @Kolibri@ThreadMain$qpvt1
.ThreadFinish:
add esp,8

View File

@ -2,31 +2,15 @@
#define __KOLIBRI_HEAP_H_INCLUDED_
#include "kolibri.h"
#include "memheap.h"
// Kolibri memory heap interface.
namespace Kolibri // All kolibri functions, types and data are nested in the (Kolibri) namespace.
{
long _HeapInit()
{
return MemoryHeap::mem_Init();
}
void *Alloc(unsigned int size)
{
return MemoryHeap::mem_Alloc(size);
}
void *ReAlloc(void *mem, unsigned int size)
{
return MemoryHeap::mem_ReAlloc(size, mem);
}
void Free(void *mem)
{
MemoryHeap::mem_Free(mem);
}
long HeapInit();
void *Alloc(unsigned long int size);
void *ReAlloc(void *mem, unsigned long int size);
void Free(void *mem);
}
#endif // ndef __KOLIBRI_HEAP_H_INCLUDED_

View File

@ -1,37 +1,42 @@
;/***
KolibriHeapInit = @@Kolibri@_HeapInit$qv
KolibriHeapInit = @Kolibri@HeapInit$qv
KolibriHeapAlloc = @@Kolibri@Alloc$qui
KolibriHeapAlloc = @Kolibri@Alloc$qul
KolibriHeapReAlloc = @@Kolibri@ReAlloc$qpvui
KolibriHeapReAlloc = @Kolibri@ReAlloc$qpvul
KolibriHeapFree = @@Kolibri@Free$qpv
KolibriHeapFree = @Kolibri@Free$qpv
proc @MemoryHeap@mem_Init$qv uses ebx
align 4
proc @Kolibri@HeapInit$qv uses ebx
mov eax,SF_SYS_MISC
mov ebx,SSF_HEAP_INIT
int 0x40
ret
endp
proc @MemoryHeap@mem_Alloc$qul uses ebx
align 4
proc @Kolibri@Alloc$qul uses ebx
mov eax,SF_SYS_MISC
mov ebx,SSF_MEM_ALLOC
mov ecx,[esp+8]
int 0x40
ret
endp
proc @MemoryHeap@mem_ReAlloc$qulpv uses ebx
align 4
proc @Kolibri@ReAlloc$qpvul uses ebx
mov eax,SF_SYS_MISC
mov ebx,SSF_MEM_REALLOC
mov ecx,[esp+8]
mov edx,[esp+12]
mov ecx,[esp+12]
mov edx,[esp+8]
int 0x40
ret
endp
proc @MemoryHeap@mem_Free$qpv uses ebx
align 4
proc @Kolibri@Free$qpv uses ebx
mov eax,SF_SYS_MISC
mov ebx,SSF_MEM_FREE
mov ecx,[esp+8]

View File

@ -1,13 +0,0 @@
#ifndef __MEMORY_HEAP_H_INCLUDED_
#define __MEMORY_HEAP_H_INCLUDED_
namespace MemoryHeap
{
long mem_Init();
void *mem_Alloc(unsigned long size);
void *mem_ReAlloc(unsigned long size, void *mem);
bool mem_Free(void *mem);
}
#endif // ndef __MEMORY_HEAP_H_INCLUDED_

View File

@ -16,7 +16,7 @@ proc @Kolibri@OpenFileDialog$qr23Kolibri@TOpenFileStruct uses ebx esi edi ebp
mov esi,ecx
.open_file_dlg_alloc:
push esi
call @@Kolibri@Alloc$qui
call @Kolibri@Alloc$qul
pop ecx
test eax,eax
jz .open_file_dlg_ret
@ -97,7 +97,7 @@ proc @Kolibri@OpenFileDialog$qr23Kolibri@TOpenFileStruct uses ebx esi edi ebp
push eax
push esi
push dword [esp+8]
call @@Kolibri@ReAlloc$qpvui
call @Kolibri@ReAlloc$qpvul
add esp,8
mov ecx,eax
pop eax
@ -131,7 +131,7 @@ proc @Kolibri@OpenFileDialog$qr23Kolibri@TOpenFileStruct uses ebx esi edi ebp
mov [esp+8],eax
push eax
push dword [esp+4]
call @@Kolibri@ReAlloc$qpvui
call @Kolibri@ReAlloc$qpvul
add esp,8
test eax,eax
jz .open_file_dlg_end
@ -143,12 +143,12 @@ proc @Kolibri@OpenFileDialog$qr23Kolibri@TOpenFileStruct uses ebx esi edi ebp
mov ebx,[esp+20]
mov dword [ebx],2
push dword [ebx+4]
call @@Kolibri@Free$qpv
call @Kolibri@Free$qpv
pop ecx
mov [ebx+4],esi
jmp .open_file_dlg_invalidate
.open_file_dlg_end:
call @@Kolibri@Free$qpv
call @Kolibri@Free$qpv
add esp,12
mov ebx,[esp+20]
mov dword [ebx],1

View File

@ -12,7 +12,7 @@ include '../../../develop/libraries/box_lib/load_lib.mac'
;include 'lang.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
hed db 'Life 04.11.18',0 ;¯®¤¯¨áì ®ª­ 
hed db 'Life 16.11.20',0 ;¯®¤¯¨áì ®ª­ 
run_file_70 FileInfoBlock
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
@ -75,20 +75,17 @@ align 4
proc pole_init_colors uses eax ebx ecx edx esi edi, col_pole:dword, col_cell_n:dword, col_cell_o:dword
mov esi,[CellColors]
mov ebx,[col_pole]
mov dword[esi],ebx
mov [esi],ebx
lea edi,[esi+4*COL_MEM]
add esi,4
mov edi,COL_MEM
dec edi
shl edi,2
add edi,esi
; esi - 㪠§ â¥«ì ­  1-© £à ¤¨¥­â­ë© 梥â
; edi - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© £à ¤¨¥­â­ë© 梥â
mov eax,[col_cell_n]
mov ebx,[col_cell_o]
mov dword[esi],eax
mov dword[edi],ebx
mov [esi],eax
mov [edi],ebx
;need save ecx edx
stdcall middle_colors, esi,edi
@ -1767,13 +1764,6 @@ import_buf2d:
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
mouse_dd dd 0
sc system_colors
last_time dd 0
align 16
procinfo process_information
align 4
buf_0: dd 0
.l: dw 0 ;+4 left
@ -1783,7 +1773,12 @@ buf_0: dd 0
.color: dd 0xffffd0 ;+16 color
db 24 ;+20 bit in pixel
align 16
i_end:
mouse_dd dd 0
last_time dd 0
sc system_colors
procinfo process_information
rb 1024
stacktop:
sys_path rb 1024