comparison dis.c @ 103:a71544cd01ea

Don't pre-emptively translate code at interrupt vectors as some PD ROMs have these pointing at junk. Need some kind of heuristic for detecting garbage if I'm going to translate them ahead of time by default.
author Mike Pavone <pavone@retrodev.com>
date Thu, 27 Dec 2012 22:48:54 -0800
parents 7b1e16e981ef
children 8b50d2c975b2
comparison
equal deleted inserted replaced
102:bfaca67eeb78 103:a71544cd01ea
24 deferred * defer(uint32_t address, deferred * next) 24 deferred * defer(uint32_t address, deferred * next)
25 { 25 {
26 if (is_visited(address)) { 26 if (is_visited(address)) {
27 return next; 27 return next;
28 } 28 }
29 //printf("deferring %X\n", address); 29 printf("deferring %X\n", address);
30 deferred * d = malloc(sizeof(deferred)); 30 deferred * d = malloc(sizeof(deferred));
31 d->address = address; 31 d->address = address;
32 d->next = next; 32 d->next = next;
33 return d; 33 return d;
34 } 34 }
82 } 82 }
83 visit(address); 83 visit(address);
84 next = m68k_decode(encoded, &instbuf, address); 84 next = m68k_decode(encoded, &instbuf, address);
85 address += (next-encoded)*2; 85 address += (next-encoded)*2;
86 encoded = next; 86 encoded = next;
87 //m68k_disasm(&instbuf, disbuf); 87 m68k_disasm(&instbuf, disbuf);
88 //printf("%X: %s\n", instbuf.address, disbuf); 88 printf("%X: %s\n", instbuf.address, disbuf);
89 if (instbuf.op == M68K_ILLEGAL || instbuf.op == M68K_RTS || instbuf.op == M68K_RTE) { 89 if (instbuf.op == M68K_ILLEGAL || instbuf.op == M68K_RTS || instbuf.op == M68K_RTE) {
90 break; 90 break;
91 } else if (instbuf.op == M68K_BCC || instbuf.op == M68K_DBCC || instbuf.op == M68K_BSR) { 91 } else if (instbuf.op == M68K_BCC || instbuf.op == M68K_DBCC || instbuf.op == M68K_BSR) {
92 if (instbuf.op == M68K_BCC && instbuf.extra.cond == COND_TRUE) { 92 if (instbuf.op == M68K_BCC && instbuf.extra.cond == COND_TRUE) {
93 address = instbuf.address + 2 + instbuf.src.params.immed; 93 address = instbuf.address + 2 + instbuf.src.params.immed;