How would I be able to tell which functions can't be used? The error said "library not found," so I suppose that lines up with what you're saying. The following code chunk is where things were added. Can you spot a function call that wouldn't work?
#include <pspctrl.h>
#include <pspkernel.h>
#include <stdio.h>
#include <pspiofilemgr.h>
#include <pspsystimer.h>
#include "draw.h"
#include "control.h"
#include "callbacks.h"
#include "test.h"
#define printf pspDebugScreenPrintf
#define PHRASE_SIZE 45
PSP_MODULE_INFO("Two Cursor Text Input", 0, 1, 1);
int testPhrase[PHRASE_SIZE]; // Holds the test phrase...
/* Write results to resultFile. */
void writeResults(SceUID resultFile, int testType, char* input, int time) {
int dataSize = 128;
char* data = malloc(dataSize);
sprintf(data, "%d\t%s\t%s%d\n", testType, testPhrase, input, time);
sceIoWrite(resultFile, data, dataSize);
free(data);
}
int* getTestPhrase() { return testPhrase; }
/* Reads the next test phrase from testFile and puts it in testPhrase. */
int readNextPhrase(SceUID testFile) {
int i = 0;
do {
i += sceIoRead(testFile, testPhrase+i, 1);
} while (i > 0 && testPhrase[i-1] != '\n');
testPhrase[i] = 0;
return i;
}
/* Run test with phrases from testFilName, write the results to resultFileName,
with either 1Cursor or 2Cursor testType. */
void runTest(const char* testFileName, const char* resultFileName, int testType) {
SceUID testFile = sceIoOpen(testFileName, PSP_O_RDONLY, 0777);
SceUID resultFile = sceIoOpen(resultFileName, PSP_O_APPEND, 0777);
SceSysTimerId timer = sceSTimerAlloc(); // Clock
int time; // Holds how long user took to input a phrase
char* input; // What the user inputted
int done = 0; // Return value of readNextPhrase
initControl(); // Initialize!
bzero(testPhrase, PHRASE_SIZE);
done = readNextPhrase(testFile); // Read test phrase
while (done != 0) {
sceSTimerStartCount(timer); // Start timer
input = parseInput(testType); // Get user input
sceSTimerStopCount(timer); // Stop timer
sceSTimerGetCount(timer, &time); // Get time
sceSTimerResetCount(timer); // Reset timer
writeResults(resultFile, testType, input, time); // Write results
bzero(testPhrase, PHRASE_SIZE); // Reset testPhrase
done = readNextPhrase(testFile); // Read new test phrase
}
sceIoWrite(resultFile, "\n\n", 2); // Add two lines to the file
// Cleanup
cleanControl();
sceSTimerFree(timer);
sceIoClose(testFile);
sceIoClose(resultFile);
}
I should add that none of this code is executed right at runtime. It goes to a menu first before it calls this. I don't know if that makes a difference...
Thank you,
L