Nugget
Loading...
Searching...
No Matches
Functions | Variables
gte-depthcue.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 CESTER_TEST (dpcs_basic, gte_tests, gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(6, 0x00808080);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_DPCS(1, 0));int32_t mac1, mac2, mac3;uint32_t rgb2;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cop2_get(22, rgb2);ramsyscall_printf("DPCS: MAC=(%d,%d,%d) RGB2=0x%08x\n", mac1, mac2, mac3, rgb2);cester_assert_int_eq(3072, mac1);cester_assert_int_eq(3072, mac2);cester_assert_int_eq(3072, mac3);cester_assert_uint_eq(0x00c0c0c0, rgb2);) CESTER_TEST(dpcs_ir0_zero
 
 gte_set_far_color (0xff00, 0xff00, 0xff00)
 
 cop2_put (6, 0x00406080)
 
 cop2_put (8, 0)
 
 gte_clear_flag ()
 
 cop2_cmd (COP2_DPCS(1, 0))
 
 cop2_get (22, rgb2)
 
 cester_assert_uint_eq (0x80, r)
 
 cester_assert_uint_eq (0x60, g)
 
 cester_assert_uint_eq (0x40, b)
 
 CESTER_TEST (dpcs_ir0_max, gte_tests, gte_set_far_color(0x1000, 0x800, 0x400);cop2_put(6, 0x00000000);cop2_put(8, 0x1000);gte_clear_flag();cop2_cmd(COP2_DPCS(1, 0));int32_t mac1, mac2, mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);ramsyscall_printf("DPCS max: MAC=(%d,%d,%d)\n", mac1, mac2, mac3);cester_assert_int_eq(4096, mac1);cester_assert_int_eq(2048, mac2);cester_assert_int_eq(1024, mac3);) CESTER_TEST(dpcs_code_preserved
 
 gte_set_far_color (0, 0, 0)
 
 cop2_put (6, 0xab102030)
 
 cester_assert_uint_eq (0xab,(rgb2 > > 24) &0xff)
 
 CESTER_TEST (dpct_reads_fifo, gte_tests, gte_set_far_color(0, 0, 0);cop2_put(20, 0x00102030);cop2_put(21, 0x00405060);cop2_put(22, 0x00708090);cop2_put(6, 0xff000000);cop2_put(8, 0);gte_clear_flag();cop2_cmd(COP2_DPCT(1, 0));uint32_t rgb0, rgb1, rgb2;cop2_get(20, rgb0);cop2_get(21, rgb1);cop2_get(22, rgb2);ramsyscall_printf("DPCT: RGB0=0x%08x RGB1=0x%08x RGB2=0x%08x\n", rgb0, rgb1, rgb2);cester_assert_uint_eq(0xff102030, rgb0);cester_assert_uint_eq(0xff405060, rgb1);cester_assert_uint_eq(0xff708090, rgb2);) CESTER_TEST(dcpl_basic
 
 gte_set_far_color (0x1000, 0x1000, 0x1000)
 
 cop2_put (6, 0x00808080)
 
 cop2_put (9, 0x1000)
 
 cop2_put (10, 0x0800)
 
 cop2_put (11, 0x0400)
 
 cop2_cmd (COP2_DCPL(1, 0))
 
 cop2_get (25, mac1)
 
 cop2_get (26, mac2)
 
 cop2_get (27, mac3)
 
 ramsyscall_printf ("DCPL: MAC=(%d,%d,%d) RGB2=0x%08x\n", mac1, mac2, mac3, rgb2)
 
 cester_assert_int_eq (2048, mac1)
 
 cester_assert_int_eq (1024, mac2)
 
 cester_assert_int_eq (512, mac3)
 
 cester_assert_uint_eq (0x00204080, rgb2)
 
 CESTER_TEST (dcpl_with_depth, gte_tests, gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(6, 0x00808080);cop2_put(9, 0x1000);cop2_put(10, 0x1000);cop2_put(11, 0x1000);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_DCPL(1, 0));int32_t mac1, mac2, mac3;uint32_t flag;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);flag=gte_read_flag();ramsyscall_printf("DCPL depth: MAC=(%d,%d,%d) FLAG=0x%08x\n", mac1, mac2, mac3, flag);cester_assert_int_eq(3072, mac1);cester_assert_int_eq(3072, mac2);cester_assert_int_eq(3072, mac3);cester_assert_uint_eq(0x00000000, flag);) CESTER_TEST(intpl_basic
 
 gte_set_far_color (0x1000, 0x2000, 0x3000)
 
 cop2_put (9, 0x100)
 
 cop2_put (10, 0x200)
 
 cop2_put (11, 0x300)
 
 cop2_cmd (COP2_INTPL(1, 0))
 
 cester_assert_int_eq (0x100, mac1)
 
 cester_assert_int_eq (0x200, mac2)
 
 cester_assert_int_eq (0x300, mac3)
 
 CESTER_TEST (intpl_half, gte_tests, gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(9, 0);cop2_put(10, 0);cop2_put(11, 0);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_INTPL(1, 0));int32_t mac1, mac2, mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);ramsyscall_printf("INTPL half: MAC=(%d,%d,%d)\n", mac1, mac2, mac3);cester_assert_int_eq(2048, mac1);cester_assert_int_eq(2048, mac2);cester_assert_int_eq(2048, mac3);) CESTER_TEST(intpl_color_push
 
 cop2_put (9, 0x0ff0)
 
 cop2_put (11, 0x0010)
 
 cop2_put (6, 0xcc000000)
 
 cester_assert_uint_eq (255, r)
 
 cester_assert_uint_eq (128, g)
 
 cester_assert_uint_eq (1, b)
 
 cester_assert_uint_eq (0xcc, cd)
 

Variables

 gte_tests
 
uint32_t rgb2
 
uint8_t r = rgb2 & 0xff
 
uint8_t g = (rgb2 >> 8) & 0xff
 
uint8_t b = (rgb2 >> 16) & 0xff
 
int32_t mac1
 
int32_t mac2
 
int32_t mac3
 
uint8_t cd = (rgb2 >> 24) & 0xff
 

Function Documentation

◆ cester_assert_int_eq() [1/6]

cester_assert_int_eq ( 0x100  ,
mac1   
)

◆ cester_assert_int_eq() [2/6]

cester_assert_int_eq ( 0x200  ,
mac2   
)

◆ cester_assert_int_eq() [3/6]

cester_assert_int_eq ( 0x300  ,
mac3   
)

◆ cester_assert_int_eq() [4/6]

cester_assert_int_eq ( 1024  ,
mac2   
)

◆ cester_assert_int_eq() [5/6]

cester_assert_int_eq ( 2048  ,
mac1   
)

◆ cester_assert_int_eq() [6/6]

cester_assert_int_eq ( 512  ,
mac3   
)

◆ cester_assert_uint_eq() [1/9]

cester_assert_uint_eq ( 0x00204080  ,
rgb2   
)

◆ cester_assert_uint_eq() [2/9]

cester_assert_uint_eq ( 0x40  ,
b   
)

◆ cester_assert_uint_eq() [3/9]

cester_assert_uint_eq ( 0x60  ,
g   
)

◆ cester_assert_uint_eq() [4/9]

cester_assert_uint_eq ( 0x80  ,
r   
)

◆ cester_assert_uint_eq() [5/9]

cester_assert_uint_eq ( 0xab  ,
(rgb2 > > 24) &  0xff 
)

◆ cester_assert_uint_eq() [6/9]

cester_assert_uint_eq ( 0xcc  ,
cd   
)

◆ cester_assert_uint_eq() [7/9]

cester_assert_uint_eq ( ,
b   
)

◆ cester_assert_uint_eq() [8/9]

cester_assert_uint_eq ( 128  ,
g   
)

◆ cester_assert_uint_eq() [9/9]

cester_assert_uint_eq ( 255  ,
r   
)

◆ CESTER_TEST() [1/5]

CESTER_TEST ( dcpl_with_depth  ,
gte_tests  ,
gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(6, 0x00808080);cop2_put(9, 0x1000);cop2_put(10, 0x1000);cop2_put(11, 0x1000);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_DCPL(1, 0));int32_t  mac1,
mac2  ,
mac3;uint32_t flag;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);  flag = gte_read_flag(); ramsyscall_printf("DCPL depth: MAC=(%d,%d,%d) FLAG=0x%08x\n", mac1mac2mac3flag); cester_assert_int_eq(3072, mac1); cester_assert_int_eq(3072, mac2); cester_assert_int_eq(3072, mac3); cester_assert_uint_eq(0x00000000, flag); 
)

