ScummVM API documentation
psx_pcdefines.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_PSX_PCDEFINES_H
28 #define ICB_PSX_PCDEFINES_H
29 
30 #include "common/types.h"
31 
32 namespace ICB {
33 // make our own equivalents
34 typedef struct MATRIX {
35  int16 m[3][3]; /* 3x3 rotation matrix */
36  int16 pad;
37  int32 t[3]; /* transfer vector */
38  MATRIX() { pad = 0; }
39 } MATRIX;
40 
41 typedef struct MATRIXPC {
42  int32 m[3][3]; /* 3x3 rotation matrix */
43  int32 pad;
44  int32 t[3]; /* transfer vector */
45  MATRIXPC() { pad = 0; }
46 } MATRIXPC;
47 
48 /* int32 word type 3D vector */
49 typedef struct VECTOR {
50  int32 vx, vy;
51  int32 vz, pad;
52  VECTOR() { pad = 0; }
53 } VECTOR;
54 
55 /* short word type 3D vector */
56 typedef struct SVECTOR {
57  int16 vx, vy;
58  int16 vz, pad;
59 } SVECTOR;
60 
61 /* short word type 3D vector - PC version */
62 typedef struct SVECTORPC {
63  int32 vx, vy;
64  int32 vz, pad;
65 } SVECTORPC;
66 
67 typedef struct CVECTOR {
68  /* color type vector */
69  uint8 r, g, b, cd;
70 } CVECTOR;
71 
72 typedef struct {/* 2D short vector */
73  short vx, vy;
74 } DVECTOR;
75 
76 typedef uint8 PACKET;
77 
78 //-=- Definitions -=-//
79 #ifndef ONE
80 #define ONE 4096
81 #endif
82 #define PSX_SCREEN_WIDTH 512
83 #define PSX_SCREEN_HEIGHT 240
84 
85 //-=- Macros -=-//
86 #define __nint__(x) (((x) > 0) ? int((x) + 0.5) : int((x)-0.5))
87 
88 #define getTPage(tp, abr, x, y) ((((tp)&0x3) << 7) | (((abr)&0x3) << 5) | (((y)&0x100) >> 4) | (((x)&0x3ff) >> 6) | (((y)&0x200) << 2))
89 
90 #define getClut(x, y) ((y << 6) | ((x >> 4) & 0x3f))
91 
92 } // End of namespace ICB
93 
94 #endif // __PSX_PcDefines_H__
Definition: px_capri_maths.h:53
Definition: actor.h:32
Definition: psx_pcdefines.h:41
Definition: psx_pcdefines.h:72
Definition: px_capri_maths.h:61
Definition: px_capri_maths.h:46
Definition: psx_pcdefines.h:62