-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnlg.h
80 lines (57 loc) · 1.41 KB
/
nlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*********
NLG.h by BouKiCHi 2013-2014
this file is no warranty,but free to use.
********/
#ifndef __NLG_H__
#define __NLG_H__
#include <stdio.h>
#ifdef _WIN32
#define PATH_SEP '\\'
#else
#define PATH_SEP '/'
#endif
typedef struct {
FILE *file;
char title[80];
int baseclk;
int tick;
int length;
int loop_ptr;
int version;
int ctc0;
int ctc3;
int irq_count;
int tick_count;
int mode;
} NLGCTX;
NLGCTX *OpenNLG(const char *file);
void CloseNLG(NLGCTX *ctx);
int ReadNLG(NLGCTX *ctx);
long TellNLG(NLGCTX *ctx);
void SeekNLG(NLGCTX *ctx, long pos);
#ifndef NLG_READONLY
void WriteHeaderNLG(NLGCTX *ctx);
NLGCTX *CreateNLG(const char *file);
void WriteNLG_IRQ(NLGCTX *ctx);
void WriteNLG_CMD(NLGCTX *ctx, int cmd);
void WriteNLG_CTC(NLGCTX *ctx, int cmd,int ctc);
void WriteNLG_Data(NLGCTX *ctx,int cmd,int addr,int data);
void SetTitleNLG(NLGCTX *ctx, const char *title);
void SetBaseClkNLG(NLGCTX *ctx, int clock);
#endif
char *GetTitleNLG(NLGCTX *ctx);
int GetTickNLG(NLGCTX *ctx);
int GetLengthNLG(NLGCTX *ctx);
int GetLoopPtrNLG(NLGCTX *ctx);
int GetBaseClkNLG(NLGCTX *ctx);
void SetCTC0_NLG(NLGCTX *ctx, int value);
void SetCTC3_NLG(NLGCTX *ctx, int value);
#define NLG_READ 0x00
#define NLG_WRITE 0x01
#define CMD_PSG 0x00
#define CMD_OPM 0x01
#define CMD_OPM2 0x02
#define CMD_IRQ 0x80
#define CMD_CTC0 0x81
#define CMD_CTC3 0x82
#endif