diff --git a/programs/other/table/build.bat b/programs/other/table/build.bat new file mode 100644 index 0000000000..68db7eb40a --- /dev/null +++ b/programs/other/table/build.bat @@ -0,0 +1,8 @@ +call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" + +@cl /c /O2 /nologo /GS- /GR- /fp:fast *.cpp +@link /nologo /manifest:no /entry:crtStartUp /subsystem:native /base:0 /fixed /align:16 /nodefaultlib hello.obj *.obj +@pe2kos hello.exe hello.kex +@del hello.exe +@del *.obj +pause \ No newline at end of file diff --git a/programs/other/table/func.cpp b/programs/other/table/func.cpp index 2c7b95e0a4..4e903798fc 100644 --- a/programs/other/table/func.cpp +++ b/programs/other/table/func.cpp @@ -235,13 +235,16 @@ void format( char *Str, int len, char* Format, ... ) Str[j] = 0; } -void *memcpy(void *dst, const void *src, unsigned size) +void *memcpy2(void *dst, const void *src, unsigned size) { while (size--) *((char*)dst+size) = *((char*)src+size); return dst; } */ + + + int strcmp(const char *s1, const char *s2) { int i; diff --git a/programs/other/table/hello.cpp b/programs/other/table/hello.cpp index a2a700f54d..8d589d1ea4 100644 --- a/programs/other/table/hello.cpp +++ b/programs/other/table/hello.cpp @@ -697,7 +697,7 @@ void draw_window() if (window_drawall==true){ kos_WindowRedrawStatus(1); - kos_DefineAndDrawWindow(10,40,WND_W,WND_H,0x33,0x40FFFFFF,0,0,(Dword)"Table v" TABLE_VERSION); + kos_DefineAndDrawWindow(10,40,WND_W,WND_H,0x73,0x40FFFFFF,0,0,(Dword)"Table v" TABLE_VERSION); kos_WindowRedrawStatus(2); if (info.rawData[70]&0x04) return; //ничего не делать если окно схлопнуто в заголовок @@ -726,15 +726,15 @@ void draw_window() file_box.left = 64; file_box.top = y - 1; file_box.width = 98; - //editbox_h = 18; + //editbox_h = 18; // сохранить kos_DefineButton(20 + 160, y - 5, 60, 20, SAVE_BUTTON, 0xd0d0d0); - kos_WriteTextToWindow(22 + 160 + (60 - strlen(sSave) * 6) / 2, y + 2, 0, 0x000000, (char*)sSave, strlen(sSave)); + kos_WriteTextToWindow(22 + 160 + (60 - strlen(sSave) * 6) / 2, y + 2, 0x80, 0x000000, (char*)sSave, 0); // загрузить kos_DefineButton(90 + 160, y - 5, 60, 20, LOAD_BUTTON, 0xd0d0d0); - kos_WriteTextToWindow(92 + 160 + (60 - strlen(sLoad) * 6) / 2, y + 2, 0, 0x000000, (char*)sLoad, strlen(sLoad)); + kos_WriteTextToWindow(92 + 160 + (60 - strlen(sLoad) * 6) / 2, y + 2, 0x80, 0x000000, (char*)sLoad, 0); // создать. только эту кнопу воткнуть некуда о_О /* diff --git a/programs/other/table/hello.dsp b/programs/other/table/hello.dsp deleted file mode 100644 index bb7d180c40..0000000000 --- a/programs/other/table/hello.dsp +++ /dev/null @@ -1,139 +0,0 @@ -# Microsoft Developer Studio Project File - Name="hello" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=hello - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "hello.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "hello.mak" CFG="hello - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "hello - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /Zp1 /W3 /vd0 /O2 /YX /FD /c -# SUBTRACT CPP /X -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "NDEBUG" -# ADD RSC /l 0x419 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /base:"0" /entry:"crtStartUp" /subsystem:windows /machine:I386 /nodefaultlib /align:16 -# SUBTRACT LINK32 /pdb:none -# Begin Custom Build -InputPath=.\Release\hello.exe -SOURCE="$(InputPath)" - -"hello.kex" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - pe2kos Release\hello.exe hello.kex - -# End Custom Build -# Begin Target - -# Name "hello - Win32 Release" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\calc.cpp -# End Source File -# Begin Source File - -SOURCE=.\func.cpp -# End Source File -# Begin Source File - -SOURCE=.\hello.cpp -# End Source File -# Begin Source File - -SOURCE=.\KosFile.cpp -# End Source File -# Begin Source File - -SOURCE=.\kosSyst.cpp -# End Source File -# Begin Source File - -SOURCE=.\math2.cpp -# End Source File -# Begin Source File - -SOURCE=.\mcsmemm.cpp -# End Source File -# Begin Source File - -SOURCE=.\parser.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\calc.h -# End Source File -# Begin Source File - -SOURCE=.\func.h -# End Source File -# Begin Source File - -SOURCE=.\KosFile.h -# End Source File -# Begin Source File - -SOURCE=.\kosSyst.h -# End Source File -# Begin Source File - -SOURCE=.\MCSMEMM.H -# End Source File -# Begin Source File - -SOURCE=.\parser.h -# End Source File -# Begin Source File - -SOURCE=.\use_library.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/programs/other/table/hello.dsw b/programs/other/table/hello.dsw deleted file mode 100644 index 07550fec4b..0000000000 --- a/programs/other/table/hello.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "hello"=".\hello.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/programs/other/table/kosSyst.cpp b/programs/other/table/kosSyst.cpp index f80309b216..62f4452c31 100644 --- a/programs/other/table/kosSyst.cpp +++ b/programs/other/table/kosSyst.cpp @@ -94,7 +94,7 @@ Dword rtlRand( void ) return RandomSeed; } -#ifdef AUTOBUILD +//#ifdef AUTOBUILD // Well, not really related to auto-build, but some compilation issue void memcpy( void *dst, const void *src, size_t bytesCount ) { @@ -118,7 +118,7 @@ void memset( Byte *dst, Byte filler, Dword count ) rep stosb } } -#endif +//#endif // diff --git a/programs/other/table/kosSyst.h b/programs/other/table/kosSyst.h index 13a1c7ec16..7aafa2740c 100644 --- a/programs/other/table/kosSyst.h +++ b/programs/other/table/kosSyst.h @@ -122,17 +122,21 @@ char * __cdecl strcpy( char *target, const char *source ); int __cdecl strlen( const char *line ); char * __cdecl strrchr( const char * string, int c ); +/* #if _MSC_VER < 1400 extern "C" void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount ); extern "C" void memset( Byte *dst, Byte filler, Dword count ); //#pragma intrinsic(memcpy,memset) #elif defined AUTOBUILD +*/ void memcpy( void *dst, const void *src, size_t bytesCount ); void memset( Byte *dst, Byte filler, Dword count ); +/* #else void * __cdecl memcpy( void *dst, const void *src, size_t bytesCount ); void memset( Byte *dst, Byte filler, Dword count ); #endif +*/ void sprintf( char *Str, char* Format, ... ); // diff --git a/programs/other/table/mymath.h b/programs/other/table/mymath.h deleted file mode 100644 index 6d911d875c..0000000000 --- a/programs/other/table/mymath.h +++ /dev/null @@ -1,95 +0,0 @@ -/* Rocket Forces - * Filename: mymath.h - * Version 0.1 - * Copyright (c) Serial 2007 - */ - - -extern "C" int _fltused = 0; - -#define M_PI 3.14159265358979323846 - -inline double sin(double x) -{ - __asm fld x - __asm fsin -} - -inline double cos(double x) -{ - __asm fld x - __asm fcos -} - -inline double sqrt(double x) -{ - __asm fld x - __asm fsqrt -} - -inline double acos(double x) -{ - __asm fld x - __asm fld st(0) - __asm fmul st,st(1) - __asm fld1 - __asm fsubrp st(1),st(0) - __asm fsqrt - __asm fxch st(1) - __asm fpatan -} - -inline double atan(double x) -{ - double res = acos(1 / sqrt(1 + x * x)); - if (x < 0) - { - res *= -1; - } - return res; -} - -inline int round_int(double x) -{ - int i; - static const float round_to_nearest = 0.5f; - __asm - { - fld x - fadd st, st(0) - fadd round_to_nearest - fistp i - sar i, 1 - } - return i; -} - -inline int floor_int(double x) -{ - int i; - static const float round_toward_m_i = -0.5f; - __asm - { - fld x - fadd st, st (0) - fadd round_toward_m_i - fistp i - sar i, 1 - } - return i; -} - -inline int ceil_int(double x) -{ - int i; - static const float round_toward_p_i = -0.5f; - __asm - { - fld x - fadd st, st (0) - fsubr round_toward_p_i - fistp i - sar i, 1 - } - return (-i); -} diff --git a/programs/other/table/parser.cpp b/programs/other/table/parser.cpp index 2bb34e8307..d8ec281aaf 100644 --- a/programs/other/table/parser.cpp +++ b/programs/other/table/parser.cpp @@ -318,6 +318,7 @@ double func_rand(double max) return q - max * func_floor(q / max); // для модуля } +/* double func_case(double_list *p) { if (!p || !p->next) @@ -368,6 +369,7 @@ double func_case(double_list *p) code = cur->code; return cur->val; } +*/ #define INF_ARGS -1 #define STR_ARG -2 @@ -389,7 +391,7 @@ typedef struct } func; // the list of functions -const int max_func = 29; +const int max_func = 28; func functions[max_func] = { "", 1, NULL, // не помню, с какой целью @@ -418,7 +420,7 @@ func functions[max_func] = "or",2,&logic_or, "xor",2,&logic_xor, "rand",1,&func_rand, - "case",INF_ARGS,&func_case, + //"case",INF_ARGS,&func_case, "pi",0,&func_pi, "eps",0,&func_eps };