Ver Fonte

move apps

MX há 2 anos atrás
commit
f284f3ed74
100 ficheiros alterados com 604 adições e 0 exclusões
  1. BIN
      .flipcorg/banner.png
  2. BIN
      .flipcorg/gallery/1.png
  3. BIN
      .flipcorg/gallery/2.png
  4. BIN
      .flipcorg/gallery/3.png
  5. BIN
      .flipcorg/gallery/4.png
  6. BIN
      .flipcorg/gallery/5.png
  7. BIN
      .flipcorg/gallery/6.png
  8. 45 0
      .github/ISSUE_TEMPLATE/01_bug_report.yml
  9. 21 0
      .github/ISSUE_TEMPLATE/02_implemented.yml
  10. 2 0
      .gitignore
  11. 21 0
      LICENSE
  12. 252 0
      README.md
  13. 249 0
      README_es.md
  14. 14 0
      application.fam
  15. BIN
      assets/Background.png
  16. BIN
      assets/Background_128x11.png
  17. BIN
      assets/Button_18x18.png
  18. BIN
      assets/Connect_me_62x31.png
  19. BIN
      assets/Connected_62x31.png
  20. BIN
      assets/Space_100x18.png
  21. BIN
      assets/Space_65x18.png
  22. BIN
      assets/Space_80x18.png
  23. BIN
      assets/Space_95x18.png
  24. BIN
      assets/abra.png
  25. BIN
      assets/aerodactyl.png
  26. BIN
      assets/alakazam.png
  27. BIN
      assets/arbok.png
  28. BIN
      assets/arcanine.png
  29. BIN
      assets/articuno.png
  30. BIN
      assets/beedrill.png
  31. BIN
      assets/bellsprout.png
  32. BIN
      assets/blastoise.png
  33. BIN
      assets/bulbasaur.png
  34. BIN
      assets/butterfree.png
  35. BIN
      assets/caterpie.png
  36. BIN
      assets/chansey.png
  37. BIN
      assets/charizard.png
  38. BIN
      assets/charmander.png
  39. BIN
      assets/charmeleon.png
  40. BIN
      assets/clefable.png
  41. BIN
      assets/clefairy.png
  42. BIN
      assets/cloyster.png
  43. BIN
      assets/cubone.png
  44. BIN
      assets/dewgong.png
  45. BIN
      assets/diglett.png
  46. BIN
      assets/ditto.png
  47. BIN
      assets/dodrio.png
  48. BIN
      assets/doduo.png
  49. BIN
      assets/dragonair.png
  50. BIN
      assets/dragonite.png
  51. BIN
      assets/dratini.png
  52. BIN
      assets/drowzee.png
  53. BIN
      assets/dugtrio.png
  54. BIN
      assets/eevee.png
  55. BIN
      assets/ekans.png
  56. BIN
      assets/electabuzz.png
  57. BIN
      assets/electrode.png
  58. BIN
      assets/exeggcute.png
  59. BIN
      assets/exeggutor.png
  60. BIN
      assets/farfetchd.png
  61. BIN
      assets/fearow.png
  62. BIN
      assets/flareon.png
  63. BIN
      assets/fossilaerodactyl.png
  64. BIN
      assets/fossilkabutops.png
  65. BIN
      assets/game_boy.png
  66. BIN
      assets/gastly.png
  67. BIN
      assets/gb_step_1.png
  68. BIN
      assets/gb_step_2.png
  69. BIN
      assets/gengar.png
  70. BIN
      assets/geodude.png
  71. BIN
      assets/gloom.png
  72. BIN
      assets/golbat.png
  73. BIN
      assets/goldeen.png
  74. BIN
      assets/golduck.png
  75. BIN
      assets/golem.png
  76. BIN
      assets/graveler.png
  77. BIN
      assets/grimer.png
  78. BIN
      assets/growlithe.png
  79. BIN
      assets/gyarados.png
  80. BIN
      assets/haunter.png
  81. BIN
      assets/hitmonchan.png
  82. BIN
      assets/hitmonlee.png
  83. BIN
      assets/horsea.png
  84. BIN
      assets/hypno.png
  85. BIN
      assets/ivysaur.png
  86. BIN
      assets/jigglypuff.png
  87. BIN
      assets/jolteon.png
  88. BIN
      assets/jynx.png
  89. BIN
      assets/kabuto.png
  90. BIN
      assets/kabutops.png
  91. BIN
      assets/kadabra.png
  92. BIN
      assets/kakuna.png
  93. BIN
      assets/kangaskhan.png
  94. BIN
      assets/kingler.png
  95. BIN
      assets/koffing.png
  96. BIN
      assets/krabby.png
  97. BIN
      assets/lapras.png
  98. BIN
      assets/lickitung.png
  99. BIN
      assets/machamp.png
  100. BIN
      assets/machoke.png

