From 972fe05b38207d48afcfa1bf66152c23d30c4eb9 Mon Sep 17 00:00:00 2001 From: JVeg199X <97848253+JVeg199X@users.noreply.github.com> Date: Sat, 11 May 2024 19:59:01 -0400 Subject: [PATCH 1/9] PULSEAUDIO should be defined for APPLE --- emulator/src/emu_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emulator/src/emu_main.c b/emulator/src/emu_main.c index 5be8087dc..4fc9c4b96 100644 --- a/emulator/src/emu_main.c +++ b/emulator/src/emu_main.c @@ -59,7 +59,7 @@ #include "CNFG.h" #define CNFA_IMPLEMENTATION -#if defined(__linux) || defined(__linux__) || defined(linux) || defined(__LINUX__) +#if defined(__linux) || defined(__linux__) || defined(linux) || defined(__LINUX__) || defined(__APPLE__) #define PULSEAUDIO #endif #include "CNFA.h" From 5a199512d196ffd3d8f3448c8a2792baaab25149 Mon Sep 17 00:00:00 2001 From: JVeg199X <97848253+JVeg199X@users.noreply.github.com> Date: Sat, 11 May 2024 20:00:45 -0400 Subject: [PATCH 2/9] Fix compilation errors due to conflicting function signature for keymapKeyCb --- emulator/src/extensions/keymap/ext_keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emulator/src/extensions/keymap/ext_keymap.c b/emulator/src/extensions/keymap/ext_keymap.c index 194adcc60..f3fe89c9b 100644 --- a/emulator/src/extensions/keymap/ext_keymap.c +++ b/emulator/src/extensions/keymap/ext_keymap.c @@ -10,7 +10,7 @@ //============================================================================== static bool keymapInit(emuArgs_t* emuArgs); -static int32_t keymapKeyCb(uint32_t keycode, bool down); +static int32_t keymapKeyCb(uint32_t keycode, bool down, modKey_t modifiers); //============================================================================== // Structs @@ -52,7 +52,7 @@ const emuExtension_t keymapEmuCallback = { .fnInitCb = keymapInit, .fnPreFrameCb = NULL, .fnPostFrameCb = NULL, - .fnKeyCb = keymapKeyCb, + .fnKeyCb = &keymapKeyCb, .fnMouseMoveCb = NULL, .fnMouseButtonCb = NULL, .fnRenderCb = NULL, @@ -100,7 +100,7 @@ static bool keymapInit(emuArgs_t* emuArgs) return false; } -static int32_t keymapKeyCb(uint32_t keycode, bool down) +static int32_t keymapKeyCb(uint32_t keycode, bool down, modKey_t modifiers) { // Convert lowercase characters to their uppercase equivalents if ('a' <= keycode && keycode <= 'z') From 9ed0bb84ce7212ce7d9ed1362fbe1586bdfe7c0a Mon Sep 17 00:00:00 2001 From: JVeg199X <97848253+JVeg199X@users.noreply.github.com> Date: Sat, 11 May 2024 20:04:02 -0400 Subject: [PATCH 3/9] Add plain LLDB launch configuration --- .vscode/launch.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index d9ee376f1..f99bac056 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -29,6 +29,14 @@ ], "preLaunchTask": "make emulator" }, + { + "name": "(lldb) Launch", + "type": "lldb", + "request": "launch", + "program": "${workspaceFolder}/swadge_emulator", + "args": ["-t", "-m", "Main Menu"], + "preLaunchTask": "make emulator" + }, { // For use with https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb // Also requires https://rr-project.org/ From 40b8614cc044f527ccf6909436ebf6a90724867f Mon Sep 17 00:00:00 2001 From: JVeg199X <97848253+JVeg199X@users.noreply.github.com> Date: Sat, 11 May 2024 20:04:48 -0400 Subject: [PATCH 4/9] Update macOS dev env setup docs --- docs/SETUP.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/SETUP.md b/docs/SETUP.md index ebd372318..f1288f8e5 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -100,23 +100,23 @@ Note: Some installs of Python will have py.exe instead of python.exe - If this i > This section is still under development, and as a result, may have unexpected errors in its process. 1. Install [Homebrew](https://brew.sh/) -2. Run the following command to install all necessary dependencies: +2. Install [XQuartz](https://www.xquartz.org/) +3. Install the [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) extension in VS Code +4. Run the following command to install all necessary dependencies: ```bash - brew install xquartz libxinerama pulseaudio clang-format cppcheck wget doxygen cmake graphviz + brew install libxinerama pulseaudio clang-format cppcheck wget doxygen cmake graphviz ``` -3. Clone the ESP-IDF v5.2.1 and install the tools. Note that it will clone into `~/esp/esp-idf`. +5. Clone the ESP-IDF v5.2.1 and install the tools. Note that it will clone into `~/esp/esp-idf`. ```bash git clone -b v5.2.1 --recurse-submodules https://github.com/espressif/esp-idf.git ~/esp/esp-idf ~/esp/esp-idf/install.sh ``` -4. Before running the simulator on your machine, you need to start pulseaudio like so: +6. Before running the simulator on your machine, you need to start pulseaudio like so: ```bash brew services start pulseaudio ``` You can stop it by running `brew services stop pulseaudio` when you are done. -When running on MacOS, you will need to run the emulator and all build tasks through the xQuartz terminal instead of zsh. - ## Building and Flashing Firmware 1. Clone this repository. From fa1075b31b70594cb601fe7653e39a7d7460aed2 Mon Sep 17 00:00:00 2001 From: JVeg199X <97848253+JVeg199X@users.noreply.github.com> Date: Sat, 11 May 2024 20:06:32 -0400 Subject: [PATCH 5/9] .DS_Store files should not appear in git --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f1011922c..f48ffa0be 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,5 @@ coverage.info tools/font_maker/font_maker tools/font_maker/*.TTF tools/font_maker/*.ttf + +*.DS_Store \ No newline at end of file From a9f20c00da6a6ce436a56ebe3aea95a6e3d56355 Mon Sep 17 00:00:00 2001 From: JVeg199X <97848253+JVeg199X@users.noreply.github.com> Date: Sat, 11 May 2024 21:01:00 -0400 Subject: [PATCH 6/9] Add note that (lldb) Launch configuration must be selected. --- docs/SETUP.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/SETUP.md b/docs/SETUP.md index f1288f8e5..5216862a9 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -116,6 +116,8 @@ Note: Some installs of Python will have py.exe instead of python.exe - If this i brew services start pulseaudio ``` You can stop it by running `brew services stop pulseaudio` when you are done. + +When launching from VS Code, make sure the `(lldb) Launch` configuration is selected. ## Building and Flashing Firmware From 6df7e13acafd16c656cb2cc9f638acd1760dd1b9 Mon Sep 17 00:00:00 2001 From: gelakinetic Date: Tue, 14 May 2024 17:57:19 -0400 Subject: [PATCH 7/9] Update submodules --- emulator/src-lib/cnfa | 2 +- emulator/src-lib/rawdraw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/emulator/src-lib/cnfa b/emulator/src-lib/cnfa index 324bd4f42..79515226f 160000 --- a/emulator/src-lib/cnfa +++ b/emulator/src-lib/cnfa @@ -1 +1 @@ -Subproject commit 324bd4f42d8b8c41ccdaaba4cbf9a663c6611abe +Subproject commit 79515226faaf75b208266de664a430195809cdd6 diff --git a/emulator/src-lib/rawdraw b/emulator/src-lib/rawdraw index d810add50..a53ea30df 160000 --- a/emulator/src-lib/rawdraw +++ b/emulator/src-lib/rawdraw @@ -1 +1 @@ -Subproject commit d810add50f84bb8dd81b456d81c68c483d58aa70 +Subproject commit a53ea30df86f5876197873975efee3dbc983a942 From 74a7e0d94b0c6a00d93d4d0d925cc938b9d1716a Mon Sep 17 00:00:00 2001 From: gelakinetic Date: Tue, 14 May 2024 18:01:54 -0400 Subject: [PATCH 8/9] Remove stray ampersand --- emulator/src/extensions/keymap/ext_keymap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emulator/src/extensions/keymap/ext_keymap.c b/emulator/src/extensions/keymap/ext_keymap.c index f3fe89c9b..4b6202995 100644 --- a/emulator/src/extensions/keymap/ext_keymap.c +++ b/emulator/src/extensions/keymap/ext_keymap.c @@ -52,7 +52,7 @@ const emuExtension_t keymapEmuCallback = { .fnInitCb = keymapInit, .fnPreFrameCb = NULL, .fnPostFrameCb = NULL, - .fnKeyCb = &keymapKeyCb, + .fnKeyCb = keymapKeyCb, .fnMouseMoveCb = NULL, .fnMouseButtonCb = NULL, .fnRenderCb = NULL, @@ -102,6 +102,7 @@ static bool keymapInit(emuArgs_t* emuArgs) static int32_t keymapKeyCb(uint32_t keycode, bool down, modKey_t modifiers) { + printf("keymapKeyCb\n"); // Convert lowercase characters to their uppercase equivalents if ('a' <= keycode && keycode <= 'z') { From 9124221f6ebc3963a3bb72b0b74d1484b4fb71c7 Mon Sep 17 00:00:00 2001 From: gelakinetic Date: Tue, 14 May 2024 18:03:06 -0400 Subject: [PATCH 9/9] Remove stray debug print --- emulator/src/extensions/keymap/ext_keymap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/emulator/src/extensions/keymap/ext_keymap.c b/emulator/src/extensions/keymap/ext_keymap.c index 4b6202995..d6fc0a144 100644 --- a/emulator/src/extensions/keymap/ext_keymap.c +++ b/emulator/src/extensions/keymap/ext_keymap.c @@ -102,7 +102,6 @@ static bool keymapInit(emuArgs_t* emuArgs) static int32_t keymapKeyCb(uint32_t keycode, bool down, modKey_t modifiers) { - printf("keymapKeyCb\n"); // Convert lowercase characters to their uppercase equivalents if ('a' <= keycode && keycode <= 'z') {