summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author DavidHaywood <28625134+DavidHaywood@users.noreply.github.com>2018-09-05 00:20:39 +0100
committer Vas Crabb <cuavas@users.noreply.github.com>2018-09-05 17:00:41 +1000
commite10af629f31fdc755dee56763548e53ee0d58bc5 (patch)
tree70ca6082ad4594228b137e92a9c8358a70533896
parent6d9e304150aee115c7c8a506c0369fc1ca68b34d (diff)
seta001 remove a kludge
-rw-r--r--src/mame/drivers/champbwl.cpp4
-rw-r--r--src/mame/drivers/thedealr.cpp2
-rw-r--r--src/mame/includes/seta.h2
-rw-r--r--src/mame/video/seta.cpp16
-rw-r--r--src/mame/video/seta001.cpp82
-rw-r--r--src/mame/video/seta001.h4
-rw-r--r--src/mame/video/srmp2.cpp6
-rw-r--r--src/mame/video/tnzs.cpp2
8 files changed, 79 insertions, 39 deletions
diff --git a/src/mame/drivers/champbwl.cpp b/src/mame/drivers/champbwl.cpp
index c8fca73d700..f6120b790c8 100644
--- a/src/mame/drivers/champbwl.cpp
+++ b/src/mame/drivers/champbwl.cpp
@@ -478,7 +478,7 @@ uint32_t champbwl_state::screen_update_champbwl(screen_device &screen, bitmap_in
m_seta001->set_fg_yoffsets( -0x12, 0x0e );
m_seta001->set_bg_yoffsets( 0x1, -0x1 );
- m_seta001->draw_sprites(screen, bitmap, cliprect, 0x800, 1 );
+ m_seta001->draw_sprites(screen, bitmap, cliprect, 0x800);
return 0;
}
@@ -539,7 +539,7 @@ uint32_t champbwl_state::screen_update_doraemon(screen_device &screen, bitmap_in
m_seta001->set_bg_yoffsets( 0x00, 0x01 );
m_seta001->set_fg_yoffsets( 0x00, 0x10 );
- m_seta001->draw_sprites(screen, bitmap, cliprect, 0x800, 1 );
+ m_seta001->draw_sprites(screen, bitmap, cliprect, 0x800);
return 0;
}
diff --git a/src/mame/drivers/thedealr.cpp b/src/mame/drivers/thedealr.cpp
index 018b6bf46cb..9a9e82dc927 100644
--- a/src/mame/drivers/thedealr.cpp
+++ b/src/mame/drivers/thedealr.cpp
@@ -114,7 +114,7 @@ uint32_t thedealr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
m_seta001->set_bg_yoffsets( 0x11+1, -0x10 ); // + is up (down with flip)
m_seta001->set_fg_yoffsets( -0x12+1, -0x01 );
- m_seta001->draw_sprites(screen, bitmap, cliprect, 0x1000, 1);
+ m_seta001->draw_sprites(screen, bitmap, cliprect, 0x1000);
return 0;
}
diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h
index 3e7a5e33678..efd2913d2cc 100644
--- a/src/mame/includes/seta.h
+++ b/src/mame/includes/seta.h
@@ -304,7 +304,7 @@ protected:
void set_pens();
void usclssic_set_pens();
void draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen);
- void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size, int sprite_setac );
+ void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size);
void rearrange_gfx();
void uPD71054_timer_init( );
DECLARE_WRITE_LINE_MEMBER(pit_out0);
diff --git a/src/mame/video/seta.cpp b/src/mame/video/seta.cpp
index 3c13018f99f..7e863aabb09 100644
--- a/src/mame/video/seta.cpp
+++ b/src/mame/video/seta.cpp
@@ -734,13 +734,13 @@ uint32_t seta_state::screen_update_seta_no_layers(screen_device &screen, bitmap_
set_pens();
bitmap.fill(0x1f0, cliprect);
- m_seta001->draw_sprites(screen, bitmap,cliprect,0x1000, 1);
+ m_seta001->draw_sprites(screen, bitmap,cliprect,0x1000);
return 0;
}
/* For games with 1 or 2 tilemaps */
-void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size, int sprite_setac )
+void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size )
{
const rectangle &visarea = screen.visible_area();
int vis_dimy = visarea.max_y - visarea.min_y + 1;
@@ -833,7 +833,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap,
if (order & 2) // layer-sprite priority?
{
- if (layers_ctrl & 8) m_seta001->draw_sprites(screen, bitmap,cliprect,sprite_bank_size, sprite_setac);
+ if (layers_ctrl & 8) m_seta001->draw_sprites(screen, bitmap,cliprect,sprite_bank_size);
if (order & 4)
{
@@ -851,7 +851,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap,
if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0);
- if (layers_ctrl & 8) m_seta001->draw_sprites(screen, bitmap,cliprect,sprite_bank_size, sprite_setac);
+ if (layers_ctrl & 8) m_seta001->draw_sprites(screen, bitmap,cliprect,sprite_bank_size);
}
}
else
@@ -860,7 +860,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap,
if (order & 2) // layer-sprite priority?
{
- if (layers_ctrl & 8) m_seta001->draw_sprites(screen, bitmap,cliprect,sprite_bank_size, sprite_setac);
+ if (layers_ctrl & 8) m_seta001->draw_sprites(screen, bitmap,cliprect,sprite_bank_size);
if ((order & 4) && m_paletteram[1] != nullptr)
{
@@ -898,7 +898,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap,
}
}
- if (layers_ctrl & 8) m_seta001->draw_sprites(screen,bitmap,cliprect,sprite_bank_size, sprite_setac);
+ if (layers_ctrl & 8) m_seta001->draw_sprites(screen,bitmap,cliprect,sprite_bank_size);
}
}
@@ -906,7 +906,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap,
uint32_t seta_state::screen_update_seta_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- seta_layers_update(screen, bitmap, cliprect, 0x1000, 1 );
+ seta_layers_update(screen, bitmap, cliprect, 0x1000 );
return 0;
}
@@ -916,7 +916,7 @@ uint32_t setaroul_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
bitmap.fill(0x0, cliprect);
if (m_led & 0x80)
- seta_layers_update(screen, bitmap, cliprect, 0x800, 1 );
+ seta_layers_update(screen, bitmap, cliprect, 0x800 );
return 0;
}
diff --git a/src/mame/video/seta001.cpp b/src/mame/video/seta001.cpp
index 4571a375b2a..3fb9c3f7c18 100644
--- a/src/mame/video/seta001.cpp
+++ b/src/mame/video/seta001.cpp
@@ -24,6 +24,12 @@
'y' low bits are NEVER buffered?
+ TODO:
+ use getter callbacks in drivers for spriterams rather than allocating memory
+ here, then we won't have to allocate extra memory for seta.cpp games which
+ appear to have 0x800 bytes of RAM that isn't connceted to the sprite chip
+ between the banks.
+
*/
#include "emu.h"
@@ -45,9 +51,28 @@ void seta001_device::device_start()
m_spritecodelow = std::make_unique<uint8_t[]>(0x2000);
m_spritecodehigh = std::make_unique<uint8_t[]>(0x2000);
- // chukatai draws a column on the left from uninitialized RAM which causes garbage in a debug build
- // if we initialize ram this is a single line in the top left instead.
- // maybe there is less RAM actually present and it should mirror, or there is another flaw?
+ /* chukatai draws a column on the left from uninitialized RAM which causes garbage
+
+ the reason for this is because the m_spriteylow only gets populated from 0x000 to 0x17d
+ with the remainder of the ram (0x17e - 0x1ff) never being written to.
+
+ If we initialize ram to 0xff it has a single line in the top left instead, but
+ the PCB has no error at all, initializing to 0xf8 is better, but unlikely from a hardware
+ perspective.
+
+ jjsquawk has a garbage tile in the bottom left instead, but in this case the entire
+ m_spriteylow is initalized (to 0), but sprite entry 0 for the other tables is never
+ written to, again meaning it picks up whatever we clear the RAM to as positional
+ values.
+
+ we can't simply skip sprite 0 as other games (mostly tnzs.cpp ones, eg. kabukiz) rely
+ on it being rendered, even if a number of seta.cpp games specifically avoid it.
+
+ maybe other components on the board determine the sprite start / end limits on a per
+ game basis?
+
+ */
+
memset(m_spritectrl,0xff,4);
memset(m_spriteylow.get(),0xff,0x300);
memset(m_spritecodelow.get(),0xff,0x2000);
@@ -178,6 +203,9 @@ WRITE8_MEMBER( seta001_device::spritebgflag_w8 )
***************************************************************************/
/*
+
+these mostly seem to be controlling the tilemap part of the chip
+
twineagl: 10 2d 0f 10 (ship)
tndrcade: 58 2d 07 18 (start of game - yes, flip on!)
arbalest: 18 2d 0f 10 (logo)
@@ -191,12 +219,31 @@ oisipuzl: 59 20 00 00 (game - yes, flip on!)
superman: 10 21 07 38 (game)
twineagl: 00 27 00 0f (test mode)
doraemon: 19 2a 00 03 (always)
+srmp2: 1e 20 xx xx
+tnzs: 1a 20 xx xx
+
+format
+ byte 0 byte 1 byte 2 byte3
+ -f-e uUss -Bb- cccc ---- ---- ---- ----
+
+ f = flipy
+ e = possible enable (only disabled in twineagl test mode? check if it needs sprites)
+ u = sometimes set
+ U = sometimes set (srmp2)
+ s = start column
+ B = buffering control - toggles often (kabukiz doesn't seem to use these like the other games)
+ b = buffering control
+ c = number of columns, 0x0 = disabled, 0x01 = 16 columns 0x2 = 2 coluns ... 0xf = 15 columns
+
+ bytes 2 and 3 get set in a bitwize way in the tnzs driver games while horizontal scrolling happens, dependong on how
+ far we've scrolled, what they actually do is unclear.
+
*/
-void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size, int setac_type)
+void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size)
{
int transpen;
@@ -222,18 +269,14 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli
int const max_y = 0xf0;
- // HACKS
- // used in conjunction with setac_type
- int col0; /* Kludge, needed for krzybowl and kiwame */
- switch (ctrl & 0x0f)
- {
- case 0x01: col0 = 0x4; break; // krzybowl
- case 0x09: col0 = 0x4; break; // doraemon
- case 0x06: col0 = 0x8; break; // kiwame
-
- default: col0 = 0x0;
- }
+ int startcol = 0;
+
+ if (ctrl & 0x01)
+ startcol += 0x4;
+ if (ctrl & 0x02)
+ startcol += 0x8;
+
xoffs = flip ? m_bg_flipxoffs : m_bg_noflipxoffs;
yoffs = flip ? m_bg_flipyoffs : m_bg_noflipyoffs;
@@ -255,10 +298,7 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli
/* draw this column */
for ( offs = 0 ; offs < 0x20; offs += 1 )
{
- int i;
- // HACKS
- if (setac_type) i = ((col+col0)&0xf) * 32 + offs;
- else i = 32 * (col ^ 8) + 2 * (offs>>1) + (offs&1);
+ int i = ((col+startcol)&0xf) * 32 + offs;
int code = ((m_spritecodehigh[i+0x400+bank]) << 8) | m_spritecodelow[i+0x400+bank];
int color =((m_spritecodehigh[i+0x600+bank]) << 8) | m_spritecodelow[i+0x600+bank];
@@ -450,8 +490,8 @@ void seta001_device::tnzs_eof( void )
}
-void seta001_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size, int setac)
+void seta001_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size)
{
- draw_background(bitmap, cliprect, bank_size, setac);
+ draw_background(bitmap, cliprect, bank_size);
draw_foreground(screen, bitmap, cliprect, bank_size);
}
diff --git a/src/mame/video/seta001.h b/src/mame/video/seta001.h
index d3f69cb27e5..07753a8a02a 100644
--- a/src/mame/video/seta001.h
+++ b/src/mame/video/seta001.h
@@ -40,7 +40,7 @@ public:
DECLARE_READ16_MEMBER( spritecode_r16 );
DECLARE_WRITE16_MEMBER( spritecode_w16 );
- void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size, int setac);
+ void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size);
void setac_eof( void );
void tnzs_eof( void );
@@ -63,7 +63,7 @@ protected:
private:
- void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size, int setac_type);
+ void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size);
void draw_foreground( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size);
required_device<gfxdecode_device> m_gfxdecode;
diff --git a/src/mame/video/srmp2.cpp b/src/mame/video/srmp2.cpp
index d4910174fcd..4db1c9bb957 100644
--- a/src/mame/video/srmp2.cpp
+++ b/src/mame/video/srmp2.cpp
@@ -58,7 +58,7 @@ uint32_t srmp2_state::screen_update_srmp2(screen_device &screen, bitmap_ind16 &b
m_seta001->set_bg_xoffsets( 0x00, 0x00 ); // bg not used?
m_seta001->set_bg_yoffsets( 0x00, 0x00 ); // bg not used?
- m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000, 1);
+ m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000);
return 0;
}
@@ -71,7 +71,7 @@ uint32_t srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &b
m_seta001->set_bg_xoffsets( -0x01, 0x10 );
m_seta001->set_bg_yoffsets( -0x06, 0x06 );
- m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000, 1);
+ m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000);
return 0;
}
@@ -85,6 +85,6 @@ uint32_t srmp2_state::screen_update_mjyuugi(screen_device &screen, bitmap_ind16
m_seta001->set_spritelimit( 0x1ff-6 );
- m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000, 1);
+ m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000);
return 0;
}
diff --git a/src/mame/video/tnzs.cpp b/src/mame/video/tnzs.cpp
index 65e11063e5d..159f953e58d 100644
--- a/src/mame/video/tnzs.cpp
+++ b/src/mame/video/tnzs.cpp
@@ -50,7 +50,7 @@ uint32_t tnzs_base_state::screen_update_tnzs(screen_device &screen, bitmap_ind16
m_seta001->set_fg_yoffsets( -0x12, 0x0e );
m_seta001->set_bg_yoffsets( 0x1, -0x1 );
- m_seta001->draw_sprites(screen, bitmap, cliprect, 0x800, 0 );
+ m_seta001->draw_sprites(screen, bitmap, cliprect, 0x800);
return 0;
}