forked from alekmaul/potator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshared.h
82 lines (59 loc) · 1.85 KB
/
shared.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
#ifndef SHARED_H
#define SHARED_H
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <SDL/SDL.h>
// potator dependencies
#include "../../common/supervision.h"
// defines and macros
#define MAX__PATH 1024
#define FILE_LIST_ROWS 19
#define SYSVID_WIDTH 160
#define SYSVID_HEIGHT 160
#define GF_GAMEINIT 1
#define GF_MAINUI 2
#define GF_GAMEQUIT 3
#define GF_GAMERUNNING 4
#ifndef O_BINARY
#define O_BINARY 0
#endif
#define true 1
#define false 0
typedef int bool;
#define PIX_TO_RGB(fmt, r, g, b) (((r>>fmt->Rloss)<<fmt->Rshift)| ((g>>fmt->Gloss)<<fmt->Gshift)|((b>>fmt->Bloss)<<fmt->Bshift))
extern uint16 mapRGB(uint8 r, uint8 g, uint8 b);
#define cartridge_IsLoaded() (strlen(gameName) != 0)
typedef struct {
unsigned int sndLevel;
unsigned int m_ScreenRatio; // 0 = original show, 1 = full screen
unsigned int OD_Joy[12]; // each key mapping
unsigned int m_DisplayFPS;
char current_dir_rom[MAX__PATH];
unsigned int m_Color;
} gamecfg;
extern char gameName[MAX__PATH];
extern unsigned int gameCRC;
//typedef unsigned char byte;
//typedef unsigned short word;
typedef unsigned int uint;
extern SDL_Surface* screen; // Main program screen
extern SDL_Surface* actualScreen; // Main program screen
extern SDL_Surface *layer,*layerback,*layerbackgrey;
extern SDL_Event event;
extern gamecfg GameConf;
extern unsigned int m_Flag;
extern char current_conf_app[MAX__PATH];
extern void system_loadcfg(char *cfg_name);
extern void system_savecfg(char *cfg_name);
extern unsigned long crc32 (unsigned int crc, const unsigned char *buf, unsigned int len);
extern void mainemuinit();
// menu
extern void screen_showtopmenu(void);
extern void print_string_video(int x, int y, const char *s);
extern void gethomedir(char *dir, char* name);
#endif