diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c index 0dc8ddb2d41..7bb3f027b78 100644 --- a/src/mame/drivers/polepos.c +++ b/src/mame/drivers/polepos.c @@ -1529,6 +1529,86 @@ ROM_START( topracera ) ROM_END + +ROM_START( ppspeed ) + /* Z80 memory/ROM data */ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "tr9b.bin", 0x0000, 0x2000, CRC(538bd0cb) SHA1(36a0628ce735c76e5db83d195af3a9bed5155c60) ) + ROM_LOAD( "tr10.bin", 0x2000, 0x1000, CRC(7174bcb7) SHA1(460326a6cea201db2df813013c95562a222ea95d) ) + + /* Z8002 #1 memory/ROM data */ + ROM_REGION( 0x10000, "sub", 0 ) + ROM_LOAD16_BYTE( "tr1b.bin", 0x0001, 0x2000, CRC(127f0750) SHA1(97ae6c6f8086187c7cdb8bff5fec94914791890b) ) + ROM_LOAD16_BYTE( "tr2b.bin", 0x0000, 0x2000, CRC(6bd4ff6b) SHA1(cf992de39a8cf7804961a8e6773fc4f7feb1878b) ) + + /* Z8002 #2 memory/ROM data */ + ROM_REGION( 0x10000, "sub2", 0 ) + ROM_LOAD16_BYTE( "tr5b.bin", 0x0001, 0x2000, CRC(4e5f7b9c) SHA1(d26b1f24dd9ef00388987890bc5b95d4db403815) ) + ROM_LOAD16_BYTE( "tr6b.bin", 0x0000, 0x2000, CRC(b3641d0c) SHA1(38ce172b2e38895749cbd3cc1c0e2c0fe8be744a) ) + + /* graphics data */ + ROM_REGION( 0x01000, "gfx1", 0 ) /* 2bpp alpha layer */ + ROM_LOAD( "tr28.bin", 0x0000, 0x1000, CRC(cd80b4c3) SHA1(5f237c1e7eb94ecb2680270afdf31c8e111164c5) ) + + ROM_REGION( 0x01000, "gfx2", 0 ) /* 2bpp view layer */ + ROM_LOAD( "tr29.bin", 0x0000, 0x1000, CRC(c6e15c21) SHA1(e2a70b3f7ce51a003068eb75d9fe82548f0206d7) ) + + ROM_REGION( 0x04000, "gfx3", 0 ) /* 4bpp 16x16 sprites */ + ROM_LOAD( "tr25.bin", 0x0000, 0x2000, CRC(f44d33c1) SHA1(e09bcc127e61b351e99c54bf0e3cbab8583949ec) ) /* 4bpp sm sprites, planes 0+1 */ + ROM_LOAD( "tr26.bin", 0x2000, 0x2000, CRC(87e8482d) SHA1(3f1c7f0f9b27e8b61e62db55dd4332c75dc31558) ) /* 4bpp sm sprites, planes 2+3 */ + + ROM_REGION( 0x10000, "gfx4", 0 ) /* 4bpp 32x32 sprites */ + ROM_LOAD( "tr17.bin", 0x0000, 0x2000, CRC(613ab0df) SHA1(88aa4500275aae010fc9783c1d8d843feab89afa) ) /* 4bpp lg sprites, planes 0+1 */ + ROM_LOAD( "tr19.bin", 0x2000, 0x2000, CRC(1ea04ccd) SHA1(1cec1e4d0f47365245d92489f78d3edd4f23481f) ) + ROM_LOAD( "tr21.bin", 0x4000, 0x2000, CRC(bd7b4a62) SHA1(66175a9382f627053097f0bc9a3fd49a26f8ac8f) ) + ROM_LOAD( "tr18.bin", 0x8000, 0x2000, CRC(5fd933e3) SHA1(5b27a8519234c935308f943cd58abc1efc463726) ) /* 4bpp lg sprites, planes 2+3 */ + ROM_LOAD( "tr20.bin", 0xa000, 0x2000, CRC(c572c6ed) SHA1(c2398a82a57be92a0bdc58330504e821878492ea) ) + ROM_LOAD( "tr22.bin", 0xc000, 0x2000, CRC(db1bcdd8) SHA1(ffd4edd8c02914a0a85cd7e39153c27d79526457) ) + + ROM_REGION( 0x5000, "gfx5", 0 ) /* road generation ROMs needed at runtime */ + ROM_LOAD( "tr30.bin", 0x0000, 0x2000, CRC(ee6b3315) SHA1(9cc26c6d3604c0f60d716f86e67e9d9c0487f87d) ) /* road control */ + ROM_LOAD( "tr31.bin", 0x2000, 0x2000, CRC(6d1e7042) SHA1(90113ff0c93ed86d95067290088705bb5e6608d1) ) /* road bits 1 */ + ROM_LOAD( "tr32.bin", 0x4000, 0x1000, CRC(4e97f101) SHA1(f377d053821c74aee93ebcd30a4d43e6156f3cfe) ) /* road bits 2 */ + + ROM_REGION( 0x1000, "gfx6", 0 ) /* sprite scaling */ + ROM_LOAD( "tr27.bin", 0x0000, 0x1000, CRC(a61bff15) SHA1(f7a59970831cdaaa7bf59c2221a38e4746c54244) ) /* vertical scaling */ + + ROM_REGION( 0x4000, "engine", 0 ) + ROM_LOAD( "tr15.bin", 0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) ) /* engine sound */ + ROM_LOAD( "tr16.bin", 0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) ) /* engine sound */ + + + // nothing below was verified on this boardset, assumed to be the same + + /* graphics (P)ROM data */ + ROM_REGION( 0x1040, "proms", 0 ) + ROM_LOAD( "7052-7.k21", 0x0000, 0x0100, CRC(f07ff2ad) SHA1(e1f3cb10a03d23f8c1d422acf271dba4e7b98cb1) ) /* red palette */ + ROM_LOAD( "7052-8.k20", 0x0100, 0x0100, CRC(adbde7d7) SHA1(956ac5117c1e310f554ac705aa2dc24a796c36a5) ) /* green palette */ + ROM_LOAD( "7052-9.k19", 0x0200, 0x0100, CRC(ddac786a) SHA1(d1860105bf91297533ccc4aa6775987df198d0fa) ) /* blue palette */ + ROM_LOAD( "7052-10.h15", 0x0300, 0x0100, CRC(5af3f710) SHA1(da13d17acf8abd0f6ebb4b51b23c3324c6197b7d) ) /* alpha color */ + ROM_LOAD( "7052-11.j15", 0x0400, 0x0100, CRC(8c90e36e) SHA1(2646288d9e0f86300da7f06e1dc0595673205bb4) ) /* background color */ + ROM_LOAD( "7052-15.d1", 0x0500, 0x0100, CRC(2d502464) SHA1(682b7dd22e51d5db52c0804b7e27e47641dfa6bd) ) /* vertical position low */ + ROM_LOAD( "7052-16.d2", 0x0600, 0x0100, CRC(027aa62c) SHA1(c7030d8b64b80e107c446f6fbdd63f560c0a91c0) ) /* vertical position med */ + ROM_LOAD( "7052-17.d3", 0x0700, 0x0100, CRC(1f8d0df3) SHA1(b8f17758f114f5e247b65b3f2922ca2660757e66) ) /* vertical position hi */ + ROM_LOAD( "7122.a19", 0x0800, 0x0400, CRC(7afc7cfc) SHA1(ba2407f6eff124e881b354f13205a4c058b7cf60) ) /* road color */ + ROM_LOAD( "7122.e7", 0x0c00, 0x0400, CRC(2f1079ee) SHA1(18a27998a78deff13dd198f3668a7e92f084f467) ) /* sprite color */ + ROM_LOAD( "7051-13.l7", 0x1000, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) ) /* video RAM address decoder (not used) */ + ROM_LOAD( "7051-14.l8", 0x1020, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) ) /* video RAM address decoder (not used) */ + + /* sound (P)ROM data */ + ROM_REGION( 0x0100, "namco", 0 ) + ROM_LOAD( "7052-5.e9", 0x0000, 0x0100, CRC(8568decc) SHA1(0aac1fa082858d4d201e21511c609a989f9a1535) ) /* Namco sound */ + + ROM_REGION( 0x6000, "52xx", 0 ) + ROM_LOAD( "tr11.b1", 0x0000, 0x2000, CRC(5b4cf05e) SHA1(52342572940489175607bbf5b6cfd05ee9b0f004) ) /* voice */ + + /* unknown or unused (P)ROM data */ + ROM_REGION( 0x0100, "user1", 0 ) + ROM_LOAD( "7052-4.c14", 0x0000, 0x0100, CRC(0e742cb1) SHA1(3ae43270aab4848fdeece1648e7e040ab216b08e) ) /* sync chain */ +ROM_END + + + /* Top Racer (bootleg without MB8841 / MB8842) CPU Lower Board (label "1081-C") @@ -2010,6 +2090,7 @@ GAME( 1982, poleposa, polepos, polepos, poleposa, driver_device, 0, GAME( 1982, polepos1, polepos, polepos, poleposa, driver_device, 0, ROT0, "Namco (Atari license)", "Pole Position (Atari version 1)", 0 ) GAME( 1984, topracer, polepos, polepos, polepos, driver_device, 0, ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, 1984)", 0 ) // the NAMCO customs have been cloned on these bootlegs GAME( 1983, topracera, polepos, polepos, polepos, driver_device, 0, ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, 1983)", 0 ) // the only difference between them is the year displayed on the title screen +GAME( 1983, ppspeed, polepos, polepos, polepos, driver_device, 0, ROT0, "bootleg", "Speed Up (Spanish bootleg of Pole Position)", 0 ) // very close to topracer / topracera GAME( 1982, topracern, polepos, topracern, topracern, polepos_state,topracern,ROT0, "bootleg", "Top Racer (no MB8841 + MB8842)", 0 ) GAME( 1983, polepos2, 0, polepos, polepos2, polepos_state, polepos2, ROT0, "Namco", "Pole Position II", 0 ) diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h index baf8e920bc0..1e2a355338e 100644 --- a/src/mame/includes/konamigx.h +++ b/src/mame/includes/konamigx.h @@ -129,13 +129,6 @@ public: /*----------- defined in video/konamigx.c -----------*/ -// 2nd-Tier GX/MW Hardware Functions - -void K053936GP_set_offset(int chip, int xoffs, int yoffs); -void K053936GP_clip_enable(int chip, int status); -void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy); - - // 1st-Tier GX/MW Variables and Functions extern UINT8 konamigx_wrport1_0, konamigx_wrport1_1; diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 5804dfd6ef6..28e12ff8d1a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -794,6 +794,7 @@ polepos1 // 136014 (c) 1982 Atari topracer // bootleg topracera // bootleg topracern // bootleg +ppspeed // bootleg polepos2 // (c) 1983 polepos2a // 136014 (c) 1983 + Atari license polepos2b // bootleg diff --git a/src/mame/video/k053936.c b/src/mame/video/k053936.c index 9c0bb038c8f..21f708bcecf 100644 --- a/src/mame/video/k053936.c +++ b/src/mame/video/k053936.c @@ -7,6 +7,16 @@ #define LOG(x) do { if (VERBOSE) logerror x; } while (0) +// Localized K053936/ROZ+ +#define K053936_MAX_CHIPS 2 + +static rectangle K053936_cliprect[K053936_MAX_CHIPS]; +static int K053936_offset[K053936_MAX_CHIPS][2] = {{0,0},{0,0}}; +static int K053936_clip_enabled[K053936_MAX_CHIPS] = {0,0}; +static int K053936_wraparound[K053936_MAX_CHIPS]; + + + /***************************************************************************/ /* */ @@ -65,13 +75,7 @@ additional control from extra RAM: */ -#define K053936_MAX_CHIPS 2 -static int K053936_offset[K053936_MAX_CHIPS][2]; -static int K053936_wraparound[K053936_MAX_CHIPS]; - -// there is another implementation of this in machine/konamigx.c (!) -// why? static void K053936_zoom_draw(int chip,UINT16 *ctrl,UINT16 *linectrl, bitmap_ind16 &bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack) { @@ -437,3 +441,281 @@ if (machine.input().code_pressed(KEYCODE_D)) } + + +void K053936GP_set_offset(int chip, int xoffs, int 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_set_cliprect(int chip, int minx, int maxx, int miny, int maxy) +{ + rectangle &cliprect = K053936_cliprect[chip]; + cliprect.set(minx, maxx, miny, maxy); +} + +INLINE void K053936GP_copyroz32clip( running_machine &machine, + bitmap_rgb32 &dst_bitmap, bitmap_ind16 &src_bitmap, + const rectangle &dst_cliprect, const rectangle &src_cliprect, + UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy, + int tilebpp, int blend, int alpha, int clip, int 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; + UINT16 *src_base; + size_t src_size; + + const pen_t *pal_base; + int dst_ptr; + int dst_size; + int dst_base2; + + int tx, dst_pitch; + UINT32 *dst_base; + int starty, incyy, startx, incyx, ty, sx, sy; + + incxy = _incxy; incxx = _incxx; incyy = _incyy; incyx = _incyx; + starty = _starty; startx = _startx; + + if (clip) // set source clip range to some extreme values when disabled + { + src_minx = src_cliprect.min_x; + src_maxx = src_cliprect.max_x; + src_miny = src_cliprect.min_y; + src_maxy = src_cliprect.max_y; + } + // this simply isn't safe to do! + else { src_minx = src_miny = -0x10000; src_maxx = src_maxy = 0x10000; } + + // set target clip range + sx = dst_cliprect.min_x; + tx = dst_cliprect.max_x - sx + 1; + sy = dst_cliprect.min_y; + ty = dst_cliprect.max_y - sy + 1; + + startx += sx * incxx + sy * incyx; + starty += sx * incxy + sy * incyy; + + // adjust entry points and other loop constants + dst_pitch = dst_bitmap.rowpixels(); + dst_base = &dst_bitmap.pix32(0); + dst_base2 = sy * dst_pitch + sx + tx; + ecx = tx = -tx; + + tilebpp = (tilebpp-1) & 7; + pal_base = machine.pens; + cmask = colormask[tilebpp]; + + src_pitch = src_bitmap.rowpixels(); + src_base = &src_bitmap.pix16(0); + src_size = src_bitmap.width() * src_bitmap.height(); + dst_size = dst_bitmap.width() * dst_bitmap.height(); + dst_ptr = 0;//dst_base; + cy = starty; + cx = startx; + + if (blend > 0) + { + dst_base += dst_pitch; // draw blended + starty += incyy; + startx += incyx; + + do { + do { + int srcx = (cx >> 16) & 0x1fff; + int srcy = (cy >> 16) & 0x1fff; + int pixel; + UINT32 offs; + offs = srcy * src_pitch + srcx; + + cx += incxx; + cy += incxy; + + if (offs>=src_size) + continue; + + if (srcx < src_minx || srcx > src_maxx || srcy < src_miny || srcy > src_maxy) + continue; + + pixel = src_base[offs]; + if (!(pixel & cmask)) + continue; + + if ((dst_ptr+ecx+dst_base2) 1) + { + ty >>= 1; + dst_pitch <<= 1; + incyy <<= 1; + incyx <<= 1; + + dst_ptr += dst_pitch; + starty = cy + incyy; + startx = cx + incyx; + } + } + + do { + do { + int srcx = (cx >> 16) & 0x1fff; + int srcy = (cy >> 16) & 0x1fff; + int pixel; + UINT32 offs; + + offs = srcy * src_pitch + srcx; + + cx += incxx; + cy += incxy; + + if (offs>=src_size) + continue; + + if (srcx < src_minx || srcx > src_maxx || srcy < src_miny || srcy > src_maxy) + continue; + + pixel = src_base[offs]; + if (!(pixel & cmask)) + continue; + + + + if ((dst_ptr+ecx+dst_base2)pixmap(); + rectangle &src_cliprect = K053936_cliprect[chip]; + clip = K053936_clip_enabled[chip]; + + if (ctrl[0x07] & 0x0040) /* "super" mode */ + { + my_clip.min_x = cliprect.min_x; + my_clip.max_x = cliprect.max_x; + y = cliprect.min_y; + maxy = cliprect.max_y; + + while (y <= maxy) + { + lineaddr = linectrl + ( ((y - K053936_offset[chip][1]) & 0x1ff) << 2); + my_clip.min_y = my_clip.max_y = y; + + startx = (INT16)(lineaddr[0] + ctrl[0x00]) << 8; + starty = (INT16)(lineaddr[1] + ctrl[0x01]) << 8; + incxx = (INT16)(lineaddr[2]); + incxy = (INT16)(lineaddr[3]); + + if (ctrl[0x06] & 0x8000) incxx <<= 8; + if (ctrl[0x06] & 0x0080) incxy <<= 8; + + startx -= K053936_offset[chip][0] * incxx; + starty -= K053936_offset[chip][0] * incxy; + + K053936GP_copyroz32clip(machine, + bitmap, src_bitmap, my_clip, src_cliprect, + startx<<5, starty<<5, incxx<<5, incxy<<5, 0, 0, + tilebpp, blend, alpha, clip, pixeldouble_output); + y++; + } + } + else /* "simple" mode */ + { + startx = (INT16)(ctrl[0x00]) << 8; + starty = (INT16)(ctrl[0x01]) << 8; + incyx = (INT16)(ctrl[0x02]); + incyy = (INT16)(ctrl[0x03]); + incxx = (INT16)(ctrl[0x04]); + incxy = (INT16)(ctrl[0x05]); + + if (ctrl[0x06] & 0x4000) { incyx <<= 8; incyy <<= 8; } + if (ctrl[0x06] & 0x0040) { incxx <<= 8; incxy <<= 8; } + + startx -= K053936_offset[chip][1] * incyx; + starty -= K053936_offset[chip][1] * incyy; + + startx -= K053936_offset[chip][0] * incxx; + starty -= K053936_offset[chip][0] * incxy; + + K053936GP_copyroz32clip(machine, + bitmap, src_bitmap, cliprect, src_cliprect, + startx<<5, starty<<5, incxx<<5, incxy<<5, incyx<<5, incyy<<5, + tilebpp, blend, alpha, clip, pixeldouble_output); + } +} + +void K053936GP_0_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, + tilemap_t *tmap, 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) +{ + if (temp_m_k053936_0_ctrl_16) + { + K053936GP_zoom_draw(machine, 0,temp_m_k053936_0_ctrl_16,temp_m_k053936_0_linectrl_16,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output); + } + else + { + K053936GP_zoom_draw(machine, 0,temp_m_k053936_0_ctrl,temp_m_k053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output); + } +} + + diff --git a/src/mame/video/k053936.h b/src/mame/video/k053936.h index 8752ba0e653..94dc274b3f6 100644 --- a/src/mame/video/k053936.h +++ b/src/mame/video/k053936.h @@ -12,13 +12,18 @@ - -extern UINT16 *K053936_0_ctrl,*K053936_0_linectrl; -//extern UINT16 *K053936_1_ctrl,*K053936_1_linectrl; void K053936_0_zoom_draw(bitmap_ind16 &bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack); void K053936_wraparound_enable(int chip, int status); void K053936_set_offset(int chip, int xoffs, int yoffs); +// GX specific implementations... +void K053936GP_set_offset(int chip, int xoffs, int yoffs); +void K053936GP_clip_enable(int chip, int status); +void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy); +void K053936GP_0_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tmap, 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); + + + struct k053936_interface { diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index e3dc4bd678c..fa7adda66b6 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -74,299 +74,6 @@ static rectangle gxtype1_roz_dstbitmapclip; static void (*game_tile_callback)(running_machine &machine, int layer, int *code, int *color, int *flags); -// Localized K053936/ROZ+ -#define K053936_MAX_CHIPS 2 - -static rectangle K053936_cliprect[K053936_MAX_CHIPS]; -static int K053936_offset[K053936_MAX_CHIPS][2] = {{0,0},{0,0}}; -static int K053936_clip_enabled[K053936_MAX_CHIPS] = {0,0}; - - -void K053936GP_set_offset(int chip, int xoffs, int 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_set_cliprect(int chip, int minx, int maxx, int miny, int maxy) -{ - rectangle &cliprect = K053936_cliprect[chip]; - cliprect.set(minx, maxx, miny, maxy); -} - -INLINE void K053936GP_copyroz32clip( running_machine &machine, - bitmap_rgb32 &dst_bitmap, bitmap_ind16 &src_bitmap, - const rectangle &dst_cliprect, const rectangle &src_cliprect, - UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy, - int tilebpp, int blend, int alpha, int clip, int 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; - UINT16 *src_base; - size_t src_size; - - const pen_t *pal_base; - int dst_ptr; - int dst_size; - int dst_base2; - - int tx, dst_pitch; - UINT32 *dst_base; - int starty, incyy, startx, incyx, ty, sx, sy; - - incxy = _incxy; incxx = _incxx; incyy = _incyy; incyx = _incyx; - starty = _starty; startx = _startx; - - if (clip) // set source clip range to some extreme values when disabled - { - src_minx = src_cliprect.min_x; - src_maxx = src_cliprect.max_x; - src_miny = src_cliprect.min_y; - src_maxy = src_cliprect.max_y; - } - // this simply isn't safe to do! - else { src_minx = src_miny = -0x10000; src_maxx = src_maxy = 0x10000; } - - // set target clip range - sx = dst_cliprect.min_x; - tx = dst_cliprect.max_x - sx + 1; - sy = dst_cliprect.min_y; - ty = dst_cliprect.max_y - sy + 1; - - startx += sx * incxx + sy * incyx; - starty += sx * incxy + sy * incyy; - - // adjust entry points and other loop constants - dst_pitch = dst_bitmap.rowpixels(); - dst_base = &dst_bitmap.pix32(0); - dst_base2 = sy * dst_pitch + sx + tx; - ecx = tx = -tx; - - tilebpp = (tilebpp-1) & 7; - pal_base = machine.pens; - cmask = colormask[tilebpp]; - - src_pitch = src_bitmap.rowpixels(); - src_base = &src_bitmap.pix16(0); - src_size = src_bitmap.width() * src_bitmap.height(); - dst_size = dst_bitmap.width() * dst_bitmap.height(); - dst_ptr = 0;//dst_base; - cy = starty; - cx = startx; - - if (blend > 0) - { - dst_base += dst_pitch; // draw blended - starty += incyy; - startx += incyx; - - do { - do { - int srcx = (cx >> 16) & 0x1fff; - int srcy = (cy >> 16) & 0x1fff; - int pixel; - UINT32 offs; - offs = srcy * src_pitch + srcx; - - cx += incxx; - cy += incxy; - - if (offs>=src_size) - continue; - - if (srcx < src_minx || srcx > src_maxx || srcy < src_miny || srcy > src_maxy) - continue; - - pixel = src_base[offs]; - if (!(pixel & cmask)) - continue; - - if ((dst_ptr+ecx+dst_base2) 1) - { - ty >>= 1; - dst_pitch <<= 1; - incyy <<= 1; - incyx <<= 1; - - dst_ptr += dst_pitch; - starty = cy + incyy; - startx = cx + incyx; - } - } - - do { - do { - int srcx = (cx >> 16) & 0x1fff; - int srcy = (cy >> 16) & 0x1fff; - int pixel; - UINT32 offs; - - offs = srcy * src_pitch + srcx; - - cx += incxx; - cy += incxy; - - if (offs>=src_size) - continue; - - if (srcx < src_minx || srcx > src_maxx || srcy < src_miny || srcy > src_maxy) - continue; - - pixel = src_base[offs]; - if (!(pixel & cmask)) - continue; - - - - if ((dst_ptr+ecx+dst_base2)pixmap(); - rectangle &src_cliprect = K053936_cliprect[chip]; - clip = K053936_clip_enabled[chip]; - - if (ctrl[0x07] & 0x0040) /* "super" mode */ - { - my_clip.min_x = cliprect.min_x; - my_clip.max_x = cliprect.max_x; - y = cliprect.min_y; - maxy = cliprect.max_y; - - while (y <= maxy) - { - lineaddr = linectrl + ( ((y - K053936_offset[chip][1]) & 0x1ff) << 2); - my_clip.min_y = my_clip.max_y = y; - - startx = (INT16)(lineaddr[0] + ctrl[0x00]) << 8; - starty = (INT16)(lineaddr[1] + ctrl[0x01]) << 8; - incxx = (INT16)(lineaddr[2]); - incxy = (INT16)(lineaddr[3]); - - if (ctrl[0x06] & 0x8000) incxx <<= 8; - if (ctrl[0x06] & 0x0080) incxy <<= 8; - - startx -= K053936_offset[chip][0] * incxx; - starty -= K053936_offset[chip][0] * incxy; - - K053936GP_copyroz32clip(machine, - bitmap, src_bitmap, my_clip, src_cliprect, - startx<<5, starty<<5, incxx<<5, incxy<<5, 0, 0, - tilebpp, blend, alpha, clip, pixeldouble_output); - y++; - } - } - else /* "simple" mode */ - { - startx = (INT16)(ctrl[0x00]) << 8; - starty = (INT16)(ctrl[0x01]) << 8; - incyx = (INT16)(ctrl[0x02]); - incyy = (INT16)(ctrl[0x03]); - incxx = (INT16)(ctrl[0x04]); - incxy = (INT16)(ctrl[0x05]); - - if (ctrl[0x06] & 0x4000) { incyx <<= 8; incyy <<= 8; } - if (ctrl[0x06] & 0x0040) { incxx <<= 8; incxy <<= 8; } - - startx -= K053936_offset[chip][1] * incyx; - starty -= K053936_offset[chip][1] * incyy; - - startx -= K053936_offset[chip][0] * incxx; - starty -= K053936_offset[chip][0] * incxy; - - K053936GP_copyroz32clip(machine, - bitmap, src_bitmap, cliprect, src_cliprect, - startx<<5, starty<<5, incxx<<5, incxy<<5, incyx<<5, incyy<<5, - tilebpp, blend, alpha, clip, pixeldouble_output); - } -} - -static void K053936GP_0_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, - tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output) -{ - konamigx_state *state = machine.driver_data(); - - if (state->m_k053936_0_ctrl_16) - { - K053936GP_zoom_draw(machine, 0,state->m_k053936_0_ctrl_16,state->m_k053936_0_linectrl_16,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output); - } - else - { - K053936GP_zoom_draw(machine, 0,state->m_k053936_0_ctrl,state->m_k053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output); - } -} - -static void K053936GP_1_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, - tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output) -{ -// konamigx_state *state = machine.driver_data(); -// K053936GP_zoom_draw(machine, 1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output); -} - - /* Parameter Notes @@ -1588,7 +1295,7 @@ void konamigx_state::konamigx_mixer(running_machine &machine, bitmap_rgb32 &bitm if (width>512) // vsnetscr case pixeldouble_output = 1; - K053936GP_0_zoom_draw(machine, bitmap, cliprect, sub1, l, k, alpha, pixeldouble_output); + K053936GP_0_zoom_draw(machine, bitmap, cliprect, sub1, l, k, alpha, pixeldouble_output, m_k053936_0_ctrl_16, m_k053936_0_linectrl_16, m_k053936_0_ctrl, m_k053936_0_linectrl); } else { @@ -1600,7 +1307,7 @@ void konamigx_state::konamigx_mixer(running_machine &machine, bitmap_rgb32 &bitm case -5: if (disp & K55_INP_SUB2) { - int alpha = 255; + //int 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 @@ -1649,8 +1356,8 @@ void konamigx_state::konamigx_mixer(running_machine &machine, bitmap_rgb32 &bitm } else { - int pixeldouble_output = 0; - K053936GP_1_zoom_draw(machine, bitmap, cliprect, sub2, l, k, alpha, pixeldouble_output); + // int pixeldouble_output = 0; + // K053936GP_1_zoom_draw(machine, bitmap, cliprect, sub2, l, k, alpha, pixeldouble_output); } } else