Hi, does anyone know why the following code causes a fatal crash? I have modified the cube example a bit so it copies the GIFTag directly to VU1 mem (using the 0x1100c000 address). However, executing the XGKICK crashes instantly. Anyone knows why? Thanks in advance!
// Reset the packet.
packet_reset(&packet);
// Create the cube GIFTag (A+D mode)
for (loop0=0;loop0<12;loop0++) {
packet_append_64(&packet, GIF_SET_TAG(6, 1, 1, GIF_SET_PRIM(3, 1, 0, 0, 0, 0, 0, 0, 0), GIF_TAG_PACKED, 1));
packet_append_64(&packet, 0x0E);
packet_append_64(&packet, colours[loop0 >> 2]);
packet_append_64(&packet, GIF_REG_RGBAQ);
packet_append_64(&packet, GIF_SET_XYZ(pointsi[triangles[loop0][0]].x, pointsi[triangles[loop0][0]].y, pointsi[triangles[loop0][0]].z));
packet_append_64(&packet, GIF_REG_XYZ2);
packet_append_64(&packet, colours[loop0 >> 2]);
packet_append_64(&packet, GIF_REG_RGBAQ);
packet_append_64(&packet, GIF_SET_XYZ(pointsi[triangles[loop0][1]].x, pointsi[triangles[loop0][1]].y, pointsi[triangles[loop0][1]].z));
packet_append_64(&packet, GIF_REG_XYZ2);
packet_append_64(&packet, colours[loop0 >> 2]);
packet_append_64(&packet, GIF_REG_RGBAQ);
packet_append_64(&packet, GIF_SET_XYZ(pointsi[triangles[loop0][2]].x, pointsi[triangles[loop0][2]].y, pointsi[triangles[loop0][2]].z));
packet_append_64(&packet, GIF_REG_XYZ2);
}
// Copy the Cube GIFTag byte by byte to 0x1100c000
for (loop0=0;loop0<packet.count;loop0++) {
vu1ptr[loop0]=packet.data[loop0];
}
// Create a VIFTag and send it (VI05 is 0, then XGKICK VI05)
vucodeptr = (int32*)&vucodebegin;
vuprogramsize=(&vucodeend-&vucodebegin); //calculate program size
packet_reset(&packet);
packet_append_32(&packet,vif_nop);
packet_append_32(&packet,vif_nop);
packet_append_32(&packet,(vif_mpg)+((vuprogramsize/2)<<16));
for (loop0=0;loop0<vuprogramsize;loop0++) {
packet_append_32(&packet,vucodeptr[loop0]);
}
packet_append_32(&packet,vif_flush);
packet_append_32(&packet,vif_mscal+(VIF_ADDR0));
packet_send(&packet, DMA_CHANNEL_VIF1, DMA_FLAG_NORMAL);