|
|
2 rokov pred | |
|---|---|---|
| .flipcorg | 2 rokov pred | |
| .github | 2 rokov pred | |
| assets | 2 rokov pred | |
| docs | 2 rokov pred | |
| scenes | 2 rokov pred | |
| views | 2 rokov pred | |
| .clang-format | 2 rokov pred | |
| .gitignore | 2 rokov pred | |
| LICENSE | 2 rokov pred | |
| README.md | 2 rokov pred | |
| README_catalog.md | 2 rokov pred | |
| README_es.md | 2 rokov pred | |
| application.fam | 2 rokov pred | |
| changelog.md | 2 rokov pred | |
| pokemon_10px.png | 2 rokov pred | |
| pokemon_app.c | 2 rokov pred | |
| pokemon_app.h | 2 rokov pred | |
| pokemon_char_encode.c | 2 rokov pred | |
| pokemon_char_encode.h | 2 rokov pred | |
| pokemon_data.h | 2 rokov pred |
This is a Pokemon exchange application from Flipper Zero to Game Boy (Generación I). Flipper Zero emulates a "Slave" Game Boy connected to a Game Link Cable to be able to exchange any Pokemon from the First Generation (Red, Blue, Yellow) to a real Game Boy.
It is a Proof of Concept (POC) for using views, GPIO, and FURI (Flipper Universal Registry Implementation).
This project is intended to be overlayed on top of an existing firmware repo, in my case the Release 0.79.1 version.
/applications_user/pokemon folder in your firmware.Run the command fbt launch_app to run it on your Flipper Zero.
./fbt launch_app APPSRC=pokemon
NOTE: If you only want to generate the fap file, you must run the following command.
./fbt fap_pokemon
And use qFlipper to copy the generated pokemon.fap file to the SD Card/apps/Game Boy folder.

These instructions assume that you are starting at the Flipper Zero desktop. Otherwise, press the Back button until you are at the desktop.
OK button on the Flipper to open the main menu.Aplicaciones from the menu.Game Boy from the submenu.Pokemon TradingThe Flipper Zero should show the selection of Pokemon that you want to trade, and by default, it appears as bulbasaur.
Press the LEFT/RIGHT buttons to paginate the selection of Pokemon by 1.
Press the UP/DOWN buttons to paginate the selection of Pokemon by 10.
Press the OK button to select the Pokemon to trade.
<br />
<img src="./docs/images/flipper-zero-flat-2.png" width="400" /><br />
The Flipper Zero will display the view to connect the Game Boy.
<br />
<img src="./docs/images/flipper-zero-flat-3.png" width="400" /><br />
On your Game Boy, you should connect the Game Link Cable to the Game Boy and in the game, go to the nearest Pokemon Center.
<br />
<img src="./docs/images/game_boy_pokemon_center.png" width="400" /><br />
Talk to the girl at the counter on the right. The girl will tell us that we have to save the game before playing, we will answer YES by pressing the A button.
.
<p align='center'>
<br />
<img src="./docs/images/game_boy_save.png" width="400" /><br />
</p>




Mew. You must select the Pokemon you want to trade and press TRADE.



Finally, the Pokemon exchange will start from Flipper Zero to the Game Boy.
<br />
<img src="./docs/images/flipper-zero-flat-7.png" width="400" /><br />
If the Flipper Zero gets stuck at the end of the exchange, you must reboot it by pressing the
LEFT +
BACK key combination.
<br />
<img src="./docs/images/reboot.png" width="400" /><br />
The method used to communicate 2 Game Boys is based on the SPI protocol, which is a very simple serial communication protocol in which a master device communicates with one or more slave devices. The protocol is bidirectional and synchronous, and uses three basic signals:
In the Game Boy, games store data in an internal shift register that is used to send and receive information. The SPI protocol used by the Game Boy uses the clock signal to indicate when data is being transferred.
The Game Boy link protocol is synchronous and requires the slave device to respond at the same rate as the master device. The master device supplies an 8KHz clock (data transfer rate of 1KB/s). The time window for responding is only ~120μs. However, the slave device has no restrictions and can respond when it receives data. The clock can vary and there is no lower limit.

An example GB SPI transfer. Here, the master sends 0xD9 (217) and the slave sends 0x45 (69).
You can learn more about it in the following video. Analyzing the Different Versions of the Link Cable.
For the Flipper Zero board, a PortData EXT Link and a 2x8 prototype board were used.

PortData EXT Link for Game Boy Color, Game Boy Pocket, GBC, GBP, GBL.



<source media="(prefers-color-scheme: dark)" srcset="./docs/images/GPIO-GBPIN_light-v2.png">
<source media="(prefers-color-scheme: light)" srcset="./docs/images/GPIO-GBPIN-v2.png">
<img
alt="Connect Flipper Zero GPIO to Game Boy Pins"
src="./docs/images/GPIO-GBPIN-v2.png">
| Cable Game Link (Socket) | Flipper Zero GPIO |
|---|---|
| 6 (GND) | 8 (GND) |
| 5 (CLK) | 6 (B2) |
| 3 (SI) | 7 (C3) |
| 2 (SO) | 5 (B3) |
It's possible to cut a cable directly without using a socket, but it's important to note that the cable is a crossover cable SI-SO.

"Cable Game Link" cut and directly connected to the Flipper Zero pins.
NOTE: Don't rely on the cable colors as they may vary depending on the manufacturer. Use a multimeter to measure continuity and identify which cable corresponds to each pin.
To generate the graphical interface, the FUI-Editor tool was used. Additionally, the original sprites from the game Pokemon Yellow, which are found in the Disassembly of Pokemon Yellow repository, were used.
For each image, the color #aaa was transformed to #fff so that Flipper Zero would render it correctly. To do this, a batch process was used in Photopea, the online image editor.
From Talcahuano 🇨🇱 with ❤