38static inline uint32_t rgb24(uint8_t
r, uint8_t
g, uint8_t
b) {
45static void drawDitherConstTri(
uint32_t color24, int16_t x0, int16_t y0) {
47 rasterClearTestRegion(0, 0, 64, 64);
49 rasterGouraudTri(color24, x0, y0,
50 color24, (int16_t)(x0 + 31), y0,
51 color24, x0, (int16_t)(y0 + 31));
52 rasterFlushPrimitive();
60static void drawCanonicalAt(
uint32_t color24) {
61 drawDitherConstTri(color24, 0, 0);
189 drawDitherConstTri(rgb24(128, 128, 128), 0, 0);
193 drawDitherConstTri(rgb24(128, 128, 128), 0, 4);
197 drawDitherConstTri(rgb24(128, 128, 128), 4, 0);
201 drawDitherConstTri(rgb24(128, 128, 128), 4, 4);
235CESTER_TEST(dt_sat_cross_under_r3_8_8, gpu_raster_phase11,
237 drawCanonicalAt(rgb24(0x03, 0, 0));
240CESTER_TEST(dt_sat_cross_under_r3_10_10, gpu_raster_phase11,
241 drawCanonicalAt(rgb24(0x03, 0, 0));
244CESTER_TEST(dt_sat_cross_land_r4_8_8, gpu_raster_phase11,
246 drawCanonicalAt(rgb24(0x04, 0, 0));
249CESTER_TEST(dt_sat_cross_over_r255_10_9, gpu_raster_phase11,
251 drawCanonicalAt(rgb24(0xff, 0, 0));
254CESTER_TEST(dt_sat_cross_over_r255_8_11, gpu_raster_phase11,
255 drawCanonicalAt(rgb24(0xff, 0, 0));
258CESTER_TEST(dt_sat_cross_land_r252_10_9, gpu_raster_phase11,
260 drawCanonicalAt(rgb24(0xfc, 0, 0));
CESTER_BODY(static int s_got40;static int s_got80;static uint32_t s_cause;static uint32_t s_epc;static uint32_t s_from;static uint32_t *s_resume;static uint32_t *s_regs;static uint32_t(*s_customhandler)()=NULL;static uint32_t s_oldIMASK;static uint32_t s_oldDPCR;static uint32_t s_oldDICR;uint32_t handler(uint32_t *regs, uint32_t from) { if(from==0x40) s_got40=1;if(from==0x80) s_got80=1;uint32_t cause;uint32_t epc;s_from=from;asm("mfc0 %0, $13\nnop\nmfc0 %1, $14\nnop" :"=r"(cause), "=r"(epc));s_cause=cause;s_epc=epc;if(s_customhandler) { return s_customhandler();} else { return s_resume ?((uint32_t) s_resume) :(epc+4);} } void installExceptionHandlers(uint32_t(*handler)(uint32_t *regs, uint32_t from));void uninstallExceptionHandlers();uint32_t branchbranch1();uint32_t branchbranch2();uint32_t jumpjump1();uint32_t jumpjump2();uint32_t cpu_LWR_LWL_half(uint32_t buff[], uint32_t initial);uint32_t cpu_LWR_LWL_nodelay(uint32_t buff[], uint32_t initial);uint32_t cpu_LWR_LWL_delayed(uint32_t buff[], uint32_t initial);uint32_t cpu_LWR_LWL_load_different(uint32_t buff[], uint32_t initial);uint32_t cpu_LW_LWR(uint32_t buff[], uint32_t initial);uint32_t cpu_delayed_load(uint32_t buff[], uint32_t override);uint32_t cpu_delayed_load_cancelled(uint32_t buff[], uint32_t override);uint64_t cpu_delayed_load_load(uint32_t buff[], uint32_t override);uint32_t linkandload();uint32_t lwandlink();uint32_t nolink();static int s_interruptsWereEnabled;) CESTER_BEFORE_EACH(cpu_tests
CESTER_TEST(cpu_cop0_basic_write_bp, cpu_tests, uint32_t expectedEPC;uint32_t t;volatile uint32_t *ptr=(volatile uint32_t *) 0x58; *ptr=1;__asm__ volatile("" " lui %0, 0b1100101010000000\n" " mtc0 %0, $7\n" " li %0, 0x58\n" " mtc0 %0, $5\n" " li %0, 0xfffffff0\n" " mtc0 %0, $9\n" :"=r"(t));cester_assert_uint_eq(1, *ptr);__asm__ volatile("la %0, 1f\n1:\nsw $0, 0x58($0)" :"=r"(expectedEPC));__asm__ volatile("mtc0 $0, $7\n");cester_assert_uint_eq(0, *ptr);cester_assert_uint_eq(1, s_got40);cester_assert_uint_eq(0, s_got80);cester_assert_uint_eq(0x40, s_from);cester_assert_uint_eq(expectedEPC, s_epc);) CESTER_TEST(cpu_cop0_kseg_write_bp
uint32_t r
Definition cpu.c:222
uint8_t g
Definition gte-depthcue.c:38
uint8_t b
Definition gte-depthcue.c:39
#define DT_BAYER_MID_8_11
Definition raster-expected-phase11.h:94
#define DT_BASE_RC0_11_11
Definition raster-expected-phase11.h:155
#define DT_BAYER_MID_10_8
Definition raster-expected-phase11.h:84
#define DT_SAT_HIGH_RFC_8_8
Definition raster-expected-phase11.h:213
#define DT_BAYER_MID_11_11
Definition raster-expected-phase11.h:97
#define DT_POS_04_AT_16_16
Definition raster-expected-phase11.h:191
#define DT_SAT_CROSS_LAND_R252_10_9
Definition raster-expected-phase11.h:240
#define DT_BAYER_MID_10_11
Definition raster-expected-phase11.h:96
#define DT_CHAN_B80_11_8
Definition raster-expected-phase11.h:171
#define DT_BASE_R80_11_11
Definition raster-expected-phase11.h:138
#define DT_BASE_R40_8_11
Definition raster-expected-phase11.h:118
#define DT_BASE_R40_9_10
Definition raster-expected-phase11.h:115
#define DT_BAYER_MID_10_9
Definition raster-expected-phase11.h:88
#define DT_BASE_R40_9_9
Definition raster-expected-phase11.h:111
#define DT_BAYER_MID_10_10
Definition raster-expected-phase11.h:92
#define DT_BASE_R80_8_9
Definition raster-expected-phase11.h:127
#define DT_SAT_CROSS_UNDER_R3_8_8
Definition raster-expected-phase11.h:235
#define DT_BASE_R80_10_9
Definition raster-expected-phase11.h:129
#define DT_BASE_R40_10_9
Definition raster-expected-phase11.h:112
#define DT_BASE_R80_10_11
Definition raster-expected-phase11.h:137
#define DT_BASE_R40_9_11
Definition raster-expected-phase11.h:119
#define DT_BAYER_MID_9_8
Definition raster-expected-phase11.h:83
#define DT_BASE_R80_11_8
Definition raster-expected-phase11.h:126
#define DT_BASE_R40_11_11
Definition raster-expected-phase11.h:121
#define DT_BAYER_MID_11_8
Definition raster-expected-phase11.h:85
#define DT_BASE_R80_10_10
Definition raster-expected-phase11.h:133
#define DT_SAT_CROSS_UNDER_R3_10_10
Definition raster-expected-phase11.h:236
#define DT_SAT_HIGH_RFC_9_8
Definition raster-expected-phase11.h:214
#define DT_CHAN_G80_11_8
Definition raster-expected-phase11.h:166
#define DT_BASE_RC0_8_11
Definition raster-expected-phase11.h:152
#define DT_BASE_R40_11_10
Definition raster-expected-phase11.h:117
#define DT_BAYER_MID_8_9
Definition raster-expected-phase11.h:86
#define DT_BASE_R80_10_8
Definition raster-expected-phase11.h:125
#define DT_BASE_R40_10_11
Definition raster-expected-phase11.h:120
#define DT_BASE_R80_8_11
Definition raster-expected-phase11.h:135
#define DT_SAT_LOW_R04_8_8
Definition raster-expected-phase11.h:205
#define DT_BASE_RC0_9_8
Definition raster-expected-phase11.h:141
#define DT_BASE_R80_9_9
Definition raster-expected-phase11.h:128
#define DT_SAT_CROSS_OVER_R255_8_11
Definition raster-expected-phase11.h:239
#define DT_POS_40_AT_16_16
Definition raster-expected-phase11.h:192
#define DT_BASE_R40_11_9
Definition raster-expected-phase11.h:113
#define DT_CHAN_G80_8_8
Definition raster-expected-phase11.h:163
#define DT_BASE_R40_8_8
Definition raster-expected-phase11.h:106
#define DT_CHAN_G80_10_8
Definition raster-expected-phase11.h:165
#define DT_BAYER_MID_8_10
Definition raster-expected-phase11.h:90
#define DT_BASE_RC0_11_8
Definition raster-expected-phase11.h:143
#define DT_SAT_CROSS_OVER_R255_10_9
Definition raster-expected-phase11.h:238
#define DT_BASE_RC0_9_10
Definition raster-expected-phase11.h:149
#define DT_BASE_R40_11_8
Definition raster-expected-phase11.h:109
#define DT_BAYER_MID_9_9
Definition raster-expected-phase11.h:87
#define DT_BASE_RC0_10_9
Definition raster-expected-phase11.h:146
#define DT_CHAN_B80_10_8
Definition raster-expected-phase11.h:170
#define DT_SAT_HIGH_RFC_10_8
Definition raster-expected-phase11.h:215
#define DT_BASE_R40_8_10
Definition raster-expected-phase11.h:114
#define DT_BASE_RC0_8_9
Definition raster-expected-phase11.h:144
#define DT_BASE_R80_11_10
Definition raster-expected-phase11.h:134
#define DT_BASE_R40_10_8
Definition raster-expected-phase11.h:108
#define DT_BASE_R40_10_10
Definition raster-expected-phase11.h:116
#define DT_BAYER_MID_11_9
Definition raster-expected-phase11.h:89
#define DT_BASE_RC0_9_11
Definition raster-expected-phase11.h:153
#define DT_BASE_RC0_11_9
Definition raster-expected-phase11.h:147
#define DT_BASE_RC0_10_11
Definition raster-expected-phase11.h:154
#define DT_CHAN_B80_9_8
Definition raster-expected-phase11.h:169
#define DT_BASE_R80_9_11
Definition raster-expected-phase11.h:136
#define DT_SAT_LOW_R04_11_8
Definition raster-expected-phase11.h:208
#define DT_SAT_HIGH_RFC_11_8
Definition raster-expected-phase11.h:216
#define DT_CHAN_G80_9_8
Definition raster-expected-phase11.h:164
#define DT_BASE_RC0_10_8
Definition raster-expected-phase11.h:142
#define DT_CHAN_B80_8_8
Definition raster-expected-phase11.h:168
#define DT_BASE_R80_11_9
Definition raster-expected-phase11.h:130
#define DT_BASE_R40_9_8
Definition raster-expected-phase11.h:107
#define DT_POS_44_AT_16_16
Definition raster-expected-phase11.h:193
#define DT_BASE_RC0_11_10
Definition raster-expected-phase11.h:151
#define DT_SAT_CROSS_LAND_R4_8_8
Definition raster-expected-phase11.h:237
#define DT_BASE_R80_8_8
Definition raster-expected-phase11.h:123
#define DT_BASE_R80_8_10
Definition raster-expected-phase11.h:131
#define DT_BASE_RC0_9_9
Definition raster-expected-phase11.h:145
#define DT_BAYER_MID_9_10
Definition raster-expected-phase11.h:91
#define DT_BASE_R80_9_10
Definition raster-expected-phase11.h:132
#define DT_BAYER_MID_8_8
Definition raster-expected-phase11.h:82
#define DT_BASE_RC0_8_8
Definition raster-expected-phase11.h:140
#define DT_BASE_R40_8_9
Definition raster-expected-phase11.h:110
#define DT_BASE_RC0_8_10
Definition raster-expected-phase11.h:148
#define DT_SAT_LOW_R04_10_8
Definition raster-expected-phase11.h:207
#define DT_BAYER_MID_11_10
Definition raster-expected-phase11.h:93
#define DT_BAYER_MID_9_11
Definition raster-expected-phase11.h:95
#define DT_BASE_RC0_10_10
Definition raster-expected-phase11.h:150
#define DT_POS_00_AT_16_16
Definition raster-expected-phase11.h:190
#define DT_BASE_R80_9_8
Definition raster-expected-phase11.h:124
#define DT_SAT_LOW_R04_9_8
Definition raster-expected-phase11.h:206
#define ASSERT_PIXEL_EQ(expected, x_, y_)
Definition raster-helpers.h:472
void uint32_t(classId, spec)