forked from czajowaty/virtual_monsbaia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PsxVRamConst.hpp
36 lines (32 loc) · 1.48 KB
/
PsxVRamConst.hpp
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
#ifndef PSXVRAMCONST_HPP
#define PSXVRAMCONST_HPP
#include "BitsHelper.hpp"
struct PsxVRamConst
{
static constexpr uint8_t const PIXEL_DEPTH = 1;
static constexpr uint8_t const PIXEL_SIZE = 1 << PIXEL_DEPTH;
static constexpr uint8_t const WIDTH_DEPTH = 0xb;
static constexpr uint16_t const WIDTH = 1 << WIDTH_DEPTH;
static constexpr uint16_t const PIXELS_PER_LINE = WIDTH / PIXEL_SIZE;
static constexpr uint8_t const HEIGHT_DEPTH = 0x9;
static constexpr uint16_t const HEIGHT = 1 << HEIGHT_DEPTH;
static constexpr uint32_t const SIZE = WIDTH * HEIGHT;
static constexpr uint8_t const TEXTURE_PAGE_X_SHIFT = 6;
static constexpr uint8_t const TEXTURE_PAGE_Y_SHIFT = 8;
static constexpr uint16_t const TEXTURE_PAGE_SIZE = 256;
static constexpr uint16_t const TEXTURE_16BPP_PAGE_WIDTH =
TEXTURE_PAGE_SIZE;
static constexpr uint16_t const TEXTURE_8BPP_PAGE_WIDTH =
TEXTURE_PAGE_SIZE >> 1;
static constexpr uint16_t const TEXTURE_4BPP_PAGE_WIDTH =
TEXTURE_PAGE_SIZE >> 2;
static constexpr uint16_t const TEXTURE_PAGE_HEIGHT =
TEXTURE_PAGE_SIZE;
static constexpr uint8_t const CLUT_X_SHIFT = 4;
static constexpr uint8_t const CLUT_Y_SHIFT = 0;
static constexpr uint16_t const CLUT_8_BPP_WIDTH = valuesInBits(8);
static constexpr uint16_t const CLUT_4_BPP_WIDTH = valuesInBits(4);
static constexpr uint16_t const CLUT_HEIGHT = 1;
PsxVRamConst() = delete;
};
#endif // PSXVRAMCONST_HPP