cfg,dynarecs,reios: use new logging
This commit is contained in:
parent
2c8094f987
commit
be5aca66e1
|
@ -21,7 +21,7 @@ void savecfgf()
|
|||
FILE* cfgfile = fopen(cfgPath.c_str(),"wt");
|
||||
if (!cfgfile)
|
||||
{
|
||||
printf("Error: Unable to open file '%s' for saving\n", cfgPath.c_str());
|
||||
WARN_LOG(COMMON, "Error: Unable to open file '%s' for saving", cfgPath.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -93,11 +93,11 @@ bool cfgOpen()
|
|||
{
|
||||
// Config file can't be opened
|
||||
int error_code = errno;
|
||||
printf("Warning: Unable to open the config file '%s' for reading (%s)\n", config_path_read.c_str(), strerror(error_code));
|
||||
WARN_LOG(COMMON, "Warning: Unable to open the config file '%s' for reading (%s)", config_path_read.c_str(), strerror(error_code));
|
||||
if (error_code == ENOENT || cfgPath != config_path_read)
|
||||
{
|
||||
// Config file didn't exist
|
||||
printf("Creating new empty config file at '%s'\n", cfgPath.c_str());
|
||||
INFO_LOG(COMMON, "Creating new empty config file at '%s'", cfgPath.c_str());
|
||||
savecfgf();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -49,19 +49,19 @@ int setconfig(wchar** arg,int cl)
|
|||
{
|
||||
if (cl<1)
|
||||
{
|
||||
printf("-config : invalid number of parameters, format is section:key=value\n");
|
||||
WARN_LOG(COMMON, "-config : invalid number of parameters, format is section:key=value");
|
||||
return rv;
|
||||
}
|
||||
wchar* sep=strstr(arg[1],":");
|
||||
if (sep==0)
|
||||
{
|
||||
printf("-config : invalid parameter %s, format is section:key=value\n",arg[1]);
|
||||
WARN_LOG(COMMON, "-config : invalid parameter %s, format is section:key=value", arg[1]);
|
||||
return rv;
|
||||
}
|
||||
wchar* value=strstr(sep+1,"=");
|
||||
if (value==0)
|
||||
{
|
||||
printf("-config : invalid parameter %s, format is section:key=value\n",arg[1]);
|
||||
WARN_LOG(COMMON, "-config : invalid parameter %s, format is section:key=value", arg[1]);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -74,14 +74,14 @@ int setconfig(wchar** arg,int cl)
|
|||
|
||||
if (sect==0 || key==0)
|
||||
{
|
||||
printf("-config : invalid parameter, format is section:key=value\n");
|
||||
WARN_LOG(COMMON, "-config : invalid parameter, format is section:key=value");
|
||||
return rv;
|
||||
}
|
||||
|
||||
const wchar* constval = value;
|
||||
if (constval==0)
|
||||
constval="";
|
||||
printf("Virtual cfg %s:%s=%s\n",sect,key,value);
|
||||
INFO_LOG(COMMON, "Virtual cfg %s:%s=%s", sect, key, value);
|
||||
|
||||
cfgSetVirtual(sect,key,value);
|
||||
rv++;
|
||||
|
@ -101,10 +101,10 @@ int setconfig(wchar** arg,int cl)
|
|||
|
||||
int showhelp(wchar** arg,int cl)
|
||||
{
|
||||
printf("\nAvailable commands :\n");
|
||||
NOTICE_LOG(COMMON, "Available commands:");
|
||||
|
||||
printf("-config section:key=value [, ..]: add a virtual config value\n Virtual config values won't be saved to the .cfg file\n unless a different value is written to em\nNote :\n You can specify many settings in the xx:yy=zz , gg:hh=jj , ...\n format.The spaces between the values and ',' are needed.\n");
|
||||
printf("\n-help: show help info\n");
|
||||
NOTICE_LOG(COMMON, "-config section:key=value [, ..]: add a virtual config value\n Virtual config values won't be saved to the .cfg file\n unless a different value is written to em\nNote :\n You can specify many settings in the xx:yy=zz , gg:hh=jj , ...\n format.The spaces between the values and ',' are needed.");
|
||||
NOTICE_LOG(COMMON, "-help: show help info");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -136,28 +136,27 @@ bool ParseCommandLine(int argc,wchar* argv[])
|
|||
|| stricmp(extension, ".gdi") == 0 || stricmp(extension, ".lst") == 0
|
||||
|| stricmp(extension, ".cue") == 0))
|
||||
{
|
||||
printf("Using '%s' as cd image\n", *arg);
|
||||
INFO_LOG(COMMON, "Using '%s' as cd image", *arg);
|
||||
cfgSetVirtual("config", "image", *arg);
|
||||
}
|
||||
else if (extension && stricmp(extension, ".elf") == 0)
|
||||
{
|
||||
printf("Using '%s' as reios elf file\n", *arg);
|
||||
INFO_LOG(COMMON, "Using '%s' as reios elf file", *arg);
|
||||
cfgSetVirtual("config", "reios.enabled", "1");
|
||||
cfgSetVirtual("reios", "ElfFile", *arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if DC_PLATFORM == DC_PLATFORM_NAOMI || DC_PLATFORM == DC_PLATFORM_ATOMISWAVE
|
||||
printf("Using '%s' as rom\n", *arg);
|
||||
INFO_LOG(COMMON, "Using '%s' as rom", *arg);
|
||||
cfgSetVirtual("config", "image", *arg);
|
||||
#else
|
||||
printf("wtf %s is supposed to do ?\n",*arg);
|
||||
WARN_LOG(COMMON, "wtf %s is supposed to do ?",*arg);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
arg++;
|
||||
cl--;
|
||||
}
|
||||
printf("\n");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -246,7 +246,7 @@ void ConfigFile::parse(FILE* file)
|
|||
|
||||
if (!separator)
|
||||
{
|
||||
printf("Malformed entry on config - ignoring @ %d(%s)\n",cline, tl);
|
||||
WARN_LOG(COMMON, "Malformed entry on config - ignoring @ %d(%s)", cline, tl);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ enum LOG_TYPE
|
|||
MODEM,
|
||||
NAOMI,
|
||||
PVR,
|
||||
REIOS,
|
||||
RENDERER,
|
||||
SAVESTATE,
|
||||
SH4,
|
||||
|
|
|
@ -93,7 +93,7 @@ LogManager::LogManager()
|
|||
// create log containers
|
||||
m_log[LogTypes::AICA] = {"AICA", "AICA Audio Emulation"};
|
||||
m_log[LogTypes::AICA_ARM] = {"AICA_ARM", "AICA ARM Emulation"};
|
||||
m_log[LogTypes::AUDIO] = {"Audio", "Audio Ouput Interface"};
|
||||
m_log[LogTypes::AUDIO] = {"AUDIO", "Audio Ouput Interface"};
|
||||
m_log[LogTypes::BOOT] = {"BOOT", "Boot"};
|
||||
m_log[LogTypes::COMMON] = {"COMMON", "Common"};
|
||||
m_log[LogTypes::DYNAREC] = {"DYNAREC", "Dynamic Recompiler"};
|
||||
|
@ -109,6 +109,7 @@ LogManager::LogManager()
|
|||
m_log[LogTypes::MODEM] = {"MODEM", "Modem and Network"};
|
||||
m_log[LogTypes::NAOMI] = {"NAOMI", "Naomi"};
|
||||
m_log[LogTypes::PVR] = {"PVR", "PowerVR GPU"};
|
||||
m_log[LogTypes::REIOS] = {"REIOS", "HLE BIOS"};
|
||||
m_log[LogTypes::RENDERER] = {"RENDERER", "OpenGL Renderer"};
|
||||
m_log[LogTypes::SAVESTATE] = {"SAVESTATE", "Save States"};
|
||||
m_log[LogTypes::SH4] = {"SH4", "SH4 Modules"};
|
||||
|
|
|
@ -335,7 +335,7 @@ u32 DynaRBI::Relink()
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("SLOW COND PATH %d\n", oplist.empty() ? -1 : oplist[oplist.size()-1].op);
|
||||
INFO_LOG(DYNAREC, "SLOW COND PATH %d", oplist.empty() ? -1 : oplist[oplist.size()-1].op);
|
||||
LoadSh4Reg_mem(r4, reg_sr_T);
|
||||
}
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ u32 DynaRBI::Relink()
|
|||
}
|
||||
|
||||
default:
|
||||
printf("Error, Relink() Block Type: %X\n", BlockType);
|
||||
ERROR_LOG(DYNAREC, "Error, Relink() Block Type: %X", BlockType);
|
||||
verify(false);
|
||||
break;
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ void ngen_Binary(shil_opcode* op, BinaryOP dtop, BinaryOPImm dtopimm)
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("ngen_Bin ??? %d \n",op->rs2.type);
|
||||
ERROR_LOG(DYNAREC, "ngen_Bin ??? %d", op->rs2.type);
|
||||
verify(false);
|
||||
}
|
||||
|
||||
|
@ -894,7 +894,7 @@ u32* ngen_readm_fail_v2(u32* ptrv,u32* regs,u32 fault_addr)
|
|||
|
||||
if (offs==-1)
|
||||
{
|
||||
printf("%08X : invalid size\n",ptr[0]);
|
||||
ERROR_LOG(DYNAREC, "%08X : invalid size", ptr[0]);
|
||||
die("can't decode opcode\n");
|
||||
}
|
||||
|
||||
|
@ -917,7 +917,7 @@ u32* ngen_readm_fail_v2(u32* ptrv,u32* regs,u32 fault_addr)
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("fail raddr %08X {@%08X}:(\n",ptr[0].full,regs[1]);
|
||||
ERROR_LOG(DYNAREC, "fail raddr %08X {@%08X}:(", ptr[0].full, regs[1]);
|
||||
die("Invalid opcode: vmem fixup\n");
|
||||
}
|
||||
//from mem op
|
||||
|
@ -1058,7 +1058,7 @@ eReg GenMemAddr(shil_opcode* op, eReg raddr = r0)
|
|||
}
|
||||
else if (!op->rs3.is_null())
|
||||
{
|
||||
printf("rs3: %08X\n",op->rs3.type);
|
||||
ERROR_LOG(DYNAREC, "rs3: %08X", op->rs3.type);
|
||||
die("invalid rs3");
|
||||
}
|
||||
else if (op->rs1.is_imm())
|
||||
|
@ -1679,7 +1679,7 @@ void ngen_compile_opcode(RuntimeBlockInfo* block, shil_opcode* op, bool staging,
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("ngen_Bin ??? %d \n",op->rs2.type);
|
||||
ERROR_LOG(DYNAREC, "ngen_Bin ??? %d", op->rs2.type);
|
||||
verify(false);
|
||||
}
|
||||
|
||||
|
@ -2186,7 +2186,7 @@ void ngen_compile_opcode(RuntimeBlockInfo* block, shil_opcode* op, bool staging,
|
|||
break;
|
||||
|
||||
__default:
|
||||
printf("@@\tError, Default case (0x%X) in ngen_CompileBlock!\n", op->op);
|
||||
ERROR_LOG(DYNAREC, "@@ Error, Default case (0x%X) in ngen_CompileBlock!", op->op);
|
||||
verify(false);
|
||||
break;
|
||||
}
|
||||
|
@ -2390,7 +2390,7 @@ void ngen_Compile(RuntimeBlockInfo* block, SmcCheckEnum smc_checks, bool reset,
|
|||
|
||||
void ngen_ResetBlocks()
|
||||
{
|
||||
printf("@@\tngen_ResetBlocks()\n");
|
||||
INFO_LOG(DYNAREC, "@@ ngen_ResetBlocks()");
|
||||
}
|
||||
/*
|
||||
SHR ..
|
||||
|
@ -2402,7 +2402,7 @@ void ngen_ResetBlocks()
|
|||
*/
|
||||
void ngen_init()
|
||||
{
|
||||
printf("Initializing the ARM32 dynarec\n");
|
||||
INFO_LOG(DYNAREC, "Initializing the ARM32 dynarec");
|
||||
verify(FPCB_OFFSET == -0x2100000 || FPCB_OFFSET == -0x4100000);
|
||||
verify(rcb_noffs(p_sh4rcb->fpcb) == FPCB_OFFSET);
|
||||
|
||||
|
@ -2472,7 +2472,7 @@ void ngen_init()
|
|||
BX(LR);
|
||||
}
|
||||
|
||||
printf("readm helpers: up to %08X\n",EMIT_GET_PTR());
|
||||
INFO_LOG(DYNAREC, "readm helpers: up to %08X", EMIT_GET_PTR());
|
||||
emit_SetBaseAddr();
|
||||
|
||||
|
||||
|
@ -2511,10 +2511,4 @@ RuntimeBlockInfo* ngen_AllocateBlock()
|
|||
{
|
||||
return new DynaRBI();
|
||||
};
|
||||
|
||||
void CacheFlush()
|
||||
{
|
||||
printf("Flushing cache from %08x to %08x\n", &CodeCache[0], &CodeCache[CODE_SIZE - 1]);
|
||||
//CacheFlush(&CodeCache[0], &CodeCache[CODE_SIZE - 1]);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -155,7 +155,7 @@ void ngen_mainloop(void* v_cntx)
|
|||
|
||||
void ngen_init()
|
||||
{
|
||||
LOGI("Initializing the ARM64 dynarec\n");
|
||||
INFO_LOG(DYNAREC, "Initializing the ARM64 dynarec");
|
||||
ngen_FailedToFindBlock = &ngen_FailedToFindBlock_nommu;
|
||||
}
|
||||
|
||||
|
@ -1396,7 +1396,7 @@ public:
|
|||
#if 0
|
||||
if (rewrite && block != NULL)
|
||||
{
|
||||
LOGI("BLOCK %08x\n", block->vaddr);
|
||||
INFO_LOG(DYNAREC, "BLOCK %08x", block->vaddr);
|
||||
Instruction* instr_start = (Instruction*)block->code;
|
||||
// Instruction* instr_end = GetLabelAddress<Instruction*>(&code_end);
|
||||
Instruction* instr_end = (Instruction*)((u8 *)block->code + block->host_code_size);
|
||||
|
@ -1406,7 +1406,7 @@ public:
|
|||
Instruction* instr;
|
||||
for (instr = instr_start; instr < instr_end; instr += kInstructionSize) {
|
||||
decoder.Decode(instr);
|
||||
LOGI("VIXL\t %p:\t%s\n",
|
||||
INFO_LOG(DYNAREC, "VIXL %p: %s",
|
||||
reinterpret_cast<void*>(instr),
|
||||
disasm.GetOutput());
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ RuntimeBlockInfo* ngen_AllocateBlock()
|
|||
}
|
||||
|
||||
static void ngen_blockcheckfail(u32 pc) {
|
||||
printf("REC CPP: SMC invalidation at %08X\n", pc);
|
||||
INFO_LOG(DYNAREC, "REC CPP: SMC invalidation at %08X", pc);
|
||||
rdv_BlockCheckFail(pc);
|
||||
}
|
||||
|
||||
|
@ -1100,7 +1100,7 @@ opcodeExec* createType(const CC_pars_t& prms, void* fun, shil_opcode* opcode) {
|
|||
if (!funs.count(fun)) {
|
||||
funs[fun] = funs_id_count++;
|
||||
|
||||
printf("DEFINE %s: FAST_po(%s)\n", getCTN(&createType<CTR>).c_str(), shil_opcode_name(opcode->op));
|
||||
INFO_LOG(DYNAREC, "DEFINE %s: FAST_po(%s)", getCTN(&createType<CTR>).c_str(), shil_opcode_name(opcode->op));
|
||||
}
|
||||
|
||||
typedef typename CTR::opex thetype;
|
||||
|
@ -1556,7 +1556,7 @@ public:
|
|||
ptrsg[opcode_index] = unmap[nm](CC_pars, ccfn, op);
|
||||
}
|
||||
else {
|
||||
printf("IMPLEMENT CC_CALL CLASS: %s\n", nm.c_str());
|
||||
INFO_LOG(DYNAREC, "IMPLEMENT CC_CALL CLASS: %s", nm.c_str());
|
||||
ptrsg[opcode_index] = new opcodeDie();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2246,14 +2246,14 @@ bool ngen_Rewrite(unat& host_pc, unat, unat)
|
|||
RuntimeBlockInfoPtr block = bm_GetBlock((void *)host_pc);
|
||||
if (block == NULL)
|
||||
{
|
||||
printf("ngen_Rewrite: Block at %p not found\n", (void *)host_pc);
|
||||
WARN_LOG(DYNAREC, "ngen_Rewrite: Block at %p not found", (void *)host_pc);
|
||||
return false;
|
||||
}
|
||||
u8 *code_ptr = (u8*)host_pc;
|
||||
auto it = block->memory_accesses.find(code_ptr);
|
||||
if (it == block->memory_accesses.end())
|
||||
{
|
||||
printf("ngen_Rewrite: memory access at %p not found (%lu entries)\n", code_ptr, block->memory_accesses.size());
|
||||
WARN_LOG(DYNAREC, "ngen_Rewrite: memory access at %p not found (%lu entries)", code_ptr, block->memory_accesses.size());
|
||||
return false;
|
||||
}
|
||||
u32 opid = it->second;
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
|
||||
#define SWAP32(a) ((((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | (((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff))
|
||||
|
||||
//#define debugf printf
|
||||
#define debugf(...)
|
||||
#define debugf(...) DEBUG_LOG(REIOS, __VA_ARGS__)
|
||||
|
||||
void GDROM_HLE_ReadSES(u32 addr)
|
||||
{
|
||||
|
@ -22,7 +21,7 @@ void GDROM_HLE_ReadSES(u32 addr)
|
|||
u32 ba = ReadMem32(addr + 8);
|
||||
u32 bb = ReadMem32(addr + 12);
|
||||
|
||||
printf("GDROM_HLE_ReadSES: doing nothing w/ %d, %d, %d, %d\n", s, b, ba, bb);
|
||||
INFO_LOG(REIOS, "GDROM_HLE_ReadSES: doing nothing w/ %d, %d, %d, %d", s, b, ba, bb);
|
||||
}
|
||||
void GDROM_HLE_ReadTOC(u32 Addr)
|
||||
{
|
||||
|
@ -32,7 +31,7 @@ void GDROM_HLE_ReadTOC(u32 Addr)
|
|||
u32* pDst = (u32*)GetMemPtr(b, 0);
|
||||
|
||||
//
|
||||
debugf("GDROM READ TOC : %X %X \n\n", s, b);
|
||||
debugf("GDROM READ TOC : %X %X", s, b);
|
||||
|
||||
libGDR_GetToc(pDst, s);
|
||||
|
||||
|
@ -97,7 +96,7 @@ void GDCC_HLE_GETSCD(u32 addr) {
|
|||
u32 b = ReadMem32(addr + 0x08);
|
||||
u32 u = ReadMem32(addr + 0x0C);
|
||||
|
||||
printf("GDROM: Doing nothing for GETSCD [0]=%d, [1]=%d, [2]=0x%08X, [3]=0x%08X\n", s, n, b, u);
|
||||
INFO_LOG(REIOS, "GDROM: Doing nothing for GETSCD [0]=%d, [1]=%d, [2]=0x%08X, [3]=0x%08X", s, n, b, u);
|
||||
}
|
||||
|
||||
#define r Sh4cntx.r
|
||||
|
@ -110,7 +109,7 @@ void GD_HLE_Command(u32 cc, u32 prm)
|
|||
switch(cc)
|
||||
{
|
||||
case GDCC_GETTOC:
|
||||
printf("GDROM:\t*FIXME* CMD GETTOC CC:%X PRM:%X\n",cc,prm);
|
||||
INFO_LOG(REIOS, "GDROM:\t*FIXME* CMD GETTOC CC:%X PRM:%X",cc,prm);
|
||||
break;
|
||||
|
||||
case GDCC_GETTOC2:
|
||||
|
@ -123,7 +122,7 @@ void GD_HLE_Command(u32 cc, u32 prm)
|
|||
break;
|
||||
|
||||
case GDCC_INIT:
|
||||
printf("GDROM:\tCMD INIT CC:%X PRM:%X\n",cc,prm);
|
||||
INFO_LOG(REIOS, "GDROM:\tCMD INIT CC:%X PRM:%X",cc,prm);
|
||||
break;
|
||||
|
||||
case GDCC_PIOREAD:
|
||||
|
@ -131,26 +130,26 @@ void GD_HLE_Command(u32 cc, u32 prm)
|
|||
break;
|
||||
|
||||
case GDCC_DMAREAD:
|
||||
debugf("GDROM:\tCMD DMAREAD CC:%X PRM:%X\n", cc, prm);
|
||||
debugf("GDROM:\tCMD DMAREAD CC:%X PRM:%X", cc, prm);
|
||||
GDROM_HLE_ReadDMA(r[5]);
|
||||
break;
|
||||
|
||||
|
||||
case GDCC_PLAY_SECTOR:
|
||||
printf("GDROM:\tCMD PLAYSEC? CC:%X PRM:%X\n",cc,prm);
|
||||
INFO_LOG(REIOS, "GDROM:\tCMD PLAYSEC? CC:%X PRM:%X",cc,prm);
|
||||
break;
|
||||
|
||||
case GDCC_RELEASE:
|
||||
printf("GDROM:\tCMD RELEASE? CC:%X PRM:%X\n",cc,prm);
|
||||
INFO_LOG(REIOS, "GDROM:\tCMD RELEASE? CC:%X PRM:%X",cc,prm);
|
||||
break;
|
||||
|
||||
case GDCC_STOP: printf("GDROM:\tCMD STOP CC:%X PRM:%X\n",cc,prm); break;
|
||||
case GDCC_SEEK: printf("GDROM:\tCMD SEEK CC:%X PRM:%X\n",cc,prm); break;
|
||||
case GDCC_PLAY: printf("GDROM:\tCMD PLAY CC:%X PRM:%X\n",cc,prm); break;
|
||||
case GDCC_PAUSE:printf("GDROM:\tCMD PAUSE CC:%X PRM:%X\n",cc,prm); break;
|
||||
case GDCC_STOP: INFO_LOG(REIOS, "GDROM:\tCMD STOP CC:%X PRM:%X",cc,prm); break;
|
||||
case GDCC_SEEK: INFO_LOG(REIOS, "GDROM:\tCMD SEEK CC:%X PRM:%X",cc,prm); break;
|
||||
case GDCC_PLAY: INFO_LOG(REIOS, "GDROM:\tCMD PLAY CC:%X PRM:%X",cc,prm); break;
|
||||
case GDCC_PAUSE:INFO_LOG(REIOS, "GDROM:\tCMD PAUSE CC:%X PRM:%X",cc,prm); break;
|
||||
|
||||
case GDCC_READ:
|
||||
printf("GDROM:\tCMD READ CC:%X PRM:%X\n",cc,prm);
|
||||
INFO_LOG(REIOS, "GDROM:\tCMD READ CC:%X PRM:%X",cc,prm);
|
||||
break;
|
||||
|
||||
case GDCC_GETSCD:
|
||||
|
@ -158,7 +157,7 @@ void GD_HLE_Command(u32 cc, u32 prm)
|
|||
GDCC_HLE_GETSCD(r[5]);
|
||||
break;
|
||||
|
||||
default: printf("GDROM:\tUnknown GDROM CC:%X PRM:%X\n",cc,prm); break;
|
||||
default: INFO_LOG(REIOS, "GDROM:\tUnknown GDROM CC:%X PRM:%X",cc,prm); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,8 +188,8 @@ void gdrom_hle_op()
|
|||
debugf("\nGDROM:\tHLE GDROM_MAIN\n");
|
||||
break;
|
||||
|
||||
case GDROM_INIT: printf("\nGDROM:\tHLE GDROM_INIT\n"); break;
|
||||
case GDROM_RESET: printf("\nGDROM:\tHLE GDROM_RESET\n"); break;
|
||||
case GDROM_INIT: INFO_LOG(REIOS, "GDROM:\tHLE GDROM_INIT"); break;
|
||||
case GDROM_RESET: INFO_LOG(REIOS, "GDROM:\tHLE GDROM_RESET"); break;
|
||||
|
||||
case GDROM_CHECK_DRIVE: //
|
||||
debugf("\nGDROM:\tHLE GDROM_CHECK_DRIVE r4:%X\n",r[4],r[5]);
|
||||
|
@ -200,25 +199,25 @@ void gdrom_hle_op()
|
|||
break;
|
||||
|
||||
case GDROM_ABORT_COMMAND: //
|
||||
printf("\nGDROM:\tHLE GDROM_ABORT_COMMAND r4:%X\n",r[4],r[5]);
|
||||
INFO_LOG(REIOS, "GDROM:\tHLE GDROM_ABORT_COMMAND r4:%X",r[4],r[5]);
|
||||
r[0]=-1; // RET FAILURE
|
||||
break;
|
||||
|
||||
|
||||
case GDROM_SECTOR_MODE: //
|
||||
printf("GDROM:\tHLE GDROM_SECTOR_MODE PTR_r4:%X\n",r[4]);
|
||||
INFO_LOG(REIOS, "GDROM:\tHLE GDROM_SECTOR_MODE PTR_r4:%X",r[4]);
|
||||
for(int i=0; i<4; i++) {
|
||||
SecMode[i] = ReadMem32(r[4]+(i<<2));
|
||||
printf("%08X%s",SecMode[i],((3==i) ? "\n" : "\t"));
|
||||
INFO_LOG(REIOS, "%08X", SecMode[i]);
|
||||
}
|
||||
r[0]=0; // RET SUCCESS
|
||||
break;
|
||||
|
||||
default: printf("\nGDROM:\tUnknown SYSCALL: %X\n",r[7]); break;
|
||||
default: INFO_LOG(REIOS, "GDROM:\tUnknown SYSCALL: %X",r[7]); break;
|
||||
}
|
||||
}
|
||||
else // MISC
|
||||
{
|
||||
printf("SYSCALL:\tSYSCALL: %X\n",r[7]);
|
||||
INFO_LOG(REIOS, "SYSCALL:\tSYSCALL: %X", r[7]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
|
||||
#include <map>
|
||||
|
||||
//#define debugf printf
|
||||
|
||||
#define debugf(...)
|
||||
#define debugf(...) DEBUG_LOG(REIOS, __VA_ARGS__)
|
||||
|
||||
#define dc_bios_syscall_system 0x8C0000B0
|
||||
#define dc_bios_syscall_font 0x8C0000B4
|
||||
|
@ -55,13 +53,13 @@ bool reios_locate_bootfile(const char* bootfile="1ST_READ.BIN") {
|
|||
libGDR_ReadSector(temp, base_fad + 16, 1, 2048);
|
||||
|
||||
if (memcmp(temp, "\001CD001\001", 7) == 0) {
|
||||
printf("reios: iso9660 PVD found\n");
|
||||
INFO_LOG(REIOS, "reios: iso9660 PVD found");
|
||||
u32 lba = read_u32bi(&temp[156 + 2]); //make sure to use big endian
|
||||
u32 len = read_u32bi(&temp[156 + 10]); //make sure to use big endian
|
||||
|
||||
data_len = ((len + 2047) / 2048) *2048;
|
||||
|
||||
printf("reios: iso9660 root_directory, FAD: %d, len: %d\n", 150 + lba, data_len);
|
||||
INFO_LOG(REIOS, "reios: iso9660 root_directory, FAD: %d, len: %d", 150 + lba, data_len);
|
||||
libGDR_ReadSector(temp, 150 + lba, data_len/2048, 2048);
|
||||
}
|
||||
else {
|
||||
|
@ -70,14 +68,14 @@ bool reios_locate_bootfile(const char* bootfile="1ST_READ.BIN") {
|
|||
|
||||
for (int i = 0; i < (data_len-20); i++) {
|
||||
if (memcmp(temp+i, bootfile, strlen(bootfile)) == 0){
|
||||
printf("Found %s at %06X\n", bootfile, i);
|
||||
INFO_LOG(REIOS, "Found %s at %06X", bootfile, i);
|
||||
|
||||
u32 lba = read_u32bi(&temp[i - 33 + 2]); //make sure to use big endian
|
||||
u32 len = read_u32bi(&temp[i - 33 + 10]); //make sure to use big endian
|
||||
|
||||
printf("filename len: %d\n", temp[i - 1]);
|
||||
printf("file LBA: %d\n", lba);
|
||||
printf("file LEN: %d\n", len);
|
||||
INFO_LOG(REIOS, "filename len: %d", temp[i - 1]);
|
||||
INFO_LOG(REIOS, "file LBA: %d", lba);
|
||||
INFO_LOG(REIOS, "file LEN: %d", len);
|
||||
|
||||
if (descrambl)
|
||||
descrambl_file(lba + 150, len, GetMemPtr(0x8c010000, 0));
|
||||
|
@ -168,7 +166,7 @@ void reios_sys_system() {
|
|||
|
||||
case 2: //SYSINFO_ICON
|
||||
{
|
||||
printf("SYSINFO_ICON\n");
|
||||
INFO_LOG(REIOS, "SYSINFO_ICON");
|
||||
/*
|
||||
r4 = icon number (0-9, but only 5-9 seems to really be icons)
|
||||
r5 = destination buffer (704 bytes in size)
|
||||
|
@ -187,13 +185,13 @@ void reios_sys_system() {
|
|||
break;
|
||||
|
||||
default:
|
||||
printf("unhandled: reios_sys_system\n");
|
||||
INFO_LOG(REIOS, "unhandled: reios_sys_system");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void reios_sys_font() {
|
||||
printf("reios_sys_font\n");
|
||||
INFO_LOG(REIOS, "reios_sys_font");
|
||||
}
|
||||
|
||||
void reios_sys_flashrom() {
|
||||
|
@ -305,7 +303,7 @@ void reios_sys_flashrom() {
|
|||
break;
|
||||
|
||||
default:
|
||||
printf("reios_sys_flashrom: not handled, %d\n", cmd);
|
||||
INFO_LOG(REIOS, "reios_sys_flashrom: not handled, %d", cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,7 +357,7 @@ void gd_do_bioscall()
|
|||
break;
|
||||
|
||||
default:
|
||||
printf("gd_do_bioscall: (%d) %d, %d, %d\n", Sh4cntx.r[4], Sh4cntx.r[5], Sh4cntx.r[6], Sh4cntx.r[7]);
|
||||
INFO_LOG(REIOS, "gd_do_bioscall: (%d) %d, %d, %d", Sh4cntx.r[4], Sh4cntx.r[5], Sh4cntx.r[6], Sh4cntx.r[7]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -367,7 +365,7 @@ void gd_do_bioscall()
|
|||
}
|
||||
|
||||
void reios_sys_misc() {
|
||||
printf("reios_sys_misc - r7: 0x%08X, r4 0x%08X, r5 0x%08X, r6 0x%08X\n", Sh4cntx.r[7], Sh4cntx.r[4], Sh4cntx.r[5], Sh4cntx.r[6]);
|
||||
INFO_LOG(REIOS, "reios_sys_misc - r7: 0x%08X, r4 0x%08X, r5 0x%08X, r6 0x%08X", Sh4cntx.r[7], Sh4cntx.r[4], Sh4cntx.r[5], Sh4cntx.r[6]);
|
||||
Sh4cntx.r[0] = 0;
|
||||
}
|
||||
|
||||
|
@ -574,9 +572,9 @@ void reios_setuo_naomi(u32 boot_addr) {
|
|||
sh4rcb.cntx.old_fpscr.full = 0x00040001;
|
||||
}
|
||||
void reios_boot() {
|
||||
printf("-----------------\n");
|
||||
printf("REIOS: Booting up\n");
|
||||
printf("-----------------\n");
|
||||
NOTICE_LOG(REIOS, "-----------------");
|
||||
NOTICE_LOG(REIOS, "REIOS: Booting up");
|
||||
NOTICE_LOG(REIOS, "-----------------");
|
||||
//setup syscalls
|
||||
//find boot file
|
||||
//boot it
|
||||
|
@ -609,7 +607,7 @@ void reios_boot() {
|
|||
verify(DC_PLATFORM == DC_PLATFORM_NAOMI);
|
||||
if (CurrentCartridge == NULL)
|
||||
{
|
||||
printf("No cartridge loaded\n");
|
||||
WARN_LOG(REIOS, "No cartridge loaded");
|
||||
return;
|
||||
}
|
||||
u32 data_size = 4;
|
||||
|
@ -657,7 +655,7 @@ u32 hook_addr(hook_fp* fn) {
|
|||
if (hooks_rev.count(fn))
|
||||
return hooks_rev[fn];
|
||||
else {
|
||||
printf("hook_addr: Failed to reverse lookup %p\n", fn);
|
||||
ERROR_LOG(REIOS, "hook_addr: Failed to reverse lookup %p", fn);
|
||||
verify(false);
|
||||
return 0;
|
||||
}
|
||||
|
@ -665,7 +663,7 @@ u32 hook_addr(hook_fp* fn) {
|
|||
|
||||
bool reios_init(u8* rom, u8* flash) {
|
||||
|
||||
printf("reios: Init\n");
|
||||
INFO_LOG(REIOS, "reios: Init");
|
||||
|
||||
biosrom = rom;
|
||||
flashrom = flash;
|
||||
|
|
Loading…
Reference in New Issue