diff --git a/SDL/font.c b/SDL/font.c index e3db34e..6cc09a2 100644 --- a/SDL/font.c +++ b/SDL/font.c @@ -1129,6 +1129,26 @@ uint8_t font[] = { X, _, X, X, _, X, X, _, _, _, _, X, _, X, X, X, X, _, + + /* Alt symbol */ + + _, _, X, X, _, _, + _, X, _, _, X, _, + _, X, _, _, X, _, + _, X, _, _, X, _, + _, X, X, X, X, _, + _, X, _, _, X, _, + _, X, _, _, X, _, + _, _, _, _, _, _, + + X, _, _, X, X, X, + X, _, _, _, X, _, + X, _, _, _, X, _, + X, _, _, _, X, _, + X, _, _, _, X, _, + X, _, _, _, X, _, + X, X, X, _, X, _, + _, _, _, _, _, _, }; const uint8_t font_max = sizeof(font) / GLYPH_HEIGHT / GLYPH_WIDTH + ' '; diff --git a/SDL/font.h b/SDL/font.h index a6d331e..ce6044f 100644 --- a/SDL/font.h +++ b/SDL/font.h @@ -11,6 +11,7 @@ extern const uint8_t font_max; #define SELECTION_STRING RIGHT_ARROW_STRING #define CTRL_STRING "\x80\x81\x82" #define SHIFT_STRING "\x83" +#define ALT_STRING "\x91\x92" #define CMD_STRING "\x84\x85" #define ELLIPSIS_STRING "\x87" #define MOJIBAKE_STRING "\x88" diff --git a/SDL/gui.c b/SDL/gui.c index b637bd6..0ca5d6d 100644 --- a/SDL/gui.c +++ b/SDL/gui.c @@ -76,8 +76,6 @@ void render_texture(void *pixels, void *previous) } static const char *help[] = { -"Drop a ROM to play.\n" -"\n" "Keyboard Shortcuts:\n" " Open Menu: Escape\n" " Open ROM: " MODIFIER_NAME "+O\n" @@ -91,6 +89,7 @@ static const char *help[] = { #else " Mute/Unmute: " MODIFIER_NAME "+M\n" #endif +" Toggle channel: " ALT_STRING "+(1-4)\n" " Break Debugger: " CTRL_STRING "+C", "\n" "SameBoy\n" diff --git a/SDL/main.c b/SDL/main.c index c3f9594..48d26c8 100644 --- a/SDL/main.c +++ b/SDL/main.c @@ -441,6 +441,16 @@ static void handle_events(GB_gameboy_t *gb) pending_command = GB_SDL_SAVE_STATE_COMMAND; } } + else if ((event.key.keysym.mod & KMOD_ALT) && event.key.keysym.scancode <= SDL_SCANCODE_4) { + GB_channel_t channel = event.key.keysym.scancode - SDL_SCANCODE_1; + bool state = !GB_is_channel_muted(gb, channel); + + GB_set_channel_muted(gb, channel, state); + + static char message[18]; + sprintf(message, "Channel %d %smuted", channel + 1, state? "" : "un"); + show_osd_text(message); + } } break; }