|
| | CESTER_TEST (ncs_z_normal_white_light, gte_tests, gte_set_simple_light();gte_set_white_light_color();gte_set_zero_bk();cop2_put(0, 0x00000000);cop2_put(1, 0x1000);cop2_put(6, 0x00808080);gte_clear_flag();cop2_cmd(COP2_NCS(1, 1));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("NCS z-normal: MAC=(%d,%d,%d) RGB2=0x%08x\n", mac1, mac2, mac3, rgb2);cester_assert_int_eq(0, mac1);cester_assert_int_eq(0, mac2);cester_assert_int_eq(4096, mac3);cester_assert_uint_eq(0x00ff0000, rgb2);) CESTER_TEST(ncs_with_background |
| |
| | gte_set_simple_light () |
| |
| | gte_set_white_light_color () |
| |
| | cop2_putc (13, 0x800) |
| |
| | cop2_putc (14, 0x400) |
| |
| | cop2_putc (15, 0x200) |
| |
| | cop2_put (0, 0x00000000) |
| |
| | cop2_put (1, 0x1000) |
| |
| | cop2_put (6, 0x00000000) |
| |
| | gte_clear_flag () |
| |
| | cop2_cmd (COP2_NCS(1, 1)) |
| |
| | cop2_get (25, mac1) |
| |
| | cop2_get (26, mac2) |
| |
| | cop2_get (27, mac3) |
| |
| | cester_assert_int_eq (0x800, mac1) |
| |
| | cester_assert_int_eq (0x400, mac2) |
| |
| | cester_assert_int_eq (0x1200, mac3) |
| |
| | CESTER_TEST (nct_three_normals, gte_tests, gte_set_simple_light();gte_set_white_light_color();gte_set_zero_bk();cop2_put(0, 0x00000000);cop2_put(1, 0x1000);cop2_put(2,(0<< 16)|0x1000);cop2_put(3, 0);cop2_put(4,(0x1000<< 16)|0);cop2_put(5, 0);cop2_put(6, 0x00000000);gte_clear_flag();cop2_cmd(COP2_NCT(1, 1));uint32_t rgb0, rgb1, rgb2;cop2_get(20, rgb0);cop2_get(21, rgb1);cop2_get(22, rgb2);ramsyscall_printf("NCT: RGB0=0x%08x RGB1=0x%08x RGB2=0x%08x\n", rgb0, rgb1, rgb2);cester_assert_uint_eq(0x00ff0000, rgb0);cester_assert_uint_eq(0x00000000, rgb1);cester_assert_uint_eq(0x00000000, rgb2);) CESTER_TEST(nccs_basic |
| |
| | gte_set_zero_bk () |
| |
| | cop2_put (6, 0x00808080) |
| |
| | cop2_cmd (COP2_NCCS(1, 1)) |
| |
| | cop2_get (22, rgb2) |
| |
| | ramsyscall_printf ("NCCS: MAC=(%d,%d,%d) RGB2=0x%08x\n", mac1, mac2, mac3, rgb2) |
| |
| | cester_assert_int_eq (0, mac1) |
| |
| | cester_assert_int_eq (0, mac2) |
| |
| | cester_assert_int_eq (2048, mac3) |
| |
| | cester_assert_uint_eq (0x00800000, rgb2) |
| |
| | CESTER_TEST (ncct_basic, gte_tests, gte_set_simple_light();gte_set_white_light_color();gte_set_zero_bk();cop2_put(0, 0x00000000);cop2_put(1, 0x1000);cop2_put(2, 0x00000000);cop2_put(3, 0x1000);cop2_put(4, 0x00000000);cop2_put(5, 0x1000);cop2_put(6, 0x00808080);gte_clear_flag();cop2_cmd(COP2_NCCT(1, 1));uint32_t rgb0, rgb1, rgb2;cop2_get(20, rgb0);cop2_get(21, rgb1);cop2_get(22, rgb2);ramsyscall_printf("NCCT: RGB0=0x%08x RGB1=0x%08x RGB2=0x%08x\n", rgb0, rgb1, rgb2);cester_assert_uint_eq(0x00800000, rgb0);cester_assert_uint_eq(0x00800000, rgb1);cester_assert_uint_eq(0x00800000, rgb2);) CESTER_TEST(ncds_no_depth |
| |
| | gte_set_far_color (0, 0, 0) |
| |
| | cop2_put (8, 0) |
| |
| | cop2_cmd (COP2_NCDS(1, 1)) |
| |
| | CESTER_TEST (ncds_with_depth, gte_tests, gte_set_simple_light();gte_set_white_light_color();gte_set_zero_bk();gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(0, 0x00000000);cop2_put(1, 0x1000);cop2_put(6, 0x00808080);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_NCDS(1, 1));int32_t mac1, mac2, mac3;uint32_t rgb2, flag;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cop2_get(22, rgb2);flag=gte_read_flag();ramsyscall_printf("NCDS depth: MAC=(%d,%d,%d) RGB2=0x%08x FLAG=0x%08x\n", mac1, mac2, mac3, rgb2, flag);cester_assert_int_eq(2048, mac1);cester_assert_int_eq(2048, mac2);cester_assert_int_eq(3072, mac3);cester_assert_uint_eq(0x00c08080, rgb2);cester_assert_uint_eq(0x00000000, flag);) CESTER_TEST(ncdt_basic |
| |
| | cop2_put (2, 0x00000000) |
| |
| | cop2_put (3, 0x0800) |
| |
| | cop2_put (4, 0x00000000) |
| |
| | cop2_put (5, 0x0400) |
| |
| | cop2_cmd (COP2_NCDT(1, 1)) |
| |
| | cop2_get (20, rgb0) |
| |
| | cop2_get (21, rgb1) |
| |
| | cester_assert_uint_eq (0x00800000, rgb0) |
| |
| | cester_assert_uint_eq (0x00400000, rgb1) |
| |
| | cester_assert_uint_eq (0x00200000, rgb2) |
| |
| | CESTER_TEST (cc_basic, gte_tests, gte_set_white_light_color();gte_set_zero_bk();cop2_put(9, 0x1000);cop2_put(10, 0x0800);cop2_put(11, 0x0400);cop2_put(6, 0x00808080);gte_clear_flag();cop2_cmd(COP2_CC(1, 1));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("CC: 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(cdp_basic |
| |
| | gte_set_far_color (0x1000, 0x1000, 0x1000) |
| |
| | cop2_put (9, 0x1000) |
| |
| | cop2_put (10, 0x1000) |
| |
| | cop2_put (11, 0x1000) |
| |
| | cop2_cmd (COP2_CDP(1, 1)) |
| |
| | cester_assert_int_eq (2048, mac1) |
| |
| | cester_assert_int_eq (2048, mac2) |
| |
| | cester_assert_uint_eq (0x00808080, rgb2) |
| |
| | CESTER_TEST (cdp_with_depth, gte_tests, gte_set_white_light_color();gte_set_zero_bk();gte_set_far_color(0x1000, 0x1000, 0x1000);cop2_put(9, 0x1000);cop2_put(10, 0x1000);cop2_put(11, 0x1000);cop2_put(6, 0x00808080);cop2_put(8, 0x0800);gte_clear_flag();cop2_cmd(COP2_CDP(1, 1));int32_t mac1, mac2, mac3;uint32_t rgb2, flag;cop2_get(25, mac1);cop2_get(26, mac2);cop2_get(27, mac3);cop2_get(22, rgb2);flag=gte_read_flag();ramsyscall_printf("CDP depth: MAC=(%d,%d,%d) RGB2=0x%08x FLAG=0x%08x\n", mac1, mac2, mac3, rgb2, flag);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_assert_uint_eq(0x00000000, flag);) CESTER_TEST(ncs_full_light_matrix |
| |
| | cop2_putc (8, 0x00000b50) |
| |
| | cop2_putc (9, 0x00000000) |
| |
| | cop2_putc (10, 0x00000000) |
| |
| | cop2_putc (11, 0x00000000) |
| |
| | cop2_putc (12, 0x0b50) |
| |
| | cop2_put (0,(0<< 16)|0x1000) |
| |
| | cop2_put (1, 0) |
| |
| | cester_assert_int_eq (0x0b50, mac1) |
| |
| | cester_assert_int_eq (0, mac3) |
| |