| 6526 | } |
| 6527 | |
| 6528 | BString DecodedOp::toString() { |
| 6529 | #ifdef __EMSCRIPTEN__ |
| 6530 | return BString::empty; |
| 6531 | #else |
| 6532 | BString out; |
| 6533 | instructionLog[this->inst].pfnFormat(&instructionLog[this->inst], this, out); |
| 6534 | if (instructionLog[this->inst].imm) { |
| 6535 | if (instructionLog[this->inst].pfnFormat != logName) |
| 6536 | out.append(","); |
| 6537 | switch (instructionLog[this->inst].width) { |
| 6538 | case -16: |
| 6539 | out.append((S32)((S16)((U16)this->imm)), 16); |
| 6540 | break; |
| 6541 | case -32: |
| 6542 | out.append(this->imm, 16); |
| 6543 | break; |
| 6544 | case -8: |
| 6545 | out.append((S32)((S8)((U8)this->imm)), 16); |
| 6546 | break; |
| 6547 | default: |
| 6548 | out.append(this->imm, 16); |
| 6549 | break; |
| 6550 | } |
| 6551 | } |
| 6552 | return out; |
| 6553 | #endif |
| 6554 | } |
| 6555 | |
| 6556 | void DecodedOp::log(CPU* cpu) { |
| 6557 | #ifdef _DEBUG |