summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2022-08-30 15:17:42 +0200
committer hap <happppp@users.noreply.github.com>2022-08-30 15:17:42 +0200
commit1e986616209690a60c0213fe5febf75e9651b6fe (patch)
tree5f64f3589b72a13720f902ef0e798bfb01942a22
parentc465a1816de23c08ab9f89579e48494058371940 (diff)
zerohour: bullet width is software controlled
-rw-r--r--src/mame/universal/getaway.cpp4
-rw-r--r--src/mame/universal/ladybug_video.cpp26
-rw-r--r--src/mame/universal/zerohour.cpp26
3 files changed, 35 insertions, 21 deletions
diff --git a/src/mame/universal/getaway.cpp b/src/mame/universal/getaway.cpp
index e4197c15a07..b696b37e266 100644
--- a/src/mame/universal/getaway.cpp
+++ b/src/mame/universal/getaway.cpp
@@ -21,7 +21,7 @@ located covered with a panel. The dumped set seems to be designed for this
cabinet.
English-language flyers show a sit-down cabinet with a gear shift lever,
-accelerator pedal, and digital displays for high scores. The set dumped set
+accelerator pedal, and digital displays for high scores. The dumped set
doesn't have support for the additional I/O.
TODO:
@@ -207,7 +207,7 @@ void getaway_state::io_w(offs_t offset, u8 data)
[0x07]
???w wwww transfer width, in 8 pixel units
- Notice that 0xff is set on POST, either full clear or NOP
+ Notice that 0xff is set on POST, either full clear or NOP
[0x08]
hhhh hhhh transfer height, in scanline units
diff --git a/src/mame/universal/ladybug_video.cpp b/src/mame/universal/ladybug_video.cpp
index 2d5791ce445..82751ba3267 100644
--- a/src/mame/universal/ladybug_video.cpp
+++ b/src/mame/universal/ladybug_video.cpp
@@ -75,22 +75,23 @@ void ladybug_video_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &c
while (0 < i)
{
+ i -= 4;
+
/*
abccdddd eeeeeeee fffghhhh iiiiiiii
- a enable?
- b size (0 = 8x8, 1 = 16x16)
- cc flip
- dddd y offset
- eeeeeeee sprite code (shift right 2 bits for 16x16 sprites)
- fff unknown
- g sprite bank
- hhhh color
- iiiiiiii x position
+ a: enable?
+ b: size (0 = 8x8, 1 = 16x16)
+ c: flip
+ d: fine-y (coarse-y is from offset)
+ e: sprite code (shift right 2 bits for 16x16 sprites)
+ f: unknown
+ g: sprite bank
+ h: color
+ i: x position
*/
- i -= 4;
- bool const enable(m_spr_ram[offs + i] & 0x80);
- if (enable)
+
+ if (m_spr_ram[offs + i] & 0x80)
{
bool const big(m_spr_ram[offs + i] & 0x40);
bool const xflip(m_spr_ram[offs + i] & 0x20);
@@ -99,6 +100,7 @@ void ladybug_video_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &c
int const color(m_spr_ram[offs + i + 2] & 0x0f);
int const xpos(m_spr_ram[offs + i + 3]);
int const ypos((offs >> 2) | (m_spr_ram[offs + i] & 0x0f));
+
if (big) // 16x16
m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code >> 2, color, xflip, yflip, xpos, ypos - 8, 0);
else // 8x8
diff --git a/src/mame/universal/zerohour.cpp b/src/mame/universal/zerohour.cpp
index f2d8fcaad3e..d44b4ea30c5 100644
--- a/src/mame/universal/zerohour.cpp
+++ b/src/mame/universal/zerohour.cpp
@@ -17,9 +17,6 @@ TODO:
scrolling at the same speed as the stars, it's used in canyon parts and during the
big ufo explosion
- redclash canyon level, a gap sometimes appears on the right side, maybe BTANB
-- According to video reference(could only find 1), redclash player bullets should be
- 4*2px red on the 1st half of the screen and 8*2px yellow on the 2nd half, zerohour
- bullets are correct though(always 8*2px magenta)
- Sound (analog, schematics available for Zero Hour), redclash sound is not the same
- redclash beeper frequency range should be higher, but it doesn't really matter
since it can't be solved with a simple multiply calculation. Besides, anything more
@@ -327,11 +324,22 @@ void zerohour_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
{
i -= 4;
+ /*
+ e-sssyyy iiiiiiii --c--ccc xxxxxxxx
+
+ e: enable?
+ i: code (some bits unused for large sprites)
+ s: size (0x20 only applies to size 16x16)
+ c: color
+ x: x position
+ y: fine-y (coarse-y is from offset)
+ */
+
if (m_spriteram[offs + i] & 0x80)
{
- int color = bitswap<4>(m_spriteram[offs + i + 2], 5,2,1,0);
int sx = m_spriteram[offs + i + 3];
int sy = offs / 4 + (m_spriteram[offs + i] & 0x07) - 16;
+ int color = bitswap<4>(m_spriteram[offs + i + 2], 5,2,1,0);
int bank = 0, code = 0;
switch ((m_spriteram[offs + i] & 0x18) >> 3)
@@ -344,8 +352,8 @@ void zerohour_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
case 2: // 16x16
if (m_spriteram[offs + i] & 0x20) // zero hour spaceships
{
- code = ((m_spriteram[offs + i + 1] & 0xf8) >> 3) + ((m_gfxbank & 1) << 5);
bank = 4 + ((m_spriteram[offs + i + 1] & 0x02) >> 1);
+ code = ((m_spriteram[offs + i + 1] & 0xf8) >> 3) + ((m_gfxbank & 1) << 5);
}
else
{
@@ -382,6 +390,10 @@ void zerohour_state::draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprec
int sx = 8 * offs + 8;
int sy = 0xff - m_videoram[offs + 0x20];
+ // width and color are from the same bitfield
+ int width = 8 - (m_videoram[offs] >> 5 & 6);
+ int color = (m_videoram[offs] >> 3 & 0x10) | 5;
+
if (flip_screen())
sx = 264 - sx;
@@ -389,10 +401,10 @@ void zerohour_state::draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprec
sx -= fine_x;
for (int y = 0; y < 2; y++)
- for (int x = 0; x < 8; x++)
+ for (int x = 0; x < width; x++)
{
if (cliprect.contains(sx + x, sy - y))
- bitmap.pix(sy - y, sx + x) = 0x3f;
+ bitmap.pix(sy - y, sx + x) = color;
}
}