From 9f4e5ae1ac4a48cdda9ea5f9d7f1da2241fa68a0 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Thu, 31 Mar 2022 22:29:40 +0200 Subject: [PATCH] [Reverse-engineering] [th04] Discover the cause behind the Kurumi crash on Easy Major thanks to Colin Douglas Howell, who looked into the issue and provided instructions for reliably reproducing it: https://github.com/nmlgc/rec98.nmlgc.net/issues/2 Part of P0189, funded by Arandui and Lmocinemod. --- th04/main/bullet/types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/th04/main/bullet/types.h b/th04/main/bullet/types.h index 4c36e64e..e2d8d218 100644 --- a/th04/main/bullet/types.h +++ b/th04/main/bullet/types.h @@ -20,6 +20,9 @@ typedef enum { BG_RANDOM_CONSTRAINED_ANGLE_AIMED = 0x1D, // Ring out of [count] bullets, ignoring [delta]. + // ZUN bug: Must be ≥1 going into the bullets_add_*() functions to prevent + // divisions by zero ("Divide error"). This is exactly what causes the + // crash during Kurumi when playing on Easy and with minimum rank. BG_RING = 0x26, BG_RING_AIMED = 0x2C,