Portability fixes

This commit is contained in:
Barry Harris 2014-10-18 22:15:17 +00:00
parent 34fb65f243
commit b39e06e83d
21 changed files with 374 additions and 373 deletions

View File

@ -144,9 +144,9 @@ static struct BurnDIPInfo ColecoDIPList[]=
STDDIPINFO(Coleco)
static UINT8 paddle_r(int paddle)
static UINT8 paddle_r(INT32 paddle)
{
int ctrl_select = (DrvDips[0] >> (paddle ? 4 : 0)) & 0x07;
INT32 ctrl_select = (DrvDips[0] >> (paddle ? 4 : 0)) & 0x07;
UINT8 data = 0x0f;
@ -302,7 +302,7 @@ UINT8 __fastcall coleco_read_port(UINT16 port)
return 0;
}
static void coleco_vdp_interrupt(int state)
static void coleco_vdp_interrupt(INT32 state)
{
if (state && !last_state)
ZetNmi();
@ -318,7 +318,7 @@ static void CVFastLoadHack() {
}
}
static int DrvDoReset()
static INT32 DrvDoReset()
{
memset (AllRam, 0, RamEnd - AllRam);
@ -339,7 +339,7 @@ static int DrvDoReset()
return 0;
}
static int MemIndex()
static INT32 MemIndex()
{
UINT8 *Next; Next = AllMem;
@ -356,13 +356,13 @@ static int MemIndex()
return 0;
}
static int DrvInit()
static INT32 DrvInit()
{
// refresh rate 59.92hz
AllMem = NULL;
MemIndex();
int nLen = MemEnd - (UINT8 *)0;
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -392,7 +392,7 @@ static int DrvInit()
ZetMapArea(0x0000, 0x1fff, 0, DrvZ80BIOS);
ZetMapArea(0x0000, 0x1fff, 2, DrvZ80BIOS);
for (int i = 0x6000; i < 0x8000; i+=0x0400) {
for (INT32 i = 0x6000; i < 0x8000; i+=0x0400) {
ZetMapArea(i + 0x0000, i + 0x03ff, 0, DrvZ80RAM);
ZetMapArea(i + 0x0000, i + 0x03ff, 1, DrvZ80RAM);
ZetMapArea(i + 0x0000, i + 0x03ff, 2, DrvZ80RAM);
@ -413,7 +413,7 @@ static int DrvInit()
return 0;
}
static int DrvExit()
static INT32 DrvExit()
{
TMS9928AExit();
ZetExit();
@ -425,7 +425,7 @@ static int DrvExit()
return 0;
}
static int DrvFrame()
static INT32 DrvFrame()
{
if (DrvReset) {
DrvDoReset();
@ -433,7 +433,7 @@ static int DrvFrame()
{
memset (DrvInputs, 0xff, 4 * sizeof(short));
for (int i = 0; i < 16; i++) {
for (INT32 i = 0; i < 16; i++) {
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
DrvInputs[2] ^= (DrvJoy3[i] & 1) << i;
@ -441,15 +441,15 @@ static int DrvFrame()
}
}
int nInterleave = 50;
int nCyclesTotal = 3579545 / 60;
int nCyclesDone = 0;
INT32 nInterleave = 50;
INT32 nCyclesTotal = 3579545 / 60;
INT32 nCyclesDone = 0;
ZetOpen(0);
for (int i = 0; i < nInterleave; i++)
for (INT32 i = 0; i < nInterleave; i++)
{
int nSegment = nCyclesTotal / nInterleave;
INT32 nSegment = nCyclesTotal / nInterleave;
nCyclesDone += ZetRun(nSegment);
@ -471,7 +471,7 @@ static int DrvFrame()
return 0;
}
static int DrvScan(int nAction,int *pnMin)
static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
{
struct BurnArea ba;

View File

@ -349,9 +349,9 @@ static UINT8 __fastcall asterix_sound_read(UINT16 address)
return 0;
}
static void asterix_sprite_callback(int *code, int *color, int *priority)
static void asterix_sprite_callback(INT32 *code, INT32 *color, INT32 *priority)
{
int pri = (*color & 0x00e0) >> 2;
INT32 pri = (*color & 0x00e0) >> 2;
if (pri <= layerpri[2]) *priority = 0;
else if (pri > layerpri[2] && pri <= layerpri[1]) *priority = 0xf0;
else if (pri > layerpri[1] && pri <= layerpri[0]) *priority = 0xfc;
@ -360,7 +360,7 @@ static void asterix_sprite_callback(int *code, int *color, int *priority)
*code = (*code & 0xfff) | spritebanks[(*code >> 12) & 3];
}
static void asterix_tile_callback(int layer, int *code, int *color, int *flags)
static void asterix_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 *flags)
{
*flags = (*code & 0x1000) ? 1 : 0;
@ -569,7 +569,7 @@ static INT32 DrvDraw()
{
DrvPaletteRecalc();
int layer[3];
INT32 layer[3];
tilebanks[0] = (K056832GetLookup(0) << 10);
tilebanks[1] = (K056832GetLookup(1) << 10);

View File

@ -385,7 +385,7 @@ static UINT8 __fastcall bishi_read_byte(UINT32 address)
return 0;
}
static void bishi_tile_callback(int layer, int *code, int *color, int */*flags*/)
static void bishi_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 */*flags*/)
{
*color = layer_colorbase[layer] + ((*color & 0xf0));
*code &= 0x7fff;
@ -545,8 +545,8 @@ static INT32 DrvDraw()
DrvPaletteRecalc();
INT32 layers[4];
static const int pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 };
static const int enables[4] = { K55_INP_VRAM_A, K55_INP_VRAM_B, K55_INP_VRAM_C, K55_INP_VRAM_D };
static const INT32 pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 };
static const INT32 enables[4] = { K55_INP_VRAM_A, K55_INP_VRAM_B, K55_INP_VRAM_C, K55_INP_VRAM_D };
KonamiClearBitmaps(0);

View File

@ -459,7 +459,7 @@ static UINT8 __fastcall dbz_sound_read(UINT16 address)
static void dbz_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
{
int pri = (*color & 0x3c0) >> 5;
INT32 pri = (*color & 0x3c0) >> 5;
if (pri <= layerpri[3]) *priority = 0xff00;
else if (pri > layerpri[3] && pri <= layerpri[2]) *priority = 0xfff0;
@ -469,7 +469,7 @@ static void dbz_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
*color = (sprite_colorbase << 1) + (*color & 0x1f);
}
static void dbz_tile_callback(int layer, int */*code*/, int *color, int */*flags*/)
static void dbz_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/)
{
*color = (layer_colorbase[layer] << 1) + ((*color & 0x3c) >> 2);
}
@ -823,11 +823,11 @@ static void DrvPaletteRecalc()
static INT32 DrvDraw()
{
static const int K053251_CI[6] = { 3, 4, 4, 4, 2, 1 };
static const INT32 K053251_CI[6] = { 3, 4, 4, 4, 2, 1 };
DrvPaletteRecalc();
KonamiClearBitmaps(0);
int layer[5], plane;
INT32 layer[5], plane;
sprite_colorbase = K053251GetPaletteIndex(0);
@ -854,7 +854,7 @@ static INT32 DrvDraw()
for (plane = 0; plane < 5; plane++)
{
int flag, pri;
INT32 flag, pri;
if (plane == 0)
{

View File

@ -351,7 +351,7 @@ static const eeprom_interface lethalen_eeprom_interface =
static void lethal_sprite_callback(INT32 *code, INT32 *color, INT32 *priority)
{
int pri = (*color & 0xfff0);
INT32 pri = (*color & 0xfff0);
*color = *color & 0x000f;
*color += 0x400 / 64;
@ -367,7 +367,7 @@ static void lethal_sprite_callback(INT32 *code, INT32 *color, INT32 *priority)
*code = (*code & 0x3fff);
}
static void lethal_tile_callback(int layer, int *code, int *color, int */*flags*/)
static void lethal_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 */*flags*/)
{
*color = layer_colorbase[layer] + ((*color & 0x3c) << 2);
*code &= 0xffff;

View File

@ -206,11 +206,11 @@ STDDIPINFO(Bucky)
static void moo_objdma()
{
int num_inactive;
INT32 num_inactive;
UINT16 *dst = (UINT16*)K053247Ram;
UINT16 *src = (UINT16*)DrvSprRAM;
int counter = 23;
INT32 counter = 23;
num_inactive = counter = 256;
@ -732,7 +732,7 @@ static const eeprom_interface moo_eeprom_interface =
static void moo_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
{
int pri = (*color & 0x03e0) >> 4;
INT32 pri = (*color & 0x03e0) >> 4;
if (pri <= layerpri[2]) *priority = 0x00;
else if (pri <= layerpri[1]) *priority = 0xf0;
@ -742,7 +742,7 @@ static void moo_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
*color = sprite_colorbase | (*color & 0x001f);
}
static void moo_tile_callback(int layer, int */*code*/, int *color, int */*flags*/)
static void moo_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/)
{
*color = layer_colorbase[layer] | (*color >> 2 & 0x0f);
}
@ -1039,9 +1039,9 @@ static INT32 DrvDraw()
KonamiClearBitmaps(0);
static const int K053251_CI[4] = { 1, 2, 3, 4 };
int layers[3];
int plane, alpha = 0xff;
static const INT32 K053251_CI[4] = { 1, 2, 3, 4 };
INT32 layers[3];
INT32 plane, alpha = 0xff;
sprite_colorbase = K053251GetPaletteIndex(0);
layer_colorbase[0] = 0x70;

View File

@ -1685,25 +1685,25 @@ static UINT8 __fastcall mystwarr_sound_read(UINT16 address)
//--------------------------------------------------------------------------------------------------------------
static void mystwarr_tile_callback(int layer, int *code, int *color, int */*flags*/)
static void mystwarr_tile_callback(INT32 layer, INT32 *code, INT32 *color, INT32 */*flags*/)
{
if (layer == 1) {if ((*code & 0xff00) + (*color) == 0x4101) cbparam++; else cbparam--;} //* water hack (TEMPORARY)
*color = layer_colorbase[layer] | ((*color >> 1) & 0x1e);
}
static void metamrph_tile_callback(int layer, int */*code*/, int *color, int */*flags*/)
static void metamrph_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/)
{
*color = layer_colorbase[layer] | (*color >> 2 & 0x0f);
}
static void game5bpp_tile_callback(int layer, int */*code*/, int *color, int */*flags*/)
static void game5bpp_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/)
{
*color = layer_colorbase[layer] | ((*color >> 1) & 0x1e);
}
static void mystwarr_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
{
int c = *color;
INT32 c = *color;
*color = sprite_colorbase | (c & 0x001f);
*priority = c & 0x00f0;
}
@ -1729,7 +1729,7 @@ static void metamrph_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *prior
static void martchmp_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
{
int c = *color;
INT32 c = *color;
if ((c & 0x3ff) == 0x11f)
*color = K055555_FULLSHADOW;
@ -1744,7 +1744,7 @@ static void martchmp_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *prior
static void gaiapolis_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
{
int c = *color;
INT32 c = *color;
*color = sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f);
*priority = c & 0x00e0;
@ -1866,10 +1866,10 @@ static void decode_gfx1(UINT8 *src, UINT8 *d, INT32 len)
while (s < pFinish)
{
int d0 = ((s[0]&0x80)<<0)|((s[0]&0x08)<<3)|((s[1]&0x80)>>2)|((s[1]&0x08)<<1)|((s[2]&0x80)>>4)|((s[2]&0x08)>>1)|((s[3]&0x80)>>6)|((s[3]&0x08)>>3);
int d1 = ((s[0]&0x40)<<1)|((s[0]&0x04)<<4)|((s[1]&0x40)>>1)|((s[1]&0x04)<<2)|((s[2]&0x40)>>3)|((s[2]&0x04)>>0)|((s[3]&0x40)>>5)|((s[3]&0x04)>>2);
int d2 = ((s[0]&0x20)<<2)|((s[0]&0x02)<<5)|((s[1]&0x20)<<0)|((s[1]&0x02)<<3)|((s[2]&0x20)>>2)|((s[2]&0x02)<<1)|((s[3]&0x20)>>4)|((s[3]&0x02)>>1);
int d3 = ((s[0]&0x10)<<3)|((s[0]&0x01)<<6)|((s[1]&0x10)<<1)|((s[1]&0x01)<<4)|((s[2]&0x10)>>1)|((s[2]&0x01)<<2)|((s[3]&0x10)>>3)|((s[3]&0x01)>>0);
INT32 d0 = ((s[0]&0x80)<<0)|((s[0]&0x08)<<3)|((s[1]&0x80)>>2)|((s[1]&0x08)<<1)|((s[2]&0x80)>>4)|((s[2]&0x08)>>1)|((s[3]&0x80)>>6)|((s[3]&0x08)>>3);
INT32 d1 = ((s[0]&0x40)<<1)|((s[0]&0x04)<<4)|((s[1]&0x40)>>1)|((s[1]&0x04)<<2)|((s[2]&0x40)>>3)|((s[2]&0x04)>>0)|((s[3]&0x40)>>5)|((s[3]&0x04)>>2);
INT32 d2 = ((s[0]&0x20)<<2)|((s[0]&0x02)<<5)|((s[1]&0x20)<<0)|((s[1]&0x02)<<3)|((s[2]&0x20)>>2)|((s[2]&0x02)<<1)|((s[3]&0x20)>>4)|((s[3]&0x02)>>1);
INT32 d3 = ((s[0]&0x10)<<3)|((s[0]&0x01)<<6)|((s[1]&0x10)<<1)|((s[1]&0x01)<<4)|((s[2]&0x10)>>1)|((s[2]&0x01)<<2)|((s[3]&0x10)>>3)|((s[3]&0x01)>>0);
d[0] = d3;
d[1] = d1;

View File

@ -394,7 +394,7 @@ static UINT8 __fastcall xexex_sound_read(UINT16 address)
static void xexex_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority)
{
int pri = (*color & 0x3e0) >> 4;
INT32 pri = (*color & 0x3e0) >> 4;
if (pri <= layerpri[3]) *priority = 0x0000;
else if (pri > layerpri[3] && pri <= layerpri[2]) *priority = 0xff00;
@ -405,7 +405,7 @@ static void xexex_sprite_callback(INT32 */*code*/, INT32 *color, INT32 *priority
*color = sprite_colorbase | (*color & 0x001f);
}
static void xexex_tile_callback(int layer, int */*code*/, int *color, int */*flags*/)
static void xexex_tile_callback(INT32 layer, INT32 */*code*/, INT32 *color, INT32 */*flags*/)
{
*color = layer_colorbase[layer] | (*color >> 2 & 0x0f);
}

View File

@ -398,12 +398,12 @@ static void draw_sprites()
{
for (INT32 offs = 0x30 - 2; offs >= 0; offs -= 2)
{
int attr = DrvSprRAM0[offs + 0];
int code = DrvSprRAM1[offs + 1] + 256 * (attr & 0x01);
int flipx = ~attr & 0x40;
int flipy = attr & 0x80;
int sy = 240 - DrvSprRAM0[offs + 1];
int sx = DrvSprRAM1 [offs + 0];
INT32 attr = DrvSprRAM0[offs + 0];
INT32 code = DrvSprRAM1[offs + 1] + 256 * (attr & 0x01);
INT32 flipx = ~attr & 0x40;
INT32 flipy = attr & 0x80;
INT32 sy = 240 - DrvSprRAM0[offs + 1];
INT32 sx = DrvSprRAM1 [offs + 0];
if (0) // if (*flipscreen)
{

View File

@ -537,8 +537,8 @@ static inline UINT32 alpha_blend_r32(UINT32 d, UINT32 s, UINT32 p)
#define GX_ZBUFW 512
#define GX_ZBUFH 256
void zdrawgfxzoom32GP(UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy,
int scalex, int scaley, int alpha, int drawmode, int zcode, int pri, UINT8* gx_objzbuf, UINT8* gx_shdzbuf)
void zdrawgfxzoom32GP(UINT32 code, UINT32 color, INT32 flipx, INT32 flipy, INT32 sx, INT32 sy,
INT32 scalex, INT32 scaley, INT32 alpha, INT32 drawmode, INT32 zcode, INT32 pri, UINT8* gx_objzbuf, UINT8* gx_shdzbuf)
{
#define FP 19
#define FPONE (1<<FP)
@ -547,10 +547,10 @@ void zdrawgfxzoom32GP(UINT32 code, UINT32 color, int flipx, int flipy, int sx, i
// inner loop
const UINT8 *src_ptr;
int src_x;
int eax, ecx;
int src_fx, src_fdx;
int shdpen;
INT32 src_x;
INT32 eax, ecx;
INT32 src_fx, src_fdx;
INT32 shdpen;
UINT8 z8 = 0, p8 = 0;
UINT8 *ozbuf_ptr;
UINT8 *szbuf_ptr;
@ -559,16 +559,16 @@ void zdrawgfxzoom32GP(UINT32 code, UINT32 color, int flipx, int flipy, int sx, i
UINT32 *dst_ptr;
// outter loop
int src_fby, src_fdy, src_fbx;
INT32 src_fby, src_fdy, src_fbx;
const UINT8 *src_base;
int dst_w, dst_h;
INT32 dst_w, dst_h;
// one-time
int nozoom, granularity;
int src_fw, src_fh;
int dst_minx, dst_maxx, dst_miny, dst_maxy;
int dst_skipx, dst_skipy, dst_x, dst_y, dst_lastx, dst_lasty;
int src_pitch, dst_pitch;
INT32 nozoom, granularity;
INT32 src_fw, src_fh;
INT32 dst_minx, dst_maxx, dst_miny, dst_maxy;
INT32 dst_skipx, dst_skipy, dst_x, dst_y, dst_lastx, dst_lasty;
INT32 src_pitch, dst_pitch;
// cull illegal and transparent objects
@ -983,35 +983,35 @@ void zdrawgfxzoom32GP(UINT32 code, UINT32 color, int flipx, int flipy, int sx, i
void k053247_draw_yxloop_gx(
int code,
int color,
int height, int width,
int zoomx, int zoomy, int flipx, int flipy,
int ox, int oy,
int xa, int ya,
int mirrorx, int mirrory,
int nozoom,
INT32 code,
INT32 color,
INT32 height, INT32 width,
INT32 zoomx, INT32 zoomy, INT32 flipx, INT32 flipy,
INT32 ox, INT32 oy,
INT32 xa, INT32 ya,
INT32 mirrorx, INT32 mirrory,
INT32 nozoom,
/* gx specifics */
int pri,
int zcode, int alpha, int drawmode,
INT32 pri,
INT32 zcode, INT32 alpha, INT32 drawmode,
UINT8* gx_objzbuf, UINT8* gx_shdzbuf,
/* non-gx specifics */
int /*primask*/,
INT32 /*primask*/,
UINT8* /*whichtable*/
)
{
static const int xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 };
static const int yoffset[8] = { 0, 2, 8, 10, 32, 34, 40, 42 };
int zw,zh;
int fx, fy, sx, sy;
int tempcode;
static const INT32 xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 };
static const INT32 yoffset[8] = { 0, 2, 8, 10, 32, 34, 40, 42 };
INT32 zw,zh;
INT32 fx, fy, sx, sy;
INT32 tempcode;
for (int y=0; y<height; y++)
for (INT32 y=0; y<height; y++)
{
sy = oy + ((zoomy * y + (1<<11)) >> 12);
zh = (oy + ((zoomy * (y+1) + (1<<11)) >> 12)) - sy;
for (int x=0; x<width; x++)
for (INT32 x=0; x<width; x++)
{
sx = ox + ((zoomx * x + (1<<11)) >> 12);
zw = (ox + ((zoomx * (x+1) + (1<<11)) >> 12)) - sx;
@ -1079,14 +1079,14 @@ 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,
int color, int alpha, int drawmode, int zcode, int pri,
int /*primask*/, int /*shadow*/, unsigned char */*drawmode_table*/, unsigned char */*shadowmode_table*/, int /*shdmask*/)
void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, INT32 code, UINT16 *gx_spriteram, INT32 offs,
INT32 color, INT32 alpha, INT32 drawmode, INT32 zcode, INT32 pri,
INT32 /*primask*/, INT32 /*shadow*/, UINT8 */*drawmode_table*/, UINT8 */*shadowmode_table*/, INT32 /*shdmask*/)
{
int xa,ya,ox,oy,flipx,flipy,mirrorx,mirrory,zoomx,zoomy,scalex,scaley,nozoom;
int temp, temp4;
int flipscreenx = K053246Regs[5] & 0x01;
int flipscreeny = K053246Regs[5] & 0x02;
INT32 xa,ya,ox,oy,flipx,flipy,mirrorx,mirrory,zoomx,zoomy,scalex,scaley,nozoom;
INT32 temp, temp4;
INT32 flipscreenx = K053246Regs[5] & 0x01;
INT32 flipscreeny = K053246Regs[5] & 0x02;
xa = ya = 0;
if (code & 0x01) xa += 1;
@ -1124,11 +1124,11 @@ void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, int
if (mirrorx) flipx = 0; // only applies to x mirror, proven
mirrory = temp & 0x8000;
int objset1 = K053247ReadRegs(5);
INT32 objset1 = K053247ReadRegs(5);
// for Escape Kids (GX975)
if ( objset1 & 8 ) // Check only "Bit #3 is '1'?"
{
int screenwidth = nScreenWidth-1;
INT32 screenwidth = nScreenWidth-1;
zoomx = zoomx>>1; // Fix sprite width to HALF size
ox = (ox>>1) + 1; // Fix sprite draw position
@ -1140,8 +1140,8 @@ void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, int
if (flipscreenx) { ox = -ox; if (!mirrorx) flipx = !flipx; }
if (flipscreeny) { oy = -oy; if (!mirrory) flipy = !flipy; }
int k053247_opset = K053247ReadRegs(0xc/2);
int wrapsize, xwraplim, ywraplim;
INT32 k053247_opset = K053247ReadRegs(0xc/2);
INT32 wrapsize, xwraplim, ywraplim;
if (k053247_opset & 0x40)
{
wrapsize = 512;
@ -1156,8 +1156,8 @@ void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, int
}
// get "display window" offsets
int offx = (short)((K053246Regs[0] << 8) | K053246Regs[1]);
int offy = (short)((K053246Regs[2] << 8) | K053246Regs[3]);
INT32 offx = (INT16)((K053246Regs[0] << 8) | K053246Regs[1]);
INT32 offy = (INT16)((K053246Regs[2] << 8) | K053246Regs[3]);
// apply wrapping and global offsets
temp = wrapsize-1;
@ -1171,8 +1171,8 @@ void k053247_draw_single_sprite_gxcore(UINT8 *gx_objzbuf, UINT8 *gx_shdzbuf, int
if (oy >= ywraplim) oy -= wrapsize;
temp = temp4>>8 & 0x0f;
int width = 1 << (temp & 3);
int height = 1 << (temp>>2 & 3);
INT32 width = 1 << (temp & 3);
INT32 height = 1 << (temp>>2 & 3);
ox -= (zoomx * width) >> 13;
oy -= (zoomy * height) >> 13;

View File

@ -404,16 +404,16 @@ void K053936GP_set_colorbase(INT32 chip, INT32 color_base)
K053936_color[chip] = color_base;
}
void K053936GP_enable(int chip, int enable)
void K053936GP_enable(INT32 chip, INT32 enable)
{
K053936_enable[chip] = enable;
}
void K053936GP_set_offset(int chip, int xoffs, int yoffs) { K053936_offset[chip][0] = xoffs; K053936_offset[chip][1] = yoffs; }
void K053936GP_set_offset(INT32 chip, INT32 xoffs, INT32 yoffs) { K053936_offset[chip][0] = xoffs; K053936_offset[chip][1] = yoffs; }
void K053936GP_clip_enable(int chip, int status) { K053936_clip_enabled[chip] = status; }
void K053936GP_clip_enable(INT32 chip, INT32 status) { K053936_clip_enabled[chip] = status; }
void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy)
void K053936GP_set_cliprect(INT32 chip, INT32 minx, INT32 maxx, INT32 miny, INT32 maxy)
{
K053936_cliprect[chip][0] = minx;
K053936_cliprect[chip][1] = maxx;
@ -421,25 +421,25 @@ void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy)
K053936_cliprect[chip][3] = maxy;
}
static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32 *my_clip, UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy,
int tilebpp, int blend, int alpha, int clip, int pixeldouble_output)
static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32 *my_clip, UINT32 _startx,UINT32 _starty,INT32 _incxx,INT32 _incxy,INT32 _incyx,INT32 _incyy,
INT32 tilebpp, INT32 blend, INT32 alpha, INT32 clip, INT32 pixeldouble_output)
{
static const int colormask[8]={1,3,7,0xf,0x1f,0x3f,0x7f,0xff};
int cy, cx;
int ecx;
int src_pitch, incxy, incxx;
int src_minx, src_maxx, src_miny, src_maxy, cmask;
static const INT32 colormask[8]={1,3,7,0xf,0x1f,0x3f,0x7f,0xff};
INT32 cy, cx;
INT32 ecx;
INT32 src_pitch, incxy, incxx;
INT32 src_minx, src_maxx, src_miny, src_maxy, cmask;
UINT16 *src_base;
INT32 src_size;
const UINT32 *pal_base;
int dst_ptr;
int dst_size;
int dst_base2;
INT32 dst_ptr;
INT32 dst_size;
INT32 dst_base2;
int tx, dst_pitch;
INT32 tx, dst_pitch;
UINT32 *dst_base;
int starty, incyy, startx, incyx, ty, sx, sy;
INT32 starty, incyy, startx, incyx, ty, sx, sy;
incxy = _incxy; incxx = _incxx; incyy = _incyy; incyx = _incyx;
starty = _starty; startx = _startx;
@ -491,9 +491,9 @@ static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32
do {
do {
int srcx = (cx >> 16) & 0x1fff;
int srcy = (cy >> 16) & 0x1fff;
int pixel;
INT32 srcx = (cx >> 16) & 0x1fff;
INT32 srcy = (cy >> 16) & 0x1fff;
INT32 pixel;
INT32 offs;
offs = srcy * src_pitch + srcx;
@ -560,9 +560,9 @@ static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32
do {
do {
int srcx = (cx >> 16) & 0x1fff;
int srcy = (cy >> 16) & 0x1fff;
int pixel;
INT32 srcx = (cx >> 16) & 0x1fff;
INT32 srcy = (cy >> 16) & 0x1fff;
INT32 pixel;
INT32 offs;
offs = srcy * src_pitch + srcx;
@ -598,13 +598,13 @@ static inline void K053936GP_copyroz32clip(INT32 chip, UINT16 *src_bitmap, INT32
}
}
static void K053936GP_zoom_draw(int chip, UINT16 *ctrl, UINT16 *linectrl, UINT16 *src_bitmap,
int tilebpp, int blend, int alpha, int pixeldouble_output)
static void K053936GP_zoom_draw(INT32 chip, UINT16 *ctrl, UINT16 *linectrl, UINT16 *src_bitmap,
INT32 tilebpp, INT32 blend, INT32 alpha, INT32 pixeldouble_output)
{
UINT16 *lineaddr;
UINT32 startx, starty;
int incxx, incxy, incyx, incyy, y, maxy, clip;
INT32 incxx, incxy, incyx, incyy, y, maxy, clip;
clip = K053936_clip_enabled[chip];
@ -665,7 +665,7 @@ static void K053936GP_zoom_draw(int chip, UINT16 *ctrl, UINT16 *linectrl, UINT16
}
}
void K053936GP_0_zoom_draw(UINT16 *bitmap, int tilebpp, int blend, int alpha, int pixeldouble_output, UINT16* temp_m_k053936_0_ctrl_16, UINT16* temp_m_k053936_0_linectrl_16,UINT16* temp_m_k053936_0_ctrl, UINT16* temp_m_k053936_0_linectrl)
void K053936GP_0_zoom_draw(UINT16 *bitmap, INT32 tilebpp, INT32 blend, INT32 alpha, INT32 pixeldouble_output, UINT16* temp_m_k053936_0_ctrl_16, UINT16* temp_m_k053936_0_linectrl_16,UINT16* temp_m_k053936_0_ctrl, UINT16* temp_m_k053936_0_linectrl)
{
if (K053936_enable[0] == 0) return;

View File

@ -57,14 +57,14 @@ void K054338WriteByte(INT32 offset, UINT8 data)
}
// returns a 16-bit '338 register
INT32 K054338_read_register(int reg)
INT32 K054338_read_register(INT32 reg)
{
return k54338_regs[reg];
}
void K054338_update_all_shadows()
{
int i, d;
INT32 i, d;
for (i = 0; i < 9; i++)
{
@ -75,7 +75,7 @@ void K054338_update_all_shadows()
}
}
void K054338_export_config(int **shd_rgb)
void K054338_export_config(INT32 **shd_rgb)
{
*shd_rgb = m_shd_rgb;
}
@ -85,7 +85,7 @@ void K054338_fill_solid_bg()
{
UINT32 bgcolor;
UINT32 *pLine;
int x, y;
INT32 x, y;
bgcolor = (K054338_read_register(K338_REG_BGC_R)&0xff)<<16;
bgcolor |= K054338_read_register(K338_REG_BGC_GB);
@ -101,12 +101,12 @@ void K054338_fill_solid_bg()
}
// Unified k054338/K055555 BG color fill
void K054338_fill_backcolor(int palette_offset, int mode) // (see p.67)
void K054338_fill_backcolor(INT32 palette_offset, INT32 mode) // (see p.67)
{
int clipx, clipy, clipw, cliph, i, dst_pitch;
int BGC_CBLK, BGC_SET;
INT32 clipx, clipy, clipw, cliph, i, dst_pitch;
INT32 BGC_CBLK, BGC_SET;
UINT32 *dst_ptr, *pal_ptr;
int bgcolor;
INT32 bgcolor;
clipx = 0 & ~3;
clipy = 0;
@ -182,10 +182,10 @@ void K054338_fill_backcolor(int palette_offset, int mode) // (see p.67)
}
// addition blending unimplemented (requires major changes to drawgfx and tilemap.c)
INT32 K054338_set_alpha_level(int pblend)
INT32 K054338_set_alpha_level(INT32 pblend)
{
UINT16 *regs;
int ctrl, mixpri, mixset, mixlv;
INT32 ctrl, mixpri, mixset, mixlv;
if (pblend <= 0 || pblend > 3)
{
@ -226,7 +226,7 @@ INT32 K054338_set_alpha_level(int pblend)
return(mixlv);
}
void K054338_invert_alpha(int invert)
void K054338_invert_alpha(INT32 invert)
{
k054338_alphainverted = invert;
}

View File

@ -38,7 +38,7 @@ static INT32 m_rom_half;
#define CLIP_MINY global_clip[2]
#define CLIP_MAXY global_clip[3]
static void (*m_callback)(int layer, int *code, int *color, int *flags);
static void (*m_callback)(INT32 layer, INT32 *code, INT32 *color, INT32 *flags);
void K056832Reset()
{
@ -77,7 +77,7 @@ static void CalculateTranstab()
}
}
void K056832Init(UINT8 *rom, UINT8 *romexp, INT32 rom_size, void (*cb)(int layer, int *code, int *color, int *flags))
void K056832Init(UINT8 *rom, UINT8 *romexp, INT32 rom_size, void (*cb)(INT32 layer, INT32 *code, INT32 *color, INT32 *flags))
{
KonamiIC_K056832InUse = 1;
@ -142,25 +142,25 @@ void K056832SetExtLinescroll()
m_use_ext_linescroll = 1;
}
int K056832IsIrqEnabled()
INT32 K056832IsIrqEnabled()
{
return k056832Regs[3] & 1;
}
void K056832ReadAvac(int *mode, int *data)
void K056832ReadAvac(INT32 *mode, INT32 *data)
{
*mode = k056832Regs[0x04/2] & 7;
*data = k056832Regs[0x38/2];
}
UINT16 K056832ReadRegister(int reg)
UINT16 K056832ReadRegister(INT32 reg)
{
return k056832Regs[reg & 0x1f];
}
int K056832GetLookup( int bits )
INT32 K056832GetLookup( INT32 bits )
{
int res;
INT32 res;
res = (k056832Regs[0x1c] >> (bits << 2)) & 0x0f;
@ -172,7 +172,7 @@ int K056832GetLookup( int bits )
static void k056832_change_rambank()
{
int bank = k056832Regs[0x19];
INT32 bank = k056832Regs[0x19];
if (k056832Regs[0] & 0x02) // external linescroll enable
m_selected_page = 16;
@ -183,9 +183,9 @@ static void k056832_change_rambank()
}
#if 0
static int k056832_get_current_rambank()
static INT32 k056832_get_current_rambank()
{
int bank = k056832Regs[0x19];
INT32 bank = k056832Regs[0x19];
return ((bank >> 1) & 0xc) | (bank & 3);
}
@ -193,7 +193,7 @@ static int k056832_get_current_rambank()
static void k056832_change_rombank()
{
int bank;
INT32 bank;
if (m_uses_tile_banks) /* Asterix */
bank = (k056832Regs[0x1a] >> 8) | (k056832Regs[0x1b] << 4) | (m_cur_tile_bank << 6);
@ -203,7 +203,7 @@ static void k056832_change_rombank()
m_cur_gfx_banks = bank % m_num_gfx_banks;
}
void K056832SetTileBank(int bank)
void K056832SetTileBank(INT32 bank)
{
m_uses_tile_banks = 1;
@ -221,7 +221,7 @@ static void k056832_update_page_layout()
INT32 m_h[4] = { 0, 0, 0, 0 }; // a hang in monster maulers otherswise. -iq
INT32 m_w[4] = { 0, 0, 0, 0 };
for (int layer = 0; layer < 4; layer++)
for (INT32 layer = 0; layer < 4; layer++)
{
m_y[layer] = (k056832Regs[0x08|layer] & 0x18) >> 3;
m_x[layer] = (k056832Regs[0x0c|layer] & 0x18) >> 3;
@ -242,20 +242,20 @@ static void k056832_update_page_layout()
}
// enable associated tilemaps
for (int layer = 0; layer < 4; layer++)
for (INT32 layer = 0; layer < 4; layer++)
{
int rowstart = m_y[layer];
int colstart = m_x[layer];
int rowspan = m_h[layer] + 1;
int colspan = m_w[layer] + 1;
INT32 rowstart = m_y[layer];
INT32 colstart = m_x[layer];
INT32 rowspan = m_h[layer] + 1;
INT32 colspan = m_w[layer] + 1;
int setlayer = (m_layer_association) ? layer : m_active_layer;
INT32 setlayer = (m_layer_association) ? layer : m_active_layer;
for (int r = 0; r < rowspan; r++)
for (INT32 r = 0; r < rowspan; r++)
{
for (int c = 0; c < colspan; c++)
for (INT32 c = 0; c < colspan; c++)
{
int page_idx = (((rowstart + r) & 3) << 2) + ((colstart + c) & 3);
INT32 page_idx = (((rowstart + r) & 3) << 2) + ((colstart + c) & 3);
if (m_layer_assoc_with_page[page_idx] == -1)
m_layer_assoc_with_page[page_idx] = setlayer;
}
@ -320,7 +320,7 @@ UINT16 K056832RomWordRead(UINT16 offset)
{
offset &= 0x1ffe;
int addr = 0x2000 * m_cur_gfx_banks + offset;
INT32 addr = 0x2000 * m_cur_gfx_banks + offset;
return K056832Rom[addr+1] | (K056832Rom[addr] << 8);
}
@ -437,7 +437,7 @@ static void draw_layer_internal(INT32 layer, INT32 pageIndex, INT32 *clip, INT32
{
static const struct K056832_SHIFTMASKS
{
int flips, palm1, pals2, palm2;
INT32 flips, palm1, pals2, palm2;
}
k056832_shiftmasks[4] = {{6, 0x3f, 0, 0x00}, {4, 0x0f, 2, 0x30}, {2, 0x03, 2, 0x3c}, {0, 0x00, 2, 0x3f}};
const struct K056832_SHIFTMASKS *smptr;
@ -567,19 +567,19 @@ static void draw_layer_internal(INT32 layer, INT32 pageIndex, INT32 *clip, INT32
#define K056832_PAGE_COUNT 16
void K056832Draw(int layer, UINT32 flags, UINT32 priority)
void K056832Draw(INT32 layer, UINT32 flags, UINT32 priority)
{
UINT16 *m_videoram = K056832VideoRAM;
UINT16 *m_regs = k056832Regs;
UINT32 last_dx, last_visible, last_active;
int sx, sy, ay, tx, ty, width, height;
int clipw, clipx, cliph, clipy, clipmaxy;
int line_height, line_endy, line_starty, line_y;
int sdat_start, sdat_walk, sdat_adv, sdat_wrapmask, sdat_offs;
int pageIndex, flipx, flipy, corr, r, c;
int cminy, cmaxy, cminx, cmaxx;
int dminy, dmaxy, dminx, dmaxx;
INT32 sx, sy, ay, tx, ty, width, height;
INT32 clipw, clipx, cliph, clipy, clipmaxy;
INT32 line_height, line_endy, line_starty, line_y;
INT32 sdat_start, sdat_walk, sdat_adv, sdat_wrapmask, sdat_offs;
INT32 pageIndex, flipx, flipy, corr, r, c;
INT32 cminy, cmaxy, cminx, cmaxx;
INT32 dminy, dmaxy, dminx, dmaxx;
UINT16 *p_scroll_data;
UINT16 ram16[2];
INT32 tmap;
@ -588,14 +588,14 @@ void K056832Draw(int layer, UINT32 flags, UINT32 priority)
INT32 clip_data[4] = {0, 0, 0, 0}; // minx, maxx, miny, maxy
int rowstart = (m_regs[0x08|layer] & 0x18) >> 3;
int colstart = (m_regs[0x0c|layer] & 0x18) >> 3;
int rowspan = ((m_regs[0x08|layer] & 0x03) >> 0) + 1;
int colspan = ((m_regs[0x0c|layer] & 0x03) >> 0) + 1;
int dy = (INT16)m_regs[0x10|layer];
int dx = (INT16)m_regs[0x14|layer];;
int scrollbank = ((m_regs[0x18] >> 1) & 0xc) | (m_regs[0x18] & 3);
int scrollmode = m_regs[0x05] >> (m_lsram_page[layer][0] << 1) & 3;
INT32 rowstart = (m_regs[0x08|layer] & 0x18) >> 3;
INT32 colstart = (m_regs[0x0c|layer] & 0x18) >> 3;
INT32 rowspan = ((m_regs[0x08|layer] & 0x03) >> 0) + 1;
INT32 colspan = ((m_regs[0x0c|layer] & 0x03) >> 0) + 1;
INT32 dy = (INT16)m_regs[0x10|layer];
INT32 dx = (INT16)m_regs[0x14|layer];;
INT32 scrollbank = ((m_regs[0x18] >> 1) & 0xc) | (m_regs[0x18] & 3);
INT32 scrollmode = m_regs[0x05] >> (m_lsram_page[layer][0] << 1) & 3;
if (m_use_ext_linescroll)
{
@ -622,7 +622,7 @@ void K056832Draw(int layer, UINT32 flags, UINT32 priority)
corr = 0;
dy += corr;
ay = (unsigned)(dy - m_layer_offs[layer][1]) % height;
ay = (UINT32)(dy - m_layer_offs[layer][1]) % height;
flipx = m_regs[0] & 0x10;
if (flipx)
@ -797,17 +797,17 @@ void K056832Draw(int layer, UINT32 flags, UINT32 priority)
clip_data[3] = (dmaxy > cmaxy ) ? cmaxy : dmaxy;
if ((scrollmode == 2) && (flags & K056832_DRAW_FLAG_MIRROR) && (flipy))
dx = ((int)p_scroll_data[sdat_offs + 0x1e0 + 14]<<16 | (int)p_scroll_data[sdat_offs + 0x1e0 + 15]) + corr;
dx = ((INT32)p_scroll_data[sdat_offs + 0x1e0 + 14]<<16 | (INT32)p_scroll_data[sdat_offs + 0x1e0 + 15]) + corr;
else
dx = ((int)p_scroll_data[sdat_offs]<<16 | (int)p_scroll_data[sdat_offs + 1]) + corr;
dx = ((INT32)p_scroll_data[sdat_offs]<<16 | (INT32)p_scroll_data[sdat_offs + 1]) + corr;
if ((INT32)last_dx == dx) { if (last_visible) draw_layer_internal(layer, tmap, clip_data, tmap_scrollx, tmap_scrolly, flags, priority); continue; }
last_dx = dx;
if (colspan > 1)
{
//sx = (unsigned)dx % width;
sx = (unsigned)dx & (width-1);
//sx = (UINT32)dx % width;
sx = (UINT32)dx & (width-1);
//tx = c * K056832_PAGE_WIDTH;
tx = c << 9;

View File

@ -3,20 +3,20 @@
static INT32 konamigx_wrport1_0 = 0;
UINT8 m_sound_ctrl;
UINT8 m_sound_intck;
UINT32 m_fantjour_dma[8];
int m_konamigx_current_frame;
int m_gx_objdma, m_gx_primode;
//static UINT8 m_sound_ctrl;
//static UINT8 m_sound_intck;
//static UINT32 m_fantjour_dma[8];
//static INT32 m_konamigx_current_frame;
static INT32 m_gx_objdma, m_gx_primode;
#define GX_MAX_SPRITES 512
#define GX_MAX_LAYERS 6
#define GX_MAX_OBJECTS (GX_MAX_SPRITES + GX_MAX_LAYERS)
static struct GX_OBJ { int order, offs, code, color; } *gx_objpool;
static struct GX_OBJ { INT32 order, offs, code, color; } *gx_objpool;
static UINT16 *gx_spriteram;
static int *K054338_shdRGB;
static INT32 *K054338_shdRGB;
static UINT8 *gx_shdzbuf, *gx_objzbuf;
@ -37,9 +37,9 @@ static INT32 osmixon;
void konamigx_precache_registers()
{
// (see sprite color coding scheme on p.46 & 47)
static const int coregmasks[5] = {0xf,0xe,0xc,0x8,0x0};
static const int coregshifts[5]= {4,5,6,7,8};
int i;
static const INT32 coregmasks[5] = {0xf,0xe,0xc,0x8,0x0};
static const INT32 coregshifts[5]= {4,5,6,7,8};
INT32 i;
i = K053247ReadRegs(0x8/2);
k053247_vrcbk[0] = (i & 0x000f) << 14;
@ -73,7 +73,7 @@ void konamigx_precache_registers()
osmixon = K055555ReadRegister(K55_OSBLEND_ON);
}
void konamigx_mixer_init(int objdma)
void konamigx_mixer_init(INT32 objdma)
{
m_gx_objdma = 0;
m_gx_primode = 0;
@ -110,15 +110,15 @@ void konamigx_mixer_exit()
m_gx_objdma = 0;
}
static void gx_wipezbuf(int noshadow)
static void gx_wipezbuf(INT32 noshadow)
{
#define GX_ZBUFW 512
int w = (nScreenWidth - 1);
int h = (nScreenHeight - 1);
INT32 w = (nScreenWidth - 1);
INT32 h = (nScreenHeight - 1);
UINT8 *zptr = gx_objzbuf;
int ecx = h;
INT32 ecx = h;
do { memset(zptr, -1, w); zptr += GX_ZBUFW; } while (--ecx);
@ -131,19 +131,19 @@ static void gx_wipezbuf(int noshadow)
}
}
void konamigx_mixer_primode(int mode)
void konamigx_mixer_primode(INT32 mode)
{
m_gx_primode = mode;
}
static void gx_draw_basic_tilemaps(int mixerflags, int code)
static void gx_draw_basic_tilemaps(INT32 mixerflags, INT32 code)
{
int temp1,temp2,temp3,temp4;
int i = code<<1;
int j = mixerflags>>i & 3;
int k = 0;
INT32 temp1,temp2,temp3,temp4;
INT32 i = code<<1;
INT32 j = mixerflags>>i & 3;
INT32 k = 0;
int disp = K055555ReadRegister(K55_INPUT_ENABLES);
INT32 disp = K055555ReadRegister(K55_INPUT_ENABLES);
if (disp & (1<<code))
{
if (j == GXMIX_BLEND_NONE) { temp1 = 0xff; temp2 = temp3 = 0; } else
@ -175,21 +175,21 @@ static void gx_draw_basic_tilemaps(int mixerflags, int code)
}
}
static void gx_draw_basic_extended_tilemaps_1(int mixerflags, int code, int sub1, int sub1flags, int rushingheroes_hack, int offs)
static void gx_draw_basic_extended_tilemaps_1(INT32 mixerflags, INT32 code, INT32 sub1, INT32 sub1flags, INT32 rushingheroes_hack, INT32 offs)
{
int temp1,temp2,temp3,temp4;
int i = code<<1;
int j = mixerflags>>i & 3;
int k = 0;
static int parity = 0;
INT32 temp1,temp2,temp3,temp4;
INT32 i = code<<1;
INT32 j = mixerflags>>i & 3;
INT32 k = 0;
static INT32 parity = 0;
parity ^= 1;
sub1 ^= 0; // kill warnings
int disp = K055555ReadRegister(K55_INPUT_ENABLES);
INT32 disp = K055555ReadRegister(K55_INPUT_ENABLES);
if ((disp & K55_INP_SUB1) || (rushingheroes_hack))
{
int alpha = 255;
INT32 alpha = 255;
if (j == GXMIX_BLEND_NONE) { temp1 = 0xff; temp2 = temp3 = 0; } else
if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags>>24; temp3 = 3; }
@ -208,14 +208,14 @@ static void gx_draw_basic_extended_tilemaps_1(int mixerflags, int code, int sub1
if (temp4 < 255) k = (j == GXMIX_BLEND_FAST) ? ~parity : 1;
}
int l = sub1flags & 0xf;
INT32 l = sub1flags & 0xf;
if (offs == -2)
{
int pixeldouble_output = 0;
INT32 pixeldouble_output = 0;
int width = nScreenWidth;
INT32 width = nScreenWidth;
if (width>512) // vsnetscr case
pixeldouble_output = 1;
@ -231,21 +231,21 @@ static void gx_draw_basic_extended_tilemaps_1(int mixerflags, int code, int sub1
}
}
static void gx_draw_basic_extended_tilemaps_2(int mixerflags, int code, int sub2, int sub2flags, INT32 extra_bitmap, int offs)
static void gx_draw_basic_extended_tilemaps_2(INT32 mixerflags, INT32 code, INT32 sub2, INT32 sub2flags, INT32 extra_bitmap, INT32 offs)
{
int temp1,temp2,temp3,temp4;
int i = code<<1;
int j = mixerflags>>i & 3;
// int k = 0;
// static int parity = 0;
INT32 temp1,temp2,temp3,temp4;
INT32 i = code<<1;
INT32 j = mixerflags>>i & 3;
// INT32 k = 0;
// static INT32 parity = 0;
// parity ^= 1;
sub2 ^= 0; // kill warnings
int disp = K055555ReadRegister(K55_INPUT_ENABLES);
INT32 disp = K055555ReadRegister(K55_INPUT_ENABLES);
if (disp & K55_INP_SUB2)
{
//int alpha = 255;
//INT32 alpha = 255;
if (j == GXMIX_BLEND_NONE) { temp1 = 0xff; temp2 = temp3 = 0; } else
if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags>>26; temp3 = 3; }
else
@ -264,16 +264,16 @@ static void gx_draw_basic_extended_tilemaps_2(int mixerflags, int code, int sub2
//if (temp4 < 255) k = (j == GXMIX_BLEND_FAST) ? ~parity : 1;
}
int l = sub2flags & 0xf;
INT32 l = sub2flags & 0xf;
if (offs == -3)
{
if (extra_bitmap) // soccer superstars roz layer
{
#if 0 // iq_132
int xx,yy;
int width = screen.width();
int height = screen.height();
INT32 xx,yy;
INT32 width = screen.width();
INT32 height = screen.height();
const pen_t *paldata = m_palette->pens();
// the output size of the roz layer has to be doubled horizontally
@ -285,7 +285,7 @@ static void gx_draw_basic_extended_tilemaps_2(int mixerflags, int code, int sub2
{
UINT16* src = &extra_bitmap->pix16(yy);
UINT32* dst = &bitmap.pix32(yy);
int shiftpos = 0;
INT32 shiftpos = 0;
for (xx=0;xx<width;xx+=2)
{
UINT16 dat = src[(((xx/2)+shiftpos))%width];
@ -297,7 +297,7 @@ static void gx_draw_basic_extended_tilemaps_2(int mixerflags, int code, int sub2
}
else
{
// int pixeldouble_output = 0;
// INT32 pixeldouble_output = 0;
// K053936GP_1_zoom_draw(machine, bitmap, cliprect, sub2, l, k, alpha, pixeldouble_output);
l = 0; // kill warning
}
@ -308,34 +308,34 @@ static void gx_draw_basic_extended_tilemaps_2(int mixerflags, int code, int sub2
}
}
extern void k053247_draw_single_sprite_gxcore(UINT8 *,UINT8 *gx_shdzbuf, int code, unsigned short *gx_spriteram, int offs,
int color, int alpha, int drawmode, int zcode, int pri,
int primask, int shadow, unsigned char *drawmode_table, unsigned char *shadowmode_table, int shdmask);
extern void k053247_draw_single_sprite_gxcore(UINT8 *,UINT8 *gx_shdzbuf, INT32 code, UINT16 *gx_spriteram, INT32 offs,
INT32 color, INT32 alpha, INT32 drawmode, INT32 zcode, INT32 pri,
INT32 primask, INT32 shadow, UINT8 *drawmode_table, UINT8 *shadowmode_table, INT32 shdmask);
static void konamigx_mixer_draw(int sub1, int sub1flags,int sub2, int sub2flags,int mixerflags, int extra_bitmap, int rushingheroes_hack,struct GX_OBJ *objpool,int *objbuf,int nobj)
static void konamigx_mixer_draw(INT32 sub1, INT32 sub1flags,INT32 sub2, INT32 sub2flags,INT32 mixerflags, INT32 extra_bitmap, INT32 rushingheroes_hack,struct GX_OBJ *objpool,INT32 *objbuf,INT32 nobj)
{
// traverse draw list
int disp = K055555ReadRegister(K55_INPUT_ENABLES);
INT32 disp = K055555ReadRegister(K55_INPUT_ENABLES);
for (int count=0; count<nobj; count++)
for (INT32 count=0; count<nobj; count++)
{
struct GX_OBJ *objptr = objpool + objbuf[count];
int order = objptr->order;
int offs = objptr->offs;
int code = objptr->code;
int color = objptr->color;
INT32 order = objptr->order;
INT32 offs = objptr->offs;
INT32 code = objptr->code;
INT32 color = objptr->color;
/* entries >=0 in our list are sprites */
if (offs >= 0)
{
if (!(disp & K55_INP_OBJ)) continue;
int drawmode = order>>4 & 0xf;
INT32 drawmode = order>>4 & 0xf;
int alpha = 255;
int pri = 0;
int zcode = -1; // negative zcode values turn off z-buffering
INT32 alpha = 255;
INT32 pri = 0;
INT32 zcode = -1; // negative zcode values turn off z-buffering
if (drawmode & 2)
{
@ -377,13 +377,13 @@ static void konamigx_mixer_draw(int sub1, int sub1flags,int sub2, int sub2flags,
}
}
void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extra tilemap 2*/, int sub2flags, int mixerflags, int extra_bitmap /*extra tilemap 3*/, int rushingheroes_hack)
void konamigx_mixer(INT32 sub1 /*extra tilemap 1*/, INT32 sub1flags, INT32 sub2 /*extra tilemap 2*/, INT32 sub2flags, INT32 mixerflags, INT32 extra_bitmap /*extra tilemap 3*/, INT32 rushingheroes_hack)
{
int objbuf[GX_MAX_OBJECTS];
int shadowon[3], shdpri[3], layerid[6], layerpri[6];
INT32 objbuf[GX_MAX_OBJECTS];
INT32 shadowon[3], shdpri[3], layerid[6], layerpri[6];
struct GX_OBJ *objpool, *objptr;
int cltc_shdpri, /*prflp,*/ disp;
INT32 cltc_shdpri, /*prflp,*/ disp;
// abort if object database failed to initialize
objpool = gx_objpool;
@ -452,14 +452,14 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
shdpri[1] = K055555ReadRegister(K55_SHAD2_PRI);
shdpri[2] = K055555ReadRegister(K55_SHAD3_PRI);
int spri_min = 0;
INT32 spri_min = 0;
shadowon[2] = shadowon[1] = shadowon[0] = 0;
int k = 0;
INT32 k = 0;
if (!(mixerflags & GXMIX_NOSHADOW))
{
int i,j;
INT32 i,j;
// only enable shadows beyond a +/-7 RGB threshold
for (j=0,i=0; i<3; j+=3,i++)
{
@ -469,7 +469,7 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
}
// SHDON specifies layers on which shadows can be projected (see detail on p.65 7.2.8)
int temp = K055555ReadRegister(K55_SHD_ON);
INT32 temp = K055555ReadRegister(K55_SHD_ON);
for (i=0; i<4; i++) if (!(temp>>i & 1) && spri_min < layerpri[i]) spri_min = layerpri[i]; // HACK
// update shadows status
@ -477,12 +477,12 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
}
// pre-sort layers
for (int j=0; j<5; j++)
for (INT32 j=0; j<5; j++)
{
int temp1 = layerpri[j];
for (int i=j+1; i<6; i++)
INT32 temp1 = layerpri[j];
for (INT32 i=j+1; i<6; i++)
{
int temp2 = layerpri[i];
INT32 temp2 = layerpri[i];
if ((UINT32)temp1 <= (UINT32)temp2)
{
layerpri[i] = temp1; layerpri[j] = temp1 = temp2;
@ -493,13 +493,13 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
// build object database and create indices
objptr = objpool;
int nobj = 0;
INT32 nobj = 0;
for (int i=5; i>=0; i--)
for (INT32 i=5; i>=0; i--)
{
int offs;
INT32 offs;
int code = layerid[i];
INT32 code = layerid[i];
switch (code)
{
/*
@ -537,21 +537,21 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
}
// i = j = 0xff;
int l = 0;
INT32 l = 0;
for (int offs=0; offs<0x800; offs+=8)
for (INT32 offs=0; offs<0x800; offs+=8)
{
int pri = 0;
INT32 pri = 0;
if (!(gx_spriteram[offs] & 0x8000)) continue;
int zcode = gx_spriteram[offs] & 0xff;
INT32 zcode = gx_spriteram[offs] & 0xff;
// invert z-order when opset_pri is set (see p.51 OPSET PRI)
if (k053247_opset & 0x10) zcode = 0xff - zcode;
int code = gx_spriteram[offs+1];
int color = k = gx_spriteram[offs+6];
INT32 code = gx_spriteram[offs+1];
INT32 color = k = gx_spriteram[offs+6];
l = gx_spriteram[offs+7];
K053247Callback(&code, &color, &pri);
@ -564,12 +564,12 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
temp3 = add shadow object
temp4 = shadow pens draw mode
*/
int temp4 = 0;
int temp3 = 0;
int temp2 = 0;
int temp1 = 0;
int spri = 0;
int shadow = 0;
INT32 temp4 = 0;
INT32 temp3 = 0;
INT32 temp2 = 0;
INT32 temp1 = 0;
INT32 spri = 0;
INT32 shadow = 0;
if (color & K055555_FULLSHADOW)
{
@ -583,7 +583,7 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
shadow = k>>10 & 3;
if (shadow) // object has shadow?
{
int k053246_objset1 = K053246ReadRegs(5);
INT32 k053246_objset1 = K053246ReadRegs(5);
if (shadow != 1 || k053246_objset1 & 0x20)
{
@ -654,7 +654,7 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
{
// add objects with solid or alpha pens
int order = pri<<24 | zcode<<16 | offs<<(8-3) | temp2<<4;
INT32 order = pri<<24 | zcode<<16 | offs<<(8-3) | temp2<<4;
objptr->order = order;
objptr->offs = offs;
objptr->code = code;
@ -668,7 +668,7 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
if (temp3 && !(color & K055555_SKIPSHADOW) && !(mixerflags & GXMIX_NOSHADOW))
{
// add objects with shadows if enabled
int order = spri<<24 | zcode<<16 | offs<<(8-3) | temp4<<4 | shadow;
INT32 order = spri<<24 | zcode<<16 | offs<<(8-3) | temp4<<4 | shadow;
objptr->order = order;
objptr->offs = offs;
objptr->code = code;
@ -684,14 +684,14 @@ void konamigx_mixer(int sub1 /*extra tilemap 1*/, int sub1flags, int sub2 /*extr
k = nobj;
l = nobj - 1;
for (int j=0; j<l; j++)
for (INT32 j=0; j<l; j++)
{
int temp1 = objbuf[j];
int temp2 = objpool[temp1].order;
for (int i=j+1; i<k; i++)
INT32 temp1 = objbuf[j];
INT32 temp2 = objpool[temp1].order;
for (INT32 i=j+1; i<k; i++)
{
int temp3 = objbuf[i];
int temp4 = objpool[temp3].order;
INT32 temp3 = objbuf[i];
INT32 temp4 = objpool[temp3].order;
if ((UINT32)temp2 <= (UINT32)temp4) { temp2 = temp4; objbuf[i] = temp1; objbuf[j] = temp1 = temp3; }
}
}

View File

@ -256,7 +256,7 @@ static void decode_gfx()
{
INT32 i;
INT32 G1 = 0xc000/3;
int G2 = 0x20000/2;
INT32 G2 = 0x20000/2;
UINT8 *gfx1 = DrvGfxROM0;
UINT8 *gfx2 = DrvGfxROM1;
UINT8 *buf = (UINT8*)BurnMalloc(0x20000);
@ -327,9 +327,9 @@ static INT32 DrvGfxDecode()
static void DrvPaletteInit()
{
for (int i = 0;i < 256;i++)
for (INT32 i = 0;i < 256;i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
INT32 bit0,bit1,bit2,bit3,r,g,b;
/* red component */
bit0 = (DrvColPROM[i] >> 0) & 0x01;
@ -426,7 +426,7 @@ static INT32 DrvExit()
return 0;
}
static void draw_layer(int rows_start, int rows_end)
static void draw_layer(INT32 rows_start, INT32 rows_end)
{
INT32 scrollx[4] = { 0x100 - scroll, 0x100 - scroll, 0x100 - scroll, 0x100 };

View File

@ -715,9 +715,9 @@ static inline INT32 scanline_to_vcount(INT32 scanline) // ripped directly from M
static void xain_scanline(INT32 scanline) // ripped directly from MAME
{
int screen_height = 240;
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
INT32 screen_height = 240;
INT32 vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
INT32 vcount = scanline_to_vcount(scanline);
if (!(vcount_old & 8) && (vcount & 8))
{
@ -794,16 +794,16 @@ static void draw_sprites()
{
for (INT32 offs = 0; offs < 0x180; offs += 4)
{
int attr = DrvSprRAM[offs+1];
int code = DrvSprRAM[offs+2] | ((attr & 7) << 8);
int color = (attr & 0x38) >> 3;
INT32 attr = DrvSprRAM[offs+1];
INT32 code = DrvSprRAM[offs+2] | ((attr & 7) << 8);
INT32 color = (attr & 0x38) >> 3;
int sx = 238 - DrvSprRAM[offs+3];
INT32 sx = 238 - DrvSprRAM[offs+3];
if (sx <= -7) sx += 256;
int sy = 240 - DrvSprRAM[offs];
INT32 sy = 240 - DrvSprRAM[offs];
if (sy <= -7) sy += 256;
int flipx = attr & 0x40;
int flipy = 0;
INT32 flipx = attr & 0x40;
INT32 flipy = 0;
if (attr & 0x80)
{

View File

@ -390,8 +390,8 @@ static UINT16 sprite_prot_x,sprite_prot_y,dst1,cop_spr_maxx,cop_spr_off;
static UINT16 sprite_prot_src_addr[2];
static struct {
int x, y, z;
int min_x, min_y, min_z, max_x, max_y, max_z;
INT32 x, y, z;
INT32 min_x, min_y, min_z, max_x, max_y, max_z;
} cop_collision_info[2];
static UINT16 cop_hit_status, cop_hit_baseadr;
@ -533,12 +533,12 @@ static void SeibuCopScan(INT32 nAction)
static void itoa_compute()
{
int digits = 1 << cop_itoa_digit_count*2;
INT32 digits = 1 << cop_itoa_digit_count*2;
UINT32 val = cop_itoa;
if(digits > 9)
digits = 9;
for(int i=0; i<digits; i++)
for(INT32 i=0; i<digits; i++)
if(!val && i)
cop_itoa_digits[i] = 0x20;
else {
@ -553,14 +553,14 @@ static void sprite_prot_src_write(UINT16 data)
sprite_prot_src_addr[1] = data;
UINT32 src = (sprite_prot_src_addr[0]<<4)+sprite_prot_src_addr[1];
int x = INT16((VezReadLong(src+0x08) >> 16) - (sprite_prot_x));
int y = INT16((VezReadLong(src+0x04) >> 16) - (sprite_prot_y));
INT32 x = INT16((VezReadLong(src+0x08) >> 16) - (sprite_prot_x));
INT32 y = INT16((VezReadLong(src+0x04) >> 16) - (sprite_prot_y));
UINT16 head1 = VezReadWord(src+cop_spr_off);
UINT16 head2 = VezReadWord(src+cop_spr_off+2);
int w = (((head1 >> 8 ) & 7) + 1) << 4;
int h = (((head1 >> 12) & 7) + 1) << 4;
INT32 w = (((head1 >> 8 ) & 7) + 1) << 4;
INT32 h = (((head1 >> 12) & 7) + 1) << 4;
UINT16 flag = x-w/2 > -w && x-w/2 < cop_spr_maxx+w && y-h/2 > -h && y-h/2 < 256+h ? 1 : 0;
@ -578,14 +578,14 @@ static void sprite_prot_src_write(UINT16 data)
}
}
static void cop_collision_read_xy(int slot, UINT32 spradr)
static void cop_collision_read_xy(INT32 slot, UINT32 spradr)
{
cop_collision_info[slot].x = VezReadLong(spradr+4);
cop_collision_info[slot].y = VezReadLong(spradr+8);
cop_collision_info[slot].z = VezReadLong(spradr+12);
}
static void cop_collision_update_hitbox(int slot, UINT32 hitadr)
static void cop_collision_update_hitbox(INT32 slot, UINT32 hitadr)
{
UINT32 hitadr2 = VezReadWord(hitadr) + (cop_hit_baseadr << 16);
@ -631,9 +631,9 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
switch(data) {
case 0x0205: { // 0205 0006 ffeb 0000 - 0188 0282 0082 0b8e 098e 0000 0000 0000
int ppos = VezReadLong(cop_regs[0] + 4 + offset*4);
int npos = ppos + VezReadLong(cop_regs[0] + 0x10 + offset*4);
int delta = (npos >> 16) - (ppos >> 16);
INT32 ppos = VezReadLong(cop_regs[0] + 4 + offset*4);
INT32 npos = ppos + VezReadLong(cop_regs[0] + 0x10 + offset*4);
INT32 delta = (npos >> 16) - (ppos >> 16);
VezWriteLong(cop_regs[0] + 4 + offset*4, npos);
VezWriteWord(cop_regs[0] + 0x1e + offset*4, VezReadWord(cop_regs[0] + 0x1e + offset*4) + delta);
break;
@ -650,8 +650,8 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
case 0x130e: // 130e 0005 bf7f 0010 - 0984 0aa4 0d82 0aa2 039b 0b9a 0b9a 0a9a
case 0x138e:
case 0x338e: { // 338e 0005 bf7f 0030 - 0984 0aa4 0d82 0aa2 039c 0b9c 0b9c 0a9a
int dx = VezReadLong(cop_regs[1]+4) - VezReadLong(cop_regs[0]+4);
int dy = VezReadLong(cop_regs[1]+8) - VezReadLong(cop_regs[0]+8);
INT32 dx = VezReadLong(cop_regs[1]+4) - VezReadLong(cop_regs[0]+4);
INT32 dy = VezReadLong(cop_regs[1]+8) - VezReadLong(cop_regs[0]+8);
if(!dy) {
cop_status |= 0x8000;
@ -670,8 +670,8 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
case 0x2208:
case 0x2288: { // 2208 0005 f5df 0020 - 0f8a 0b8a 0388 0b9a 0b9a 0a9a 0000 0000
int dx = VezReadWord(cop_regs[0]+0x12);
int dy = VezReadWord(cop_regs[0]+0x16);
INT32 dx = VezReadWord(cop_regs[0]+0x12);
INT32 dy = VezReadWord(cop_regs[0]+0x16);
if(!dy) {
cop_status |= 0x8000;
@ -689,7 +689,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
}
case 0x2a05: { // 2a05 0006 ebeb 0028 - 09af 0a82 0082 0a8f 018e 0000 0000 0000
int delta = VezReadWord(cop_regs[1] + 0x1e + offset*4);
INT32 delta = VezReadWord(cop_regs[1] + 0x1e + offset*4);
VezWriteLong(cop_regs[0] + 4+2 + offset*4, VezReadWord(cop_regs[0] + 4+2 + offset*4) + delta);
VezWriteLong(cop_regs[0] + 0x1e + offset*4, VezReadWord(cop_regs[0] + 0x1e + offset*4) + delta);
break;
@ -699,7 +699,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
case 0x3b30:
case 0x3bb0: { // 3bb0 0004 007f 0038 - 0f9c 0b9c 0b9c 0b9c 0b9c 0b9c 0b9c 099c
/* TODO: these are actually internally loaded via 0x130e command */
int dx,dy;
INT32 dx,dy;
dx = VezReadLong(cop_regs[1]+4) - VezReadLong(cop_regs[0]+4);
dy = VezReadLong(cop_regs[1]+8) - VezReadLong(cop_regs[0]+8);
@ -714,7 +714,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
}
case 0x42c2: { // 42c2 0005 fcdd 0040 - 0f9a 0b9a 0b9c 0b9c 0b9c 029c 0000 0000
int div = VezReadWord(cop_regs[0]+(0x36));
INT32 div = VezReadWord(cop_regs[0]+(0x36));
if(!div)
div = 1;
@ -726,7 +726,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
}
case 0x4aa0: { // 4aa0 0005 fcdd 0048 - 0f9a 0b9a 0b9c 0b9c 0b9c 099b 0000 0000
int div = VezReadWord(cop_regs[0]+(0x38));
INT32 div = VezReadWord(cop_regs[0]+(0x38));
if(!div)
div = 1;
@ -743,7 +743,7 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
cop_angle_target &= 0xff;
cop_angle_step &= 0xff;
flags &= ~0x0004;
int delta = angle - cop_angle_target;
INT32 delta = angle - cop_angle_target;
if(delta >= 128)
delta -= 256;
else if(delta < -128)
@ -767,27 +767,27 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
}
case 0x8100: { // 8100 0007 fdfb 0080 - 0b9a 0b88 0888 0000 0000 0000 0000 0000
int raw_angle = (VezReadWord(cop_regs[0]+(0x34)) & 0xff);
INT32 raw_angle = (VezReadWord(cop_regs[0]+(0x34)) & 0xff);
double angle = raw_angle * M_PI / 128;
double amp = (65536 >> 5)*(VezReadWord(cop_regs[0]+(0x36)) & 0xff);
int res;
INT32 res;
/* TODO: up direction, why? (check machine/seicop.c) */
if(raw_angle == 0xc0)
amp*=2;
res = int(amp*sin(angle)) << cop_scale;
res = INT32(amp*sin(angle)) << cop_scale;
VezWriteLong(cop_regs[0] + 16, res);
break;
}
case 0x8900: { // 8900 0007 fdfb 0088 - 0b9a 0b8a 088a 0000 0000 0000 0000 0000
int raw_angle = (VezReadWord(cop_regs[0]+(0x34)) & 0xff);
INT32 raw_angle = (VezReadWord(cop_regs[0]+(0x34)) & 0xff);
double angle = raw_angle * M_PI / 128;
double amp = (65536 >> 5)*(VezReadWord(cop_regs[0]+(0x36)) & 0xff);
int res;
INT32 res;
/* TODO: left direction, why? (check machine/seicop.c) */
if(raw_angle == 0x80)
amp*=2;
res = int(amp*cos(angle)) << cop_scale;
res = INT32(amp*cos(angle)) << cop_scale;
VezWriteLong(cop_regs[0] + 20, res);
break;
}
@ -835,10 +835,10 @@ static void cop_cmd_write(INT32 offset, UINT16 data)
}
}
static UINT8 fade_table(int v)
static UINT8 fade_table(INT32 v)
{
int low = v & 0x001f;
int high = v & 0x03e0;
INT32 low = v & 0x001f;
INT32 high = v & 0x03e0;
return (low * (high | (high >> 5)) + 0x210) >> 10;
}
@ -852,13 +852,13 @@ static void cop_dma_trigger_write(UINT16)
Raiden 2 uses this DMA with cop_dma_dst == 0xfffe, effectively changing the order of the uploaded VRAMs.
Also the size is used for doing a sprite limit trickery.
*/
static int rsize = ((0x80 - cop_dma_size[cop_dma_mode]) & 0x7f) +1;
static INT32 rsize = ((0x80 - cop_dma_size[cop_dma_mode]) & 0x7f) +1;
sprites_cur_start = 0x1000 - (rsize << 5);
#if 0
int rsize = 32*(0x7f-cop_dma_size);
int radr = 64*cop_dma_adr - rsize;
for(int i=0; i<rsize; i+=2)
INT32 rsize = 32*(0x7f-cop_dma_size);
INT32 radr = 64*cop_dma_adr - rsize;
for(INT32 i=0; i<rsize; i+=2)
sprites[i/2] = VezReadWord(radr+i);
sprites_cur_start = rsize;
#endif
@ -877,8 +877,8 @@ static void cop_dma_trigger_write(UINT16)
for(i = 0;i < size;i++)
{
UINT16 pal_val;
int r,g,b;
int rt,gt,bt;
INT32 r,g,b;
INT32 rt,gt,bt;
bt = (VezReadWord(src + (cop_dma_adr_rel * 0x400)) & 0x7c00) >> 5;
bt = fade_table(bt|(pal_brightness_val ^ 0));
@ -949,7 +949,7 @@ static void cop_sort_dma_trig_write(UINT16 data)
sort_size = data;
{
int i,j;
INT32 i,j;
UINT8 xchg_flag;
UINT32 addri,addrj;
UINT16 vali,valj;
@ -1713,15 +1713,15 @@ static const UINT16 x11_zt[512] = {
0x30e, 0x0d8, 0x0d8, 0x55c, 0x55c, 0x31c, 0x31c, 0x30e, 0x351, 0x3dc, 0x3dc, 0x6c1, 0x6c1, 0x651, 0x651, 0x351,
};
static UINT32 partial_carry_sum(UINT32 add1,UINT32 add2,UINT32 carry_mask,int bits)
static UINT32 partial_carry_sum(UINT32 add1,UINT32 add2,UINT32 carry_mask,INT32 bits)
{
int i,res,carry;
INT32 i,res,carry;
res = 0;
carry = 0;
for (i = 0;i < bits;i++)
{
int bit = BIT(add1,i) + BIT(add2,i) + carry;
INT32 bit = BIT(add1,i) + BIT(add2,i) + carry;
res += (bit & 1) << i;
@ -1744,16 +1744,16 @@ static UINT32 partial_carry_sum32(UINT32 add1,UINT32 add2,UINT32 carry_mask)
return partial_carry_sum(add1,add2,carry_mask,32);
}
static UINT32 yrot(UINT32 v, int r)
static UINT32 yrot(UINT32 v, INT32 r)
{
return (v << r) | (v >> (32-r));
}
static UINT16 gm(int i4)
static UINT16 gm(INT32 i4)
{
UINT16 x=0;
for (int i=0; i<4; ++i)
for (INT32 i=0; i<4; ++i)
{
if (BIT(i4,i))
x ^= 0xf << (i<<2);
@ -1762,7 +1762,7 @@ static UINT16 gm(int i4)
return x;
}
static UINT32 core_decrypt(UINT32 ciphertext, int i1, int i2, int i3, int i4,
static UINT32 core_decrypt(UINT32 ciphertext, INT32 i1, INT32 i2, INT32 i3, INT32 i4,
const UINT8 *rotate, const UINT8 *x5, const UINT16 *x11, UINT32 preXor, UINT32 carryMask, UINT32 postXor)
{
UINT32 v1 = BITSWAP32(yrot(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21);
@ -1777,7 +1777,7 @@ static void raiden2_decrypt_sprites()
{
UINT32 *data = (UINT32 *)DrvGfxROM2;
for(int i=0; i<0x800000/4; i++)
for(INT32 i=0; i<0x800000/4; i++)
{
data[i] = core_decrypt(data[i], (i&0xff) ^ BIT(i,15) ^ (BIT(i,20)<<8), (i&0xff) ^ BIT(i,15),
(i>>8) & 0xff, (i>>16) & 0xf, rotate_r2, x5_r2, x11_r2, 0x60860000, 0x176c91a8, 0x0f488000);
@ -1788,7 +1788,7 @@ static void zeroteam_decrypt_sprites()
{
UINT32 *data = (UINT32 *)DrvGfxROM2;
for(int i=0; i<0x400000/4; i++)
for(INT32 i=0; i<0x400000/4; i++)
{
data[i] = core_decrypt(data[i], i & 0xff, i & 0xff, (i>>7) & 0x1ff, (i>>16) & 0xf,
rotate_zt, x5_zt, x11_zt, 0xa5800000, 0x7b67b7b9, 0xf1412ea8
@ -2379,15 +2379,15 @@ static void draw_sprites(INT32 priority)
UINT16 *source = sprites + sprites_cur_start/2;
while( source >= sprites ){
int tile_number = source[1];
int sx = source[2];
int sy = source[3];
int colr;
int xtiles, ytiles;
int ytlim, xtlim;
int xflip, yflip;
int xstep, ystep;
int pri;
INT32 tile_number = source[1];
INT32 sx = source[2];
INT32 sy = source[3];
INT32 colr;
INT32 xtiles, ytiles;
INT32 ytlim, xtlim;
INT32 xflip, yflip;
INT32 xstep, ystep;
INT32 pri;
ytlim = (source[0] >> 12) & 0x7;
xtlim = (source[0] >> 8 ) & 0x7;

View File

@ -242,7 +242,7 @@ static void galpanib_calc_write(INT32 offset, UINT16 data)
static void update_irq_state()
{
int irq = (vblank_irq || sprite_irq || unknown_irq) ? 1 : 0;
INT32 irq = (vblank_irq || sprite_irq || unknown_irq) ? 1 : 0;
SekSetIRQLine(1, irq ? SEK_IRQSTATUS_ACK : SEK_IRQSTATUS_NONE);
}

View File

@ -51,8 +51,8 @@ struct t90_Regs
UINT8 halt, after_EI;
UINT16 irq_state, irq_mask;
int icount;
int extra_cycles; // extra cycles for interrupts
INT32 icount;
INT32 extra_cycles; // extra cycles for interrupts
UINT8 internal_registers[48];
UINT32 ixbase,iybase;
@ -75,7 +75,7 @@ struct t90_Regs
e_mode mode2;
e_r r2,r2b;
int cyc_t,cyc_f;
INT32 cyc_t,cyc_f;
UINT32 addr;
@ -980,12 +980,12 @@ static const char *const ir_names[] = {
static const char *internal_registers_names(UINT16 x)
{
int ir = x - T90_IOBASE;
INT32 ir = x - T90_IOBASE;
if ( ir >= 0 && ir < sizeof(ir_names)/sizeof(ir_names[0]) )
return ir_names[ir];
return NULL;
}
static int sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_mode mode, const e_r r, const e_r rb)
static INT32 sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_mode mode, const e_r r, const e_r rb)
{
const char *reg_name;
switch ( mode )
@ -1023,7 +1023,7 @@ static int sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_mode mod
CPU_DISASSEMBLE( t90 )
{
t90_Regs *cpustate = get_safe_token(device);
int len;
INT32 len;
cpustate->addr = pc;
@ -1224,9 +1224,9 @@ READ_FN(2)
WRITE_FN(1)
WRITE_FN(2)
INLINE int Test( t90_Regs *cpustate, UINT8 cond )
INLINE INT32 Test( t90_Regs *cpustate, UINT8 cond )
{
int s,v;
INT32 s,v;
switch ( cond )
{
case FLS: return 0;
@ -1327,8 +1327,8 @@ static void take_interrupt(t90_Regs *cpustate, e_irq irq)
static void check_interrupts(t90_Regs *cpustate)
{
int irq;
int mask;
INT32 irq;
INT32 mask;
if (!(F & IF))
return;
@ -1345,7 +1345,7 @@ static void check_interrupts(t90_Regs *cpustate)
}
}
void tlcs90_set_irq_line(int irq, int state)
void tlcs90_set_irq_line(INT32 irq, INT32 state)
{
t90_Regs *cpustate = &tlcs90_data[0];
@ -1394,7 +1394,7 @@ INT32 tlcs90Run(INT32 nCycles)
t90_Regs *cpustate = &tlcs90_data[0]; //get_safe_token(device);
UINT8 a8,b8;
UINT16 a16,b16;
unsigned a32;
UINT32 a32;
PAIR tmp;
cpustate->icount=nCycles;
@ -2405,9 +2405,9 @@ UINT8 t90_internal_registers_r(UINT16 offset)
return data;
}
static void t90_start_timer(t90_Regs *cpustate, int i)
static void t90_start_timer(t90_Regs *cpustate, INT32 i)
{
int prescaler;
INT32 prescaler;
double period;
cpustate->timer_value[i] = 0;
@ -2449,7 +2449,7 @@ static void t90_start_timer(t90_Regs *cpustate, int i)
static void t90_start_timer4(t90_Regs *cpustate)
{
int prescaler;
INT32 prescaler;
double period;
cpustate->timer4_value = 0;
@ -2471,7 +2471,7 @@ static void t90_start_timer4(t90_Regs *cpustate)
}
static void t90_stop_timer(t90_Regs *cpustate, int i)
static void t90_stop_timer(t90_Regs *cpustate, INT32 i)
{
cpustate->timer_enable[i] = 0;
@ -2487,8 +2487,8 @@ void t90_timer_callback(INT32 param)
{
t90_Regs *cpustate = &tlcs90_data[0];
int mode, timer_fired;
int i = param;
INT32 mode, timer_fired;
INT32 i = param;
if ( (cpustate->internal_registers[ T90_TRUN - T90_IOBASE ] & (1 << i)) == 0 )
return;
@ -2715,7 +2715,7 @@ void t90_internal_registers_w(UINT16 offset, UINT8 data)
INT32 tlcs90_init(INT32 /*clock*/)
{
t90_Regs *cpustate = &tlcs90_data[0];
int i, p;
INT32 i, p;
for (i = 0; i < 256; i++)
{

View File

@ -15,7 +15,7 @@ INT32 tlcs90Exit();
#define TLCS90_IRQSTATUS_ACK 1
#define TLCS90_IRQSTATUS_AUTO 2
void tlcs90SetIRQLine(int line, int state);
void tlcs90SetIRQLine(INT32 line, INT32 state);
void tlcs90BurnCycles(INT32 nCpu, INT32 cycles);

View File

@ -205,6 +205,7 @@
<li>Add proper Seibu Sound device to Toki [iq_132]</li>
<li>Fix sound panning in Cyber Tank [dink]</li>
<li>Fix for mixing distortion/crackles in Konami's K054539 sound driver [dink]</li>
<li>Tidy-up submitted code fixing compile warnings and portability issues [barry[</li>
</ul>