From 64be99d496186fa28ccff4b260c87b733ecb1ac8 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 17 Feb 2023 20:41:11 -0800 Subject: [PATCH] Add `-addresses` command-line argument This prints the address of every global class to the console, and then exits. This is useful for autosplitters, which read memory addresses directly. Any time a new version of the game is shipped, this makes updating the autosplitters much easier as people don't have to find the addresses of the global classes themselves. --- desktop_version/src/main.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 6f32d029..7b2ade94 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -420,6 +420,26 @@ int main(int argc, char *argv[]) #endif VVV_exit(0); } + else if (ARG("-addresses")) + { +#ifndef NO_CUSTOM_LEVELS + printf("cl : %p\n", (void*) &cl); +# ifndef NO_EDITOR + printf("ed : %p\n", (void*) &ed); +# endif +#endif + printf("game : %p\n", (void*) &game); + printf("gameScreen : %p\n", (void*) &gameScreen); + printf("graphics : %p\n", (void*) &graphics); + printf("help : %p\n", (void*) &help); + printf("key : %p\n", (void*) &key); + printf("map : %p\n", (void*) &map); + printf("music : %p\n", (void*) &music); + printf("obj : %p\n", (void*) &obj); + printf("script : %p\n", (void*) &script); + + VVV_exit(0); + } else if (ARG("-renderer")) { ARG_INNER({