Commit ddf6afc6 authored by PoroCYon's avatar PoroCYon
Browse files

add v2 stuff

parent 01cbb65d
NASM ?= nasm
default: all
%/:
mkdir -p "$@"
obj/lplayer.o: src/lplayer.cpp obj/
$(CXX) -g -m32 -o "$@" -c "$<" -I libv2
obj/v2mplayer.o: libv2/v2mplayer.cpp obj/
$(CXX) -g -m32 -o "$@" -c "$<" -I libv2
obj/synth.o: libv2/synth.asm obj/
$(NASM) -g -f elf32 -o "$@" "$<"
obj/v2m-%.asm: mus/%.v2m obj/
printf "global theTune\ntheTune:\nincbin \"%s\"\n" "$<" > "$@"
obj/v2m-%.o: obj/v2m-%.asm
$(NASM) -g -f elf32 -o "$@" "$<"
bin/lplayer-%: obj/lplayer.o obj/synth.o obj/v2mplayer.o obj/v2m-%.o bin/
$(CXX) -g -m32 -o "$@" $(filter-out bin/,$^)
all: $(patsubst mus/%.v2m,bin/lplayer-%,$(wildcard mus/*.v2m))
echo $^
clean:
$(RM) -vr obj/ bin/
.PHONY: all clean default
Subproject commit 8c8f82c2ae01133370e649bbc05916e7aceecadd Subproject commit c59154914a3e5b7eba0d3328c9bcb370ce1715ad
../fr_public/v2/libv2.h
\ No newline at end of file
../fr_public/v2/synth.asm
\ No newline at end of file
../fr_public/v2/synth.h
\ No newline at end of file
../fr_public/v2/v2mplayer.cpp
\ No newline at end of file
../fr_public/v2/v2mplayer.h
\ No newline at end of file
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include "v2mplayer.h"
#include "synth.h"
/*#include "libv2.h"*/
extern "C" const uint8_t theTune[];
#define BUFFERLEN (8192) /* arbitrary */
static V2MPlayer player;
static sF32 output_buffer[BUFFERLEN*8];
int main() {
player.Init();
player.Open(theTune);
player.Play();
while (player.IsPlaying()) {
player.Render(output_buffer, 64, sFALSE);
write(STDOUT_FILENO, output_buffer, 64*8);
//dprintf(STDERR_FILENO,"tick");
}
player.Close();
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment