diff options
-rw-r--r-- | printf-in-mGBA.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/printf-in-mGBA.md b/printf-in-mGBA.md index c7a7abb..c24fff2 100644 --- a/printf-in-mGBA.md +++ b/printf-in-mGBA.md @@ -157,7 +157,7 @@ Now let's edit the function that's called whenever a wild Pokémon is encountere ``` This will print out the species number for the wild Pokémon about to be encountered. This is already useful, but we can do even better. Let's modify our statement to print the species name as well. We'll add two more includes to the top of the file: -``` +```c #include "data.h" // for gSpeciesNames, which maps species number to species name. #include "../gflib/string_util.h" // for ConvertToAscii() ``` @@ -165,7 +165,9 @@ This will print out the species number for the wild Pokémon about to be encount Now we'll change our `mgba_printf` call to the following: -`mgba_printf(MGBA_LOG_DEBUG, "%d %s", species, ConvertToAscii(gSpeciesNames[species]));` +```c +mgba_printf(MGBA_LOG_DEBUG, "%d %s", species, ConvertToAscii(gSpeciesNames[species])); +``` ## 6. Viewing the logs In order to view our logs, we'll need to use the [mGBA](https://mgba.io/) emulator. Open the log viewer by going to the "Tools" menu and selecting "View Logs...". Make sure the "Debug" checkbox is checked and you should see a message like this one when you encounter a wild Pokémon: `[DEBUG] GBA Debug: 286 POOCHYENA`.
\ No newline at end of file |