1 |
cebix |
1.1 |
/* |
2 |
cebix |
1.2 |
* main.h - SIDPlayer common routines |
3 |
cebix |
1.1 |
* |
4 |
cebix |
1.4 |
* SIDPlayer (C) Copyright 1996-2001 Christian Bauer |
5 |
cebix |
1.1 |
* |
6 |
|
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
|
|
*/ |
20 |
|
|
|
21 |
|
|
#ifndef MAIN_H |
22 |
|
|
#define MAIN_H |
23 |
|
|
|
24 |
|
|
#include "types.h" |
25 |
|
|
|
26 |
|
|
|
27 |
|
|
/* |
28 |
|
|
* Definitions |
29 |
|
|
*/ |
30 |
|
|
|
31 |
|
|
// C64 replay routine address (set by LoadPSIDFile(), used by sid.cpp) |
32 |
|
|
extern uint16 play_adr; |
33 |
|
|
|
34 |
cebix |
1.2 |
// Module name, author name, copyright info in ISO Latin1 (BeOS: UTF8) charset (set by LoadPSIDFile()) |
35 |
cebix |
1.1 |
extern char module_name[64], author_name[64], copyright_info[64]; |
36 |
cebix |
1.2 |
|
37 |
|
|
// Total number of songs in module and currently played song number (0..n) |
38 |
|
|
extern int number_of_songs, current_song; |
39 |
cebix |
1.1 |
|
40 |
|
|
|
41 |
|
|
/* |
42 |
|
|
* Functions |
43 |
|
|
*/ |
44 |
|
|
|
45 |
|
|
// Init everything |
46 |
cebix |
1.3 |
extern void InitAll(int argc, char **argv); |
47 |
cebix |
1.1 |
|
48 |
|
|
// Exit everything |
49 |
|
|
extern void ExitAll(void); |
50 |
|
|
|
51 |
|
|
// Read PSID file header to buffer |
52 |
|
|
extern bool LoadPSIDHeader(const char *file, uint8 *p); |
53 |
|
|
|
54 |
|
|
// Check for PSID header |
55 |
|
|
extern bool IsPSIDHeader(const uint8 *p); |
56 |
|
|
|
57 |
|
|
// Check whether file is a PSID file |
58 |
|
|
extern bool IsPSIDFile(const char *file); |
59 |
|
|
|
60 |
|
|
// Load PSID file for playing |
61 |
|
|
extern bool LoadPSIDFile(const char *file); |
62 |
cebix |
1.4 |
|
63 |
|
|
// PSID file loaded and ready? |
64 |
|
|
extern bool IsPSIDLoaded(void); |
65 |
cebix |
1.1 |
|
66 |
|
|
// Select song for playing |
67 |
|
|
extern void SelectSong(int num); |
68 |
|
|
|
69 |
|
|
// Adjust replay speed |
70 |
|
|
extern void AdjustSpeed(int percent); |
71 |
|
|
|
72 |
|
|
// Show About window |
73 |
|
|
extern void AboutWindow(void); |
74 |
|
|
|
75 |
|
|
// Fast pseudo-random number generator |
76 |
|
|
extern uint32 f_rand_seed; |
77 |
|
|
|
78 |
|
|
inline static uint8 f_rand(void) |
79 |
|
|
{ |
80 |
|
|
f_rand_seed = f_rand_seed * 1103515245 + 12345; |
81 |
|
|
return f_rand_seed >> 16; |
82 |
|
|
} |
83 |
|
|
|
84 |
|
|
#endif |