MCPcopy Create free account
hub / github.com/TASEmulators/fceux / checkMemActivity

Method checkMemActivity

src/drivers/Qt/HexEditor.cpp:3573–3613  ·  view source on GitHub ↗

---------------------------------------------------------------------------- Calling of checkMemActivity must always be synchronized with the emulation thread as calling GetMem while the emulation is executing can mess up certain registers (especially controller registers $4016 and $4017)

Source from the content-addressed store, hash-verified

3571// thread as calling GetMem while the emulation is executing can mess up certain
3572// registers (especially controller registers $4016 and $4017)
3573int QHexEdit::checkMemActivity(void)
3574{
3575 int c;
3576
3577 // Don't perform memory activity checks when:
3578 // 1. In ROM View Mode
3579 // 2. The simulation is not cycling (paused)
3580
3581 if ( !updateRequested )
3582 {
3583 if ( ( viewMode == MODE_NES_ROM ) ||
3584 ( total_instructions_lp == total_instructions ) )
3585 {
3586 return -1;
3587 }
3588 }
3589
3590 for (int i=0; i<mb.size(); i++)
3591 {
3592 c = memAccessFunc(i);
3593
3594 if ( c != mb.buf[i].data )
3595 {
3596 mb.buf[i].actv = 15;
3597 mb.buf[i].data = c;
3598 //mb.buf[i].draw = 1;
3599 }
3600 else
3601 {
3602 if ( mb.buf[i].actv > 0 )
3603 {
3604 //mb.buf[i].draw = 1;
3605 mb.buf[i].actv--;
3606 }
3607 }
3608 }
3609 total_instructions_lp = total_instructions;
3610 updateRequested = false;
3611
3612 return 0;
3613}
3614//----------------------------------------------------------------------------
3615int QHexEdit::getRomAddrColor( int addr, QColor &fg, QColor &bg )
3616{

Callers 2

updatePeriodicMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected