From fdf2a45baf493a3a5e3548f09f3290276aaa665b Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 9 Feb 2020 21:34:35 +0100 Subject: [PATCH] [Maintenance] Use *_CELS to denote the number of distinct animation sprites Which are typically lower than the amount of *_FRAMES they're shown in. Part of P0074, funded by Myles. --- CONTRIBUTING.md | 3 +++ th05/gaiji/gaiji.inc | 2 +- th05_maine.asm | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4ec7857..a210b4b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -196,6 +196,9 @@ binary, as compared using [mzdiff].** The only allowed exceptions are: * ASM file extensions: `.asm` if they emit code, `.inc` if they don't * Macros defining the number of instances of an entity: `_COUNT` +* Macros defining the number of distinct sprites in an animation: `*_CELS` +* Frame variables counting from a frame count to 0: `*_time` +* Frame variables and other counters starting from 0: `*_frames` * Functionally identical reimplementations or micro-optimizations of master.lib functions: `z_` diff --git a/th05/gaiji/gaiji.inc b/th05/gaiji/gaiji.inc index 020f8cef..e27a0c56 100644 --- a/th05/gaiji/gaiji.inc +++ b/th05/gaiji/gaiji.inc @@ -11,5 +11,5 @@ ga_RETURN_KEY_0 = ga_RETURN_KEY + 0 ga_RETURN_KEY_1 = ga_RETURN_KEY + 1 ga_RETURN_KEY_2 = ga_RETURN_KEY + 2 ga_RETURN_KEY_3 = ga_RETURN_KEY + 3 -ga_RETURN_KEY_FRAMES = 4 +ga_RETURN_KEY_CELS = 4 ; ---------- diff --git a/th05_maine.asm b/th05_maine.asm index e31387dd..723c83ef 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -776,7 +776,7 @@ loc_A962: push point_15004.y mov ax, di shr ax, 3 - and ax, ga_RETURN_KEY_FRAMES - 1 + and ax, ga_RETURN_KEY_CELS - 1 add ax, ga_RETURN_KEY push ax push 15