diff options
author | Angelo Salese <angelosa@users.noreply.github.com> | 2011-03-22 23:47:01 +0000 |
---|---|---|
committer | Angelo Salese <angelosa@users.noreply.github.com> | 2011-03-22 23:47:01 +0000 |
commit | 4c512a46d6ace743fa3c99fb5f93862d4ac905c5 (patch) | |
tree | b989f2befdde86e0c72d9e5333cdb4f5a441816c | |
parent | 4c1663441a601bd10caf6f80c06d024d50c70820 (diff) |
Bunch of deco 56 merging from Dave
-rw-r--r-- | src/mame/drivers/darkseal.c | 5 | ||||
-rw-r--r-- | src/mame/drivers/funkyjet.c | 4 | ||||
-rw-r--r-- | src/mame/video/darkseal.c | 73 | ||||
-rw-r--r-- | src/mame/video/decospr.c | 13 | ||||
-rw-r--r-- | src/mame/video/funkyjet.c | 70 |
5 files changed, 21 insertions, 144 deletions
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c index ff85b5f31e4..98a7258f515 100644 --- a/src/mame/drivers/darkseal.c +++ b/src/mame/drivers/darkseal.c @@ -20,7 +20,7 @@ #include "sound/2151intf.h" #include "sound/okim6295.h" #include "includes/darkseal.h" - +#include "video/decospr.h" /******************************************************************************/ @@ -250,6 +250,9 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state ) MCFG_GFXDECODE(darkseal) MCFG_PALETTE_LENGTH(2048) + MCFG_DEVICE_ADD("spritegen", decospr_, 0) + decospr_device_config::set_gfx_region(device, 3); + MCFG_VIDEO_START(darkseal) /* sound hardware */ diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c index e356e2736b9..861bc96967d 100644 --- a/src/mame/drivers/funkyjet.c +++ b/src/mame/drivers/funkyjet.c @@ -96,7 +96,7 @@ Notes: #include "sound/2151intf.h" #include "sound/okim6295.h" #include "video/deco16ic.h" - +#include "video/decospr.h" /******************************************************************************/ @@ -330,6 +330,8 @@ static MACHINE_CONFIG_START( funkyjet, funkyjet_state ) MCFG_PALETTE_LENGTH(1024) MCFG_DECO16IC_ADD("deco_custom", funkyjet_deco16ic_intf) + MCFG_DEVICE_ADD("spritegen", decospr_, 0) + decospr_device_config::set_gfx_region(device, 2); /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/video/darkseal.c b/src/mame/video/darkseal.c index 96a08d05f73..c24946689fd 100644 --- a/src/mame/video/darkseal.c +++ b/src/mame/video/darkseal.c @@ -87,8 +87,7 @@ Sprites - Data East custom chip 52 #include "emu.h" #include "includes/darkseal.h" - - +#include "video/decospr.h" /***************************************************************************/ @@ -168,72 +167,6 @@ WRITE16_HANDLER( darkseal_palette_24bit_b_w ) /******************************************************************************/ -static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect) -{ - darkseal_state *state = machine->driver_data<darkseal_state>(); - UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16; - int offs; - - for (offs = 0;offs < 0x400;offs += 4) - { - int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; - - sprite = buffered_spriteram16[offs+1] & 0x1fff; - if (!sprite) continue; - - y = buffered_spriteram16[offs]; - x = buffered_spriteram16[offs+2]; - - flash=y&0x1000; - if (flash && (machine->primary_screen->frame_number() & 1)) continue; - - colour = (x >> 9) &0x1f; - - fx = y & 0x2000; - fy = y & 0x4000; - multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 256) x -= 512; - if (y >= 256) y -= 512; - x = 240 - x; - y = 240 - y; - - if (x>256) continue; /* Speedup */ - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (state->flipscreen) - { - y=240-y; - x=240-x; - if (fx) fx=0; else fx=1; - if (fy) fy=0; else fy=1; - mult=16; - } - else mult=-16; - - while (multi >= 0) - { - drawgfx_transpen(bitmap,cliprect,machine->gfx[3], - sprite - multi * inc, - colour, - fx,fy, - x,y + mult * multi,0); - - multi--; - } - } -} - /******************************************************************************/ WRITE16_HANDLER( darkseal_pf1_data_w ) @@ -316,7 +249,9 @@ SCREEN_UPDATE( darkseal ) tilemap_draw(bitmap,cliprect,state->pf3_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,0); - draw_sprites(screen->machine,bitmap,cliprect); + + screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400); + tilemap_draw(bitmap,cliprect,state->pf1_tilemap,0,0); return 0; } diff --git a/src/mame/video/decospr.c b/src/mame/video/decospr.c index b1ee30a7837..8acb04642de 100644 --- a/src/mame/video/decospr.c +++ b/src/mame/video/decospr.c @@ -4,7 +4,7 @@ note, we have pri callbacks and checks to drop back to plain drawgfx because not all drivers are using pdrawgfx yet, they probably should be... some games have different visible areas, but are confirmed as the same sprite chip. - games with alpha aren't supported here yet, in most cases they need better mixing anyway. + games with alpha aren't supported here yet, in most cases they need better mixing anyway, probably rendering to screen buffers and manual mixing. used by: @@ -16,15 +16,18 @@ deco156.c pktgaldx.c backfire.c + darkseal.c partially converted: cninja.c (mutantf uses alpha etc.) difficult to convert: rohga.c - alpha effects, extra rom banking on the sprites etc. causes problems - - todo: - cbuster.c - needs updating to use proper priority, not multipass + lemmings.c - priority stuff + dassault.c - video mixing + deco32.c - video mixing + cbuster.c - needs updating to use proper priority (pdrawgfx), not multipass + mirage.c - needs updating to use proper priority (pdrawgfx), not multipass many more */ @@ -76,7 +79,7 @@ decospr_device::decospr_device(running_machine &_machine, const decospr_device_c void decospr_device::device_start() { // sprite_kludge_x = sprite_kludge_y = 0; - printf("decospr_device::device_start()\n"); +// printf("decospr_device::device_start()\n"); } void decospr_device::device_reset() diff --git a/src/mame/video/funkyjet.c b/src/mame/video/funkyjet.c index 900ee841087..b5752e59135 100644 --- a/src/mame/video/funkyjet.c +++ b/src/mame/video/funkyjet.c @@ -7,76 +7,10 @@ #include "emu.h" #include "includes/funkyjet.h" #include "video/deco16ic.h" +#include "video/decospr.h" /******************************************************************************/ -static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) -{ - funkyjet_state *state = machine->driver_data<funkyjet_state>(); - UINT16 *spriteram = state->spriteram; - int offs; - - for (offs = 0; offs < 0x400; offs += 4) - { - int x, y,sprite, colour, multi, fx, fy, inc, flash, mult; - - sprite = spriteram[offs + 1] & 0x3fff; - - y = spriteram[offs]; - flash = y & 0x1000; - if (flash && (machine->primary_screen->frame_number() & 1)) - continue; - - x = spriteram[offs + 2]; - colour = (x >> 9) & 0x1f; - - fx = y & 0x2000; - fy = y & 0x4000; - multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ - - x = x & 0x01ff; - y = y & 0x01ff; - if (x >= 320) x -= 512; - if (y >= 256) y -= 512; - y = 240 - y; - x = 304 - x; - - if (x > 320) - continue; - - sprite &= ~multi; - if (fy) - inc = -1; - else - { - sprite += multi; - inc = 1; - } - - if (flip_screen_get(machine)) - { - y = 240 - y; - x = 304 - x; - if (fx) fx = 0; else fx = 1; - if (fy) fy = 0; else fy = 1; - mult = 16; - } - else - mult = -16; - - while (multi >= 0) - { - drawgfx_transpen(bitmap,cliprect,machine->gfx[2], - sprite - multi * inc, - colour, - fx,fy, - x,y + mult * multi,0); - - multi--; - } - } -} - SCREEN_UPDATE( funkyjet ) { funkyjet_state *state = screen->machine->driver_data<funkyjet_state>(); @@ -88,6 +22,6 @@ SCREEN_UPDATE( funkyjet ) bitmap_fill(bitmap, cliprect, 768); deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0); - draw_sprites(screen->machine, bitmap, cliprect); + screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400); return 0; } |