Commit Graph

22 Commits (master)

Author SHA1 Message Date
kts fb149cfad8 Precompiler now reads the given source file into a buffer, rather than reading char by char during parsing. This allows for more flexibility in looking forwards and backwards during expression parsing at the expense of memory. Depending on the parsing methods chosen, this may be changed back to single forward reads directly from the file. 2014-05-27 21:45:25 -07:00
kts 9f32631fe5 Added rolls test program. This reads rolls.tsc in and attempts to do some basic attack/defend rolls for Tiles. Also added the basic structure for the VM function precompiler. Next modification will likely be converting the current VM precompiling code into using a buffer rather than reading from the file handle directly. This will allow for forward reading of characters in addition to backwards, thereby allowing for easier expression parsing (at least towards what I am conceiving of it thus far). 2014-05-17 16:28:24 -07:00
kts 42de0d491c Fixed up potential bugs and warnings revealed by clang. 2014-04-29 13:08:08 -07:00
kts 22a8e518e1 Cleaned up and organized vm_compile.c/.h - will add expression parsing and dynamic memory management within the vm soon 2014-04-28 19:59:46 -07:00
kts 6f1ffe3563 More added to the precompiler. To be done is function parameter word parsing into vm_pc_Variable Tables as well as the bulk of source to operation precompilation. 2014-04-25 12:53:31 -07:00
kts 30472bf0ca Precompiler now adds Variables to a pc_Variable Table. Additional precompilation error checking implemented. TablePair now uses a T_POINTER type. If this data type is used, the memory pointed to is _not_ freed when the TablePair or its parent Table is freed. The developer must remember to free this data type manually when it is used. 2014-04-15 11:18:52 -07:00
kts 902e21ebc6 After far too long of a delay, a git commit. The updates pertain to vm_compile and implements the basic parsing of virtual machine C source files into global, group, and local scopes. At the moment it does not convert to op codes - it only identifies variables declared outside of functions for the given scope. 2014-04-02 00:37:31 -07:00
kts c7daa2d1b7 Added a test compiler program. Not much functionality yet, but it describes the precompilation (and, to a lesser extent, precompilation) of VM functions. 2014-03-16 19:37:51 -07:00
kts d42b12885f Added a load module state that provides a button list of modules found in the ../modules directory. When clicking on one, it will attempt to load ../modules/MODULE_NAME/MODULE_NAME.tsd into struct Data* g_tile_data. If it succeeds, it switches to a test state where I will be tweaking stuff like tile movement and similar. I will also add spritesheet loading in the load module state. 2014-03-11 23:56:23 -07:00
kts 722ceb5747 Reorganized the project root, deleted unnecessary files, moved data.c/.h, fio.c/.h, llist.c/.h into common and old code into old/ directory. All modules will now reside on the modules/ directory. 2014-03-10 12:41:49 -07:00
kts 53ffd0fce3 Added vm.c/.h in test. Implemented a good portion of the bytecode execution system. Need to implement non int data type operations. The VM is coming together\! 2014-03-06 23:54:19 -08:00
kts a590956502 Added vm_memory.c in test/ - basically just a test bed for vm memory. 2014-03-06 13:05:02 -08:00
kts 452bdf4a1d Cleaned up code in data.c and organized it. Current and future code will be formatted in adherence to the current draft of KCS. Also added datatype-specific writing and reading functions for TablePair values. This reduces the chance of unexpected behaviors when one datatype is interpreted as another. 2014-03-03 12:11:19 -08:00
kts bbcd6cd0aa More stuff added - how nondescript. In particular, data.c/.h now includes a function for loading in a .tsc, or timesynk configuration file, into a Table. This adheres to the information regarding the timesynk Configuration Syntax on the wiki. This feature has been implemented in the engine, as video width, height, and other similar options are loaded from the settings.tsc file relative to the engine. Also added a modules directory with a basic skeleton for the Xibalba module. 2014-03-02 22:10:49 -08:00
kts 9b5a1ed4b3 Added rendering code for sprite and fonts, made a pretty bad high precision timer - while being higher precision than SDL_GetTicks, it has a few problems that I must sort out. Also need to make it crossplatform. 2014-02-25 02:45:10 -08:00
kts 30f71466fd Much progress on the tile editor, as it can now read in a .tsd file using the earlier developed data.c/data.h (Data, TileSetData, TileData, etc. structs and accompanying functions). Once a file is successfully loaded, changing the set/id will attempt to populate the GUI with key=>value pairs for the given tile, if it exists. Partially implemented is the parsing of InventoryData. Will implement adding new TablePairs through the GUI and the saving of any changes back to a .tsd file. Fixed some memory allocation problems as well - some leakage still existing in the tile editor as well as the Data functions/structs, but they are noted and will be taken care of in time. 2014-01-17 04:03:10 -08:00
kts 4ca32efeee Added an empty skeleton for the tile editor, including its own sub-directory in tile_editor/ (along with corresponding Makefile), as well as its own Target in timesynk's XCode project file. 2013-12-27 23:22:04 -08:00
kts f2422fdada added getTileDataById to data.h, as it was causing segfaults on gcc 4.2.1, mac os 10.6.8/x86 without it. Also fixed pack_data.c, as it was attempting to load the tile data directory before checking argc if an arg was passed. Also added equipment to ibexian shocktrooper and barbarian in xibalba/players for additional testing. 2013-12-24 06:01:43 -08:00
kts d5f4947c90 Yet again committed the sin of not committing for a long duration of time. As I recall: Finished most of the code for parsing a ts tile declaration file into data structures. In doing so added the InventoryData structure, which simply contains the name of the target tile, the count of tiles(using struct Range, which has min and max properties), the chance of spawn(using a float from 0.0 to 100.0), and an optional pointer to the next InventoryData in the line (akin to Tile Chains). Still todo is for TileData's TablePairs to be parsed into more than char*=>char* pairs, such as char*=>int, char*=>float, etc.. This will be far more efficient and given that TablePair(s) already contain the property for type, it should be done. Also added variations to addTablePair/setTablePair - addTablePairPointer and setTablePairPointer. These functions set the value pointer to the passed pointer rather than allocating new memory and copying the pointer's target memory to that new memory. 2013-12-24 05:37:15 -08:00
kts c7f3ac15d3 added pack_tiles.c, providing pack_tiles, a program that takes a directory as an argument and creates a new file (directory/directory.tsd) from cleaned files 'doors', 'floors', 'npcs', 'walls', 'equips', 'items', and 'players' in that directory. At the moment it can be used on the xibalba directory to create 'xibalba/xibalba.tsd', which can then be tested with test/t2d.c, providing the internal filename referenced is changed. At the moment the Data system does not properly deal with inventories so any inventory/equipment declaration is ignored. 2013-12-21 02:38:08 -08:00
kts 0005a93d65 Implemented Data system fully now (not integrated into ts engine itself yet). In the process added a new Table (hash table) system that matches keys to values. More information pertaining to that in data.h/data.c. Might switch over to a system wherein all Tiles are actually TileData structs (or contain TileData structs). This would increase the processing necessary, as values for properties must be acquired from a string instead of reading from a pre-defined struct, but it would increase the modularity immensely as there is no real limit on the amount of properties a Tile may contain (which will be most important once the interpreter is implemented and used for tile movement, collisions, etc.). 2013-12-20 18:24:06 -08:00
kts e2e015c76b Added two folders: test/ and xibalba/. Contained within test/ are two test/devel-beds for two systems that will be integrated within ts. The first is script.c, which is the development program for the interpreter system - this interpreter system allows for the setting of variables (both local and global), the creation of new functions, and the definition of default in-game functions such as dice rolling and the like. The second file, t2d.c functions as a basic test utility for Tile Data loading and the like - it interprets a tileset/tile definition file into Data, TileDataSet, and TileData(s) respectively. These structs, as defined in data.c/.h, allow for reference to tiles by TID:ID or simply by name through the use of key=>value pairs. It is from these structs and their accompanying access functions that new Tiles will be created (perhaps later optimized through a basic Tile array that contains semi-populated Tile(s) that can be memcpy'd similar to the current system). Also added the xibalba/ sub-dir that will contain the various data for Xibalba (tile definitions, graphics, map creation, etc.), moving majority of what is in tiles/ into xibalba/. 2013-12-17 17:08:37 -08:00