Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.
Open
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
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ button_helper.bin: button_helper.c Makefile
clean:
rm -f brix.bin

load_brix: brix.bin
python3.8 ../pongoOS/scripts/upload_data.py brix.bin
(printf 'modload\n'; cat) | (../pongoOS/scripts/pongoterm || true)

load_buttons: button_helper.bin
python3.8 ../pongoOS/scripts/upload_data.py button_helper.bin
(printf 'modload\n'; cat) | (../pongoOS/scripts/pongoterm || true)
start_pongoos_shell:
make ../pongoOS/scripts
./../pongoOS/scripts/pongoterm
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,24 @@ A pongoOS module for running the BRIX game, featuring rendering code I wrote at

**Warning:** This project was intended to be compiled on macOS. If you're using Linux, you will have to modify the makefile and you might need to use something other than `pongoterm`.

1. Make sure you cloned pongoOS to `../pongoOS`.
2. Apply the small patch in `pongo_changes.patch` to `../pongoOS`. This patch makes pongoOS export two additional symbols that are required by the CHIP-8 emulator. You can apply this patch by running `git apply pongo_changes.patch` in `../pongoOS` (replace `pongo_changes.patch` with the absolute path).
3. Compile pongoOS itself by running `make` in `../pongoOS`.
4. Compile `pongoterm` by running `make` in `../pongoOS/scripts`.
5. Boot into pongoOS with `checkrain -k ../pongoOS/build/Pongo.bin -p` if your device isn't already in pongoOS.
- Clone PongoOS to ../pongoOS like this: `git clone --recursive https://github.com/checkra1n/PongoOS.git ../pongoOS`

## Compatibility

Currently supported devices:
- iPhone 7 GSM (iPhone9,3)
- iPad Pro 10.5-inch WiFi/Cellular (iPad7,4)
- iPad 10.2-inch 7th Gen WiFi/Cellular (iPad7,12)
- iPhone SE (1st generation) (iPhone8,4)
- iPad 7 (iPad7,11)

If your device is already supported, great! You won't have to modify the code. You can skip to [running BRIX](#running-brix). If your device isn't supported, adding support for your own device shouldn't be hard.

## Adding support for your device

Different devices use different addresses for buttons and there doesn't appear to be an automatic way to extract these addresses from the device. However, you can use `button_helper` in this repository to manually find the button addresses for your device.

1. With your device plugged in, run `make load_buttons`. This will install the button helper module in pongoOS and show you the pongoOS shell.
1. With your device plugged in, run `make start_pongoos_shell`. This will open a pongoOS shell, where you can then run `/send button_helper.bin` and then `modload`. If you don't have button_helper.bin, run `make button_helper.bin` and try again.
2. In the pongoOS shell, run `button_helper`.
3. Follow the instructions given by the program. "Holding the mute switch" means muting and releasing it means unmuting. Example output:
```
Expand All @@ -54,7 +52,7 @@ Address: 0x20f1000a0

## Running BRIX

1. Run `make load_brix`. This will compile the module and load it in pongoOS.
1. Run `make load_pongoos_shell`. This will load the pongo_os shell where you can then run `/send brix.bin` and then `modload`. If you don't have brix.bin, run `make brix.bin` and try again.
2. Run `brix` in the pongoOS shell. Your device should now be running BRIX.

## Controls
Expand Down
20 changes: 19 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ const struct device_model devices[] = {
.home_button = 0x20f100158,
.home_button_at_right = 1
},
{
.name = "iPhone8,4",
.volume_up = 0x20f100108,
.volume_down = 0x20f10010c,
.mute_switch = 0x20f100254,
.power_button = 0x20f100184,
.home_button = 0x20f100180,
.home_button_at_right = 1
},
{
.name = "iPad7,11",
.volume_up = 0x20f100168,
.volume_down = 0x20f100164,
.mute_switch = NULL,
.power_button = 0x20f1002cc,
.home_button = 0x20f1002d0,
.home_button_at_right = 1
},
{ .name = NULL }
};

Expand Down Expand Up @@ -204,4 +222,4 @@ void module_entry() {
char *module_name = "brix";
struct pongo_exports exported_symbols[] = {
{.name = 0, .value = 0}
};
};
21 changes: 0 additions & 21 deletions pongo_changes.patch

This file was deleted.