MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / isValidAddress

Method isValidAddress

pcsx2/DebugTools/DebugInterface.cpp:632–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632bool R5900DebugInterface::isValidAddress(u32 addr)
633{
634 u32 lopart = addr & 0xfFFffFF;
635
636 // get rid of ee ram mirrors
637 switch (addr >> 28)
638 {
639 case 0:
640 case 2:
641 // case 3: throw exception (not mapped ?)
642 // [ 0000_8000 - 01FF_FFFF ] RAM
643 // [ 2000_8000 - 21FF_FFFF ] RAM MIRROR
644 // [ 3000_8000 - 31FF_FFFF ] RAM MIRROR
645 if (lopart >= 0x80000 && lopart < Ps2MemSize::ExposedRam)
646 return !!vtlb_GetPhyPtr(lopart);
647 break;
648 case 1:
649 // [ 1000_0000 - 1000_CFFF ] EE register
650 if (lopart <= 0xcfff)
651 return true;
652
653 // [ 1100_0000 - 1100_FFFF ] VU mem
654 if (lopart >= 0x1000000 && lopart <= 0x100FFff)
655 return true;
656
657 // [ 1200_0000 - 1200_FFFF ] GS regs
658 if (lopart >= 0x2000000 && lopart <= 0x20010ff)
659 return true;
660
661 // [ 1E00_0000 - 1FFF_FFFF ] ROM
662 // if (lopart >= 0xe000000)
663 // return true; throw exception (not mapped ?)
664 break;
665 case 7:
666 // [ 7000_0000 - 7000_3FFF ] Scratchpad
667 if (lopart <= 0x3fff)
668 return true;
669 break;
670 case 8:
671 case 0xA:
672 if (lopart <= 0xFFFFF)
673 return true;
674 break;
675 case 9:
676 case 0xB:
677 // [ 8000_0000 - BFFF_FFFF ] kernel
678 if (lopart >= 0xFC00000)
679 return true;
680 break;
681 case 0xF:
682 // [ 8000_0000 - BFFF_FFFF ] IOP or kernel stack
683 if (lopart >= 0xfff8000)
684 return true;
685 break;
686 }
687
688 return false;
689}

Callers 13

searchWorkerFunction · 0.80
searchWorkerByteArrayFunction · 0.80
KeyPressMethod · 0.80
populateChildrenMethod · 0.80
GetOpcodeInfoFunction · 0.80
ScanForAllocaSignatureFunction · 0.80
ScanForEntryFunction · 0.80
analyzeMethod · 0.80
getNthPreviousAddressMethod · 0.80

Calls 1

vtlb_GetPhyPtrFunction · 0.85

Tested by

no test coverage detected