From 4ccc79ed1e04b7e1e63c557e6e4c0f1f0864f487 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 19 Nov 2012 18:22:29 -0500 Subject: [PATCH] fixing the compile and the floating point error --- Makefile | 7 ++++--- all.c => main.c | 0 sounds.c | 17 ++++++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) rename all.c => main.c (100%) diff --git a/Makefile b/Makefile index 4e628cc..0fffd83 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -MUSIC_FILES := $(basename $(wildcard f*.c)) +MUSIC_FILES := $(basename $(wildcard f*.c)) main TMP_FILES := $(wildcard *~) $(wildcard *.o) -CFLAGS += -LDFLAGS += -static -s +CFLAGS += +LDFLAGS += -g +CC = gcc all: $(MUSIC_FILES) audio.o: audio.c audio.h diff --git a/all.c b/main.c similarity index 100% rename from all.c rename to main.c diff --git a/sounds.c b/sounds.c index 974afaa..aea0962 100644 --- a/sounds.c +++ b/sounds.c @@ -23,9 +23,9 @@ int sound_3(int t) { int sound_4(int t) { int i = 0; - while (i == 0) { - i = (t>>7-(t>>15)&-t>>7-(t>>15)); - t++; + i = (t>>7-(t>>15)&-t>>7-(t>>15)); + if (i==0) { + i=1; } return (t>>4|t&(t>>5)/i); } @@ -37,10 +37,13 @@ int sound_5(int t) { int sound_6(int t) { int y = 0, x = 0; - while (y == 0 && x == 0) { - x=t*"6689"[t>>16&3]/24&127; - y=t&16383; - t++; + x=t*"6689"[t>>16&3]/24&127; + y=t&16383; + if (y==0) { + y=1; + } + if (x==0) { + y=1; } return ((30000000000/(y)&1)*35+(x)*y/400000000+((t>>8^t>>10|1>>14|x)&63)); }