From a2624e85d55a228d6ac2138c890aee4cee5a683c Mon Sep 17 00:00:00 2001 From: grinvader <> Date: Tue, 1 Mar 2005 18:02:51 +0000 Subject: [PATCH] Sets % to execute like the ASM used to. --- zsnes/src/initc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/zsnes/src/initc.c b/zsnes/src/initc.c index 939e0aaf..ff262421 100755 --- a/zsnes/src/initc.c +++ b/zsnes/src/initc.c @@ -1627,12 +1627,14 @@ extern unsigned char per2exec; void Setper2exec() { - opexec268 = (unsigned char)(opexec268*(per2exec*0.01)); - opexec358 = (unsigned char)(opexec358*(per2exec*0.01)); - opexec268b = (unsigned char)(opexec268b*(per2exec*0.01)); - opexec358b = (unsigned char)(opexec358b*(per2exec*0.01)); - opexec268cph = (unsigned char)(opexec268cph*(per2exec*0.01)); - opexec358cph = (unsigned char)(opexec358cph*(per2exec*0.01)); + if (per2exec != 100) + { // Decrease standard % of execution by 5% to replace branch and 16bit + // cycle deductions + opexec268b = (unsigned char)((opexec268 * 95 * per2exec) / 10000); + opexec358b = (unsigned char)((opexec358 * 87 * per2exec) / 10000); // 82 + opexec268cphb = (unsigned char)((opexec268cph * 95 * per2exec) / 10000); + opexec358cphb = (unsigned char)((opexec358cph * 87 * per2exec) / 10000); // 82 + } } extern char FEOEZPath[1024];