Nugget
Loading...
Searching...
No Matches
Functions | Variables
gte-gpf-gpl.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 (gpf_shifted_unity, gte_tests, cop2_put(8, 0x1000);cop2_put(9, 100);cop2_put(10, 200);cop2_put(11, 300);cop2_put(6, 0x00204060);gte_clear_flag();cop2_cmd(COP2_GPF(1, 0));int32_t mac1, mac2, mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cester_assert_int_eq(100, mac1);cester_assert_int_eq(200, mac2);cester_assert_int_eq(300, mac3);) CESTER_TEST(gpf_shifted_half
 
 cop2_put (8, 0x0800)
 
 cop2_put (9, 1000)
 
 cop2_put (10, 2000)
 
 cop2_put (11, 4000)
 
 cop2_put (6, 0x00808080)
 
 gte_clear_flag ()
 
 cop2_cmd (COP2_GPF(1, 0))
 
 cop2_get (25, mac1)
 
 cop2_get (26, mac2)
 
 cop2_get (27, mac3)
 
 cester_assert_int_eq (500, mac1)
 
 cester_assert_int_eq (1000, mac2)
 
 cester_assert_int_eq (2000, mac3)
 
 CESTER_TEST (gpf_color_fifo_push, gte_tests, cop2_put(8, 0x1000);cop2_put(9, 0x0800);cop2_put(10, 0x0400);cop2_put(11, 0x0200);cop2_put(6, 0xaa000000);gte_clear_flag();cop2_cmd(COP2_GPF(1, 0));uint32_t rgb2;cop2_get(22, rgb2);uint8_t r=rgb2 &0xff;uint8_t g=(rgb2 > > 8) &0xff;uint8_t b=(rgb2 > > 16) &0xff;uint8_t cd=(rgb2 > > 24) &0xff;ramsyscall_printf("GPF color: R=%u G=%u B=%u CD=0x%02x\n", r, g, b, cd);cester_assert_uint_eq(0xaa, cd);cester_assert_uint_eq(128, r);cester_assert_uint_eq(64, g);cester_assert_uint_eq(32, b);) CESTER_TEST(gpf_unshifted
 
 cop2_put (8, 2)
 
 cop2_put (9, 100)
 
 cop2_put (10, 200)
 
 cop2_put (11, 300)
 
 cop2_cmd (COP2_GPF(0, 0))
 
 cester_assert_int_eq (200, mac1)
 
 cester_assert_int_eq (400, mac2)
 
 cester_assert_int_eq (600, mac3)
 
 CESTER_TEST (gpl_shifted, gte_tests, cop2_put(25, 1000);cop2_put(26, 2000);cop2_put(27, 3000);cop2_put(8, 0x1000);cop2_put(9, 100);cop2_put(10, 200);cop2_put(11, 300);cop2_put(6, 0x00808080);gte_clear_flag();cop2_cmd(COP2_GPL(1, 0));int32_t mac1, mac2, mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cester_assert_int_eq(1100, mac1);cester_assert_int_eq(2200, mac2);cester_assert_int_eq(3300, mac3);) CESTER_TEST(gpl_unshifted
 
 cop2_put (25, 100)
 
 cop2_put (26, 200)
 
 cop2_put (27, 300)
 
 cop2_put (8, 3)
 
 cop2_put (9, 10)
 
 cop2_put (10, 20)
 
 cop2_put (11, 30)
 
 cop2_cmd (COP2_GPL(0, 0))
 
 cester_assert_int_eq (130, mac1)
 
 cester_assert_int_eq (260, mac2)
 
 cester_assert_int_eq (390, mac3)
 

Variables

 gte_tests
 
int32_t mac1
 
int32_t mac2
 
int32_t mac3
 

Function Documentation

◆ cester_assert_int_eq() [1/9]

cester_assert_int_eq ( 1000  ,
mac2   
)

◆ cester_assert_int_eq() [2/9]

cester_assert_int_eq ( 130  ,
mac1   
)

◆ cester_assert_int_eq() [3/9]

cester_assert_int_eq ( 200  ,
mac1   
)

◆ cester_assert_int_eq() [4/9]

cester_assert_int_eq ( 2000  ,
mac3   
)

◆ cester_assert_int_eq() [5/9]

cester_assert_int_eq ( 260  ,
mac2   
)

◆ cester_assert_int_eq() [6/9]

cester_assert_int_eq ( 390  ,
mac3   
)

◆ cester_assert_int_eq() [7/9]

cester_assert_int_eq ( 400  ,
mac2   
)

◆ cester_assert_int_eq() [8/9]

cester_assert_int_eq ( 500  ,
mac1   
)

◆ cester_assert_int_eq() [9/9]

cester_assert_int_eq ( 600  ,
mac3   
)

◆ CESTER_TEST() [1/3]

CESTER_TEST ( gpf_color_fifo_push  ,
gte_tests  ,
cop2_put(8, 0x1000);cop2_put(9, 0x0800);cop2_put(10, 0x0400);cop2_put(11, 0x0200);cop2_put(6, 0xaa000000);gte_clear_flag();cop2_cmd(COP2_GPF(1, 0));uint32_t rgb2;cop2_get(22, rgb2);uint8_t  r = rgb2 & 0xff; uint8_t g = (rgb2 >> 8) & 0xff; uint8_t b = (rgb2 >> 16) & 0xff; uint8_t cd = (rgb2 >> 24) & 0xff; ramsyscall_printf("GPF color: R=%u G=%u B=%u CD=0x%02x\n", rgbcd); cester_assert_uint_eq(0xaa, cd);   cester_assert_uint_eq(128, r); cester_assert_uint_eq(64, g); cester_assert_uint_eq(32, b); 
)

◆ CESTER_TEST() [2/3]

CESTER_TEST ( gpf_shifted_unity  ,
gte_tests  ,
cop2_put(8, 0x1000);cop2_put(9, 100);cop2_put(10, 200);cop2_put(11, 300);cop2_put(6, 0x00204060);gte_clear_flag();cop2_cmd(COP2_GPF(1, 0));int32_t  mac1,
mac2  ,
mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cester_assert_int_eq(100, mac1);cester_assert_int_eq(200, mac2);cester_assert_int_eq(300, mac3);   
)

◆ CESTER_TEST() [3/3]

CESTER_TEST ( gpl_shifted  ,
gte_tests  ,
cop2_put(25, 1000);cop2_put(26, 2000);cop2_put(27, 3000);cop2_put(8, 0x1000);cop2_put(9, 100);cop2_put(10, 200);cop2_put(11, 300);cop2_put(6, 0x00808080);gte_clear_flag();cop2_cmd(COP2_GPL(1, 0));int32_t  mac1,
mac2  ,
mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cester_assert_int_eq(1100, mac1);cester_assert_int_eq(2200, mac2);cester_assert_int_eq(3300, mac3);   
)

◆ cop2_cmd() [1/3]

cop2_cmd ( COP2_GPF(0, 0)  )

◆ cop2_cmd() [2/3]

cop2_cmd ( COP2_GPF(1, 0)  )

◆ cop2_cmd() [3/3]

cop2_cmd ( COP2_GPL(0, 0)  )

◆ cop2_get() [1/3]

cop2_get ( 25  ,
mac1   
)

◆ cop2_get() [2/3]

cop2_get ( 26  ,
mac2   
)

◆ cop2_get() [3/3]

cop2_get ( 27  ,
mac3   
)

◆ cop2_put() [1/16]

cop2_put ( 10  ,
20   
)

◆ cop2_put() [2/16]

cop2_put ( 10  ,
200   
)

◆ cop2_put() [3/16]

cop2_put ( 10  ,
2000   
)

◆ cop2_put() [4/16]

cop2_put ( 11  ,
30   
)

◆ cop2_put() [5/16]

cop2_put ( 11  ,
300   
)

◆ cop2_put() [6/16]

cop2_put ( 11  ,
4000   
)

◆ cop2_put() [7/16]

cop2_put ( 25  ,
100   
)

◆ cop2_put() [8/16]

cop2_put ( 26  ,
200   
)

◆ cop2_put() [9/16]

cop2_put ( 27  ,
300   
)

◆ cop2_put() [10/16]

cop2_put ( ,
0x00808080   
)

◆ cop2_put() [11/16]

cop2_put ( ,
0x0800   
)

◆ cop2_put() [12/16]

cop2_put ( ,
 
)

◆ cop2_put() [13/16]

cop2_put ( ,
 
)

◆ cop2_put() [14/16]

cop2_put ( ,
10   
)

◆ cop2_put() [15/16]

cop2_put ( ,
100   
)

◆ cop2_put() [16/16]

cop2_put ( ,
1000   
)

◆ gte_clear_flag()

gte_clear_flag ( )

Variable Documentation

◆ gte_tests

gte_tests

◆ mac1

int32_t mac1

◆ mac2

int32_t mac2

◆ mac3

int32_t mac3