Merge branch 'master' into sdl_extract
This commit is contained in:
		
							
								
								
									
										11
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Makefile
									
									
									
									
									
								
							@@ -46,14 +46,15 @@ LINUX_INCLUDES= \
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
LINUX_LIBS= \
 | 
					LINUX_LIBS= \
 | 
				
			||||||
	$(GTK_LIBS) \
 | 
						$(GTK_LIBS) \
 | 
				
			||||||
	`sdl2-config --static-libs`
 | 
						`sdl2-config --static-libs` \
 | 
				
			||||||
 | 
						-L$(3RD_PARTY)/wren-0.1.0/lib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LINUX64_LIBS= \
 | 
					LINUX64_LIBS= \
 | 
				
			||||||
	$(LINUX_LIBS) \
 | 
						$(GTK_LIBS) \
 | 
				
			||||||
	-L$(PRE_BUILT)/linux64
 | 
						-L$(PRE_BUILT)/linux64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LINUX32_LIBS= \
 | 
					LINUX32_LIBS= \
 | 
				
			||||||
	$(LINUX_LIBS) \
 | 
						$(GTK_LIBS) \
 | 
				
			||||||
	-L$(PRE_BUILT)/linux32
 | 
						-L$(PRE_BUILT)/linux32
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LINUX_ARM_LIBS= \
 | 
					LINUX_ARM_LIBS= \
 | 
				
			||||||
