add clinkster player code

This commit is contained in:
PoroCYon 2019-05-11 02:00:36 +02:00
parent 86e6cfbd96
commit 863e07e575
8 changed files with 59 additions and 2 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
*.o *.o
*.pyc
__pycache__/

View File

@ -1,6 +1,6 @@
# Linux templates for PC intro synths # Linux templates for PC intro synths
Small template code to get 4klang, Oidos and V2 running on Linux :) Small template code to get 4klang, Clinkster, Oidos and V2 running on Linux :)
Quickly hacked together by PoroCYon. Quickly hacked together by PoroCYon.
@ -14,6 +14,7 @@ Planet](https://demozoo.org/productions/172416/).
* A C compiler, make, sed, awk * A C compiler, make, sed, awk
* nasm or yasm * nasm or yasm
* Python **2**, for the converters used in Clinkster and Oidos.
### Usage ### Usage
@ -24,6 +25,12 @@ Planet](https://demozoo.org/productions/172416/).
2. Run `make` 2. Run `make`
3. Run `bin/runner` 3. Run `bin/runner`
#### Clinkster
1. Put the `.xrns` files in the `mus` folder.
2. Run `make`
3. Run `bin/play-<songname> | aplay`
#### Oidos #### Oidos
1. Put the `.xrns` files in the `mus` folder. 1. Put the `.xrns` files in the `mus` folder.

2
clinkster/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
bin/
obj/

33
clinkster/Makefile Normal file
View File

@ -0,0 +1,33 @@
NASM ?= nasm
NASMFLAGS := -DLINUX -felf32 -I Clinkster/player/ -I obj/
default: all
%/:
mkdir -p "$@"
obj/play.o: src/play.c obj/
$(CC) -I Clinkster/player/ -m32 -c -o "$@" "$<"
obj/%.xrns.asm: mus/%.xrns obj/
Clinkster/converter/renoiseconvert.py "$<" "$@"
obj/%.xrns.o: obj/%.xrns.asm Clinkster/player/clinkster.asm obj/
cp "$<" obj/music.asm
$(NASM) $(NASMFLAGS) -o "$@" "Clinkster/player/clinkster.asm"
$(RM) obj/music.asm
bin/play-%: obj/play.o obj/%.xrns.o bin/
$(CC) -m32 -o "$@" $(filter-out bin/,$^)
INFILES := $(wildcard mus/*.xrns)
OUTFILES := $(patsubst mus/%.xrns,bin/play-%,$(INFILES))
all: $(OUTFILES)
clean:
$(RM) -vr bin/ obj/
.PHONY: deafult all clean

1
clinkster/mus/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.xrns

12
clinkster/src/play.c Normal file
View File

@ -0,0 +1,12 @@
#include <unistd.h>
#include "clinkster.h"
int main() {
Clinkster_GenerateMusic();
write(STDOUT_FILENO, Clinkster_WavFileHeader, sizeof(Clinkster_WavFileHeader));
write(STDOUT_FILENO, Clinkster_MusicBuffer, Clinkster_WavFileHeader[10]);
}

1
oidos/.gitignore vendored
View File

@ -1,3 +1,2 @@
bin/ bin/
obj/ obj/
mus/*.xrns

1
oidos/mus/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.xrns