Fixed MSVC build.

This commit is contained in:
Phil Bennett 2009-02-07 18:50:40 +00:00
parent c51290fa1a
commit e4f2c2494c
2 changed files with 21 additions and 21 deletions

View File

@ -380,15 +380,15 @@ static void tms57002_opc_write_c(tms57002_t *s, UINT32 opcode, UINT32 v)
{ {
if(opcode & 0x400) { if(opcode & 0x400) {
if(opcode & 0x100) if(opcode & 0x100)
return tms57002_write_c(s, opcode & 0xff, v); tms57002_write_c(s, opcode & 0xff, v);
else if(opcode & 0x80) else if(opcode & 0x80)
return tms57002_write_c(s, s->ca++, v); tms57002_write_c(s, s->ca++, v);
else else
return tms57002_write_c(s, s->ca, v); tms57002_write_c(s, s->ca, v);
} else if(opcode & 0x200) } else if(opcode & 0x200)
return tms57002_write_c(s, s->ca++, v); tms57002_write_c(s, s->ca++, v);
else else
return tms57002_write_c(s, s->ca, v); tms57002_write_c(s, s->ca, v);
} }
static UINT32 tms57002_opc_read_c(tms57002_t *s, UINT32 opcode) static UINT32 tms57002_opc_read_c(tms57002_t *s, UINT32 opcode)
@ -1081,7 +1081,7 @@ void tms57002_execute(tms57002_t *s)
} }
} }
static inline int xmode(UINT32 opcode, char type) INLINE int xmode(UINT32 opcode, char type)
{ {
if(((opcode & 0x400) && (type == 'c')) || (!(opcode & 0x400) && (type == 'd'))) { if(((opcode & 0x400) && (type == 'c')) || (!(opcode & 0x400) && (type == 'd'))) {
if(opcode & 0x100) if(opcode & 0x100)
@ -1096,42 +1096,42 @@ static inline int xmode(UINT32 opcode, char type)
return 1; return 1;
} }
static inline int sfao(UINT32 st1) INLINE int sfao(UINT32 st1)
{ {
return st1 & ST1_SFAO ? 1 : 0; return st1 & ST1_SFAO ? 1 : 0;
} }
static inline int dbp(UINT32 st1) INLINE int dbp(UINT32 st1)
{ {
return st1 & ST1_DBP ? 1 : 0; return st1 & ST1_DBP ? 1 : 0;
} }
static inline int crm(UINT32 st1) INLINE int crm(UINT32 st1)
{ {
return (st1 & ST1_CRM) >> ST1_CRM_SHIFT; return (st1 & ST1_CRM) >> ST1_CRM_SHIFT;
} }
static inline int sfai(UINT32 st1) INLINE int sfai(UINT32 st1)
{ {
return st1 & ST1_SFAI ? 1 : 0; return st1 & ST1_SFAI ? 1 : 0;
} }
static inline int sfmo(UINT32 st1) INLINE int sfmo(UINT32 st1)
{ {
return (st1 & ST1_SFMO) >> ST1_SFMO_SHIFT; return (st1 & ST1_SFMO) >> ST1_SFMO_SHIFT;
} }
static inline int rnd(UINT32 st1) INLINE int rnd(UINT32 st1)
{ {
return (st1 & ST1_RND) >> ST1_RND_SHIFT; return (st1 & ST1_RND) >> ST1_RND_SHIFT;
} }
static inline int movm(UINT32 st1) INLINE int movm(UINT32 st1)
{ {
return st1 & ST1_MOVM ? 1 : 0; return st1 & ST1_MOVM ? 1 : 0;
} }
static inline int sfma(UINT32 st1) INLINE int sfma(UINT32 st1)
{ {
return (st1 & ST1_SFMA) >> ST1_SFMA_SHIFT; return (st1 & ST1_SFMA) >> ST1_SFMA_SHIFT;
} }

View File

@ -65,7 +65,7 @@ const static pdesc pp_r[] = {
{ "wd", 1, PWD }, { "wd", 1, PWD },
{ "b", 1, PB }, { "b", 1, PB },
{ "sfai", 2, SFAI }, { "sfai", 2, SFAI },
{ } { 0 }
}; };
instr cat1[0x40], cat2[0x80], cat3[0x80]; instr cat1[0x40], cat2[0x80], cat3[0x80];
@ -93,7 +93,7 @@ vinfo vinf[] = {
{ I_RND, 8, "rnd", "rnd(s->st1)" }, { I_RND, 8, "rnd", "rnd(s->st1)" },
{ I_MOVM, 2, "movm", "movm(s->st1)" }, { I_MOVM, 2, "movm", "movm(s->st1)" },
{ I_SFMA, 4, "sfma", "sfma(s->st1)" }, { I_SFMA, 4, "sfma", "sfma(s->st1)" },
{ } { 0 }
}; };
char *sconcat(char *dest, const char *src) char *sconcat(char *dest, const char *src)
@ -156,7 +156,7 @@ void load(const char *fname)
p = buf; p = buf;
while(*p == ' ' || *p == '\t') while(*p == ' ' || *p == '\t')
p++; p++;
i->dasm = strdup(p); i->dasm = _strdup(p);
} }
} else { } else {
char *name=0, *cat=0, *id=0, *cyc=0, *rep=0, *type=0; char *name=0, *cat=0, *id=0, *cyc=0, *rep=0, *type=0;
@ -224,7 +224,7 @@ void load(const char *fname)
exit(1); exit(1);
} }
i->name = strdup(name); i->name = _strdup(name);
i->line = line; i->line = line;
i->cycles = strtol(cyc, 0, 10); i->cycles = strtol(cyc, 0, 10);
i->flags = flags; i->flags = flags;
@ -403,7 +403,7 @@ void save_dasm_cat(FILE *f, const char *def, instr *il, int count)
{ "c", 0, PC }, { "c", 0, PC },
{ "d", 0, PD }, { "d", 0, PD },
{ "i", 0, PI }, { "i", 0, PI },
{ } { 0 }
}; };
int i; int i;
@ -630,7 +630,7 @@ void cintrp_expand(char **p, int s, int e, const int *cv)
break; break;
case PC: { case PC: {
const char *r; const char *r = NULL;
if(cv[IxCMODE] == 0) if(cv[IxCMODE] == 0)
r = "s->cmem[i->param]"; r = "s->cmem[i->param]";
else if(cv[IxCMODE] == 1) else if(cv[IxCMODE] == 1)
@ -818,7 +818,7 @@ void save_cintrp_cat(FILE *f, instr *il, int count)
for(i=0; i != count; i++) for(i=0; i != count; i++)
if(il[i].run) { if(il[i].run) {
int cv[IxCOUNT]; int cv[IxCOUNT];
int j, k; int j, k = 0;
unsigned int flags = il[i].flags; unsigned int flags = il[i].flags;
char buf[16384]; char buf[16384];