Ascii-graff.
[pineappletracker.git] / stuff.h
blob505677aef35bff0046d81441260ff463a0cf6efb
1 /* vi:set ts=4 sts=4 sw=4: */
2 #ifndef STUFF_H
3 #define STUFF_H
4 #define TRACKLEN 32
6 typedef unsigned char u8;
7 typedef unsigned short u16;
8 typedef char s8;
9 typedef short s16;
10 typedef unsigned long u32;
12 u8 callbacktime;
14 enum {
15 WF_TRI,
16 WF_SAW,
17 WF_PUL,
18 WF_NOI
22 struct trackline {
23 u8 note;
24 u8 instr;
25 u8 cmd[2];
26 u8 param[2];
29 struct track {
30 struct trackline line[TRACKLEN];
33 struct instrline {
34 u8 cmd;
35 u8 param;
38 struct instrument {
39 int length;
40 struct instrline line[256];
43 struct songline {
44 u8 track[4];
45 u8 transp[4];
48 volatile struct oscillator {
49 u16 freq;
50 u16 phase;
51 u16 duty;
52 u8 waveform;
53 u8 volume; // 0-255
54 } osc[4];
56 void initchip();
57 u8 interrupthandler();
59 void readsong(int pos, int ch, u8 *dest);
60 void readtrack(int num, int pos, struct trackline *tl);
61 void readinstr(int num, int pos, u8 *il);
63 void silence();
64 void iedplonk(int, int);
66 void initgui();
67 void guiloop();
69 //void initjoystick();
70 //void sdlmainloop();
71 void display();
73 void startplaysong(int);
74 void startplaytrack(int);
75 void loadfile(char *);
77 extern u8 trackpos;
78 extern u8 playtrack;
79 extern u8 playsong;
80 extern u8 songpos;
81 extern int songlen;
83 extern struct instrument instrument[256], iclip;
84 extern struct track track[256], tclip;
85 extern struct songline song[256];
87 #endif /* STUFF_H */