From 15c1126d11cd629155a12a375b41a91040130d37 Mon Sep 17 00:00:00 2001 From: qm210 Date: Tue, 22 Oct 2024 00:08:23 +0200 Subject: [PATCH] fix: center value 64 for the exp_ parameters --- vm/compiler/templates/amd64-386/sources.asm | 5 +++-- write_envelexp_wav.ps1 | 0 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 write_envelexp_wav.ps1 diff --git a/vm/compiler/templates/amd64-386/sources.asm b/vm/compiler/templates/amd64-386/sources.asm index da02543..51686c5 100644 --- a/vm/compiler/templates/amd64-386/sources.asm +++ b/vm/compiler/templates/amd64-386/sources.asm @@ -149,8 +149,9 @@ su_op_envelopexp_applyexp: ; qm210: NOW THE ACTUAL EXPONENTIAL SCALING ; - scale the exponent in [0; 1] to [0.125; 8], call that kappa = 2^(6*(expo-0.5)) fld dword [r10] ; stack: [ expo, x' ] - fld qword [{{.Use (.Float 0.5)}}] ; stack: [ 0.5, expo, x' ] - fsubp st1, st0 ; stack: [ expo-0.5, x' ] + {{.Prepare (.Float 0.5)}} + fld dword [{{.Use (.Float 0.5)}}] ; stack: [ 0.5, expo, x' ] + fsubp st1, st0 ; stack: [ expo-0.5, x' ] {{.Prepare (.Int 6)}} fimul dword [{{.Use (.Int 6)}}] ; stack: [ 6*(expo-0.5), x' ] {{.Call "su_power"}} ; stack: [ kappa, x' ] diff --git a/write_envelexp_wav.ps1 b/write_envelexp_wav.ps1 new file mode 100644 index 0000000..e69de29