From a7106d50091672ee4cf7d7f842d548db5ce872dc Mon Sep 17 00:00:00 2001 From: yellows8 Date: Mon, 19 Feb 2018 02:44:26 -0500 Subject: [PATCH] In playtone use kDown instead of calling hidKeysDown() multiple times. --- audio/playtone/source/main.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/audio/playtone/source/main.c b/audio/playtone/source/main.c index 1e980d7..04bf805 100644 --- a/audio/playtone/source/main.c +++ b/audio/playtone/source/main.c @@ -69,73 +69,73 @@ int main(int argc, char **argv) if (kDown & KEY_PLUS) break; // break in order to return to hbmenu - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_A) + if (kDown & KEY_A) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[0]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_B) + if (kDown & KEY_B) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[1]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_Y) + if (kDown & KEY_Y) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[2]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_X) + if (kDown & KEY_X) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[3]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_DLEFT) + if (kDown & KEY_DLEFT) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[4]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_DUP) + if (kDown & KEY_DUP) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[5]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_DRIGHT) + if (kDown & KEY_DRIGHT) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[6]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_DDOWN) + if (kDown & KEY_DDOWN) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[7]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_L) + if (kDown & KEY_L) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[8]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_R) + if (kDown & KEY_R) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[9]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_ZL) + if (kDown & KEY_ZL) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[10]); play_tone = true; } - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_ZR) + if (kDown & KEY_ZR) { fill_audio_buffer(raw_data, 0, SAMPLESPERBUF * 2, notefreq[11]); play_tone = true;