Skip to content

Commit

Permalink
Fixed Windows, added periphemu.names
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 committed Nov 25, 2019
1 parent f68de27 commit de6d624
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 12 deletions.
Binary file modified CraftOS-PC 2.aps
Binary file not shown.
8 changes: 4 additions & 4 deletions CraftOS-PC 2.rc
Expand Up @@ -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
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion CraftOS-PC.exe.manifest
Expand Up @@ -3,7 +3,7 @@
<assemblyIdentity
type="win32"
name="CraftOS-PC"
version="2.1.2.0"
version="2.2.0.0"
processorArchitecture="amd64"
/>
<description> my exe </description>
Expand Down
1 change: 1 addition & 0 deletions DOCUMENTATION.md
Expand Up @@ -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.
Expand Down
23 changes: 18 additions & 5 deletions src/periphemu.cpp
Expand Up @@ -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 };
library_t periphemu_lib = { "periphemu", 3, periphemu_keys, periphemu_values, nullptr, nullptr };
2 changes: 1 addition & 1 deletion src/peripheral/debugger.hpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/term.cpp
Expand Up @@ -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<int, std::pair<std::string, int> > b : computer->breakpoints)
if (b.second.first == std::string(ar->source) && b.second.second == ar->currentline)
Expand Down

0 comments on commit de6d624

Please sign in to comment.