summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2014-12-12 23:20:01 -0500
committerGravatar bunnei2014-12-12 23:20:01 -0500
commitaf1cd769e7b407af71496e788e218add31f8b2b0 (patch)
tree1e3fd71256c04a15970b09abd3f7280f8b1ff678 /src/core
parentMerge pull request #267 from bunnei/apt-shared-font (diff)
parentRemove old logging system (diff)
downloadyuzu-af1cd769e7b407af71496e788e218add31f8b2b0.tar.gz
yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.tar.xz
yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.zip
Merge pull request #258 from yuriks/log-ng
New logging system
Diffstat (limited to 'src/core')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp200
-rw-r--r--src/core/arm/interpreter/armemu.cpp4
-rw-r--r--src/core/arm/interpreter/armsupp.cpp8
-rw-r--r--src/core/arm/interpreter/thumbemu.cpp2
-rw-r--r--src/core/arm/skyeye_common/armemu.h4
-rw-r--r--src/core/core.cpp4
-rw-r--r--src/core/core_timing.cpp8
-rw-r--r--src/core/file_sys/archive.h12
-rw-r--r--src/core/file_sys/archive_romfs.cpp18
-rw-r--r--src/core/file_sys/archive_sdmc.cpp18
-rw-r--r--src/core/file_sys/directory_sdmc.cpp2
-rw-r--r--src/core/file_sys/file_sdmc.cpp2
-rw-r--r--src/core/hle/config_mem.cpp3
-rw-r--r--src/core/hle/hle.cpp12
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp8
-rw-r--r--src/core/hle/kernel/archive.cpp50
-rw-r--r--src/core/hle/kernel/kernel.cpp8
-rw-r--r--src/core/hle/kernel/kernel.h17
-rw-r--r--src/core/hle/kernel/shared_memory.cpp10
-rw-r--r--src/core/hle/kernel/thread.cpp24
-rw-r--r--src/core/hle/service/ac_u.cpp2
-rw-r--r--src/core/hle/service/apt_u.cpp20
-rw-r--r--src/core/hle/service/cfg_u.cpp6
-rw-r--r--src/core/hle/service/dsp_dsp.cpp14
-rw-r--r--src/core/hle/service/fs_user.cpp54
-rw-r--r--src/core/hle/service/gsp_gpu.cpp18
-rw-r--r--src/core/hle/service/hid_user.cpp2
-rw-r--r--src/core/hle/service/ptm_u.cpp8
-rw-r--r--src/core/hle/service/service.cpp4
-rw-r--r--src/core/hle/service/service.h8
-rw-r--r--src/core/hle/service/srv.cpp8
-rw-r--r--src/core/hle/svc.cpp54
-rw-r--r--src/core/hw/gpu.cpp16
-rw-r--r--src/core/hw/hw.cpp8
-rw-r--r--src/core/loader/3dsx.cpp14
-rw-r--r--src/core/loader/elf.cpp16
-rw-r--r--src/core/loader/loader.cpp6
-rw-r--r--src/core/loader/ncch.cpp34
-rw-r--r--src/core/mem_map.cpp4
-rw-r--r--src/core/mem_map_funcs.cpp12
-rw-r--r--src/core/settings.h4
41 files changed, 340 insertions, 386 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index 233cd3e3a..68012bffd 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -433,9 +433,7 @@ typedef struct _ldst_inst {
433 unsigned int inst; 433 unsigned int inst;
434 get_addr_fp_t get_addr; 434 get_addr_fp_t get_addr;
435} ldst_inst; 435} ldst_inst;
436#define DEBUG_MSG DEBUG_LOG(ARM11, "in %s %d\n", __FUNCTION__, __LINE__); \ 436#define DEBUG_MSG LOG_DEBUG(Core_ARM11, "inst is %x", inst); CITRA_IGNORE_EXIT(0)
437 DEBUG_LOG(ARM11, "inst is %x\n", inst); \
438 CITRA_IGNORE_EXIT(0)
439 437
440int CondPassed(arm_processor *cpu, unsigned int cond); 438int CondPassed(arm_processor *cpu, unsigned int cond);
441#define LnSWoUB(s) glue(LnSWoUB, s) 439#define LnSWoUB(s) glue(LnSWoUB, s)
@@ -1423,7 +1421,7 @@ inline void *AllocBuffer(unsigned int size)
1423 int start = top; 1421 int start = top;
1424 top += size; 1422 top += size;
1425 if (top > CACHE_BUFFER_SIZE) { 1423 if (top > CACHE_BUFFER_SIZE) {
1426 DEBUG_LOG(ARM11, "inst_buf is full\n"); 1424 LOG_ERROR(Core_ARM11, "inst_buf is full");
1427 CITRA_IGNORE_EXIT(-1); 1425 CITRA_IGNORE_EXIT(-1);
1428 } 1426 }
1429 return (void *)&inst_buf[start]; 1427 return (void *)&inst_buf[start];
@@ -1609,6 +1607,10 @@ get_addr_fp_t get_calc_addr_op(unsigned int inst)
1609#define CHECK_RM (inst_cream->Rm == 15) 1607#define CHECK_RM (inst_cream->Rm == 15)
1610#define CHECK_RS (inst_cream->Rs == 15) 1608#define CHECK_RS (inst_cream->Rs == 15)
1611 1609
1610#define UNIMPLEMENTED_INSTRUCTION(mnemonic) \
1611 LOG_ERROR(Core_ARM11, "unimplemented instruction: %s", mnemonic); \
1612 CITRA_IGNORE_EXIT(-1); \
1613 return nullptr;
1612 1614
1613ARM_INST_PTR INTERPRETER_TRANSLATE(adc)(unsigned int inst, int index) 1615ARM_INST_PTR INTERPRETER_TRANSLATE(adc)(unsigned int inst, int index)
1614{ 1616{
@@ -1723,7 +1725,7 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(bic)(unsigned int inst, int index)
1723 inst_base->br = INDIRECT_BRANCH; 1725 inst_base->br = INDIRECT_BRANCH;
1724 return inst_base; 1726 return inst_base;
1725} 1727}
1726ARM_INST_PTR INTERPRETER_TRANSLATE(bkpt)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 1728ARM_INST_PTR INTERPRETER_TRANSLATE(bkpt)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("BKPT"); }
1727ARM_INST_PTR INTERPRETER_TRANSLATE(blx)(unsigned int inst, int index) 1729ARM_INST_PTR INTERPRETER_TRANSLATE(blx)(unsigned int inst, int index)
1728{ 1730{
1729 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(blx_inst)); 1731 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(blx_inst));
@@ -1758,7 +1760,7 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(bx)(unsigned int inst, int index)
1758 1760
1759 return inst_base; 1761 return inst_base;
1760} 1762}
1761ARM_INST_PTR INTERPRETER_TRANSLATE(bxj)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 1763ARM_INST_PTR INTERPRETER_TRANSLATE(bxj)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("BXJ"); }
1762ARM_INST_PTR INTERPRETER_TRANSLATE(cdp)(unsigned int inst, int index){ 1764ARM_INST_PTR INTERPRETER_TRANSLATE(cdp)(unsigned int inst, int index){
1763 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cdp_inst)); 1765 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(cdp_inst));
1764 cdp_inst *inst_cream = (cdp_inst *)inst_base->component; 1766 cdp_inst *inst_cream = (cdp_inst *)inst_base->component;
@@ -1775,7 +1777,7 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(cdp)(unsigned int inst, int index){
1775 inst_cream->opcode_1 = BITS(inst, 20, 23); 1777 inst_cream->opcode_1 = BITS(inst, 20, 23);
1776 inst_cream->inst = inst; 1778 inst_cream->inst = inst;
1777 1779
1778 DEBUG_LOG(ARM11, "in func %s inst %x index %x\n", __FUNCTION__, inst, index); 1780 LOG_TRACE(Core_ARM11, "inst %x index %x", inst, index);
1779 return inst_base; 1781 return inst_base;
1780} 1782}
1781ARM_INST_PTR INTERPRETER_TRANSLATE(clrex)(unsigned int inst, int index) 1783ARM_INST_PTR INTERPRETER_TRANSLATE(clrex)(unsigned int inst, int index)
@@ -2205,7 +2207,7 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mcr)(unsigned int inst, int index)
2205 inst_cream->inst = inst; 2207 inst_cream->inst = inst;
2206 return inst_base; 2208 return inst_base;
2207} 2209}
2208ARM_INST_PTR INTERPRETER_TRANSLATE(mcrr)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2210ARM_INST_PTR INTERPRETER_TRANSLATE(mcrr)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("MCRR"); }
2209ARM_INST_PTR INTERPRETER_TRANSLATE(mla)(unsigned int inst, int index) 2211ARM_INST_PTR INTERPRETER_TRANSLATE(mla)(unsigned int inst, int index)
2210{ 2212{
2211 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mla_inst)); 2213 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mla_inst));
@@ -2264,7 +2266,7 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(mrc)(unsigned int inst, int index)
2264 inst_cream->inst = inst; 2266 inst_cream->inst = inst;
2265 return inst_base; 2267 return inst_base;
2266} 2268}
2267ARM_INST_PTR INTERPRETER_TRANSLATE(mrrc)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2269ARM_INST_PTR INTERPRETER_TRANSLATE(mrrc)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("MRRC"); }
2268ARM_INST_PTR INTERPRETER_TRANSLATE(mrs)(unsigned int inst, int index) 2270ARM_INST_PTR INTERPRETER_TRANSLATE(mrs)(unsigned int inst, int index)
2269{ 2271{
2270 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mrs_inst)); 2272 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(mrs_inst));
@@ -2358,8 +2360,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(orr)(unsigned int inst, int index)
2358 } 2360 }
2359 return inst_base; 2361 return inst_base;
2360} 2362}
2361ARM_INST_PTR INTERPRETER_TRANSLATE(pkhbt)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2363ARM_INST_PTR INTERPRETER_TRANSLATE(pkhbt)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("PKHBT"); }
2362ARM_INST_PTR INTERPRETER_TRANSLATE(pkhtb)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2364ARM_INST_PTR INTERPRETER_TRANSLATE(pkhtb)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("PKHTB"); }
2363ARM_INST_PTR INTERPRETER_TRANSLATE(pld)(unsigned int inst, int index) 2365ARM_INST_PTR INTERPRETER_TRANSLATE(pld)(unsigned int inst, int index)
2364{ 2366{
2365 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(pld_inst)); 2367 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(pld_inst));
@@ -2371,16 +2373,16 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(pld)(unsigned int inst, int index)
2371 2373
2372 return inst_base; 2374 return inst_base;
2373} 2375}
2374ARM_INST_PTR INTERPRETER_TRANSLATE(qadd)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2376ARM_INST_PTR INTERPRETER_TRANSLATE(qadd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD"); }
2375ARM_INST_PTR INTERPRETER_TRANSLATE(qadd16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2377ARM_INST_PTR INTERPRETER_TRANSLATE(qadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD16"); }
2376ARM_INST_PTR INTERPRETER_TRANSLATE(qadd8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2378ARM_INST_PTR INTERPRETER_TRANSLATE(qadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADD8"); }
2377ARM_INST_PTR INTERPRETER_TRANSLATE(qaddsubx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2379ARM_INST_PTR INTERPRETER_TRANSLATE(qaddsubx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QADDSUBX"); }
2378ARM_INST_PTR INTERPRETER_TRANSLATE(qdadd)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2380ARM_INST_PTR INTERPRETER_TRANSLATE(qdadd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QDADD"); }
2379ARM_INST_PTR INTERPRETER_TRANSLATE(qdsub)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2381ARM_INST_PTR INTERPRETER_TRANSLATE(qdsub)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QDSUB"); }
2380ARM_INST_PTR INTERPRETER_TRANSLATE(qsub)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2382ARM_INST_PTR INTERPRETER_TRANSLATE(qsub)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB"); }
2381ARM_INST_PTR INTERPRETER_TRANSLATE(qsub16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2383ARM_INST_PTR INTERPRETER_TRANSLATE(qsub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB16"); }
2382ARM_INST_PTR INTERPRETER_TRANSLATE(qsub8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2384ARM_INST_PTR INTERPRETER_TRANSLATE(qsub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUB8"); }
2383ARM_INST_PTR INTERPRETER_TRANSLATE(qsubaddx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2385ARM_INST_PTR INTERPRETER_TRANSLATE(qsubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("QSUBADDX"); }
2384ARM_INST_PTR INTERPRETER_TRANSLATE(rev)(unsigned int inst, int index) 2386ARM_INST_PTR INTERPRETER_TRANSLATE(rev)(unsigned int inst, int index)
2385{ 2387{
2386 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rev_inst)); 2388 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rev_inst));
@@ -2410,8 +2412,8 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(rev16)(unsigned int inst, int index){
2410 2412
2411 return inst_base; 2413 return inst_base;
2412} 2414}
2413ARM_INST_PTR INTERPRETER_TRANSLATE(revsh)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2415ARM_INST_PTR INTERPRETER_TRANSLATE(revsh)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("REVSH"); }
2414ARM_INST_PTR INTERPRETER_TRANSLATE(rfe)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2416ARM_INST_PTR INTERPRETER_TRANSLATE(rfe)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("RFE"); }
2415ARM_INST_PTR INTERPRETER_TRANSLATE(rsb)(unsigned int inst, int index) 2417ARM_INST_PTR INTERPRETER_TRANSLATE(rsb)(unsigned int inst, int index)
2416{ 2418{
2417 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsb_inst)); 2419 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(rsb_inst));
@@ -2460,9 +2462,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(rsc)(unsigned int inst, int index)
2460 } 2462 }
2461 return inst_base; 2463 return inst_base;
2462} 2464}
2463ARM_INST_PTR INTERPRETER_TRANSLATE(sadd16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2465ARM_INST_PTR INTERPRETER_TRANSLATE(sadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SADD16"); }
2464ARM_INST_PTR INTERPRETER_TRANSLATE(sadd8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2466ARM_INST_PTR INTERPRETER_TRANSLATE(sadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SADD8"); }
2465ARM_INST_PTR INTERPRETER_TRANSLATE(saddsubx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2467ARM_INST_PTR INTERPRETER_TRANSLATE(saddsubx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SADDSUBX"); }
2466ARM_INST_PTR INTERPRETER_TRANSLATE(sbc)(unsigned int inst, int index) 2468ARM_INST_PTR INTERPRETER_TRANSLATE(sbc)(unsigned int inst, int index)
2467{ 2469{
2468 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sbc_inst)); 2470 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sbc_inst));
@@ -2487,14 +2489,14 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sbc)(unsigned int inst, int index)
2487 } 2489 }
2488 return inst_base; 2490 return inst_base;
2489} 2491}
2490ARM_INST_PTR INTERPRETER_TRANSLATE(sel)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2492ARM_INST_PTR INTERPRETER_TRANSLATE(sel)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SEL"); }
2491ARM_INST_PTR INTERPRETER_TRANSLATE(setend)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2493ARM_INST_PTR INTERPRETER_TRANSLATE(setend)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SETEND"); }
2492ARM_INST_PTR INTERPRETER_TRANSLATE(shadd16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2494ARM_INST_PTR INTERPRETER_TRANSLATE(shadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHADD16"); }
2493ARM_INST_PTR INTERPRETER_TRANSLATE(shadd8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2495ARM_INST_PTR INTERPRETER_TRANSLATE(shadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHADD8"); }
2494ARM_INST_PTR INTERPRETER_TRANSLATE(shaddsubx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2496ARM_INST_PTR INTERPRETER_TRANSLATE(shaddsubx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHADDSUBX"); }
2495ARM_INST_PTR INTERPRETER_TRANSLATE(shsub16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2497ARM_INST_PTR INTERPRETER_TRANSLATE(shsub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHSUB16"); }
2496ARM_INST_PTR INTERPRETER_TRANSLATE(shsub8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2498ARM_INST_PTR INTERPRETER_TRANSLATE(shsub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHSUB8"); }
2497ARM_INST_PTR INTERPRETER_TRANSLATE(shsubaddx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2499ARM_INST_PTR INTERPRETER_TRANSLATE(shsubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SHSUBADDX"); }
2498ARM_INST_PTR INTERPRETER_TRANSLATE(smla)(unsigned int inst, int index) 2500ARM_INST_PTR INTERPRETER_TRANSLATE(smla)(unsigned int inst, int index)
2499{ 2501{
2500 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smla_inst)); 2502 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smla_inst));
@@ -2553,15 +2555,15 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(smlal)(unsigned int inst, int index)
2553 inst_base->load_r15 = 1; 2555 inst_base->load_r15 = 1;
2554 return inst_base; 2556 return inst_base;
2555} 2557}
2556ARM_INST_PTR INTERPRETER_TRANSLATE(smlalxy)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2558ARM_INST_PTR INTERPRETER_TRANSLATE(smlalxy)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMLALXY"); }
2557ARM_INST_PTR INTERPRETER_TRANSLATE(smlald)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2559ARM_INST_PTR INTERPRETER_TRANSLATE(smlald)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMLALD"); }
2558ARM_INST_PTR INTERPRETER_TRANSLATE(smlaw)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2560ARM_INST_PTR INTERPRETER_TRANSLATE(smlaw)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMLAW"); }
2559ARM_INST_PTR INTERPRETER_TRANSLATE(smlsd)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2561ARM_INST_PTR INTERPRETER_TRANSLATE(smlsd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMLSD"); }
2560ARM_INST_PTR INTERPRETER_TRANSLATE(smlsld)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2562ARM_INST_PTR INTERPRETER_TRANSLATE(smlsld)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMLSLD"); }
2561ARM_INST_PTR INTERPRETER_TRANSLATE(smmla)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2563ARM_INST_PTR INTERPRETER_TRANSLATE(smmla)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMMLA"); }
2562ARM_INST_PTR INTERPRETER_TRANSLATE(smmls)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2564ARM_INST_PTR INTERPRETER_TRANSLATE(smmls)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMMLS"); }
2563ARM_INST_PTR INTERPRETER_TRANSLATE(smmul)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2565ARM_INST_PTR INTERPRETER_TRANSLATE(smmul)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMMUL"); }
2564ARM_INST_PTR INTERPRETER_TRANSLATE(smuad)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2566ARM_INST_PTR INTERPRETER_TRANSLATE(smuad)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMUAD"); }
2565ARM_INST_PTR INTERPRETER_TRANSLATE(smul)(unsigned int inst, int index) 2567ARM_INST_PTR INTERPRETER_TRANSLATE(smul)(unsigned int inst, int index)
2566{ 2568{
2567 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smul_inst)); 2569 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(smul_inst));
@@ -2624,13 +2626,13 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(smulw)(unsigned int inst, int index)
2624 inst_base->load_r15 = 1; 2626 inst_base->load_r15 = 1;
2625 return inst_base; 2627 return inst_base;
2626} 2628}
2627ARM_INST_PTR INTERPRETER_TRANSLATE(smusd)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2629ARM_INST_PTR INTERPRETER_TRANSLATE(smusd)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SMUSD"); }
2628ARM_INST_PTR INTERPRETER_TRANSLATE(srs)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2630ARM_INST_PTR INTERPRETER_TRANSLATE(srs)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SRS"); }
2629ARM_INST_PTR INTERPRETER_TRANSLATE(ssat)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2631ARM_INST_PTR INTERPRETER_TRANSLATE(ssat)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SSAT"); }
2630ARM_INST_PTR INTERPRETER_TRANSLATE(ssat16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2632ARM_INST_PTR INTERPRETER_TRANSLATE(ssat16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SSAT16"); }
2631ARM_INST_PTR INTERPRETER_TRANSLATE(ssub16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2633ARM_INST_PTR INTERPRETER_TRANSLATE(ssub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SSUB16"); }
2632ARM_INST_PTR INTERPRETER_TRANSLATE(ssub8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2634ARM_INST_PTR INTERPRETER_TRANSLATE(ssub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SSUB8"); }
2633ARM_INST_PTR INTERPRETER_TRANSLATE(ssubaddx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2635ARM_INST_PTR INTERPRETER_TRANSLATE(ssubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SSUBADDX"); }
2634ARM_INST_PTR INTERPRETER_TRANSLATE(stc)(unsigned int inst, int index) 2636ARM_INST_PTR INTERPRETER_TRANSLATE(stc)(unsigned int inst, int index)
2635{ 2637{
2636 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(stc_inst)); 2638 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(stc_inst));
@@ -2937,9 +2939,9 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sxtab)(unsigned int inst, int index){
2937 2939
2938 return inst_base; 2940 return inst_base;
2939} 2941}
2940ARM_INST_PTR INTERPRETER_TRANSLATE(sxtab16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2942ARM_INST_PTR INTERPRETER_TRANSLATE(sxtab16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SXTAB16"); }
2941ARM_INST_PTR INTERPRETER_TRANSLATE(sxtah)(unsigned int inst, int index){ 2943ARM_INST_PTR INTERPRETER_TRANSLATE(sxtah)(unsigned int inst, int index){
2942 DEBUG_LOG(ARM11, "in func %s, SXTAH untested\n", __func__); 2944 LOG_WARNING(Core_ARM11, "SXTAH untested");
2943 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sxtah_inst)); 2945 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(sxtah_inst));
2944 sxtah_inst *inst_cream = (sxtah_inst *)inst_base->component; 2946 sxtah_inst *inst_cream = (sxtah_inst *)inst_base->component;
2945 2947
@@ -2955,7 +2957,7 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(sxtah)(unsigned int inst, int index){
2955 2957
2956 return inst_base; 2958 return inst_base;
2957} 2959}
2958ARM_INST_PTR INTERPRETER_TRANSLATE(sxtb16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 2960ARM_INST_PTR INTERPRETER_TRANSLATE(sxtb16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("SXTB16"); }
2959ARM_INST_PTR INTERPRETER_TRANSLATE(teq)(unsigned int inst, int index) 2961ARM_INST_PTR INTERPRETER_TRANSLATE(teq)(unsigned int inst, int index)
2960{ 2962{
2961 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(teq_inst)); 2963 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(teq_inst));
@@ -2999,16 +3001,16 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(tst)(unsigned int inst, int index)
2999 inst_base->load_r15 = 1; 3001 inst_base->load_r15 = 1;
3000 return inst_base; 3002 return inst_base;
3001} 3003}
3002ARM_INST_PTR INTERPRETER_TRANSLATE(uadd16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3004ARM_INST_PTR INTERPRETER_TRANSLATE(uadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UADD16"); }
3003ARM_INST_PTR INTERPRETER_TRANSLATE(uadd8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3005ARM_INST_PTR INTERPRETER_TRANSLATE(uadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UADD8"); }
3004ARM_INST_PTR INTERPRETER_TRANSLATE(uaddsubx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3006ARM_INST_PTR INTERPRETER_TRANSLATE(uaddsubx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UADDSUBX"); }
3005ARM_INST_PTR INTERPRETER_TRANSLATE(uhadd16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3007ARM_INST_PTR INTERPRETER_TRANSLATE(uhadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UHADD16"); }
3006ARM_INST_PTR INTERPRETER_TRANSLATE(uhadd8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3008ARM_INST_PTR INTERPRETER_TRANSLATE(uhadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UHADD8"); }
3007ARM_INST_PTR INTERPRETER_TRANSLATE(uhaddsubx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3009ARM_INST_PTR INTERPRETER_TRANSLATE(uhaddsubx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UHADDSUBX"); }
3008ARM_INST_PTR INTERPRETER_TRANSLATE(uhsub16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3010ARM_INST_PTR INTERPRETER_TRANSLATE(uhsub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UHSUB16"); }
3009ARM_INST_PTR INTERPRETER_TRANSLATE(uhsub8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3011ARM_INST_PTR INTERPRETER_TRANSLATE(uhsub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UHSUB8"); }
3010ARM_INST_PTR INTERPRETER_TRANSLATE(uhsubaddx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3012ARM_INST_PTR INTERPRETER_TRANSLATE(uhsubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UHSUBADDX"); }
3011ARM_INST_PTR INTERPRETER_TRANSLATE(umaal)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3013ARM_INST_PTR INTERPRETER_TRANSLATE(umaal)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UMAAL"); }
3012ARM_INST_PTR INTERPRETER_TRANSLATE(umlal)(unsigned int inst, int index) 3014ARM_INST_PTR INTERPRETER_TRANSLATE(umlal)(unsigned int inst, int index)
3013{ 3015{
3014 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umlal_inst)); 3016 arm_inst *inst_base = (arm_inst *)AllocBuffer(sizeof(arm_inst) + sizeof(umlal_inst));
@@ -3111,21 +3113,21 @@ ARM_INST_PTR INTERPRETER_TRANSLATE(blx_1_thumb)(unsigned int tinst, int index)
3111 return inst_base; 3113 return inst_base;
3112} 3114}
3113 3115
3114ARM_INST_PTR INTERPRETER_TRANSLATE(uqadd16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3116ARM_INST_PTR INTERPRETER_TRANSLATE(uqadd16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UQADD16"); }
3115ARM_INST_PTR INTERPRETER_TRANSLATE(uqadd8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3117ARM_INST_PTR INTERPRETER_TRANSLATE(uqadd8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UQADD8"); }
3116ARM_INST_PTR INTERPRETER_TRANSLATE(uqaddsubx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3118ARM_INST_PTR INTERPRETER_TRANSLATE(uqaddsubx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UQADDSUBX"); }
3117ARM_INST_PTR INTERPRETER_TRANSLATE(uqsub16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3119ARM_INST_PTR INTERPRETER_TRANSLATE(uqsub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UQSUB16"); }
3118ARM_INST_PTR INTERPRETER_TRANSLATE(uqsub8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3120ARM_INST_PTR INTERPRETER_TRANSLATE(uqsub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UQSUB8"); }
3119ARM_INST_PTR INTERPRETER_TRANSLATE(uqsubaddx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3121ARM_INST_PTR INTERPRETER_TRANSLATE(uqsubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UQSUBADDX"); }
3120ARM_INST_PTR INTERPRETER_TRANSLATE(usad8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3122ARM_INST_PTR INTERPRETER_TRANSLATE(usad8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USAD8"); }
3121ARM_INST_PTR INTERPRETER_TRANSLATE(usada8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3123ARM_INST_PTR INTERPRETER_TRANSLATE(usada8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USADA8"); }
3122ARM_INST_PTR INTERPRETER_TRANSLATE(usat)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3124ARM_INST_PTR INTERPRETER_TRANSLATE(usat)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USAT"); }
3123ARM_INST_PTR INTERPRETER_TRANSLATE(usat16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3125ARM_INST_PTR INTERPRETER_TRANSLATE(usat16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USAT16"); }
3124ARM_INST_PTR INTERPRETER_TRANSLATE(usub16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3126ARM_INST_PTR INTERPRETER_TRANSLATE(usub16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUB16"); }
3125ARM_INST_PTR INTERPRETER_TRANSLATE(usub8)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3127ARM_INST_PTR INTERPRETER_TRANSLATE(usub8)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUB8"); }
3126ARM_INST_PTR INTERPRETER_TRANSLATE(usubaddx)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3128ARM_INST_PTR INTERPRETER_TRANSLATE(usubaddx)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("USUBADDX"); }
3127ARM_INST_PTR INTERPRETER_TRANSLATE(uxtab16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3129ARM_INST_PTR INTERPRETER_TRANSLATE(uxtab16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UXTAB16"); }
3128ARM_INST_PTR INTERPRETER_TRANSLATE(uxtb16)(unsigned int inst, int index){DEBUG_LOG(ARM11, "in func %s\n", __FUNCTION__);CITRA_IGNORE_EXIT(-1); return nullptr;} 3130ARM_INST_PTR INTERPRETER_TRANSLATE(uxtb16)(unsigned int inst, int index) { UNIMPLEMENTED_INSTRUCTION("UXTB16"); }
3129 3131
3130 3132
3131 3133
@@ -3391,7 +3393,7 @@ static tdstate decode_thumb_instr(arm_processor *cpu, uint32_t inst, addr_t addr
3391 } 3393 }
3392 else{ 3394 else{
3393 /* something wrong */ 3395 /* something wrong */
3394 DEBUG_LOG(ARM11, "In %s, thumb decoder error\n", __FUNCTION__); 3396 LOG_ERROR(Core_ARM11, "thumb decoder error");
3395 } 3397 }
3396 break; 3398 break;
3397 case 28: 3399 case 28:
@@ -3599,7 +3601,7 @@ int InterpreterTranslate(arm_processor *cpu, int &bb_start, addr_t addr)
3599 bank->bank_read(32, phys_addr, &inst); 3601 bank->bank_read(32, phys_addr, &inst);
3600 } 3602 }
3601 else { 3603 else {
3602 DEBUG_LOG(ARM11, "SKYEYE: Read physical addr 0x%x error!!\n", phys_addr); 3604 LOG_ERROR(Core_ARM11, "SKYEYE: Read physical addr 0x%x error!!\n", phys_addr);
3603 return FETCH_FAILURE; 3605 return FETCH_FAILURE;
3604 } 3606 }
3605#else 3607#else
@@ -3629,8 +3631,8 @@ int InterpreterTranslate(arm_processor *cpu, int &bb_start, addr_t addr)
3629 3631
3630 ret = decode_arm_instr(inst, &idx); 3632 ret = decode_arm_instr(inst, &idx);
3631 if (ret == DECODE_FAILURE) { 3633 if (ret == DECODE_FAILURE) {
3632 DEBUG_LOG(ARM11, "[info] : Decode failure.\tPC : [0x%x]\tInstruction : [%x]\n", phys_addr, inst); 3634 LOG_ERROR(Core_ARM11, "Decode failure.\tPC : [0x%x]\tInstruction : [%x]", phys_addr, inst);
3633 DEBUG_LOG(ARM11, "cpsr=0x%x, cpu->TFlag=%d, r15=0x%x\n", cpu->Cpsr, cpu->TFlag, cpu->Reg[15]); 3635 LOG_ERROR(Core_ARM11, "cpsr=0x%x, cpu->TFlag=%d, r15=0x%x", cpu->Cpsr, cpu->TFlag, cpu->Reg[15]);
3634 CITRA_IGNORE_EXIT(-1); 3636 CITRA_IGNORE_EXIT(-1);
3635 } 3637 }
3636// DEBUG_LOG(ARM11, "PC : [0x%x] INST : %s\n", cpu->translate_pc, arm_instruction[idx].name); 3638// DEBUG_LOG(ARM11, "PC : [0x%x] INST : %s\n", cpu->translate_pc, arm_instruction[idx].name);
@@ -3674,7 +3676,7 @@ void InterpreterInitInstLength(unsigned long long int *ptr, size_t size)
3674 } 3676 }
3675 } 3677 }
3676 for (int i = 0; i < array_size - 4; i ++) 3678 for (int i = 0; i < array_size - 4; i ++)
3677 DEBUG_LOG(ARM11, "[%d]:%d\n", i, InstLength[i]); 3679 LOG_DEBUG(Core_ARM11, "[%d]:%d", i, InstLength[i]);
3678} 3680}
3679 3681
3680int clz(unsigned int x) 3682int clz(unsigned int x)
@@ -3721,7 +3723,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
3721 //if (debug_function(core)) \ 3723 //if (debug_function(core)) \
3722 if (core->check_int_flag) \ 3724 if (core->check_int_flag) \
3723 goto END 3725 goto END
3724 //DEBUG_LOG(ARM11, "icounter is %llx line is %d pc is %x\n", cpu->icounter, __LINE__, cpu->Reg[15]) 3726 //LOG_TRACE(Core_ARM11, "icounter is %llx pc is %x\n", cpu->icounter, cpu->Reg[15])
3725 #else 3727 #else
3726 #define INC_ICOUNTER ; 3728 #define INC_ICOUNTER ;
3727 #endif 3729 #endif
@@ -4348,7 +4350,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
4348 bx_inst *inst_cream = (bx_inst *)inst_base->component; 4350 bx_inst *inst_cream = (bx_inst *)inst_base->component;
4349 if ((inst_base->cond == 0xe) || CondPassed(cpu, inst_base->cond)) { 4351 if ((inst_base->cond == 0xe) || CondPassed(cpu, inst_base->cond)) {
4350 if (inst_cream->Rm == 15) 4352 if (inst_cream->Rm == 15)
4351 DEBUG_LOG(ARM11, "In %s, BX at pc %x: use of Rm = R15 is discouraged\n", __FUNCTION__, cpu->Reg[15]); 4353 LOG_WARNING(Core_ARM11, "BX at pc %x: use of Rm = R15 is discouraged", cpu->Reg[15]);
4352 cpu->TFlag = cpu->Reg[inst_cream->Rm] & 0x1; 4354 cpu->TFlag = cpu->Reg[inst_cream->Rm] & 0x1;
4353 cpu->Reg[15] = cpu->Reg[inst_cream->Rm] & 0xfffffffe; 4355 cpu->Reg[15] = cpu->Reg[inst_cream->Rm] & 0xfffffffe;
4354// cpu->TFlag = cpu->Reg[inst_cream->Rm] & 0x1; 4356// cpu->TFlag = cpu->Reg[inst_cream->Rm] & 0x1;
@@ -4373,10 +4375,10 @@ unsigned InterpreterMainLoop(ARMul_State* state)
4373 cpu->NumInstrsToExecute = 0; 4375 cpu->NumInstrsToExecute = 0;
4374 return num_instrs; 4376 return num_instrs;
4375 } 4377 }
4376 ERROR_LOG(ARM11, "CDP insn inst=0x%x, pc=0x%x\n", inst_cream->inst, cpu->Reg[15]); 4378 LOG_ERROR(Core_ARM11, "CDP insn inst=0x%x, pc=0x%x\n", inst_cream->inst, cpu->Reg[15]);
4377 unsigned cpab = (cpu->CDP[inst_cream->cp_num]) (cpu, ARMul_FIRST, inst_cream->inst); 4379 unsigned cpab = (cpu->CDP[inst_cream->cp_num]) (cpu, ARMul_FIRST, inst_cream->inst);
4378 if(cpab != ARMul_DONE){ 4380 if(cpab != ARMul_DONE){
4379 ERROR_LOG(ARM11, "CDP insn wrong, inst=0x%x, cp_num=0x%x\n", inst_cream->inst, inst_cream->cp_num); 4381 LOG_ERROR(Core_ARM11, "CDP insn wrong, inst=0x%x, cp_num=0x%x\n", inst_cream->inst, inst_cream->cp_num);
4380 //CITRA_IGNORE_EXIT(-1); 4382 //CITRA_IGNORE_EXIT(-1);
4381 } 4383 }
4382 } 4384 }
@@ -4803,7 +4805,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
4803 & 0xffff; 4805 & 0xffff;
4804 RD = RN + operand2; 4806 RD = RN + operand2;
4805 if (inst_cream->Rn == 15 || inst_cream->Rm == 15) { 4807 if (inst_cream->Rn == 15 || inst_cream->Rm == 15) {
4806 DEBUG_LOG(ARM11, "in line %d\n", __LINE__); 4808 LOG_ERROR(Core_ARM11, "invalid operands for UXTAH");
4807 CITRA_IGNORE_EXIT(-1); 4809 CITRA_IGNORE_EXIT(-1);
4808 } 4810 }
4809 } 4811 }
@@ -4866,7 +4868,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
4866 uint32_t rear_phys_addr; 4868 uint32_t rear_phys_addr;
4867 fault = check_address_validity(cpu, addr + 4, &rear_phys_addr, 1); 4869 fault = check_address_validity(cpu, addr + 4, &rear_phys_addr, 1);
4868 if(fault){ 4870 if(fault){
4869 ERROR_LOG(ARM11, "mmu fault , should rollback the above get_addr\n"); 4871 LOG_ERROR(Core_ARM11, "mmu fault , should rollback the above get_addr\n");
4870 CITRA_IGNORE_EXIT(-1); 4872 CITRA_IGNORE_EXIT(-1);
4871 goto MMU_EXCEPTION; 4873 goto MMU_EXCEPTION;
4872 } 4874 }
@@ -5089,7 +5091,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5089 switch(OPCODE_2){ 5091 switch(OPCODE_2){
5090 case 0: /* invalidate all */ 5092 case 0: /* invalidate all */
5091 //invalidate_all_tlb(state); 5093 //invalidate_all_tlb(state);
5092 DEBUG_LOG(ARM11, "{TLB} [INSN] invalidate all\n"); 5094 LOG_DEBUG(Core_ARM11, "{TLB} [INSN] invalidate all");
5093 //remove_tlb(INSN_TLB); 5095 //remove_tlb(INSN_TLB);
5094 //erase_all(core, INSN_TLB); 5096 //erase_all(core, INSN_TLB);
5095 break; 5097 break;
@@ -5115,7 +5117,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5115 //invalidate_all_tlb(state); 5117 //invalidate_all_tlb(state);
5116 //remove_tlb(DATA_TLB); 5118 //remove_tlb(DATA_TLB);
5117 //erase_all(core, DATA_TLB); 5119 //erase_all(core, DATA_TLB);
5118 DEBUG_LOG(ARM11, "{TLB} [DATA] invalidate all\n"); 5120 LOG_DEBUG(Core_ARM11, "{TLB} [DATA] invalidate all");
5119 break; 5121 break;
5120 case 1: /* invalidate by MVA */ 5122 case 1: /* invalidate by MVA */
5121 //invalidate_by_mva(state, value); 5123 //invalidate_by_mva(state, value);
@@ -5147,13 +5149,13 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5147 //invalidate_by_mva(state, value); 5149 //invalidate_by_mva(state, value);
5148 //erase_by_mva(core, RD, DATA_TLB); 5150 //erase_by_mva(core, RD, DATA_TLB);
5149 //erase_by_mva(core, RD, INSN_TLB); 5151 //erase_by_mva(core, RD, INSN_TLB);
5150 DEBUG_LOG(ARM11, "{TLB} [UNIFILED] invalidate by mva\n"); 5152 LOG_DEBUG(Core_ARM11, "{TLB} [UNIFILED] invalidate by mva");
5151 break; 5153 break;
5152 case 2: /* invalidate by asid */ 5154 case 2: /* invalidate by asid */
5153 //invalidate_by_asid(state, value); 5155 //invalidate_by_asid(state, value);
5154 //erase_by_asid(core, RD, DATA_TLB); 5156 //erase_by_asid(core, RD, DATA_TLB);
5155 //erase_by_asid(core, RD, INSN_TLB); 5157 //erase_by_asid(core, RD, INSN_TLB);
5156 DEBUG_LOG(ARM11, "{TLB} [UNIFILED] invalidate by asid\n"); 5158 LOG_DEBUG(Core_ARM11, "{TLB} [UNIFILED] invalidate by asid");
5157 break; 5159 break;
5158 default: 5160 default:
5159 break; 5161 break;
@@ -5175,7 +5177,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5175 } 5177 }
5176 5178
5177 } else { 5179 } else {
5178 DEBUG_LOG(ARM11, "mcr is not implementated. CRn is %d, CRm is %d, OPCODE_2 is %d\n", CRn, CRm, OPCODE_2); 5180 LOG_ERROR(Core_ARM11, "mcr CRn=%d, CRm=%d OP2=%d is not implemented", CRn, CRm, OPCODE_2);
5179 } 5181 }
5180 } 5182 }
5181 } 5183 }
@@ -5195,7 +5197,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5195 uint64_t rs = RS; 5197 uint64_t rs = RS;
5196 uint64_t rn = RN; 5198 uint64_t rn = RN;
5197 if (inst_cream->Rm == 15 || inst_cream->Rs == 15 || inst_cream->Rn == 15) { 5199 if (inst_cream->Rm == 15 || inst_cream->Rs == 15 || inst_cream->Rn == 15) {
5198 DEBUG_LOG(ARM11, "in __line__\n", __LINE__); 5200 LOG_ERROR(Core_ARM11, "invalid operands for MLA");
5199 CITRA_IGNORE_EXIT(-1); 5201 CITRA_IGNORE_EXIT(-1);
5200 } 5202 }
5201// RD = dst = RM * RS + RN; 5203// RD = dst = RM * RS + RN;
@@ -5309,7 +5311,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5309 } 5311 }
5310 } 5312 }
5311 else { 5313 else {
5312 DEBUG_LOG(ARM11, "mrc is not implementated. CRn is %d, CRm is %d, OPCODE_2 is %d\n", CRn, CRm, OPCODE_2); 5314 LOG_ERROR(Core_ARM11, "mrc CRn=%d, CRm=%d, OP2=%d is not implemented", CRn, CRm, OPCODE_2);
5313 } 5315 }
5314 } 5316 }
5315 //DEBUG_LOG(ARM11, "mrc is not implementated. CRn is %d, CRm is %d, OPCODE_2 is %d\n", CRn, CRm, OPCODE_2); 5317 //DEBUG_LOG(ARM11, "mrc is not implementated. CRn is %d, CRm is %d, OPCODE_2 is %d\n", CRn, CRm, OPCODE_2);
@@ -5500,7 +5502,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5500 (((RM >> 16) & 0xff) << 8) | 5502 (((RM >> 16) & 0xff) << 8) |
5501 ((RM >> 24) & 0xff); 5503 ((RM >> 24) & 0xff);
5502 if (inst_cream->Rm == 15) { 5504 if (inst_cream->Rm == 15) {
5503 DEBUG_LOG(ARM11, "in line %d\n", __LINE__); 5505 LOG_ERROR(Core_ARM11, "invalid operand for REV");
5504 CITRA_IGNORE_EXIT(-1); 5506 CITRA_IGNORE_EXIT(-1);
5505 } 5507 }
5506 } 5508 }
@@ -5953,7 +5955,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
5953 sxtb_inst *inst_cream = (sxtb_inst *)inst_base->component; 5955 sxtb_inst *inst_cream = (sxtb_inst *)inst_base->component;
5954 if ((inst_base->cond == 0xe) || CondPassed(cpu, inst_base->cond)) { 5956 if ((inst_base->cond == 0xe) || CondPassed(cpu, inst_base->cond)) {
5955 if (inst_cream->Rm == 15) { 5957 if (inst_cream->Rm == 15) {
5956 DEBUG_LOG(ARM11, "line is %d\n", __LINE__); 5958 LOG_ERROR(Core_ARM11, "invalid operand for SXTB");
5957 CITRA_IGNORE_EXIT(-1); 5959 CITRA_IGNORE_EXIT(-1);
5958 } 5960 }
5959 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate); 5961 unsigned int operand2 = ROTATE_RIGHT_32(RM, 8 * inst_cream->rotate);
@@ -6059,7 +6061,7 @@ unsigned InterpreterMainLoop(ARMul_State* state)
6059 uint32_t rear_phys_addr; 6061 uint32_t rear_phys_addr;
6060 fault = check_address_validity(cpu, addr + 4, &rear_phys_addr, 0); 6062 fault = check_address_validity(cpu, addr + 4, &rear_phys_addr, 0);
6061 if (fault){ 6063 if (fault){
6062 ERROR_LOG(ARM11, "mmu fault , should rollback the above get_addr\n"); 6064 LOG_ERROR(Core_ARM11, "mmu fault , should rollback the above get_addr\n");
6063 CITRA_IGNORE_EXIT(-1); 6065 CITRA_IGNORE_EXIT(-1);
6064 goto MMU_EXCEPTION; 6066 goto MMU_EXCEPTION;
6065 } 6067 }
diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp
index d717bd2c8..825955ade 100644
--- a/src/core/arm/interpreter/armemu.cpp
+++ b/src/core/arm/interpreter/armemu.cpp
@@ -949,7 +949,7 @@ ARMul_Emulate26 (ARMul_State * state)
949 //printf("t decode %04lx -> %08lx\n", instr & 0xffff, armOp); 949 //printf("t decode %04lx -> %08lx\n", instr & 0xffff, armOp);
950 950
951 if (armOp == 0xDEADC0DE) { 951 if (armOp == 0xDEADC0DE) {
952 DEBUG("Failed to decode thumb opcode %04X at %08X\n", instr, pc); 952 LOG_ERROR(Core_ARM11, "Failed to decode thumb opcode %04X at %08X", instr, pc);
953 } 953 }
954 954
955 instr = armOp; 955 instr = armOp;
@@ -3437,7 +3437,7 @@ mainswitch:
3437 3437
3438 case 0x7f: /* Load Byte, WriteBack, Pre Inc, Reg. */ 3438 case 0x7f: /* Load Byte, WriteBack, Pre Inc, Reg. */
3439 if (BIT (4)) { 3439 if (BIT (4)) {
3440 DEBUG("got unhandled special breakpoint\n"); 3440 LOG_DEBUG(Core_ARM11, "got unhandled special breakpoint");
3441 return 1; 3441 return 1;
3442 } 3442 }
3443 UNDEF_LSRBaseEQOffWb; 3443 UNDEF_LSRBaseEQOffWb;
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp
index 2568b93ef..30519f216 100644
--- a/src/core/arm/interpreter/armsupp.cpp
+++ b/src/core/arm/interpreter/armsupp.cpp
@@ -665,7 +665,7 @@ ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source)
665 //if (!CP_ACCESS_ALLOWED (state, CPNum)) { 665 //if (!CP_ACCESS_ALLOWED (state, CPNum)) {
666 if (!state->MCR[CPNum]) { 666 if (!state->MCR[CPNum]) {
667 //chy 2004-07-19 should fix in the future ????!!!! 667 //chy 2004-07-19 should fix in the future ????!!!!
668 DEBUG("SKYEYE ARMul_MCR, ACCESS_not ALLOWed, UndefinedInstr CPnum is %x, source %x\n",CPNum, source); 668 LOG_ERROR(Core_ARM11, "SKYEYE ARMul_MCR, ACCESS_not ALLOWed, UndefinedInstr CPnum is %x, source %x",CPNum, source);
669 ARMul_UndefInstr (state, instr); 669 ARMul_UndefInstr (state, instr);
670 return; 670 return;
671 } 671 }
@@ -690,7 +690,7 @@ ARMul_MCR (ARMul_State * state, ARMword instr, ARMword source)
690 } 690 }
691 691
692 if (cpab == ARMul_CANT) { 692 if (cpab == ARMul_CANT) {
693 DEBUG("SKYEYE ARMul_MCR, CANT, UndefinedInstr %x CPnum is %x, source %x\n", instr, CPNum, source); //ichfly todo 693 LOG_ERROR(Core_ARM11, "SKYEYE ARMul_MCR, CANT, UndefinedInstr %x CPnum is %x, source %x", instr, CPNum, source); //ichfly todo
694 //ARMul_Abort (state, ARMul_UndefinedInstrV); 694 //ARMul_Abort (state, ARMul_UndefinedInstrV);
695 } else { 695 } else {
696 BUSUSEDINCPCN; 696 BUSUSEDINCPCN;
@@ -762,7 +762,7 @@ ARMword ARMul_MRC (ARMul_State * state, ARMword instr)
762 //if (!CP_ACCESS_ALLOWED (state, CPNum)) { 762 //if (!CP_ACCESS_ALLOWED (state, CPNum)) {
763 if (!state->MRC[CPNum]) { 763 if (!state->MRC[CPNum]) {
764 //chy 2004-07-19 should fix in the future????!!!! 764 //chy 2004-07-19 should fix in the future????!!!!
765 DEBUG("SKYEYE ARMul_MRC,NOT ALLOWed UndefInstr CPnum is %x, instr %x\n", CPNum, instr); 765 LOG_ERROR(Core_ARM11, "SKYEYE ARMul_MRC,NOT ALLOWed UndefInstr CPnum is %x, instr %x", CPNum, instr);
766 ARMul_UndefInstr (state, instr); 766 ARMul_UndefInstr (state, instr);
767 return -1; 767 return -1;
768 } 768 }
@@ -865,7 +865,7 @@ void
865ARMul_UndefInstr (ARMul_State * state, ARMword instr) 865ARMul_UndefInstr (ARMul_State * state, ARMword instr)
866{ 866{
867 std::string disasm = ARM_Disasm::Disassemble(state->pc, instr); 867 std::string disasm = ARM_Disasm::Disassemble(state->pc, instr);
868 ERROR_LOG(ARM11, "Undefined instruction!! Disasm: %s Opcode: 0x%x", disasm.c_str(), instr); 868 LOG_ERROR(Core_ARM11, "Undefined instruction!! Disasm: %s Opcode: 0x%x", disasm.c_str(), instr);
869 ARMul_Abort (state, ARMul_UndefinedInstrV); 869 ARMul_Abort (state, ARMul_UndefinedInstrV);
870} 870}
871 871
diff --git a/src/core/arm/interpreter/thumbemu.cpp b/src/core/arm/interpreter/thumbemu.cpp
index f7f11f714..9cf80672d 100644
--- a/src/core/arm/interpreter/thumbemu.cpp
+++ b/src/core/arm/interpreter/thumbemu.cpp
@@ -467,7 +467,7 @@ ARMul_ThumbDecode (
467 (state->Reg[14] + ((tinstr & 0x07FF) << 1)) & 0xFFFFFFFC; 467 (state->Reg[14] + ((tinstr & 0x07FF) << 1)) & 0xFFFFFFFC;
468 state->Reg[14] = (tmp | 1); 468 state->Reg[14] = (tmp | 1);
469 CLEART; 469 CLEART;
470 DEBUG_LOG(ARM11, "In %s, After BLX(1),LR=0x%x,PC=0x%x, offset=0x%x\n", __FUNCTION__, state->Reg[14], state->Reg[15], (tinstr &0x7FF) << 1); 470 LOG_DEBUG(Core_ARM11, "After BLX(1),LR=0x%x,PC=0x%x, offset=0x%x", state->Reg[14], state->Reg[15], (tinstr &0x7FF) << 1);
471 valid = t_branch; 471 valid = t_branch;
472 FLUSHPIPE; 472 FLUSHPIPE;
473 } 473 }
diff --git a/src/core/arm/skyeye_common/armemu.h b/src/core/arm/skyeye_common/armemu.h
index 075fc7e9e..7f7c0e682 100644
--- a/src/core/arm/skyeye_common/armemu.h
+++ b/src/core/arm/skyeye_common/armemu.h
@@ -23,8 +23,6 @@
23 23
24//extern ARMword isize; 24//extern ARMword isize;
25 25
26#define DEBUG(...) DEBUG_LOG(ARM11, __VA_ARGS__)
27
28/* Shift Opcodes. */ 26/* Shift Opcodes. */
29#define LSL 0 27#define LSL 0
30#define LSR 1 28#define LSR 1
@@ -485,7 +483,7 @@ tdstate;
485 * out-of-updated with the newer ISA. 483 * out-of-updated with the newer ISA.
486 * -- Michael.Kang 484 * -- Michael.Kang
487 ********************************************************************************/ 485 ********************************************************************************/
488#define UNDEF_WARNING WARN_LOG(ARM11, "undefined or unpredicted behavior for arm instruction.\n"); 486#define UNDEF_WARNING LOG_WARNING(Core_ARM11, "undefined or unpredicted behavior for arm instruction.");
489 487
490/* Macros to scrutinize instructions. */ 488/* Macros to scrutinize instructions. */
491#define UNDEF_Test UNDEF_WARNING 489#define UNDEF_Test UNDEF_WARNING
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 865898b24..64de0cbba 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -47,7 +47,7 @@ void Stop() {
47 47
48/// Initialize the core 48/// Initialize the core
49int Init() { 49int Init() {
50 NOTICE_LOG(MASTER_LOG, "initialized OK"); 50 LOG_DEBUG(Core, "initialized OK");
51 51
52 disasm = new ARM_Disasm(); 52 disasm = new ARM_Disasm();
53 g_sys_core = new ARM_Interpreter(); 53 g_sys_core = new ARM_Interpreter();
@@ -72,7 +72,7 @@ void Shutdown() {
72 delete g_app_core; 72 delete g_app_core;
73 delete g_sys_core; 73 delete g_sys_core;
74 74
75 NOTICE_LOG(MASTER_LOG, "shutdown OK"); 75 LOG_DEBUG(Core, "shutdown OK");
76} 76}
77 77
78} // namespace 78} // namespace
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index bf8acf41f..1a0b2724a 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -124,7 +124,7 @@ int RegisterEvent(const char *name, TimedCallback callback)
124 124
125void AntiCrashCallback(u64 userdata, int cyclesLate) 125void AntiCrashCallback(u64 userdata, int cyclesLate)
126{ 126{
127 ERROR_LOG(TIME, "Savestate broken: an unregistered event was called."); 127 LOG_CRITICAL(Core, "Savestate broken: an unregistered event was called.");
128 Core::Halt("invalid timing events"); 128 Core::Halt("invalid timing events");
129} 129}
130 130
@@ -176,7 +176,7 @@ void Shutdown()
176 176
177u64 GetTicks() 177u64 GetTicks()
178{ 178{
179 ERROR_LOG(TIME, "Unimplemented function!"); 179 LOG_ERROR(Core, "Unimplemented function!");
180 return 0; 180 return 0;
181 //return (u64)globalTimer + slicelength - currentMIPS->downcount; 181 //return (u64)globalTimer + slicelength - currentMIPS->downcount;
182} 182}
@@ -510,7 +510,7 @@ void MoveEvents()
510 510
511void Advance() 511void Advance()
512{ 512{
513 ERROR_LOG(TIME, "Unimplemented function!"); 513 LOG_ERROR(Core, "Unimplemented function!");
514 //int cyclesExecuted = slicelength - currentMIPS->downcount; 514 //int cyclesExecuted = slicelength - currentMIPS->downcount;
515 //globalTimer += cyclesExecuted; 515 //globalTimer += cyclesExecuted;
516 //currentMIPS->downcount = slicelength; 516 //currentMIPS->downcount = slicelength;
@@ -547,7 +547,7 @@ void LogPendingEvents()
547 547
548void Idle(int maxIdle) 548void Idle(int maxIdle)
549{ 549{
550 ERROR_LOG(TIME, "Unimplemented function!"); 550 LOG_ERROR(Core, "Unimplemented function!");
551 //int cyclesDown = currentMIPS->downcount; 551 //int cyclesDown = currentMIPS->downcount;
552 //if (maxIdle != 0 && cyclesDown > maxIdle) 552 //if (maxIdle != 0 && cyclesDown > maxIdle)
553 // cyclesDown = maxIdle; 553 // cyclesDown = maxIdle;
diff --git a/src/core/file_sys/archive.h b/src/core/file_sys/archive.h
index f3cb11133..27ed23cd0 100644
--- a/src/core/file_sys/archive.h
+++ b/src/core/file_sys/archive.h
@@ -100,7 +100,8 @@ public:
100 case Wchar: 100 case Wchar:
101 return "[Wchar: " + AsString() + ']'; 101 return "[Wchar: " + AsString() + ']';
102 default: 102 default:
103 ERROR_LOG(KERNEL, "LowPathType cannot be converted to string!"); 103 // TODO(yuriks): Add assert
104 LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!");
104 return {}; 105 return {};
105 } 106 }
106 } 107 }
@@ -114,7 +115,8 @@ public:
114 case Empty: 115 case Empty:
115 return {}; 116 return {};
116 default: 117 default:
117 ERROR_LOG(KERNEL, "LowPathType cannot be converted to string!"); 118 // TODO(yuriks): Add assert
119 LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!");
118 return {}; 120 return {};
119 } 121 }
120 } 122 }
@@ -128,7 +130,8 @@ public:
128 case Empty: 130 case Empty:
129 return {}; 131 return {};
130 default: 132 default:
131 ERROR_LOG(KERNEL, "LowPathType cannot be converted to u16string!"); 133 // TODO(yuriks): Add assert
134 LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!");
132 return {}; 135 return {};
133 } 136 }
134 } 137 }
@@ -144,7 +147,8 @@ public:
144 case Empty: 147 case Empty:
145 return {}; 148 return {};
146 default: 149 default:
147 ERROR_LOG(KERNEL, "LowPathType cannot be converted to binary!"); 150 // TODO(yuriks): Add assert
151 LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!");
148 return {}; 152 return {};
149 } 153 }
150 } 154 }
diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp
index 8c2dbeda5..74974c2df 100644
--- a/src/core/file_sys/archive_romfs.cpp
+++ b/src/core/file_sys/archive_romfs.cpp
@@ -16,7 +16,7 @@ namespace FileSys {
16Archive_RomFS::Archive_RomFS(const Loader::AppLoader& app_loader) { 16Archive_RomFS::Archive_RomFS(const Loader::AppLoader& app_loader) {
17 // Load the RomFS from the app 17 // Load the RomFS from the app
18 if (Loader::ResultStatus::Success != app_loader.ReadRomFS(raw_data)) { 18 if (Loader::ResultStatus::Success != app_loader.ReadRomFS(raw_data)) {
19 WARN_LOG(FILESYS, "Unable to read RomFS!"); 19 LOG_ERROR(Service_FS, "Unable to read RomFS!");
20 } 20 }
21} 21}
22 22
@@ -39,12 +39,12 @@ std::unique_ptr<File> Archive_RomFS::OpenFile(const Path& path, const Mode mode)
39 * @return Whether the file could be deleted 39 * @return Whether the file could be deleted
40 */ 40 */
41bool Archive_RomFS::DeleteFile(const FileSys::Path& path) const { 41bool Archive_RomFS::DeleteFile(const FileSys::Path& path) const {
42 ERROR_LOG(FILESYS, "Attempted to delete a file from ROMFS."); 42 LOG_WARNING(Service_FS, "Attempted to delete a file from ROMFS.");
43 return false; 43 return false;
44} 44}
45 45
46bool Archive_RomFS::RenameFile(const FileSys::Path& src_path, const FileSys::Path& dest_path) const { 46bool Archive_RomFS::RenameFile(const FileSys::Path& src_path, const FileSys::Path& dest_path) const {
47 ERROR_LOG(FILESYS, "Attempted to rename a file within ROMFS."); 47 LOG_WARNING(Service_FS, "Attempted to rename a file within ROMFS.");
48 return false; 48 return false;
49} 49}
50 50
@@ -54,7 +54,7 @@ bool Archive_RomFS::RenameFile(const FileSys::Path& src_path, const FileSys::Pat
54 * @return Whether the directory could be deleted 54 * @return Whether the directory could be deleted
55 */ 55 */
56bool Archive_RomFS::DeleteDirectory(const FileSys::Path& path) const { 56bool Archive_RomFS::DeleteDirectory(const FileSys::Path& path) const {
57 ERROR_LOG(FILESYS, "Attempted to delete a directory from ROMFS."); 57 LOG_WARNING(Service_FS, "Attempted to delete a directory from ROMFS.");
58 return false; 58 return false;
59} 59}
60 60
@@ -64,12 +64,12 @@ bool Archive_RomFS::DeleteDirectory(const FileSys::Path& path) const {
64 * @return Whether the directory could be created 64 * @return Whether the directory could be created
65 */ 65 */
66bool Archive_RomFS::CreateDirectory(const Path& path) const { 66bool Archive_RomFS::CreateDirectory(const Path& path) const {
67 ERROR_LOG(FILESYS, "Attempted to create a directory in ROMFS."); 67 LOG_WARNING(Service_FS, "Attempted to create a directory in ROMFS.");
68 return false; 68 return false;
69} 69}
70 70
71bool Archive_RomFS::RenameDirectory(const FileSys::Path& src_path, const FileSys::Path& dest_path) const { 71bool Archive_RomFS::RenameDirectory(const FileSys::Path& src_path, const FileSys::Path& dest_path) const {
72 ERROR_LOG(FILESYS, "Attempted to rename a file within ROMFS."); 72 LOG_WARNING(Service_FS, "Attempted to rename a file within ROMFS.");
73 return false; 73 return false;
74} 74}
75 75
@@ -90,7 +90,7 @@ std::unique_ptr<Directory> Archive_RomFS::OpenDirectory(const Path& path) const
90 * @return Number of bytes read 90 * @return Number of bytes read
91 */ 91 */
92size_t Archive_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const { 92size_t Archive_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const {
93 DEBUG_LOG(FILESYS, "called offset=%llu, length=%d", offset, length); 93 LOG_TRACE(Service_FS, "called offset=%llu, length=%d", offset, length);
94 memcpy(buffer, &raw_data[(u32)offset], length); 94 memcpy(buffer, &raw_data[(u32)offset], length);
95 return length; 95 return length;
96} 96}
@@ -104,7 +104,7 @@ size_t Archive_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const
104 * @return Number of bytes written 104 * @return Number of bytes written
105 */ 105 */
106size_t Archive_RomFS::Write(const u64 offset, const u32 length, const u32 flush, u8* buffer) { 106size_t Archive_RomFS::Write(const u64 offset, const u32 length, const u32 flush, u8* buffer) {
107 ERROR_LOG(FILESYS, "Attempted to write to ROMFS."); 107 LOG_WARNING(Service_FS, "Attempted to write to ROMFS.");
108 return 0; 108 return 0;
109} 109}
110 110
@@ -120,7 +120,7 @@ size_t Archive_RomFS::GetSize() const {
120 * Set the size of the archive in bytes 120 * Set the size of the archive in bytes
121 */ 121 */
122void Archive_RomFS::SetSize(const u64 size) { 122void Archive_RomFS::SetSize(const u64 size) {
123 ERROR_LOG(FILESYS, "Attempted to set the size of ROMFS"); 123 LOG_WARNING(Service_FS, "Attempted to set the size of ROMFS");
124} 124}
125 125
126} // namespace FileSys 126} // namespace FileSys
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index fc0b9b72d..9e524b60e 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -19,7 +19,7 @@ namespace FileSys {
19 19
20Archive_SDMC::Archive_SDMC(const std::string& mount_point) { 20Archive_SDMC::Archive_SDMC(const std::string& mount_point) {
21 this->mount_point = mount_point; 21 this->mount_point = mount_point;
22 DEBUG_LOG(FILESYS, "Directory %s set as SDMC.", mount_point.c_str()); 22 LOG_INFO(Service_FS, "Directory %s set as SDMC.", mount_point.c_str());
23} 23}
24 24
25Archive_SDMC::~Archive_SDMC() { 25Archive_SDMC::~Archive_SDMC() {
@@ -31,12 +31,12 @@ Archive_SDMC::~Archive_SDMC() {
31 */ 31 */
32bool Archive_SDMC::Initialize() { 32bool Archive_SDMC::Initialize() {
33 if (!Settings::values.use_virtual_sd) { 33 if (!Settings::values.use_virtual_sd) {
34 WARN_LOG(FILESYS, "SDMC disabled by config."); 34 LOG_WARNING(Service_FS, "SDMC disabled by config.");
35 return false; 35 return false;
36 } 36 }
37 37
38 if (!FileUtil::CreateFullPath(mount_point)) { 38 if (!FileUtil::CreateFullPath(mount_point)) {
39 WARN_LOG(FILESYS, "Unable to create SDMC path."); 39 LOG_ERROR(Service_FS, "Unable to create SDMC path.");
40 return false; 40 return false;
41 } 41 }
42 42
@@ -50,7 +50,7 @@ bool Archive_SDMC::Initialize() {
50 * @return Opened file, or nullptr 50 * @return Opened file, or nullptr
51 */ 51 */
52std::unique_ptr<File> Archive_SDMC::OpenFile(const Path& path, const Mode mode) const { 52std::unique_ptr<File> Archive_SDMC::OpenFile(const Path& path, const Mode mode) const {
53 DEBUG_LOG(FILESYS, "called path=%s mode=%u", path.DebugStr().c_str(), mode.hex); 53 LOG_DEBUG(Service_FS, "called path=%s mode=%u", path.DebugStr().c_str(), mode.hex);
54 File_SDMC* file = new File_SDMC(this, path, mode); 54 File_SDMC* file = new File_SDMC(this, path, mode);
55 if (!file->Open()) 55 if (!file->Open())
56 return nullptr; 56 return nullptr;
@@ -98,7 +98,7 @@ bool Archive_SDMC::RenameDirectory(const FileSys::Path& src_path, const FileSys:
98 * @return Opened directory, or nullptr 98 * @return Opened directory, or nullptr
99 */ 99 */
100std::unique_ptr<Directory> Archive_SDMC::OpenDirectory(const Path& path) const { 100std::unique_ptr<Directory> Archive_SDMC::OpenDirectory(const Path& path) const {
101 DEBUG_LOG(FILESYS, "called path=%s", path.DebugStr().c_str()); 101 LOG_DEBUG(Service_FS, "called path=%s", path.DebugStr().c_str());
102 Directory_SDMC* directory = new Directory_SDMC(this, path); 102 Directory_SDMC* directory = new Directory_SDMC(this, path);
103 if (!directory->Open()) 103 if (!directory->Open())
104 return nullptr; 104 return nullptr;
@@ -113,7 +113,7 @@ std::unique_ptr<Directory> Archive_SDMC::OpenDirectory(const Path& path) const {
113 * @return Number of bytes read 113 * @return Number of bytes read
114 */ 114 */
115size_t Archive_SDMC::Read(const u64 offset, const u32 length, u8* buffer) const { 115size_t Archive_SDMC::Read(const u64 offset, const u32 length, u8* buffer) const {
116 ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); 116 LOG_ERROR(Service_FS, "(UNIMPLEMENTED)");
117 return -1; 117 return -1;
118} 118}
119 119
@@ -126,7 +126,7 @@ size_t Archive_SDMC::Read(const u64 offset, const u32 length, u8* buffer) const
126 * @return Number of bytes written 126 * @return Number of bytes written
127 */ 127 */
128size_t Archive_SDMC::Write(const u64 offset, const u32 length, const u32 flush, u8* buffer) { 128size_t Archive_SDMC::Write(const u64 offset, const u32 length, const u32 flush, u8* buffer) {
129 ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); 129 LOG_ERROR(Service_FS, "(UNIMPLEMENTED)");
130 return -1; 130 return -1;
131} 131}
132 132
@@ -135,7 +135,7 @@ size_t Archive_SDMC::Write(const u64 offset, const u32 length, const u32 flush,
135 * @return Size of the archive in bytes 135 * @return Size of the archive in bytes
136 */ 136 */
137size_t Archive_SDMC::GetSize() const { 137size_t Archive_SDMC::GetSize() const {
138 ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); 138 LOG_ERROR(Service_FS, "(UNIMPLEMENTED)");
139 return 0; 139 return 0;
140} 140}
141 141
@@ -143,7 +143,7 @@ size_t Archive_SDMC::GetSize() const {
143 * Set the size of the archive in bytes 143 * Set the size of the archive in bytes
144 */ 144 */
145void Archive_SDMC::SetSize(const u64 size) { 145void Archive_SDMC::SetSize(const u64 size) {
146 ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); 146 LOG_ERROR(Service_FS, "(UNIMPLEMENTED)");
147} 147}
148 148
149/** 149/**
diff --git a/src/core/file_sys/directory_sdmc.cpp b/src/core/file_sys/directory_sdmc.cpp
index 0f156a127..519787641 100644
--- a/src/core/file_sys/directory_sdmc.cpp
+++ b/src/core/file_sys/directory_sdmc.cpp
@@ -49,7 +49,7 @@ u32 Directory_SDMC::Read(const u32 count, Entry* entries) {
49 const std::string& filename = file.virtualName; 49 const std::string& filename = file.virtualName;
50 Entry& entry = entries[entries_read]; 50 Entry& entry = entries[entries_read];
51 51
52 WARN_LOG(FILESYS, "File %s: size=%llu dir=%d", filename.c_str(), file.size, file.isDirectory); 52 LOG_TRACE(Service_FS, "File %s: size=%llu dir=%d", filename.c_str(), file.size, file.isDirectory);
53 53
54 // TODO(Link Mauve): use a proper conversion to UTF-16. 54 // TODO(Link Mauve): use a proper conversion to UTF-16.
55 for (size_t j = 0; j < FILENAME_LENGTH; ++j) { 55 for (size_t j = 0; j < FILENAME_LENGTH; ++j) {
diff --git a/src/core/file_sys/file_sdmc.cpp b/src/core/file_sys/file_sdmc.cpp
index b01d96e3d..46c29900b 100644
--- a/src/core/file_sys/file_sdmc.cpp
+++ b/src/core/file_sys/file_sdmc.cpp
@@ -33,7 +33,7 @@ File_SDMC::~File_SDMC() {
33 */ 33 */
34bool File_SDMC::Open() { 34bool File_SDMC::Open() {
35 if (!mode.create_flag && !FileUtil::Exists(path)) { 35 if (!mode.create_flag && !FileUtil::Exists(path)) {
36 ERROR_LOG(FILESYS, "Non-existing file %s can’t be open without mode create.", path.c_str()); 36 LOG_ERROR(Service_FS, "Non-existing file %s can’t be open without mode create.", path.c_str());
37 return false; 37 return false;
38 } 38 }
39 39
diff --git a/src/core/hle/config_mem.cpp b/src/core/hle/config_mem.cpp
index c7cf5b1d3..d8ba9e6cf 100644
--- a/src/core/hle/config_mem.cpp
+++ b/src/core/hle/config_mem.cpp
@@ -3,6 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/common_types.h" 5#include "common/common_types.h"
6#include "common/log.h"
6 7
7#include "core/hle/config_mem.h" 8#include "core/hle/config_mem.h"
8 9
@@ -54,7 +55,7 @@ inline void Read(T &var, const u32 addr) {
54 break; 55 break;
55 56
56 default: 57 default:
57 ERROR_LOG(HLE, "unknown addr=0x%08X", addr); 58 LOG_ERROR(Kernel, "unknown addr=0x%08X", addr);
58 } 59 }
59} 60}
60 61
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp
index b8ac186f6..3f73b5538 100644
--- a/src/core/hle/hle.cpp
+++ b/src/core/hle/hle.cpp
@@ -20,7 +20,7 @@ bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a n
20const FunctionDef* GetSVCInfo(u32 opcode) { 20const FunctionDef* GetSVCInfo(u32 opcode) {
21 u32 func_num = opcode & 0xFFFFFF; // 8 bits 21 u32 func_num = opcode & 0xFFFFFF; // 8 bits
22 if (func_num > 0xFF) { 22 if (func_num > 0xFF) {
23 ERROR_LOG(HLE,"unknown svc=0x%02X", func_num); 23 LOG_ERROR(Kernel_SVC,"unknown svc=0x%02X", func_num);
24 return nullptr; 24 return nullptr;
25 } 25 }
26 return &g_module_db[0].func_table[func_num]; 26 return &g_module_db[0].func_table[func_num];
@@ -35,14 +35,12 @@ void CallSVC(u32 opcode) {
35 if (info->func) { 35 if (info->func) {
36 info->func(); 36 info->func();
37 } else { 37 } else {
38 ERROR_LOG(HLE, "unimplemented SVC function %s(..)", info->name.c_str()); 38 LOG_ERROR(Kernel_SVC, "unimplemented SVC function %s(..)", info->name.c_str());
39 } 39 }
40} 40}
41 41
42void Reschedule(const char *reason) { 42void Reschedule(const char *reason) {
43#ifdef _DEBUG 43 _dbg_assert_msg_(Kernel, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
44 _dbg_assert_msg_(HLE, reason != 0 && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
45#endif
46 Core::g_app_core->PrepareReschedule(); 44 Core::g_app_core->PrepareReschedule();
47 g_reschedule = true; 45 g_reschedule = true;
48} 46}
@@ -61,7 +59,7 @@ void Init() {
61 59
62 RegisterAllModules(); 60 RegisterAllModules();
63 61
64 NOTICE_LOG(HLE, "initialized OK"); 62 LOG_DEBUG(Kernel, "initialized OK");
65} 63}
66 64
67void Shutdown() { 65void Shutdown() {
@@ -69,7 +67,7 @@ void Shutdown() {
69 67
70 g_module_db.clear(); 68 g_module_db.clear();
71 69
72 NOTICE_LOG(HLE, "shutdown OK"); 70 LOG_DEBUG(Kernel, "shutdown OK");
73} 71}
74 72
75} // namespace 73} // namespace
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index ce4f3c854..9a921108d 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -24,12 +24,6 @@ public:
24 Kernel::HandleType GetHandleType() const override { return HandleType::AddressArbiter; } 24 Kernel::HandleType GetHandleType() const override { return HandleType::AddressArbiter; }
25 25
26 std::string name; ///< Name of address arbiter object (optional) 26 std::string name; ///< Name of address arbiter object (optional)
27
28 ResultVal<bool> WaitSynchronization() override {
29 // TODO(bunnei): ImplementMe
30 ERROR_LOG(OSHLE, "(UNIMPLEMENTED)");
31 return UnimplementedFunction(ErrorModule::OS);
32 }
33}; 27};
34 28
35//////////////////////////////////////////////////////////////////////////////////////////////////// 29////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -59,7 +53,7 @@ ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s3
59 break; 53 break;
60 54
61 default: 55 default:
62 ERROR_LOG(KERNEL, "unknown type=%d", type); 56 LOG_ERROR(Kernel, "unknown type=%d", type);
63 return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage); 57 return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage);
64 } 58 }
65 return RESULT_SUCCESS; 59 return RESULT_SUCCESS;
diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp
index a875fa7ff..ddc09e13b 100644
--- a/src/core/hle/kernel/archive.cpp
+++ b/src/core/hle/kernel/archive.cpp
@@ -94,26 +94,20 @@ public:
94 } 94 }
95 case FileCommand::Close: 95 case FileCommand::Close:
96 { 96 {
97 DEBUG_LOG(KERNEL, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); 97 LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str());
98 CloseArchive(backend->GetIdCode()); 98 CloseArchive(backend->GetIdCode());
99 break; 99 break;
100 } 100 }
101 // Unknown command... 101 // Unknown command...
102 default: 102 default:
103 { 103 {
104 ERROR_LOG(KERNEL, "Unknown command=0x%08X!", cmd); 104 LOG_ERROR(Service_FS, "Unknown command=0x%08X", cmd);
105 return UnimplementedFunction(ErrorModule::FS); 105 return UnimplementedFunction(ErrorModule::FS);
106 } 106 }
107 } 107 }
108 cmd_buff[1] = 0; // No error 108 cmd_buff[1] = 0; // No error
109 return MakeResult<bool>(false); 109 return MakeResult<bool>(false);
110 } 110 }
111
112 ResultVal<bool> WaitSynchronization() override {
113 // TODO(bunnei): ImplementMe
114 ERROR_LOG(OSHLE, "(UNIMPLEMENTED)");
115 return UnimplementedFunction(ErrorModule::FS);
116 }
117}; 111};
118 112
119class File : public Object { 113class File : public Object {
@@ -138,7 +132,7 @@ public:
138 u64 offset = cmd_buff[1] | ((u64) cmd_buff[2]) << 32; 132 u64 offset = cmd_buff[1] | ((u64) cmd_buff[2]) << 32;
139 u32 length = cmd_buff[3]; 133 u32 length = cmd_buff[3];
140 u32 address = cmd_buff[5]; 134 u32 address = cmd_buff[5];
141 DEBUG_LOG(KERNEL, "Read %s %s: offset=0x%llx length=%d address=0x%x", 135 LOG_TRACE(Service_FS, "Read %s %s: offset=0x%llx length=%d address=0x%x",
142 GetTypeName().c_str(), GetName().c_str(), offset, length, address); 136 GetTypeName().c_str(), GetName().c_str(), offset, length, address);
143 cmd_buff[2] = backend->Read(offset, length, Memory::GetPointer(address)); 137 cmd_buff[2] = backend->Read(offset, length, Memory::GetPointer(address));
144 break; 138 break;
@@ -151,7 +145,7 @@ public:
151 u32 length = cmd_buff[3]; 145 u32 length = cmd_buff[3];
152 u32 flush = cmd_buff[4]; 146 u32 flush = cmd_buff[4];
153 u32 address = cmd_buff[6]; 147 u32 address = cmd_buff[6];
154 DEBUG_LOG(KERNEL, "Write %s %s: offset=0x%llx length=%d address=0x%x, flush=0x%x", 148 LOG_TRACE(Service_FS, "Write %s %s: offset=0x%llx length=%d address=0x%x, flush=0x%x",
155 GetTypeName().c_str(), GetName().c_str(), offset, length, address, flush); 149 GetTypeName().c_str(), GetName().c_str(), offset, length, address, flush);
156 cmd_buff[2] = backend->Write(offset, length, flush, Memory::GetPointer(address)); 150 cmd_buff[2] = backend->Write(offset, length, flush, Memory::GetPointer(address));
157 break; 151 break;
@@ -159,7 +153,7 @@ public:
159 153
160 case FileCommand::GetSize: 154 case FileCommand::GetSize:
161 { 155 {
162 DEBUG_LOG(KERNEL, "GetSize %s %s", GetTypeName().c_str(), GetName().c_str()); 156 LOG_TRACE(Service_FS, "GetSize %s %s", GetTypeName().c_str(), GetName().c_str());
163 u64 size = backend->GetSize(); 157 u64 size = backend->GetSize();
164 cmd_buff[2] = (u32)size; 158 cmd_buff[2] = (u32)size;
165 cmd_buff[3] = size >> 32; 159 cmd_buff[3] = size >> 32;
@@ -169,7 +163,7 @@ public:
169 case FileCommand::SetSize: 163 case FileCommand::SetSize:
170 { 164 {
171 u64 size = cmd_buff[1] | ((u64)cmd_buff[2] << 32); 165 u64 size = cmd_buff[1] | ((u64)cmd_buff[2] << 32);
172 DEBUG_LOG(KERNEL, "SetSize %s %s size=%llu", 166 LOG_TRACE(Service_FS, "SetSize %s %s size=%llu",
173 GetTypeName().c_str(), GetName().c_str(), size); 167 GetTypeName().c_str(), GetName().c_str(), size);
174 backend->SetSize(size); 168 backend->SetSize(size);
175 break; 169 break;
@@ -177,14 +171,14 @@ public:
177 171
178 case FileCommand::Close: 172 case FileCommand::Close:
179 { 173 {
180 DEBUG_LOG(KERNEL, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); 174 LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str());
181 Kernel::g_object_pool.Destroy<File>(GetHandle()); 175 Kernel::g_object_pool.Destroy<File>(GetHandle());
182 break; 176 break;
183 } 177 }
184 178
185 // Unknown command... 179 // Unknown command...
186 default: 180 default:
187 ERROR_LOG(KERNEL, "Unknown command=0x%08X!", cmd); 181 LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd);
188 ResultCode error = UnimplementedFunction(ErrorModule::FS); 182 ResultCode error = UnimplementedFunction(ErrorModule::FS);
189 cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. 183 cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
190 return error; 184 return error;
@@ -192,12 +186,6 @@ public:
192 cmd_buff[1] = 0; // No error 186 cmd_buff[1] = 0; // No error
193 return MakeResult<bool>(false); 187 return MakeResult<bool>(false);
194 } 188 }
195
196 ResultVal<bool> WaitSynchronization() override {
197 // TODO(bunnei): ImplementMe
198 ERROR_LOG(OSHLE, "(UNIMPLEMENTED)");
199 return UnimplementedFunction(ErrorModule::FS);
200 }
201}; 189};
202 190
203class Directory : public Object { 191class Directory : public Object {
@@ -222,7 +210,7 @@ public:
222 u32 count = cmd_buff[1]; 210 u32 count = cmd_buff[1];
223 u32 address = cmd_buff[3]; 211 u32 address = cmd_buff[3];
224 auto entries = reinterpret_cast<FileSys::Entry*>(Memory::GetPointer(address)); 212 auto entries = reinterpret_cast<FileSys::Entry*>(Memory::GetPointer(address));
225 DEBUG_LOG(KERNEL, "Read %s %s: count=%d", 213 LOG_TRACE(Service_FS, "Read %s %s: count=%d",
226 GetTypeName().c_str(), GetName().c_str(), count); 214 GetTypeName().c_str(), GetName().c_str(), count);
227 215
228 // Number of entries actually read 216 // Number of entries actually read
@@ -232,14 +220,14 @@ public:
232 220
233 case DirectoryCommand::Close: 221 case DirectoryCommand::Close:
234 { 222 {
235 DEBUG_LOG(KERNEL, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); 223 LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str());
236 Kernel::g_object_pool.Destroy<Directory>(GetHandle()); 224 Kernel::g_object_pool.Destroy<Directory>(GetHandle());
237 break; 225 break;
238 } 226 }
239 227
240 // Unknown command... 228 // Unknown command...
241 default: 229 default:
242 ERROR_LOG(KERNEL, "Unknown command=0x%08X!", cmd); 230 LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd);
243 ResultCode error = UnimplementedFunction(ErrorModule::FS); 231 ResultCode error = UnimplementedFunction(ErrorModule::FS);
244 cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. 232 cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
245 return error; 233 return error;
@@ -247,12 +235,6 @@ public:
247 cmd_buff[1] = 0; // No error 235 cmd_buff[1] = 0; // No error
248 return MakeResult<bool>(false); 236 return MakeResult<bool>(false);
249 } 237 }
250
251 ResultVal<bool> WaitSynchronization() override {
252 // TODO(bunnei): ImplementMe
253 ERROR_LOG(OSHLE, "(UNIMPLEMENTED)");
254 return UnimplementedFunction(ErrorModule::FS);
255 }
256}; 238};
257 239
258//////////////////////////////////////////////////////////////////////////////////////////////////// 240////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -272,11 +254,11 @@ ResultVal<Handle> OpenArchive(FileSys::Archive::IdCode id_code) {
272ResultCode CloseArchive(FileSys::Archive::IdCode id_code) { 254ResultCode CloseArchive(FileSys::Archive::IdCode id_code) {
273 auto itr = g_archive_map.find(id_code); 255 auto itr = g_archive_map.find(id_code);
274 if (itr == g_archive_map.end()) { 256 if (itr == g_archive_map.end()) {
275 ERROR_LOG(KERNEL, "Cannot close archive %d, does not exist!", (int)id_code); 257 LOG_ERROR(Service_FS, "Cannot close archive %d, does not exist!", (int)id_code);
276 return InvalidHandle(ErrorModule::FS); 258 return InvalidHandle(ErrorModule::FS);
277 } 259 }
278 260
279 INFO_LOG(KERNEL, "Closed archive %d", (int) id_code); 261 LOG_TRACE(Service_FS, "Closed archive %d", (int) id_code);
280 return RESULT_SUCCESS; 262 return RESULT_SUCCESS;
281} 263}
282 264
@@ -288,11 +270,11 @@ ResultCode MountArchive(Archive* archive) {
288 FileSys::Archive::IdCode id_code = archive->backend->GetIdCode(); 270 FileSys::Archive::IdCode id_code = archive->backend->GetIdCode();
289 ResultVal<Handle> archive_handle = OpenArchive(id_code); 271 ResultVal<Handle> archive_handle = OpenArchive(id_code);
290 if (archive_handle.Succeeded()) { 272 if (archive_handle.Succeeded()) {
291 ERROR_LOG(KERNEL, "Cannot mount two archives with the same ID code! (%d)", (int) id_code); 273 LOG_ERROR(Service_FS, "Cannot mount two archives with the same ID code! (%d)", (int) id_code);
292 return archive_handle.Code(); 274 return archive_handle.Code();
293 } 275 }
294 g_archive_map[id_code] = archive->GetHandle(); 276 g_archive_map[id_code] = archive->GetHandle();
295 INFO_LOG(KERNEL, "Mounted archive %s", archive->GetName().c_str()); 277 LOG_TRACE(Service_FS, "Mounted archive %s", archive->GetName().c_str());
296 return RESULT_SUCCESS; 278 return RESULT_SUCCESS;
297} 279}
298 280
@@ -442,7 +424,7 @@ void ArchiveInit() {
442 if (archive->Initialize()) 424 if (archive->Initialize())
443 CreateArchive(archive, "SDMC"); 425 CreateArchive(archive, "SDMC");
444 else 426 else
445 ERROR_LOG(KERNEL, "Can't instantiate SDMC archive with path %s", sdmc_directory.c_str()); 427 LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path %s", sdmc_directory.c_str());
446} 428}
447 429
448/// Shutdown archives 430/// Shutdown archives
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 80a34c2d5..b38be0a49 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -35,7 +35,7 @@ Handle ObjectPool::Create(Object* obj, int range_bottom, int range_top) {
35 return i + HANDLE_OFFSET; 35 return i + HANDLE_OFFSET;
36 } 36 }
37 } 37 }
38 ERROR_LOG(HLE, "Unable to allocate kernel object, too many objects slots in use."); 38 LOG_ERROR(Kernel, "Unable to allocate kernel object, too many objects slots in use.");
39 return 0; 39 return 0;
40} 40}
41 41
@@ -62,7 +62,7 @@ void ObjectPool::Clear() {
62 62
63Object* &ObjectPool::operator [](Handle handle) 63Object* &ObjectPool::operator [](Handle handle)
64{ 64{
65 _dbg_assert_msg_(KERNEL, IsValid(handle), "GRABBING UNALLOCED KERNEL OBJ"); 65 _dbg_assert_msg_(Kernel, IsValid(handle), "GRABBING UNALLOCED KERNEL OBJ");
66 return pool[handle - HANDLE_OFFSET]; 66 return pool[handle - HANDLE_OFFSET];
67} 67}
68 68
@@ -70,7 +70,7 @@ void ObjectPool::List() {
70 for (int i = 0; i < MAX_COUNT; i++) { 70 for (int i = 0; i < MAX_COUNT; i++) {
71 if (occupied[i]) { 71 if (occupied[i]) {
72 if (pool[i]) { 72 if (pool[i]) {
73 INFO_LOG(KERNEL, "KO %i: %s \"%s\"", i + HANDLE_OFFSET, pool[i]->GetTypeName().c_str(), 73 LOG_DEBUG(Kernel, "KO %i: %s \"%s\"", i + HANDLE_OFFSET, pool[i]->GetTypeName().c_str(),
74 pool[i]->GetName().c_str()); 74 pool[i]->GetName().c_str());
75 } 75 }
76 } 76 }
@@ -82,7 +82,7 @@ int ObjectPool::GetCount() const {
82} 82}
83 83
84Object* ObjectPool::CreateByIDType(int type) { 84Object* ObjectPool::CreateByIDType(int type) {
85 ERROR_LOG(COMMON, "Unimplemented: %d.", type); 85 LOG_ERROR(Kernel, "Unimplemented: %d.", type);
86 return nullptr; 86 return nullptr;
87} 87}
88 88
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 00a2228bf..00f9b57fc 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -57,7 +57,7 @@ public:
57 * @return True if the current thread should wait as a result of the sync 57 * @return True if the current thread should wait as a result of the sync
58 */ 58 */
59 virtual ResultVal<bool> SyncRequest() { 59 virtual ResultVal<bool> SyncRequest() {
60 ERROR_LOG(KERNEL, "(UNIMPLEMENTED)"); 60 LOG_ERROR(Kernel, "(UNIMPLEMENTED)");
61 return UnimplementedFunction(ErrorModule::Kernel); 61 return UnimplementedFunction(ErrorModule::Kernel);
62 } 62 }
63 63
@@ -65,7 +65,10 @@ public:
65 * Wait for kernel object to synchronize. 65 * Wait for kernel object to synchronize.
66 * @return True if the current thread should wait as a result of the wait 66 * @return True if the current thread should wait as a result of the wait
67 */ 67 */
68 virtual ResultVal<bool> WaitSynchronization() = 0; 68 virtual ResultVal<bool> WaitSynchronization() {
69 LOG_ERROR(Kernel, "(UNIMPLEMENTED)");
70 return UnimplementedFunction(ErrorModule::Kernel);
71 }
69}; 72};
70 73
71class ObjectPool : NonCopyable { 74class ObjectPool : NonCopyable {
@@ -92,13 +95,13 @@ public:
92 T* Get(Handle handle) { 95 T* Get(Handle handle) {
93 if (handle < HANDLE_OFFSET || handle >= HANDLE_OFFSET + MAX_COUNT || !occupied[handle - HANDLE_OFFSET]) { 96 if (handle < HANDLE_OFFSET || handle >= HANDLE_OFFSET + MAX_COUNT || !occupied[handle - HANDLE_OFFSET]) {
94 if (handle != 0) { 97 if (handle != 0) {
95 WARN_LOG(KERNEL, "Kernel: Bad object handle %i (%08x)", handle, handle); 98 LOG_ERROR(Kernel, "Bad object handle %08x", handle, handle);
96 } 99 }
97 return nullptr; 100 return nullptr;
98 } else { 101 } else {
99 Object* t = pool[handle - HANDLE_OFFSET]; 102 Object* t = pool[handle - HANDLE_OFFSET];
100 if (t->GetHandleType() != T::GetStaticHandleType()) { 103 if (t->GetHandleType() != T::GetStaticHandleType()) {
101 WARN_LOG(KERNEL, "Kernel: Wrong object type for %i (%08x)", handle, handle); 104 LOG_ERROR(Kernel, "Wrong object type for %08x", handle, handle);
102 return nullptr; 105 return nullptr;
103 } 106 }
104 return static_cast<T*>(t); 107 return static_cast<T*>(t);
@@ -109,7 +112,7 @@ public:
109 template <class T> 112 template <class T>
110 T *GetFast(Handle handle) { 113 T *GetFast(Handle handle) {
111 const Handle realHandle = handle - HANDLE_OFFSET; 114 const Handle realHandle = handle - HANDLE_OFFSET;
112 _dbg_assert_(KERNEL, realHandle >= 0 && realHandle < MAX_COUNT && occupied[realHandle]); 115 _dbg_assert_(Kernel, realHandle >= 0 && realHandle < MAX_COUNT && occupied[realHandle]);
113 return static_cast<T*>(pool[realHandle]); 116 return static_cast<T*>(pool[realHandle]);
114 } 117 }
115 118
@@ -130,8 +133,8 @@ public:
130 133
131 bool GetIDType(Handle handle, HandleType* type) const { 134 bool GetIDType(Handle handle, HandleType* type) const {
132 if ((handle < HANDLE_OFFSET) || (handle >= HANDLE_OFFSET + MAX_COUNT) || 135 if ((handle < HANDLE_OFFSET) || (handle >= HANDLE_OFFSET + MAX_COUNT) ||
133 !occupied[handle - HANDLE_OFFSET]) { 136 !occupied[handle - HANDLE_OFFSET]) {
134 ERROR_LOG(KERNEL, "Kernel: Bad object handle %i (%08x)", handle, handle); 137 LOG_ERROR(Kernel, "Bad object handle %08X", handle, handle);
135 return false; 138 return false;
136 } 139 }
137 Object* t = pool[handle - HANDLE_OFFSET]; 140 Object* t = pool[handle - HANDLE_OFFSET];
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index cfcc0e0b7..3c8c502c6 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -16,12 +16,6 @@ public:
16 static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::SharedMemory; } 16 static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::SharedMemory; }
17 Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::SharedMemory; } 17 Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::SharedMemory; }
18 18
19 ResultVal<bool> WaitSynchronization() override {
20 // TODO(bunnei): ImplementMe
21 ERROR_LOG(OSHLE, "(UNIMPLEMENTED)");
22 return UnimplementedFunction(ErrorModule::OS);
23 }
24
25 u32 base_address; ///< Address of shared memory block in RAM 19 u32 base_address; ///< Address of shared memory block in RAM
26 MemoryPermission permissions; ///< Permissions of shared memory block (SVC field) 20 MemoryPermission permissions; ///< Permissions of shared memory block (SVC field)
27 MemoryPermission other_permissions; ///< Other permissions of shared memory block (SVC field) 21 MemoryPermission other_permissions; ///< Other permissions of shared memory block (SVC field)
@@ -61,7 +55,7 @@ ResultCode MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions
61 MemoryPermission other_permissions) { 55 MemoryPermission other_permissions) {
62 56
63 if (address < Memory::SHARED_MEMORY_VADDR || address >= Memory::SHARED_MEMORY_VADDR_END) { 57 if (address < Memory::SHARED_MEMORY_VADDR || address >= Memory::SHARED_MEMORY_VADDR_END) {
64 ERROR_LOG(KERNEL, "cannot map handle=0x%08X, address=0x%08X outside of shared mem bounds!", 58 LOG_ERROR(Kernel_SVC, "cannot map handle=0x%08X, address=0x%08X outside of shared mem bounds!",
65 handle, address); 59 handle, address);
66 return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::Kernel, 60 return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::Kernel,
67 ErrorSummary::InvalidArgument, ErrorLevel::Permanent); 61 ErrorSummary::InvalidArgument, ErrorLevel::Permanent);
@@ -83,7 +77,7 @@ ResultVal<u8*> GetSharedMemoryPointer(Handle handle, u32 offset) {
83 if (0 != shared_memory->base_address) 77 if (0 != shared_memory->base_address)
84 return MakeResult<u8*>(Memory::GetPointer(shared_memory->base_address + offset)); 78 return MakeResult<u8*>(Memory::GetPointer(shared_memory->base_address + offset));
85 79
86 ERROR_LOG(KERNEL, "memory block handle=0x%08X not mapped!", handle); 80 LOG_ERROR(Kernel_SVC, "memory block handle=0x%08X not mapped!", handle);
87 // TODO(yuriks): Verify error code. 81 // TODO(yuriks): Verify error code.
88 return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::Kernel, 82 return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::Kernel,
89 ErrorSummary::InvalidState, ErrorLevel::Permanent); 83 ErrorSummary::InvalidState, ErrorLevel::Permanent);
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 492b917e1..1c04701de 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -150,13 +150,13 @@ void ChangeReadyState(Thread* t, bool ready) {
150 150
151/// Verify that a thread has not been released from waiting 151/// Verify that a thread has not been released from waiting
152static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle) { 152static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle) {
153 _dbg_assert_(KERNEL, thread != nullptr); 153 _dbg_assert_(Kernel, thread != nullptr);
154 return (type == thread->wait_type) && (wait_handle == thread->wait_handle) && (thread->IsWaiting()); 154 return (type == thread->wait_type) && (wait_handle == thread->wait_handle) && (thread->IsWaiting());
155} 155}
156 156
157/// Verify that a thread has not been released from waiting (with wait address) 157/// Verify that a thread has not been released from waiting (with wait address)
158static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle, VAddr wait_address) { 158static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle, VAddr wait_address) {
159 _dbg_assert_(KERNEL, thread != nullptr); 159 _dbg_assert_(Kernel, thread != nullptr);
160 return VerifyWait(thread, type, wait_handle) && (wait_address == thread->wait_address); 160 return VerifyWait(thread, type, wait_handle) && (wait_address == thread->wait_address);
161} 161}
162 162
@@ -196,7 +196,7 @@ void ChangeThreadState(Thread* t, ThreadStatus new_status) {
196 196
197 if (new_status == THREADSTATUS_WAIT) { 197 if (new_status == THREADSTATUS_WAIT) {
198 if (t->wait_type == WAITTYPE_NONE) { 198 if (t->wait_type == WAITTYPE_NONE) {
199 ERROR_LOG(KERNEL, "Waittype none not allowed"); 199 LOG_ERROR(Kernel, "Waittype none not allowed");
200 } 200 }
201 } 201 }
202} 202}
@@ -318,12 +318,12 @@ void DebugThreadQueue() {
318 if (!thread) { 318 if (!thread) {
319 return; 319 return;
320 } 320 }
321 INFO_LOG(KERNEL, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThreadHandle()); 321 LOG_DEBUG(Kernel, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThreadHandle());
322 for (u32 i = 0; i < thread_queue.size(); i++) { 322 for (u32 i = 0; i < thread_queue.size(); i++) {
323 Handle handle = thread_queue[i]; 323 Handle handle = thread_queue[i];
324 s32 priority = thread_ready_queue.contains(handle); 324 s32 priority = thread_ready_queue.contains(handle);
325 if (priority != -1) { 325 if (priority != -1) {
326 INFO_LOG(KERNEL, "0x%02X 0x%08X", priority, handle); 326 LOG_DEBUG(Kernel, "0x%02X 0x%08X", priority, handle);
327 } 327 }
328 } 328 }
329} 329}
@@ -333,7 +333,7 @@ Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 prio
333 s32 processor_id, u32 stack_top, int stack_size) { 333 s32 processor_id, u32 stack_top, int stack_size) {
334 334
335 _assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST), 335 _assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST),
336 "CreateThread priority=%d, outside of allowable range!", priority) 336 "priority=%d, outside of allowable range!", priority)
337 337
338 Thread* thread = new Thread; 338 Thread* thread = new Thread;
339 339
@@ -362,24 +362,24 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3
362 u32 stack_top, int stack_size) { 362 u32 stack_top, int stack_size) {
363 363
364 if (name == nullptr) { 364 if (name == nullptr) {
365 ERROR_LOG(KERNEL, "CreateThread(): nullptr name"); 365 LOG_ERROR(Kernel_SVC, "nullptr name");
366 return -1; 366 return -1;
367 } 367 }
368 if ((u32)stack_size < 0x200) { 368 if ((u32)stack_size < 0x200) {
369 ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid stack_size=0x%08X", name, 369 LOG_ERROR(Kernel_SVC, "(name=%s): invalid stack_size=0x%08X", name,
370 stack_size); 370 stack_size);
371 return -1; 371 return -1;
372 } 372 }
373 if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { 373 if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) {
374 s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); 374 s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
375 WARN_LOG(KERNEL, "CreateThread(name=%s): invalid priority=0x%08X, clamping to %08X", 375 LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d",
376 name, priority, new_priority); 376 name, priority, new_priority);
377 // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm 377 // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm
378 // validity of this 378 // validity of this
379 priority = new_priority; 379 priority = new_priority;
380 } 380 }
381 if (!Memory::GetPointer(entry_point)) { 381 if (!Memory::GetPointer(entry_point)) {
382 ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid entry %08x", name, entry_point); 382 LOG_ERROR(Kernel_SVC, "(name=%s): invalid entry %08x", name, entry_point);
383 return -1; 383 return -1;
384 } 384 }
385 Handle handle; 385 Handle handle;
@@ -416,7 +416,7 @@ ResultCode SetThreadPriority(Handle handle, s32 priority) {
416 // If priority is invalid, clamp to valid range 416 // If priority is invalid, clamp to valid range
417 if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { 417 if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) {
418 s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); 418 s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST);
419 WARN_LOG(KERNEL, "invalid priority=0x%08X, clamping to %08X", priority, new_priority); 419 LOG_WARNING(Kernel_SVC, "invalid priority=%d, clamping to %d", priority, new_priority);
420 // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm 420 // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm
421 // validity of this 421 // validity of this
422 priority = new_priority; 422 priority = new_priority;
@@ -470,7 +470,7 @@ void Reschedule() {
470 Thread* next = NextThread(); 470 Thread* next = NextThread();
471 HLE::g_reschedule = false; 471 HLE::g_reschedule = false;
472 if (next > 0) { 472 if (next > 0) {
473 INFO_LOG(KERNEL, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle()); 473 LOG_TRACE(Kernel, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle());
474 474
475 SwitchContext(next); 475 SwitchContext(next);
476 476
diff --git a/src/core/hle/service/ac_u.cpp b/src/core/hle/service/ac_u.cpp
index 46aee40d6..4130feb9d 100644
--- a/src/core/hle/service/ac_u.cpp
+++ b/src/core/hle/service/ac_u.cpp
@@ -26,7 +26,7 @@ void GetWifiStatus(Service::Interface* self) {
26 cmd_buff[1] = 0; // No error 26 cmd_buff[1] = 0; // No error
27 cmd_buff[2] = 0; // Connection type set to none 27 cmd_buff[2] = 0; // Connection type set to none
28 28
29 WARN_LOG(KERNEL, "(STUBBED) called"); 29 LOG_WARNING(Service_AC, "(STUBBED) called");
30} 30}
31 31
32const Interface::FunctionInfo FunctionTable[] = { 32const Interface::FunctionInfo FunctionTable[] = {
diff --git a/src/core/hle/service/apt_u.cpp b/src/core/hle/service/apt_u.cpp
index 181763724..b6d5d101f 100644
--- a/src/core/hle/service/apt_u.cpp
+++ b/src/core/hle/service/apt_u.cpp
@@ -53,7 +53,7 @@ void Initialize(Service::Interface* self) {
53 53
54 cmd_buff[1] = 0; // No error 54 cmd_buff[1] = 0; // No error
55 55
56 DEBUG_LOG(KERNEL, "called"); 56 LOG_DEBUG(Service_APT, "called");
57} 57}
58 58
59void GetLockHandle(Service::Interface* self) { 59void GetLockHandle(Service::Interface* self) {
@@ -74,14 +74,14 @@ void GetLockHandle(Service::Interface* self) {
74 cmd_buff[4] = 0; 74 cmd_buff[4] = 0;
75 75
76 cmd_buff[5] = lock_handle; 76 cmd_buff[5] = lock_handle;
77 DEBUG_LOG(KERNEL, "called handle=0x%08X", cmd_buff[5]); 77 LOG_TRACE(Service_APT, "called handle=0x%08X", cmd_buff[5]);
78} 78}
79 79
80void Enable(Service::Interface* self) { 80void Enable(Service::Interface* self) {
81 u32* cmd_buff = Service::GetCommandBuffer(); 81 u32* cmd_buff = Service::GetCommandBuffer();
82 u32 unk = cmd_buff[1]; // TODO(bunnei): What is this field used for? 82 u32 unk = cmd_buff[1]; // TODO(bunnei): What is this field used for?
83 cmd_buff[1] = 0; // No error 83 cmd_buff[1] = 0; // No error
84 WARN_LOG(KERNEL, "(STUBBED) called unk=0x%08X", unk); 84 LOG_WARNING(Service_APT, "(STUBBED) called unk=0x%08X", unk);
85} 85}
86 86
87void InquireNotification(Service::Interface* self) { 87void InquireNotification(Service::Interface* self) {
@@ -89,7 +89,7 @@ void InquireNotification(Service::Interface* self) {
89 u32 app_id = cmd_buff[2]; 89 u32 app_id = cmd_buff[2];
90 cmd_buff[1] = 0; // No error 90 cmd_buff[1] = 0; // No error
91 cmd_buff[2] = static_cast<u32>(SignalType::None); // Signal type 91 cmd_buff[2] = static_cast<u32>(SignalType::None); // Signal type
92 WARN_LOG(KERNEL, "(STUBBED) called app_id=0x%08X", app_id); 92 LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id);
93} 93}
94 94
95/** 95/**
@@ -122,7 +122,7 @@ void ReceiveParameter(Service::Interface* self) {
122 cmd_buff[5] = 0; 122 cmd_buff[5] = 0;
123 cmd_buff[6] = 0; 123 cmd_buff[6] = 0;
124 cmd_buff[7] = 0; 124 cmd_buff[7] = 0;
125 WARN_LOG(KERNEL, "(STUBBED) called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size); 125 LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size);
126} 126}
127 127
128/** 128/**
@@ -155,7 +155,7 @@ void GlanceParameter(Service::Interface* self) {
155 cmd_buff[6] = 0; 155 cmd_buff[6] = 0;
156 cmd_buff[7] = 0; 156 cmd_buff[7] = 0;
157 157
158 WARN_LOG(KERNEL, "(STUBBED) called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size); 158 LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size);
159} 159}
160 160
161/** 161/**
@@ -181,7 +181,7 @@ void AppletUtility(Service::Interface* self) {
181 181
182 cmd_buff[1] = 0; // No error 182 cmd_buff[1] = 0; // No error
183 183
184 WARN_LOG(KERNEL, "(STUBBED) called unk=0x%08X, buffer1_size=0x%08x, buffer2_size=0x%08x, " 184 LOG_WARNING(Service_APT, "(STUBBED) called unk=0x%08X, buffer1_size=0x%08x, buffer2_size=0x%08x, "
185 "buffer1_addr=0x%08x, buffer2_addr=0x%08x", unk, buffer1_size, buffer2_size, 185 "buffer1_addr=0x%08x, buffer2_addr=0x%08x", unk, buffer1_size, buffer2_size,
186 buffer1_addr, buffer2_addr); 186 buffer1_addr, buffer2_addr);
187} 187}
@@ -194,7 +194,7 @@ void AppletUtility(Service::Interface* self) {
194 * 4 : Handle to shared font memory 194 * 4 : Handle to shared font memory
195 */ 195 */
196void GetSharedFont(Service::Interface* self) { 196void GetSharedFont(Service::Interface* self) {
197 DEBUG_LOG(KERNEL, "called"); 197 LOG_TRACE(Kernel_SVC, "called");
198 198
199 u32* cmd_buff = Service::GetCommandBuffer(); 199 u32* cmd_buff = Service::GetCommandBuffer();
200 200
@@ -210,7 +210,7 @@ void GetSharedFont(Service::Interface* self) {
210 cmd_buff[4] = shared_font_mem; 210 cmd_buff[4] = shared_font_mem;
211 } else { 211 } else {
212 cmd_buff[1] = -1; // Generic error (not really possible to verify this on hardware) 212 cmd_buff[1] = -1; // Generic error (not really possible to verify this on hardware)
213 ERROR_LOG(KERNEL, "called, but %s has not been loaded!", SHARED_FONT); 213 LOG_ERROR(Kernel_SVC, "called, but %s has not been loaded!", SHARED_FONT);
214 } 214 }
215} 215}
216 216
@@ -321,7 +321,7 @@ Interface::Interface() {
321 // Create shared font memory object 321 // Create shared font memory object
322 shared_font_mem = Kernel::CreateSharedMemory("APT_U:shared_font_mem"); 322 shared_font_mem = Kernel::CreateSharedMemory("APT_U:shared_font_mem");
323 } else { 323 } else {
324 WARN_LOG(KERNEL, "Unable to load shared font: %s", filepath.c_str()); 324 LOG_WARNING(Service_APT, "Unable to load shared font: %s", filepath.c_str());
325 shared_font_mem = 0; 325 shared_font_mem = 0;
326 } 326 }
327 327
diff --git a/src/core/hle/service/cfg_u.cpp b/src/core/hle/service/cfg_u.cpp
index 82bab5797..972cc0534 100644
--- a/src/core/hle/service/cfg_u.cpp
+++ b/src/core/hle/service/cfg_u.cpp
@@ -56,7 +56,7 @@ static void GetCountryCodeString(Service::Interface* self) {
56 u32 country_code_id = cmd_buffer[1]; 56 u32 country_code_id = cmd_buffer[1];
57 57
58 if (country_code_id >= country_codes.size() || 0 == country_codes[country_code_id]) { 58 if (country_code_id >= country_codes.size() || 0 == country_codes[country_code_id]) {
59 ERROR_LOG(KERNEL, "requested country code id=%d is invalid", country_code_id); 59 LOG_ERROR(Service_CFG, "requested country code id=%d is invalid", country_code_id);
60 cmd_buffer[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw; 60 cmd_buffer[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw;
61 return; 61 return;
62 } 62 }
@@ -79,7 +79,7 @@ static void GetCountryCodeID(Service::Interface* self) {
79 u16 country_code_id = 0; 79 u16 country_code_id = 0;
80 80
81 // The following algorithm will fail if the first country code isn't 0. 81 // The following algorithm will fail if the first country code isn't 0.
82 _dbg_assert_(HLE, country_codes[0] == 0); 82 _dbg_assert_(Service_CFG, country_codes[0] == 0);
83 83
84 for (size_t id = 0; id < country_codes.size(); ++id) { 84 for (size_t id = 0; id < country_codes.size(); ++id) {
85 if (country_codes[id] == country_code) { 85 if (country_codes[id] == country_code) {
@@ -89,7 +89,7 @@ static void GetCountryCodeID(Service::Interface* self) {
89 } 89 }
90 90
91 if (0 == country_code_id) { 91 if (0 == country_code_id) {
92 ERROR_LOG(KERNEL, "requested country code name=%c%c is invalid", country_code & 0xff, country_code >> 8); 92 LOG_ERROR(Service_CFG, "requested country code name=%c%c is invalid", country_code & 0xff, country_code >> 8);
93 cmd_buffer[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw; 93 cmd_buffer[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw;
94 cmd_buffer[2] = 0xFFFF; 94 cmd_buffer[2] = 0xFFFF;
95 return; 95 return;
diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp
index e89c8aae3..ce1c9938d 100644
--- a/src/core/hle/service/dsp_dsp.cpp
+++ b/src/core/hle/service/dsp_dsp.cpp
@@ -32,7 +32,7 @@ void ConvertProcessAddressFromDspDram(Service::Interface* self) {
32 cmd_buff[1] = 0; // No error 32 cmd_buff[1] = 0; // No error
33 cmd_buff[2] = (addr << 1) + (Memory::DSP_MEMORY_VADDR + 0x40000); 33 cmd_buff[2] = (addr << 1) + (Memory::DSP_MEMORY_VADDR + 0x40000);
34 34
35 DEBUG_LOG(KERNEL, "(STUBBED) called with address %u", addr); 35 LOG_WARNING(Service_DSP, "(STUBBED) called with address %u", addr);
36} 36}
37 37
38/** 38/**
@@ -55,7 +55,7 @@ void LoadComponent(Service::Interface* self) {
55 55
56 // TODO(bunnei): Implement real DSP firmware loading 56 // TODO(bunnei): Implement real DSP firmware loading
57 57
58 DEBUG_LOG(KERNEL, "(STUBBED) called"); 58 LOG_WARNING(Service_DSP, "(STUBBED) called");
59} 59}
60 60
61/** 61/**
@@ -70,7 +70,7 @@ void GetSemaphoreEventHandle(Service::Interface* self) {
70 cmd_buff[1] = 0; // No error 70 cmd_buff[1] = 0; // No error
71 cmd_buff[3] = semaphore_event; // Event handle 71 cmd_buff[3] = semaphore_event; // Event handle
72 72
73 DEBUG_LOG(KERNEL, "(STUBBED) called"); 73 LOG_WARNING(Service_DSP, "(STUBBED) called");
74} 74}
75 75
76/** 76/**
@@ -89,7 +89,7 @@ void RegisterInterruptEvents(Service::Interface* self) {
89 89
90 cmd_buff[1] = 0; // No error 90 cmd_buff[1] = 0; // No error
91 91
92 DEBUG_LOG(KERNEL, "(STUBBED) called"); 92 LOG_WARNING(Service_DSP, "(STUBBED) called");
93} 93}
94 94
95/** 95/**
@@ -106,7 +106,7 @@ void WriteReg0x10(Service::Interface* self) {
106 106
107 cmd_buff[1] = 0; // No error 107 cmd_buff[1] = 0; // No error
108 108
109 DEBUG_LOG(KERNEL, "(STUBBED) called"); 109 LOG_WARNING(Service_DSP, "(STUBBED) called");
110} 110}
111 111
112/** 112/**
@@ -140,7 +140,7 @@ void ReadPipeIfPossible(Service::Interface* self) {
140 Memory::Write16(addr + offset, canned_read_pipe[read_pipe_count]); 140 Memory::Write16(addr + offset, canned_read_pipe[read_pipe_count]);
141 read_pipe_count++; 141 read_pipe_count++;
142 } else { 142 } else {
143 ERROR_LOG(KERNEL, "canned read pipe log exceeded!"); 143 LOG_ERROR(Service_DSP, "canned read pipe log exceeded!");
144 break; 144 break;
145 } 145 }
146 } 146 }
@@ -148,7 +148,7 @@ void ReadPipeIfPossible(Service::Interface* self) {
148 cmd_buff[1] = 0; // No error 148 cmd_buff[1] = 0; // No error
149 cmd_buff[2] = (read_pipe_count - initial_size) * sizeof(u16); 149 cmd_buff[2] = (read_pipe_count - initial_size) * sizeof(u16);
150 150
151 DEBUG_LOG(KERNEL, "(STUBBED) called size=0x%08X, buffer=0x%08X", size, addr); 151 LOG_WARNING(Service_DSP, "(STUBBED) called size=0x%08X, buffer=0x%08X", size, addr);
152} 152}
153 153
154const Interface::FunctionInfo FunctionTable[] = { 154const Interface::FunctionInfo FunctionTable[] = {
diff --git a/src/core/hle/service/fs_user.cpp b/src/core/hle/service/fs_user.cpp
index 51e8b579e..9bda4fe8a 100644
--- a/src/core/hle/service/fs_user.cpp
+++ b/src/core/hle/service/fs_user.cpp
@@ -23,7 +23,7 @@ static void Initialize(Service::Interface* self) {
23 // http://3dbrew.org/wiki/FS:Initialize#Request 23 // http://3dbrew.org/wiki/FS:Initialize#Request
24 cmd_buff[1] = RESULT_SUCCESS.raw; 24 cmd_buff[1] = RESULT_SUCCESS.raw;
25 25
26 DEBUG_LOG(KERNEL, "called"); 26 LOG_DEBUG(Service_FS, "called");
27} 27}
28 28
29/** 29/**
@@ -55,17 +55,15 @@ static void OpenFile(Service::Interface* self) {
55 u32 filename_ptr = cmd_buff[9]; 55 u32 filename_ptr = cmd_buff[9];
56 FileSys::Path file_path(filename_type, filename_size, filename_ptr); 56 FileSys::Path file_path(filename_type, filename_size, filename_ptr);
57 57
58 DEBUG_LOG(KERNEL, "path=%s, mode=%d attrs=%u", file_path.DebugStr().c_str(), mode.hex, attributes); 58 LOG_DEBUG(Service_FS, "path=%s, mode=%d attrs=%u", file_path.DebugStr().c_str(), mode.hex, attributes);
59 59
60 ResultVal<Handle> handle = Kernel::OpenFileFromArchive(archive_handle, file_path, mode); 60 ResultVal<Handle> handle = Kernel::OpenFileFromArchive(archive_handle, file_path, mode);
61 cmd_buff[1] = handle.Code().raw; 61 cmd_buff[1] = handle.Code().raw;
62 if (handle.Succeeded()) { 62 if (handle.Succeeded()) {
63 cmd_buff[3] = *handle; 63 cmd_buff[3] = *handle;
64 } else { 64 } else {
65 ERROR_LOG(KERNEL, "failed to get a handle for file %s", file_path.DebugStr().c_str()); 65 LOG_ERROR(Service_FS, "failed to get a handle for file %s", file_path.DebugStr().c_str());
66 } 66 }
67
68 DEBUG_LOG(KERNEL, "called");
69} 67}
70 68
71/** 69/**
@@ -102,11 +100,11 @@ static void OpenFileDirectly(Service::Interface* self) {
102 FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); 100 FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr);
103 FileSys::Path file_path(filename_type, filename_size, filename_ptr); 101 FileSys::Path file_path(filename_type, filename_size, filename_ptr);
104 102
105 DEBUG_LOG(KERNEL, "archive_path=%s file_path=%s, mode=%u attributes=%d", 103 LOG_DEBUG(Service_FS, "archive_path=%s file_path=%s, mode=%u attributes=%d",
106 archive_path.DebugStr().c_str(), file_path.DebugStr().c_str(), mode.hex, attributes); 104 archive_path.DebugStr().c_str(), file_path.DebugStr().c_str(), mode.hex, attributes);
107 105
108 if (archive_path.GetType() != FileSys::Empty) { 106 if (archive_path.GetType() != FileSys::Empty) {
109 ERROR_LOG(KERNEL, "archive LowPath type other than empty is currently unsupported"); 107 LOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported");
110 cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw; 108 cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw;
111 return; 109 return;
112 } 110 }
@@ -116,7 +114,7 @@ static void OpenFileDirectly(Service::Interface* self) {
116 ResultVal<Handle> archive_handle = Kernel::OpenArchive(archive_id); 114 ResultVal<Handle> archive_handle = Kernel::OpenArchive(archive_id);
117 cmd_buff[1] = archive_handle.Code().raw; 115 cmd_buff[1] = archive_handle.Code().raw;
118 if (archive_handle.Failed()) { 116 if (archive_handle.Failed()) {
119 ERROR_LOG(KERNEL, "failed to get a handle for archive"); 117 LOG_ERROR(Service_FS, "failed to get a handle for archive");
120 return; 118 return;
121 } 119 }
122 // cmd_buff[2] isn't used according to 3dmoo's implementation. 120 // cmd_buff[2] isn't used according to 3dmoo's implementation.
@@ -127,10 +125,8 @@ static void OpenFileDirectly(Service::Interface* self) {
127 if (handle.Succeeded()) { 125 if (handle.Succeeded()) {
128 cmd_buff[3] = *handle; 126 cmd_buff[3] = *handle;
129 } else { 127 } else {
130 ERROR_LOG(KERNEL, "failed to get a handle for file %s", file_path.DebugStr().c_str()); 128 LOG_ERROR(Service_FS, "failed to get a handle for file %s", file_path.DebugStr().c_str());
131 } 129 }
132
133 DEBUG_LOG(KERNEL, "called");
134} 130}
135 131
136/* 132/*
@@ -156,12 +152,10 @@ void DeleteFile(Service::Interface* self) {
156 152
157 FileSys::Path file_path(filename_type, filename_size, filename_ptr); 153 FileSys::Path file_path(filename_type, filename_size, filename_ptr);
158 154
159 DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", 155 LOG_DEBUG(Service_FS, "type=%d size=%d data=%s",
160 filename_type, filename_size, file_path.DebugStr().c_str()); 156 filename_type, filename_size, file_path.DebugStr().c_str());
161 157
162 cmd_buff[1] = Kernel::DeleteFileFromArchive(archive_handle, file_path).raw; 158 cmd_buff[1] = Kernel::DeleteFileFromArchive(archive_handle, file_path).raw;
163
164 DEBUG_LOG(KERNEL, "called");
165} 159}
166 160
167/* 161/*
@@ -197,13 +191,11 @@ void RenameFile(Service::Interface* self) {
197 FileSys::Path src_file_path(src_filename_type, src_filename_size, src_filename_ptr); 191 FileSys::Path src_file_path(src_filename_type, src_filename_size, src_filename_ptr);
198 FileSys::Path dest_file_path(dest_filename_type, dest_filename_size, dest_filename_ptr); 192 FileSys::Path dest_file_path(dest_filename_type, dest_filename_size, dest_filename_ptr);
199 193
200 DEBUG_LOG(KERNEL, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", 194 LOG_DEBUG(Service_FS, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s",
201 src_filename_type, src_filename_size, src_file_path.DebugStr().c_str(), 195 src_filename_type, src_filename_size, src_file_path.DebugStr().c_str(),
202 dest_filename_type, dest_filename_size, dest_file_path.DebugStr().c_str()); 196 dest_filename_type, dest_filename_size, dest_file_path.DebugStr().c_str());
203 197
204 cmd_buff[1] = Kernel::RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, dest_file_path).raw; 198 cmd_buff[1] = Kernel::RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, dest_file_path).raw;
205
206 DEBUG_LOG(KERNEL, "called");
207} 199}
208 200
209/* 201/*
@@ -229,12 +221,10 @@ void DeleteDirectory(Service::Interface* self) {
229 221
230 FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); 222 FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
231 223
232 DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", 224 LOG_DEBUG(Service_FS, "type=%d size=%d data=%s",
233 dirname_type, dirname_size, dir_path.DebugStr().c_str()); 225 dirname_type, dirname_size, dir_path.DebugStr().c_str());
234 226
235 cmd_buff[1] = Kernel::DeleteDirectoryFromArchive(archive_handle, dir_path).raw; 227 cmd_buff[1] = Kernel::DeleteDirectoryFromArchive(archive_handle, dir_path).raw;
236
237 DEBUG_LOG(KERNEL, "called");
238} 228}
239 229
240/* 230/*
@@ -260,11 +250,9 @@ static void CreateDirectory(Service::Interface* self) {
260 250
261 FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); 251 FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
262 252
263 DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str()); 253 LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str());
264 254
265 cmd_buff[1] = Kernel::CreateDirectoryFromArchive(archive_handle, dir_path).raw; 255 cmd_buff[1] = Kernel::CreateDirectoryFromArchive(archive_handle, dir_path).raw;
266
267 DEBUG_LOG(KERNEL, "called");
268} 256}
269 257
270/* 258/*
@@ -300,13 +288,11 @@ void RenameDirectory(Service::Interface* self) {
300 FileSys::Path src_dir_path(src_dirname_type, src_dirname_size, src_dirname_ptr); 288 FileSys::Path src_dir_path(src_dirname_type, src_dirname_size, src_dirname_ptr);
301 FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname_size, dest_dirname_ptr); 289 FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname_size, dest_dirname_ptr);
302 290
303 DEBUG_LOG(KERNEL, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", 291 LOG_DEBUG(Service_FS, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s",
304 src_dirname_type, src_dirname_size, src_dir_path.DebugStr().c_str(), 292 src_dirname_type, src_dirname_size, src_dir_path.DebugStr().c_str(),
305 dest_dirname_type, dest_dirname_size, dest_dir_path.DebugStr().c_str()); 293 dest_dirname_type, dest_dirname_size, dest_dir_path.DebugStr().c_str());
306 294
307 cmd_buff[1] = Kernel::RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, dest_archive_handle, dest_dir_path).raw; 295 cmd_buff[1] = Kernel::RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, dest_archive_handle, dest_dir_path).raw;
308
309 DEBUG_LOG(KERNEL, "called");
310} 296}
311 297
312static void OpenDirectory(Service::Interface* self) { 298static void OpenDirectory(Service::Interface* self) {
@@ -321,17 +307,15 @@ static void OpenDirectory(Service::Interface* self) {
321 307
322 FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); 308 FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
323 309
324 DEBUG_LOG(KERNEL, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str()); 310 LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str());
325 311
326 ResultVal<Handle> handle = Kernel::OpenDirectoryFromArchive(archive_handle, dir_path); 312 ResultVal<Handle> handle = Kernel::OpenDirectoryFromArchive(archive_handle, dir_path);
327 cmd_buff[1] = handle.Code().raw; 313 cmd_buff[1] = handle.Code().raw;
328 if (handle.Succeeded()) { 314 if (handle.Succeeded()) {
329 cmd_buff[3] = *handle; 315 cmd_buff[3] = *handle;
330 } else { 316 } else {
331 ERROR_LOG(KERNEL, "failed to get a handle for directory"); 317 LOG_ERROR(Service_FS, "failed to get a handle for directory");
332 } 318 }
333
334 DEBUG_LOG(KERNEL, "called");
335} 319}
336 320
337/** 321/**
@@ -356,10 +340,10 @@ static void OpenArchive(Service::Interface* self) {
356 u32 archivename_ptr = cmd_buff[5]; 340 u32 archivename_ptr = cmd_buff[5];
357 FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); 341 FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr);
358 342
359 DEBUG_LOG(KERNEL, "archive_path=%s", archive_path.DebugStr().c_str()); 343 LOG_DEBUG(Service_FS, "archive_path=%s", archive_path.DebugStr().c_str());
360 344
361 if (archive_path.GetType() != FileSys::Empty) { 345 if (archive_path.GetType() != FileSys::Empty) {
362 ERROR_LOG(KERNEL, "archive LowPath type other than empty is currently unsupported"); 346 LOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported");
363 cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw; 347 cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw;
364 return; 348 return;
365 } 349 }
@@ -370,10 +354,8 @@ static void OpenArchive(Service::Interface* self) {
370 // cmd_buff[2] isn't used according to 3dmoo's implementation. 354 // cmd_buff[2] isn't used according to 3dmoo's implementation.
371 cmd_buff[3] = *handle; 355 cmd_buff[3] = *handle;
372 } else { 356 } else {
373 ERROR_LOG(KERNEL, "failed to get a handle for archive"); 357 LOG_ERROR(Service_FS, "failed to get a handle for archive");
374 } 358 }
375
376 DEBUG_LOG(KERNEL, "called");
377} 359}
378 360
379/* 361/*
@@ -388,7 +370,7 @@ static void IsSdmcDetected(Service::Interface* self) {
388 cmd_buff[1] = 0; 370 cmd_buff[1] = 0;
389 cmd_buff[2] = Settings::values.use_virtual_sd ? 1 : 0; 371 cmd_buff[2] = Settings::values.use_virtual_sd ? 1 : 0;
390 372
391 DEBUG_LOG(KERNEL, "called"); 373 LOG_DEBUG(Service_FS, "called");
392} 374}
393 375
394const Interface::FunctionInfo FunctionTable[] = { 376const Interface::FunctionInfo FunctionTable[] = {
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index 34eabac45..223800560 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -33,7 +33,7 @@ static inline u8* GetCommandBuffer(u32 thread_id) {
33} 33}
34 34
35static inline FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) { 35static inline FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) {
36 _dbg_assert_msg_(GSP, screen_index < 2, "Invalid screen index"); 36 _dbg_assert_msg_(Service_GSP, screen_index < 2, "Invalid screen index");
37 37
38 // For each thread there are two FrameBufferUpdate fields 38 // For each thread there are two FrameBufferUpdate fields
39 u32 offset = 0x200 + (2 * thread_id + screen_index) * sizeof(FrameBufferUpdate); 39 u32 offset = 0x200 + (2 * thread_id + screen_index) * sizeof(FrameBufferUpdate);
@@ -50,14 +50,14 @@ static inline InterruptRelayQueue* GetInterruptRelayQueue(u32 thread_id) {
50static void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) { 50static void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) {
51 // TODO: Return proper error codes 51 // TODO: Return proper error codes
52 if (base_address + size_in_bytes >= 0x420000) { 52 if (base_address + size_in_bytes >= 0x420000) {
53 ERROR_LOG(GPU, "Write address out of range! (address=0x%08x, size=0x%08x)", 53 LOG_ERROR(Service_GSP, "Write address out of range! (address=0x%08x, size=0x%08x)",
54 base_address, size_in_bytes); 54 base_address, size_in_bytes);
55 return; 55 return;
56 } 56 }
57 57
58 // size should be word-aligned 58 // size should be word-aligned
59 if ((size_in_bytes % 4) != 0) { 59 if ((size_in_bytes % 4) != 0) {
60 ERROR_LOG(GPU, "Invalid size 0x%08x", size_in_bytes); 60 LOG_ERROR(Service_GSP, "Invalid size 0x%08x", size_in_bytes);
61 return; 61 return;
62 } 62 }
63 63
@@ -89,13 +89,13 @@ static void ReadHWRegs(Service::Interface* self) {
89 89
90 // TODO: Return proper error codes 90 // TODO: Return proper error codes
91 if (reg_addr + size >= 0x420000) { 91 if (reg_addr + size >= 0x420000) {
92 ERROR_LOG(GPU, "Read address out of range! (address=0x%08x, size=0x%08x)", reg_addr, size); 92 LOG_ERROR(Service_GSP, "Read address out of range! (address=0x%08x, size=0x%08x)", reg_addr, size);
93 return; 93 return;
94 } 94 }
95 95
96 // size should be word-aligned 96 // size should be word-aligned
97 if ((size % 4) != 0) { 97 if ((size % 4) != 0) {
98 ERROR_LOG(GPU, "Invalid size 0x%08x", size); 98 LOG_ERROR(Service_GSP, "Invalid size 0x%08x", size);
99 return; 99 return;
100 } 100 }
101 101
@@ -177,11 +177,11 @@ static void RegisterInterruptRelayQueue(Service::Interface* self) {
177 */ 177 */
178void SignalInterrupt(InterruptId interrupt_id) { 178void SignalInterrupt(InterruptId interrupt_id) {
179 if (0 == g_interrupt_event) { 179 if (0 == g_interrupt_event) {
180 WARN_LOG(GSP, "cannot synchronize until GSP event has been created!"); 180 LOG_WARNING(Service_GSP, "cannot synchronize until GSP event has been created!");
181 return; 181 return;
182 } 182 }
183 if (0 == g_shared_memory) { 183 if (0 == g_shared_memory) {
184 WARN_LOG(GSP, "cannot synchronize until GSP shared memory has been created!"); 184 LOG_WARNING(Service_GSP, "cannot synchronize until GSP shared memory has been created!");
185 return; 185 return;
186 } 186 }
187 for (int thread_id = 0; thread_id < 0x4; ++thread_id) { 187 for (int thread_id = 0; thread_id < 0x4; ++thread_id) {
@@ -298,14 +298,14 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
298 } 298 }
299 299
300 default: 300 default:
301 ERROR_LOG(GSP, "unknown command 0x%08X", (int)command.id.Value()); 301 LOG_ERROR(Service_GSP, "unknown command 0x%08X", (int)command.id.Value());
302 } 302 }
303} 303}
304 304
305/// This triggers handling of the GX command written to the command buffer in shared memory. 305/// This triggers handling of the GX command written to the command buffer in shared memory.
306static void TriggerCmdReqQueue(Service::Interface* self) { 306static void TriggerCmdReqQueue(Service::Interface* self) {
307 307
308 DEBUG_LOG(GSP, "called"); 308 LOG_TRACE(Service_GSP, "called");
309 309
310 // Iterate through each thread's command queue... 310 // Iterate through each thread's command queue...
311 for (unsigned thread_id = 0; thread_id < 0x4; ++thread_id) { 311 for (unsigned thread_id = 0; thread_id < 0x4; ++thread_id) {
diff --git a/src/core/hle/service/hid_user.cpp b/src/core/hle/service/hid_user.cpp
index 2abaf0f2f..5772199d4 100644
--- a/src/core/hle/service/hid_user.cpp
+++ b/src/core/hle/service/hid_user.cpp
@@ -163,7 +163,7 @@ static void GetIPCHandles(Service::Interface* self) {
163 cmd_buff[7] = event_gyroscope; 163 cmd_buff[7] = event_gyroscope;
164 cmd_buff[8] = event_debug_pad; 164 cmd_buff[8] = event_debug_pad;
165 165
166 DEBUG_LOG(KERNEL, "called"); 166 LOG_TRACE(Service_HID, "called");
167} 167}
168 168
169const Interface::FunctionInfo FunctionTable[] = { 169const Interface::FunctionInfo FunctionTable[] = {
diff --git a/src/core/hle/service/ptm_u.cpp b/src/core/hle/service/ptm_u.cpp
index 941df467b..559f148dd 100644
--- a/src/core/hle/service/ptm_u.cpp
+++ b/src/core/hle/service/ptm_u.cpp
@@ -42,7 +42,7 @@ static void GetAdapterState(Service::Interface* self) {
42 cmd_buff[1] = 0; // No error 42 cmd_buff[1] = 0; // No error
43 cmd_buff[2] = battery_is_charging ? 1 : 0; 43 cmd_buff[2] = battery_is_charging ? 1 : 0;
44 44
45 WARN_LOG(KERNEL, "(STUBBED) called"); 45 LOG_WARNING(Service_PTM, "(STUBBED) called");
46} 46}
47 47
48/* 48/*
@@ -57,7 +57,7 @@ static void GetShellState(Service::Interface* self) {
57 cmd_buff[1] = 0; 57 cmd_buff[1] = 0;
58 cmd_buff[2] = shell_open ? 1 : 0; 58 cmd_buff[2] = shell_open ? 1 : 0;
59 59
60 DEBUG_LOG(KERNEL, "PTM_U::GetShellState called"); 60 LOG_TRACE(Service_PTM, "PTM_U::GetShellState called");
61} 61}
62 62
63/** 63/**
@@ -76,7 +76,7 @@ static void GetBatteryLevel(Service::Interface* self) {
76 cmd_buff[1] = 0; // No error 76 cmd_buff[1] = 0; // No error
77 cmd_buff[2] = static_cast<u32>(ChargeLevels::CompletelyFull); // Set to a completely full battery 77 cmd_buff[2] = static_cast<u32>(ChargeLevels::CompletelyFull); // Set to a completely full battery
78 78
79 WARN_LOG(KERNEL, "(STUBBED) called"); 79 LOG_WARNING(Service_PTM, "(STUBBED) called");
80} 80}
81 81
82/** 82/**
@@ -94,7 +94,7 @@ static void GetBatteryChargeState(Service::Interface* self) {
94 cmd_buff[1] = 0; // No error 94 cmd_buff[1] = 0; // No error
95 cmd_buff[2] = battery_is_charging ? 1 : 0; 95 cmd_buff[2] = battery_is_charging ? 1 : 0;
96 96
97 WARN_LOG(KERNEL, "(STUBBED) called"); 97 LOG_WARNING(Service_PTM, "(STUBBED) called");
98} 98}
99 99
100const Interface::FunctionInfo FunctionTable[] = { 100const Interface::FunctionInfo FunctionTable[] = {
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index fed2268a0..e6973572b 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -106,13 +106,13 @@ void Init() {
106 g_manager->AddService(new SOC_U::Interface); 106 g_manager->AddService(new SOC_U::Interface);
107 g_manager->AddService(new SSL_C::Interface); 107 g_manager->AddService(new SSL_C::Interface);
108 108
109 NOTICE_LOG(HLE, "initialized OK"); 109 LOG_DEBUG(Service, "initialized OK");
110} 110}
111 111
112/// Shutdown ServiceManager 112/// Shutdown ServiceManager
113void Shutdown() { 113void Shutdown() {
114 delete g_manager; 114 delete g_manager;
115 NOTICE_LOG(HLE, "shutdown OK"); 115 LOG_DEBUG(Service, "shutdown OK");
116} 116}
117 117
118 118
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 3a7d6c469..baae910a1 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -91,7 +91,7 @@ public:
91 91
92 std::string name = (itr == m_functions.end()) ? Common::StringFromFormat("0x%08X", cmd_buff[0]) : itr->second.name; 92 std::string name = (itr == m_functions.end()) ? Common::StringFromFormat("0x%08X", cmd_buff[0]) : itr->second.name;
93 93
94 ERROR_LOG(OSHLE, error.c_str(), name.c_str(), GetPortName().c_str()); 94 LOG_ERROR(Service, error.c_str(), name.c_str(), GetPortName().c_str());
95 95
96 // TODO(bunnei): Hack - ignore error 96 // TODO(bunnei): Hack - ignore error
97 cmd_buff[1] = 0; 97 cmd_buff[1] = 0;
@@ -103,12 +103,6 @@ public:
103 return MakeResult<bool>(false); // TODO: Implement return from actual function 103 return MakeResult<bool>(false); // TODO: Implement return from actual function
104 } 104 }
105 105
106 ResultVal<bool> WaitSynchronization() override {
107 // TODO(bunnei): ImplementMe
108 ERROR_LOG(OSHLE, "unimplemented function");
109 return UnimplementedFunction(ErrorModule::OS);
110 }
111
112protected: 106protected:
113 107
114 /** 108 /**
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index 0e7fa9e3b..24a846533 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -14,7 +14,7 @@ namespace SRV {
14static Handle g_event_handle = 0; 14static Handle g_event_handle = 0;
15 15
16static void Initialize(Service::Interface* self) { 16static void Initialize(Service::Interface* self) {
17 DEBUG_LOG(OSHLE, "called"); 17 LOG_DEBUG(Service_SRV, "called");
18 18
19 u32* cmd_buff = Service::GetCommandBuffer(); 19 u32* cmd_buff = Service::GetCommandBuffer();
20 20
@@ -22,7 +22,7 @@ static void Initialize(Service::Interface* self) {
22} 22}
23 23
24static void GetProcSemaphore(Service::Interface* self) { 24static void GetProcSemaphore(Service::Interface* self) {
25 DEBUG_LOG(OSHLE, "called"); 25 LOG_TRACE(Service_SRV, "called");
26 26
27 u32* cmd_buff = Service::GetCommandBuffer(); 27 u32* cmd_buff = Service::GetCommandBuffer();
28 28
@@ -43,9 +43,9 @@ static void GetServiceHandle(Service::Interface* self) {
43 43
44 if (nullptr != service) { 44 if (nullptr != service) {
45 cmd_buff[3] = service->GetHandle(); 45 cmd_buff[3] = service->GetHandle();
46 DEBUG_LOG(OSHLE, "called port=%s, handle=0x%08X", port_name.c_str(), cmd_buff[3]); 46 LOG_TRACE(Service_SRV, "called port=%s, handle=0x%08X", port_name.c_str(), cmd_buff[3]);
47 } else { 47 } else {
48 ERROR_LOG(OSHLE, "(UNIMPLEMENTED) called port=%s", port_name.c_str()); 48 LOG_ERROR(Service_SRV, "(UNIMPLEMENTED) called port=%s", port_name.c_str());
49 res = UnimplementedFunction(ErrorModule::SRV); 49 res = UnimplementedFunction(ErrorModule::SRV);
50 } 50 }
51 cmd_buff[1] = res.raw; 51 cmd_buff[1] = res.raw;
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index b99c301d4..db0c42e74 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -31,7 +31,7 @@ enum ControlMemoryOperation {
31 31
32/// Map application or GSP heap memory 32/// Map application or GSP heap memory
33static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { 33static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) {
34 DEBUG_LOG(SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X", 34 LOG_TRACE(Kernel_SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X",
35 operation, addr0, addr1, size, permissions); 35 operation, addr0, addr1, size, permissions);
36 36
37 switch (operation) { 37 switch (operation) {
@@ -48,14 +48,14 @@ static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1,
48 48
49 // Unknown ControlMemory operation 49 // Unknown ControlMemory operation
50 default: 50 default:
51 ERROR_LOG(SVC, "unknown operation=0x%08X", operation); 51 LOG_ERROR(Kernel_SVC, "unknown operation=0x%08X", operation);
52 } 52 }
53 return 0; 53 return 0;
54} 54}
55 55
56/// Maps a memory block to specified address 56/// Maps a memory block to specified address
57static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { 57static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) {
58 DEBUG_LOG(SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d", 58 LOG_TRACE(Kernel_SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d",
59 handle, addr, permissions, other_permissions); 59 handle, addr, permissions, other_permissions);
60 60
61 Kernel::MemoryPermission permissions_type = static_cast<Kernel::MemoryPermission>(permissions); 61 Kernel::MemoryPermission permissions_type = static_cast<Kernel::MemoryPermission>(permissions);
@@ -68,7 +68,7 @@ static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other
68 static_cast<Kernel::MemoryPermission>(other_permissions)); 68 static_cast<Kernel::MemoryPermission>(other_permissions));
69 break; 69 break;
70 default: 70 default:
71 ERROR_LOG(OSHLE, "unknown permissions=0x%08X", permissions); 71 LOG_ERROR(Kernel_SVC, "unknown permissions=0x%08X", permissions);
72 } 72 }
73 return 0; 73 return 0;
74} 74}
@@ -77,7 +77,7 @@ static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other
77static Result ConnectToPort(Handle* out, const char* port_name) { 77static Result ConnectToPort(Handle* out, const char* port_name) {
78 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); 78 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
79 79
80 DEBUG_LOG(SVC, "called port_name=%s", port_name); 80 LOG_TRACE(Kernel_SVC, "called port_name=%s", port_name);
81 _assert_msg_(KERNEL, (service != nullptr), "called, but service is not implemented!"); 81 _assert_msg_(KERNEL, (service != nullptr), "called, but service is not implemented!");
82 82
83 *out = service->GetHandle(); 83 *out = service->GetHandle();
@@ -95,7 +95,7 @@ static Result SendSyncRequest(Handle handle) {
95 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle); 95 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle);
96 96
97 _assert_msg_(KERNEL, (object != nullptr), "called, but kernel object is nullptr!"); 97 _assert_msg_(KERNEL, (object != nullptr), "called, but kernel object is nullptr!");
98 DEBUG_LOG(SVC, "called handle=0x%08X(%s)", handle, object->GetTypeName().c_str()); 98 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s)", handle, object->GetTypeName().c_str());
99 99
100 ResultVal<bool> wait = object->SyncRequest(); 100 ResultVal<bool> wait = object->SyncRequest();
101 if (wait.Succeeded() && *wait) { 101 if (wait.Succeeded() && *wait) {
@@ -108,7 +108,7 @@ static Result SendSyncRequest(Handle handle) {
108/// Close a handle 108/// Close a handle
109static Result CloseHandle(Handle handle) { 109static Result CloseHandle(Handle handle) {
110 // ImplementMe 110 // ImplementMe
111 ERROR_LOG(SVC, "(UNIMPLEMENTED) called handle=0x%08X", handle); 111 LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called handle=0x%08X", handle);
112 return 0; 112 return 0;
113} 113}
114 114
@@ -121,9 +121,9 @@ static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
121 return InvalidHandle(ErrorModule::Kernel).raw; 121 return InvalidHandle(ErrorModule::Kernel).raw;
122 } 122 }
123 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle); 123 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle);
124 _dbg_assert_(KERNEL, object != nullptr); 124 _dbg_assert_(Kernel, object != nullptr);
125 125
126 DEBUG_LOG(SVC, "called handle=0x%08X(%s:%s), nanoseconds=%lld", handle, object->GetTypeName().c_str(), 126 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s:%s), nanoseconds=%lld", handle, object->GetTypeName().c_str(),
127 object->GetName().c_str(), nano_seconds); 127 object->GetName().c_str(), nano_seconds);
128 128
129 ResultVal<bool> wait = object->WaitSynchronization(); 129 ResultVal<bool> wait = object->WaitSynchronization();
@@ -143,7 +143,7 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count,
143 bool unlock_all = true; 143 bool unlock_all = true;
144 bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated 144 bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated
145 145
146 DEBUG_LOG(SVC, "called handle_count=%d, wait_all=%s, nanoseconds=%lld", 146 LOG_TRACE(Kernel_SVC, "called handle_count=%d, wait_all=%s, nanoseconds=%lld",
147 handle_count, (wait_all ? "true" : "false"), nano_seconds); 147 handle_count, (wait_all ? "true" : "false"), nano_seconds);
148 148
149 // Iterate through each handle, synchronize kernel object 149 // Iterate through each handle, synchronize kernel object
@@ -153,7 +153,7 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count,
153 } 153 }
154 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handles[i]); 154 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handles[i]);
155 155
156 DEBUG_LOG(SVC, "\thandle[%d] = 0x%08X(%s:%s)", i, handles[i], object->GetTypeName().c_str(), 156 LOG_TRACE(Kernel_SVC, "\thandle[%d] = 0x%08X(%s:%s)", i, handles[i], object->GetTypeName().c_str(),
157 object->GetName().c_str()); 157 object->GetName().c_str());
158 158
159 // TODO(yuriks): Verify how the real function behaves when an error happens here 159 // TODO(yuriks): Verify how the real function behaves when an error happens here
@@ -181,7 +181,7 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count,
181 181
182/// Create an address arbiter (to allocate access to shared resources) 182/// Create an address arbiter (to allocate access to shared resources)
183static Result CreateAddressArbiter(u32* arbiter) { 183static Result CreateAddressArbiter(u32* arbiter) {
184 DEBUG_LOG(SVC, "called"); 184 LOG_TRACE(Kernel_SVC, "called");
185 Handle handle = Kernel::CreateAddressArbiter(); 185 Handle handle = Kernel::CreateAddressArbiter();
186 *arbiter = handle; 186 *arbiter = handle;
187 return 0; 187 return 0;
@@ -189,7 +189,7 @@ static Result CreateAddressArbiter(u32* arbiter) {
189 189
190/// Arbitrate address 190/// Arbitrate address
191static Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value, s64 nanoseconds) { 191static Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value, s64 nanoseconds) {
192 DEBUG_LOG(SVC, "called handle=0x%08X, address=0x%08X, type=0x%08X, value=0x%08X", arbiter, 192 LOG_TRACE(Kernel_SVC, "called handle=0x%08X, address=0x%08X, type=0x%08X, value=0x%08X", arbiter,
193 address, type, value); 193 address, type, value);
194 return Kernel::ArbitrateAddress(arbiter, static_cast<Kernel::ArbitrationType>(type), 194 return Kernel::ArbitrateAddress(arbiter, static_cast<Kernel::ArbitrationType>(type),
195 address, value).raw; 195 address, value).raw;
@@ -197,7 +197,7 @@ static Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value,
197 197
198/// Used to output a message on a debug hardware unit - does nothing on a retail unit 198/// Used to output a message on a debug hardware unit - does nothing on a retail unit
199static void OutputDebugString(const char* string) { 199static void OutputDebugString(const char* string) {
200 OS_LOG(SVC, "%s", string); 200 LOG_DEBUG(Debug_Emulated, "%s", string);
201} 201}
202 202
203/// Get resource limit 203/// Get resource limit
@@ -206,14 +206,14 @@ static Result GetResourceLimit(Handle* resource_limit, Handle process) {
206 // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for 206 // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for
207 // the current KThread. 207 // the current KThread.
208 *resource_limit = 0xDEADBEEF; 208 *resource_limit = 0xDEADBEEF;
209 ERROR_LOG(SVC, "(UNIMPLEMENTED) called process=0x%08X", process); 209 LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called process=0x%08X", process);
210 return 0; 210 return 0;
211} 211}
212 212
213/// Get resource limit current values 213/// Get resource limit current values
214static Result GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names, 214static Result GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names,
215 s32 name_count) { 215 s32 name_count) {
216 ERROR_LOG(SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d", 216 LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d",
217 resource_limit, names, name_count); 217 resource_limit, names, name_count);
218 Memory::Write32(Core::g_app_core->GetReg(0), 0); // Normmatt: Set used memory to 0 for now 218 Memory::Write32(Core::g_app_core->GetReg(0), 0); // Normmatt: Set used memory to 0 for now
219 return 0; 219 return 0;
@@ -234,7 +234,7 @@ static Result CreateThread(u32 priority, u32 entry_point, u32 arg, u32 stack_top
234 234
235 Core::g_app_core->SetReg(1, thread); 235 Core::g_app_core->SetReg(1, thread);
236 236
237 DEBUG_LOG(SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " 237 LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, "
238 "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", entry_point, 238 "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", entry_point,
239 name.c_str(), arg, stack_top, priority, processor_id, thread); 239 name.c_str(), arg, stack_top, priority, processor_id, thread);
240 240
@@ -245,7 +245,7 @@ static Result CreateThread(u32 priority, u32 entry_point, u32 arg, u32 stack_top
245static u32 ExitThread() { 245static u32 ExitThread() {
246 Handle thread = Kernel::GetCurrentThreadHandle(); 246 Handle thread = Kernel::GetCurrentThreadHandle();
247 247
248 DEBUG_LOG(SVC, "called, pc=0x%08X", Core::g_app_core->GetPC()); // PC = 0x0010545C 248 LOG_TRACE(Kernel_SVC, "called, pc=0x%08X", Core::g_app_core->GetPC()); // PC = 0x0010545C
249 249
250 Kernel::StopThread(thread, __func__); 250 Kernel::StopThread(thread, __func__);
251 HLE::Reschedule(__func__); 251 HLE::Reschedule(__func__);
@@ -269,42 +269,42 @@ static Result SetThreadPriority(Handle handle, s32 priority) {
269/// Create a mutex 269/// Create a mutex
270static Result CreateMutex(Handle* mutex, u32 initial_locked) { 270static Result CreateMutex(Handle* mutex, u32 initial_locked) {
271 *mutex = Kernel::CreateMutex((initial_locked != 0)); 271 *mutex = Kernel::CreateMutex((initial_locked != 0));
272 DEBUG_LOG(SVC, "called initial_locked=%s : created handle=0x%08X", 272 LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X",
273 initial_locked ? "true" : "false", *mutex); 273 initial_locked ? "true" : "false", *mutex);
274 return 0; 274 return 0;
275} 275}
276 276
277/// Release a mutex 277/// Release a mutex
278static Result ReleaseMutex(Handle handle) { 278static Result ReleaseMutex(Handle handle) {
279 DEBUG_LOG(SVC, "called handle=0x%08X", handle); 279 LOG_TRACE(Kernel_SVC, "called handle=0x%08X", handle);
280 ResultCode res = Kernel::ReleaseMutex(handle); 280 ResultCode res = Kernel::ReleaseMutex(handle);
281 return res.raw; 281 return res.raw;
282} 282}
283 283
284/// Get the ID for the specified thread. 284/// Get the ID for the specified thread.
285static Result GetThreadId(u32* thread_id, Handle handle) { 285static Result GetThreadId(u32* thread_id, Handle handle) {
286 DEBUG_LOG(SVC, "called thread=0x%08X", handle); 286 LOG_TRACE(Kernel_SVC, "called thread=0x%08X", handle);
287 ResultCode result = Kernel::GetThreadId(thread_id, handle); 287 ResultCode result = Kernel::GetThreadId(thread_id, handle);
288 return result.raw; 288 return result.raw;
289} 289}
290 290
291/// Query memory 291/// Query memory
292static Result QueryMemory(void* info, void* out, u32 addr) { 292static Result QueryMemory(void* info, void* out, u32 addr) {
293 ERROR_LOG(SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr); 293 LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr);
294 return 0; 294 return 0;
295} 295}
296 296
297/// Create an event 297/// Create an event
298static Result CreateEvent(Handle* evt, u32 reset_type) { 298static Result CreateEvent(Handle* evt, u32 reset_type) {
299 *evt = Kernel::CreateEvent((ResetType)reset_type); 299 *evt = Kernel::CreateEvent((ResetType)reset_type);
300 DEBUG_LOG(SVC, "called reset_type=0x%08X : created handle=0x%08X", 300 LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X",
301 reset_type, *evt); 301 reset_type, *evt);
302 return 0; 302 return 0;
303} 303}
304 304
305/// Duplicates a kernel handle 305/// Duplicates a kernel handle
306static Result DuplicateHandle(Handle* out, Handle handle) { 306static Result DuplicateHandle(Handle* out, Handle handle) {
307 DEBUG_LOG(SVC, "called handle=0x%08X", handle); 307 LOG_WARNING(Kernel_SVC, "(STUBBED) called handle=0x%08X", handle);
308 308
309 // Translate kernel handles -> real handles 309 // Translate kernel handles -> real handles
310 if (handle == Kernel::CurrentThread) { 310 if (handle == Kernel::CurrentThread) {
@@ -321,19 +321,19 @@ static Result DuplicateHandle(Handle* out, Handle handle) {
321 321
322/// Signals an event 322/// Signals an event
323static Result SignalEvent(Handle evt) { 323static Result SignalEvent(Handle evt) {
324 DEBUG_LOG(SVC, "called event=0x%08X", evt); 324 LOG_TRACE(Kernel_SVC, "called event=0x%08X", evt);
325 return Kernel::SignalEvent(evt).raw; 325 return Kernel::SignalEvent(evt).raw;
326} 326}
327 327
328/// Clears an event 328/// Clears an event
329static Result ClearEvent(Handle evt) { 329static Result ClearEvent(Handle evt) {
330 DEBUG_LOG(SVC, "called event=0x%08X", evt); 330 LOG_TRACE(Kernel_SVC, "called event=0x%08X", evt);
331 return Kernel::ClearEvent(evt).raw; 331 return Kernel::ClearEvent(evt).raw;
332} 332}
333 333
334/// Sleep the current thread 334/// Sleep the current thread
335static void SleepThread(s64 nanoseconds) { 335static void SleepThread(s64 nanoseconds) {
336 DEBUG_LOG(SVC, "called nanoseconds=%lld", nanoseconds); 336 LOG_TRACE(Kernel_SVC, "called nanoseconds=%lld", nanoseconds);
337 337
338 // Check for next thread to schedule 338 // Check for next thread to schedule
339 HLE::Reschedule(__func__); 339 HLE::Reschedule(__func__);
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 77557e582..da78b85e5 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -35,7 +35,7 @@ inline void Read(T &var, const u32 raw_addr) {
35 35
36 // Reads other than u32 are untested, so I'd rather have them abort than silently fail 36 // Reads other than u32 are untested, so I'd rather have them abort than silently fail
37 if (index >= Regs::NumIds() || !std::is_same<T,u32>::value) { 37 if (index >= Regs::NumIds() || !std::is_same<T,u32>::value) {
38 ERROR_LOG(GPU, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, addr); 38 LOG_ERROR(HW_GPU, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, addr);
39 return; 39 return;
40 } 40 }
41 41
@@ -49,7 +49,7 @@ inline void Write(u32 addr, const T data) {
49 49
50 // Writes other than u32 are untested, so I'd rather have them abort than silently fail 50 // Writes other than u32 are untested, so I'd rather have them abort than silently fail
51 if (index >= Regs::NumIds() || !std::is_same<T,u32>::value) { 51 if (index >= Regs::NumIds() || !std::is_same<T,u32>::value) {
52 ERROR_LOG(GPU, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, (u32)data, addr); 52 LOG_ERROR(HW_GPU, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, (u32)data, addr);
53 return; 53 return;
54 } 54 }
55 55
@@ -73,7 +73,7 @@ inline void Write(u32 addr, const T data) {
73 for (u32* ptr = start; ptr < end; ++ptr) 73 for (u32* ptr = start; ptr < end; ++ptr)
74 *ptr = bswap32(config.value); // TODO: This is just a workaround to missing framebuffer format emulation 74 *ptr = bswap32(config.value); // TODO: This is just a workaround to missing framebuffer format emulation
75 75
76 DEBUG_LOG(GPU, "MemoryFill from 0x%08x to 0x%08x", config.GetStartAddress(), config.GetEndAddress()); 76 LOG_TRACE(HW_GPU, "MemoryFill from 0x%08x to 0x%08x", config.GetStartAddress(), config.GetEndAddress());
77 } 77 }
78 break; 78 break;
79 } 79 }
@@ -105,7 +105,7 @@ inline void Write(u32 addr, const T data) {
105 } 105 }
106 106
107 default: 107 default:
108 ERROR_LOG(GPU, "Unknown source framebuffer format %x", config.input_format.Value()); 108 LOG_ERROR(HW_GPU, "Unknown source framebuffer format %x", config.input_format.Value());
109 break; 109 break;
110 } 110 }
111 111
@@ -132,13 +132,13 @@ inline void Write(u32 addr, const T data) {
132 } 132 }
133 133
134 default: 134 default:
135 ERROR_LOG(GPU, "Unknown destination framebuffer format %x", config.output_format.Value()); 135 LOG_ERROR(HW_GPU, "Unknown destination framebuffer format %x", config.output_format.Value());
136 break; 136 break;
137 } 137 }
138 } 138 }
139 } 139 }
140 140
141 DEBUG_LOG(GPU, "DisplayTriggerTransfer: 0x%08x bytes from 0x%08x(%ux%u)-> 0x%08x(%ux%u), dst format %x", 141 LOG_TRACE(HW_GPU, "DisplayTriggerTransfer: 0x%08x bytes from 0x%08x(%ux%u)-> 0x%08x(%ux%u), dst format %x",
142 config.output_height * config.output_width * 4, 142 config.output_height * config.output_width * 4,
143 config.GetPhysicalInputAddress(), (u32)config.input_width, (u32)config.input_height, 143 config.GetPhysicalInputAddress(), (u32)config.input_width, (u32)config.input_height,
144 config.GetPhysicalOutputAddress(), (u32)config.output_width, (u32)config.output_height, 144 config.GetPhysicalOutputAddress(), (u32)config.output_width, (u32)config.output_height,
@@ -251,12 +251,12 @@ void Init() {
251 framebuffer_sub.color_format = Regs::PixelFormat::RGB8; 251 framebuffer_sub.color_format = Regs::PixelFormat::RGB8;
252 framebuffer_sub.active_fb = 0; 252 framebuffer_sub.active_fb = 0;
253 253
254 NOTICE_LOG(GPU, "initialized OK"); 254 LOG_DEBUG(HW_GPU, "initialized OK");
255} 255}
256 256
257/// Shutdown hardware 257/// Shutdown hardware
258void Shutdown() { 258void Shutdown() {
259 NOTICE_LOG(GPU, "shutdown OK"); 259 LOG_DEBUG(HW_GPU, "shutdown OK");
260} 260}
261 261
262} // namespace 262} // namespace
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp
index 73a4f1e53..af42b41fb 100644
--- a/src/core/hw/hw.cpp
+++ b/src/core/hw/hw.cpp
@@ -44,7 +44,7 @@ inline void Read(T &var, const u32 addr) {
44 break; 44 break;
45 45
46 default: 46 default:
47 ERROR_LOG(HW, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, addr); 47 LOG_ERROR(HW_Memory, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, addr);
48 } 48 }
49} 49}
50 50
@@ -57,7 +57,7 @@ inline void Write(u32 addr, const T data) {
57 break; 57 break;
58 58
59 default: 59 default:
60 ERROR_LOG(HW, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, (u32)data, addr); 60 LOG_ERROR(HW_Memory, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, (u32)data, addr);
61 } 61 }
62} 62}
63 63
@@ -81,12 +81,12 @@ void Update() {
81/// Initialize hardware 81/// Initialize hardware
82void Init() { 82void Init() {
83 GPU::Init(); 83 GPU::Init();
84 NOTICE_LOG(HW, "initialized OK"); 84 LOG_DEBUG(HW, "initialized OK");
85} 85}
86 86
87/// Shutdown hardware 87/// Shutdown hardware
88void Shutdown() { 88void Shutdown() {
89 NOTICE_LOG(HW, "shutdown OK"); 89 LOG_DEBUG(HW, "shutdown OK");
90} 90}
91 91
92} \ No newline at end of file 92} \ No newline at end of file
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp
index 7ef146359..f48d13530 100644
--- a/src/core/loader/3dsx.cpp
+++ b/src/core/loader/3dsx.cpp
@@ -174,14 +174,14 @@ int THREEDSXReader::Load3DSXFile(const std::string& filename, u32 base_addr)
174 return ERROR_READ; 174 return ERROR_READ;
175 175
176 for (u32 current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) { 176 for (u32 current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) {
177 DEBUG_LOG(LOADER, "(t=%d,skip=%u,patch=%u)\n", 177 LOG_TRACE(Loader, "(t=%d,skip=%u,patch=%u)\n",
178 current_segment_reloc_table, (u32)reloc_table[current_inprogress].skip, (u32)reloc_table[current_inprogress].patch); 178 current_segment_reloc_table, (u32)reloc_table[current_inprogress].skip, (u32)reloc_table[current_inprogress].patch);
179 pos += reloc_table[current_inprogress].skip; 179 pos += reloc_table[current_inprogress].skip;
180 s32 num_patches = reloc_table[current_inprogress].patch; 180 s32 num_patches = reloc_table[current_inprogress].patch;
181 while (0 < num_patches && pos < end_pos) { 181 while (0 < num_patches && pos < end_pos) {
182 u32 in_addr = (char*)pos - (char*)&all_mem[0]; 182 u32 in_addr = (char*)pos - (char*)&all_mem[0];
183 u32 addr = TranslateAddr(*pos, &loadinfo, offsets); 183 u32 addr = TranslateAddr(*pos, &loadinfo, offsets);
184 DEBUG_LOG(LOADER, "Patching %08X <-- rel(%08X,%d) (%08X)\n", 184 LOG_TRACE(Loader, "Patching %08X <-- rel(%08X,%d) (%08X)\n",
185 base_addr + in_addr, addr, current_segment_reloc_table, *pos); 185 base_addr + in_addr, addr, current_segment_reloc_table, *pos);
186 switch (current_segment_reloc_table) { 186 switch (current_segment_reloc_table) {
187 case 0: *pos = (addr); break; 187 case 0: *pos = (addr); break;
@@ -199,10 +199,10 @@ int THREEDSXReader::Load3DSXFile(const std::string& filename, u32 base_addr)
199 // Write the data 199 // Write the data
200 memcpy(Memory::GetPointer(base_addr), &all_mem[0], loadinfo.seg_sizes[0] + loadinfo.seg_sizes[1] + loadinfo.seg_sizes[2]); 200 memcpy(Memory::GetPointer(base_addr), &all_mem[0], loadinfo.seg_sizes[0] + loadinfo.seg_sizes[1] + loadinfo.seg_sizes[2]);
201 201
202 DEBUG_LOG(LOADER, "CODE: %u pages\n", loadinfo.seg_sizes[0] / 0x1000); 202 LOG_DEBUG(Loader, "CODE: %u pages\n", loadinfo.seg_sizes[0] / 0x1000);
203 DEBUG_LOG(LOADER, "RODATA: %u pages\n", loadinfo.seg_sizes[1] / 0x1000); 203 LOG_DEBUG(Loader, "RODATA: %u pages\n", loadinfo.seg_sizes[1] / 0x1000);
204 DEBUG_LOG(LOADER, "DATA: %u pages\n", data_load_size / 0x1000); 204 LOG_DEBUG(Loader, "DATA: %u pages\n", data_load_size / 0x1000);
205 DEBUG_LOG(LOADER, "BSS: %u pages\n", bss_load_size / 0x1000); 205 LOG_DEBUG(Loader, "BSS: %u pages\n", bss_load_size / 0x1000);
206 206
207 return ERROR_NONE; 207 return ERROR_NONE;
208} 208}
@@ -220,7 +220,7 @@ int THREEDSXReader::Load3DSXFile(const std::string& filename, u32 base_addr)
220 * @return Success on success, otherwise Error 220 * @return Success on success, otherwise Error
221 */ 221 */
222 ResultStatus AppLoader_THREEDSX::Load() { 222 ResultStatus AppLoader_THREEDSX::Load() {
223 INFO_LOG(LOADER, "Loading 3DSX file %s...", filename.c_str()); 223 LOG_INFO(Loader, "Loading 3DSX file %s...", filename.c_str());
224 FileUtil::IOFile file(filename, "rb"); 224 FileUtil::IOFile file(filename, "rb");
225 if (file.IsOpen()) { 225 if (file.IsOpen()) {
226 226
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index 63d2496ed..c95882f4a 100644
--- a/src/core/loader/elf.cpp
+++ b/src/core/loader/elf.cpp
@@ -254,18 +254,18 @@ const char *ElfReader::GetSectionName(int section) const {
254} 254}
255 255
256bool ElfReader::LoadInto(u32 vaddr) { 256bool ElfReader::LoadInto(u32 vaddr) {
257 DEBUG_LOG(MASTER_LOG, "String section: %i", header->e_shstrndx); 257 LOG_DEBUG(Loader, "String section: %i", header->e_shstrndx);
258 258
259 // Should we relocate? 259 // Should we relocate?
260 relocate = (header->e_type != ET_EXEC); 260 relocate = (header->e_type != ET_EXEC);
261 261
262 if (relocate) { 262 if (relocate) {
263 DEBUG_LOG(MASTER_LOG, "Relocatable module"); 263 LOG_DEBUG(Loader, "Relocatable module");
264 entryPoint += vaddr; 264 entryPoint += vaddr;
265 } else { 265 } else {
266 DEBUG_LOG(MASTER_LOG, "Prerelocated executable"); 266 LOG_DEBUG(Loader, "Prerelocated executable");
267 } 267 }
268 INFO_LOG(MASTER_LOG, "%i segments:", header->e_phnum); 268 LOG_DEBUG(Loader, "%i segments:", header->e_phnum);
269 269
270 // First pass : Get the bits into RAM 270 // First pass : Get the bits into RAM
271 u32 segment_addr[32]; 271 u32 segment_addr[32];
@@ -273,17 +273,17 @@ bool ElfReader::LoadInto(u32 vaddr) {
273 273
274 for (int i = 0; i < header->e_phnum; i++) { 274 for (int i = 0; i < header->e_phnum; i++) {
275 Elf32_Phdr *p = segments + i; 275 Elf32_Phdr *p = segments + i;
276 INFO_LOG(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr, 276 LOG_DEBUG(Loader, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr,
277 p->p_filesz, p->p_memsz); 277 p->p_filesz, p->p_memsz);
278 278
279 if (p->p_type == PT_LOAD) { 279 if (p->p_type == PT_LOAD) {
280 segment_addr[i] = base_addr + p->p_vaddr; 280 segment_addr[i] = base_addr + p->p_vaddr;
281 memcpy(Memory::GetPointer(segment_addr[i]), GetSegmentPtr(i), p->p_filesz); 281 memcpy(Memory::GetPointer(segment_addr[i]), GetSegmentPtr(i), p->p_filesz);
282 INFO_LOG(MASTER_LOG, "Loadable Segment Copied to %08x, size %08x", segment_addr[i], 282 LOG_DEBUG(Loader, "Loadable Segment Copied to %08x, size %08x", segment_addr[i],
283 p->p_memsz); 283 p->p_memsz);
284 } 284 }
285 } 285 }
286 INFO_LOG(MASTER_LOG, "Done loading."); 286 LOG_DEBUG(Loader, "Done loading.");
287 return true; 287 return true;
288} 288}
289 289
@@ -346,7 +346,7 @@ AppLoader_ELF::~AppLoader_ELF() {
346 * @return True on success, otherwise false 346 * @return True on success, otherwise false
347 */ 347 */
348ResultStatus AppLoader_ELF::Load() { 348ResultStatus AppLoader_ELF::Load() {
349 INFO_LOG(LOADER, "Loading ELF file %s...", filename.c_str()); 349 LOG_INFO(Loader, "Loading ELF file %s...", filename.c_str());
350 350
351 if (is_loaded) 351 if (is_loaded)
352 return ResultStatus::ErrorAlreadyLoaded; 352 return ResultStatus::ErrorAlreadyLoaded;
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 174397b05..3883e1307 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -23,7 +23,7 @@ namespace Loader {
23 */ 23 */
24FileType IdentifyFile(const std::string &filename) { 24FileType IdentifyFile(const std::string &filename) {
25 if (filename.size() == 0) { 25 if (filename.size() == 0) {
26 ERROR_LOG(LOADER, "invalid filename %s", filename.c_str()); 26 LOG_ERROR(Loader, "invalid filename %s", filename.c_str());
27 return FileType::Error; 27 return FileType::Error;
28 } 28 }
29 29
@@ -55,7 +55,7 @@ FileType IdentifyFile(const std::string &filename) {
55 * @return ResultStatus result of function 55 * @return ResultStatus result of function
56 */ 56 */
57ResultStatus LoadFile(const std::string& filename) { 57ResultStatus LoadFile(const std::string& filename) {
58 INFO_LOG(LOADER, "Loading file %s...", filename.c_str()); 58 LOG_INFO(Loader, "Loading file %s...", filename.c_str());
59 59
60 switch (IdentifyFile(filename)) { 60 switch (IdentifyFile(filename)) {
61 61
@@ -83,7 +83,7 @@ ResultStatus LoadFile(const std::string& filename) {
83 // Raw BIN file format... 83 // Raw BIN file format...
84 case FileType::BIN: 84 case FileType::BIN:
85 { 85 {
86 INFO_LOG(LOADER, "Loading BIN file %s...", filename.c_str()); 86 LOG_INFO(Loader, "Loading BIN file %s...", filename.c_str());
87 87
88 FileUtil::IOFile file(filename, "rb"); 88 FileUtil::IOFile file(filename, "rb");
89 89
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index 343bb7523..ba9ba00c0 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -140,13 +140,13 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
140 // Iterate through the ExeFs archive until we find the .code file... 140 // Iterate through the ExeFs archive until we find the .code file...
141 FileUtil::IOFile file(filename, "rb"); 141 FileUtil::IOFile file(filename, "rb");
142 if (file.IsOpen()) { 142 if (file.IsOpen()) {
143 LOG_DEBUG(Loader, "%d sections:", kMaxSections);
143 for (int i = 0; i < kMaxSections; i++) { 144 for (int i = 0; i < kMaxSections; i++) {
144 // Load the specified section... 145 // Load the specified section...
145 if (strcmp((const char*)exefs_header.section[i].name, name) == 0) { 146 if (strcmp((const char*)exefs_header.section[i].name, name) == 0) {
146 INFO_LOG(LOADER, "ExeFS section %d:", i); 147 LOG_DEBUG(Loader, "%d - offset: 0x%08X, size: 0x%08X, name: %s", i,
147 INFO_LOG(LOADER, " name: %s", exefs_header.section[i].name); 148 exefs_header.section[i].offset, exefs_header.section[i].size,
148 INFO_LOG(LOADER, " offset: 0x%08X", exefs_header.section[i].offset); 149 exefs_header.section[i].name);
149 INFO_LOG(LOADER, " size: 0x%08X", exefs_header.section[i].size);
150 150
151 s64 section_offset = (exefs_header.section[i].offset + exefs_offset + 151 s64 section_offset = (exefs_header.section[i].offset + exefs_offset +
152 sizeof(ExeFs_Header)+ncch_offset); 152 sizeof(ExeFs_Header)+ncch_offset);
@@ -181,7 +181,7 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
181 } 181 }
182 } 182 }
183 } else { 183 } else {
184 ERROR_LOG(LOADER, "Unable to read file %s!", filename.c_str()); 184 LOG_ERROR(Loader, "Unable to read file %s!", filename.c_str());
185 return ResultStatus::Error; 185 return ResultStatus::Error;
186 } 186 }
187 return ResultStatus::ErrorNotUsed; 187 return ResultStatus::ErrorNotUsed;
@@ -194,7 +194,7 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
194 * @return True on success, otherwise false 194 * @return True on success, otherwise false
195 */ 195 */
196ResultStatus AppLoader_NCCH::Load() { 196ResultStatus AppLoader_NCCH::Load() {
197 INFO_LOG(LOADER, "Loading NCCH file %s...", filename.c_str()); 197 LOG_INFO(Loader, "Loading NCCH file %s...", filename.c_str());
198 198
199 if (is_loaded) 199 if (is_loaded)
200 return ResultStatus::ErrorAlreadyLoaded; 200 return ResultStatus::ErrorAlreadyLoaded;
@@ -205,7 +205,7 @@ ResultStatus AppLoader_NCCH::Load() {
205 205
206 // Skip NCSD header and load first NCCH (NCSD is just a container of NCCH files)... 206 // Skip NCSD header and load first NCCH (NCSD is just a container of NCCH files)...
207 if (0 == memcmp(&ncch_header.magic, "NCSD", 4)) { 207 if (0 == memcmp(&ncch_header.magic, "NCSD", 4)) {
208 WARN_LOG(LOADER, "Only loading the first (bootable) NCCH within the NCSD file!"); 208 LOG_WARNING(Loader, "Only loading the first (bootable) NCCH within the NCSD file!");
209 ncch_offset = 0x4000; 209 ncch_offset = 0x4000;
210 file.Seek(ncch_offset, 0); 210 file.Seek(ncch_offset, 0);
211 file.ReadBytes(&ncch_header, sizeof(NCCH_Header)); 211 file.ReadBytes(&ncch_header, sizeof(NCCH_Header));
@@ -222,17 +222,17 @@ ResultStatus AppLoader_NCCH::Load() {
222 is_compressed = (exheader_header.codeset_info.flags.flag & 1) == 1; 222 is_compressed = (exheader_header.codeset_info.flags.flag & 1) == 1;
223 entry_point = exheader_header.codeset_info.text.address; 223 entry_point = exheader_header.codeset_info.text.address;
224 224
225 INFO_LOG(LOADER, "Name: %s", exheader_header.codeset_info.name); 225 LOG_INFO(Loader, "Name: %s", exheader_header.codeset_info.name);
226 INFO_LOG(LOADER, "Code compressed: %s", is_compressed ? "yes" : "no"); 226 LOG_DEBUG(Loader, "Code compressed: %s", is_compressed ? "yes" : "no");
227 INFO_LOG(LOADER, "Entry point: 0x%08X", entry_point); 227 LOG_DEBUG(Loader, "Entry point: 0x%08X", entry_point);
228 228
229 // Read ExeFS... 229 // Read ExeFS...
230 230
231 exefs_offset = ncch_header.exefs_offset * kBlockSize; 231 exefs_offset = ncch_header.exefs_offset * kBlockSize;
232 u32 exefs_size = ncch_header.exefs_size * kBlockSize; 232 u32 exefs_size = ncch_header.exefs_size * kBlockSize;
233 233
234 INFO_LOG(LOADER, "ExeFS offset: 0x%08X", exefs_offset); 234 LOG_DEBUG(Loader, "ExeFS offset: 0x%08X", exefs_offset);
235 INFO_LOG(LOADER, "ExeFS size: 0x%08X", exefs_size); 235 LOG_DEBUG(Loader, "ExeFS size: 0x%08X", exefs_size);
236 236
237 file.Seek(exefs_offset + ncch_offset, 0); 237 file.Seek(exefs_offset + ncch_offset, 0);
238 file.ReadBytes(&exefs_header, sizeof(ExeFs_Header)); 238 file.ReadBytes(&exefs_header, sizeof(ExeFs_Header));
@@ -243,7 +243,7 @@ ResultStatus AppLoader_NCCH::Load() {
243 243
244 return ResultStatus::Success; 244 return ResultStatus::Success;
245 } else { 245 } else {
246 ERROR_LOG(LOADER, "Unable to read file %s!", filename.c_str()); 246 LOG_ERROR(Loader, "Unable to read file %s!", filename.c_str());
247 } 247 }
248 return ResultStatus::Error; 248 return ResultStatus::Error;
249} 249}
@@ -297,8 +297,8 @@ ResultStatus AppLoader_NCCH::ReadRomFS(std::vector<u8>& buffer) const {
297 u32 romfs_offset = ncch_offset + (ncch_header.romfs_offset * kBlockSize) + 0x1000; 297 u32 romfs_offset = ncch_offset + (ncch_header.romfs_offset * kBlockSize) + 0x1000;
298 u32 romfs_size = (ncch_header.romfs_size * kBlockSize) - 0x1000; 298 u32 romfs_size = (ncch_header.romfs_size * kBlockSize) - 0x1000;
299 299
300 INFO_LOG(LOADER, "RomFS offset: 0x%08X", romfs_offset); 300 LOG_DEBUG(Loader, "RomFS offset: 0x%08X", romfs_offset);
301 INFO_LOG(LOADER, "RomFS size: 0x%08X", romfs_size); 301 LOG_DEBUG(Loader, "RomFS size: 0x%08X", romfs_size);
302 302
303 buffer.resize(romfs_size); 303 buffer.resize(romfs_size);
304 304
@@ -307,10 +307,10 @@ ResultStatus AppLoader_NCCH::ReadRomFS(std::vector<u8>& buffer) const {
307 307
308 return ResultStatus::Success; 308 return ResultStatus::Success;
309 } 309 }
310 NOTICE_LOG(LOADER, "RomFS unused"); 310 LOG_DEBUG(Loader, "NCCH has no RomFS");
311 return ResultStatus::ErrorNotUsed; 311 return ResultStatus::ErrorNotUsed;
312 } else { 312 } else {
313 ERROR_LOG(LOADER, "Unable to read file %s!", filename.c_str()); 313 LOG_ERROR(Loader, "Unable to read file %s!", filename.c_str());
314 } 314 }
315 return ResultStatus::Error; 315 return ResultStatus::Error;
316} 316}
diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp
index e1c2580ff..d1c44ed24 100644
--- a/src/core/mem_map.cpp
+++ b/src/core/mem_map.cpp
@@ -71,7 +71,7 @@ void Init() {
71 71
72 g_base = MemoryMap_Setup(g_views, kNumMemViews, flags, &arena); 72 g_base = MemoryMap_Setup(g_views, kNumMemViews, flags, &arena);
73 73
74 NOTICE_LOG(MEMMAP, "initialized OK, RAM at %p (mirror at 0 @ %p)", g_heap, 74 LOG_DEBUG(HW_Memory, "initialized OK, RAM at %p (mirror at 0 @ %p)", g_heap,
75 physical_fcram); 75 physical_fcram);
76} 76}
77 77
@@ -82,7 +82,7 @@ void Shutdown() {
82 arena.ReleaseSpace(); 82 arena.ReleaseSpace();
83 g_base = nullptr; 83 g_base = nullptr;
84 84
85 NOTICE_LOG(MEMMAP, "shutdown OK"); 85 LOG_DEBUG(HW_Memory, "shutdown OK");
86} 86}
87 87
88} // namespace 88} // namespace
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index b78821a3b..7f7e77233 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -28,7 +28,7 @@ VAddr PhysicalToVirtualAddress(const PAddr addr) {
28 return addr - FCRAM_PADDR + FCRAM_VADDR; 28 return addr - FCRAM_PADDR + FCRAM_VADDR;
29 } 29 }
30 30
31 ERROR_LOG(MEMMAP, "Unknown physical address @ 0x%08x", addr); 31 LOG_ERROR(HW_Memory, "Unknown physical address @ 0x%08x", addr);
32 return addr; 32 return addr;
33} 33}
34 34
@@ -44,7 +44,7 @@ PAddr VirtualToPhysicalAddress(const VAddr addr) {
44 return addr - FCRAM_VADDR + FCRAM_PADDR; 44 return addr - FCRAM_VADDR + FCRAM_PADDR;
45 } 45 }
46 46
47 ERROR_LOG(MEMMAP, "Unknown virtual address @ 0x%08x", addr); 47 LOG_ERROR(HW_Memory, "Unknown virtual address @ 0x%08x", addr);
48 return addr; 48 return addr;
49} 49}
50 50
@@ -92,7 +92,7 @@ inline void Read(T &var, const VAddr vaddr) {
92 var = *((const T*)&g_vram[vaddr - VRAM_VADDR]); 92 var = *((const T*)&g_vram[vaddr - VRAM_VADDR]);
93 93
94 } else { 94 } else {
95 ERROR_LOG(MEMMAP, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, vaddr); 95 LOG_ERROR(HW_Memory, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, vaddr);
96 } 96 }
97} 97}
98 98
@@ -141,7 +141,7 @@ inline void Write(const VAddr vaddr, const T data) {
141 141
142 // Error out... 142 // Error out...
143 } else { 143 } else {
144 ERROR_LOG(MEMMAP, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, (u32)data, vaddr); 144 LOG_ERROR(HW_Memory, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, (u32)data, vaddr);
145 } 145 }
146} 146}
147 147
@@ -175,7 +175,7 @@ u8 *GetPointer(const VAddr vaddr) {
175 return g_vram + (vaddr - VRAM_VADDR); 175 return g_vram + (vaddr - VRAM_VADDR);
176 176
177 } else { 177 } else {
178 ERROR_LOG(MEMMAP, "unknown GetPointer @ 0x%08x", vaddr); 178 LOG_ERROR(HW_Memory, "unknown GetPointer @ 0x%08x", vaddr);
179 return 0; 179 return 0;
180 } 180 }
181} 181}
@@ -239,7 +239,7 @@ u16 Read16(const VAddr addr) {
239 // Check for 16-bit unaligned memory reads... 239 // Check for 16-bit unaligned memory reads...
240 if (addr & 1) { 240 if (addr & 1) {
241 // TODO(bunnei): Implement 16-bit unaligned memory reads 241 // TODO(bunnei): Implement 16-bit unaligned memory reads
242 ERROR_LOG(MEMMAP, "16-bit unaligned memory reads are not implemented!"); 242 LOG_ERROR(HW_Memory, "16-bit unaligned memory reads are not implemented!");
243 } 243 }
244 244
245 return (u16)data; 245 return (u16)data;
diff --git a/src/core/settings.h b/src/core/settings.h
index 7e7a66b89..138ffc615 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -4,6 +4,8 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <string>
8
7namespace Settings { 9namespace Settings {
8 10
9struct Values { 11struct Values {
@@ -33,7 +35,7 @@ struct Values {
33 // Data Storage 35 // Data Storage
34 bool use_virtual_sd; 36 bool use_virtual_sd;
35 37
36 bool enable_log; 38 std::string log_filter;
37} extern values; 39} extern values;
38 40
39} 41}