@@ -89,10 +89,10 @@ PCSX::Memory::Memory() : m_listener(g_system->m_eventBus) {
89
89
m_listener.listen <Events::ExecutionFlow::Reset>([this ](auto &) {
90
90
free (m_msanRAM);
91
91
free (m_msanUsableBitmap);
92
- free (m_msanWrittenBitmap );
92
+ free (m_msanInitializedBitmap );
93
93
m_msanRAM = nullptr ;
94
94
m_msanUsableBitmap = nullptr ;
95
- m_msanWrittenBitmap = nullptr ;
95
+ m_msanInitializedBitmap = nullptr ;
96
96
m_msanAllocs.clear ();
97
97
});
98
98
}
@@ -265,10 +265,10 @@ void PCSX::Memory::shutdown() {
265
265
266
266
free (m_msanRAM);
267
267
free (m_msanUsableBitmap);
268
- free (m_msanWrittenBitmap );
268
+ free (m_msanInitializedBitmap );
269
269
m_msanRAM = nullptr ;
270
270
m_msanUsableBitmap = nullptr ;
271
- m_msanWrittenBitmap = nullptr ;
271
+ m_msanInitializedBitmap = nullptr ;
272
272
m_msanAllocs.clear ();
273
273
}
274
274
@@ -280,7 +280,7 @@ uint8_t PCSX::Memory::read8(uint32_t address) {
280
280
281
281
if (pointer != nullptr ) {
282
282
if (msanInitialized () && inMsanRange (address)) [[unlikely]] {
283
- switch (msanGetStatus (address, 1 )) {
283
+ switch (msanGetStatus< 1 > (address)) {
284
284
case MsanStatus::UNINITIALIZED:
285
285
g_system->log (LogClass::CPU, _ (" 8-bit read from usable but uninitialized msan memory: %8.8lx\n " ), address);
286
286
break ;
@@ -330,7 +330,7 @@ uint16_t PCSX::Memory::read16(uint32_t address) {
330
330
331
331
if (pointer != nullptr ) {
332
332
if (msanInitialized () && inMsanRange (address)) {
333
- switch (msanGetStatus (address, 2 )) {
333
+ switch (msanGetStatus< 2 > (address)) {
334
334
case MsanStatus::UNINITIALIZED:
335
335
g_system->log (LogClass::CPU, _ (" 16-bit read from usable but uninitialized msan memory: %8.8lx\n " ), address);
336
336
break ;
@@ -377,7 +377,7 @@ uint32_t PCSX::Memory::read32(uint32_t address, ReadType readType) {
377
377
378
378
if (pointer != nullptr ) {
379
379
if (msanInitialized () && inMsanRange (address)) {
380
- switch (msanGetStatus (address, 4 )) {
380
+ switch (msanGetStatus< 4 > (address)) {
381
381
case MsanStatus::UNINITIALIZED:
382
382
g_system->log (LogClass::CPU, _ (" 32-bit read from usable but uninitialized msan memory: %8.8lx\n " ), address);
383
383
break ;
@@ -500,7 +500,7 @@ void PCSX::Memory::write8(uint32_t address, uint32_t value) {
500
500
501
501
if (pointer != nullptr ) {
502
502
if (msanInitialized () && inMsanRange (address)) {
503
- if (msanValidateWrite (address, 1 )) {
503
+ if (msanValidateWrite< 1 > (address)) {
504
504
m_msanRAM[address - c_msanStart] = value;
505
505
} else {
506
506
g_system->log (LogClass::CPU, _ (" 8-bit write to unusable msan memory: %8.8lx\n " ), address);
@@ -537,7 +537,7 @@ void PCSX::Memory::write16(uint32_t address, uint32_t value) {
537
537
538
538
if (pointer != nullptr ) {
539
539
if (msanInitialized () && inMsanRange (address)) {
540
- if (msanValidateWrite (address, 2 )) {
540
+ if (msanValidateWrite< 2 > (address)) {
541
541
*(uint16_t *)&m_msanRAM[address - c_msanStart] = SWAP_LEu16 (value);
542
542
} else {
543
543
g_system->log (LogClass::CPU, _ (" 16-bit write to unusable msan memory: %8.8lx\n " ), address);
@@ -575,7 +575,7 @@ void PCSX::Memory::write32(uint32_t address, uint32_t value) {
575
575
576
576
if (pointer != nullptr ) {
577
577
if (msanInitialized () && inMsanRange (address)) {
578
- if (msanValidateWrite (address, 4 )) {
578
+ if (msanValidateWrite< 4 > (address)) {
579
579
*(uint32_t *)&m_msanRAM[address - c_msanStart] = SWAP_LEu32 (value);
580
580
} else {
581
581
g_system->log (LogClass::CPU, _ (" 32-bit write to unusable msan memory: %8.8lx\n " ), address);
@@ -814,10 +814,10 @@ void PCSX::Memory::initMsan(bool reset) {
814
814
if (reset) {
815
815
free (m_msanRAM);
816
816
free (m_msanUsableBitmap);
817
- free (m_msanWrittenBitmap );
817
+ free (m_msanInitializedBitmap );
818
818
m_msanRAM = nullptr ;
819
819
m_msanUsableBitmap = nullptr ;
820
- m_msanWrittenBitmap = nullptr ;
820
+ m_msanInitializedBitmap = nullptr ;
821
821
m_msanAllocs.clear ();
822
822
m_msanChainRegistry.clear ();
823
823
}
@@ -830,7 +830,7 @@ void PCSX::Memory::initMsan(bool reset) {
830
830
// 1.5GB of RAM, with 384MB worth of bitmap, between 0x20000000 and 0x80000000
831
831
m_msanRAM = (uint8_t *)calloc (c_msanSize, 1 );
832
832
m_msanUsableBitmap = (uint8_t *)calloc (c_msanSize / 8 , 1 );
833
- m_msanWrittenBitmap = (uint8_t *)calloc (c_msanSize / 8 , 1 );
833
+ m_msanInitializedBitmap = (uint8_t *)calloc (c_msanSize / 8 , 1 );
834
834
m_msanPtr = 1024 ;
835
835
for (uint32_t segment = c_msanStart; segment < c_msanEnd; segment += 0x10000 ) {
836
836
m_readLUT[segment >> 16 ] = m_msanRAM + (segment - c_msanStart);
@@ -928,7 +928,7 @@ uint32_t PCSX::Memory::msanRealloc(uint32_t ptr, uint32_t size) {
928
928
// Mark the new allocation as written to
929
929
auto toCopy = std::min (size, oldSize);
930
930
for (uint32_t i = 0 ; i < toCopy; i++) {
931
- m_msanWrittenBitmap [(newPtr + i) / 8 ] |= 1 << ((newPtr + i) % 8 );
931
+ m_msanInitializedBitmap [(newPtr + i) / 8 ] |= 1 << ((newPtr + i) % 8 );
932
932
}
933
933
// Remove the allocation from the list of allocations.
934
934
m_msanAllocs.erase (ptr);
0 commit comments