BIN
.flipcorg/banner.png


BIN
.flipcorg/gallery/1.png


BIN
.flipcorg/gallery/2.png


BIN
.flipcorg/gallery/3.png


BIN
.flipcorg/gallery/4.png


BIN
.flipcorg/gallery/5.png


BIN
.flipcorg/gallery/6.png


+ 45 - 0
.github/ISSUE_TEMPLATE/01_bug_report.yml

@@ -0,0 +1,45 @@
+name: Bug report
+description: File a bug reports regarding the app.
+labels: ["bug"]
+body:
+  - type: markdown
+    attributes:
+      value: |
+        Thank you for taking the time to fill out an issue, this template is meant for any issues related to application.
+  - type: textarea
+    id: description
+    attributes:
+      label: Describe the bug.
+      description: "A clear and concise description of what the bug is."
+    validations:
+      required: true
+  - type: textarea
+    id: repro
+    attributes:
+      label: Reproduction
+      description: "How can this bug be reproduced?"
+      placeholder: |
+        1. Switch on...
+        2. Press button '....'
+        3. Wait for the moon phase
+        4. It burns
+    validations:
+      required: true
+  - type: input
+    id: target
+    attributes:
+      label: Target Framework
+      description: Specify the target
+      # Target seems to be largely ignored by outside sources.
+  - type: textarea
+    id: logs
+    attributes:
+      label: Logs
+      description: Attach your debug logs here
+      render: Text
+      # Avoid rendering as Markdown here.
+  - type: textarea
+    id: anything-else
+    attributes:
+      label: Anything else?
+      description: Let us know if you have anything else to share.

+ 21 - 0
.github/ISSUE_TEMPLATE/02_implemented.yml

@@ -0,0 +1,21 @@
+name: I implemented it
+description: Share your process.
+labels: ["implemented"]
+body:
+- type: markdown
+  attributes:
+    value: |
+      Thank you for taking the time to fill out. If you have already implemented the application, could you share which Flipper Zero framework you have used? Additionally, could you specify the required type of Game Boy and cartridge? Lastly, it would be great if you could share some images of the process.
+- type: textarea
+  id: desc
+  attributes:
+    label: "Describe the process."
+    description: |
+      Feel free to describe in as much detail as you wish.
+  validations:
+    required: true
+- type: input
+  id: type
+  attributes:
+    label: Game boy
+    description: (Color, Pocket, Advance)

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+.DS_Store
+.vscode

+ 21 - 0
LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Esteban Fuentealba
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 252 - 0
README.md

