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