Merge pull request #3487 from DavidHaywood/250418

rad_eu3a14 - improve rendering for rad_foot by making more correct use of sprite registers / bits
This commit is contained in:
ajrhacker 2018-04-26 20:27:58 -04:00 committed by GitHub
commit 48dc3b3447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,6 +76,7 @@ public:
m_scrollregs(*this, "scrollregs"),
m_tilecfg(*this, "tilecfg"),
m_tilebase(*this, "tilebase"),
m_spritebase(*this, "spritebase"),
m_mainram(*this, "mainram"),
m_dmaparams(*this, "dmaparams"),
m_bank(*this, "bank"),
@ -133,6 +134,7 @@ private:
required_shared_ptr<uint8_t> m_scrollregs;
required_shared_ptr<uint8_t> m_tilecfg;
required_shared_ptr<uint8_t> m_tilebase;
required_shared_ptr<uint8_t> m_spritebase;
required_shared_ptr<uint8_t> m_mainram;
required_shared_ptr<uint8_t> m_dmaparams;
required_device<address_map_bank_device> m_bank;
@ -282,7 +284,7 @@ void radica_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitm
{
// first 4 sprite entries seem to be garbage sprites, so we start at 0x20
// likely we're just interpreting them wrong and they're used for blanking things or clipping?
for (int i = m_spriterambase; i < m_spriterambase+0x7e0; i += 8)
for (int i = m_spriterambase; i < m_spriterambase + 0x7e0; i += 8)
{
/*
+0 e--f hhww flip, enable, height, width
@ -291,7 +293,7 @@ void radica_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitm
+3 pppp ---- palette
+4 tttt tttt tile bits
+5 tttt tttt
+6 ---- ---- (more tile bits)
+6 --TT TPPP TTT = tile bank PPP = bpp select (+more?)
+7 ---- ----
*/
@ -338,62 +340,42 @@ void radica_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitm
x -= 8;
y -= 4;
// int base = 0x18000;
int offset = ((m_mainram[i + 5] << 8) + (m_mainram[i + 4] << 0));
int extra = m_mainram[i + 6];
gfx_element *gfx;
gfx = m_gfxdecode->gfx(1);
#if 0
static int test = 0x0000;
if (machine().input().code_pressed_once(KEYCODE_W))
{
test += 0x2000;
popmessage("%02x", test);
}
if (machine().input().code_pressed_once(KEYCODE_Q))
{
test -= 0x2000;
popmessage("%02x", test);
}
#endif
int spritebase = (m_spritebase[1] << 8) | m_spritebase[0];
// this probably comes from somewhere else, base register
offset += 0x8000;
offset += (extra & 0xf8) << 13;
extra &= ~0xf8;
offset += spritebase << 7;
// these additions are odd, because 0x8000 should already be coming
// from the tile bits above
// 2bpp modes, always have bit --- --x- set?
if (extra == 0x02)
switch (extra & 0x07)
{
case 0x00: // 8bpp
case 0x07: // 8bpp
offset >>= 1;
gfx = m_gfxdecode->gfx(2);
break;
case 0x02: // 2bpp
offset <<= 1;
gfx = m_gfxdecode->gfx(0);
pal = 0;
break;
case 0x04: // 4bpp
break;
case 0x01: // unknowns
case 0x03:
case 0x05:
case 0x06:
pal = machine().rand();
break;
}
if (extra == 0x0a) // bits ---- x-x-
{
offset += 0x10000;
offset <<= 1;
gfx = m_gfxdecode->gfx(0);
pal = 0;
}
// 4bpp modes, always have bit --- -x-- set?
if (extra == 0x04) // bits ---- -x--
{
//
}
if (extra == 0x0c) // bits ---- xx--
offset += 0x10000;
if (extra == 0x14) // bits ---x -x--
offset += 0x20000;
offset = offset >> 1;
if (attr & 0x80)
@ -551,7 +533,8 @@ void radica_eu3a14_state::radica_eu3a14_map(address_map &map)
map(0x5116, 0x5117).ram();
map(0x5121, 0x5124).ram().share("scrollregs");
map(0x5150, 0x5150).ram(); // startup
map(0x5151, 0x5153).ram(); // startup
map(0x5151, 0x5152).ram().share("spritebase");
map(0x5153, 0x5153).ram(); // startup
map(0x6000, 0xdfff).m(m_bank, FUNC(address_map_bank_device::amap8));