comparison sms.c @ 2424:767ec72acca7

Avoid conflicts between watchpoints and normal debugger entry
author Michael Pavone <pavone@retrodev.com>
date Wed, 24 Jan 2024 18:51:44 -0800
parents c97609fe8315
children
comparison
equal deleted inserted replaced
2423:b733a10488c6 2424:767ec72acca7
476 } else { 476 } else {
477 exit_after -= elapsed; 477 exit_after -= elapsed;
478 } 478 }
479 } 479 }
480 } 480 }
481 if (system->enter_debugger && sms->z80->pc) { 481 if ((system->enter_debugger || sms->z80->wp_hit) && sms->z80->pc) {
482 system->enter_debugger = 0; 482 if (!sms->z80->wp_hit) {
483 system->enter_debugger = 0;
484 }
483 #ifndef IS_LIB 485 #ifndef IS_LIB
484 zdebugger(sms->z80, sms->z80->pc); 486 zdebugger(sms->z80, sms->z80->pc);
485 #endif 487 #endif
486 } 488 }
487 #ifdef NEW_CORE 489 #ifdef NEW_CORE
493 if (nmi != CYCLE_NEVER) { 495 if (nmi != CYCLE_NEVER) {
494 z80_assert_nmi(sms->z80, nmi); 496 z80_assert_nmi(sms->z80, nmi);
495 } 497 }
496 } 498 }
497 499
498 if (system->enter_debugger) { 500 if (system->enter_debugger || sms->z80->wp_hit) {
499 target_cycle = sms->z80->Z80_CYCLE + 1; 501 target_cycle = sms->z80->Z80_CYCLE + 1;
500 } 502 }
501 z80_run(sms->z80, target_cycle); 503 z80_run(sms->z80, target_cycle);
502 if (sms->z80->reset) { 504 if (sms->z80->reset) {
503 z80_clear_reset(sms->z80, sms->z80->Z80_CYCLE + 128*15); 505 z80_clear_reset(sms->z80, sms->z80->Z80_CYCLE + 128*15);