Some minor bugfixes and stuff.

git-svn-id: http://svn.purei.org/purei/trunk@460 b36208d7-6611-0410-8bec-b1987f11c4a2
This commit is contained in:
jpd002 2009-01-11 02:35:27 +00:00
parent 4c05249b72
commit f4bd746de4
7 changed files with 31 additions and 2 deletions

View File

@ -101,6 +101,8 @@ void CLoadcore::LoadModule(uint32* args, uint32 argsSize, uint32* ret, uint32 re
//Load the module???
CLog::GetInstance().Print(LOG_NAME, "Request to load module '%s' received.\r\n", sModuleName);
m_bios.LoadAndStartModule(sModuleName, NULL, 0);
//This function returns something negative upon failure
ret[0] = 0x00000000;
}

View File

@ -64,6 +64,12 @@ void CSysclib::Invoke(CMIPS& context, unsigned int functionId)
reinterpret_cast<char*>(&m_ram[context.m_State.nGPR[CMIPS::A0].nV0])
));
break;
case 29:
context.m_State.nGPR[CMIPS::V0].nD0 = static_cast<int32>(__strncmp(
reinterpret_cast<char*>(&m_ram[context.m_State.nGPR[CMIPS::A0].nV0]),
reinterpret_cast<char*>(&m_ram[context.m_State.nGPR[CMIPS::A1].nV0]),
context.m_State.nGPR[CMIPS::A2].nD0));
break;
case 30:
context.m_State.nGPR[CMIPS::V0].nD0 = context.m_State.nGPR[CMIPS::A0].nD0;
__strncpy(
@ -114,6 +120,11 @@ void CSysclib::__strcpy(char* dst, const char* src)
strcpy(dst, src);
}
uint32 CSysclib::__strncmp(const char* s1, const char* s2, uint32 length)
{
return static_cast<uint32>(strncmp(s1, s2, length));
}
void CSysclib::__strncpy(char* dst, const char* src, unsigned int count)
{
strncpy(dst, src, count);

View File

@ -22,6 +22,7 @@ namespace Iop
uint32 __sprintf(CMIPS& context);
uint32 __strlen(const char*);
void __strcpy(char*, const char*);
uint32 __strncmp(const char*, const char*, uint32);
void __strncpy(char*, const char*, unsigned int);
uint32 __strtol(const char*, unsigned int);
uint8* m_ram;

View File

@ -1,7 +1,10 @@
#include "IsoDevice.h"
#include <algorithm>
#include <string>
using namespace Framework;
using namespace Iop::Ioman;
using namespace std;
CIsoDevice::CIsoDevice(CISO9660*& iso) :
m_iso(iso)
@ -14,9 +17,17 @@ CIsoDevice::~CIsoDevice()
}
char CIsoDevice::FixSlashes(char input)
{
if(input == '\\') return '/';
return input;
}
CStream* CIsoDevice::GetFile(uint32 mode, const char* devicePath)
{
if(mode != O_RDONLY) return NULL;
if(m_iso == NULL) return NULL;
return m_iso->Open(devicePath);
string fixedString(devicePath);
transform(fixedString.begin(), fixedString.end(), fixedString.begin(), &CIsoDevice::FixSlashes);
return m_iso->Open(fixedString.c_str());
}

View File

@ -16,6 +16,8 @@ namespace Iop
virtual Framework::CStream* GetFile(uint32, const char*);
private:
static char FixSlashes(char);
CISO9660*& m_iso;
};
}

Binary file not shown.

View File

@ -81,7 +81,9 @@ private:
void OnExecutableChangeMsg();
void OnExecutableUnloadingMsg();
HACCEL m_nAccTable;
void ImportOldenTagsFile(const char*, CMIPSTags&);
HACCEL m_nAccTable;
CELFView* m_pELFView;
CFunctionsView* m_pFunctionsView;