-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathi_system.h
127 lines (100 loc) · 3.65 KB
/
i_system.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//
// Copyright (C) 1993-1996 Id Software, Inc.
// Copyright (C) 1993-2008 Raven Software
// Copyright (C) 2016-2017 Alexey Khokholov (Nuke.YKT)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// DESCRIPTION:
// System specific interface stuff.
//
#ifndef __I_SYSTEM__
#define __I_SYSTEM__
#include "d_ticcmd.h"
#include "d_event.h"
#include "sounds.h"
// Called by DoomMain.
void I_Init(void);
// Called by startup code
// to get the ammount of memory to malloc
// for the zone management.
byte *I_ZoneBase(int *size);
//
// Called by D_DoomLoop,
// called before processing each tic in a frame.
// Quick syncronous operations are performed here.
// Can call D_PostEvent.
void I_StartTic(void);
// Asynchronous interrupt functions should maintain private queues
// that are read by the synchronous functions
// to be converted into events.
// Called by M_Responder when quit is selected.
// Clean exit, displays sell blurb.
void I_Quit(void);
// Allocates from low memory under dos,
// just mallocs under unix
byte *I_AllocLow(int length);
void I_Error(char *error, ...);
//
// MUSIC I/O
//
int I_RegisterSong(void *data);
// called by anything that wants to register a song lump with the sound lib
// calls Paul's function of the similar name to register music only.
// note that the song data is the same for any sound card and is paul's
// MUS format. Returns a handle which will be passed to all other music
// functions.
void I_LoopSong(int handle);
// called by anything that wishes to start music.
// plays a song, and when the song is done, starts playing it again in
// an endless loop. the start is faded in over three seconds.
void I_StopSong(int handle);
// called by anything that wishes to stop music.
// stops a song abruptly.
void I_SetMusicVolume(int volume);
void I_ResumeSong(int handle);
void I_PlaySong(int handle, boolean looping);
void I_PauseSong(int handle);
void I_ResumeSong(int handle);
// SFX I/O
//
int I_GetSfxLumpNum(sfxinfo_t *sfx);
// called by routines which wish to play a sound effect at some later
// time. Pass it the lump name of a sound effect WITHOUT the sfx
// prefix. This means the maximum name length is 7 letters/digits.
// The prefixes for different sound cards are 'S','M','A', and 'P'.
// They refer to the card type. The routine will cache in the
// appropriate sound effect when it is played.
int I_StartSound(int id, void *data, int vol, int sep, int priority);
// Starts a sound in a particular sound channel
void I_UpdateSoundParams(int handle, int vol, int sep);
// Updates the volume, separation, and pitch of a sound channel
void I_StopSound(int handle);
// Stops a sound channel
int I_SoundIsPlaying(int handle);
// called by S_*()'s to see if a channel is still playing. Returns 0
// if no longer playing, 1 if playing.
void I_SetChannels(int channels);
// Called by D_DoomMain,
// determines the hardware configuration
// and sets up the video mode
void I_InitGraphics(void);
void I_ShutdownGraphics(void);
// Takes full 8 bit values.
void I_SetPalette(byte *palette);
void I_UpdateNoBlit(void);
void I_FinishUpdate(void);
// Wait for vertical retrace or pause a bit.
void I_WaitVBL(int count);
void I_ReadScreen(byte *scr);
// Called by D_DoomMain.
void I_InitNetwork(void);
#endif