Formatting cleanup

This commit is contained in:
Dimitris Panokostas 2020-05-23 22:36:28 +02:00
parent ec06c1ecaa
commit 3e214e6ed7
2 changed files with 167 additions and 147 deletions

View file

@ -109,14 +109,14 @@ STATIC_INLINE void set_cycles (unsigned long int x)
STATIC_INLINE int current_hpos(void)
{
int hp = (get_cycles () - eventtab[ev_hsync].oldcycles) / CYCLE_UNIT;
const int hp = (get_cycles() - eventtab[ev_hsync].oldcycles) / CYCLE_UNIT;
return hp;
}
STATIC_INLINE bool cycles_in_range (unsigned long endcycles)
{
signed long c = get_cycles ();
return (signed long)endcycles - c > 0;
const signed long c = get_cycles ();
return static_cast<signed long>(endcycles) - c > 0;
}
extern void MISC_handler (void);
@ -125,7 +125,7 @@ extern void event2_newevent_x_replace(evt t, uae_u32 data, evfunc2 func);
STATIC_INLINE void event2_newevent_x (int no, evt t, uae_u32 data, evfunc2 func)
{
if (((int)t) <= 0) {
if (static_cast<int>(t) <= 0) {
func (data);
return;
}
@ -143,7 +143,7 @@ STATIC_INLINE void event2_newevent2 (evt t, uae_u32 data, evfunc2 func)
STATIC_INLINE void event2_remevent (int no)
{
eventtab2[no].active = 0;
eventtab2[no].active = false;
}
#endif /* UAE_EVENTS_H */

View file

@ -23,7 +23,8 @@ extern int movem_next[256];
typedef uae_u32 REGPARAM3 cpuop_func(uae_u32) REGPARAM;
typedef void REGPARAM3 cpuop_func_ce(uae_u32) REGPARAM;
struct cputbl {
struct cputbl
{
cpuop_func* handler;
uae_u16 opcode;
uae_s8 length;
@ -43,7 +44,8 @@ typedef uae_u32 REGPARAM3 compop_func (uae_u32) REGPARAM;
#define COMP_OPCODE_ISCJUMP 0x0010
#define COMP_OPCODE_USES_FPU 0x0020
struct comptbl {
struct comptbl
{
compop_func* handler;
uae_u32 specific;
uae_u32 opcode;
@ -67,6 +69,7 @@ struct mmufixup
int reg;
uae_u32 value;
};
extern struct mmufixup mmufixup[1];
typedef struct
@ -162,6 +165,7 @@ STATIC_INLINE void set_special_exter(uae_u32 x)
{
atomic_or(&regs.spcflags, x);
}
STATIC_INLINE void set_special(uae_u32 x)
{
atomic_or(&regs.spcflags, x);
@ -201,15 +205,18 @@ STATIC_INLINE void m68k_setpc (uaecptr newpc)
regs.pc_p = regs.pc_oldp = get_real_address(newpc);
regs.instruction_pc = regs.pc = newpc;
}
STATIC_INLINE void m68k_setpc_j(uaecptr newpc)
{
regs.pc_p = regs.pc_oldp = get_real_address(newpc);
regs.pc = newpc;
}
STATIC_INLINE uaecptr m68k_getpc(void)
{
return (uaecptr)(regs.pc + ((uae_u8*)regs.pc_p - (uae_u8*)regs.pc_oldp));
return static_cast<uaecptr>(regs.pc + (static_cast<uae_u8*>(regs.pc_p) - static_cast<uae_u8*>(regs.pc_oldp)));
}
#define M68K_GETPC m68k_getpc()
STATIC_INLINE void m68k_incpc(int o)
{
@ -218,22 +225,26 @@ STATIC_INLINE void m68k_incpc(int o)
STATIC_INLINE uae_u32 get_dibyte(int o)
{
return do_get_mem_byte((uae_u8 *)((regs).pc_p + (o) + 1));
return do_get_mem_byte(static_cast<uae_u8*>((regs).pc_p + (o) + 1));
}
STATIC_INLINE uae_u32 get_diword(int o)
{
return do_get_mem_word((uae_u16*)((regs).pc_p + (o)));
}
STATIC_INLINE uae_u32 get_dilong(int o)
{
return do_get_mem_long((uae_u32*)((regs).pc_p + (o)));
}
STATIC_INLINE uae_u32 next_diword(void)
{
uae_u32 r = do_get_mem_word((uae_u16*)((regs).pc_p));
m68k_incpc(2);
return r;
}
STATIC_INLINE uae_u32 next_dilong(void)
{
uae_u32 r = do_get_mem_long((uae_u32*)((regs).pc_p));
@ -247,6 +258,7 @@ STATIC_INLINE void m68k_do_bsr (uaecptr oldpc, uae_s32 offset)
put_long(m68k_areg(regs, 7), oldpc);
m68k_incpc(offset);
}
STATIC_INLINE void m68k_do_rts(void)
{
uae_u32 newpc = get_long(m68k_areg(regs, 7));
@ -260,14 +272,17 @@ STATIC_INLINE void m68k_setpci(uaecptr newpc)
{
regs.instruction_pc = regs.pc = newpc;
}
STATIC_INLINE void m68k_setpci_j(uaecptr newpc)
{
regs.pc = newpc;
}
STATIC_INLINE uaecptr m68k_getpci(void)
{
return regs.pc;
}
STATIC_INLINE void m68k_incpci(int o)
{
regs.pc += o;
@ -279,6 +294,7 @@ STATIC_INLINE void m68k_do_bsri(uaecptr oldpc, uae_s32 offset)
x_put_long(m68k_areg(regs, 7), oldpc);
m68k_incpci(offset);
}
STATIC_INLINE void m68k_do_rtsi(void)
{
uae_u32 newpc = x_get_long(m68k_areg(regs, 7));
@ -298,10 +314,13 @@ STATIC_INLINE void m68k_incpc_normal(int o)
STATIC_INLINE void m68k_setpc_normal(uaecptr pc)
{
if (m68k_pc_indirect > 0) {
regs.pc_p = regs.pc_oldp = 0;
if (m68k_pc_indirect > 0)
{
regs.pc_p = regs.pc_oldp = nullptr;
m68k_setpci(pc);
} else {
}
else
{
m68k_setpc(pc);
}
}
@ -347,7 +366,8 @@ extern void setchk2undefinedflags(uae_u32 lower, uae_u32 upper, uae_u32 val, int
extern void protect_roms(bool);
extern void Exception_build_stack_frame_common(uae_u32 oldpc, uae_u32 currpc, int nr);
extern void Exception_build_stack_frame(uae_u32 oldpc, uae_u32 currpc, uae_u32 ssw, int nr, int format);
extern void Exception_build_68000_address_error_stack_frame(uae_u16 mode, uae_u16 opcode, uaecptr fault_addr, uaecptr pc);
extern void Exception_build_68000_address_error_stack_frame(uae_u16 mode, uae_u16 opcode, uaecptr fault_addr,
uaecptr pc);
extern uae_u32 exception_pc(int nr);
void ccr_68000_long_move_ae_LZN(uae_s32 src);