Pro Tracker 3.51 player fix
ZXNet echo conference «zxnet.soft»
From Ivan Roshin → To All 11 April 2001
Hello, All!
How to fix Pro Tracker 3.51 player so that commands 9 and A,
that change the frequency of the envelope were processed correctly.
The source text of the player contains the following fragment:
;--- install_E ---
E_ins0 JR Ei_form
Esl_ids LD HL,0 ;stp_sld_env
LD (Esl_sds+1),HL
Esl_ist LD A,0 ;stp_sld_p
LD (Esl_stp+1),A <──────────────────────────── (1)
LD (Esl_sts+1),A
LD A,#18
LD(E_ins0),A
Ei_form LD A,0 ;env_form
LD(E_form+1),A
AND A
JR Z,temp
Ei_frq LD HL,0 ;env_frq
LD (E_frq+1),HL
XOR A
LD L,A
LD H,A
LD(Ei_form+1),A
LD (Esl_stp+1),A <──────────────────────────── (2)
LD (Esl_frq+1),HL
What do we see? (1) - to a variable at Esl_stp+1
one of the command parameters 9 or A is placed. Next, if this
the command was on a note using the envelope (i.e. Ei_form+1
not 0), then a program fragment containing (2) is executed -
Resetting the Esl_stp+1 variable to zero. The command parameter is reset to zero -
and as a result there will be no change in frequency of the envelope.
How to fix it? The recipe I gave in the description
previous version of BestView (byte reset at offset #4C1 fromstart of the player), actually canceled the command (2). At the same time
commands 9 and A started to work, but did not finish changing
frequency when the next note using
envelope. So some modules still sounded
wrong.
For a final fix, a fragment of the player needs to be
change it like this:
;--- install_E ---
E_ins0 JR Ei_form
Esl_ids LD HL,0 ;stp_sld_env
LD (Esl_sds+1),HL
Esl_ist LD A,0 ;stp_sld_p
LD (Esl_stp+1),A
LD (Esl_sts+1),A
LD A,(Ei_form+1)
AND A
JR Z,BUG_F3
LD A,#3E
LD(BUG_F2),A
BUG_F3 LD A,#18
LD(E_ins0),A
Ei_form LD A,0 ;env_form
LD(E_form+1),A
AND A
JR Z,temp
Ei_frq LD HL,0 ;env_frq
LD (E_frq+1),HL
XOR A
LD L,A
LD H,A
LD (Esl_frq+1),HL
LD(Ei_form+1),A
BUG_F2 JR BUG_F1
LD A,#18
LD(BUG_F2),A
JR temp
BUG_F1 LD (Esl_stp+1),A
Please note that the length of the player is slightly
will increase.
Best regards, Ivan Roshchin.