-
Notifications
You must be signed in to change notification settings - Fork 1
/
setpoohw.c
51 lines (44 loc) · 1.1 KB
/
setpoohw.c
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include "famegraf.h"
typedef /*unsigned*/ char *block;
typedef void *screen;
extern int SetLib(char *);
extern int PutLib(char *, block, unsigned long);
extern int GetLib(char *, block);
#include <windows.h>
void fatalerror(char *t) {
MessageBox(0, t, "SetPoohWin32", MB_ICONERROR);
exit(1);
}
#pragma pack(push, 1)
struct {
short dev,mix,vol;
short j;
short f;
short cheat;
} setup;
#pragma pack(pop)
int AskAbout(char *t) {
return(
(MessageBox(0,
t ? t : "Done!",
"WinSetPooh32",
t ? (MB_YESNO | MB_ICONQUESTION) : (MB_OK | MB_ICONINFORMATION)
) == IDYES) ? 1 : 0
);
}
int main(int argc, char *argv[]) {
SetLib("graph");
memset(&setup, 0, sizeof(setup));
GetLib("pooh.cfg", (block) &setup);
setup.dev = AskAbout("Allow music?") ? 7 : (-1);
setup.vol = 255;
setup.j = AskAbout("Allow joystick / gamepad / controller?") ? 1 : 0;
setup.f = 3;
setup.cheat = ((argc == 2) && (stricmp(argv[1],"cheat")==0)) ? 1 : 0;
PutLib("pooh.cfg", (block) &setup, sizeof(setup));
AskAbout(NULL);
return(0);
}