diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index 0f32ad0d99..f788bdb25a 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -14,9 +14,13 @@ #code32 TRUE +#ifndef ENTRY_POINT + #define ENTRY_POINT #______INIT______ +#endif + char os_name[8] = {'M','E','N','U','E','T','0','1'}; dword os_version = 0x00000001; -dword start_addr = #______INIT______; +dword start_addr = ENTRY_POINT; dword final_addr = #______STOP______+32; dword alloc_mem = MEMSIZE; dword x86esp_reg = MEMSIZE; @@ -644,7 +648,7 @@ inline fastcall dword GetStartTime() dword __generator; // random number generator init //The initialization of the initial data before running -void ______INIT______() +:void ______INIT______() { skin_height = @GetSkinHeight(); screen.width = @GetScreenWidth()+1; diff --git a/programs/cmm/misc/mblocks.c b/programs/cmm/misc/mblocks.c index d0db99a8c8..8c87ecde91 100644 --- a/programs/cmm/misc/mblocks.c +++ b/programs/cmm/misc/mblocks.c @@ -5,6 +5,8 @@ */ #define MEMSIZE 1024 * 20 +#define ENTRY_POINT #main + #include "..\lib\gui.h" #include "..\lib\random.h" @@ -104,7 +106,7 @@ void main() case evReDraw: sc.get(); - DefineAndDrawWindow(215,100,WIN_W + 9,WIN_H+4+skin_height, + DefineAndDrawWindow(215,100,WIN_W + 9,WIN_H+4+GetSkinHeight(), 0x34,0xC0C0C0,"Memory Blocks",0); Draw_Panel(); Draw_Game_Pole(); diff --git a/programs/games/c4/trunk/c4.asm b/programs/games/c4/trunk/c4.asm index a103858047..a175e4b502 100644 --- a/programs/games/c4/trunk/c4.asm +++ b/programs/games/c4/trunk/c4.asm @@ -719,12 +719,12 @@ updatePlayerStatusText: ; ; window definition ; -windowtitle db "C4 0.1",0 +windowtitle db "C4",0 window: istruc WND at WND.xposandsize, dd MOS_DWORD(0,WND_WIDTH) at WND.yposandsize, dd MOS_DWORD(0,WND_HEIGHT) - at WND.workcolor, dd 0x03000000 | WND_WORKCOLOR + at WND.workcolor, dd 0x14000000 | WND_WORKCOLOR at WND.grabcolor, dd 0 at WND.framecolor, dd 0 at WND.caption, dd windowtitle diff --git a/programs/games/c4/trunk/windows.inc b/programs/games/c4/trunk/windows.inc index 01f0e11949..05cd588c60 100644 --- a/programs/games/c4/trunk/windows.inc +++ b/programs/games/c4/trunk/windows.inc @@ -128,59 +128,15 @@ drawWindow: mov cx,[edi + WND.yposandsize] .positionok: ; ebx/ecx contain dimensions - ; - ; colors - ; push edi - mov edx,[edi + WND.workcolor] - test dword [edi + WND.flags],WND_DEFAULT_WORKCOLOR - jz short .workcolorok - and edx,0xff000000 - or edx,[WNDCOLORS + MOS_WNDCOLORS.work] -.workcolorok: - mov esi,[edi + WND.grabcolor] - test dword [edi + WND.flags],WND_DEFAULT_GRABCOLOR - jz short .grabcolorok - and esi,0xff000000 - or esi,[WNDCOLORS + MOS_WNDCOLORS.grab] -.grabcolorok: - test dword [edi + WND.flags],WND_DEFAULT_FRAMECOLOR - mov edi,[edi + WND.framecolor] - jz short .framecolorok - and edi,0xff000000 - or edi,[WNDCOLORS + MOS_WNDCOLORS.frame] -.framecolorok: ; define window mov eax,MOS_SC_DEFINEWINDOW + mov edx,[edi + WND.workcolor] + mov edi,windowtitle int 0x40 pop edi - ; - ; caption - ; - cmp dword [edi + WND.caption],0 ; is there a caption ? - je short .captionok ; nope -> do nothing - mov ebx,MOS_DWORD(8,8) ; ebx = position - mov edx,[edi + WND.caption] ; edx -> string - push edi ; get string length - mov edi,edx - mov ecx,-1 - xor al,al ; scan for zero byte - repne scasb - sub edi,edx - dec edi - mov esi,edi - pop edi ; esi = string length - mov ecx,[edi + WND.captioncolor] - test dword [edi + WND.flags],WND_DEFAULT_CAPTIONCOLOR - jz short .captioncolorok - mov ecx,[WNDCOLORS + MOS_WNDCOLORS.grabText] -.captioncolorok: - mov eax,MOS_SC_WRITETEXT - int 0x40 -.captionok: - popad popfd leave