40static void drawWindowTri(uint8_t mask_x, uint8_t mask_y,
41 uint8_t off_x, uint8_t off_y) {
43 rasterClearTestRegion(0, 0, 64, 16);
45 setTextureWindow(mask_x, mask_y, off_x, off_y);
51 rasterFlushPrimitive();
54static void drawWindowRect(uint8_t mask_x, uint8_t mask_y,
55 uint8_t off_x, uint8_t off_y) {
57 rasterClearTestRegion(0, 0, 64, 16);
59 setTextureWindow(mask_x, mask_y, off_x, off_y);
61 rasterFlushPrimitive();
64static void drawWindowQuad(uint8_t mask_x, uint8_t mask_y,
65 uint8_t off_x, uint8_t off_y) {
67 rasterClearTestRegion(0, 0, 64, 16);
69 setTextureWindow(mask_x, mask_y, off_x, off_y);
76 rasterFlushPrimitive();
87static void drawWindowSemi(uint8_t abr) {
91 setTextureWindow(0x01, 0, 0, 0);
93 rasterFlushPrimitive();
102static void drawWindowTransparency(uint8_t abr) {
105 uploadClut8MaskedAt0();
107 setTextureWindow(0x01, 0, 0, 0);
112 rasterFlushPrimitive();
125CESTER_TEST(wt_mask00_off00_identity, gpu_raster_phase15,
126 drawWindowTri(0x00, 0, 0, 0);
130CESTER_TEST(wt_mask01_off00_wrap8, gpu_raster_phase15,
131 drawWindowTri(0x01, 0, 0, 0);
136 drawWindowTri(0x07, 0, 0, 0);
141 drawWindowTri(0x0f, 0, 0, 0);
146 drawWindowTri(0x1f, 0, 0, 0);
151 drawWindowTri(0x1f, 0, 0, 0);
156 drawWindowTri(0x1f, 0, 0, 0);
167 drawWindowTri(0x0f, 0, 0x01, 0);
172 drawWindowTri(0x0f, 0, 0x03, 0);
177 drawWindowTri(0x0f, 0, 0x0f, 0);
188 drawWindowTri(0x1f, 0, 0x1f, 0);
201CESTER_TEST(wt_maskU01_maskV01_off00_x8y4, gpu_raster_phase15,
202 drawWindowTri(0x01, 0x01, 0, 0);
206CESTER_TEST(wt_maskU01_maskV01_off11_x8y4, gpu_raster_phase15,
207 drawWindowTri(0x01, 0x01, 0x01, 0x01);
219 drawWindowTri(0x01, 0, 0x07, 0);
226 drawWindowTri(0x03, 0, 0x1f, 0);
238 drawWindowRect(0x01, 0, 0, 0);
243 drawWindowQuad(0x01, 0, 0, 0);
248CESTER_TEST(wr_mask03_off01_x12, gpu_raster_phase15,
249 drawWindowRect(0x03, 0, 0x01, 0);
253CESTER_TEST(wq_mask03_off01_x12, gpu_raster_phase15,
254 drawWindowQuad(0x03, 0, 0x01, 0);
266CESTER_TEST(ws_window_semi_abr0, gpu_raster_phase15,
270CESTER_TEST(ws_window_semi_abr1, gpu_raster_phase15,
274CESTER_TEST(ws_window_semi_abr2, gpu_raster_phase15,
278CESTER_TEST(ws_window_semi_abr3, gpu_raster_phase15,
290CESTER_TEST(wx_window_transparency_abr0_x8, gpu_raster_phase15,
291 drawWindowTransparency(0);
298CESTER_TEST(wx_window_transparency_abr0_x0, gpu_raster_phase15,
299 drawWindowTransparency(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
#define WX_WINDOW_TRANS_ABR0
Definition raster-expected-phase15.h:60
#define WT_MASK1F_OFF1F_X0_HW
Definition raster-expected-phase15.h:68
#define WT_MASK0F_OFF0F_X0_HW
Definition raster-expected-phase15.h:67
#define WS_WINDOW_SEMI_NO_BLEND
Definition raster-expected-phase15.h:41
#define WX_WINDOW_TRANS_X0
Definition raster-expected-phase15.h:61
#define RASTER_VRAM_RED
Definition raster-helpers.h:124
#define ASSERT_PIXEL_EQ(expected, x_, y_)
Definition raster-helpers.h:472
#define CLUT8_FIELD
Definition texture-fixtures.h:84
#define TEX8_TY
Definition texture-fixtures.h:61
#define TEX8_TPAGE
Definition texture-fixtures.h:103
#define TEX8_TX
Definition texture-fixtures.h:60
#define TEX_MOD_NEUTRAL
Definition texture-fixtures.h:328