void GFX_FIFOsend(u8 cmd, u32 param) { //INFO("gxFIFO: send 0x%02X = 0x%08X (size %03i/0x%02X) gxstat 0x%08X\n", cmd, param, gxFIFO.size, gxFIFO.size, gxstat); //printf("fifo recv: %02X: %08X upto:%d\n",cmd,param,gxFIFO.size+1); //TODO - WOAH ! NOT HANDLING A TOO-BIG FIFO RIGHT NOW! //if (gxFIFO.size > 255) //{ // GXF_FIFO_handleEvents(); // //NEED TO HANDLE THIS!!!!!!!!!!!!!!!!!!!!!!!!!! // //gxstat |= 0x08000000; // busy // NDS_RescheduleGXFIFO(1); // //INFO("ERROR: gxFIFO is full (cmd 0x%02X = 0x%08X) (prev cmd 0x%02X = 0x%08X)\n", cmd, param, gxFIFO.cmd[255], gxFIFO.param[255]); // return; //} gxFIFO.cmd[gxFIFO.tail] = cmd; gxFIFO.param[gxFIFO.tail] = param; gxFIFO.tail++; gxFIFO.size++; if (gxFIFO.tail > HACK_GXIFO_SIZE-1) gxFIFO.tail = 0; //if a matrix op is entering the pipeline, do accounting for it //(this is tested by wild west, which will jam a few ops in the fifo and then wait for the matrix stack to be //un-busy so it can read back the current matrix stack position). //it is definitely only pushes and pops which set this flag. //seems like it would be less work in the HW to make a counter than do cmps on all the command bytes, so maybe we're even doing it right. if(IsMatrixStackCommand(cmd)) gxFIFO.matrix_stack_op_size++; if(gxFIFO.size>=HACK_GXIFO_SIZE) { printf("--FIFO FULL-- : %d\n",gxFIFO.size); } //gxstat |= 0x08000000; // set busy flag GXF_FIFO_handleEvents(); NDS_RescheduleGXFIFO(1); }
void GFX_FIFOsend(u8 cmd, u32 param) { if(cmd==0x41) { int zzz=9; } //INFO("gxFIFO: send 0x%02X = 0x%08X (size %03i/0x%02X) gxstat 0x%08X\n", cmd, param, gxFIFO.size, gxFIFO.size, gxstat); //printf("fifo recv: %02X: %08X upto:%d\n",cmd,param,gxFIFO.size+1); //TODO - WOAH ! NOT HANDLING A TOO-BIG FIFO RIGHT NOW! //if (gxFIFO.size > 255) //{ // GXF_FIFO_handleEvents(); // //NEED TO HANDLE THIS!!!!!!!!!!!!!!!!!!!!!!!!!! // //gxstat |= 0x08000000; // busy // NDS_RescheduleGXFIFO(1); // //INFO("ERROR: gxFIFO is full (cmd 0x%02X = 0x%08X) (prev cmd 0x%02X = 0x%08X)\n", cmd, param, gxFIFO.cmd[255], gxFIFO.param[255]); // return; //} gxFIFO.cmd[gxFIFO.tail] = cmd; gxFIFO.param[gxFIFO.tail] = param; gxFIFO.tail++; gxFIFO.size++; if (gxFIFO.tail > HACK_GXIFO_SIZE-1) gxFIFO.tail = 0; if(gxFIFO.size>=HACK_GXIFO_SIZE) { printf("--FIFO FULL-- : %d\n",gxFIFO.size); } //gxstat |= 0x08000000; // set busy flag GXF_FIFO_handleEvents(); NDS_RescheduleGXFIFO(1); }