GS9 version v3.02 230124 by Alexandru Simion Version history: v3.02 - 230124 fixed text . bug fixed text render that was not wrapping . upd added align paramter to text render, and made use of the wrap value . upd docs now show the multiple out values of functions . upd docs now tell about how to use obj v3.01 - 221121 rebuild with new version . upd changed version to 221121 . upd updated the solution to VS2019 . upd updated FreeType library used in Font class to 2.12.1 (and built its staric libs from the Builds sln) . upd a file resolve function is used when compiling files: first we try to open from the current directory (as before) second try is from the folder of the script file who requested third try looks for the file in the gs executable's folder. . upd the command line compiler no longer tries to load gsc.gs (users should include it in their scripts) . upd updated the documentation and its build scripts and generated a new chm. v3.0b - 160510 rebuild with new version . upd changed version id from old to 160510 . upd added img shader mul and mul2x . upd get pixel for 24bits returns a color with alpha filled to 0xff . upd shader blend, add, sub, mul, mul2x they only write in RGB now (no longer set destination alpha to zero) v3.0b - 160318 fix img .upd gsFntSetSpacing (gs_ckint was gs_ckstr) .upd gsFntUseKerning (gs_ckint was gs_ckstr) .upd gsFntGetTextMetrics (gs_ckint was gs_ckstr) .upd added color as tab .bug fixed img rgb bgr issue v3.0b - 160224 .upd fixed some assert to gs_assert .upd the solution outputs to gsc/gsc.exe .upd updated the gs9_utils.gs with more functions from 130314 and other v3.0b - 160212 imglib .upd added img lib with support for fnt and tga .bug fixed an gs_assert instead of assert !!! forgot to update the version in exe (still 160204) !!! must do a propper version with docs and all v3.0b - 160204 recover based on code of 110330 an E9 engine version of GS9 reimplement lost features (?) v3.0b - 130131 (LOST, only exe remained) v3.0b - 110330 from E9 (from web 110910?) .upd compile include with relative paths .upd %d instead of %i .bug fixed "GLOBAL" function name to "gfname" in gs_compilebuffer .bug buffer size in gsEnv::GetSBuffer .bug gsStrImplode v3.0b - 130314 mkprj (LOST, only exe remained) ? .upd gsdemo loads the gs file with the same name as the exe from that path ? .upd probably support multiple global functions (removes them?) v3.0b - 090813 updated .upd get,set methodes uses a zero based stack .upd ptr type was moved after tab .upd all types work as bool, except NIL .upd changed grammar: cast format, type values, NUL for obj and fnc, etc. .upd removed explicit global declarations (only var now) .upd no default lib (must be registered manually) .bug fixed findfile, gs_env:158 global ref, .bug fixed pp report on vm errors (pp--) .bug fixed doc index to gather all libs v3.0b - 090718 Rewritten .upd most of the GS9 was rewritten for better speed and new features .upd strings and tables are managed and have reference counting .upd strings are immutable and unique, and are stored in a strings table .ups strings no longer expose the eos; sizeof(s) is the number of characters in string .upd values are no longer duplicated when pushed on stack .upd strings and tables are not duplicated when sent as parameters to functions .upd reference type was removed for speed purposes .upd multiple returning values support .upd new data types: function and object .upd function are stored as globals in the same globals variables table .upd support for c++ objects members access, through gsObj class and obj type .upd support for namespaces at compile time using long variables names .upd cache for strings and tables pointers to avoid memory fragmentation .upd different direct access and function calling from c/c++ .upd changed the c/c++ function format; no longer needs to return 0 or 1 .upd execution is stopped at the first encountered error (doesn't try to recover anymore) .upd support for precompiled binary scripts (export, import) .upd improved the assember instructions; use of set/get, setidx/getidx, etc. .upd updated and reorganized the libraries .upd updated the grammar using bison v2.4 (better errors reporting) .upd the GS9 book was updated experimental support: - "new" instruction to duplicate a table (not recursively) to be used like pos = new Vec3 or mat = new Mat4x4 where Vec3 is [0.0f,0.0f,0.0f] - gsObj support to access C++ class ins,tances, by calling Get, Set, Call virtual functions. note: DizzyAGE remains with GS9 v2.2 v2.2 - 080401 Upgrade (used in DizzyAGE v2.2) .upd added support for redefines (#def); if types match; used in multilanguage .bug fixed in console; poped the return, to avoid assert v2.1 - 080201 Fixes (used in DizzyAGE v2.1) .bug fixed bad bug in gso_tabdel function .upd added elegant stack overflow test .upd added gs_isrunning function v2.0 - 070612 New manual and updates (used in DizzyAGE v2.0) .upd type and size of object data changed to int instead of word, to allow huge strings .upd reversed zero defines for str and ptr. Now VOID is for strings and NULL for ptr. .upd logical operators and conditional jumps pop any type but NUL (false = 0, 0.0, VOID, bad ref, NULL) .upd simplified the gsdemo console to only use one command line parameter, for script file. .upd added scanln, getch in default lib and gs_commandline in win lib. .upd added tab add operator (+) to concatenate two tables. .upd restructured kit folders - 070901 .bug gs_findfile fixed .upd doc reviewed v1.3 - 070222 Doc, fixes and updates (intermediary build) .bug in gs.cpp was writing in the 32th of an array[32] .bug reading characters from strings failed because of char is signed .bug some char - byte conversions in gsVM .upd ptr new type and VOID value in objects, lexer, parser, compiler and virtual machine .upd changed file lib to use ptr instad of int for file pointer .upd file write and read text functions use now both \r and \n for end of lines .upd vc2005 solution (VC8) .upd type casts, some gsstrlen and intptr type, to avoid warnings in VC8 .upd OROR operation set to pop anything not just integers (hm?) .upd report file errors when not compiling (in include commands too) v1.2 - 060306 Doc and fixes (used in DizzyAGE) .bug trim function was failing some cases .upd manual have been updated, including chm doc .upd added math library .upd strskip function in default lib .bug negative defines are now accepted .upd renamed gs_error and gs_debug - 070219 small fixes and port to VC8 v1.1 - 051224 Update and fixes .bug (gsasm.cpp,56) pos<=a.size at gso_tabins .upd (gsasm.h,19) gsObj( dword ) .upd (gscfg.cpp) gsfile_open callback uses open modes: 0=rb,1=wb .bug (gscompiler.cpp,559) always add a return operation at the end of functions .bug (gsenv.cpp,52) check before free .bug (gsvm.cpp) treat operators as dwords in binary operations, because of the sign bit in integers .upd changed library mechanism .upd added more library functions like gs_do, gs_compile, or file support .bug fixed string functions when called with reference to string .upd don't return NUL when fails in functions that should return something. avoid using NUL objects, always return an acceptable value .bug solved a = b?c:1 parseing .bug gsdemo.exe use the debug flags argument .bug solved string parseing issue "\\" .upd notify errors in linking goto, when having a continue or a break command outside a loop .bug gs_compile string bug fixed .bug gs_frand repartitioned was wrong .upd gs_cpycall( vm,buffer,size ) in gs.h.cpp, added call info in error handler msgbox (on halt) .upd gsassertvm( vm,exp ) in gscfg.h, GSE_ASSERT in gserror.h.cpp .upd gs_debug export to dynamical set the vm->m_debug flags (flags const not exported) .upd gs9.chm help with index and stuff :) v1.0 - 050419 First official version (used in Saboteur95) .gs_dostring bug fixed .gs_recover will clear script callstack up to code level .gs_ckparams fixed .gso_tabs removed .file functions are over-writable .gserrorexit is over-writable; better errorexit .gsVM::Done clear callstack (recover) .libs are in the same directory v0.6 - 050129 .grammar: allow empty expressions, used in calls .fixed vm bug: objects leaks when comparing strings .libs: gs_rand, gs_frand, gs_srand .fixed nametype bug (non-static was returned) .implicit creation for STR and TAB; GSOP_NEW, GSNODE_NEW added .gserrorexit function .fixed decfn bug ( if params declaration failed, the error was not returned ) .defines with values for INT,FLT,STR; grammar: defobj .obj values; NUL allowed; changed tokens to TOK_NULVAL, TOK_INTVAL, ... .table cookie indexing (tab.member) throught variable value; string indexing eliminated; GSOP_IDX; varidd .better error handeling: gsErrInfo, gsErrorHandler, error codes changed, etc. .debug local vars in vm for current line, file, func (only on _DEBUG) .less parameters in function call allowed (NULs are pushed) v0.5 - 050112 .gs_reglib and lib register function changed to use vm insteed of env .GSFN_SCRIPTED flag .bug in compiler (node - n) .restrict locals again (must have different names than globals or fn) .restrict defines .remove @ and IDI .DECEXP become IFEXP .remove VARCK node (simplified) .hash for fn, var, sym v0.4 - 050111 .explicit declarations for globals and functions ( int i; var i; func fn; func fn(){} ) .implicit declarations for locals .allow local names to be the same as globals or functions .no more $ for globals (var: find local; else find global; else add local) .sizeof, typeof operators .@idd insteed of #idd .?var to test if not NUL (return 0 if NUL else 1) .exp ? exp : exp (GSNODE_SELEXP) .deny redeclarations (no change of global types, or change of non-empty or exported functions) .compare (==,!=) strings v0.3 - 050110 .no more explicit declarations (except extern globals for clarity) .cast operators work on expressions .call function use fid as last param .bug gs_type fixed .grammar change for simplicity (decidd_list) v0.2 - 050107 fixed some bugs $ globals etc v0.1 - 050103 first release If you want to ask questions or write your opinion, visit GS9 web site: http://www.simion.co.uk/gs9