From: Toni Wilen Date: Sat, 28 Mar 2015 14:07:55 +0000 (+0200) Subject: Cleanups. X-Git-Tag: 3100~65 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c3b4ee48ffabb6b3511a1ce6a5ad502f05b7e868;p=francis%2Fwinuae.git Cleanups. --- diff --git a/debug.cpp b/debug.cpp index ad451065..7b80be56 100644 --- a/debug.cpp +++ b/debug.cpp @@ -812,7 +812,7 @@ uaecptr dumpmem2 (uaecptr addr, TCHAR *out, int osize) if (osize <= (9 + cols * 5 + 1 + 2 * cols)) return addr; - _stprintf (out, _T("%08lX "), addr); + _stprintf (out, _T("%08X "), addr); for (i = 0; i < cols; i++) { uae_u8 b1, b2; b1 = b2 = 0; @@ -1370,7 +1370,7 @@ static void decode_copper_insn (FILE* file, uae_u16 mword1, uae_u16 mword2, unsi if (get_copper_address (-1) >= addr && get_copper_address(-1) <= addr + 3) here = '*'; - console_out_f (_T("%c%08lx: %04lx %04lx%s\t;%c "), here, addr, insn >> 16, insn & 0xFFFF, record, insn != ((mword1 << 16) | mword2) ? '!' : ' '); + console_out_f (_T("%c%08x: %04x %04x%s\t;%c "), here, addr, insn >> 16, insn & 0xFFFF, record, insn != ((mword1 << 16) | mword2) ? '!' : ' '); switch (insn_type) { case 0x00010000: /* WAIT insn */ @@ -1398,9 +1398,9 @@ static void decode_copper_insn (FILE* file, uae_u16 mword1, uae_u16 mword2, unsi i++; } if (custd[i].name) - console_out_f (_T("%s := 0x%04lx\n"), custd[i].name, insn & 0xffff); + console_out_f (_T("%s := 0x%04x\n"), custd[i].name, insn & 0xffff); else - console_out_f (_T("%04x := 0x%04lx\n"), addr, insn & 0xffff); + console_out_f (_T("%04x := 0x%04x\n"), addr, insn & 0xffff); } break; diff --git a/disk.cpp b/disk.cpp index 63ebe243..c022bbba 100644 --- a/disk.cpp +++ b/disk.cpp @@ -2966,7 +2966,7 @@ void DISK_select (uae_u8 data) if (!currprefs.cs_df0idhw && dr == 0) drv->idbit = 0; #ifdef DEBUG_DRIVE_ID - write_log (_T("DISK_status: sel %d id %s (%08X) [0x%08lx, bit #%02d: %d]\n"), + write_log (_T("DISK_status: sel %d id %s (%08X) [0x%08x, bit #%02d: %d]\n"), dr, drive_id_name(drv), drv->drive_id, drv->drive_id << drv->drive_id_scnt, 31 - drv->drive_id_scnt, drv->idbit); #endif } diff --git a/fpp.cpp b/fpp.cpp index c0d75b62..64c13ee1 100644 --- a/fpp.cpp +++ b/fpp.cpp @@ -1868,7 +1868,7 @@ void fpuop_dbcc (uae_u32 opcode, uae_u16 extra) regs.fp_exception = false; #if DEBUG_FPP if (!isinrom ()) - write_log (_T("fdbcc_opp at %08lx\n"), m68k_getpc ()); + write_log (_T("fdbcc_opp at %08x\n"), m68k_getpc ()); #endif if (fault_if_no_6888x (opcode, extra, pc - 4)) return; @@ -1900,7 +1900,7 @@ void fpuop_scc (uae_u32 opcode, uae_u16 extra) regs.fp_exception = false; #if DEBUG_FPP if (!isinrom ()) - write_log (_T("fscc_opp at %08lx\n"), m68k_getpc ()); + write_log (_T("fscc_opp at %08x\n"), m68k_getpc ()); #endif if (fault_if_no_6888x (opcode, extra, pc)) @@ -1935,7 +1935,7 @@ void fpuop_trapcc (uae_u32 opcode, uaecptr oldpc, uae_u16 extra) regs.fp_exception = false; #if DEBUG_FPP if (!isinrom ()) - write_log (_T("ftrapcc_opp at %08lx\n"), m68k_getpc ()); + write_log (_T("ftrapcc_opp at %08x\n"), m68k_getpc ()); #endif if (fault_if_no_fpu_u (opcode, extra, 0, oldpc)) return; @@ -1957,7 +1957,7 @@ void fpuop_bcc (uae_u32 opcode, uaecptr oldpc, uae_u32 extra) regs.fp_exception = false; #if DEBUG_FPP if (!isinrom ()) - write_log (_T("fbcc_opp at %08lx\n"), m68k_getpc ()); + write_log (_T("fbcc_opp at %08x\n"), m68k_getpc ()); #endif if (fault_if_no_fpu (opcode, extra, 0, oldpc - 2)) return; @@ -1985,7 +1985,7 @@ void fpuop_save (uae_u32 opcode) regs.fp_exception = false; #if DEBUG_FPP if (!isinrom ()) - write_log (_T("fsave_opp at %08lx\n"), m68k_getpc ()); + write_log (_T("fsave_opp at %08x\n"), m68k_getpc ()); #endif if (fault_if_no_6888x (opcode, 0, pc)) @@ -2224,7 +2224,7 @@ void fpuop_restore (uae_u32 opcode) regs.fp_exception = false; #if DEBUG_FPP if (!isinrom ()) - write_log (_T("frestore_opp at %08lx\n"), m68k_getpc ()); + write_log (_T("frestore_opp at %08x\n"), m68k_getpc ()); #endif if (fault_if_no_6888x (opcode, 0, pc)) @@ -2805,7 +2805,7 @@ static void fpuop_arithmetic2 (uae_u32 opcode, uae_u16 extra) #if DEBUG_FPP if (!isinrom ()) - write_log (_T("FPP %04lx %04x at %08lx\n"), opcode & 0xffff, extra, pc); + write_log (_T("FPP %04x %04x at %08x\n"), opcode & 0xffff, extra, pc); #endif if (fault_if_no_6888x (opcode, extra, pc)) return; diff --git a/memory.cpp b/memory.cpp index a0c12e34..a361b919 100644 --- a/memory.cpp +++ b/memory.cpp @@ -131,7 +131,7 @@ __inline__ void byteput (uaecptr addr, uae_u32 b) int addr_valid (const TCHAR *txt, uaecptr addr, uae_u32 len) { addrbank *ab = &get_mem_bank(addr); - if (ab == 0 || !(ab->flags & (ABFLAG_RAM | ABFLAG_ROM)) || addr < 0x100 || len < 0 || len > 16777215 || !valid_address (addr, len)) { + if (ab == 0 || !(ab->flags & (ABFLAG_RAM | ABFLAG_ROM)) || addr < 0x100 || len > 16777215 || !valid_address (addr, len)) { write_log (_T("corrupt %s pointer %x (%d) detected!\n"), txt, addr, len); return 0; } diff --git a/newcpu.cpp b/newcpu.cpp index 2aea16be..b5972ef6 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -322,7 +322,7 @@ static bool check_trace (void) return true; if (!cputrace.readcounter && !cputrace.writecounter && !cputrace.cyclecounter) { if (cpu_tracer != -2) { - write_log (_T("CPU trace: dma_cycle() enabled. %08x %08x NOW=%08lx\n"), + write_log (_T("CPU trace: dma_cycle() enabled. %08x %08x NOW=%08x\n"), cputrace.cyclecounter_pre, cputrace.cyclecounter_post, get_cycles ()); cpu_tracer = -2; // dma_cycle() allowed to work now } @@ -346,7 +346,7 @@ static bool check_trace (void) x_do_cycles_pre = x2_do_cycles_pre; x_do_cycles_post = x2_do_cycles_post; set_x_cp_funcs(); - write_log (_T("CPU tracer playback complete. STARTCYCLES=%08x NOWCYCLES=%08lx\n"), cputrace.startcycles, get_cycles ()); + write_log (_T("CPU tracer playback complete. STARTCYCLES=%08x NOWCYCLES=%08x\n"), cputrace.startcycles, get_cycles ()); cputrace.needendcycles = 1; cpu_tracer = 0; return true; @@ -359,7 +359,7 @@ static bool get_trace (uaecptr addr, int accessmode, int size, uae_u32 *data) struct cputracememory *ctm = &cputrace.ctm[i]; if (ctm->addr == addr && ctm->mode == mode) { ctm->mode = 0; - write_log (_T("CPU trace: GET %d: PC=%08x %08x=%08x %d %d %08x/%08x/%08x %d/%d (%08lx)\n"), + write_log (_T("CPU trace: GET %d: PC=%08x %08x=%08x %d %d %08x/%08x/%08x %d/%d (%08x)\n"), i, cputrace.pc, addr, ctm->data, accessmode, size, cputrace.cyclecounter, cputrace.cyclecounter_pre, cputrace.cyclecounter_post, cputrace.readcounter, cputrace.writecounter, get_cycles ()); @@ -1462,7 +1462,7 @@ void init_m68k (void) TCHAR name[20]; write_log (_T("Reading instruction count file...\n")); fscanf (f, "Total: %lu\n", &total); - while (fscanf (f, "%lx: %lu %s\n", &opcode, &count, name) == 3) { + while (fscanf (f, "%x: %lu %s\n", &opcode, &count, name) == 3) { instrcount[opcode] = count; } fclose (f); @@ -1534,7 +1534,7 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode else _stprintf (offtxt, _T("$%04x"), disp16); addr = m68k_areg (regs, reg) + disp16; - _stprintf (buffer, _T("(A%d, %s) == $%08lx"), reg, offtxt, (unsigned long)addr); + _stprintf (buffer, _T("(A%d, %s) == $%08x"), reg, offtxt, (unsigned long)addr); } break; case Ad8r: @@ -1564,14 +1564,14 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode if (dp & 4) base += dispreg; addr = base + outer; - _stprintf (buffer, _T("(%s%c%d.%c*%d+%d)+%d == $%08lx"), name, + _stprintf (buffer, _T("(%s%c%d.%c*%d+%d)+%d == $%08x"), name, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp, outer, (unsigned long)addr); } else { addr = m68k_areg (regs, reg) + (uae_s32)((uae_s8)disp8) + dispreg; - _stprintf (buffer, _T("(A%d, %c%d.%c*%d, $%02x) == $%08lx"), reg, + _stprintf (buffer, _T("(A%d, %c%d.%c*%d, $%02x) == $%08x"), reg, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp8, (unsigned long)addr); @@ -1580,7 +1580,7 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode case PC16: disp16 = get_iword_debug (pc); pc += 2; addr += (uae_s16)disp16; - _stprintf (buffer, _T("(PC,$%04x) == $%08lx"), disp16 & 0xffff, (unsigned long)addr); + _stprintf (buffer, _T("(PC,$%04x) == $%08x"), disp16 & 0xffff, (unsigned long)addr); break; case PC8r: dp = get_iword_debug (pc); pc += 2; @@ -1609,26 +1609,26 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode if (dp & 4) base += dispreg; addr = base + outer; - _stprintf (buffer, _T("(%s%c%d.%c*%d+%d)+%d == $%08lx"), name, + _stprintf (buffer, _T("(%s%c%d.%c*%d+%d)+%d == $%08x"), name, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp, outer, (unsigned long)addr); } else { addr += (uae_s32)((uae_s8)disp8) + dispreg; - _stprintf (buffer, _T("(PC, %c%d.%c*%d, $%02x) == $%08lx"), dp & 0x8000 ? 'A' : 'D', + _stprintf (buffer, _T("(PC, %c%d.%c*%d, $%02x) == $%08x"), dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp8, (unsigned long)addr); } break; case absw: addr = (uae_s32)(uae_s16)get_iword_debug (pc); - _stprintf (buffer, _T("$%08lx"), (unsigned long)addr); + _stprintf (buffer, _T("$%08x"), addr); pc += 2; break; case absl: addr = get_ilong_debug (pc); - _stprintf (buffer, _T("$%08lx"), (unsigned long)addr); + _stprintf (buffer, _T("$%08x"), (unsigned long)addr); pc += 4; break; case imm: @@ -1642,7 +1642,7 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode pc += 2; break; case sz_long: - _stprintf(buffer, _T("#$%08lx"), (unsigned long)(get_ilong_debug(pc))); + _stprintf(buffer, _T("#$%08x"), (unsigned long)(get_ilong_debug(pc))); pc += 4; break; case sz_single: @@ -1674,7 +1674,7 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode break; } case sz_packed: - _stprintf(buffer, _T("#$%08lx%08lx%08lx"), (unsigned long)(get_ilong_debug(pc)), (unsigned long)(get_ilong_debug(pc + 4)), (unsigned long)(get_ilong_debug(pc + 8))); + _stprintf(buffer, _T("#$%08x%08x%08x"), get_ilong_debug(pc), get_ilong_debug(pc + 4), get_ilong_debug(pc + 8)); pc += 12; break; default: @@ -1696,13 +1696,13 @@ static uaecptr ShowEA (void *f, uaecptr pc, uae_u16 opcode, int reg, amodes mode break; case imm2: offset = (uae_s32)get_ilong_debug (pc); - _stprintf (buffer, _T("#$%08lx"), (unsigned long)offset); + _stprintf (buffer, _T("#$%08x"), (unsigned long)offset); addr = pc + offset; pc += 4; break; case immi: offset = (uae_s32)(uae_s8)(reg & 0xff); - _stprintf (buffer, _T("#$%08lx"), (unsigned long)offset); + _stprintf (buffer, _T("#$%08x"), (unsigned long)offset); addr = pc + offset; break; default: @@ -3912,7 +3912,7 @@ static void m68k_run_1_ce (void) cont: if (cputrace.needendcycles) { cputrace.needendcycles = 0; - write_log (_T("STARTCYCLES=%08x ENDCYCLES=%08lx\n"), cputrace.startcycles, get_cycles ()); + write_log (_T("STARTCYCLES=%08x ENDCYCLES=%08x\n"), cputrace.startcycles, get_cycles ()); log_dma_record (); } @@ -5121,7 +5121,7 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int cn for (lookup = lookuptab;lookup->mnemo != dp->mnemo; lookup++) ; - buf = buf_out (buf, &bufsize, _T("%08lX "), pc); + buf = buf_out (buf, &bufsize, _T("%08X "), pc); pc += 2; @@ -5497,11 +5497,11 @@ void m68k_dumpstate (uaecptr pc, uaecptr *nextpc) int i, j; for (i = 0; i < 8; i++){ - console_out_f (_T(" D%d %08lX "), i, m68k_dreg (regs, i)); + console_out_f (_T(" D%d %08X "), i, m68k_dreg (regs, i)); if ((i & 3) == 3) console_out_f (_T("\n")); } for (i = 0; i < 8; i++){ - console_out_f (_T(" A%d %08lX "), i, m68k_areg (regs, i)); + console_out_f (_T(" A%d %08X "), i, m68k_areg (regs, i)); if ((i & 3) == 3) console_out_f (_T("\n")); } if (regs.s == 0) @@ -5563,7 +5563,7 @@ void m68k_dumpstate (uaecptr pc, uaecptr *nextpc) if (pc != 0xffffffff) { m68k_disasm (pc, nextpc, 1); if (nextpc) - console_out_f (_T("Next PC: %08lx\n"), *nextpc); + console_out_f (_T("Next PC: %08x\n"), *nextpc); } } void m68k_dumpstate (uaecptr *nextpc) diff --git a/newcpu_common.cpp b/newcpu_common.cpp index 9121d6c9..967aa80b 100644 --- a/newcpu_common.cpp +++ b/newcpu_common.cpp @@ -818,7 +818,7 @@ bool m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra) a |= (uae_s64)m68k_dreg (regs, extra & 7) << 32; } - if (a == 0x8000000000000000 && src == -1) { + if (a == 0x8000000000000000 && src == ~0) { SET_VFLG (1); SET_NFLG (1); SET_CFLG (0);