Merge branch 'squirrel'
This commit is contained in:
commit
52b77e7e87
|
@ -137,7 +137,7 @@ target_include_directories(wren PRIVATE 3rd-party/wren-0.1.0/src/vm)
|
||||||
# SQUIRREL
|
# SQUIRREL
|
||||||
################################
|
################################
|
||||||
|
|
||||||
set(SQUIRREL_DIR 3rd-party/squirrel3.1)
|
set(SQUIRREL_DIR 3rd-party/squirrel)
|
||||||
set(SQUIRREL_SRC
|
set(SQUIRREL_SRC
|
||||||
${SQUIRREL_DIR}/squirrel/sqapi.cpp
|
${SQUIRREL_DIR}/squirrel/sqapi.cpp
|
||||||
${SQUIRREL_DIR}/squirrel/sqbaselib.cpp
|
${SQUIRREL_DIR}/squirrel/sqbaselib.cpp
|
||||||
|
@ -163,9 +163,9 @@ set(SQUIRREL_SRC
|
||||||
|
|
||||||
add_library(squirrel STATIC ${SQUIRREL_SRC})
|
add_library(squirrel STATIC ${SQUIRREL_SRC})
|
||||||
set_target_properties(squirrel PROPERTIES LINKER_LANGUAGE CXX)
|
set_target_properties(squirrel PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
target_include_directories(squirrel PRIVATE 3rd-party/squirrel3.1/include)
|
target_include_directories(squirrel PRIVATE 3rd-party/squirrel/include)
|
||||||
target_include_directories(squirrel PRIVATE 3rd-party/squirrel3.1/squirrel)
|
target_include_directories(squirrel PRIVATE 3rd-party/squirrel/squirrel)
|
||||||
target_include_directories(squirrel PRIVATE 3rd-party/squirrel3.1/sqstdlib)
|
target_include_directories(squirrel PRIVATE 3rd-party/squirrel/sqstdlib)
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# GIFLIB
|
# GIFLIB
|
||||||
|
@ -210,7 +210,7 @@ target_include_directories(tic80core PRIVATE 3rd-party/duktape-2.2.0/src)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/lua-5.3.1/src)
|
target_include_directories(tic80core PRIVATE 3rd-party/lua-5.3.1/src)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/giflib-5.1.4/lib)
|
target_include_directories(tic80core PRIVATE 3rd-party/giflib-5.1.4/lib)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/wren-0.1.0/src/include)
|
target_include_directories(tic80core PRIVATE 3rd-party/wren-0.1.0/src/include)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/squirrel3.1/include)
|
target_include_directories(tic80core PRIVATE 3rd-party/squirrel/include)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/moonscript)
|
target_include_directories(tic80core PRIVATE 3rd-party/moonscript)
|
||||||
target_include_directories(tic80core PRIVATE 3rd-party/fennel)
|
target_include_directories(tic80core PRIVATE 3rd-party/fennel)
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,10 @@ typedef enum
|
||||||
WrenScript,
|
WrenScript,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
SquirrelScript,
|
||||||
|
#endif
|
||||||
|
|
||||||
} ScriptLang;
|
} ScriptLang;
|
||||||
|
|
||||||
#if defined(__TIC_WINDOWS__) || defined(__TIC_LINUX__) || defined(__TIC_MACOSX__)
|
#if defined(__TIC_WINDOWS__) || defined(__TIC_LINUX__) || defined(__TIC_MACOSX__)
|
||||||
|
@ -118,7 +122,10 @@ static const char DefaultJSTicPath[] = TIC_LOCAL "default_js.tic";
|
||||||
#if defined(TIC_BUILD_WITH_WREN)
|
#if defined(TIC_BUILD_WITH_WREN)
|
||||||
static const char DefaultWrenTicPath[] = TIC_LOCAL "default_wren.tic";
|
static const char DefaultWrenTicPath[] = TIC_LOCAL "default_wren.tic";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
static const char DefaultSquirrelTicPath[] = TIC_LOCAL "default_squirrel.tic";
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char* getName(const char* name, const char* ext)
|
static const char* getName(const char* name, const char* ext)
|
||||||
{
|
{
|
||||||
|
@ -485,6 +492,10 @@ static void* getDemoCart(Console* console, ScriptLang script, s32* size)
|
||||||
|
|
||||||
#if defined(TIC_BUILD_WITH_WREN)
|
#if defined(TIC_BUILD_WITH_WREN)
|
||||||
case WrenScript: strcpy(path, DefaultWrenTicPath); break;
|
case WrenScript: strcpy(path, DefaultWrenTicPath); break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
case SquirrelScript: strcpy(path, DefaultSquirrelTicPath); break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,6 +581,20 @@ static void* getDemoCart(Console* console, ScriptLang script, s32* size)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
case SquirrelScript:
|
||||||
|
{
|
||||||
|
static const u8 SquirrelDemoRom[] =
|
||||||
|
{
|
||||||
|
#include "../bin/assets/squirreldemo.tic.dat"
|
||||||
|
};
|
||||||
|
|
||||||
|
demo = SquirrelDemoRom;
|
||||||
|
romSize = sizeof SquirrelDemoRom;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
u8* data = NULL;
|
u8* data = NULL;
|
||||||
|
@ -622,6 +647,11 @@ static void onConsoleLoadDemoCommandConfirmed(Console* console, const char* para
|
||||||
data = getDemoCart(console, WrenScript, &size);
|
data = getDemoCart(console, WrenScript, &size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
if(strcmp(param, DefaultSquirrelTicPath) == 0)
|
||||||
|
data = getDemoCart(console, SquirrelScript, &size);
|
||||||
|
#endif
|
||||||
|
|
||||||
const char* name = getCartName(param);
|
const char* name = getCartName(param);
|
||||||
|
|
||||||
setCartName(console, name);
|
setCartName(console, name);
|
||||||
|
@ -1228,6 +1258,14 @@ static void onConsoleNewCommandConfirmed(Console* console, const char* param)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
if(strcmp(param, "squirrel") == 0)
|
||||||
|
{
|
||||||
|
loadDemo(console, SquirrelScript);
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!done)
|
if(!done)
|
||||||
{
|
{
|
||||||
printError(console, "\nunknown parameter: ");
|
printError(console, "\nunknown parameter: ");
|
||||||
|
@ -1525,6 +1563,13 @@ static void onConsoleConfigCommand(Console* console, const char* param)
|
||||||
onConsoleLoadDemoCommand(console, DefaultWrenTicPath);
|
onConsoleLoadDemoCommand(console, DefaultWrenTicPath);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
else if(strcmp(param, "default squirrel") == 0)
|
||||||
|
{
|
||||||
|
onConsoleLoadDemoCommand(console, DefaultSquirrelTicPath);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2738,6 +2783,8 @@ static void tick(Console* console)
|
||||||
loadDemo(console, JavaScript);
|
loadDemo(console, JavaScript);
|
||||||
#elif defined(TIC_BUILD_WITH_WREN)
|
#elif defined(TIC_BUILD_WITH_WREN)
|
||||||
loadDemo(console, WrenScript);
|
loadDemo(console, WrenScript);
|
||||||
|
#elif defined(TIC_BUILD_WITH_SQUIRREL)
|
||||||
|
loadDemo(console, SquirrelScript);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printBack(console, "\n hello! type ");
|
printBack(console, "\n hello! type ");
|
||||||
|
|
Loading…
Reference in New Issue