Skip to content

shangha3_v.cpp: proposed fix for shangha3 drawing phantom drop shadows for player sprites #10329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/mame/sunelectronics/shangha3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ driver by Nicola Salmoria
all games:
- Blitter needs to be device-ized
shangha3:
- The zoom used for the "100" floating score when you remove tiles is very
rough.
- The zoom used for the "100" floating score when you remove tiles draws with
upper/bottom lines missing;
- identify what exactly is the "protection device";
- sometimes samples have playback drifts (btanb?);
heberpop:
- Unknown writes to sound ports 40/41
blocken:
Expand Down
14 changes: 9 additions & 5 deletions src/mame/sunelectronics/shangha3_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,19 @@ void shangha3_state::video_start()

m_screen->register_screen_bitmap(m_rawbitmap);

for (i = 0;i < 14;i++)
for (i = 0; i < 14; i++)
m_drawmode_table[i] = DRAWMODE_SOURCE;
m_drawmode_table[14] = m_do_shadows ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
m_drawmode_table[15] = DRAWMODE_NONE;

if (m_do_shadows)
{
// MAME default of 0.6 causes visible drop shadow following player cursors
m_palette->set_shadow_factor(1.0);

/* Prepare the shadow table */
for (i = 0;i < 128;i++)
m_palette->shadow_table()[i] = i+128;
for (i = 0; i < 128; i++)
m_palette->shadow_table()[i] = i + 128;
}

save_item(NAME(m_gfxlist_addr));
Expand All @@ -94,7 +97,8 @@ void shangha3_state::flipscreen_w(uint8_t data)
/* bit 7 flips screen, the rest seems to always be set to 0x7e */
flip_screen_set(data & 0x80);

if ((data & 0x7f) != 0x7e) popmessage("flipscreen_w %02x",data);
if ((data & 0x7f) != 0x7e)
popmessage("flipscreen_w %02x",data);
}

void shangha3_state::gfxlist_addr_w(offs_t offset, uint16_t data, uint16_t mem_mask)
Expand Down Expand Up @@ -183,7 +187,7 @@ void shangha3_state::blitter_go_w(uint16_t data)
{
int dx,dy,tile;

/* TODO: zooming algo is definitely wrong for Blocken here */
// TODO: zooming algo is definitely wrong for Blocken here
if (condensed)
{
int addr = ((y+srcy) & 0x1f) |
Expand Down