Nugget
Loading...
Searching...
No Matches
Functions | Variables
gte-rtps.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 (rtps_identity_center, gte_tests, gte_set_identity_rotation();gte_set_translation(0, 0, 1000);gte_set_screen(160<< 16, 120<< 16, 200);cop2_put(0, 0x00000000);cop2_put(1, 0);gte_clear_flag();cop2_cmd(COP2_RTPS(1, 0));uint32_t sz3, sxy2;cop2_get(19, sz3);cop2_get(14, sxy2);cester_assert_uint_eq(1000, sz3);cester_assert_int_eq(160,(int16_t)(sxy2 &0xffff));cester_assert_int_eq(120,(int16_t)(sxy2 > > 16));) CESTER_TEST(rtps_offset_vertex
 
 gte_set_identity_rotation ()
 
 gte_set_translation (0, 0, 0)
 
 gte_set_screen (160<< 16, 120<< 16, 200)
 
 cop2_put (0,(50<< 16)|(100 &0xffff))
 
 cop2_put (1, 500)
 
 gte_clear_flag ()
 
 cop2_cmd (COP2_RTPS(1, 0))
 
 cop2_get (19, sz3)
 
 cester_assert_uint_eq (500, sz3)
 
 cop2_get (14, sxy2)
 
 ramsyscall_printf ("RTPS offset: SX=%d SY=%d\n", sx, sy)
 
 cester_assert_int_eq (199, sx)
 
 cester_assert_int_eq (139, sy)
 
 CESTER_TEST (rtps_mac_output, gte_tests, gte_set_identity_rotation();gte_set_translation(100, 200, 300);gte_set_screen(0, 0, 200);cop2_put(0,(50<< 16)|10);cop2_put(1, 500);gte_clear_flag();cop2_cmd(COP2_RTPS(1, 0));int32_t mac1, mac2, mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cester_assert_int_eq(110, mac1);cester_assert_int_eq(250, mac2);cester_assert_int_eq(800, mac3);) CESTER_TEST(rtps_division_overflow
 
 gte_set_screen (0, 0, 200)
 
 cop2_put (0,(0<< 16)|100)
 
 cop2_put (1, 1)
 
 cester_assert_uint_eq (1, flag17)
 
 CESTER_TEST (rtps_screen_saturation, gte_tests, gte_set_identity_rotation();gte_set_translation(0, 0, 0);gte_set_screen(0, 0, 200);cop2_put(0,(0<< 16)|0x7fff);cop2_put(1, 100);gte_clear_flag();cop2_cmd(COP2_RTPS(1, 0));uint32_t sxy2, flag;cop2_get(14, sxy2);flag=gte_read_flag();int16_t sx=(int16_t)(sxy2 &0xffff);ramsyscall_printf("RTPS sat: SX=%d FLAG=0x%08x (bit14=%u)\n", sx, flag,(flag > > 14) &1);cester_assert_int_eq(0x3ff, sx);uint32_t flag14=(flag > > 14) &1;cester_assert_uint_eq(1, flag14);) CESTER_TEST(rtps_depth_cue
 
 cop2_putc (24, 0)
 
 cop2_putc (25, 0)
 
 cop2_putc (26, 200)
 
 cop2_putc (27, 0xfffff880)
 
 cop2_putc (28, 0x01000000)
 
 cop2_put (0, 0x00000000)
 
 cop2_put (1, 1000)
 
 cop2_get (24, mac0)
 
 cop2_get (8, ir0)
 
 cester_assert_int_eq (-8388224, mac0)
 
 cester_assert_uint_eq (0, ir0)
 
 CESTER_TEST (rtps_sf0, gte_tests, gte_set_identity_rotation();gte_set_translation(0, 0, 0x1000);gte_set_screen(0, 0, 200);cop2_put(0, 0x00000000);cop2_put(1, 0);gte_clear_flag();cop2_cmd(COP2_RTPS(0, 0));int32_t mac3;uint32_t ir3, sz3, flag;cop2_get(27, mac3);cop2_get(11, ir3);cop2_get(19, sz3);flag=gte_read_flag();ramsyscall_printf("RTPS sf=0: MAC3=%d IR3=0x%04x SZ3=%u FLAG=0x%08x\n", mac3, ir3 &0xffff, sz3, flag);cester_assert_int_eq(16777216, mac3);cester_assert_uint_eq(0x7fff, ir3);cester_assert_uint_eq(4096, sz3);cester_assert_uint_eq(0, flag);) CESTER_TEST(rtpt_three_vertices
 
 cop2_put (2,(0<< 16)|100)
 
 cop2_put (3, 1000)
 
 cop2_put (4,(100<< 16)|0)
 
 cop2_put (5, 1000)
 
 cop2_cmd (COP2_RTPT(1, 0))
 
 cop2_get (12, sxy0)
 
 cop2_get (13, sxy1)
 
 cester_assert_int_eq (160,(int16_t)(sxy0 &0xffff))
 
 cester_assert_int_eq (120,(int16_t)(sxy0 > > 16))
 
 cester_assert_int_eq (120, sy1)
 
 CESTER_TEST (rtpt_flag_accumulates, gte_tests, gte_set_identity_rotation();gte_set_translation(0, 0, 0);gte_set_screen(0, 0, 200);cop2_put(0, 0x00000000);cop2_put(1, 1000);cop2_put(2,(0<< 16)|0x7fff);cop2_put(3, 100);cop2_put(4, 0x00000000);cop2_put(5, 1000);gte_clear_flag();cop2_cmd(COP2_RTPT(1, 0));uint32_t flag;flag=gte_read_flag();ramsyscall_printf("RTPT flag accum: FLAG=0x%08x\n", flag);uint32_t flag17=(flag > > 17) &1;cester_assert_uint_eq(1, flag17);) CESTER_TEST(rtpt_sz_fifo
 
 cop2_put (1, 100)
 
 cop2_put (2, 0x00000000)
 
 cop2_put (3, 200)
 
 cop2_put (4, 0x00000000)
 
 cop2_put (5, 300)
 
 cop2_get (17, sz1)
 
 cop2_get (18, sz2)
 
 cester_assert_uint_eq (100, sz1)
 
 cester_assert_uint_eq (200, sz2)
 
 cester_assert_uint_eq (300, sz3)
 

Variables

 gte_tests
 
uint32_t sz3
 
uint32_t sxy2
 
int16_t sx = (int16_t)(sxy2 & 0xffff)
 
int16_t sy = (int16_t)(sxy2 >> 16)
 
uint32_t flag = gte_read_flag()
 
uint32_t flag17 = (flag >> 17) & 1
 
int32_t mac0
 
uint32_t ir0
 
uint32_t sxy0
 
uint32_t sxy1
 
int16_t sx1 = (int16_t)(sxy1 & 0xffff)
 
int16_t sy1 = (int16_t)(sxy1 >> 16)
 
uint32_t sz1
 
uint32_t sz2
 

Function Documentation

◆ cester_assert_int_eq() [1/6]

cester_assert_int_eq ( 8388224,
mac0   
)

◆ cester_assert_int_eq() [2/6]

cester_assert_int_eq ( 120  ,
sy1   
)

◆ cester_assert_int_eq() [3/6]

cester_assert_int_eq ( 120  ,
(int16_t)(sxy0 > > 16)   
)

◆ cester_assert_int_eq() [4/6]

cester_assert_int_eq ( 139  ,
sy   
)

◆ cester_assert_int_eq() [5/6]

cester_assert_int_eq ( 160  ,
(int16_t)(sxy0 &0xffff)   
)

◆ cester_assert_int_eq() [6/6]

cester_assert_int_eq ( 199  ,
sx   
)

◆ cester_assert_uint_eq() [1/6]

cester_assert_uint_eq ( ,
ir0   
)

◆ cester_assert_uint_eq() [2/6]

cester_assert_uint_eq ( ,
flag17   
)

◆ cester_assert_uint_eq() [3/6]

cester_assert_uint_eq ( 100  ,
sz1   
)

◆ cester_assert_uint_eq() [4/6]

cester_assert_uint_eq ( 200  ,
sz2   
)

◆ cester_assert_uint_eq() [5/6]

cester_assert_uint_eq ( 300  ,
sz3   
)

◆ cester_assert_uint_eq() [6/6]

cester_assert_uint_eq ( 500  ,
sz3   
)

◆ CESTER_TEST() [1/5]

CESTER_TEST ( rtps_identity_center  ,
gte_tests  ,
gte_set_identity_rotation();gte_set_translation(0, 0, 1000);gte_set_screen(160<< 16, 120<< 16, 200);cop2_put(0, 0x00000000);cop2_put(1, 0);gte_clear_flag();cop2_cmd(COP2_RTPS(1, 0));uint32_t  sz3,
sxy2;cop2_get(19, sz3);cop2_get(14, sxy2);cester_assert_uint_eq(1000, sz3);cester_assert_int_eq(160,(int16_t)(sxy2 &0xffff));cester_assert_int_eq(120,(int16_t)(sxy2 > > 16));   
)

◆ CESTER_TEST() [2/5]

CESTER_TEST ( rtps_mac_output  ,
gte_tests  ,
gte_set_identity_rotation();gte_set_translation(100, 200, 300);gte_set_screen(0, 0, 200);cop2_put(0,(50<< 16)|10);cop2_put(1, 500);gte_clear_flag();cop2_cmd(COP2_RTPS(1, 0));int32_t  mac1,
mac2  ,
mac3;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cester_assert_int_eq(110, mac1);cester_assert_int_eq(250, mac2);cester_assert_int_eq(800, mac3);   
)

◆ CESTER_TEST() [3/5]

CESTER_TEST ( rtps_screen_saturation  ,
gte_tests  ,
gte_set_identity_rotation();gte_set_translation(0, 0, 0);gte_set_screen(0, 0, 200);cop2_put(0,(0<< 16)|0x7fff);cop2_put(1, 100);gte_clear_flag();cop2_cmd(COP2_RTPS(1, 0));uint32_t  sxy2,
flag;cop2_get(14, sxy2);  flag = gte_read_flag(); int16_t sx = (int16_t)(sxy2 & 0xffff); ramsyscall_printf("RTPS sat: SX=%d FLAG=0x%08x (bit14=%u)\n", sxflag, (flag >> 14) & 1);  cester_assert_int_eq(0x3ff, sx); uint32_t flag14 = (flag >> 14) & 1; cester_assert_uint_eq(1, flag14); 
)

◆ CESTER_TEST() [4/5]

CESTER_TEST ( rtps_sf0  ,
gte_tests  ,
gte_set_identity_rotation();gte_set_translation(0, 0, 0x1000);gte_set_screen(0, 0, 200);cop2_put(0, 0x00000000);cop2_put(1, 0);gte_clear_flag();cop2_cmd(COP2_RTPS(0, 0));int32_t mac3;uint32_t  ir3,
sz3  ,
flag;cop2_get(27, mac3);cop2_get(11, ir3);cop2_get(19, sz3);  flag = gte_read_flag(); ramsyscall_printf("RTPS sf=0: MAC3=%d IR3=0x%04x SZ3=%u FLAG=0x%08x\n",                      mac3ir3 & 0xffff, sz3flag);   cester_assert_int_eq(16777216, mac3); cester_assert_uint_eq(0x7fff, ir3); cester_assert_uint_eq(4096, sz3); cester_assert_uint_eq(0, flag); 
)

◆ CESTER_TEST() [5/5]

CESTER_TEST ( rtpt_flag_accumulates  ,
gte_tests  ,
gte_set_identity_rotation();gte_set_translation(0, 0, 0);gte_set_screen(0, 0, 200);cop2_put(0, 0x00000000);cop2_put(1, 1000);cop2_put(2,(0<< 16)|0x7fff);cop2_put(3, 100);cop2_put(4, 0x00000000);cop2_put(5, 1000);gte_clear_flag();cop2_cmd(COP2_RTPT(1, 0));uint32_t flag flag = gte_read_flag();  ramsyscall_printf("RTPT flag accum: FLAG=0x%08x\n", flag);  uint32_t flag17 = (flag >> 17) & 1; cester_assert_uint_eq(1, flag17); 
)

◆ cop2_cmd() [1/2]

cop2_cmd ( COP2_RTPS(1, 0)  )

◆ cop2_cmd() [2/2]

cop2_cmd ( COP2_RTPT(1, 0)  )

◆ cop2_get() [1/8]

cop2_get ( 12  ,
sxy0   
)

◆ cop2_get() [2/8]

cop2_get ( 13  ,
sxy1   
)

◆ cop2_get() [3/8]

cop2_get ( 14  ,
sxy2   
)

◆ cop2_get() [4/8]

cop2_get ( 17  ,
sz1   
)

◆ cop2_get() [5/8]

cop2_get ( 18  ,
sz2   
)

◆ cop2_get() [6/8]

cop2_get ( 19  ,
sz3   
)

◆ cop2_get() [7/8]

cop2_get ( 24  ,
mac0   
)

◆ cop2_get() [8/8]

cop2_get ( ,
ir0   
)

◆ cop2_put() [1/15]

cop2_put ( ,
0x00000000   
)

◆ cop2_put() [2/15]

cop2_put ( ,
(0<< 16)|  100 
)

◆ cop2_put() [3/15]

cop2_put ( ,
(50<< 16)|(100 &0xffff)   
)

◆ cop2_put() [4/15]

cop2_put ( ,
 
)

◆ cop2_put() [5/15]

cop2_put ( ,
100   
)

◆ cop2_put() [6/15]

cop2_put ( ,
1000   
)

◆ cop2_put() [7/15]

cop2_put ( ,
500   
)

◆ cop2_put() [8/15]

cop2_put ( ,
0x00000000   
)

◆ cop2_put() [9/15]

cop2_put ( ,
(0<< 16)|  100 
)

◆ cop2_put() [10/15]

cop2_put ( ,
1000   
)

◆ cop2_put() [11/15]

cop2_put ( ,
200   
)

◆ cop2_put() [12/15]

cop2_put ( ,
0x00000000   
)

◆ cop2_put() [13/15]

cop2_put ( ,
(100<< 16)|  0 
)

◆ cop2_put() [14/15]

cop2_put ( ,
1000   
)

◆ cop2_put() [15/15]

cop2_put ( ,
300   
)

◆ cop2_putc() [1/5]

cop2_putc ( 24  ,
 
)

◆ cop2_putc() [2/5]

cop2_putc ( 25  ,
 
)

◆ cop2_putc() [3/5]

cop2_putc ( 26  ,
200   
)

◆ cop2_putc() [4/5]

cop2_putc ( 27  ,
0xfffff880   
)

◆ cop2_putc() [5/5]

cop2_putc ( 28  ,
0x01000000   
)

◆ gte_clear_flag()

gte_clear_flag ( )

◆ gte_set_identity_rotation()

gte_set_identity_rotation ( )

◆ gte_set_screen() [1/2]

gte_set_screen ( ,
,
200   
)

◆ gte_set_screen() [2/2]

gte_set_screen ( 160<<  16,
120<<  16,
200   
)

◆ gte_set_translation()

gte_set_translation ( ,
,
 
)

◆ ramsyscall_printf()

ramsyscall_printf ( )

Variable Documentation

◆ flag

flag = gte_read_flag()

◆ flag17

uint32_t flag17 = (flag >> 17) & 1

◆ gte_tests

gte_tests

◆ ir0

uint32_t ir0

◆ mac0

int32_t mac0

◆ sx

int16_t sx = (int16_t)(sxy2 & 0xffff)

◆ sx1

int16_t sx1 = (int16_t)(sxy1 & 0xffff)

◆ sxy0

uint32_t sxy0

◆ sxy1

uint32_t sxy1

◆ sxy2

uint32_t sxy2

◆ sy

int16_t sy = (int16_t)(sxy2 >> 16)

◆ sy1

int16_t sy1 = (int16_t)(sxy1 >> 16)

◆ sz1

uint32_t sz1

◆ sz2

uint32_t sz2

◆ sz3

uint32_t sz3