PSPLINK 3.0 via USB (latest)
Eclipse 3.3 (Europa) using CDT plugin
PSP Slim 3.71 M33-2
PSPSDK (latest as of a few days ago)
So a debugging session begins in Eclipse and I can begin to step through the code (code listed at the bottom of this post). I step into the InitSnes9x() function and as soon as I attempt to step into ZeroMemory() the line stepping starts going screwy. It skips around lines in a somewhat random order and then periodically gets "back on track" and starts stepping through the code in an almost normal way (some lines will be skipped).
Since I'm still fairly new to PSP development I don't know if this is par for the course or if something else isn't functioning as it should. You can read the code in question below and you can read about my ambitions here: http://forums.ps2dev.org/viewtopic.php?t=9494 Just as an update I've been implementing the port specific functions for snes9x but I'm taking some time out now to start testing the progress I've made with simple system initialization.
Oh and this main.c file is a joke. I grabbed one of the templates from the SDK examples and plugged in code. I just wanted to see if I could make some wheels turn.
Code: Select all
#include <pspkernel.h>
#include <pspdebug.h>
#include "port.h"
#include "snes9x.h"
#include "memmap.h"
#include "controls.h"
#include "apu.h"
#define printf pspDebugScreenPrintf
void InitSnes9x();
/* Define the module info section */
PSP_MODULE_INFO("snes9xPSP", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
PSP_MAIN_THREAD_STACK_SIZE_KB(256);
int main(int argc, char *argv[])
{
pspDebugScreenInit();
pspDebugScreenPrintf("Starting up snes9x\n");
InitSnes9x();
return 0;
}
void InitSnes9x()
{
pspDebugScreenPrintf("Beginning initialization.\n");
ZeroMemory (&Settings, sizeof (Settings));
Settings.MouseMaster = TRUE;
Settings.SuperScopeMaster = TRUE;
Settings.MultiPlayer5Master = TRUE;
Settings.JustifierMaster = TRUE;
Settings.ShutdownMaster = FALSE;
Settings.BlockInvalidVRAMAccess = TRUE;
Settings.HDMATimingHack = 100;
Settings.APUEnabled = TRUE;
Settings.NextAPUEnabled = TRUE;
Settings.SoundPlaybackRate = 32000;
Settings.Stereo = TRUE;
Settings.SixteenBitSound = TRUE;
Settings.SoundEnvelopeHeightReading = TRUE;
Settings.DisableSampleCaching = TRUE;
Settings.InterpolatedSound = TRUE;
Settings.Transparency = TRUE;
Settings.SupportHiRes = TRUE;
Settings.SDD1Pack = TRUE;
if(!Memory.Init())
{
pspDebugScreenPrintf("Failed to initialize memory.\n");
}
else
{
pspDebugScreenPrintf("Memory Initialized!\n");
}
S9xUnmapAllControls();
}
void DeInitSnes9x()
{
Memory.Deinit();
S9xGraphicsDeinit();
S9xDeinitAPU();
}