From 763c4f513604036abbdaa9b272a0337c068ff471 Mon Sep 17 00:00:00 2001 From: vsariola <5684185+vsariola@users.noreply.github.com> Date: Wed, 24 Mar 2021 23:49:14 +0200 Subject: [PATCH] fix(templates): unison sample oscillators crashed on amd64 --- templates/amd64-386/sources.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/amd64-386/sources.asm b/templates/amd64-386/sources.asm index 0d77b1c..b43af9a 100644 --- a/templates/amd64-386/sources.asm +++ b/templates/amd64-386/sources.asm @@ -315,7 +315,7 @@ su_oscillat_gate_bit: ; stack: 0/1, let's call it x {{- if .HasCall "su_oscillat_sample"}} {{.Func "su_oscillat_sample"}} - {{- .PushRegs .AX "SampleAx" .DX "SampleDx" .CX "SampleCx" .BX "SampleBx" | indent 4}} ; edx must be saved, eax & ecx if this is stereo osc + {{- .PushRegs .AX "SampleAx" .DX "SampleDx" .CX "SampleCx" .BX "SampleBx" .DI "SampleDi" | indent 4}} ; edx must be saved, eax & ecx if this is stereo osc push {{.AX}} mov al, byte [{{.VAL}}-4] ; reuse "color" as the sample number {{- if .Library}} @@ -342,7 +342,7 @@ su_oscillat_sample_not_looping: fild word [{{.Use "su_sample_table"}} + {{.DX}}*2] {{- .Float 32767.0 | .Prepare | indent 4}} fdiv dword [{{.Float 32767.0 | .Use}}] - {{- .PopRegs .AX .DX .CX .BX | indent 4}} + {{- .PopRegs .AX .DX .CX .BX .DI | indent 4}} ret {{end}}