1
0
mirror of https://github.com/ScrelliCopter/VGM-Tools synced 2025-02-21 04:09:25 +11:00

adpcm decoders compiling on loonix

This commit is contained in:
2019-09-26 22:06:51 +10:00
parent c1a5003a82
commit 7e0740d03a
4 changed files with 25 additions and 56 deletions

4
neotools/.gitignore vendored
View File

@@ -4,3 +4,7 @@
*.log *.log
*.pcm *.pcm
*.wav *.wav
*.o
adpcm
adpcmb

View File

@@ -1,70 +1,34 @@
# Standard makefile to use as a base for DJGPP projects # Standard makefile to use as a base for DJGPP projects (not anymore lol)
# By MARTINEZ Fabrice aka SNK of SUPREMACY # By MARTINEZ Fabrice aka SNK of SUPREMACY
# Programs to use during make # Programs to use during make
AR = ar LD := $(CC)
CC = gcc
LD = gcc
ASM = nasm
PACKER = upx
# Flags for debugging TARGET := adpcm
#DEBUG=1 SOURCE := adpcm.c
#SYMBOLS=1
# Flags for compilation # Flags for compilation
ASMFLAGS = -f coff CFLAGS := -fomit-frame-pointer -O3 -Werror -Wall \
ifdef SYMBOLS
CFLAGS = -o -mpentium -Wall -Werror -g
LDFLAGS = -s
else
CFLAGS = -fomit-frame-pointer -O3 -mpentium -Werror -Wall \
-W -Wno-sign-compare -Wno-unused \ -W -Wno-sign-compare -Wno-unused \
-Wpointer-arith -Wbad-function-cast -Wcast-align -Waggregate-return \ -Wpointer-arith -Wbad-function-cast -Wcast-align -Waggregate-return \
-pedantic \ -pedantic \
-Wshadow \ -Wshadow \
-Wstrict-prototypes -Wstrict-prototypes
LDFLAGS = LDFLAGS := -lm
endif
CDEFS =
ASMDEFS =
# Object files # Object files
MAINOBJS = OBJECT := $(SOURCE:%.c=%.o)
# Library files
MAINLIBS = obj/adpcm.a
# Make rules # Make rules
all: adpcm.exe all: $(TARGET)
adpcm.exe: $(MAINOBJS) $(MAINLIBS) $(TARGET): $(OBJECT)
$(LD) $(LDFLAGS) $(MAINOBJS) $(MAINLIBS) -o $@ $(LD) $(CFLAGS) $(LDFLAGS) $^ -o $@
src/%.asm: %.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
obj/%.o: src/%.c
$(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
obj/%.oa: src/%.asm
$(ASM) -o $@ $(ASMFLAGS) $(ASMDEFS) $<
obj/%.a:
$(AR) cr $@ $^
# Rules to manage files # Rules to manage files
pack: adpcm.exe .PHONY: clean
$(PACKER) adpcm.exe
mkdir:
md obj
clean: clean:
del obj\*.o rm -f $(TARGET) $(OBJECT)
del obj\*.a
del obj\*.oa
del *.exe
# Rules to make libraries
obj/adpcm.a: obj/adpcm.o
# obj/decode.oa \

View File

@@ -1,8 +1,6 @@
#include <process.h>
#include <stdio.h> #include <stdio.h>
#include <mem.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <io.h>
#define BUFFER_SIZE 1024*256 #define BUFFER_SIZE 1024*256
#define ADPCMA_VOLUME_RATE 1 #define ADPCMA_VOLUME_RATE 1
@@ -70,8 +68,11 @@ int main(int argc, char *argv[])
} }
adpcm_init(); adpcm_init();
Filelen = filelength(fileno(Fp1)); fseek(Fp1, 0, SEEK_END);
Filelen = ftell(Fp1);
fseek(Fp1, 0, SEEK_SET);
*((unsigned int*)(&RiffWave[4])) = Filelen*4 + 0x2C; *((unsigned int*)(&RiffWave[4])) = Filelen*4 + 0x2C;
*((unsigned int*)(&RiffWave[0x28])) = Filelen*4; *((unsigned int*)(&RiffWave[0x28])) = Filelen*4;

View File

@@ -4,7 +4,7 @@ CFLAGS = -O3
SRC = . SRC = .
OBJ = . OBJ = .
OUT_OBJ = $(OBJ)/adpcmb.exe OUT_OBJ = $(OBJ)/adpcmb
all: $(OUT_OBJ) all: $(OUT_OBJ)