diff --git a/CraftOS-PC 2.aps b/CraftOS-PC 2.aps
index 7a6ed98e..e300a87f 100644
Binary files a/CraftOS-PC 2.aps and b/CraftOS-PC 2.aps differ
diff --git a/CraftOS-PC 2.rc b/CraftOS-PC 2.rc
index 24733108..56b270f8 100644
--- a/CraftOS-PC 2.rc
+++ b/CraftOS-PC 2.rc
@@ -70,8 +70,8 @@ MANIFEST RT_MANIFEST "CraftOS-PC.exe.manifest"
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,1,2,0
- PRODUCTVERSION 2,1,2,0
+ FILEVERSION 2,2,0,0
+ PRODUCTVERSION 2,2,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -87,12 +87,12 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "CraftOS-PC"
- VALUE "FileVersion", "2.1.2.0"
+ VALUE "FileVersion", "2.2.0.0"
VALUE "InternalName", "CraftOS-PC.exe"
VALUE "LegalCopyright", "Copyright (C) 2019 JackMacWindows."
VALUE "OriginalFilename", "CraftOS-PC.exe"
VALUE "ProductName", "CraftOS-PC"
- VALUE "ProductVersion", "2.1.2.0"
+ VALUE "ProductVersion", "2.2.0.0"
END
END
BLOCK "VarFileInfo"
diff --git a/CraftOS-PC.exe.manifest b/CraftOS-PC.exe.manifest
index 6c114ad1..6b4d8e0a 100644
--- a/CraftOS-PC.exe.manifest
+++ b/CraftOS-PC.exe.manifest
@@ -3,7 +3,7 @@
my exe
diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md
index 1cd15235..340c793f 100644
--- a/DOCUMENTATION.md
+++ b/DOCUMENTATION.md
@@ -31,6 +31,7 @@ Creates and removes peripherals from the registry.
* *boolean* remove(*string* side): Removes a peripheral.
* side: The side to remove
* Returns: `true` on success, `false` on failure (already removed)
+* *table* names(): Returns a list of available peripherals.
## `drive` peripheral
Floppy drive emulator that supports loading mounts (see mounter API), floppy disks (by ID), and audio files.
diff --git a/src/periphemu.cpp b/src/periphemu.cpp
index 002d9905..e5d3a453 100644
--- a/src/periphemu.cpp
+++ b/src/periphemu.cpp
@@ -113,14 +113,27 @@ int periphemu_remove(lua_State* L) {
return 1;
}
-const char* periphemu_keys[2] = {
+int periphemu_names(lua_State *L) {
+ lua_newtable(L);
+ int i = 1;
+ for (auto entry : initializers) {
+ lua_pushinteger(L, i++);
+ lua_pushstring(L, entry.first.c_str());
+ lua_settable(L, -3);
+ }
+ return 1;
+}
+
+const char* periphemu_keys[3] = {
"create",
- "remove"
+ "remove",
+ "names",
};
-lua_CFunction periphemu_values[2] = {
+lua_CFunction periphemu_values[3] = {
periphemu_create,
- periphemu_remove
+ periphemu_remove,
+ periphemu_names,
};
-library_t periphemu_lib = { "periphemu", 2, periphemu_keys, periphemu_values, nullptr, nullptr };
\ No newline at end of file
+library_t periphemu_lib = { "periphemu", 3, periphemu_keys, periphemu_values, nullptr, nullptr };
\ No newline at end of file
diff --git a/src/peripheral/debugger.hpp b/src/peripheral/debugger.hpp
index 21c11e9d..d4928f6b 100644
--- a/src/peripheral/debugger.hpp
+++ b/src/peripheral/debugger.hpp
@@ -39,7 +39,7 @@ class debugger: public peripheral {
std::atomic_bool running;
Computer * computer;
int breakType = DEBUGGER_BREAK_TYPE_NONSTOP;
- unsigned int stepCount = 0;
+ int stepCount = 0;
int breakMask = 0;
std::string breakFunc;
bool didBreak = false;
diff --git a/src/term.cpp b/src/term.cpp
index 8813c21e..765ba14c 100755
--- a/src/term.cpp
+++ b/src/term.cpp
@@ -402,7 +402,7 @@ void termHook(lua_State *L, lua_Debug *ar) {
debugger * dbg = (debugger*)computer->debugger;
if (dbg->thread == NULL) {
if (dbg->breakType == DEBUGGER_BREAK_TYPE_LINE) {
- if (dbg->stepCount == 0 && debuggerBreak(L, computer, dbg, "Pause")) return;
+ if (dbg->stepCount >= 0) {dbg->stepCount = 0; debuggerBreak(L, computer, dbg, "Pause");}
else dbg->stepCount--;
} else for (std::pair > b : computer->breakpoints)
if (b.second.first == std::string(ar->source) && b.second.second == ar->currentline)