no message
This commit is contained in:
		
							
								
								
									
										8
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								Makefile
									
									
									
									
									
								
							@@ -17,6 +17,7 @@ INCLUDES= \
 | 
				
			|||||||
	-I$(3RD_PARTY)/zlib-1.2.8 \
 | 
						-I$(3RD_PARTY)/zlib-1.2.8 \
 | 
				
			||||||
	-I$(3RD_PARTY)/giflib-5.1.4/lib \
 | 
						-I$(3RD_PARTY)/giflib-5.1.4/lib \
 | 
				
			||||||
	-I$(3RD_PARTY)/SDL2-2.0.7/include \
 | 
						-I$(3RD_PARTY)/SDL2-2.0.7/include \
 | 
				
			||||||
 | 
						-I$(3RD_PARTY)/sdl-gpu/include \
 | 
				
			||||||
	-I$(3RD_PARTY)/wren-0.1.0/src/include \
 | 
						-I$(3RD_PARTY)/wren-0.1.0/src/include \
 | 
				
			||||||
	-I$(3RD_PARTY)/moonscript \
 | 
						-I$(3RD_PARTY)/moonscript \
 | 
				
			||||||
	-I$(BLIPBUF_LIB) \
 | 
						-I$(BLIPBUF_LIB) \
 | 
				
			||||||
@@ -26,11 +27,14 @@ INCLUDES= \
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
MINGW_LINKER_FLAGS= \
 | 
					MINGW_LINKER_FLAGS= \
 | 
				
			||||||
	-L$(PRE_BUILT)/mingw \
 | 
						-L$(PRE_BUILT)/mingw \
 | 
				
			||||||
 | 
						-L$(3RD_PARTY)/sdl-gpu \
 | 
				
			||||||
	-lmingw32 \
 | 
						-lmingw32 \
 | 
				
			||||||
	-lSDL2main \
 | 
					 | 
				
			||||||
	-lSDL2 \
 | 
					 | 
				
			||||||
	-lcomdlg32 \
 | 
						-lcomdlg32 \
 | 
				
			||||||
	-lws2_32 \
 | 
						-lws2_32 \
 | 
				
			||||||
 | 
						-lSDL2_gpu \
 | 
				
			||||||
 | 
						-lSDL2main \
 | 
				
			||||||
 | 
						-lSDL2 \
 | 
				
			||||||
 | 
						-lopengl32 \
 | 
				
			||||||
	-mwindows
 | 
						-mwindows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GTK_INCLUDES= `pkg-config --cflags gtk+-3.0`
 | 
					GTK_INCLUDES= `pkg-config --cflags gtk+-3.0`
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1715,7 +1715,7 @@ static void processMouseStates()
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void studioTick(void* pixels)
 | 
					static void studioTick()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	processShortcuts();
 | 
						processShortcuts();
 | 
				
			||||||
	processMouseStates();
 | 
						processMouseStates();
 | 
				
			||||||
@@ -1755,10 +1755,10 @@ static void studioTick(void* pixels)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		tic->api.blit(tic, scanline, overlap, data);
 | 
							tic->api.blit(tic, scanline, overlap, data);
 | 
				
			||||||
		memcpy(pixels, tic->screen, sizeof tic->screen);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		recordFrame(pixels);
 | 
							recordFrame(tic->screen);
 | 
				
			||||||
		drawDesyncLabel(pixels);
 | 
							drawDesyncLabel(tic->screen);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										83
									
								
								src/system.c
									
									
									
									
									
								
							
							
						
						
									
										83
									
								
								src/system.c
									
									
									
									
									
								
							@@ -7,6 +7,8 @@
 | 
				
			|||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
#include <SDL.h>
 | 
					#include <SDL.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <SDL_gpu.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__EMSCRIPTEN__)
 | 
					#if defined(__EMSCRIPTEN__)
 | 
				
			||||||
