forked from libretro/libretro-atari800
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibretro-core.h
87 lines (70 loc) · 1.89 KB
/
libretro-core.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
#ifndef LIBRETRO_CORE_H
#define LIBRETRO_CORE_H 1
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#define TEX_WIDTH 400
#define TEX_HEIGHT 300
#define UINT16 uint16_t
#define UINT32 uint32_t
#define RENDER16B
#ifdef RENDER16B
extern uint16_t Retro_Screen[400*300];
#define PIXEL_BYTES 1
#define PIXEL_TYPE UINT16
#define PITCH 2
#else
extern unsigned int Retro_Screen[400*300];
#define PIXEL_BYTES 2
#define PIXEL_TYPE UINT32
#define PITCH 4
#endif
#define WINDOW_WIDTH 400
#define WINDOW_HEIGHT 300
#include "libco.h"
extern cothread_t mainThread;
extern cothread_t emuThread;
extern char Key_State[512];
extern int pauseg;
#define NPLGN 12
#define NLIGN 6
#define NLETT 5
#define XSIDE (CROP_WIDTH/NPLGN -1)
#define YSIDE (CROP_HEIGHT/8 -1)
#define YBASE0 (CROP_HEIGHT - NLIGN*YSIDE -8)
#define XBASE0 0+4+2
#define XBASE3 0
#define YBASE3 YBASE0 -4
#define STAT_DECX 120
#define STAT_YSZ 20
#ifndef RENDER16B
#define RGB565(r, g, b) (((r) << (5+16)) | ((g) << (5+8)) | (b<<5))
#define R_RGB565(rgb) (((rgb) >> (5+16)) & 255)
#define G_RGB565(rgb) (((rgb) >> (5+8)) & 255)
#define B_RGB565(rgb) ((rgb>>5) & 255)
#else
#if defined(ABGR1555)
#define RGB565(r, g, b) (((b) << (10)) | ((g) << 5) | (r))
#define B_RGB565(rgb) (((rgb) >> (10)) & 31)
#define G_RGB565(rgb) (((rgb) >> 5) & 31)
#define R_RGB565(rgb) (rgb & 31)
#else
#define RGB565(r, g, b) (((r) << (5+6)) | ((g) << 6) | (b))
#define R_RGB565(rgb) (((rgb) >> (5+6)) & 31)
#define G_RGB565(rgb) (((rgb) >> 6) & 31)
#define B_RGB565(rgb) (rgb & 31)
#endif
#endif
#define uint32 unsigned int
#define uint8 unsigned char
//Paddle & 5200 POT
#define LIBRETRO_ANALOG_RANGE 0x8000
#define JOY_5200_MIN 6
#define JOY_5200_MAX 220
#define JOY_5200_CENTER 114
void retro_message(const char* text, unsigned int frames, int alt);
void retro_audio_cb(int16_t l, int16_t r);
#endif