@@ -0,0 +1,252 @@
+# 🐬 Flipper Zero - Pokemon Trading in Game Boy
+
+<p align="center">
+<a target="_blank" href="https://www.reddit.com/r/flipperzero/comments/121ncot/flipper_zero_game_boy_pokemon_trading/">
+  <img align="center" alt="Flipper Zero - Pokemon Trading Game Boy" src="./docs/images/youtube.png" />
+  </a>
+  <br />
+</p>
+
+<div align="center">
+
+**FW Official** | **FW Unleashed** | **FW RogueMaster**
+:- | :- | :- 
+[![FlipC.org](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/badge?branch=main)](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading?branch=main)|[![FlipC.org](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/badge?branch=main&firmware=unleashed)](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading?branch=main&firmware=unleashed)|[![FlipC.org](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/badge?branch=main&firmware=roguemaster)](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading?branch=main&firmware=roguemaster)
+</div>
+
+## Introduction
+
+This is a Pokemon exchange application from Flipper Zero to Game Boy [(Generación I)](https://bulbapedia.bulbagarden.net/wiki/Generation_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).
+
+## Installation Directions
+
+This project is intended to be overlayed on top of an existing firmware repo,  in my case the **Release 0.79.1** version.
+
+- Clone the [Flipper Zero firmware repository](https://github.com/flipperdevices/flipperzero-firmware). Refer to [this tutorial](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/firmware/updating/README.md) for updating the firmware.
+- Copy the "pokemon" folder into the `/applications_user/pokemon` folder in your firmware.
+- Run the command `fbt launch_app` to run it on your Flipper Zero.
+
+```bash
+./fbt launch_app APPSRC=pokemon
+```
+
+- NOTE: If you only want to generate the fap file, you must run the following command.
+
+```bash
+./fbt fap_pokemon
+```
+
+And use [**qFlipper**](https://flipperzero.one/update) to copy the generated **pokemon.fap** file to the `SD Card/apps/Game Boy` folder.
+
+<p align='center'>
+<img src="./docs/images/qFlipper.png" width="400" /><br />
+</p>
+
+## Instructions for use.
+
+These instructions assume that you are starting at the Flipper Zero desktop. Otherwise, press the Back button until you are at the desktop.
+
+- Press the `OK` button on the Flipper to open the main menu.
+- Choose `Aplicaciones` from the menu.
+- Choose `Game Boy` from the submenu.
+- Choose `Pokemon Trading`
+- The Flipper Zero should show the selection of Pokemon that you want to trade, and by default, it appears as bulbasaur.
+
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-1.png" width="400" />
+        <br />
+    </p>
+
+- 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.
+    <p align='center'>
+         <br />
+        <img src="./docs/images/flipper-zero-flat-2.png" width="400" /><br />
+    </p>
+- The Flipper Zero will display the view to connect the Game Boy.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-3.png" width="400" /><br />
+    </p>
+- 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**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_pokemon_center.png" width="400" /><br />
+    </p>
+- 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>
+- The Flipper Zero will show that we are connected.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-4.png" width="400" /><br />
+    </p>
+- On the Game Boy, we will be asked which option we want, and we select **TRADE CENTER**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_save_trade.png" width="400" /><br />
+    </p>
+- You will enter the Trade Center where you must press the A button on the Game Boy on your side of the table.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_trade_room_2.png" width="400" /><br />
+    </p>
+- Flipper Zero will remain on a waiting screen with the Pokemon you selected.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-5.png" width="400" /><br />
+    </p>
+- You will see your Pokemon and the Pokemon you selected on the Flipper Zero, in this case, `Mew`. You must select the Pokemon you want to trade and press **TRADE**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_trade_list_select_trade.png" width="400" /><br />
+    </p>
+- You must confirm the selected trade by selecting **TRADE**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_trade_list_select_trade_confirm.png" width="400" /><br />
+    </p>
+- Flipper Zero will remain on a waiting screen with the Pokemon you selected.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-6.png" width="400" /><br />
+    </p>
+- Finally, the Pokemon exchange will start from **Flipper Zero** to the **Game Boy**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-7.png" width="400" /><br />
+    </p>
+
+    If the Flipper Zero gets stuck at the end of the exchange, you must reboot it by pressing the <img src="./docs/images/left.png" /> LEFT + <img src="./docs/images/back.png" /> BACK key combination.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/reboot.png" width="400" /><br />
+    </p>
+
+## How does it work?
+
+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:
+
+- A clock signal (CLK).
+- An output signal (Serial Out or SO).
+- An input signal (Serial In or SI).
+
+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.
+
+<p align='center'>
+<br />
+<img src="./docs/images/gb_spi.png" width="400" /><br />
+</p>
+
+_An example GB SPI transfer. Here, the master sends 0xD9 (217) and the slave sends 0x45 (69)._
+
+<br />
+
+You can learn more about it in the following video. [**Analyzing the Different Versions of the Link Cable**](https://youtu.be/h1KKkCfzOws?t=151).
+
+## Board for Flipper Zero with PortData EXT Link.
+
+For the Flipper Zero board, a [PortData EXT Link](https://es.aliexpress.com/item/1005004116983895.html) and a 2x8  [prototype board](https://es.aliexpress.com/item/32478242317.html) were used.
+
+<p align='center'>
+<br />
+<img src="./docs/images/EXT-Link.png" width="400" /><br />
+</p>
+
+_PortData EXT Link for Game Boy Color, Game Boy Pocket, GBC, GBP, GBL._
+
+<p align='center'>
+<br />
+<img src="./docs/images/pcb.png" width="400" /><br />
+</p>
+<p align='center'>
+<br />
+<img src="./docs/images/flipper-zero-pcb.png" width="400" /><br />
+</p>
+I used 33kΩ resistor on CLK, but it's optional, it can be connected directly.
+
+
+## Connection: Flipper Zero GPIO - Game Boy
+
+The pins should be connected as follows:
+
+<p align='center'>
+<br />
+<img src="./docs/images/wgbl-0.png" width="400" /><br />
+</p>
+
+<picture>
+    <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">
+</picture>
+
+| Cable Game Link (Socket) | Flipper Zero GPIO |
+| ------------------------ | ----------------- |
+| 6 (GND)                  | 8 (GND)           |
+| 5 (CLK)                  | 6 (B2)            |
+| 3 (SI)                   | 7 (C3)            |
+| 2 (SO)                   | 5 (B3)            |
+
+## Connect to Flipper Zero without Socket PortData EXT Link
+
+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.
+
+<p align='center'>
+<br />
+<img src="./docs/images/cut-cable-v3.png" width="400" /><br />
+</p>
+
+*"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.
+
+
+
+## GUI
+
+To generate the graphical interface, the [**FUI-Editor**](https://ilin.pt/stuff/fui-editor/) tool was used. Additionally, the original sprites from the game Pokemon Yellow, which are found in the [**Disassembly of Pokemon Yellow**](https://github.com/pret/pokeyellow/tree/master/gfx/pokemon/front) 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](https://www.photopea.com/), the online image editor.
+
+##  Tested In
+- Game Boy Color (GBC)
+- Game Boy Advance (GBA)
+
+## Implemented by
+<a href="https://github.com/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/issues?q=is%3Aissue+label%3AImplemented+is%3Aclosed+is%3Aopen+" target="_blank"><img src="./docs/images/implemented.svg" /></a>
+
+## TODO
+- [ ] Refactor the code
+- [x] The OK button stops working when exiting the app, so it needs to be restarted 🤔
+- [ ] Set each Pokemon's characteristics, attacks, and default levels
+- [ ] Improve animations
+
+## Links
+
+- [Flipper Zero firmware source code](https://github.com/flipperdevices/flipperzero-firmware)
+- Adan Scotney's pokemon [trade protocol specification](http://www.adanscotney.com/2014/01/spoofing-pokemon-trades-with-stellaris.html) and implementation
+- Derek Jamison - [Youtube Channel](https://www.youtube.com/@MrDerekJamison)
+- Matt Penny - [GBPlay Blog](https://blog.gbplay.io/)
+- [Pokémon data structure (Generation I)](<https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_data_structure_(Generation_I)>)
+- [Disassembly of Pokemon Yellow](https://github.com/pret/pokeyellow)
+- [Arduino-Spoofing-Gameboy-Pokemon-Trades](https://github.com/EstebanFuentealba/Arduino-Spoofing-Gameboy-Pokemon-Trades)
+- [🎮 Gameboy link cable breakout PCB](https://github.com/Palmr/gb-link-cable)
+
+<p align='center'>
+<br />
+<br />
+From Talcahuano 🇨🇱 with ❤ 
+</p>

+ 249 - 0
README_es.md

@@ -0,0 +1,249 @@
+# 🐬 Flipper Zero - Pokemon Trading in Game Boy
+
+<p align="center">
+<a target="_blank" href="https://www.reddit.com/r/flipperzero/comments/121ncot/flipper_zero_game_boy_pokemon_trading/">
+  <img align="center" alt="Flipper Zero - Pokemon Trading Game Boy" src="./docs/images/youtube.png" />
+  <br />
+</p>
+<div align="center">
+
+**FW Official** | **FW Unleashed** | **FW RogueMaster**
+:- | :- | :- 
+[![FlipC.org](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/badge?branch=main)](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading?branch=main)|[![FlipC.org](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/badge?branch=main&firmware=unleashed)](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading?branch=main&firmware=unleashed)|[![FlipC.org](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/badge?branch=main&firmware=roguemaster)](https://flipc.org/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading?branch=main&firmware=roguemaster)
+</div>
+
+## Introducción
+
+Esta es una aplicación de intercambio de Pokemon's desde de Flipper Zero a Game Boy [(Generación I)](https://bulbapedia.bulbagarden.net/wiki/Generation_I). Flipper Zero emula un Game Boy "Esclavo" conectado a **Cable Game Link** para poder intercambiar cualquier Pokemon de la Primera Generación (Red, Blue, Yellow) a un Game Boy Real.
+
+Es una Prueba de concepto (POC) para utilizar vistas, GPIO y FURI (Flipper Universal Registry Implementation).
+
+## Instrucciones de instalación
+
+Este proyecto está destinado a ser superpuesto encima de un repositorio de firmware existente, en mi caso la versión **Release 0.79.1**.
+
+- Clona el [Repositorio del firmware de Flipper Zero](https://github.com/flipperdevices/flipperzero-firmware). Consulta este [tutorial](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/firmware/updating/README.md) para actualizar el firmware.
+- Copia la [carpeta "pokemon"](..) en la carpeta `/applications_user/pokemon` del firmware que clonaste.
+- Corre el comando `fbt launch_app` para correr en tu Flipper Zero.
+
+```bash
+./fbt launch_app APPSRC=pokemon
+```
+
+- NOTA: Si sólo quieres generar el archivo `fap` debes correr el siguiente comando.
+
+```bash
+./fbt fap_pokemon
+```
+
+y usa [**qFlipper**](https://flipperzero.one/update) para copiar el archivo **pokemon.fap** generado a la carpeta `SD Card/apps/Game Boy`.
+
+<p align='center'>
+<img src="./docs/images/qFlipper.png" width="400" /><br />
+</p>
+
+## Instrucciones de Uso
+
+Estas instrucciones asumen que está comenzando en el escritorio de Flipper Zero. De lo contrario, presione el botón Atrás hasta que esté en el escritorio.
+
+- Presione el botón `OK` en el flipper para abrir el menú principal.
+- Elija `Aplicaciones` en el menú.
+- Elija `Game Boy` en el submenú.
+- Elija `Pokemon Trading`
+- El Flipper Zero debe mostrar la selección de Pokemon que se desea intercambiar y por defecto parece bulbasaur.
+
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-1.png" width="400" />
+        <br />
+    </p>
+
+- Pulse los botones `IZQUIERDA`/`DERECHA` para paginar de 1 en 1 la selección de Pokemon.
+- Pulse los botones `ARRIBA`/`ABAJO` para paginar de 10 en 10 la selección de Pokemon.
+- Pulse el botón `OK` para seleccionar el Pokemon a Intercambiar.
+    <p align='center'>
+         <br />
+        <img src="./docs/images/flipper-zero-flat-2.png" width="400" /><br />
+    </p>
+- En el Flipper Zero se muestra la vista para conectar el Game Boy.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-3.png" width="400" /><br />
+    </p>
+- En tu Game Boy debes conectar el **Cable Game Link** al Game Boy, en el juego dirigirte a un **Centro Pokémon** que tengas más cercano.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_pokemon_center.png" width="400" /><br />
+    </p>
+- Habla con la chica que está en el mostrador de la derecha. La chica nos dirá que para poder jugar antes tendremos que salvar el juego, le contestaremos que _SI_ pulsando el botón _A_.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_save.png" width="400" /><br />
+    </p>
+- El Flipper Zero nos mostrará que estámos conectados.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-4.png" width="400" /><br />
+    </p>
+- En el Game Boy nos preguntará que opción queremos y Seleccionamos **CENT. CAMBIO**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_save_trade.png" width="400" /><br />
+    </p>
+- Entrarás a la sala de Intercambio donde debes presionar el botón A del Game Boy en el lado de tu mesa.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_trade_room_2.png" width="400" /><br />
+    </p>
+- Flipper Zero quedará en una pantalla de espera con el Pokemon que seleccionaste.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-5.png" width="400" /><br />
+    </p>
+- Se te mostrarán tus Pokemon y el Pokemon que seleccionaste en el Flipper Zero, en este Caso **Mew**. Debes seleccionar el pokemon que quieres intercambiar y presionar **TRATO**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_trade_list_select_trade.png" width="400" /><br />
+    </p>
+- Debes confirmar el intercambio seleccionado **TRATO**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/game_boy_trade_list_select_trade_confirm.png" width="400" /><br />
+    </p>
+- Flipper Zero quedará en una pantalla de espera con el Pokemon que seleccionaste.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-6.png" width="400" /><br />
+    </p>
+- Finalmente comenzará el intercambio de Pokemon desde **Flipper Zero** al **Game Boy**.
+    <p align='center'>
+        <br />
+        <img src="./docs/images/flipper-zero-flat-7.png" width="400" /><br />
+    </p>
+- **NOTA**: Si al final del Intercambio se te bloquea el Flipper Zero debes Rebootear presionando la combinación de teclas <img src="./docs/images/left.png" /> IZQUIERDA + <img src="./docs/images/back.png" /> ATRAS
+    <p align='center'>
+        <br />
+        <img src="./docs/images/reboot.png" width="400" /><br />
+    </p>
+
+## ¿Cómo trabaja?
+
+El método utilizado para comunicar 2 Game Boy se basa en el protocolo SPI, que es un protocolo de comunicación serial muy simple en el que un dispositivo maestro se comunica con uno o más dispositivos esclavos. El protocolo es bidireccional y sincrónico, y utiliza tres señales básicas:
+
+- Una señal de reloj (CLK).
+- Una señal de salida (Serial Out o SO).
+- Una señal de entrada (Serial In o SI).
+
+En el Game Boy, los juegos almacenan los datos en un registro de cambio interno que se utiliza para enviar y recibir información. El protocolo SPI utilizado por el Game Boy utiliza la señal de reloj para indicar cuándo se transfieren los datos.
+
+El protocolo de enlace de Game Boy es síncrono y requiere que el dispositivo esclavo responda al mismo ritmo que el dispositivo maestro. El dispositivo maestro suministra un reloj de 8KHz (velocidad de transferencia de datos de 1KB/s). La ventana de tiempo para responder es de solo **~120μs**. Sin embargo, el dispositivo esclavo no tiene restricciones y puede responder cuando recibe los datos. El reloj puede variar y no hay un límite inferior.
+
+<p align='center'>
+<br />
+<img src="./docs/images/gb_spi.png" width="400" /><br />
+</p>
+
+_Una transferencia de ejemplo de GB SPI. Aquí, el maestro envía 0xD9 (217) y el esclavo envía 0x45 (69)._
+
+<br />
+
+Se puede conocer mas al respecto en el siguiente Video [**Analyzing the Different Versions of the Link Cable**](https://youtu.be/h1KKkCfzOws?t=151).
+
+## Placa para Flipper Zero con Socket PortData EXT Link
+
+Para la placa del Fipper Zero se utilizó un [PortData EXT Link](https://es.aliexpress.com/item/1005004116983895.html) y una [place de prototipo](https://es.aliexpress.com/item/32478242317.html) de 2x8.
+
+<p align='center'>
+<br />
+<img src="./docs/images/EXT-Link.png" width="400" /><br />
+</p>
+
+_PortData EXT Link para Game Boy Color, Game Boy Pocket, GBC, GBP, GBL._
+
+<p align='center'>
+<br />
+<img src="./docs/images/pcb.png" width="400" /><br />
+</p>
+<p align='center'>
+<br />
+<img src="./docs/images/flipper-zero-pcb.png" width="400" /><br />
+</p>
+Usé una resistencia de 33kΩ en CLK, pero es opcional, se puede conectar directamente.
+
+## Conexión: Flipper Zero GPIO - Game Boy
+
+Se deben conectar los Pines de la siguiente manera
+
+<p align='center'>
+<br />
+<img src="./docs/images/wgbl-0.png" width="400" /><br />
+</p>
+
+<picture>
+    <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">
+</picture>
+
+| Cable Game Link (Socket) | Flipper Zero GPIO |
+| ------------------------ | ----------------- |
+| 6 (GND)                  | 8 (GND)           |
+| 5 (CLK)                  | 6 (B2)            |
+| 3 (SI)                   | 7 (C3)            |
+| 2 (SO)                   | 5 (B3)            |
+
+
+## Conectar a Flipper Zero sin Socket PortData EXT Link
+
+Pudes cortar un cable directamente sin usar el socket pero debes tener en cuenta que el es un cable cruzado SI-SO.
+
+<p align='center'>
+<br />
+<img src="./docs/images/cut-cable-v3.png" width="400" /><br />
+</p>
+
+*"Cable Game Link" cortado y conectado directamente a los pines de Flipper Zero.*
+
+
+**NOTA**: No guiarse por los colores porque dependiendo del fabricante estos pueden cambiar, con un multímetro medir continuidad e identificar que cable es de que pin
+
+
+## GUI
+
+Para generar la Interfaz gráfica se utilizó la herramienta [**FUI-Editor**](https://ilin.pt/stuff/fui-editor/).
+Además se utilizaron los sprites originales del juego _Pokemon Yellow_ que se encuentran en el repositorio [**Disassembly of Pokemon Yellow**](https://github.com/pret/pokeyellow/tree/master/gfx/pokemon/front).
+
+De cada imagen se transformó el color `#aaa` a `#fff` para que Flipper Zero la renderizara bien. Para eso se utilizó un **Batch** para [Photopea](https://www.photopea.com/), el editor de imagenes online.
+
+##  Implementado en
+- Game Boy Color (GBC)
+- Game Boy Advance (GBA)
+
+## Implementado por
+<a href="https://github.com/EstebanFuentealba/Flipper-Zero-Game-Boy-Pokemon-Trading/issues?q=is%3Aissue+label%3AImplemented+is%3Aclosed+is%3Aopen+" target="_blank"><img src="./docs/images/implemented.svg" /></a>
+
+## TODO
+
+- [ ] Refactorizar el código
+- [ ] Al salir de la app el botón `OK` deja de funcionar por lo que hay que reiniciarlo 🤔
+- [ ] Setear a cada pokemon sus características, ataques, niveles por defecto
+- [ ] Mejorar animaciones
+
+## Links
+
+- [Flipper Zero firmware source code](https://github.com/flipperdevices/flipperzero-firmware)
+- Adan Scotney's pokemon [trade protocol specification](http://www.adanscotney.com/2014/01/spoofing-pokemon-trades-with-stellaris.html) and implementation
+- Derek Jamison - [Youtube Channel](https://www.youtube.com/@MrDerekJamison)
+- Matt Penny - [GBPlay Blog](https://blog.gbplay.io/)
+- [Pokémon data structure (Generation I)](<https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_data_structure_(Generation_I)>)
+- [Disassembly of Pokemon Yellow](https://github.com/pret/pokeyellow)
+- [Arduino-Spoofing-Gameboy-Pokemon-Trades](https://github.com/EstebanFuentealba/Arduino-Spoofing-Gameboy-Pokemon-Trades)
+- [🎮 Gameboy link cable breakout PCB](https://github.com/Palmr/gb-link-cable)
+
+<p align='center'>
+<br />
+<br />
+Desde Talcahuano 🇨🇱 con ❤ 
+</p>

+ 14 - 0
application.fam

@@ -0,0 +1,14 @@
+App(
+    appid="pokemon",
+    name="Pokemon Trading",
+    apptype=FlipperAppType.EXTERNAL,
+    entry_point="pokemon_app",
+    requires=["gui"],
+    stack_size=2 * 1024,
+    fap_version=[1, 2],
+    fap_category="GPIO",
+    fap_icon="pokemon_10px.png",
+    fap_icon_assets="assets",
+    fap_author="Esteban Fuentealba",
+    fap_weburl="https://github.com/EstebanFuentealba",
+)

BIN
assets/Background.png


BIN
assets/Background_128x11.png


BIN
assets/Button_18x18.png


BIN
assets/Connect_me_62x31.png


BIN
assets/Connected_62x31.png


BIN
assets/Space_100x18.png


BIN
assets/Space_65x18.png


BIN
assets/Space_80x18.png


BIN
assets/Space_95x18.png


BIN
assets/abra.png


BIN
assets/aerodactyl.png


BIN
assets/alakazam.png


BIN
assets/arbok.png


BIN
assets/arcanine.png


BIN
assets/articuno.png


BIN
assets/beedrill.png


BIN
assets/bellsprout.png


BIN
assets/blastoise.png


BIN
assets/bulbasaur.png


BIN
assets/butterfree.png


BIN
assets/caterpie.png


BIN
assets/chansey.png


BIN
assets/charizard.png


BIN
assets/charmander.png


BIN
assets/charmeleon.png


BIN
assets/clefable.png


BIN
assets/clefairy.png


BIN
assets/cloyster.png


BIN
assets/cubone.png


BIN
assets/dewgong.png


BIN
assets/diglett.png


BIN
assets/ditto.png


BIN
assets/dodrio.png


BIN
assets/doduo.png


BIN
assets/dragonair.png


BIN
assets/dragonite.png


BIN
assets/dratini.png


BIN
assets/drowzee.png


BIN
assets/dugtrio.png


BIN
assets/eevee.png


BIN
assets/ekans.png


BIN
assets/electabuzz.png


BIN
assets/electrode.png


BIN
assets/exeggcute.png


BIN
assets/exeggutor.png


BIN
assets/farfetchd.png


BIN
assets/fearow.png


BIN
assets/flareon.png


BIN
assets/fossilaerodactyl.png


BIN
assets/fossilkabutops.png


BIN
assets/game_boy.png


BIN
assets/gastly.png


BIN
assets/gb_step_1.png


BIN
assets/gb_step_2.png


BIN
assets/gengar.png


BIN
assets/geodude.png


BIN
assets/gloom.png


BIN
assets/golbat.png


BIN
assets/goldeen.png


BIN
assets/golduck.png


BIN
assets/golem.png


BIN
assets/graveler.png


BIN
assets/grimer.png


BIN
assets/growlithe.png


BIN
assets/gyarados.png


BIN
assets/haunter.png


BIN
assets/hitmonchan.png


BIN
assets/hitmonlee.png


BIN
assets/horsea.png


BIN
assets/hypno.png


BIN
assets/ivysaur.png


BIN
assets/jigglypuff.png


BIN
assets/jolteon.png


BIN
assets/jynx.png


BIN
assets/kabuto.png


BIN
assets/kabutops.png


BIN
assets/kadabra.png


BIN
assets/kakuna.png


BIN
assets/kangaskhan.png


BIN
assets/kingler.png


BIN
assets/koffing.png


BIN
assets/krabby.png


BIN
assets/lapras.png


BIN
assets/lickitung.png


BIN
assets/machamp.png


BIN
assets/machoke.png


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff