tatsumi.cpp: apply proper shadow sprites for Apache 3 and Round Up 5 too (nw)

This commit is contained in:
angelosa 2018-05-30 20:25:51 +02:00
parent d8a1e0da88
commit 13c65b82eb
2 changed files with 14 additions and 26 deletions

View File

@ -69,6 +69,7 @@ public:
protected: protected:
uint8_t m_hd6445_reg[64]; uint8_t m_hd6445_reg[64];
void apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap);
private: private:
uint8_t m_hd6445_address; uint8_t m_hd6445_address;
}; };
@ -164,7 +165,7 @@ protected:
// virtual void machine_reset() override; // virtual void machine_reset() override;
private: private:
void draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap); void draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect);
void draw_landscape(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t type); void draw_landscape(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t type);
required_shared_ptr<uint16_t> m_vregs; required_shared_ptr<uint16_t> m_vregs;
@ -242,5 +243,4 @@ private:
void tile_expand(); void tile_expand();
void draw_bg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *src, const uint16_t* scrollx, const uint16_t* scrolly, int xscroll_offset, int yscroll_offset, bool is_road, bool is_opaque); void draw_bg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *src, const uint16_t* scrollx, const uint16_t* scrolly, int xscroll_offset, int yscroll_offset, bool is_road, bool is_opaque);
void apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap);
}; };

View File

@ -701,7 +701,7 @@ start_offset-=48;
} }
} }
void roundup5_state::draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap) void roundup5_state::draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
/* /*
0xf980 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess) 0xf980 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess)
@ -827,10 +827,6 @@ offset is from last pixel of first road segment?
for (x=0; (x < startPos) && (x < cliprect.max_x+1); x++) for (x=0; (x < startPos) && (x < cliprect.max_x+1); x++)
{ {
int col = linedata[0]&0xf; int col = linedata[0]&0xf;
uint8_t shadow=shadow_bitmap.pix8(y, x);
if (shadow)
bitmap.pix32(y, x) = m_palette->pen(768 + pal*16 + col);
else
bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col); bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col);
} }
@ -850,15 +846,11 @@ offset is from last pixel of first road segment?
{ {
// look up colour // look up colour
int col = linedata[(samplePos>>11)&0x7f]&0xf; int col = linedata[(samplePos>>11)&0x7f]&0xf;
uint8_t shadow=shadow_bitmap.pix8(y, x);
/* Clamp if we have reached the end of the pixel data */ /* Clamp if we have reached the end of the pixel data */
//if ((samplePos>>11) > 0x7f) //if ((samplePos>>11) > 0x7f)
// col=linedata[0x7f]&0xf; // col=linedata[0x7f]&0xf;
if (shadow)
bitmap.pix32(y, x) = m_palette->pen(768 + pal*16 + col);
else
bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col); bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col);
samplePos+=step; samplePos+=step;
@ -882,15 +874,11 @@ offset is from last pixel of first road segment?
for (x=startPos; x < (cliprect.max_x+1) && (x < endPos); x++) for (x=startPos; x < (cliprect.max_x+1) && (x < endPos); x++)
{ {
int col = linedata[0x80]&0xf; int col = linedata[0x80]&0xf;
uint8_t shadow=shadow_bitmap.pix8(y, x);
/* Clamp if we have reached the end of the pixel data */ /* Clamp if we have reached the end of the pixel data */
//if ((samplePos>>11) > 0x7f) //if ((samplePos>>11) > 0x7f)
// col=linedata[0x7f]&0xf; // col=linedata[0x7f]&0xf;
if (shadow)
bitmap.pix32(y, x) = m_palette->pen(768 + pal*16 + col + 32);
else
bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col + 32); bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col + 32);
} }
@ -911,15 +899,11 @@ offset is from last pixel of first road segment?
{ {
// look up colour // look up colour
int col = linedata[((samplePos>>11)&0x7f) + 0x200]&0xf; int col = linedata[((samplePos>>11)&0x7f) + 0x200]&0xf;
uint8_t shadow=shadow_bitmap.pix8(y, x);
/* Clamp if we have reached the end of the pixel data */ /* Clamp if we have reached the end of the pixel data */
if ((samplePos>>11) > 0x7f) if ((samplePos>>11) > 0x7f)
col=linedata[0x7f + 0x200]&0xf; col=linedata[0x7f + 0x200]&0xf;
if (shadow)
bitmap.pix32(y, x) = m_palette->pen(768 + pal*16 + col + 32);
else
bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col + 32); bitmap.pix32(y, x) = m_palette->pen(256 + pal*16 + col + 32);
samplePos+=step; samplePos+=step;
@ -1111,7 +1095,10 @@ uint32_t apache3_state::screen_update_apache3(screen_device &screen, bitmap_rgb3
m_tx_layer->set_scrollx(0,24); m_tx_layer->set_scrollx(0,24);
bitmap.fill(m_palette->pen(0), cliprect); bitmap.fill(m_palette->pen(0), cliprect);
screen.priority().fill(0, cliprect);
draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only
draw_sky(bitmap, cliprect, 256, m_apache3_rotate_ctrl[1]); draw_sky(bitmap, cliprect, 256, m_apache3_rotate_ctrl[1]);
apply_shadow_bitmap(bitmap,cliprect,screen.priority());
// draw_ground(bitmap, cliprect); // draw_ground(bitmap, cliprect);
draw_sprites(bitmap,cliprect,0, (m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0); draw_sprites(bitmap,cliprect,0, (m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0);
m_tx_layer->draw(screen, bitmap, cliprect, 0,0); m_tx_layer->draw(screen, bitmap, cliprect, 0,0);
@ -1135,7 +1122,8 @@ uint32_t roundup5_state::screen_update_roundup5(screen_device &screen, bitmap_rg
draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only
draw_landscape(bitmap,cliprect,0); draw_landscape(bitmap,cliprect,0);
draw_landscape(bitmap,cliprect,1); draw_landscape(bitmap,cliprect,1);
draw_road(bitmap,cliprect,screen.priority()); draw_road(bitmap,cliprect);
apply_shadow_bitmap(bitmap,cliprect,screen.priority());
if(m_control_word & 0x80) // enabled on map screen after a play if(m_control_word & 0x80) // enabled on map screen after a play
{ {
m_tx_layer->draw(screen, bitmap, cliprect, 0,0); m_tx_layer->draw(screen, bitmap, cliprect, 0,0);
@ -1149,7 +1137,7 @@ uint32_t roundup5_state::screen_update_roundup5(screen_device &screen, bitmap_rg
return 0; return 0;
} }
void cyclwarr_state::apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap) void tatsumi_state::apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap)
{ {
for(int y=cliprect.min_y;y<cliprect.max_y;y++) for(int y=cliprect.min_y;y<cliprect.max_y;y++)
{ {