From 5ea3682f705b891f1e54c147038d80ac4dd23112 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Thu, 24 Jul 2014 11:21:54 -0500 Subject: [PATCH] Some small improvements --- apple2048.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apple2048.c b/apple2048.c index 4caa94f..f89efaf 100644 --- a/apple2048.c +++ b/apple2048.c @@ -52,9 +52,11 @@ void shortDelay(uint16_t howMuch) void playSound(int8_t freq, int16_t duration) { + if (!gPlaySounds) + return; + while (duration > 0) { - if (gPlaySounds) - asm ("STA %w", 0xc030); + asm ("STA %w", 0xc030); while (freq > 0) { freq--; } @@ -215,7 +217,7 @@ void performAnimationsLeft(void) animInProgress = true; printValueAt(x, y, tileAnim->tileString); } - playSound(200, 2); + playSound(200, 1); } firstFrame = false; } while (animInProgress); @@ -270,7 +272,7 @@ void performAnimationsRight(void) animInProgress = true; printValueAt(x, y, tileAnim->tileString); } - playSound(200, 2); + playSound(200, 1); } firstFrame = false; } while (animInProgress); @@ -321,7 +323,7 @@ void performAnimationsUp(void) animInProgress = true; printValueAt(x, y, tileAnim->tileString); } - playSound(200, 2); + playSound(200, 1); } firstFrame = false; } while (animInProgress); @@ -372,7 +374,7 @@ void performAnimationsDown(void) animInProgress = true; printValueAt(x, y, tileAnim->tileString); } - playSound(200, 2); + playSound(200, 1); } firstFrame = false; } while (animInProgress);