#include <emscripten.h>
 | 
					#include <emscripten.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@@ -577,6 +579,8 @@ static void pollEvent()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static void blitTexture()
 | 
					static void blitTexture()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						tic_mem* tic = platform.studio->tic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SDL_Rect rect = {0, 0, 0, 0};
 | 
						SDL_Rect rect = {0, 0, 0, 0};
 | 
				
			||||||
	calcTextureRect(&rect);
 | 
						calcTextureRect(&rect);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -584,7 +588,9 @@ static void blitTexture()
 | 
				
			|||||||
	s32 pitch = 0;
 | 
						s32 pitch = 0;
 | 
				
			||||||
	SDL_LockTexture(platform.texture, NULL, &pixels, &pitch);
 | 
						SDL_LockTexture(platform.texture, NULL, &pixels, &pitch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	platform.studio->tick(pixels);
 | 
						platform.studio->tick();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						memcpy(pixels, tic->screen, sizeof tic->screen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SDL_UnlockTexture(platform.texture);
 | 
						SDL_UnlockTexture(platform.texture);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -995,12 +1001,87 @@ static void emstick()
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static s32 start(s32 argc, char **argv, const char* folder)
 | 
					static s32 start(s32 argc, char **argv, const char* folder)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						initSound();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						platform.net = createNet();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						platform.studio = studioInit(argc, argv, platform.audio.spec.freq, folder, &systemInterface);
 | 
				
			||||||
 | 
						tic_mem* tic = platform.studio->tic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						setWindowIcon();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						initTouchGamepad();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GPU_Target* screen = GPU_Init(TIC80_FULLWIDTH * STUDIO_UI_SCALE, TIC80_FULLHEIGHT * STUDIO_UI_SCALE, GPU_INIT_DISABLE_VSYNC);
 | 
				
			||||||
 | 
						GPU_Image* texture = GPU_CreateImage(TIC80_FULLWIDTH, TIC80_FULLHEIGHT, GPU_FORMAT_BGRA);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								u64 nextTick = SDL_GetPerformanceCounter();
 | 
				
			||||||
 | 
								const u64 Delta = SDL_GetPerformanceFrequency() / TIC_FRAMERATE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								while (!platform.studio->quit)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									platform.missedFrame = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									nextTick += Delta;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										pollEvent();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										GPU_Clear(screen);
 | 
				
			||||||
 | 
									
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											platform.studio->tick();
 | 
				
			||||||
 | 
											GPU_UpdateImageBytes(texture, NULL, tic->screen, TIC80_FULLWIDTH * sizeof(u32));
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										GPU_BlitScale(texture, NULL, screen, TIC80_FULLWIDTH/2*STUDIO_UI_SCALE, TIC80_FULLHEIGHT/2*STUDIO_UI_SCALE, STUDIO_UI_SCALE, STUDIO_UI_SCALE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										GPU_Flip(screen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										blitSound();
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										s64 delay = nextTick - SDL_GetPerformanceCounter();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										if(delay < 0)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											nextTick -= delay;
 | 
				
			||||||
 | 
											platform.missedFrame = true;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										else SDL_Delay((u32)(delay * 1000 / SDL_GetPerformanceFrequency()));
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						platform.studio->close();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						closeNet(platform.net);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						SDL_CloseAudioDevice(platform.audio.device);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GPU_FreeImage(texture);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GPU_Quit();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static s32 start2(s32 argc, char **argv, const char* folder)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SDL_SetHint(SDL_HINT_WINRT_HANDLE_BACK_BUTTON, "1");
 | 
						SDL_SetHint(SDL_HINT_WINRT_HANDLE_BACK_BUTTON, "1");
 | 
				
			||||||
	SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
 | 
						SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
 | 
						SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	initSound();
 | 
						initSound();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	platform.net = createNet();
 | 
						platform.net = createNet();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -76,7 +76,7 @@ typedef struct
 | 
				
			|||||||
	tic_mem* tic;
 | 
						tic_mem* tic;
 | 
				
			||||||
	bool quit;
 | 
						bool quit;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void (*tick)(void* pixels);
 | 
						void (*tick)();
 | 
				
			||||||
	void (*exit)();
 | 
						void (*exit)();
 | 
				
			||||||
	void (*close)();
 | 
						void (*close)();
 | 
				
			||||||
	void (*updateProject)();
 | 
						void (*updateProject)();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user