Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos dev fixes #225

Merged
merged 9 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ coverage.info
tools/font_maker/font_maker
tools/font_maker/*.TTF
tools/font_maker/*.ttf

*.DS_Store
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
14 changes: 8 additions & 6 deletions docs/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,25 @@ 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/)
AEFeinstein marked this conversation as resolved.
Show resolved Hide resolved
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.

When launching from VS Code, make sure the `(lldb) Launch` configuration is selected.

## Building and Flashing Firmware

1. Clone this repository.
Expand Down
2 changes: 1 addition & 1 deletion emulator/src-lib/cnfa
Submodule cnfa updated 6 files
+2 −3 CNFA.c
+26 −4 CNFA.h
+1 −2 CNFA_winmm.c
+28 −8 Makefile
+9 −4 example.c
+3 −11 wave_player/Makefile
2 changes: 1 addition & 1 deletion emulator/src-lib/rawdraw
2 changes: 1 addition & 1 deletion emulator/src/emu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions emulator/src/extensions/keymap/ext_keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
AEFeinstein marked this conversation as resolved.
Show resolved Hide resolved
{
// Convert lowercase characters to their uppercase equivalents
if ('a' <= keycode && keycode <= 'z')
Expand Down