no message
This commit is contained in:
parent
670c650120
commit
631fd03dd8
|
@ -35,6 +35,10 @@
|
|||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#define CONSOLE_CURSOR_COLOR ((tic_color_red))
|
||||
#define CONSOLE_BACK_TEXT_COLOR ((tic_color_dark_gray))
|
||||
#define CONSOLE_FRONT_TEXT_COLOR ((tic_color_white))
|
||||
|
@ -54,7 +58,7 @@ typedef enum
|
|||
WrenScript,
|
||||
} ScriptLang;
|
||||
|
||||
#if defined(__TIC_WINDOWS__) || defined(__LINUX__) || defined(__MACOSX__)
|
||||
#if defined(__TIC_WINDOWS__) || defined(__TIC_LINUX__) || defined(__TIC_MACOSX__)
|
||||
#define CAN_EXPORT 1
|
||||
#endif
|
||||
|
||||
|
@ -1644,9 +1648,7 @@ static void onConsoleExportCommand(Console* console, const char* param)
|
|||
|
||||
#else
|
||||
|
||||
#if !defined(__ANDROID__) && !defined(__MACOSX__) && !defined(__LINUX__)
|
||||
|
||||
static void *memmem(const void* haystack, size_t hlen, const void* needle, size_t nlen)
|
||||
static void *ticMemmem(const void* haystack, size_t hlen, const void* needle, size_t nlen)
|
||||
{
|
||||
const u8* p = haystack;
|
||||
size_t plen = hlen;
|
||||
|
@ -1667,8 +1669,6 @@ static void *memmem(const void* haystack, size_t hlen, const void* needle, size_
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Console* console;
|
||||
|
@ -1722,7 +1722,7 @@ static void onConsoleExportHtmlCommand(Console* console, const char* name)
|
|||
u8* EmbedTicJs = NULL;
|
||||
u32 EmbedTicJsSize = unzip(&EmbedTicJs, EmbedTicJsZip, EmbedTicJsZipSize);
|
||||
|
||||
u8* ptr = memmem(EmbedIndex, EmbedIndexSize, Placeholder, sizeof(Placeholder)-1);
|
||||
u8* ptr = ticMemmem(EmbedIndex, EmbedIndexSize, Placeholder, sizeof(Placeholder)-1);
|
||||
|
||||
if(ptr)
|
||||
{
|
||||
|
@ -2363,13 +2363,7 @@ static void onConsoleHelpCommand(Console* console, const char* param)
|
|||
}
|
||||
|
||||
printBack(console, "\npress ");
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
printFront(console, "BACK");
|
||||
#else
|
||||
printFront(console, "ESC");
|
||||
#endif
|
||||
|
||||
printBack(console, " to enter UI mode\n");
|
||||
|
||||
commandDone(console);
|
||||
|
@ -3108,7 +3102,7 @@ void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config,
|
|||
|
||||
while(true)
|
||||
{
|
||||
const EmbedHeader* header = (const EmbedHeader*)memmem(ptr, size, TicCartSig, SIG_SIZE);
|
||||
const EmbedHeader* header = (const EmbedHeader*)ticMemmem(ptr, size, TicCartSig, SIG_SIZE);
|
||||
|
||||
if(header)
|
||||
{
|
||||
|
|
4
src/fs.c
4
src/fs.c
|
@ -165,6 +165,8 @@ int _wremove(const wchar_t *);
|
|||
|
||||
#endif
|
||||
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ListCallback callback;
|
||||
|
@ -286,6 +288,8 @@ static void netDirRequest(const char* path, ListCallback callback, void* data)
|
|||
onDirResponse(buffer, size, &netDirData);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void fsEnumFiles(FileSystem* fs, ListCallback callback, void* data)
|
||||
{
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
|
|
12
src/run.c
12
src/run.c
|
@ -155,16 +155,6 @@ static void processDoFile(void* data, char* dst)
|
|||
return;
|
||||
}
|
||||
|
||||
static void preseed()
|
||||
{
|
||||
#if defined(__MACOSX__)
|
||||
srandom(time(NULL));
|
||||
random();
|
||||
#else
|
||||
srand(time(NULL));
|
||||
rand();
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool forceExit(void* data)
|
||||
{
|
||||
|
@ -213,5 +203,5 @@ void initRun(Run* run, Console* console, tic_mem* tic)
|
|||
if(data) free(data);
|
||||
}
|
||||
|
||||
preseed();
|
||||
getSystem()->preseed();
|
||||
}
|
||||
|
|
|
@ -27,10 +27,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#include "tic.h"
|
||||
#include "ticapi.h"
|
||||
#include "defines.h"
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#define COVER_Y 5
|
||||
#define COVER_X (TIC80_WIDTH - COVER_WIDTH - COVER_Y)
|
||||
|
||||
#if defined(__TIC_WINDOWS__) || defined(__LINUX__) || defined(__MACOSX__)
|
||||
#if defined(__TIC_WINDOWS__) || defined(__TIC_LINUX__) || defined(__TIC_MACOSX__)
|
||||
#define CAN_OPEN_URL 1
|
||||
#endif
|
||||
|
||||
|
|
17
src/system.c
17
src/system.c
|
@ -4,8 +4,13 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <SDL.h>
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#define STUDIO_UI_SCALE 3
|
||||
#define STUDIO_PIXEL_FORMAT SDL_PIXELFORMAT_ARGB8888
|
||||
#define TEXTURE_SIZE (TIC80_FULLWIDTH)
|
||||
|
@ -967,6 +972,17 @@ static void* getUrlRequest(const char* url, s32* size)
|
|||
return netGetRequest(platform.net, url, size);
|
||||
}
|
||||
|
||||
static void preseed()
|
||||
{
|
||||
#if defined(__MACOSX__)
|
||||
srandom(time(NULL));
|
||||
random();
|
||||
#else
|
||||
srand(time(NULL));
|
||||
rand();
|
||||
#endif
|
||||
}
|
||||
|
||||
static System systemInterface =
|
||||
{
|
||||
.setClipboardText = setClipboardText,
|
||||
|
@ -985,6 +1001,7 @@ static System systemInterface =
|
|||
.setWindowTitle = setWindowTitle,
|
||||
|
||||
.openSystemPath = openSystemPath,
|
||||
.preseed = preseed,
|
||||
};
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
|
|
|
@ -21,6 +21,8 @@ typedef struct
|
|||
void (*setWindowTitle)(const char* title);
|
||||
|
||||
void (*openSystemPath)(const char* path);
|
||||
|
||||
void (*preseed)();
|
||||
|
||||
} System;
|
||||
|
||||
|
|
Loading…
Reference in New Issue