From ddde6c01e1b1ff539fa20c867404fa89a25fcd2e Mon Sep 17 00:00:00 2001 From: LTVA1 <87536432+LTVA1@users.noreply.github.com> Date: Tue, 2 Aug 2022 21:31:58 +0300 Subject: [PATCH] fix issues with instrument program commands highlight --- src/command.c | 2 +- src/view.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.c b/src/command.c index a2471d51..fd76b250 100644 --- a/src/command.c +++ b/src/command.c @@ -83,7 +83,7 @@ static const InstructionDesc instruction_desc[] = {MUS_FX_SET_RINGSRC, 0xff00, "Set ring modulation source (FF=off)", "SetRingSrc", 0, 0xff}, {MUS_FX_SET_SYNCSRC, 0xff00, "Set sync source (FF=off)", "SetSyncSrc", 0, 0xff}, {MUS_FX_SET_DOWNSAMPLE, 0xff00, "Set downsample", "SetDnSmp", 0, 0xff}, - {MUS_FX_SET_SPEED, 0xff00, "Set speed", "Speed", -1, -1}, + {MUS_FX_SET_SPEED, 0xff00, "Set speed (program period in instrument program)", "ProgPeriod", -1, -1}, {MUS_FX_SET_SPEED1, 0xff00, "Set speed 1 (00-FF)", "Speed1Full", -1, -1}, //wasn't there {MUS_FX_SET_SPEED2, 0xff00, "Set speed 2 (00-FF)", "Speed2Full", -1, -1}, //wasn't there {MUS_FX_SET_RATE, 0xff00, "Set rate lower byte", "RateLowByte", -1, -1}, diff --git a/src/view.c b/src/view.c index 38822ba9..b3441fb8 100644 --- a/src/view.c +++ b/src/view.c @@ -1229,7 +1229,7 @@ static void write_command(const SDL_Event *event, const char *text, int cmd_idx, { Uint16 command = (char_to_hex(text[0]) << 12) + (char_to_hex(text[1]) << 8) + (char_to_hex(text[2]) << 4) + char_to_hex(text[3]); - if((~(get_instruction_mask(command))) & (0xf << ((3 - i) * 4)) && command != 0 && is_valid_command(command) && (command & 0xff00) != MUS_FX_LABEL && (command & 0xff00) != MUS_FX_RELEASE_POINT && command != MUS_FX_END) + if(((~(get_instruction_mask(command))) & (0xf << ((3 - i) * 4))) && is_valid_command(command) && text[0] != '.' && (command & 0xff00) != MUS_FX_LABEL && (command & 0xff00) != MUS_FX_RELEASE_POINT && command != MUS_FX_END) { Uint32 color = init_color; Uint32 highlight_color = ((color & 0xff) * 1 / 2) + (((((color >> 8) & 0xff) * 1 / 2) & 0xff) << 8) + 0xff0000;//my_min(0xff0000, (((((color >> 16) & 0xff) * 7 / 4) & 0xff) << 16));