◆ CESTER_TEST() [2/5]

CESTER_TEST ( dpcs_basic  ,
gte_tests  ,
gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(6, 0x00808080);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_DPCS(1, 0));int32_t  mac1,
mac2  ,
mac3;uint32_t rgb2;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cop2_get(22, rgb2);ramsyscall_printf("DPCS: MAC=(%d,%d,%d) RGB2=0x%08x\n", mac1, mac2, mac3, rgb2);cester_assert_int_eq(3072, mac1);cester_assert_int_eq(3072, mac2);cester_assert_int_eq(3072, mac3);cester_assert_uint_eq(0x00c0c0c0, rgb2);   
)

◆ CESTER_TEST() [3/5]

CESTER_TEST ( dpcs_ir0_max  ,
gte_tests  ,
gte_set_far_color(0x1000, 0x800, 0x400);cop2_put(6, 0x00000000);cop2_put(8, 0x1000);gte_clear_flag();cop2_cmd(COP2_DPCS(1, 0));int32_t  mac1,
mac2  ,
mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);ramsyscall_printf("DPCS max: MAC=(%d,%d,%d)\n", mac1, mac2, mac3);cester_assert_int_eq(4096, mac1);cester_assert_int_eq(2048, mac2);cester_assert_int_eq(1024, mac3);   
)

