summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwalkingeyerobot <mitch@thefoley.net>2020-09-04 01:15:24 -0400
committerwalkingeyerobot <mitch@thefoley.net>2020-09-04 01:15:24 -0400
commit26ae6afb9c6cad1dabb7f7568b7763ad1355751e (patch)
tree510c81551292f470eeb244404085aa1ea2b25b90
parent3d243569cc64ed1c866541da5529ecb74fde4bc9 (diff)
remove what I think is another unnecessary change
-rw-r--r--printf-in-mGBA.md19
1 files changed, 3 insertions, 16 deletions
diff --git a/printf-in-mGBA.md b/printf-in-mGBA.md
index e03b203..72c361f 100644
--- a/printf-in-mGBA.md
+++ b/printf-in-mGBA.md
@@ -33,21 +33,8 @@ void AgbMain()
InitHeap(gHeap, HEAP_SIZE);
...
```
-## 4. ???
-Add `#include "printf.h"` to `src/libisagbprn.c`.
-```diff
-...
-#define AGB_PRINT_FLUSH_ADDR 0x9FE209D
--#define AGB_PRINT_STRUCT_ADDR 0x9FE20F8
-+#define AGB_PRINT_STRUCT_ADDR (char*) 0x9FE20F8
- #define AGB_PRINT_PROTECT_ADDR 0x9FE2FFE
- #define WSCNT_DATA (WAITCNT_PHI_OUT_16MHZ | WAITCNT_WS0_S_2 | WAITCNT_WS0_N_4)
-...
-```
-Then, search and replace `vsprintf` with `vsnprintf` in the file.
-
-## 5. Add the ability to print ASCII strings
+## 4. Add the ability to print ASCII strings
In order to print human-readable strings, we need to add a utility function to `gflib/string_util.h`. Open this file and add the following declaration at the end (above the `#endif`).
```diff
...
@@ -148,7 +135,7 @@ char *ConvertToAscii(const u8 *str)
}
```
-## 6. Testing the code
+## 5. Testing the code
Printf is now functioning! Let's test it out. We'll add a print statement every time we encounter a wild pokemon.
Open `wild_encounter.c`. You'll need to add the following include statements at the top.
@@ -179,5 +166,5 @@ 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]));`.
-## 7. Viewing the logs
+## 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