82 |
|
|
83 |
|
start: |
84 |
|
if (mon_token == T_STRING) { |
85 |
– |
uint8 *p = (uint8 *)mon_string; |
85 |
|
unsigned n = strlen(mon_string); |
86 |
|
str = (uint8 *)realloc(str, (len + n - 1 + GRANULARITY) & ~(GRANULARITY - 1)); |
87 |
|
memcpy(str + len, mon_string, n); |
230 |
|
return; |
231 |
|
|
232 |
|
while (adr <= end_adr && !mon_aborted()) { |
233 |
< |
fprintf(monout, "%0*lx:", 2 * sizeof(adr), mon_use_real_mem ? adr: adr % mon_mem_size); |
233 |
> |
fprintf(monout, "%0*lx:", int(2 * sizeof(adr)), mon_use_real_mem ? adr: adr % mon_mem_size); |
234 |
|
for (int i=0; i<MEMDUMP_BPL; i++, adr++) { |
235 |
|
if (i % 4 == 0) |
236 |
|
fprintf(monout, " %08x", mon_read_word(adr)); |
261 |
|
return; |
262 |
|
|
263 |
|
while (adr <= end_adr && !mon_aborted()) { |
264 |
< |
fprintf(monout, "%0*lx:", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
264 |
> |
fprintf(monout, "%0*lx:", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
265 |
|
for (int i=0; i<ASCIIDUMP_BPL; i++, adr++) |
266 |
|
str[i] = char2print(mon_read_byte(adr)); |
267 |
|
fprintf(monout, " '%s'\n", str); |
287 |
|
return; |
288 |
|
|
289 |
|
while (adr <= end_adr && !mon_aborted()) { |
290 |
< |
fprintf(monout, "%0*lx:", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
290 |
> |
fprintf(monout, "%0*lx:", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
291 |
|
uint8 b = mon_read_byte(adr); |
292 |
|
for (int m=0x80, i=0; i<8; m>>=1, i++) |
293 |
|
str[i] = (b & m) ? '*' : '.'; |
330 |
|
case CPU_PPC: |
331 |
|
while (adr <= end_adr && !mon_aborted()) { |
332 |
|
uint32 w = mon_read_word(adr); |
333 |
< |
fprintf(monout, "%0*lx: %08x\t", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size, w); |
333 |
> |
fprintf(monout, "%0*lx: %08x\t", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size, w); |
334 |
|
disass_ppc(monout, mon_use_real_mem ? adr : adr % mon_mem_size, w); |
335 |
|
adr += 4; |
336 |
|
} |
341 |
|
uint8 op = mon_read_byte(adr); |
342 |
|
uint8 lo = mon_read_byte(adr + 1); |
343 |
|
uint8 hi = mon_read_byte(adr + 2); |
344 |
< |
fprintf(monout, "%0*lx: ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
344 |
> |
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
345 |
|
adr += disass_6502(monout, mon_use_real_mem ? adr : adr % mon_mem_size, op, lo, hi); |
346 |
|
} |
347 |
|
break; |
348 |
|
|
349 |
|
case CPU_680x0: |
350 |
|
while (adr <= end_adr && !mon_aborted()) { |
351 |
< |
fprintf(monout, "%0*lx: ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
351 |
> |
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
352 |
|
adr += disass_68k(monout, mon_use_real_mem ? adr : adr % mon_mem_size); |
353 |
|
} |
354 |
|
break; |
355 |
|
|
356 |
|
case CPU_Z80: |
357 |
|
while (adr <= end_adr && !mon_aborted()) { |
358 |
< |
fprintf(monout, "%0*lx: ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
358 |
> |
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
359 |
|
adr += disass_z80(monout, mon_use_real_mem ? adr : adr % mon_mem_size); |
360 |
|
} |
361 |
|
break; |
362 |
|
|
363 |
|
case CPU_x86_64: |
364 |
|
while (adr <= end_adr && !mon_aborted()) { |
365 |
< |
fprintf(monout, "%0*lx: ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
365 |
> |
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
366 |
|
adr += disass_x86(monout, mon_use_real_mem ? adr : adr % mon_mem_size, 64); |
367 |
|
} |
368 |
|
break; |
369 |
|
|
370 |
|
case CPU_80x86_32: |
371 |
|
while (adr <= end_adr && !mon_aborted()) { |
372 |
< |
fprintf(monout, "%0*lx: ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
372 |
> |
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
373 |
|
adr += disass_x86(monout, mon_use_real_mem ? adr : adr % mon_mem_size, 32); |
374 |
|
} |
375 |
|
break; |
376 |
|
|
377 |
|
case CPU_80x86_16: |
378 |
|
while (adr <= end_adr && !mon_aborted()) { |
379 |
< |
fprintf(monout, "%0*lx: ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
379 |
> |
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
380 |
|
adr += disass_x86(monout, mon_use_real_mem ? adr : adr % mon_mem_size, 16); |
381 |
|
} |
382 |
|
} |
524 |
|
|
525 |
|
while (adr <= end_adr && !mon_aborted()) { |
526 |
|
if (mon_read_byte(adr) != mon_read_byte(dest)) { |
527 |
< |
fprintf(monout, "%0*lx ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
527 |
> |
fprintf(monout, "%0*lx ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
528 |
|
num++; |
529 |
|
if (!(num & 7)) |
530 |
|
fputc('\n', monout); |
564 |
|
break; |
565 |
|
|
566 |
|
if (i == len) { |
567 |
< |
fprintf(monout, "%0*lx ", 2 * sizeof(adr), mon_use_real_mem ? adr : adr % mon_mem_size); |
567 |
> |
fprintf(monout, "%0*lx ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); |
568 |
|
num++; |
569 |
|
if (num == 1) |
570 |
|
mon_dot_address = adr; |
618 |
|
mon_write_byte(adr++, fc); |
619 |
|
fclose(file); |
620 |
|
|
621 |
< |
fprintf(monerr, "%08x bytes read from %0*lx to %0*lx\n", adr - start_adr, 2 * sizeof(adr), mon_use_real_mem ? start_adr : start_adr % mon_mem_size, 2 * sizeof(adr), mon_use_real_mem ? adr-1 : (adr-1) % mon_mem_size); |
621 |
> |
fprintf(monerr, "%08x bytes read from %0*lx to %0*lx\n", adr - start_adr, int(2 * sizeof(adr)), mon_use_real_mem ? start_adr : start_adr % mon_mem_size, int(2 * sizeof(adr)), mon_use_real_mem ? adr-1 : (adr-1) % mon_mem_size); |
622 |
|
mon_dot_address = adr; |
623 |
|
} |
624 |
|
} |
661 |
|
fputc(mon_read_byte(adr++), file); |
662 |
|
fclose(file); |
663 |
|
|
664 |
< |
fprintf(monerr, "%08x bytes written from %0*lx to %0*lx\n", size, 2 * sizeof(adr), mon_use_real_mem ? start_adr : start_adr % mon_mem_size, 2 * sizeof(adr), mon_use_real_mem ? end_adr : end_adr % mon_mem_size); |
664 |
> |
fprintf(monerr, "%08x bytes written from %0*lx to %0*lx\n", size, int(2 * sizeof(adr)), mon_use_real_mem ? start_adr : start_adr % mon_mem_size, int(2 * sizeof(adr)), mon_use_real_mem ? end_adr : end_adr % mon_mem_size); |
665 |
|
} |
666 |
|
} |