◆ CESTER_TEST() [4/5]

CESTER_TEST ( dpct_reads_fifo  ,
gte_tests  ,
gte_set_far_color(0, 0, 0);cop2_put(20, 0x00102030);cop2_put(21, 0x00405060);cop2_put(22, 0x00708090);cop2_put(6, 0xff000000);cop2_put(8, 0);gte_clear_flag();cop2_cmd(COP2_DPCT(1, 0));uint32_t  rgb0,
rgb1  ,
rgb2;cop2_get(20, rgb0);cop2_get(21, rgb1);cop2_get(22, rgb2);ramsyscall_printf("DPCT: RGB0=0x%08x RGB1=0x%08x RGB2=0x%08x\n", rgb0, rgb1, rgb2);cester_assert_uint_eq(0xff102030, rgb0);cester_assert_uint_eq(0xff405060, rgb1);cester_assert_uint_eq(0xff708090, rgb2);   
)

◆ CESTER_TEST() [5/5]

CESTER_TEST ( intpl_half  ,
gte_tests  ,
gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(9, 0);cop2_put(10, 0);cop2_put(11, 0);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_INTPL(1, 0));int32_t  mac1,
mac2  ,
mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);ramsyscall_printf("INTPL half: MAC=(%d,%d,%d)\n", mac1, mac2, mac3);cester_assert_int_eq(2048, mac1);cester_assert_int_eq(2048, mac2);cester_assert_int_eq(2048, mac3);   
)

◆ cop2_cmd() [1/3]

cop2_cmd ( COP2_DCPL(1, 0)  )

◆ cop2_cmd() [2/3]

cop2_cmd ( COP2_DPCS(1, 0)  )

◆ cop2_cmd() [3/3]

cop2_cmd ( COP2_INTPL(1, 0)  )

◆ cop2_get() [1/4]

cop2_get ( 22  ,
rgb2   
)

◆ cop2_get() [2/4]

cop2_get ( 25  ,
mac1   
)

◆ cop2_get() [3/4]

cop2_get ( 26  ,
mac2   
)

◆ cop2_get() [4/4]

cop2_get ( 27  ,
mac3   
)

◆ cop2_put() [1/13]

cop2_put ( 10  ,
0x0800   
)

◆ cop2_put() [2/13]

cop2_put ( 10  ,
0x200   
)

◆ cop2_put() [3/13]

cop2_put ( 11  ,
0x0010   
)

◆ cop2_put() [4/13]

cop2_put ( 11  ,
0x0400   
)

◆ cop2_put() [5/13]

cop2_put ( 11  ,
0x300   
)

◆ cop2_put() [6/13]

cop2_put ( ,
0x00406080   
)

◆ cop2_put() [7/13]

cop2_put ( ,
0x00808080   
)

◆ cop2_put() [8/13]

cop2_put ( ,
0xab102030   
)

◆ cop2_put() [9/13]

cop2_put ( ,
0xcc000000   
)

◆ cop2_put() [10/13]

cop2_put ( ,
 
)

◆ cop2_put() [11/13]

cop2_put ( ,
0x0ff0   
)

◆ cop2_put() [12/13]

cop2_put ( ,
0x100   
)

◆ cop2_put() [13/13]

cop2_put ( ,
0x1000   
)

◆ gte_clear_flag()

gte_clear_flag ( )

◆ gte_set_far_color() [1/4]

gte_set_far_color ( ,
,
 
)

◆ gte_set_far_color() [2/4]

gte_set_far_color ( 0x1000  ,
0x1000  ,
0x1000   
)

◆ gte_set_far_color() [3/4]

gte_set_far_color ( 0x1000  ,
0x2000  ,
0x3000   
)

◆ gte_set_far_color() [4/4]

gte_set_far_color ( 0xff00  ,
0xff00  ,
0xff00   
)

◆ ramsyscall_printf()

ramsyscall_printf ( )

Variable Documentation

◆ b

char b = (rgb2 >> 16) & 0xff

◆ cd

uint8_t cd = (rgb2 >> 24) & 0xff

◆ g

uint8_t g = (rgb2 >> 8) & 0xff

◆ gte_tests

gte_tests

◆ mac1

int32_t mac1

◆ mac2

int32_t mac2

◆ mac3

int32_t mac3

◆ r

uint8_t r = rgb2 & 0xff

◆ rgb2

uint32_t rgb2