comparison debug.c @ 622:b76d2a628ab9

Partially working switch to having a vcounter and hslot counter in the context rather than trying to derive them from the cycle count. This should allow for more accurate handling of mid screen mode switches. Interrupt timing is broken currently though
author Michael Pavone <pavone@retrodev.com>
date Tue, 17 Jun 2014 19:01:01 -0700
parents 62860044337d
children f822d9216968
comparison
equal deleted inserted replaced
621:5196333b37a6 622:b76d2a628ab9
596 for (int flag = 0; flag < 5; flag++) { 596 for (int flag = 0; flag < 5; flag++) {
597 value |= context->flags[flag] << (4-flag); 597 value |= context->flags[flag] << (4-flag);
598 } 598 }
599 } else if(param[0] == 'c') { 599 } else if(param[0] == 'c') {
600 value = context->current_cycle; 600 value = context->current_cycle;
601 } else if (param[0] == '0' && param[1] == 'x') { 601 } else if ((param[0] == '0' && param[1] == 'x') || param[0] == '$') {
602 uint32_t p_addr = strtol(param+2, NULL, 16); 602 uint32_t p_addr = strtol(param+(param[0] == '0' ? 2 : 1), NULL, 16);
603 value = read_dma_value(p_addr/2); 603 if ((p_addr & 0xFFFFFF) == 0xC00004) {
604 genesis_context * gen = context->system;
605 value = vdp_hv_counter_read(gen->vdp);
606 } else {
607 value = read_dma_value(p_addr/2);
608 }
604 } else { 609 } else {
605 fprintf(stderr, "Unrecognized parameter to p: %s\n", param); 610 fprintf(stderr, "Unrecognized parameter to p: %s\n", param);
606 break; 611 break;
607 } 612 }
608 printf(format, param, value); 613 printf(format, param, value);