@@ -61,6 +61,7 @@ _legato_post_sign:
61
61
ld LEGATO_DELAY(ix) , a
62
62
63
63
set BIT_FX_LEGATO , NOTE_FX(ix)
64
+ set BIT_FX_QUICK_LEGATO , NOTE_FX(ix)
64
65
65
66
pop bc
66
67
inc hl
@@ -88,9 +89,14 @@ _legato_update_pos:
88
89
;; to recompute the note and tune values without shift, so force it here
89
90
set BIT_LOAD_NOTE , PIPELINE(ix)
90
91
91
- ;; stop FX
92
+ ;; stop FX if that was a quick legato
93
+ ;; (otherwise a dedicated opcode must be used to disable legato)
92
94
ld LEGATO_TRANSPOSE(ix) , # 0
95
+ bit BIT_FX_QUICK_LEGATO , NOTE_FX(ix)
96
+ jr nz , _legato_update_end
93
97
res BIT_FX_LEGATO , NOTE_FX(ix)
98
+ _legato_update_end:
99
+ res BIT_FX_QUICK_LEGATO , NOTE_FX(ix)
94
100
95
101
ret
96
102
@@ -117,3 +123,23 @@ quick_legato_down::
117
123
;; a: direction
118
124
xor a
119
125
jp legato_init
126
+
127
+
128
+ ;;; LEGATO
129
+ ;;; Enable the legato mode for current channel
130
+ ;;; ------
131
+ ;;; ix : state for channel
132
+ ;;; hl modified
133
+ legato::
134
+ set BIT_FX_LEGATO , NOTE_FX(ix)
135
+ ret
136
+
137
+
138
+ ;;; LEGATO_OFF
139
+ ;;; Disable the legato mode for current channel
140
+ ;;; ------
141
+ ;;; ix : state for channel
142
+ ;;; hl modified
143
+ legato_off::
144
+ res BIT_FX_LEGATO , NOTE_FX(ix)
145
+ ret
0 commit comments