shithub: cstory

Download patch

ref: bc5a9b2d9f039eeb72655428864a05f40f723864
parent: a55361ec2c04af25ac24a8605c5702c6908c2013
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Sep 15 14:44:03 EDT 2019

These macros produced inaccurate assembly

--- a/src/CommonDefines.h
+++ b/src/CommonDefines.h
@@ -7,8 +7,8 @@
 #define PIXELS_TO_TILES(x) ((x) / 0x10)
 #define PIXELS_TO_UNITS(x) ((x) * 0x200)
 #define UNITS_TO_PIXELS(x) ((x) / 0x200)
-#define TILES_TO_UNITS(x) (PIXELS_TO_UNITS(TILES_TO_PIXELS(x)))	// * 0x2000
-#define UNITS_TO_TILES(x) (PIXELS_TO_TILES(UNITS_TO_PIXELS(x)))	// / 0x2000
+#define TILES_TO_UNITS(x) ((x) * (0x200 * 0x10))
+#define UNITS_TO_TILES(x) ((x) / (0x200 * 0x10))
 
 #define SECONDS_TO_FRAMES(x) ((x) * 50)
 #define FRAMES_TO_SECONDS(x) ((x) / 50)