1
0
Fork 0
mirror of https://github.com/vbatts/bitorchestra.git synced 2024-11-27 02:55:41 +00:00

fixing the compile and the floating point error

This commit is contained in:
Vincent Batts 2012-11-19 18:22:29 -05:00
parent 8de884e177
commit 4ccc79ed1e
3 changed files with 14 additions and 10 deletions

View file

@ -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

View file

View file

@ -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));
}