|
| | 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) |
| |