compile warnings

This commit is contained in:
Barry Harris 2014-10-18 21:08:01 +00:00
parent fe08150f1e
commit 9f67ea730e
10 changed files with 52 additions and 47 deletions

View File

@ -867,7 +867,7 @@ static INT32 alt2_kludge(UINT32 /*offset*/)
static const SekRegister SekRegs1[8] = { SEK_REG_A0, SEK_REG_A1, SEK_REG_A2, SEK_REG_A3, SEK_REG_A4, SEK_REG_A5, SEK_REG_A6, SEK_REG_A7 }; static const SekRegister SekRegs1[8] = { SEK_REG_A0, SEK_REG_A1, SEK_REG_A2, SEK_REG_A3, SEK_REG_A4, SEK_REG_A5, SEK_REG_A6, SEK_REG_A7 };
/* first verify that the prefetched PC matches the first alternate */ /* first verify that the prefetched PC matches the first alternate */
if (MATCHES_MASK_VALUE(SekGetPC(-1) >> 1, slapstic.alt1)) if (MATCHES_MASK_VALUE((INT32)(SekGetPC(-1) >> 1), slapstic.alt1))
{ {
/* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */ /* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */
UINT16 opcode = SekFetchWord((SekGetPC(-1) - 4) & 0xffffff); // IQ_132 check this! UINT16 opcode = SekFetchWord((SekGetPC(-1) - 4) & 0xffffff); // IQ_132 check this!

View File

@ -71,8 +71,8 @@ static void CpsBlendInit()
if (strncmp ("Name", szLine, 4) == 0) continue; // don't care if (strncmp ("Name", szLine, 4) == 0) continue; // don't care
if (szLine[0] == ';') continue; // comment (also don't care) if (szLine[0] == ';') continue; // comment (also don't care)
int type; INT32 type, single_entry = -1;
unsigned int min,max,k, single_entry = -1; UINT32 min,max,k;
for (k = 0; k < strlen(szLine); k++) { for (k = 0; k < strlen(szLine); k++) {
if (szLine[k] == '-') { single_entry = k+1; break; } if (szLine[k] == '-') { single_entry = k+1; break; }

View File

@ -29,6 +29,11 @@
#include "k054539.h" #include "k054539.h"
#include "eeprom.h" #include "eeprom.h"
#if defined _MSC_VER
#define _USE_MATH_DEFINES
#include <cmath>
#endif
static UINT8 *AllMem; static UINT8 *AllMem;
static UINT8 *Drv68KROM; static UINT8 *Drv68KROM;
static UINT8 *DrvZ80ROM; static UINT8 *DrvZ80ROM;
@ -649,8 +654,8 @@ static void K055550_word_write(INT32 offset, UINT16 data, UINT16 mask)
offset = (offset & 0x3e) / 2; offset = (offset & 0x3e) / 2;
UINT32 adr, bsize, count, i, lim; UINT32 adr, bsize, count, i, lim;
int src, tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2; INT32 src, tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2;
int dx, dy, angle; INT32 dx, dy, angle;
if (offset == 0 && (mask & 0x00ff)) if (offset == 0 && (mask & 0x00ff))
{ {
@ -698,17 +703,17 @@ static void K055550_word_write(INT32 offset, UINT16 data, UINT16 mask)
// let's hope GCC will inline the mem24bew calls // let's hope GCC will inline the mem24bew calls
for (src=adr; src<srcend; src+=bsize) for (src=adr; src<srcend; src+=bsize)
{ {
cx1 = (short)SekReadWord(src); cx1 = (INT16)SekReadWord(src);
sx1 = (short)SekReadWord(src + 2); sx1 = (INT16)SekReadWord(src + 2);
wx1 = (short)SekReadWord(src + 4); wx1 = (INT16)SekReadWord(src + 4);
cy1 = (short)SekReadWord(src + 6); cy1 = (INT16)SekReadWord(src + 6);
sy1 = (short)SekReadWord(src + 8); sy1 = (INT16)SekReadWord(src + 8);
wy1 = (short)SekReadWord(src +10); wy1 = (INT16)SekReadWord(src +10);
cz1 = (short)SekReadWord(src +12); cz1 = (INT16)SekReadWord(src +12);
sz1 = (short)SekReadWord(src +14); sz1 = (INT16)SekReadWord(src +14);
wz1 = (short)SekReadWord(src +16); wz1 = (INT16)SekReadWord(src +16);
count = i = src + skip; count = i = src + skip;
tgt = src + bsize; tgt = src + bsize;
@ -717,19 +722,19 @@ static void K055550_word_write(INT32 offset, UINT16 data, UINT16 mask)
for (; tgt<tgtend; i++, tgt+=bsize) for (; tgt<tgtend; i++, tgt+=bsize)
{ {
c2 = (short)SekReadWord(tgt); c2 = (INT16)SekReadWord(tgt);
s2 = (short)SekReadWord(tgt + 2); s2 = (INT16)SekReadWord(tgt + 2);
w2 = (short)SekReadWord(tgt + 4); w2 = (INT16)SekReadWord(tgt + 4);
if (abs((cx1+sx1)-(c2+s2))>=wx1+w2) continue; // X rejection if (abs((cx1+sx1)-(c2+s2))>=wx1+w2) continue; // X rejection
c2 = (short)SekReadWord(tgt + 6); c2 = (INT16)SekReadWord(tgt + 6);
s2 = (short)SekReadWord(tgt + 8); s2 = (INT16)SekReadWord(tgt + 8);
w2 = (short)SekReadWord(tgt +10); w2 = (INT16)SekReadWord(tgt +10);
if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection
c2 = (short)SekReadWord(tgt +12); c2 = (INT16)SekReadWord(tgt +12);
s2 = (short)SekReadWord(tgt +14); s2 = (INT16)SekReadWord(tgt +14);
w2 = (short)SekReadWord(tgt +16); w2 = (INT16)SekReadWord(tgt +16);
if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection
SekWriteByte(i, 0x80); // collision confirmed SekWriteByte(i, 0x80); // collision confirmed
@ -738,8 +743,8 @@ static void K055550_word_write(INT32 offset, UINT16 data, UINT16 mask)
break; break;
case 0xc0: // calculate object "homes-in" vector (Violent Storm at 0x03da9e) case 0xc0: // calculate object "homes-in" vector (Violent Storm at 0x03da9e)
dx = (short)prot_data[0xc]; dx = (INT16)prot_data[0xc];
dy = (short)prot_data[0xd]; dy = (INT16)prot_data[0xd];
// it's not necessary to use lookup tables because Violent Storm // it's not necessary to use lookup tables because Violent Storm
// only calls the service once per enemy per frame. // only calls the service once per enemy per frame.
@ -747,7 +752,7 @@ static void K055550_word_write(INT32 offset, UINT16 data, UINT16 mask)
{ {
if (dy) if (dy)
{ {
angle = (atan((double)dy / dx) * 128.0) / M_PI; angle = (INT32)((atan((double)dy / dx) * 128.0) / M_PI);
if (dx < 0) angle += 128; if (dx < 0) angle += 128;
i = (angle - 0x40) & 0xff; i = (angle - 0x40) & 0xff;
} }
@ -1055,14 +1060,14 @@ static UINT8 __fastcall metamrph_main_read_byte(UINT32 address)
//-------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------
static void K053990_word_write(INT32 offset, UINT16 data, UINT16 mask) static void K053990_word_write(INT32 offset, UINT16 /*data*/, UINT16 mask)
{ {
offset = (offset & 0x3e) / 2; offset = (offset & 0x3e) / 2;
int src_addr, src_count, src_skip; INT32 src_addr, src_count, src_skip;
int dst_addr, /*dst_count,*/ dst_skip; INT32 dst_addr, /*dst_count,*/ dst_skip;
int mod_addr, mod_count, mod_skip, mod_offs; INT32 mod_addr, mod_count, mod_skip, mod_offs;
int mode, i, element_size = 1; INT32 mode, i, element_size = 1;
UINT16 mod_val, mod_data; UINT16 mod_val, mod_data;
if (offset == 0x0c && (mask & 0x00ff)) if (offset == 0x0c && (mask & 0x00ff))

View File

@ -996,8 +996,8 @@ void k053247_draw_yxloop_gx(
int zcode, int alpha, int drawmode, int zcode, int alpha, int drawmode,
UINT8* gx_objzbuf, UINT8* gx_shdzbuf, UINT8* gx_objzbuf, UINT8* gx_shdzbuf,
/* non-gx specifics */ /* non-gx specifics */
int primask, int /*primask*/,
UINT8* whichtable UINT8* /*whichtable*/
) )
{ {
static const int xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 }; static const int xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 };
@ -1081,7 +1081,7 @@ void k053247_draw_yxloop_gx(
void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, int code, unsigned short *gx_spriteram, int offs, void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, int code, unsigned short *gx_spriteram, int offs,
int color, int alpha, int drawmode, int zcode, int pri, int color, int alpha, int drawmode, int zcode, int pri,
int primask, int shadow, unsigned char *drawmode_table, unsigned char *shadowmode_table, int shdmask) int /*primask*/, int /*shadow*/, unsigned char */*drawmode_table*/, unsigned char */*shadowmode_table*/, int /*shdmask*/)
{ {
int xa,ya,ox,oy,flipx,flipy,mirrorx,mirrory,zoomx,zoomy,scalex,scaley,nozoom; int xa,ya,ox,oy,flipx,flipy,mirrorx,mirrory,zoomx,zoomy,scalex,scaley,nozoom;
int temp, temp4; int temp, temp4;

View File

@ -494,7 +494,7 @@ static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32
int srcx = (cx >> 16) & 0x1fff; int srcx = (cx >> 16) & 0x1fff;
int srcy = (cy >> 16) & 0x1fff; int srcy = (cy >> 16) & 0x1fff;
int pixel; int pixel;
UINT32 offs; INT32 offs;
offs = srcy * src_pitch + srcx; offs = srcy * src_pitch + srcx;
cx += incxx; cx += incxx;
@ -563,7 +563,7 @@ static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32
int srcx = (cx >> 16) & 0x1fff; int srcx = (cx >> 16) & 0x1fff;
int srcy = (cy >> 16) & 0x1fff; int srcy = (cy >> 16) & 0x1fff;
int pixel; int pixel;
UINT32 offs; INT32 offs;
offs = srcy * src_pitch + srcx; offs = srcy * src_pitch + srcx;

View File

@ -178,8 +178,8 @@ static void NeoBlendInit(INT32 nSlot)
if (strncmp ("Name", szLine, 4) == 0) continue; // don't care if (strncmp ("Name", szLine, 4) == 0) continue; // don't care
if (szLine[0] == ';') continue; // comment (also don't care) if (szLine[0] == ';') continue; // comment (also don't care)
int type; INT32 type, single_entry = -1;
unsigned int min,max,k, single_entry = -1; UINT32 min,max,k;
for (k = 0; k < strlen(szLine); k++) { for (k = 0; k < strlen(szLine); k++) {
if (szLine[k] == '-') { single_entry = k+1; break; } if (szLine[k] == '-') { single_entry = k+1; break; }

View File

@ -657,7 +657,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
cop_status |= 0x8000; cop_status |= 0x8000;
cop_angle = 0; cop_angle = 0;
} else { } else {
cop_angle = atan(double(dx)/double(dy)) * 128 / M_PI; cop_angle = (UINT16)(atan(double(dx)/double(dy)) * 128 / M_PI);
if(dy<0) if(dy<0)
cop_angle += 0x80; cop_angle += 0x80;
} }
@ -677,7 +677,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
cop_status |= 0x8000; cop_status |= 0x8000;
cop_angle = 0; cop_angle = 0;
} else { } else {
cop_angle = atan(double(dx)/double(dy)) * 128 / M_PI; cop_angle = (UINT16)(atan(double(dx)/double(dy)) * 128 / M_PI);
if(dy<0) if(dy<0)
cop_angle += 0x80; cop_angle += 0x80;
} }
@ -706,7 +706,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
dx = dx >> 16; dx = dx >> 16;
dy = dy >> 16; dy = dy >> 16;
cop_dist = sqrt((double)(dx*dx+dy*dy)); cop_dist = (UINT16)sqrt((double)(dx*dx+dy*dy));
if(data & 0x0080) if(data & 0x0080)
VezWriteWord(cop_regs[0]+(data & 0x200 ? 0x3a : 0x38), cop_dist); VezWriteWord(cop_regs[0]+(data & 0x200 ? 0x3a : 0x38), cop_dist);

View File

@ -445,7 +445,7 @@ void K054539UpdateNEWBUTCRACKLES(INT32 chip, INT16 *pBuf, INT32 length)
} }
int cur_pfrac, cur_val, cur_pval; int cur_pfrac, cur_val, cur_pval;
if(cur_pos != chan->pos) { if(cur_pos != (INT32)chan->pos) {
chan->pos = cur_pos; chan->pos = cur_pos;
cur_pfrac = 0; cur_pfrac = 0;
cur_val = 0; cur_val = 0;
@ -713,7 +713,7 @@ void K054539Update(INT32 chip, INT16 *pBuf, INT32 length)
cur_pos += pdelta; //dink (pdelta * nUpdateStep) >> 15; cur_pos += pdelta; //dink (pdelta * nUpdateStep) >> 15;
cur_pval = cur_val; cur_pval = cur_val;
if (cur_pos > info->rom_size) { if (cur_pos > (INT32)info->rom_size) {
continue; continue;
} }
cur_val = (INT16)(samples[cur_pos] << 8); cur_val = (INT16)(samples[cur_pos] << 8);
@ -744,7 +744,7 @@ void K054539Update(INT32 chip, INT16 *pBuf, INT32 length)
cur_pos += pdelta; //dink (pdelta * nUpdateStep) >> 15; cur_pos += pdelta; //dink (pdelta * nUpdateStep) >> 15;
cur_pval = cur_val; cur_pval = cur_val;
if (cur_pos+1 > info->rom_size) { if (cur_pos+1 > (INT32)info->rom_size) {
continue; continue;
} }
cur_val = (INT16)(samples[cur_pos] | samples[cur_pos+1]<<8); cur_val = (INT16)(samples[cur_pos] | samples[cur_pos+1]<<8);
@ -780,7 +780,7 @@ void K054539Update(INT32 chip, INT16 *pBuf, INT32 length)
cur_pos += pdelta; //dink (pdelta * nUpdateStep) >> 15; cur_pos += pdelta; //dink (pdelta * nUpdateStep) >> 15;
cur_pval = cur_val; cur_pval = cur_val;
if (cur_pos > info->rom_size) { if (cur_pos > (INT32)info->rom_size) {
continue; continue;
} }
cur_val = samples[cur_pos>>1]; cur_val = samples[cur_pos>>1];

View File

@ -2712,7 +2712,7 @@ void t90_internal_registers_w(UINT16 offset, UINT8 data)
cpustate->internal_registers[offset] = data; cpustate->internal_registers[offset] = data;
} }
INT32 tlcs90_init(INT32 clock) INT32 tlcs90_init(INT32 /*clock*/)
{ {
t90_Regs *cpustate = &tlcs90_data[0]; t90_Regs *cpustate = &tlcs90_data[0];
int i, p; int i, p;