GUI: fix MML string input for negative numbers

fixes #124
This commit is contained in:
tildearrow 2022-02-04 15:51:25 -05:00
parent 088b3eece3
commit 7a941e5b68

View file

@ -344,8 +344,8 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
case ' ': case ' ':
if (hasVal) { if (hasVal) {
hasVal=false; hasVal=false;
negaBuf=false;
macro[macroLen]=negaBuf?-buf:buf; macro[macroLen]=negaBuf?-buf:buf;
negaBuf=false;
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin; if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax; if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
macroLen++; macroLen++;
@ -362,8 +362,8 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
} }
if (hasVal && macroLen<128) { if (hasVal && macroLen<128) {
hasVal=false; hasVal=false;
negaBuf=false;
macro[macroLen]=negaBuf?-buf:buf; macro[macroLen]=negaBuf?-buf:buf;
negaBuf=false;
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin; if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax; if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
macroLen++; macroLen++;