Nugget
Bare-metal libraries and examples for the original PlayStation
Loading...
Searching...
No Matches
tests
gpu-raster-phase9
raster-expected-phase9.h
Go to the documentation of this file.
1
/*
2
3
MIT License
4
5
Copyright (c) 2026 PCSX-Redux authors
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy
8
of this software and associated documentation files (the "Software"), to deal
9
in the Software without restriction, including without limitation the rights
10
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the Software is
12
furnished to do so, subject to the following conditions:
13
14
The above copyright notice and this permission notice shall be included in all
15
copies or substantial portions of the Software.
16
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
SOFTWARE.
24
25
*/
26
27
#pragma once
28
29
// Phase-9 expected hardware-truth values for 8-bit and 15-bit
30
// texture-window probes. 8-bit tests use expectedClut8Color() inline
31
// (the CLUT lookup is deterministic from u) so no constants needed
32
// for them. 15-bit values are precomputed below for cester's macro
33
// expansion at compile time.
34
//
35
// 15-bit texel(u, v) = vram555(u & 0x1f, v & 0x1f, (u + v) & 0x1f).
36
// At y=0 (so v=0), filtered_u is what matters: vram555(filtered_u,
37
// 0, filtered_u) = filtered_u | (filtered_u << 10).
38
39
#include "
raster-helpers.h
"
40
#include "
texture-fixtures.h
"
41
42
// mask_u = 0x01, offset_u = 0 -> bit 3 cleared
43
//
44
// HARDWARE FINDING (verified 2026-05-16): texel value 0x0000 in
45
// textured primitives is treated as TRANSPARENT on PS1 hardware - the
46
// rasterizer skips the pixel write entirely and the underlying VRAM
47
// shows through. So filtered_u=0 (which would produce vram555(0,0,0)
48
// = 0x0000) reads back as sentinel, not 0x0000. This is the PS1's
49
// "transparent black" texture quirk.
50
#define TW15_M01_O00_U0_Y0 RASTER_SENTINEL
/* filtered=0 -> texel 0x0000 = transparent */
51
#define TW15_M01_O00_U7_Y0 0x1c07u
/* filtered=7 -> vram555(7,0,7) */
52
#define TW15_M01_O00_U8_Y0 RASTER_SENTINEL
/* filtered=0 -> texel 0x0000 = transparent */
53
#define TW15_M01_O00_U15_Y0 0x1c07u
/* filtered=7 -> vram555(7,0,7) */
54
55
// mask_u = 0x01, offset_u = 0x01 -> bit 3 forced set
56
#define TW15_M01_O01_U0_Y0 0x2008u
/* filtered=8 -> vram555(8,0,8) */
57
#define TW15_M01_O01_U3_Y0 0x2c0bu
/* filtered=11 -> vram555(11,0,11) */
58
#define TW15_M01_O01_U8_Y0 0x2008u
/* filtered=8 -> vram555(8,0,8) */
59
60
// mask_u = 0x03, offset_u = 0 -> bits 3,4 cleared
61
#define TW15_M03_O00_U13_Y0 0x1405u
/* filtered=5 -> vram555(5,0,5) */
raster-helpers.h
texture-fixtures.h
Generated by
1.9.8