summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author DavidHaywood <28625134+DavidHaywood@users.noreply.github.com>2019-06-04 19:27:34 +0100
committer DavidHaywood <28625134+DavidHaywood@users.noreply.github.com>2019-06-04 19:27:34 +0100
commit42d57e58ea19f734a8aeafde96ae8e3d3b6f87d5 (patch)
treed2ceeb4f0d6baee8dd36a6ac61c44942d3b9215f /src
parenta9c01535bd03b7109cdc381efff8c10d2a0dc7d5 (diff)
eu3a14 - identify more bits
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/rad_eu3a14.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/mame/drivers/rad_eu3a14.cpp b/src/mame/drivers/rad_eu3a14.cpp
index 7b0c664f2e4..c3f74a1f661 100644
--- a/src/mame/drivers/rad_eu3a14.cpp
+++ b/src/mame/drivers/rad_eu3a14.cpp
@@ -178,8 +178,8 @@ private:
void handle_palette(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_page(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int xbase, int ybase, int size);
void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int count, int pal, int flipx, int xpos, int ypos, int gfxno);
- void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int count, int pal, int flipx, int flipy, int xpos, int ypos, int gfxno);
+ void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int drawpri);
};
@@ -430,22 +430,22 @@ void radica_eu3a14_state::draw_background(screen_device &screen, bitmap_ind16 &b
}
-void radica_eu3a14_state::draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int count, int pal, int flipx, int xpos, int ypos, int gfxno)
+void radica_eu3a14_state::draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int count, int pal, int flipx, int flipy, int xpos, int ypos, int gfxno)
{
int tileno = offset + count;
gfx_element *gfx = m_gfxdecode->gfx(gfxno);
- gfx->transpen(bitmap, cliprect, tileno, pal, flipx, 0, xpos, ypos, 0);
+ gfx->transpen(bitmap, cliprect, tileno, pal, flipx, flipy, xpos, ypos, 0);
}
-void radica_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void radica_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int drawpri)
{
// 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)
{
/*
- +0 e--f hhww flip, enable, height, width
+ +0 e-ff hhww flip yx, enable, height, width
+1 yyyy yyyy ypos
+2 xxxx xxxx xpos
+3 pppp ---- palette
@@ -464,11 +464,17 @@ void radica_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitm
int h = attr & 0x0c;
int w = attr & 0x03;
int flipx = (attr & 0x10) >> 4;
+ int flipy = (attr & 0x20) >> 5;
int height = 0;
int width = 0;
int pal = attr2 >> 4;
+ int pri = attr2 & 0x07;
+
+ if (pri != drawpri)
+ continue;
+
// no idea
if (attr2 & 0x08)
pal += 0x10;
@@ -541,9 +547,13 @@ void radica_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitm
int count = 0;
for (int yy = 0; yy < height; yy++)
{
+ int yoff = flipy ? height-1-yy : yy;
+
for (int xx = 0; xx < width; xx++)
{
- draw_sprite_line(screen, bitmap, cliprect, offset, count, pal, flipx, x + xx * 8, y + yy, gfxno);
+ int xoff = flipx ? (((width - 1) * 8) - (xx * 8)) : (xx * 8);
+
+ draw_sprite_line(screen, bitmap, cliprect, offset, count, pal, flipx, flipy, x + xoff, y + yoff, gfxno);
count++;
}
}
@@ -561,7 +571,11 @@ uint32_t radica_eu3a14_state::screen_update(screen_device &screen, bitmap_ind16
handle_palette(screen, bitmap, cliprect);
draw_background(screen, bitmap, cliprect);
- draw_sprites(screen, bitmap, cliprect);
+
+ for (int i = 0; i < 8; i++)
+ {
+ draw_sprites(screen, bitmap, cliprect, i);
+ }
return 0;
}