Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
Hollow Knight: saves keep up to 128 rooms
Mason363ea8fe29916c5
diff --git a/games/hollowknight/src/data.bin b/games/hollowknight/src/data.binindex 77be3479..cb8afed9 100644Binary files a/games/hollowknight/src/data.bin and b/games/hollowknight/src/data.bin differdiff --git a/games/hollowknight/src/data.h b/games/hollowknight/src/data.hindex ce202165..e5abf492 100644--- a/games/hollowknight/src/data.h+++ b/games/hollowknight/src/data.h@@ -740,7 +740,7 @@#define TXT_PROMPT_WATCH 120#define TXT_PROMPT_CHALLENGE 121#define PROMPT_SORT 884737u-#define DIGIT_ADV {0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f}+#define DIGIT_ADV {0.4138f, 0.4138f, 0.4138f, 0.4138f, 0.4138f, 0.4138f, 0.4138f, 0.4138f, 0.4138f, 0.4138f}#define VMOP_NOP 1#define VMOP_WAIT 2#define VMOP_NEXTFRAMEEVENT 3@@ -1140,7 +1140,7 @@#define TXT_CHARM_NAMES_INV {-1, 260, 261, 262, 263, -1, 264, 265, 266, -1, -1, -1, -1, -1, 267, -1, -1, -1, 268, 269, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}#define TXT_CHARM_DESCS {-1, 271, 272, 273, 274, -1, 275, 276, 277, -1, -1, -1, -1, -1, 278, -1, -1, -1, 279, 280, 281, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}#define TXT_KEY_OK 282-#define TXT_CHARM_BENCH 439+#define TXT_CHARM_BENCH 283#define INV_FIXED {{2935, -7.1600f, -3.8300f, 1.0000f, 1.0000f}, {2936, -3.2500f, -4.2100f, 1.0000f, 1.0000f}, {2937, -7.2900f, -9.4400f, 1.0000f, 1.0000f}, {2938, -4.7200f, -6.2100f, 1.0000f, 1.0000f}, {2939, -3.2700f, -7.4600f, 1.0000f, 1.0000f}, {2940, -5.7200f, -13.3200f, 1.0000f, 1.0000f}}#define INV_FIXED_BG {{-1, 0, 0, 0, 0}, {-1, 0, 0, 0, 0}, {-1, 0, 0, 0, 0}, {2941, -4.6374f, -6.2413f, 1.0000f, 1.0000f}, {2942, -3.2774f, -7.4713f, 1.0000f, 1.0000f}, {-1, 0, 0, 0, 0}}#define INV_FIXED_BOX {{1.9363f, 2.9287f, -0.0651f, 0.0923f}, {1.4420f, 1.4140f, -0.0546f, 0.0682f}, {1.6244f, 5.3245f, 0.0126f, 0.1884f}, {1.7500f, 1.7500f, 0.0000f, 0.0000f}, {1.8505f, 1.8756f, -0.0503f, 0.0629f}, {7.8215f, 1.4409f, 1.7816f, -0.0205f}}@@ -1160,12 +1160,12 @@#define INV_DIVIDERS {{2961, -0.1800f, -7.5100f, 1.0000f, 0.2443f, -90.0000f}, {2961, 8.7300f, -7.5100f, 1.0000f, 0.2443f, -90.0000f}}#define INV_NAME {12.9500f, -1.9345f, 8.3290f}#define INV_DESC {9.2144f, -3.1678f, 7.6475f}-#define TXT_INV_HEART {{283, 284}, {285, 286}, {287, 288}, {285, 289}, {285, 290}, {291, 292}}-#define TXT_INV_VESSEL {{283, 284}, {293, 294}, {295, 296}, {293, 297}, {298, 299}}-#define TXT_INV_FIXED {{300, 301}, {302, 303}, {304, 305}, {306, 307}}-#define TXT_INV_EQ {{308, 309}, {310, 311}, {312, 313}, {314, 315}, {316, 317}, {318, 319}}-#define TXT_INV_QUILL {320, 321, 322, 323}-#define TXT_INV_TRINKETS {{324, 325}, {326, 327}, {328, 329}, {330, 331}}+#define TXT_INV_HEART {{284, 285}, {286, 287}, {288, 289}, {286, 290}, {286, 291}, {292, 293}}+#define TXT_INV_VESSEL {{284, 285}, {294, 295}, {296, 297}, {294, 298}, {299, 300}}+#define TXT_INV_FIXED {{301, 302}, {303, 304}, {305, 306}, {307, 308}}+#define TXT_INV_EQ {{309, 310}, {311, 312}, {313, 314}, {315, 316}, {317, 318}, {319, 320}}+#define TXT_INV_QUILL {321, 322, 323, 324}+#define TXT_INV_TRINKETS {{325, 326}, {327, 328}, {329, 330}, {331, 332}}#define SHOP_BACKBOARD {2962, 4.9000f, -0.3200f, 0.8667f, 1.0000f}#define SHOP_MASK_TOP {2963, 5.1230f, 4.8800f, 1.0000f, 0.9013f}#define SHOP_MASK_BOTTOM {2964, 5.1537f, -5.6200f, 1.0000f, 0.8820f}@@ -1177,7 +1177,7 @@#define SHOP_POINTER_R {2968, 6.6249f, -2.0798f, -1.0000f, 1.0000f}#define SHOP_MASK_A {0, 0, 255, 255, 255, 255, 255, 254, 249, 230, 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 73, 134, 178, 204, 226, 223, 0, 0, 0, 0, 0, 0}#define SHOP_CONFIRM_ITEM {5.0900f, 2.4700f}-#define TXT_KEY_BACK 333+#define TXT_KEY_BACK 334#define SHOP_BACKBOARD_A 0.8910f#define SHOP_BORDERS {{5.1437f, 3.6600f, 1.1244f, 1.0000f, CLIP_SHOPUI_SHOP_MENU_TOP_UP, CLIP_SHOPUI_SHOP_MENU_TOP_DOWN, 0.0000f}, {5.1937f, -5.7000f, 1.1338f, 1.0000f, CLIP_SHOPUI_SHOP_MENU_BOTTOM_UP, CLIP_SHOPUI_SHOP_MENU_BOTTOM_DOWN, 0.0000f}}#define SHOP_FIGUREHEADS {{5.1437f, 6.6400f, 1.0000f, 1.0000f, CLIP_SHOPUI_SHOP_FIGUREHEAD_SLY_UP, CLIP_SHOPUI_SHOP_FIGUREHEAD_SLY_DOWN, 0.3500f}, {5.1437f, 6.7400f, 1.0000f, 1.0000f, CLIP_SHOPUI_SHOP_FIGUREHEAD_MAPPERWIFE_UP, CLIP_SHOPUI_SHOP_FIGUREHEAD_MAPPERWIFE_DOWN, 0.3500f}, {5.1437f, 6.8300f, 1.0000f, 1.0000f, CLIP_SHOPUI_SHOP_FIGUREHEAD_SLUG_UP, CLIP_SHOPUI_SHOP_FIGUREHEAD_SLUG_DOWN, 0.3500f}}@@ -1205,24 +1205,24 @@#define SHOP_ROW_TOP 4.9000f#define SHOP_ROW_BOTTOM -5.2500f#define SHOP_ARROW_BOB 0.1500f-#define TXT_SHOP_CTRL_BUY 336-#define TXT_SHOP_CTRL_EXIT 337-#define TXT_SHOP_CTRL_CONFIRM 338-#define TXT_SHOP_CTRL_CANCEL 339-#define TXT_SHOP_SHOP_PURCHASE_CONFIRM 340-#define TXT_SHOP_SHOP_PURCHASE_COMPLETE 341-#define TXT_SHOP_CHARM_TXT_NOTCHCOST 342-#define TXT_SHOP_YES 343-#define TXT_SHOP_NO 344+#define TXT_SHOP_CTRL_BUY 337+#define TXT_SHOP_CTRL_EXIT 338+#define TXT_SHOP_CTRL_CONFIRM 339+#define TXT_SHOP_CTRL_CANCEL 340+#define TXT_SHOP_SHOP_PURCHASE_CONFIRM 341+#define TXT_SHOP_SHOP_PURCHASE_COMPLETE 342+#define TXT_SHOP_CHARM_TXT_NOTCHCOST 343+#define TXT_SHOP_YES 344+#define TXT_SHOP_NO 345#define SHOP_DESC_BOTTOM -5.0500f-#define SHOP_ITEMS {{2971, 0.5714f, 345, 346, 150, 1, 125, -1, 0, 0}, {2971, 0.5714f, 345, 347, 500, 1, 126, 125, 0, 0}, {2972, 0.5714f, 348, 349, 550, 3, 127, -1, 0, 0}, {2973, 0.5714f, 350, 351, 950, 10, 128, -1, 0, 0}, {2974, 0.5714f, 352, 353, 300, 2, 37, -1, 0, 1}, {2975, 0.5714f, 354, 355, 200, 2, 40, -1, 0, 4}, {2976, 0.5714f, 356, 357, 1800, 0, 119, -1, 0, 0}, {2977, 0.5714f, 358, 359, 60, 11, 129, -1, 0, 0}, {2978, 0.5714f, 360, 361, 220, 2, 38, -1, 0, 2}, {2979, 0.5714f, 362, 363, 120, 0, 2, -1, 0, 0}, {2980, 0.5714f, 364, 365, 40, 9, 130, 10, 0, 0}, {2980, 0.5714f, 366, 367, 80, 9, 131, 28, 0, 0}, {2981, 0.5714f, 368, 369, 100, 16, 133, -1, 0, 0}, {2982, 0.5714f, 370, 371, 100, 16, 134, -1, 0, 0}, {2983, 0.5714f, 372, 373, 100, 16, 135, -1, 0, 0}, {2984, 0.5714f, 374, 375, 100, 16, 137, 147, 0, 0}, {2985, 0.5714f, 376, 377, 100, 16, 136, -1, 0, 0}, {2986, 0.5714f, 378, 379, 100, 17, 139, -1, 0, 0}, {2987, 0.5714f, 380, 381, 100, 17, 140, -1, 0, 0}, {2988, 0.5714f, 382, 383, 100, 17, 141, 14, 0, 0}, {2989, 0.5714f, 384, 385, 210, 17, 142, 14, 0, 0}, {2990, 0.5714f, 386, 387, 250, 2, 44, -1, 0, 8}, {2991, 0.5714f, 388, 389, 300, 2, 54, -1, 0, 18}, {2992, 0.5714f, 390, 391, 120, 2, 50, -1, 0, 14}, {2993, 0.5714f, 392, 393, 220, 2, 55, -1, 0, 19}, {2994, 0.5714f, 394, 395, 800, 2, 43, -1, 0, 7}, {2995, 0.5714f, 396, 397, 120, 8, 143, -1, 5, 0}, {2995, 0.5714f, 396, 397, 500, 8, 144, -1, 10, 0}, {2995, 0.5714f, 396, 397, 900, 8, 145, -1, 18, 0}, {2995, 0.5714f, 396, 398, 1400, 8, 146, -1, 25, 0}}+#define SHOP_ITEMS {{2971, 0.5714f, 346, 347, 150, 1, 125, -1, 0, 0}, {2971, 0.5714f, 346, 348, 500, 1, 126, 125, 0, 0}, {2972, 0.5714f, 349, 350, 550, 3, 127, -1, 0, 0}, {2973, 0.5714f, 351, 352, 950, 10, 128, -1, 0, 0}, {2974, 0.5714f, 353, 354, 300, 2, 37, -1, 0, 1}, {2975, 0.5714f, 355, 356, 200, 2, 40, -1, 0, 4}, {2976, 0.5714f, 357, 358, 1800, 0, 119, -1, 0, 0}, {2977, 0.5714f, 359, 360, 60, 11, 129, -1, 0, 0}, {2978, 0.5714f, 361, 362, 220, 2, 38, -1, 0, 2}, {2979, 0.5714f, 363, 364, 120, 0, 2, -1, 0, 0}, {2980, 0.5714f, 365, 366, 40, 9, 130, 10, 0, 0}, {2980, 0.5714f, 367, 368, 80, 9, 131, 28, 0, 0}, {2981, 0.5714f, 369, 370, 100, 16, 133, -1, 0, 0}, {2982, 0.5714f, 371, 372, 100, 16, 134, -1, 0, 0}, {2983, 0.5714f, 373, 374, 100, 16, 135, -1, 0, 0}, {2984, 0.5714f, 375, 376, 100, 16, 137, 147, 0, 0}, {2985, 0.5714f, 377, 378, 100, 16, 136, -1, 0, 0}, {2986, 0.5714f, 379, 380, 100, 17, 139, -1, 0, 0}, {2987, 0.5714f, 381, 382, 100, 17, 140, -1, 0, 0}, {2988, 0.5714f, 383, 384, 100, 17, 141, 14, 0, 0}, {2989, 0.5714f, 385, 386, 210, 17, 142, 14, 0, 0}, {2990, 0.5714f, 387, 388, 250, 2, 44, -1, 0, 8}, {2991, 0.5714f, 389, 390, 300, 2, 54, -1, 0, 18}, {2992, 0.5714f, 391, 392, 120, 2, 50, -1, 0, 14}, {2993, 0.5714f, 393, 394, 220, 2, 55, -1, 0, 19}, {2994, 0.5714f, 395, 396, 800, 2, 43, -1, 0, 7}, {2995, 0.5714f, 397, 398, 120, 8, 143, -1, 5, 0}, {2995, 0.5714f, 397, 398, 500, 8, 144, -1, 10, 0}, {2995, 0.5714f, 397, 398, 900, 8, 145, -1, 18, 0}, {2995, 0.5714f, 397, 399, 1400, 8, 146, -1, 25, 0}}#define SHOP_FIRST {0, 8, 21, 30}#define SHOP_ROW_GEO {2970, 1.4551f, 0.0000f, 1.0000f, 1.0000f}#define SHOP_ROW_COST {1.8423f, 0.2885f}#define SHOP_ACTIVE_RGB {255, 255, 255}#define SHOP_INACTIVE_RGB {141, 141, 141}#define SHOP_ROOMS {"Room_shop", "Room_mapper", "Room_Charm_Shop"}-#define SHOP_NOSTOCK {400, 401, 402}+#define SHOP_NOSTOCK {401, 402, 403}#define SHOP_TITLES {TITLE_SLY, TITLE_ISELDA, TITLE_CHARM_SLUG}#define SHOP_N 3#define COLLECT_FLEUR {0.0000f, 0.0000f, 0.0000f, 1.0000f}@@ -1248,24 +1248,24 @@#define STAG_LIST_KNIGHT {3001, -10.5102f, 4.6056f, 1.0000f, 1.0000f}#define STAG_DIVIDER {3004, -7.6003f, 5.2734f, -1.0000f, -0.8696f}#define STAG_T_STATIONS {-7.5992f, 6.0194f, 5.8145f}-#define TXT_STAG_STATIONS 403-#define TXT_STAG_NAMES {404, 364, 366}+#define TXT_STAG_STATIONS 404+#define TXT_STAG_NAMES {405, 365, 367}#define STAG_NAMES_STR {124, 123, 127}#define STAG_BORDER_TOP {-0.0963f, 7.0185f, 0.9784f, 1.0028f, CLIP_STAGUI_STAG_BORDER_TOP_UP, CLIP_STAGUI_STAG_BORDER_TOP_DOWN, 0}#define STAG_BORDER_BOTTOM {-0.0638f, -6.5632f, 0.9165f, 0.9394f, CLIP_STAGUI_STAG_BORDER_BOTTOM_UP, CLIP_STAGUI_STAG_BORDER_BOTTOM_DOWN, 0}#define STAG_T_ACT_CONFIRM {11.1713f, -4.5306f, 15.3500f}#define STAG_KEY_CONFIRM {11.7464f, -4.7993f}-#define TXT_STAG_CTRL_TRAVEL 405+#define TXT_STAG_CTRL_TRAVEL 406#define STAG_T_ACT_CANCEL {11.1713f, -5.3525f, 15.3500f}#define STAG_KEY_CANCEL {11.7464f, -5.6213f}-#define TXT_STAG_CTRL_CANCEL 339+#define TXT_STAG_CTRL_CANCEL 340#define STAG_SCENES_STR {137, 136, 138}#define STAG_SCENES_ROOM {4, 19, 36}-#define MAP_AREAS {{0, 2, -1, 4.0700f, -11.6200f, 409, 0x14u}, {2, 24, 130, -0.0400f, -7.8800f, 412, 0x400020u}, {26, 16, 131, 16.3100f, -7.8700f, 413, 0x40u}}-#define MAP_ROOMS {{0, 1, 3005, 3006, -1.9230f, 7.6490f, 4.0800f, 2.1400f, 0xB6B6B6, 1}, {0, 0, 3012, 3013, -5.4430f, 7.4690f, 2.9600f, 1.4800f, 0x636363, 1}, {1, 12, -1, -1, -1.5030f, 5.1050f, 0.0000f, 0.0000f, 0x000000, 0}, {1, 38, 3015, -1, 0.8660f, 4.8850f, 1.8700f, 0.4300f, 0xB5DDFB, 0}, {1, 255, 3016, 3017, 3.3290f, 6.5270f, 0.8900f, 0.3800f, 0xB5DDFB, 1}, {1, 19, 3018, -1, 1.4650f, 4.4640f, 0.6500f, 0.3100f, 0xB5DDFB, 0}, {1, 255, 3019, 3020, 0.9410f, 4.0880f, 1.3600f, 0.3900f, 0xB5DDFB, 1}, {1, 15, 3021, 3022, 1.6660f, 6.5240f, 1.3000f, 0.3400f, 0xB5DDFB, 1}, {1, 9, 3023, -1, -3.0980f, 6.4880f, 1.1110f, 0.4800f, 0xB5DDFB, 0}, {1, 10, 3025, 3026, -2.2270f, 4.6390f, 0.6800f, 0.8600f, 0xB5DDFB, 1}, {1, 25, 3027, -1, -0.6440f, 4.4430f, 0.7000f, 0.3700f, 0xB5DDFB, 0}, {1, 14, 3029, 3030, 0.8660f, 4.8850f, 1.8584f, 0.5000f, 0xB5DDFB, 1}, {1, 20, 3031, 3032, 2.0720f, 3.8620f, 0.9500f, 0.7900f, 0xB5DDFB, 1}, {1, 17, 3033, 3034, 1.6240f, 5.9190f, 1.3800f, 0.5200f, 0xB5DDFB, 1}, {1, 16, 3035, 3036, 2.6280f, 6.1870f, 0.7000f, 1.0300f, 0xB5DDFB, 1}, {1, 255, 3037, 3038, -0.3640f, 4.0580f, 1.2500f, 0.3500f, 0xB5DDFB, 1}, {1, 255, 3039, 3040, -3.1500f, 4.3130f, 1.1700f, 0.3500f, 0xB5DDFB, 1}, {1, 26, 3041, -1, -3.7180f, 5.7650f, 2.3517f, 0.4300f, 0xB5DDFB, 0}, {1, 13, 3043, 3044, -0.5860f, 5.0990f, 1.1900f, 0.8800f, 0xB5DDFB, 1}, {1, 24, 3045, 3046, -1.4530f, 4.2330f, 0.9600f, 0.6900f, 0xB5DDFB, 1}, {1, 8, 3047, 3048, -2.2170f, 5.8440f, 0.6800f, 1.5700f, 0xB5DDFB, 1}, {1, 11, 3049, -1, -1.5030f, 5.1050f, 0.8500f, 0.8900f, 0xB5DDFB, 0}, {1, 21, 3050, -1, 3.7290f, 3.4460f, 2.4100f, 0.6600f, 0xB5DDFB, 0}, {1, 18, 3052, 3053, 2.0240f, 4.9490f, 0.5900f, 1.4673f, 0xB5DDFB, 1}, {1, 6, 3054, 3055, 0.3470f, 6.6100f, 1.3800f, 0.5000f, 0xB5DDFB, 1}, {1, 5, 3056, 3057, -1.1130f, 6.6140f, 1.5800f, 0.7500f, 0xB5DDFB, 1}, {2, 255, 3058, 3059, -6.5180f, 4.0350f, 1.0100f, 0.8900f, 0xCFFFC3, 1}, {2, 33, 3060, 3061, -10.8980f, 6.4740f, 1.3600f, 0.7100f, 0xCFFFC3, 1}, {2, 32, 3062, 3063, -11.2830f, 5.0920f, 0.5900f, 2.1300f, 0xCFFFC3, 1}, {2, 255, 3064, 3065, -11.8520f, 3.8320f, 1.6500f, 0.4800f, 0xCFFFC3, 1}, {2, 35, 3066, -1, -12.3910f, 5.0270f, 0.5700f, 1.9700f, 0xCFFFC3, 0}, {2, 34, 3067, 3068, -12.2580f, 6.4100f, 1.3800f, 0.8200f, 0xCFFFC3, 1}, {2, 255, 3069, 3070, -7.6750f, 3.7830f, 1.3400f, 0.4200f, 0xCFFFC3, 1}, {2, 30, 3071, -1, -9.2170f, 5.6940f, 1.2300f, 0.4400f, 0xCFFFC3, 0}, {2, 36, 3072, -1, -12.9760f, 5.8120f, 0.6000f, 0.3000f, 0xCFFFC3, 0}, {2, 255, 3073, 3074, -9.6830f, 3.8190f, 2.6800f, 0.4600f, 0xCFFFC3, 1}, {2, 255, 3075, 3076, -6.8080f, 4.7040f, 2.3200f, 0.5100f, 0xCFFFC3, 1}, {2, 37, 3077, 3078, -13.6530f, 6.1350f, 1.4100f, 1.0200f, 0xCFFFC3, 1}, {2, 31, 3079, -1, -10.4130f, 5.6780f, 1.1700f, 0.5500f, 0xCFFFC3, 0}, {2, 29, 3080, 3081, -8.2930f, 5.2090f, 0.6700f, 1.2200f, 0xCFFFC3, 1}, {2, 28, 3082, 3083, -7.6430f, 5.9550f, 0.6700f, 0.7500f, 0xCFFFC3, 1}, {2, 27, 3084, 3085, -6.1000f, 5.8290f, 2.4400f, 0.6700f, 0xCFFFC3, 1}}+#define MAP_AREAS {{0, 2, -1, 4.0700f, -11.6200f, 410, 0x14u}, {2, 24, 130, -0.0400f, -7.8800f, 413, 0x400020u}, {26, 16, 131, 16.3100f, -7.8700f, 414, 0x40u}}+#define MAP_ROOMS {{0, 1, 3005, 3006, -1.9230f, 7.6490f, 4.0800f, 2.1400f, 0xB6B6B6, 1}, {0, 0, 3012, 3013, -5.4430f, 7.4690f, 2.9600f, 1.4800f, 0x636363, 1}, {1, 12, -1, -1, -1.5030f, 5.1050f, 0.0000f, 0.0000f, 0x000000, 0}, {1, 127, 3015, -1, 0.8660f, 4.8850f, 1.8700f, 0.4300f, 0xB5DDFB, 0}, {1, 255, 3016, 3017, 3.3290f, 6.5270f, 0.8900f, 0.3800f, 0xB5DDFB, 1}, {1, 19, 3018, -1, 1.4650f, 4.4640f, 0.6500f, 0.3100f, 0xB5DDFB, 0}, {1, 255, 3019, 3020, 0.9410f, 4.0880f, 1.3600f, 0.3900f, 0xB5DDFB, 1}, {1, 15, 3021, 3022, 1.6660f, 6.5240f, 1.3000f, 0.3400f, 0xB5DDFB, 1}, {1, 9, 3023, -1, -3.0980f, 6.4880f, 1.1110f, 0.4800f, 0xB5DDFB, 0}, {1, 10, 3025, 3026, -2.2270f, 4.6390f, 0.6800f, 0.8600f, 0xB5DDFB, 1}, {1, 25, 3027, -1, -0.6440f, 4.4430f, 0.7000f, 0.3700f, 0xB5DDFB, 0}, {1, 14, 3029, 3030, 0.8660f, 4.8850f, 1.8584f, 0.5000f, 0xB5DDFB, 1}, {1, 20, 3031, 3032, 2.0720f, 3.8620f, 0.9500f, 0.7900f, 0xB5DDFB, 1}, {1, 17, 3033, 3034, 1.6240f, 5.9190f, 1.3800f, 0.5200f, 0xB5DDFB, 1}, {1, 16, 3035, 3036, 2.6280f, 6.1870f, 0.7000f, 1.0300f, 0xB5DDFB, 1}, {1, 255, 3037, 3038, -0.3640f, 4.0580f, 1.2500f, 0.3500f, 0xB5DDFB, 1}, {1, 255, 3039, 3040, -3.1500f, 4.3130f, 1.1700f, 0.3500f, 0xB5DDFB, 1}, {1, 26, 3041, -1, -3.7180f, 5.7650f, 2.3517f, 0.4300f, 0xB5DDFB, 0}, {1, 13, 3043, 3044, -0.5860f, 5.0990f, 1.1900f, 0.8800f, 0xB5DDFB, 1}, {1, 24, 3045, 3046, -1.4530f, 4.2330f, 0.9600f, 0.6900f, 0xB5DDFB, 1}, {1, 8, 3047, 3048, -2.2170f, 5.8440f, 0.6800f, 1.5700f, 0xB5DDFB, 1}, {1, 11, 3049, -1, -1.5030f, 5.1050f, 0.8500f, 0.8900f, 0xB5DDFB, 0}, {1, 21, 3050, -1, 3.7290f, 3.4460f, 2.4100f, 0.6600f, 0xB5DDFB, 0}, {1, 18, 3052, 3053, 2.0240f, 4.9490f, 0.5900f, 1.4673f, 0xB5DDFB, 1}, {1, 6, 3054, 3055, 0.3470f, 6.6100f, 1.3800f, 0.5000f, 0xB5DDFB, 1}, {1, 5, 3056, 3057, -1.1130f, 6.6140f, 1.5800f, 0.7500f, 0xB5DDFB, 1}, {2, 255, 3058, 3059, -6.5180f, 4.0350f, 1.0100f, 0.8900f, 0xCFFFC3, 1}, {2, 33, 3060, 3061, -10.8980f, 6.4740f, 1.3600f, 0.7100f, 0xCFFFC3, 1}, {2, 32, 3062, 3063, -11.2830f, 5.0920f, 0.5900f, 2.1300f, 0xCFFFC3, 1}, {2, 255, 3064, 3065, -11.8520f, 3.8320f, 1.6500f, 0.4800f, 0xCFFFC3, 1}, {2, 35, 3066, -1, -12.3910f, 5.0270f, 0.5700f, 1.9700f, 0xCFFFC3, 0}, {2, 34, 3067, 3068, -12.2580f, 6.4100f, 1.3800f, 0.8200f, 0xCFFFC3, 1}, {2, 255, 3069, 3070, -7.6750f, 3.7830f, 1.3400f, 0.4200f, 0xCFFFC3, 1}, {2, 30, 3071, -1, -9.2170f, 5.6940f, 1.2300f, 0.4400f, 0xCFFFC3, 0}, {2, 36, 3072, -1, -12.9760f, 5.8120f, 0.6000f, 0.3000f, 0xCFFFC3, 0}, {2, 255, 3073, 3074, -9.6830f, 3.8190f, 2.6800f, 0.4600f, 0xCFFFC3, 1}, {2, 255, 3075, 3076, -6.8080f, 4.7040f, 2.3200f, 0.5100f, 0xCFFFC3, 1}, {2, 37, 3077, 3078, -13.6530f, 6.1350f, 1.4100f, 1.0200f, 0xCFFFC3, 1}, {2, 31, 3079, -1, -10.4130f, 5.6780f, 1.1700f, 0.5500f, 0xCFFFC3, 0}, {2, 29, 3080, 3081, -8.2930f, 5.2090f, 0.6700f, 1.2200f, 0xCFFFC3, 1}, {2, 28, 3082, 3083, -7.6430f, 5.9550f, 0.6700f, 0.7500f, 0xCFFFC3, 1}, {2, 27, 3084, 3085, -6.1000f, 5.8290f, 2.4400f, 0.6700f, 0xCFFFC3, 1}}#define MAP_PINS {{0, 0, 3007, -2.0390f, 7.7500f, 133, -1}, {0, 0, 3008, -1.6430f, 7.7500f, 137, -1}, {0, 0, 3009, -2.4700f, 7.7500f, 135, 122}, {0, 0, 3010, -1.2540f, 7.7600f, 135, 123}, {1, 1, 3014, -6.2100f, 7.6800f, 134, -1}, {2, 1, 3014, -1.3150f, 5.0920f, 134, -1}, {5, 0, 3008, 1.2400f, 4.4520f, 137, -1}, {5, 0, 3007, 1.6210f, 4.4490f, 133, -1}, {8, 0, 3024, -3.0697f, 6.4597f, 135, -1}, {10, 0, 3007, -0.3430f, 4.4060f, 133, -1}, {10, 0, 3028, -0.7200f, 4.3930f, 136, -1}, {21, 0, 3007, -1.6940f, 5.0880f, 133, -1}, {22, 0, 3051, 4.5530f, 3.3700f, 135, 124}, {22, 0, 3007, 4.9480f, 3.3820f, 133, -1}, {27, 1, 3014, -10.9970f, 6.6240f, 134, -1}, {28, 0, 3007, -11.2580f, 4.9690f, 133, -1}, {34, 0, 3007, -12.8160f, 5.7890f, 133, -1}, {34, 0, 3008, -13.1960f, 5.7970f, 137, -1}, {40, 0, 3007, -7.6610f, 6.0700f, 133, -1}}-#define MAP_NEXT {{0, 3011, -1.0730f, 6.4850f, 180.0000f, 408, -1.0730f, 6.1870f, 1, -1}, {17, 3042, -5.2607f, 5.8454f, 90.0000f, 410, -5.5969f, 6.0434f, 2, 16}, {25, 3011, -1.0730f, 7.2500f, 0.0000f, 407, -1.0930f, 7.9120f, 1, -1}, {41, 3011, -4.5300f, 5.8450f, -90.0000f, 408, -4.1075f, 6.0470f, 0, 6}}-#define MAP_NAMES {{0, -1, 406, -0.2000f, 8.3901f, 0xFFFFFF, 1, 0}, {0, -1, 407, 3.3200f, 8.4801f, 0xFFFFFF, 1, 1}, {1, -1, 408, 6.7700f, 3.3701f, 0xB5DCFB, 1, 1}, {1, 21, 411, 3.4800f, 5.6971f, 0xB5DCFB, 1, 0}, {2, -1, 410, -5.0993f, 5.4501f, 0xCFFFC3, 0, 1}}+#define MAP_NEXT {{0, 3011, -1.0730f, 6.4850f, 180.0000f, 409, -1.0730f, 6.1870f, 1, -1}, {17, 3042, -5.2607f, 5.8454f, 90.0000f, 411, -5.5969f, 6.0434f, 2, 16}, {25, 3011, -1.0730f, 7.2500f, 0.0000f, 408, -1.0930f, 7.9120f, 1, -1}, {41, 3011, -4.5300f, 5.8450f, -90.0000f, 409, -4.1075f, 6.0470f, 0, 6}}+#define MAP_NAMES {{0, -1, 407, -0.2000f, 8.3901f, 0xFFFFFF, 1, 0}, {0, -1, 408, 3.3200f, 8.4801f, 0xFFFFFF, 1, 1}, {1, -1, 409, 6.7700f, 3.3701f, 0xB5DCFB, 1, 1}, {1, 21, 412, 3.4800f, 5.6971f, 0xB5DCFB, 1, 0}, {2, -1, 411, -5.0993f, 5.4501f, 0xCFFFC3, 0, 1}}#define MAP_QUICK_K 1.5500f#define MAP_SHADE {{3086, 0.0055f, -0.0110f, 178}, {3087, 0.0000f, 0.0000f, 255}}#define MAP_MARKERS {3088, 3089, 3090, 3091}@@ -1274,14 +1274,14 @@#define MAP_TITLE {0.0000f, 7.5363f}#define MAP_TITLE_BACK {3092, 0.2520f, 7.1073f, 1.0000f, 0.6696f, 246}#define MAP_NO_MAP {3093, 0.0000f, 0.9400f}-#define MAP_NO_MAP_MSG {414, -0.0600f, -1.2932f}-#define MAP_MSG {-1.2900f, -6.8300f, 0.0000f, 0.0420f, 0.9865f, -0.0210f, 415, 3094, 1.9740f, -0.0840f, 1.0000f, 0.6931f, 179}+#define MAP_NO_MAP_MSG {415, -0.0600f, -1.2932f}+#define MAP_MSG {-1.2900f, -6.8300f, 0.0000f, 0.0420f, 0.9865f, -0.0210f, 416, 3094, 1.9740f, -0.0840f, 1.0000f, 0.6931f, 179}#define MAP_MSG_K 0.7000f#define FIRSTMAP_BG_A 0.6410f-#define FIRSTMAP_TEXTS {{416, 0.0000f, 5.0305f}, {182, 0.0000f, -0.8796f}, {417, 0.0000f, -3.2895f}, {418, 0.0000f, -4.6996f}}+#define FIRSTMAP_TEXTS {{417, 0.0000f, 5.0305f}, {182, 0.0000f, -0.8796f}, {418, 0.0000f, -3.2895f}, {419, 0.0000f, -4.6996f}}#define FIRSTMAP_PIECES {{3095, 0.0000f, 2.1300f, 1.0000f, 1.0000f}, {3096, 0.0000f, 0.0200f, 1.0000f, 0.0771f}, {3097, 0.0000f, -6.4000f, 1.0000f, 1.0000f}}-#define FIRSTMAP_KEY {419, 0.0900f, -2.3200f}-#define MAP_WIDE {{{3098, 3.0400f, -6.6800f, 1.0000f, 1.0000f}, 420, {8.7184f, -6.2919f, 11.0476f}, 4.0000f, -8.6420f, 3.3800f, -7.0700f, {1000.0000f, -1000.0000f, 1000.0000f, -1000.0000f}}, {{3099, 4.2300f, -8.2600f, 1.0000f, 1.0000f}, 421, {9.9990f, -7.8578f, 11.7784f}, -0.0400f, -7.5800f, 3.0300f, -8.2300f, {1000.0000f, -1000.0000f, 1000.0000f, -1000.0000f}}, {{3100, -0.6100f, -7.9700f, 1.0000f, 1.0000f}, 422, {5.6452f, -7.7738f, 11.8448f}, 16.4200f, -7.3200f, 0.4000f, -8.5800f, {1000.0000f, 17.2600f, 1000.0000f, -6.2200f}}}+#define FIRSTMAP_KEY {420, 0.0900f, -2.3200f}+#define MAP_WIDE {{{3098, 3.0400f, -6.6800f, 1.0000f, 1.0000f}, 421, {8.7184f, -6.2919f, 11.0476f}, 4.0000f, -8.6420f, 3.3800f, -7.0700f, {1000.0000f, -1000.0000f, 1000.0000f, -1000.0000f}}, {{3099, 4.2300f, -8.2600f, 1.0000f, 1.0000f}, 422, {9.9990f, -7.8578f, 11.7784f}, -0.0400f, -7.5800f, 3.0300f, -8.2300f, {1000.0000f, -1000.0000f, 1000.0000f, -1000.0000f}}, {{3100, -0.6100f, -7.9700f, 1.0000f, 1.0000f}, 423, {5.6452f, -7.7738f, 11.8448f}, 16.4200f, -7.3200f, 0.4000f, -8.5800f, {1000.0000f, 17.2600f, 1000.0000f, -6.2200f}}}#define MAP_WIDE_GREY 0x5C#define MAP_WIDE_NAME_GREY 0x5B#define MAP_WIDE_COMPASS_K 0.8700f@@ -1289,14 +1289,14 @@#define MAP_PAN {-1.4400f, 4.5500f, -8.6420f, -5.5800f}#define MAP_PAN_SPEED 8.0000f#define MAP_PAN_ARROWS {{3101, 3.9700f, -2.1900f, 1.0f, 0.0000f}, {3101, 4.0400f, -13.4900f, 1.0f, 180.0000f}, {3101, -9.0000f, -7.1700f, 1.0f, 90.0000f}, {3101, 17.1900f, -7.1700f, 1.0f, -90.0000f}}-#define MAP_ACT_CONFIRM {{3102, 15.3897f, -13.3139f, 1.0000f, 0.8889f}, {16.9008f, -13.2878f}, {16.1269f, -13.0221f, 15.3500f}, {423, 424, 424}}-#define MAP_ACT_MARKER {{3102, -6.9500f, -13.3138f, 1.0000f, 0.8889f}, {-8.5394f, -13.2877f}, {-7.7259f, -13.0223f, 7.6740f}, {425, 426, 427}}-#define MAP_ACT_CANCEL {{3102, 15.3897f, -13.3138f, 1.0000f, 0.8889f}, {16.9008f, -13.2877f}, {16.1259f, -13.0223f, 15.3480f}, {339, 339, 339}}-#define MAP_ACT_CHANGE {{3102, -6.9500f, -12.0238f, 1.0000f, 0.8889f}, {-8.5394f, -11.9977f}, {-7.7259f, -11.7323f, 7.6740f}, {428, 428, 428}}-#define MAP_ACT_KEY {{3102, 15.3897f, -12.2039f, 1.0000f, 0.8889f}, {16.9008f, -12.1778f}, {16.3265f, -11.9122f, 15.3500f}, {429, 430, 431}}+#define MAP_ACT_CONFIRM {{3102, 15.3897f, -13.3139f, 1.0000f, 0.8889f}, {16.9008f, -13.2878f}, {16.1269f, -13.0221f, 15.3500f}, {424, 425, 425}}+#define MAP_ACT_MARKER {{3102, -6.9500f, -13.3138f, 1.0000f, 0.8889f}, {-8.5394f, -13.2877f}, {-7.7259f, -13.0223f, 7.6740f}, {426, 427, 428}}+#define MAP_ACT_CANCEL {{3102, 15.3897f, -13.3138f, 1.0000f, 0.8889f}, {16.9008f, -13.2877f}, {16.1259f, -13.0223f, 15.3480f}, {340, 340, 340}}+#define MAP_ACT_CHANGE {{3102, -6.9500f, -12.0238f, 1.0000f, 0.8889f}, {-8.5394f, -11.9977f}, {-7.7259f, -11.7323f, 7.6740f}, {429, 429, 429}}+#define MAP_ACT_KEY {{3102, 15.3897f, -12.2039f, 1.0000f, 0.8889f}, {16.9008f, -12.1778f}, {16.3265f, -11.9122f, 15.3500f}, {430, 431, 432}}#define MAP_KEY_BB {3103, 13.6200f, 3.4200f, 0.3781f, 1.0000f}#define MAP_KEY_STEP -0.8250f-#define MAP_KEY_ROWS {{{3104, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 432, {12.7550f, -1.5413f, 15.3500f}}, {{3105, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 433, {12.7550f, -1.5413f, 15.3500f}}, {{3106, 11.7720f, -1.7460f, 1.0000f, 1.0000f}, 434, {12.7550f, -1.5413f, 15.3500f}}, {{3107, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 435, {12.7550f, -1.5413f, 15.3500f}}, {{3108, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 436, {12.7550f, -1.5413f, 15.3500f}}}+#define MAP_KEY_ROWS {{{3104, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 433, {12.7550f, -1.5413f, 15.3500f}}, {{3105, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 434, {12.7550f, -1.5413f, 15.3500f}}, {{3106, 11.7720f, -1.7460f, 1.0000f, 1.0000f}, 435, {12.7550f, -1.5413f, 15.3500f}}, {{3107, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 436, {12.7550f, -1.5413f, 15.3500f}}, {{3108, 11.8600f, -1.7400f, 1.0000f, 1.0000f}, 437, {12.7550f, -1.5413f, 15.3500f}}}#define MAP_KEY_FLAGS {133, 134, 135, 136, 137}#define MAP_KEY_N 5#define MAP_MM_PIECES {{3109, 4.0500f, -12.3700f, 1.0000f, 1.0000f}, {3110, 4.0100f, -12.9500f, 0.7510f, 1.0000f}, {3111, 1.9000f, -12.3700f, 1.0000f, 1.0000f}, {3112, 1.9000f, -12.3700f, 1.0000f, 1.0000f}}@@ -1306,7 +1306,7 @@#define MAP_MM_PLACE {3117, 4.0500f, -7.9900f, -4.9500f, 13.0500f, -10.5500f, -3.5500f, 7.0000f, 20.0000f}#define MAP_MM_RADII 0.8900f#define MAP_MM_UI_PAUSE 0.2000f-#define TXT_KEY_SHIFT 437+#define TXT_KEY_SHIFT 438#define ROOM_ZONES {2, 4, 5, 4, 4, 5, 5, 5, 5, 5, 5, 5, 22, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6}#define MSG_FIREBALL 0#define MSG_DASH 1diff --git a/games/hollowknight/src/game.h b/games/hollowknight/src/game.hindex e9334aab..69f560af 100644--- a/games/hollowknight/src/game.h+++ b/games/hollowknight/src/game.h@@ -4,6 +4,7 @@/* ---------------------------------------------------------------- PlayerData (what a save keeps) */#define MAX_PERSIST 1024+#define MAX_ROOM_BITS 128 /* (the rooms a save keeps bits of: tools/vm.py) */#define SCENE_NAME 32/* the game's many bools (PlayerData's), by number: new ones only ever added at the end (saves keep them) */enum {@@ -74,14 +75,16 @@ typedef struct {uint8_t current_inv_pane; /* (currentInvPane) */uint8_t stag_position1; /* (stagPosition + 1: 0 none yet, 1 Dirtmouth, 2 Crossroads, 3 Greenpath) */uint8_t stations_opened; /* (stationsOpened) */- /* (scenesVisited, scenesMapped (the quill's), scenesEncounteredCocoon (a lifeblood cocoon broken there): by room) */- uint8_t rooms_visited[5], rooms_mapped[5], rooms_cocoon[5];+ uint8_t old_rooms[3][5]; /* (versions 1 and 2: the rooms' bits below, 40 of each) */uint8_t map_key_pref; /* (mapKeyPref: the map's key and its pins shown 0, the pins only 1, neither 2) */uint8_t mender_state; /* (menderState: 1 the sign broken once, 2 the Mender Bug killed) */uint8_t reserved[13];/* (save version 2 on) the markers placed on the map (placedMarkers_b, _r, _y, _w: their places, 1/100 map units) */uint8_t markers_placed[4];int16_t markers[4][6][2];+ /* (save version 3 on) scenesVisited, scenesMapped (the quill's), scenesEncounteredCocoon (a lifeblood cocoon broken+ * there): by room, the map's own pieces from the last bit down */+ uint8_t rooms_visited[MAX_ROOM_BITS / 8], rooms_mapped[MAX_ROOM_BITS / 8], rooms_cocoon[MAX_ROOM_BITS / 8];/* (saved apart, by the objects' names: their states) */uint8_t persist[MAX_PERSIST / 8];/* (not saved) */@@ -89,6 +92,7 @@ typedef struct {} PlayerData;#define PD_SAVED offsetof(PlayerData, persist)#define PD_SAVED_V1 offsetof(PlayerData, markers_placed) /* (a version 1 save's: no markers) */+#define PD_SAVED_V2 offsetof(PlayerData, rooms_visited) /* (a version 2 save's: the rooms' bits in old_rooms) */extern PlayerData g_pd;static inline bool pd_flag(int f) { return g_pd.flags[f >> 3] >> (f & 7) & 1; }/* (equippedCharm_N) */diff --git a/games/hollowknight/src/map.c b/games/hollowknight/src/map.cindex 289bea54..887684ee 100644--- a/games/hollowknight/src/map.c+++ b/games/hollowknight/src/map.c@@ -45,9 +45,9 @@ static bool held(void) { return g_hero.keys & K_MAP; }static bool pressed(void) { return (g_hero.keys & K_MAP) && !(g_hero.prev_keys & K_MAP); }/* ---------------------------------------------------------------- PlayerData's lists */-static bool bit(const uint8_t *b, int i) { return i >= 0 && i < 40 && (b[i >> 3] >> (i & 7) & 1); }+static bool bit(const uint8_t *b, int i) { return i >= 0 && i < MAX_ROOM_BITS && (b[i >> 3] >> (i & 7) & 1); }static void set_bit(uint8_t *b, int i) {- if (i >= 0 && i < 40) b[i >> 3] |= (uint8_t)(1 << (i & 7));+ if (i >= 0 && i < MAX_ROOM_BITS) b[i >> 3] |= (uint8_t)(1 << (i & 7));}void map_room_entered(void) { set_bit(g_pd.rooms_visited, g_room.id); } /* (SceneManager: scenesVisited) */diff --git a/games/hollowknight/src/save.c b/games/hollowknight/src/save.cindex 74d4ffda..b7c67fe9 100644--- a/games/hollowknight/src/save.c+++ b/games/hollowknight/src/save.c@@ -5,7 +5,8 @@#include "game.h"#define SAVE_MAGIC 0x56534B48u /* "HKSV" */-#define SAVE_VERSION 2 /* (1: PlayerData up to PD_SAVED_V1, loaded with the rest cleared) */+#define SAVE_VERSION 3 /* (1: PlayerData up to PD_SAVED_V1, 2: up to PD_SAVED_V2, loaded with the rest cleared) */+#define V2_ROOMS 38 /* (versions 1 and 2: their rooms, then the map's own pieces) */typedef struct {uint32_t magic, version, size, crc; /* (size, crc: of what follows the header) */@@ -71,7 +72,7 @@ static const uint8_t *whole(const uint8_t *p, uint32_t len, uint32_t *count, uinSaveHead h;if (!p || len < sizeof h) return NULL;memcpy(&h, p, sizeof h);- uint32_t pd = h.version == SAVE_VERSION ? PD_SAVED : h.version == 1 ? PD_SAVED_V1 : 0;+ uint32_t pd = h.version == SAVE_VERSION ? PD_SAVED : h.version == 2 ? PD_SAVED_V2 : h.version == 1 ? PD_SAVED_V1 : 0;if (h.magic != SAVE_MAGIC || !pd || len < sizeof h + pd + 4 || h.size != len - sizeof h ||h.crc != crc32(p + sizeof h, h.size))return NULL;@@ -207,6 +208,19 @@ bool save_load(int slot) {save_select(slot);memset(&g_pd, 0, sizeof g_pd);memcpy(&g_pd, p, pd);+ if (pd < PD_SAVED) {+ /* (versions 1 and 2: the rooms' bits where they were, the map's own pieces after the rooms; the map's from the+ * last bit down now) */+ for (int k = 0; k < 3; k++) {+ uint8_t *to = k == 0 ? g_pd.rooms_visited : k == 1 ? g_pd.rooms_mapped : g_pd.rooms_cocoon;+ for (int i = 0; i < 40; i++)+ if (g_pd.old_rooms[k][i >> 3] >> (i & 7) & 1) {+ int j = i < V2_ROOMS ? i : MAX_ROOM_BITS - 1 - (i - V2_ROOMS);+ to[j >> 3] |= (uint8_t)(1 << (j & 7));+ }+ }+ memset(g_pd.old_rooms, 0, sizeof g_pd.old_rooms);+ }/* (counts kept within their arrays whatever the file says) */for (int c = 0; c < 4; c++)if (g_pd.markers_placed[c] > 6) g_pd.markers_placed[c] = 6;diff --git a/games/hollowknight/src/vm.c b/games/hollowknight/src/vm.cindex 110f3314..36968026 100644--- a/games/hollowknight/src/vm.c+++ b/games/hollowknight/src/vm.c@@ -14,7 +14,7 @@#define MAX_VM_OBJS 48#define MAX_VM_ANIMS 20 /* (its objects that animate: an animator, a wave, a fade) */ /* (tools/vm.py: MAX_OBJS, MAX_FSMS, MAX_VARS) */#define MAX_VM_FSMS 29-#define MAX_VM_VARS 232+#define MAX_VM_VARS 256#define MAX_MOVERS 4#define NONE 0xFFFF#define OWNER 0xFF0Fdiff --git a/games/hollowknight/tests/check.py b/games/hollowknight/tests/check.pyindex aa1ad137..3cad1399 100644--- a/games/hollowknight/tests/check.py+++ b/games/hollowknight/tests/check.py@@ -13,6 +13,7 @@out of the view, and the view never jumping- a bench: sat on, the inventory opened, a charm equipped, then up again (atBench off)- the soul orb: dark with no soul, white with its liquid when full+- a version 2 save: loaded, its rooms' bits where they are now- the charms: OK changes none away from a bench; at one, equipped (its effect on), none past the notches, unequipped,overcharmed on the fifth try and off again, kept by Home in the inventory and a load- the stag stations: each seen (their blanker faded out), come in by its gate, by the stag (called by its bell) and@@ -109,6 +110,15 @@ def main():orb = shades[0] < 80 and shades[1] > 200results.append(report("the soul orb filled", rc, out if orb else out + "\nFAIL its middle: %.0f empty, %.0f full" % tuple(shades),("FAIL",)))+ # a version 2 save (Crossroads_47's bench; rooms 19 and 20 visited, 20 mapped, and the map's piece of Crossroads_21+ # at bit 38, as it was then): loaded, its rooms where they are now, the map's piece at the last bit+ with tempfile.TemporaryDirectory() as saves:+ with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "save_v2.sav"), "rb") as f, \+ open(os.path.join(saves, "hk1.sav"), "wb") as g:+ g.write(f.read())+ rc, out = play("--room", "Crossroads_47", "--play", "*20", env={"HKSAVES": saves, "HKLOAD": "0", "HKPD": "1"})+ rooms = next((l for l in out.splitlines() if l.startswith("rooms:")), "")+ results.append(report("a version 2 save", rc, out if rooms == "rooms: 19 20m 127m" else out + "\nFAIL " + rooms, ("FAIL",)))with ThreadPoolExecutor(JOBS) as pool:walks = list(pool.map(lambda w: play("--gates", "wander:all:%d:%d" % w, env={"HKFAST": "1"} if w[0] % 2 else None), WALKS))for (seed, ticks), (rc, out) in zip(WALKS, walks):diff --git a/games/hollowknight/tests/play.c b/games/hollowknight/tests/play.cindex 3b63f3ea..3e44f243 100644--- a/games/hollowknight/tests/play.c+++ b/games/hollowknight/tests/play.c@@ -1439,6 +1439,11 @@ int main(int argc, char **argv) {g_pd.trinkets[0], g_pd.trinkets[1], g_pd.trinkets[2], g_pd.trinkets[3], g_pd.charms_owned, np, g_pd.health,g_pd.health_blue, g_pd.mp, (int)g_pd.geo, g_pd.grubs_collected, g_pd.max_health, g_pd.heart_pieces,g_pd.vessel_fragments, g_pd.mp_reserve_max, g_pd.shaman, g_pd.fireball_level);+ /* (the rooms visited and mapped, by their bits) */+ printf("rooms:");+ for (int i = 0; i < MAX_ROOM_BITS; i++)+ if (g_pd.rooms_visited[i >> 3] >> (i & 7) & 1) printf(" %d%s", i, g_pd.rooms_mapped[i >> 3] >> (i & 7) & 1 ? "m" : "");+ printf("\n");}return 0;}diff --git a/games/hollowknight/tests/save_v2.sav b/games/hollowknight/tests/save_v2.savnew file mode 100644index 00000000..52ea2775Binary files /dev/null and b/games/hollowknight/tests/save_v2.sav differdiff --git a/games/hollowknight/tools/gamemap.py b/games/hollowknight/tools/gamemap.pyindex 5a5314ce..282c8d63 100644--- a/games/hollowknight/tools/gamemap.py+++ b/games/hollowknight/tools/gamemap.py@@ -34,7 +34,7 @@ COCOON = "hasPinCocoon" # (pin_blue_health: SetupMap's, by the rooms a cdef build(sprites, texts, res, rooms, pd_flags, room_zone):- """rooms: the rooms this part of the game has (their order); pd_flags: PlayerData bools -> flags; room_zone(room) ->+ """rooms: the rooms by their bits in the save (vm.room_bits); pd_flags: PlayerData bools -> flags; room_zone(room) ->its map zone (SceneManager's mapZone)"""d = unity.prefab(*GAME_MAP)by = {o["path"]: o for o in d["objects"]}diff --git a/games/hollowknight/tools/pack.py b/games/hollowknight/tools/pack.pyindex 7dfd4e50..66b7d69c 100644--- a/games/hollowknight/tools/pack.py+++ b/games/hollowknight/tools/pack.py@@ -6,8 +6,13 @@ HERE = os.path.dirname(os.path.abspath(__file__))sys.path.insert(0, HERE)import unity, scene, visible, art, actors, coll, ents, font, text, vm-SRC = os.path.join(HERE, "..", "src")-ALL_ROOMS = [l.strip() for l in open(os.path.join(HERE, "rooms.txt")) if l.strip() and not l.startswith("#")]+SRC = os.environ.get("HK_OUT") or os.path.join(HERE, "..", "src")+# HK_XL=1: the bigger game, the rooms past Greenpath too (rooms_xl.txt, after the others: theirs keep their numbers),+# into data_xl.bin and data_xl.h+XL = os.environ.get("HK_XL") == "1"+OUT = "data_xl" if XL else "data"+ALL_ROOMS = [l.strip() for f in ["rooms.txt"] + ([os.environ.get("HK_XL_ROOMS", "rooms_xl.txt")] if XL else [])+ for l in open(os.path.join(HERE, f)) if l.strip() and not l.startswith("#")]# (scenes loaded with others are part of those: two variants of the room, by a PlayerData bool)ROOMS = [r for r in ALL_ROOMS if r not in scene.additive_scenes(ALL_ROOMS)]VARIANT_ROOMS = [r for r in ROOMS if scene.additive(r)]@@ -513,7 +518,7 @@ def main():fleurs["TUTE_" + name] = "{%d, %.4ff, %.4ff}" % (s, kx, ky)# the focus tutorial King's Pass's first tablet shows (Focus_prompt_temp, the HUD's where it is): its picture, its# lines (Prompts: in the message's style) by their rects' tops, centred or ending at x, the key to hold (Cast's: its- # box's left); a line no nearer the one above than its height (the text bigger)+ # box's left); the lines where the game has them (the text bigger, they still clear each other and the picture)fdoc = unity.scene("Tutorial_01")fby = {o["path"]: o for o in fdoc["objects"]}froot = "_Props/Tut_tablet_top/Focus_prompt_temp"@@ -533,9 +538,6 @@ def main():top = q["pos"][1] + ((1 - tc["m_pivot"]["y"]) * h - mg["y"]) * kal = tm["m_textAlignment"] % 4assert al in (1, 2), n- if rows:- top = min(top, prev - text.STYLES["MSG"][2] / text.HUD_PX)- prev = toprows.append("{%d, %.4ff, %.4ff, %d}" % (TEXTS.id(gt["sheetName"], gt["convName"], "MSG"),(x0 + x1) / 2 if al == 1 else x1, top, al - 1))fleurs["FOCUS_PROMPT_TEXTS"] = "{%s}" % ", ".join(rows)@@ -569,7 +571,7 @@ def main():fleurs.update(collect.build())fleurs.update(stag.build(SPRITES, TEXTS, hud_res, actors.clip_id, ents.pd_flags(), vm.STR.id, ROOMS))import gamemap- fleurs.update(gamemap.build(SPRITES, TEXTS, hud_res, list(ROOMS) + list(vm.MAP_SCENES), ents.pd_flags(),+ fleurs.update(gamemap.build(SPRITES, TEXTS, hud_res, vm.room_bits(ROOMS), ents.pd_flags(),lambda r: scene.settings(unity.scene(vm.MAP_SCENES.get(r, r))).get("map_zone") or 0))fleurs["ROOM_ZONES"] = "{%s}" % ", ".join(str(scene.settings(unity.scene(r)).get("map_zone") or 0) for r in ROOMS)for i, item in enumerate(text.MSGS):@@ -781,10 +783,10 @@ def main():table += struct.pack("<II", pos + len(body), len(secs[k].b))body += secs[k].bdata = head + table + body- open(os.path.join(SRC, "data.bin"), "wb").write(data)+ open(os.path.join(SRC, OUT + ".bin"), "wb").write(data)sizes = {k: len(secs[k].b) for k in SECTIONS}- print("data.bin", len(data), sizes, "%.0fs" % (time.time() - t0))- with open(os.path.join(SRC, "data.h"), "w") as f:+ print(OUT + ".bin", len(data), sizes, "%.0fs" % (time.time() - t0))+ with open(os.path.join(SRC, OUT + ".h"), "w") as f:f.write("/* made by tools/pack.py */\n#pragma once\n")for i, k in enumerate(SECTIONS):f.write("#define SEC_%s %d\n" % (k, i))diff --git a/games/hollowknight/tools/vm.py b/games/hollowknight/tools/vm.pyindex ad794dd6..bf18acbd 100644--- a/games/hollowknight/tools/vm.py+++ b/games/hollowknight/tools/vm.py@@ -172,9 +172,18 @@ SKIP_PATHS = {("Crossroads_04", "_Transition Gates/Mender Door/Inspect"), ("Cros# tollbooth Crossroads_16 drops into; the game's Knight comes up to it first by rooms this port leaves out, so here the# tollbooth is the way on to Crossroads_21 and the False KnightPULLED = {("Crossroads_03", "_Props/Toll Gate Switch")}-MAX_OBJS, MAX_FSMS, MAX_VARS, MAX_ANIMS = 48, 29, 232, 20 # (src/vm.c)+MAX_OBJS, MAX_FSMS, MAX_VARS, MAX_ANIMS = 48, 29, 256, 20 # (src/vm.c)# map pieces of their own a script marks visited (AddToScenesVisited), as their room's (src/map.c: after the rooms)MAP_SCENES = {"Crossroads_21_b": "Crossroads_21"}+MAX_ROOM_BITS = 128 # (src/game.h)+++def room_bits(rooms):+ """Each room's bit in the save's lists (scenesVisited...), by its place in the list: the rooms, then the map's own+ pieces (MAP_SCENES) from the last bit down (None: no room)"""+ out = list(rooms) + [None] * (MAX_ROOM_BITS - len(rooms) - len(MAP_SCENES)) + list(MAP_SCENES)[::-1]+ assert len(out) == MAX_ROOM_BITS+ return out# the grubs in this part of the game (Crossroads_03, Fungus1_21): the Grubfather's rewards past them never comeGRUBS = 2# the ints ConvertIntToString turns into strings here (the Grubfather's rewards given)@@ -1330,7 +1339,7 @@ class Compiler:if beh == "GameManager" and m == "AddToScenesVisited":names = self.string_values(args[0]["s"] if isinstance(args[0], dict) else args[0])assert len(names) == 1 and names[0] in MAP_SCENES, names- return self.emit("SceneVisited", {"room": len(ROOM_NAMES) + list(MAP_SCENES).index(names[0])})+ return self.emit("SceneVisited", {"room": room_bits(ROOM_NAMES).index(names[0])})if beh == "GameMap" and m == "SetupMap":return None # (the map: drawn as PlayerData has it, src/map.c)if beh == "HeroPlatformStick" and m in ("Activate", "Deactivate"):@@ -1598,7 +1607,7 @@ def prepare(rooms, sprites, texts):global PIECE_SPRITESPIECE_SPRITES = sprites.idROOM_NAMES[:] = rooms- assert len(rooms) + len(MAP_SCENES) <= 40 # (src/game.h: rooms_visited's bits)+ assert len(rooms) + len(MAP_SCENES) <= MAX_ROOM_BITS # (src/game.h: rooms_visited's bits)for name, prefixes in ROOMS.items():if name not in rooms:continue