diff options
author | 2015-06-24 22:32:18 +0200 | |
---|---|---|
committer | 2015-06-24 22:32:18 +0200 | |
commit | 339fa6bcc9ea78be2cb4afca58bbd9be81cb25db (patch) | |
tree | a312bdbc7c4eb0cd18aed8736ab0b6c003cf8526 /src | |
parent | 6fd6943375bd308c9e90e57ff6d2a21f694f4c3b (diff) |
Added crude sprite DMA pause feature: resuming causes sprites to be drawn above other layers.
Diffstat (limited to 'src')
-rw-r--r-- | src/mame/drivers/taitoair.c | 13 | ||||
-rw-r--r-- | src/mame/includes/taitoair.h | 4 | ||||
-rw-r--r-- | src/mame/video/taitoair.c | 51 |
3 files changed, 43 insertions, 25 deletions
diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c index f0bcc6c809d..fa679bf4576 100644 --- a/src/mame/drivers/taitoair.c +++ b/src/mame/drivers/taitoair.c @@ -316,15 +316,6 @@ WRITE16_MEMBER(taitoair_state::airsys_gradram_w) g = (g << 1) | (g & 1); b = (b << 1) | (b & 1); - /* TODO: I'm sure that normal paletteram and gradiation ram mixes in some way ... */ - //pal_r = ((m_paletteram[(offset >> 7) + 0x300] & 0x000f) >> 0) * 0x11; - //pal_g = ((m_paletteram[(offset >> 7) + 0x300] & 0x01e0) >> 5) * 0x11; - //pal_b = ((m_paletteram[(offset >> 7) + 0x300] & 0x7c00) >> 10) * 0x11; - - //if(r == 0) { r = (pal_r); } - //if(g == 0) { g = (pal_g); } - //if(b == 0) { b = (pal_b); } - m_palette->set_pen_color(offset+0x2000, r, g, b); } @@ -388,7 +379,7 @@ static ADDRESS_MAP_START( airsys_map, AS_PROGRAM, 16, taitoair_state ) AM_RANGE(0x000000, 0x0bffff) AM_ROM AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("m68000_mainram") AM_RANGE(0x140000, 0x140001) AM_WRITE(system_control_w) /* Pause the TMS32025 */ - AM_RANGE(0x180000, 0x187fff) AM_RAM_WRITE(airsys_gradram_w) AM_SHARE("gradram") /* "gradiation ram (0/1)" */ + AM_RANGE(0x180000, 0x187fff) AM_RAM_WRITE(airsys_gradram_w) AM_SHARE("gradram") /* "gradiation ram (0/1)" */ AM_RANGE(0x188000, 0x189fff) AM_MIRROR(0x2000) AM_RAM_WRITE(airsys_paletteram16_w) AM_SHARE("paletteram") AM_RANGE(0x800000, 0x820fff) AM_DEVREADWRITE("tc0080vco", tc0080vco_device, word_r, word_w) /* tilemaps, sprites */ AM_RANGE(0x906000, 0x906007) AM_RAM // DMA? @@ -688,7 +679,7 @@ static MACHINE_CONFIG_START( airsys, taitoair_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*16, 64*16) + MCFG_SCREEN_SIZE(64*16, 32*16) MCFG_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 3*16, 28*16-1) MCFG_SCREEN_UPDATE_DRIVER(taitoair_state, screen_update_taitoair) MCFG_SCREEN_PALETTE("palette") diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h index 328bfbc63cf..e7de60e9fa1 100644 --- a/src/mame/includes/taitoair.h +++ b/src/mame/includes/taitoair.h @@ -102,7 +102,9 @@ public: virtual void machine_reset(); virtual void video_start(); UINT32 screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); + int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); + int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset ); + void fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, int color, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 ); void multVecMtx(const INT16* vec4, const float* m, float* result); void airInfernoFrustum(const INT16 leftExtent, const INT16 bottomExtent, float* m); diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c index baf172fd365..acd52281e01 100644 --- a/src/mame/video/taitoair.c +++ b/src/mame/video/taitoair.c @@ -70,11 +70,20 @@ static const int zoomy_conv_table[] = Screen refresh ***************************************************************************/ -void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ) +int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) +{ + return draw_sprites(bitmap,cliprect, 0x3f8 / 2); +} + +/*! + @param start_offset DMA sprite offset source + @return value acquired by a pause flag acquisition. + */ +int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset ) { /* Y chain size is 16/32?/64/64? pixels. X chain size is always 64 pixels. */ - + //const UINT16 stop_values[4] = { 0xc00, 0, 0, 0 }; address_space &space = machine().driver_data()->generic_space(); static const int size[] = { 1, 2, 4, 4 }; int x0, y0, x, y, dx, dy, ex, ey, zx, zy; @@ -84,12 +93,19 @@ void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre int tile_offs; /* sprite chain offset */ int zoomx, zoomy; /* zoom value */ - for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) + for (offs = start_offset; offs >= 0; offs -= 0x008 / 2) { - /* TODO: remove this aberration of nature */ - if (offs < 0x01b0 && priority == 0) continue; - if (offs >= 0x01b0 && priority == 1) continue; - + /*! + Starting at a particular sequence, sprite DMA seems to stop there and resume via "something", + effectively drawing any other sprite with better priority in the framebuffer scheme of things. + + @todo reported sequence for DMA pause flag is 0x0c** 0x0000 0x0000 0x0000. + Verify how exactly via HW test. Continuing may be determined by a DMA bit write. + */ + if(m_tc0080vco->sprram_r(space, offs + 0, 0xffff) == 0xc00 || + m_tc0080vco->sprram_r(space, offs + 0, 0xffff) == 0xcff) // Air Inferno + return offs - 8/2; + x0 = m_tc0080vco->sprram_r(space, offs + 1, 0xffff) & 0x3ff; y0 = m_tc0080vco->sprram_r(space, offs + 0, 0xffff) & 0x3ff; zoomx = (m_tc0080vco->sprram_r(space, offs + 2, 0xffff) & 0x7f00) >> 8; @@ -97,6 +113,7 @@ void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre tile_offs = (m_tc0080vco->sprram_r(space, offs + 3, 0xffff) & 0x1fff) << 2; ysize = size[(m_tc0080vco->sprram_r(space, offs, 0xffff) & 0x0c00) >> 10]; + if (tile_offs) { /* Convert zoomy value to real value as zoomx */ @@ -181,6 +198,8 @@ void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre } } } + + return 0; } void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, int color, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 ) @@ -240,7 +259,12 @@ void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect if (xx2 > cliprect.max_x) xx2 = cliprect.max_x; - if(color & 0x40) + if(machine().input().code_pressed(KEYCODE_Q)) + { + base_color = machine().rand() & 0x3fff; + grad_col = 0; + } + else if(color & 0x40) { /* Non-terrain elements are colored with this. */ base_color = (color & 0x3f) + 0x340; @@ -573,6 +597,7 @@ void taitoair_state::video_start() UINT32 taitoair_state::screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { + int sprite_ptr; m_tc0080vco->tilemap_update(); UINT32 counter1 = (m_tc0430grw[0] << 16) | m_tc0430grw[1]; @@ -618,16 +643,16 @@ UINT32 taitoair_state::screen_update_taitoair(screen_device &screen, bitmap_ind1 m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); - draw_sprites(bitmap, cliprect, 0); - copybitmap_trans(bitmap, *m_framebuffer[1], 0, 0, 0, 0, cliprect, 0); + sprite_ptr = draw_sprites(bitmap, cliprect); + m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); - - draw_sprites(bitmap, cliprect, 1); - + m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0); + draw_sprites(bitmap, cliprect, sprite_ptr); + /* Hacky 3d bitmap */ //copybitmap_trans(bitmap, m_buffer3d, 0, 0, 0, 0, cliprect, 0); //m_buffer3d->fill(0, cliprect); |