---------------------------------------------------------------------------- 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)
| 3571 | // thread as calling GetMem while the emulation is executing can mess up certain |
| 3572 | // registers (especially controller registers $4016 and $4017) |
| 3573 | int 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 | //---------------------------------------------------------------------------- |
| 3615 | int QHexEdit::getRomAddrColor( int addr, QColor &fg, QColor &bg ) |
| 3616 | { |
no test coverage detected