@@ -323,14 +324,14 @@ run: mingw-pro
 | 
				
			|||||||
	$(MINGW_OUTPUT)
 | 
						$(MINGW_OUTPUT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
linux64-lto:
 | 
					linux64-lto:
 | 
				
			||||||
	$(CC) $(LINUX_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX64_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o $(BIN_NAME)
 | 
						$(CC) $(GTK_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX64_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o $(BIN_NAME)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
linux64-lto-pro:
 | 
					linux64-lto-pro:
 | 
				
			||||||
	$(eval OPT += $(OPT_PRO))
 | 
						$(eval OPT += $(OPT_PRO))
 | 
				
			||||||
	make linux64-lto OPT="$(OPT)"
 | 
						make linux64-lto OPT="$(OPT)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
linux32-lto:
 | 
					linux32-lto:
 | 
				
			||||||
	$(CC) $(LINUX_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX32_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o $(BIN_NAME)
 | 
						$(CC) $(GTK_INCLUDES) $(SOURCES) $(TIC80_SRC) $(SOURCES_EXT) $(OPT) $(INCLUDES) $(LINUX32_LIBS) $(LINUX_LINKER_LTO_FLAGS) -flto -o $(BIN_NAME)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
linux32-lto-pro:
 | 
					linux32-lto-pro:
 | 
				
			||||||
	$(eval OPT += $(OPT_PRO))
 | 
						$(eval OPT += $(OPT_PRO))
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										52
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								README.md
									
									
									
									
									
								
							@@ -1,12 +1,50 @@
 | 
				
			|||||||
# TIC-80 issues tracker and wiki
 | 
					
 | 
				
			||||||
 | 
					**TIC-80 TINY COMPUTER** - [https://tic.computer/](https://tic.computer/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Discord chat](https://discord.gg/DkD73dP)
 | 
					# About
 | 
				
			||||||
 | 
					TIC-80 is a **FREE** and **OPEN SOURCE** fantasy computer for making, playing and sharing tiny games.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This is the official issues tracker of <https://tic.computer>. If you are experiencing a bug or would like to see a new feature [browse existing issues](https://github.com/nesbox/tic.computer/issues) or [create a new one](https://github.com/nesbox/tic.computer/issues/new).
 | 
					With TIC-80 you get built-in tools for development: code, sprites, maps, sound editors and the command line, which is enough to create a mini retro game.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Documentation is available in the [wiki](https://github.com/nesbox/tic.computer/wiki).
 | 
					Games are packeged into a cartridge file, which can be easily distributed. TIC-80 works on all popular platforms. This means your cartridge can be played in any device.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Thanks!
 | 
					To make a retro styled game, the whole process of creation and execution takes place under some technical limitations: 240x136 pixels display, 16 color palette, 256 8x8 color sprites, 4 channel sound and etc.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Features
 | 
				
			||||||
 | 
					- Multiple progamming languages: Lua, Moonscript, Javascript and Wren
 | 
				
			||||||
 | 
					- Games can have mouse and keyboard as input
 | 
				
			||||||
 | 
					- Games can have up to 4 controllers as input
 | 
				
			||||||
 | 
					- Builtin editors: for code, sprites, world maps, sound effects and music
 | 
				
			||||||
 | 
					- An aditional memory bank: load different assets from your cartridge while your game is executing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Binaries Downloads
 | 
				
			||||||
 | 
					You can download compiled versions for the major operating systems directly from our [releases page](https://github.com/nesbox/TIC-80/releases).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Pro Version
 | 
				
			||||||
 | 
					To help supporting the TIC-80 development, we have a [PRO Version](https://nesbox.itch.io/tic).
 | 
				
			||||||
 | 
					This version has a few aditional features and can only be download on [our Itch.io page](https://nesbox.itch.io/tic).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For users who can't spend the money, we made it easy to build the pro version from the source code.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Pro features
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Save/load cartridges in text format, and create your game in any editor you want, also useful for version control systems.
 | 
				
			||||||
 | 
					- Even more memory banks: instead of having only 1 memory bank you have 8.
 | 
				
			||||||
 | 
					- Export your game only without editors, and then publish it to app stores (WIP).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Community
 | 
				
			||||||
 | 
					You can play and share games, tools and music at [tic.computer](https://tic.computer/play).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The community also hangs and discuss on [Discord chat](https://discord.gg/DkD73dP).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Contributing
 | 
				
			||||||
 | 
					You are can contribute by issuing a bug or requesting a new feature on our [issues page](https://github.com/nesbox/tic.computer/issues).
 | 
				
			||||||
 | 
					Keep in mind when engaging on a discussion to follow our [Code of Conduct](https://github.com/nesbox/TIC-80/blob/master/CODE_OF_CONDUCT.md).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					You can also contribute by reviewing or improving our [wiki](https://github.com/nesbox/tic.computer/wiki).
 | 
				
			||||||
 | 
					The [wiki](https://github.com/nesbox/tic.computer/wiki) holds TIC-80 documentation, code snippets and game development tutorials.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Build instructions
 | 
					# Build instructions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -30,7 +68,9 @@ run the following commands in the Terminal
 | 
				
			|||||||
```
 | 
					```
 | 
				
			||||||
sudo apt-get install git build-essential libgtk-3-dev libsdl2-dev lua5.3-dev zlib1g-dev
 | 
					sudo apt-get install git build-essential libgtk-3-dev libsdl2-dev lua5.3-dev zlib1g-dev
 | 
				
			||||||
git clone --recursive https://github.com/nesbox/TIC-80
 | 
					git clone --recursive https://github.com/nesbox/TIC-80
 | 
				
			||||||
cd TIC-80
 | 
					cd 3rd-party/wren-0.1.0/
 | 
				
			||||||
 | 
					make static
 | 
				
			||||||
 | 
					cd ../..
 | 
				
			||||||
make linux
 | 
					make linux
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								config.tic
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								config.tic
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -3042,6 +3042,9 @@ void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config,
 | 
				
			|||||||
				else if(strcmp(arg, "-skip") == 0)
 | 
									else if(strcmp(arg, "-skip") == 0)
 | 
				
			||||||
					console->skipStart = true;
 | 
										console->skipStart = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									else if(strcmp(arg, "-save") == 0)
 | 
				
			||||||
 | 
										saveCart(console);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				else continue;
 | 
									else continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				argp |= 0b1 << i;
 | 
									argp |= 0b1 << i;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/main.c
									
									
									
									
									
								
							@@ -839,6 +839,7 @@ s32 main(s32 argc, char **argv)
 | 
				
			|||||||
#elif defined(__EMSCRIPTEN__)
 | 
					#elif defined(__EMSCRIPTEN__)
 | 
				
			||||||
		SDL_RENDERER_ACCELERATED
 | 
							SDL_RENDERER_ACCELERATED
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
 | 
							// TODO: uncomment this later
 | 
				
			||||||
		SDL_RENDERER_ACCELERATED// | (getConfig()->useVsync ? SDL_RENDERER_PRESENTVSYNC : 0)
 | 
							SDL_RENDERER_ACCELERATED// | (getConfig()->useVsync ? SDL_RENDERER_PRESENTVSYNC : 0)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	);
 | 
						);
 | 
				
			||||||
@@ -850,7 +851,9 @@ s32 main(s32 argc, char **argv)
 | 
				
			|||||||
	initTouchGamepad();
 | 
						initTouchGamepad();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__EMSCRIPTEN__)
 | 
					#if defined(__EMSCRIPTEN__)
 | 
				
			||||||
	emscripten_set_main_loop(emstick, TIC_FRAMERATE, 1);
 | 
					
 | 
				
			||||||
 | 
						// call this after FS is initialized
 | 
				
			||||||
 | 
						emscripten_set_main_loop(getConfig()->useVsync ? tick : emstick, TIC_FRAMERATE, 1);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		u64 nextTick = SDL_GetPerformanceCounter();
 | 
							u64 nextTick = SDL_GetPerformanceCounter();
 | 
				
			||||||
@@ -872,12 +875,7 @@ s32 main(s32 argc, char **argv)
 | 
				
			|||||||
					nextTick -= delay;
 | 
										nextTick -= delay;
 | 
				
			||||||
					platform.missedFrame = true;
 | 
										platform.missedFrame = true;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				else
 | 
									else SDL_Delay((u32)(delay * 1000 / SDL_GetPerformanceFrequency()));
 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					u32 time = (u32)(delay * 1000 / SDL_GetPerformanceFrequency());
 | 
					 | 
				
			||||||
					if(time >= 10)
 | 
					 | 
				
			||||||
						SDL_Delay(time);
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2941,7 +2941,7 @@ Studio* studioInit(s32 argc, char **argv, s32 samplerate)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	else createFileSystem(NULL, onFSInitialized);
 | 
						else createFileSystem(NULL, onFSInitialized);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	emscripten_set_main_loop(emstick, TIC_FRAMERATE, 1);
 | 
						// emscripten_set_main_loop(emstick, TIC_FRAMERATE, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user