annotate playercode/drv_raw.c @ 9:990c9dadb348

Initial revision
author darius
date Fri, 23 Jan 1998 16:05:10 +0000
parents b30908f9d9f9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
1 /*
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
2
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
3 Name:
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
4 DRV_RAW.C
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
5
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
6 Description:
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
7 Mikmod driver for output to a file called MUSIC.RAW
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
8
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
9 MS-DOS Programmers:
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
10 !! DO NOT CALL MD_UPDATE FROM A INTERRUPT IF YOU USE THIS DRIVER !!
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
11
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
12 Portability:
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
13
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
14 MSDOS: BC(y) Watcom(y) DJGPP(y)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
15 Win95: BC(y)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
16 Linux: y
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
17
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
18 (y) - yes
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
19 (n) - no (not possible or not useful)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
20 (?) - may be possible, but not tested
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
21
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
22 */
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
23
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
24 #include "mikmod.h"
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
25
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
26 #ifdef __GNUC__
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
27 #include <sys/types.h>
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
28 #else
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
29 #include <io.h>
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
30 #endif
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
31 #include <sys/stat.h>
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
32 #include <fcntl.h>
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
33
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
34 #define RAWBUFFERSIZE 8192
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
35
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
36 static int rawout;
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
37
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
38 static SBYTE RAW_DMABUF[RAWBUFFERSIZE];
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
39
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
40
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
41 static BOOL RAW_IsThere(void)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
42 {
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
43 return 1;
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
44 }
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
45
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
46
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
47 static BOOL RAW_Init(void)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
48 {
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
49 if(-1 == (rawout = open("music.raw",
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
50 #ifndef __GNUC__
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
51 O_BINARY |
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
52 #endif
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
53 O_RDWR | O_TRUNC | O_CREAT, S_IREAD | S_IWRITE)))
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
54 return 1;
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
55
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
56 md_mode |= DMODE_SOFT_MUSIC | DMODE_SOFT_SNDFX;
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
57
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
58 if(VC_Init()) return 1;
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
59
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
60 return 0;
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
61 }
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
62
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
63
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
64 static void RAW_Exit(void)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
65 {
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
66 VC_Exit();
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
67 close(rawout);
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
68 }
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
69
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
70
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
71 static void RAW_Update(void)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
72 {
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
73 VC_WriteBytes(RAW_DMABUF, RAWBUFFERSIZE);
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
74 write(rawout, RAW_DMABUF, RAWBUFFERSIZE);
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
75 }
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
76
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
77
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
78 static BOOL RAW_Reset(void)
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
79 {
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
80 return 0;
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
81 }
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
82
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
83
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
84 MDRIVER drv_raw =
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
85 { NULL,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
86 "music.raw file",
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
87 "RAW [music.raw] file output driver v1.0",
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
88 0,255,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
89 RAW_IsThere,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
90 VC_SampleLoad,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
91 VC_SampleUnload,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
92 VC_SampleSpace,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
93 VC_SampleLength,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
94 RAW_Init,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
95 RAW_Exit,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
96 RAW_Reset,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
97 VC_SetNumVoices,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
98 VC_PlayStart,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
99 VC_PlayStop,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
100 RAW_Update,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
101 VC_VoiceSetVolume,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
102 VC_VoiceSetFrequency,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
103 VC_VoiceSetPanning,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
104 VC_VoicePlay,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
105 VC_VoiceStop,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
106 VC_VoiceStopped,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
107 VC_VoiceReleaseSustain,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
108 VC_VoiceGetPosition,
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
109 VC_VoiceRealVolume
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
110 };
b30908f9d9f9 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
111