summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers')
-rw-r--r--src/mame/drivers/1945kiii.cpp6
-rw-r--r--src/mame/drivers/acefruit.cpp2
-rw-r--r--src/mame/drivers/aquarium.cpp8
-rw-r--r--src/mame/drivers/bzone.cpp28
-rw-r--r--src/mame/drivers/coolridr.cpp6
-rw-r--r--src/mame/drivers/cps3.cpp10
-rw-r--r--src/mame/drivers/gamecstl.cpp2
-rw-r--r--src/mame/drivers/gstream.cpp421
-rw-r--r--src/mame/drivers/hp9k.cpp2
-rw-r--r--src/mame/drivers/lucky37.cpp194
-rw-r--r--src/mame/drivers/lucky74.cpp6
-rw-r--r--src/mame/drivers/mediagx.cpp4
-rw-r--r--src/mame/drivers/mindset.cpp35
-rw-r--r--src/mame/drivers/mpu4vid.cpp2
-rw-r--r--src/mame/drivers/pinball2k.cpp4
-rw-r--r--src/mame/drivers/pk8020.cpp29
-rw-r--r--src/mame/drivers/poly88.cpp34
-rw-r--r--src/mame/drivers/saitek_stratos.cpp263
-rw-r--r--src/mame/drivers/sb8085.cpp312
-rw-r--r--src/mame/drivers/scyclone.cpp10
-rw-r--r--src/mame/drivers/slapshot.cpp8
-rw-r--r--src/mame/drivers/supstarf.cpp54
-rw-r--r--src/mame/drivers/taito_f2.cpp8
-rw-r--r--src/mame/drivers/taito_f3.cpp16
-rw-r--r--src/mame/drivers/zwackery.cpp8
25 files changed, 1129 insertions, 343 deletions
diff --git a/src/mame/drivers/1945kiii.cpp b/src/mame/drivers/1945kiii.cpp
index ca2b22d41c5..a17c8ad962a 100644
--- a/src/mame/drivers/1945kiii.cpp
+++ b/src/mame/drivers/1945kiii.cpp
@@ -129,7 +129,7 @@ void k3_state::k3_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_eleme
{
/* Start drawing */
const u16 pal = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
- const u16 *source_base = gfx->get_data(code % gfx->elements());
+ const u8 *source_base = gfx->get_data(code % gfx->elements());
int xinc = flipx ? -1 : 1;
int yinc = flipy ? -1 : 1;
@@ -171,12 +171,12 @@ void k3_state::k3_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_eleme
{ // skip if inner loop doesn't draw anything
for (int y = sy; y < ey; y++)
{
- const u16 *source = source_base + y_index * gfx->rowbytes();
+ const u8 *source = source_base + y_index * gfx->rowbytes();
u16 *dest = &dest_bmp.pix16(y);
int x_index = x_index_base;
for (int x = sx; x < ex; x++)
{
- const u16 c = source[x_index];
+ u8 c = source[x_index];
if (c != transparent_color)
{
if (flicker) // verified from PCB (reference : https://www.youtube.com/watch?v=ooXyyvpW1O0)
diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp
index 7982b28ee9c..c3ebc08de7b 100644
--- a/src/mame/drivers/acefruit.cpp
+++ b/src/mame/drivers/acefruit.cpp
@@ -179,7 +179,7 @@ uint32_t acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_in
for( x = 0; x < 16; x++ )
{
int sprite = ( m_spriteram[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf;
- const uint16_t *gfxdata = gfx->get_data(sprite);
+ const uint8_t *gfxdata = gfx->get_data(sprite);
for( y = 0; y < 8; y++ )
{
diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp
index b04b04270d6..0a18960d945 100644
--- a/src/mame/drivers/aquarium.cpp
+++ b/src/mame/drivers/aquarium.cpp
@@ -341,14 +341,14 @@ void aquarium_state::expand_gfx(int low, int hi)
u8 *dest = srcdata;
for (int c = 0; c < gfx_l->elements(); c++)
{
- const u16 *c0base = gfx_l->get_data(c);
- const u16 *c1base = gfx_h->get_data(c);
+ const u8 *c0base = gfx_l->get_data(c);
+ const u8 *c1base = gfx_h->get_data(c);
// loop over height
for (int y = 0; y < gfx_l->height(); y++)
{
- const u16 *c0 = c0base;
- const u16 *c1 = c1base;
+ const u8 *c0 = c0base;
+ const u8 *c1 = c1base;
for (int x = 0; x < gfx_l->width(); x++)
{
diff --git a/src/mame/drivers/bzone.cpp b/src/mame/drivers/bzone.cpp
index ea90f27e544..cc8fc1e7753 100644
--- a/src/mame/drivers/bzone.cpp
+++ b/src/mame/drivers/bzone.cpp
@@ -242,7 +242,7 @@ void redbaron_state::machine_start()
void redbaron_state::machine_reset()
{
- earom_control_w(machine().dummy_space(), 0, 0);
+ earom_control_w(0);
}
@@ -273,7 +273,7 @@ CUSTOM_INPUT_MEMBER(bzone_state::clock_r)
}
-WRITE8_MEMBER(bzone_state::bzone_coin_counter_w)
+void bzone_state::bzone_coin_counter_w(offs_t offset, uint8_t data)
{
machine().bookkeeping().coin_counter_w(offset,data);
}
@@ -286,15 +286,15 @@ WRITE8_MEMBER(bzone_state::bzone_coin_counter_w)
*
*************************************/
-READ8_MEMBER(redbaron_state::redbaron_joy_r)
+uint8_t redbaron_state::redbaron_joy_r()
{
return m_fake_ports[m_rb_input_select ? 0 : 1]->read();
}
-WRITE8_MEMBER(redbaron_state::redbaron_joysound_w)
+void redbaron_state::redbaron_joysound_w(uint8_t data)
{
m_rb_input_select = data & 1;
- m_redbaronsound->sounds_w(space, offset, data);
+ m_redbaronsound->sounds_w(data);
}
@@ -305,18 +305,18 @@ WRITE8_MEMBER(redbaron_state::redbaron_joysound_w)
*
*************************************/
-READ8_MEMBER(redbaron_state::earom_read)
+uint8_t redbaron_state::earom_read()
{
return m_earom->data();
}
-WRITE8_MEMBER(redbaron_state::earom_write)
+void redbaron_state::earom_write(offs_t offset, uint8_t data)
{
m_earom->set_address((offset ^ 0x20) & 0x3f);
m_earom->set_data(data);
}
-WRITE8_MEMBER(redbaron_state::earom_control_w)
+void redbaron_state::earom_control_w(uint8_t data)
{
// CK = EDB0, C1 = /EDB2, C2 = EDB1, CS1 = EDB3, /CS2 = GND
m_earom->set_control(BIT(data, 3), 1, !BIT(data, 2), BIT(data, 1));
@@ -369,10 +369,10 @@ void redbaron_state::redbaron_map(address_map &map)
map(0x1806, 0x1806).r("mathbox", FUNC(mathbox_device::hi_r));
map(0x1808, 0x1808).w(FUNC(redbaron_state::redbaron_joysound_w)); /* and select joystick pot also */
map(0x180a, 0x180a).nopw(); /* sound reset, yet todo */
- map(0x180c, 0x180c).w(FUNC(redbaron_state::earom_control_w));
+ map(0x180c, 0x180c).nopr().w(FUNC(redbaron_state::earom_control_w));
map(0x1810, 0x181f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x1820, 0x185f).rw(FUNC(redbaron_state::earom_read), FUNC(redbaron_state::earom_write));
- map(0x1860, 0x187f).w("mathbox", FUNC(mathbox_device::go_w));
+ map(0x1860, 0x187f).nopr().w("mathbox", FUNC(mathbox_device::go_w));
map(0x2000, 0x2fff).ram().share("avg:vectorram").region("maincpu", 0x2000);
map(0x3000, 0x7fff).rom();
}
@@ -875,13 +875,13 @@ ROM_END
*
*************************************/
-READ8_MEMBER(bzone_state::analog_data_r)
+uint8_t bzone_state::analog_data_r()
{
return m_analog_data;
}
-WRITE8_MEMBER(bzone_state::analog_select_w)
+void bzone_state::analog_select_w(offs_t offset, uint8_t data)
{
static const char *const analog_port[] = { "AN0", "AN1", "AN2" };
@@ -896,8 +896,8 @@ void bzone_state::init_bradley()
space.install_ram(0x400, 0x7ff);
space.install_read_port(0x1808, 0x1808, "1808");
space.install_read_port(0x1809, 0x1809, "1809");
- space.install_read_handler(0x180a, 0x180a, read8_delegate(FUNC(bzone_state::analog_data_r),this));
- space.install_write_handler(0x1848, 0x1850, write8_delegate(FUNC(bzone_state::analog_select_w),this));
+ space.install_read_handler(0x180a, 0x180a, read8smo_delegate(FUNC(bzone_state::analog_data_r),this));
+ space.install_write_handler(0x1848, 0x1850, write8sm_delegate(FUNC(bzone_state::analog_select_w),this));
}
diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp
index 7cae64bde71..4bc6129aeb0 100644
--- a/src/mame/drivers/coolridr.cpp
+++ b/src/mame/drivers/coolridr.cpp
@@ -589,7 +589,7 @@ void coolridr_state::video_start()
#define COOLRIDERS_DRAWGFX_CORE(PIXEL_TYPE, COOL_PIXEL_OP) \
do { \
do { \
- const uint16_t *srcdata; \
+ const uint8_t *srcdata; \
int32_t destendx, destendy; \
int32_t srcx, srcy; \
int32_t curx, cury; \
@@ -667,7 +667,7 @@ do {
for (cury = desty; cury <= destendy; cury++) \
{ \
PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const uint16_t *srcptr = srcdata; \
+ const uint8_t *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \
@@ -699,7 +699,7 @@ do {
for (cury = desty; cury <= destendy; cury++) \
{ \
PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const uint16_t *srcptr = srcdata; \
+ const uint8_t *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \
diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp
index 508e079a174..5986ad19a8a 100644
--- a/src/mame/drivers/cps3.cpp
+++ b/src/mame/drivers/cps3.cpp
@@ -529,7 +529,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
// const pen_t *pal = &gfx->colortable[gfx->granularity() * (color % gfx->colors())];
u32 palbase = (gfx->granularity() * color) & 0x1ffff;
const pen_t *pal = &m_mame_colours[palbase];
- const u16 *source_base = gfx->get_data(code % gfx->elements());
+ const u8 *source_base = gfx->get_data(code % gfx->elements());
int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16;
int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16;
@@ -595,7 +595,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
@@ -611,7 +611,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
@@ -628,7 +628,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
@@ -645,7 +645,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
diff --git a/src/mame/drivers/gamecstl.cpp b/src/mame/drivers/gamecstl.cpp
index 0bb7ddc9671..947eaced689 100644
--- a/src/mame/drivers/gamecstl.cpp
+++ b/src/mame/drivers/gamecstl.cpp
@@ -138,7 +138,7 @@ void gamecstl_state::video_start()
void gamecstl_state::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
{
int i,j;
- const uint16_t *dp;
+ const uint8_t *dp;
int index = 0;
dp = gfx->get_data(ch);
diff --git a/src/mame/drivers/gstream.cpp b/src/mame/drivers/gstream.cpp
index 127ee1ac57f..42cc5dc63ad 100644
--- a/src/mame/drivers/gstream.cpp
+++ b/src/mame/drivers/gstream.cpp
@@ -183,7 +183,6 @@ private:
int m_oki_bank[2];
int m_toggle;
int m_xoffset;
- bool m_is_rgb;
DECLARE_WRITE32_MEMBER(vram_w);
template<int Layer> DECLARE_WRITE16_MEMBER(scrollx_w);
@@ -199,8 +198,11 @@ private:
virtual void video_start() override;
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int map, uint32_t* ram);
- void drawgfx_rgb(bitmap_rgb32 &bitmap,const rectangle &clip,gfx_element *gfx,
- u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy);
+ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx,gfx_element *gfx2,
+ uint32_t code, int flipx, int flipy, int32_t destx, int32_t desty);
+
+ void rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2);
+ void rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2);
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -547,44 +549,23 @@ static const gfx_layout layout32x32 =
32*32*8,
};
-
-static const gfx_layout layout16x16x16 =
-{
- 16,16,
- RGN_FRAC(1,1),
- 16,
- { STEP16(0,1) },
- { STEP16(0,16) },
- { STEP16(0,16*16) },
- 16*16*16,
-};
-
-
-static const gfx_layout layout32x32x16 =
-{
- 32,32,
- RGN_FRAC(1,1),
- 16,
- { STEP16(0,1) },
- { STEP32(0,16) },
- { STEP32(0,16*32) },
- 32*32*16,
-};
-
-
static GFXDECODE_START( gfx_gstream )
- GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0x1000, 4 )
- GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0x1400, 4 )
- GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0x1800, 4 )
+ GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0x1000, 4 )
+ GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0x1400, 4 )
+ GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0x1800, 4 )
GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0, 32 )
GFXDECODE_END
static GFXDECODE_START( gfx_x2222 )
- GFXDECODE_ENTRY( "gfx2", 0, layout32x32x16, 0, 1 )
- GFXDECODE_ENTRY( "gfx3", 0, layout32x32x16, 0, 1 )
- GFXDECODE_ENTRY( "gfx4", 0, layout32x32x16, 0, 1 )
- GFXDECODE_ENTRY( "gfx1", 0, layout16x16x16, 0, 1 )
+ GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx1_lower", 0, layout16x16, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx2_lower", 0, layout32x32, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx3_lower", 0, layout32x32, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx4_lower", 0, layout32x32, 0, 0x80 )
GFXDECODE_END
@@ -593,67 +574,152 @@ void gstream_state::video_start()
}
-void gstream_state::drawgfx_rgb(bitmap_rgb32 &bitmap,const rectangle &clip,gfx_element *gfx,
- u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy)
+// custom drawgfx function for x2222 to draw RGB data instead of indexed data, needed because our regular drawgfx and tilemap code don't support that
+void gstream_state::drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx,gfx_element *gfx2,
+ uint32_t code, int flipx, int flipy, int32_t destx, int32_t desty)
{
- /* Start drawing */
- const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const u16 *source_base = gfx->get_data(code % gfx->elements());
+ // use pen usage to optimize
+ code %= gfx->elements();
+ const pen_t *rgb = m_palette->pens(); // 16 bit BGR
+
+ // render
+
+ do {
+ g_profiler.start(PROFILER_DRAWGFX);
+ do {
+ const uint8_t *srcdata, *srcdata2;
+ int32_t destendx, destendy;
+ int32_t srcx, srcy;
+ int32_t curx, cury;
+ int32_t dy;
+
+ assert(dest.valid());
+ assert(gfx != nullptr);
+ assert(dest.cliprect().contains(cliprect));
+ assert(code < gfx->elements());
+
+ /* ignore empty/invalid cliprects */
+ if (cliprect.empty())
+ break;
+
+ /* compute final pixel in X and exit if we are entirely clipped */
+ destendx = destx + gfx->width() - 1;
+ if (destx > cliprect.max_x || destendx < cliprect.min_x)
+ break;
+
+ /* apply left clip */
+ srcx = 0;
+ if (destx < cliprect.min_x)
+ {
+ srcx = cliprect.min_x - destx;
+ destx = cliprect.min_x;
+ }
- int xinc = flipx ? -1 : 1;
- int yinc = flipy ? -1 : 1;
+ /* apply right clip */
+ if (destendx > cliprect.max_x)
+ destendx = cliprect.max_x;
- int x_index_base = flipx ? gfx->width() - 1 : 0;
- int y_index = flipy ? gfx->height() - 1 : 0;
+ /* compute final pixel in Y and exit if we are entirely clipped */
+ destendy = desty + gfx->height() - 1;
+ if (desty > cliprect.max_y || destendy < cliprect.min_y)
+ break;
- // start coordinates
- int sx = offsx;
- int sy = offsy;
+ /* apply top clip */
+ srcy = 0;
+ if (desty < cliprect.min_y)
+ {
+ srcy = cliprect.min_y - desty;
+ desty = cliprect.min_y;
+ }
- // end coordinates
- int ex = sx + gfx->width();
- int ey = sy + gfx->height();
+ /* apply bottom clip */
+ if (destendy > cliprect.max_y)
+ destendy = cliprect.max_y;
- if (sx < clip.min_x)
- { // clip left
- int pixels = clip.min_x - sx;
- sx += pixels;
- x_index_base += xinc * pixels;
- }
- if (sy < clip.min_y)
- { // clip top
- int pixels = clip.min_y - sy;
- sy += pixels;
- y_index += yinc * pixels;
- }
- // NS 980211 - fixed incorrect clipping
- if (ex > clip.max_x + 1)
- { // clip right
- ex = clip.max_x + 1;
- }
- if (ey > clip.max_y + 1)
- { // clip bottom
- ey = clip.max_y + 1;
- }
+ /* apply X flipping */
+ if (flipx)
+ srcx = gfx->width() - 1 - srcx;
- if (ex > sx)
- { // skip if inner loop doesn't draw anything
- for (int y = sy; y < ey; y++)
- {
- const u16 *source = source_base + y_index * gfx->rowbytes();
- u32 *dest = &bitmap.pix32(y);
- int x_index = x_index_base;
- for (int x = sx; x < ex; x++)
+ /* apply Y flipping */
+ dy = gfx->rowbytes();
+ if (flipy)
+ {
+ srcy = gfx->height() - 1 - srcy;
+ dy = -dy;
+ }
+
+ /* fetch the source data */
+ srcdata = gfx->get_data(code);
+ srcdata2 = gfx2->get_data(code);
+
+ /* compute how many blocks of 4 pixels we have */
+ uint32_t leftovers = (destendx + 1 - destx);
+
+ /* adjust srcdata to point to the first source pixel of the row */
+ srcdata += srcy * gfx->rowbytes() + srcx;
+ srcdata2 += srcy * gfx->rowbytes() + srcx;
+
+ /* non-flipped 16bpp case */
+ if (!flipx)
{
- const u16 c = source[x_index];
- if (c != 0) // draw this pixel when rom data is not 0
- dest[x] = pal[c];
+ /* iterate over pixels in Y */
+ for (cury = desty; cury <= destendy; cury++)
+ {
+ uint32_t *destptr = &dest.pix32(cury, destx);
+ const uint8_t *srcptr = srcdata;
+ const uint8_t *srcptr2 = srcdata2;
+ srcdata += dy;
+ srcdata2 += dy;
+
+ /* iterate over leftover pixels */
+ for (curx = 0; curx < leftovers; curx++)
+ {
+ uint32_t srcdata = (srcptr[0]);
+ uint32_t srcdata2 = (srcptr2[0]);
+
+ uint16_t full = (srcdata | (srcdata2 << 8));
+ if (full != 0)
+ destptr[0] = rgb[full];
+
+ srcptr++;
+ srcptr2++;
+ destptr++;
+ }
+ }
+ }
- x_index += xinc;
+ /* flipped 16bpp case */
+ else
+ {
+ /* iterate over pixels in Y */
+ for (cury = desty; cury <= destendy; cury++)
+ {
+ uint32_t *destptr = &dest.pix32(cury, destx);
+ const uint8_t *srcptr = srcdata;
+ const uint8_t *srcptr2 = srcdata2;
+
+ srcdata += dy;
+ srcdata2 += dy;
+
+ /* iterate over leftover pixels */
+ for (curx = 0; curx < leftovers; curx++)
+ {
+ uint32_t srcdata = (srcptr[0]);
+ uint32_t srcdata2 = (srcptr2[0]);
+
+ uint16_t full = (srcdata | (srcdata2 << 8));
+ if (full != 0)
+ destptr[0] = rgb[full];
+
+ srcptr--;
+ srcptr2--;
+ destptr++;
+ }
+ }
}
- y_index += yinc;
- }
- }
+ } while (0);
+ g_profiler.stop();
+ } while (0);
}
void gstream_state::draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int map, uint32_t* ram )
@@ -674,8 +740,8 @@ void gstream_state::draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int
int pal = (vram_data & 0xc000) >> 14;
int code = (vram_data & 0x0fff);
- if (m_is_rgb)
- drawgfx_rgb(bitmap,cliprect,m_gfxdecode->gfx(map),code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f));
+ if (m_gfxdecode->gfx(map+5))
+ drawgfx_transpen_x2222(bitmap,cliprect,m_gfxdecode->gfx(map),m_gfxdecode->gfx(map+5),code,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f));
else
m_gfxdecode->gfx(map)->transpen(bitmap,cliprect,code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f),0);
@@ -709,10 +775,12 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
//popmessage("(1) %08x %08x (2) %08x %08x (3) %08x %08x", m_scrollx[0], m_scrolly[0], m_scrollx[1], m_scrolly[1], m_scrollx[2], m_scrolly[2] );
bitmap.fill(0,cliprect);
+
draw_bg(bitmap, cliprect, 2, m_vram + 0x800/4);
draw_bg(bitmap, cliprect, 1, m_vram + 0x400/4);
draw_bg(bitmap, cliprect, 0, m_vram + 0x000/4); // move on top for x2222 , check
+
for (i = 0x0000 / 4; i < 0x4000 / 4; i += 4)
{
/* Upper bits are used by the tilemaps */
@@ -721,12 +789,13 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
int y = m_vram[i + 2] & 0xff;
int col = m_vram[i + 3] & 0x1f;
- if (m_is_rgb)
+ if (m_gfxdecode->gfx(4))
{
- drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset, y);
- drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset, y-0x100);
- drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset - 0x200, y);
- drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset - 0x200, y-0x100);
+ drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset, y);
+ drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset, y-0x100);
+ drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset - 0x200, y);
+ drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset - 0x200 , y-0x100);
+
}
else
{
@@ -734,6 +803,7 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset, y-0x100, 0);
m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset - 0x200, y, 0);
m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset - 0x200, y-0x100, 0);
+
}
}
return 0;
@@ -868,28 +938,53 @@ ROM_START( x2222 )
ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */
ROM_LOAD( "test.hye", 0x000000, 0x0112dda, CRC(c1142b2f) SHA1(5807930820a53604013a6ac66e4d4ebe3628e1fc) ) // the above binary was built from this
- /* x2222 uses raw rgb16 data rather than 8bpp indexed */
- ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprite tiles (16x16x16) */
- ROM_LOAD64_WORD_SWAP( "spr11.bin", 0x000000, 0x200000, CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
- ROM_LOAD64_WORD_SWAP( "spr21.bin", 0x800000, 0x1b8b00, CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
- ROM_LOAD64_WORD_SWAP( "spr12.bin", 0x000002, 0x200000, CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
- ROM_LOAD64_WORD_SWAP( "spr22.bin", 0x800002, 0x1b8b00, CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
- ROM_LOAD64_WORD_SWAP( "spr13.bin", 0x000004, 0x200000, CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
- ROM_LOAD64_WORD_SWAP( "spr23.bin", 0x800004, 0x1b8b00, CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
- ROM_LOAD64_WORD_SWAP( "spr14.bin", 0x000006, 0x200000, CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
- ROM_LOAD64_WORD_SWAP( "spr24.bin", 0x800006, 0x1b8b00, CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
-
- ROM_REGION( 0x400000, "gfx2", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD32_WORD_SWAP( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
- ROM_LOAD32_WORD_SWAP( "bg32.bin", 0x000002, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
-
- ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD32_WORD_SWAP( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
- ROM_LOAD32_WORD_SWAP( "bg22.bin", 0x000002, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
-
- ROM_REGION( 0x400000, "gfx4", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD32_WORD_SWAP( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
- ROM_LOAD32_WORD_SWAP( "bg12.bin", 0x000002, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
+ /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */
+ ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ /* 2nd 8-bits */
+ ROM_REGION( 0x800000, "gfx1_lower", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx2_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx3_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx4_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x1000000, "sprites", 0 ) /* sprite tiles (16x16x16) */
+ ROM_LOAD( "spr11.bin", 0x000000, 0x200000, CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
+ ROM_LOAD( "spr21.bin", 0x200000, 0x1b8b00, CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
+ ROM_LOAD( "spr12.bin", 0x400000, 0x200000, CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
+ ROM_LOAD( "spr22.bin", 0x600000, 0x1b8b00, CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
+ ROM_LOAD( "spr13.bin", 0x800000, 0x200000, CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
+ ROM_LOAD( "spr23.bin", 0xa00000, 0x1b8b00, CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
+ ROM_LOAD( "spr14.bin", 0xc00000, 0x200000, CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
+ ROM_LOAD( "spr24.bin", 0xe00000, 0x1b8b00, CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
+
+ ROM_REGION( 0x400000, "bg1", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD16_BYTE( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
+ ROM_LOAD16_BYTE( "bg32.bin", 0x000001, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
+
+ ROM_REGION( 0x400000, "bg2", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD16_BYTE( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
+ ROM_LOAD16_BYTE( "bg22.bin", 0x000001, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
+
+ ROM_REGION( 0x400000, "bg3", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD16_BYTE( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
+ ROM_LOAD16_BYTE( "bg12.bin", 0x000001, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
// no idea what the sound hw is?
ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 )
@@ -905,28 +1000,53 @@ ROM_START( x2222o )
ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */
ROM_LOAD( "older.hye", 0x000000, 0x010892f, CRC(cf3a004e) SHA1(1cba64cfa235b9540f33a5ee0cc02dfd267e00fc) ) // this corresponds to the older.bin we're using, for reference
- /* x2222 uses raw rgb16 data rather than 8bpp indexed */
- ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprite tiles (16x16x16) */ // these sprite ROMs have the Boss tiles in the wrong location for the prototype program rom
- ROM_LOAD64_WORD_SWAP( "spr11.bin", 0x000000, 0x200000, BAD_DUMP CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
- ROM_LOAD64_WORD_SWAP( "spr21.bin", 0x800000, 0x1b8b00, BAD_DUMP CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
- ROM_LOAD64_WORD_SWAP( "spr12.bin", 0x000002, 0x200000, BAD_DUMP CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
- ROM_LOAD64_WORD_SWAP( "spr22.bin", 0x800002, 0x1b8b00, BAD_DUMP CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
- ROM_LOAD64_WORD_SWAP( "spr13.bin", 0x000004, 0x200000, BAD_DUMP CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
- ROM_LOAD64_WORD_SWAP( "spr23.bin", 0x800004, 0x1b8b00, BAD_DUMP CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
- ROM_LOAD64_WORD_SWAP( "spr14.bin", 0x000006, 0x200000, BAD_DUMP CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
- ROM_LOAD64_WORD_SWAP( "spr24.bin", 0x800006, 0x1b8b00, BAD_DUMP CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
-
- ROM_REGION( 0x400000, "gfx2", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD32_WORD_SWAP( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
- ROM_LOAD32_WORD_SWAP( "bg32.bin", 0x000002, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
-
- ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD32_WORD_SWAP( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
- ROM_LOAD32_WORD_SWAP( "bg22.bin", 0x000002, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
-
- ROM_REGION( 0x400000, "gfx4", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD32_WORD_SWAP( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
- ROM_LOAD32_WORD_SWAP( "bg12.bin", 0x000002, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
+ /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */
+ ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ /* 2nd 8-bits */
+ ROM_REGION( 0x800000, "gfx1_lower", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx2_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx3_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x200000, "gfx4_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
+ /* filled in at init*/
+
+ ROM_REGION( 0x1000000, "sprites", 0 ) /* sprite tiles (16x16x16) */ // these sprite ROMs have the Boss tiles in the wrong location for the prototype program rom
+ ROM_LOAD( "spr11.bin", 0x000000, 0x200000, BAD_DUMP CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
+ ROM_LOAD( "spr21.bin", 0x200000, 0x1b8b00, BAD_DUMP CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
+ ROM_LOAD( "spr12.bin", 0x400000, 0x200000, BAD_DUMP CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
+ ROM_LOAD( "spr22.bin", 0x600000, 0x1b8b00, BAD_DUMP CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
+ ROM_LOAD( "spr13.bin", 0x800000, 0x200000, BAD_DUMP CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
+ ROM_LOAD( "spr23.bin", 0xa00000, 0x1b8b00, BAD_DUMP CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
+ ROM_LOAD( "spr14.bin", 0xc00000, 0x200000, BAD_DUMP CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
+ ROM_LOAD( "spr24.bin", 0xe00000, 0x1b8b00, BAD_DUMP CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
+
+ ROM_REGION( 0x400000, "bg1", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD16_BYTE( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
+ ROM_LOAD16_BYTE( "bg32.bin", 0x000001, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
+
+ ROM_REGION( 0x400000, "bg2", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD16_BYTE( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
+ ROM_LOAD16_BYTE( "bg22.bin", 0x000001, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
+
+ ROM_REGION( 0x400000, "bg3", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD16_BYTE( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
+ ROM_LOAD16_BYTE( "bg12.bin", 0x000001, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
// no idea what the sound hw is?
ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 )
@@ -971,17 +1091,40 @@ void gstream_state::init_gstream()
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd1ee0, 0xd1ee3, read32_delegate(FUNC(gstream_state::gstream_speedup_r), this));
m_xoffset = 2;
- m_is_rgb = false;
}
+void gstream_state::rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2)
+{
+ int i;
+ for (i = 0; i < 0x80000; i++)
+ {
+ NEW[i] = (ROM[(i * 8) + 0x000000] << 0) | (ROM[(i * 8) + 0x000001] << 8) | (ROM[(i * 8) + 0x000004] << 16) | (ROM[(i * 8) + 0x000005] << 24);
+ NEW2[i] = (ROM[(i * 8) + 0x000002] << 0) | (ROM[(i * 8) + 0x000003] << 8) | (ROM[(i * 8) + 0x000006] << 16) | (ROM[(i * 8) + 0x000007] << 24);
+ }
+}
+
+void gstream_state::rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2)
+{
+ int i;
+ for (i = 0; i < 0x200000; i++)
+ {
+ NEW[i] = (ROM[(i * 2) + 0xc00000] << 24) | (ROM[(i * 2) + 0x800000] << 16) | (ROM[(i * 2) + 0x400000] << 8) | (ROM[(i * 2) + 0x000000] << 0);
+ NEW2[i] = (ROM[(i * 2) + 0xc00001] << 24) | (ROM[(i * 2) + 0x800001] << 16) | (ROM[(i * 2) + 0x400001] << 8) | (ROM[(i * 2) + 0x000001] << 0);
+ }
+}
+
void gstream_state::init_x2222()
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0x7ffac, 0x7ffaf, read32_delegate(FUNC(gstream_state::x2222_speedup_r), this)); // older
m_maincpu->space(AS_PROGRAM).install_read_handler(0x84e3c, 0x84e3f, read32_delegate(FUNC(gstream_state::x2222_speedup2_r), this)); // newer
+ rearrange_sprite_data(memregion("sprites")->base(), (uint32_t*)memregion("gfx1")->base(), (uint32_t*)memregion("gfx1_lower")->base() );
+ rearrange_tile_data(memregion("bg1")->base(), (uint32_t*)memregion("gfx2")->base(), (uint32_t*)memregion("gfx2_lower")->base());
+ rearrange_tile_data(memregion("bg2")->base(), (uint32_t*)memregion("gfx3")->base(), (uint32_t*)memregion("gfx3_lower")->base());
+ rearrange_tile_data(memregion("bg3")->base(), (uint32_t*)memregion("gfx4")->base(), (uint32_t*)memregion("gfx4_lower")->base());
+
m_xoffset = 0;
- m_is_rgb = true;
}
diff --git a/src/mame/drivers/hp9k.cpp b/src/mame/drivers/hp9k.cpp
index 75215a1e8b9..c10eed0913b 100644
--- a/src/mame/drivers/hp9k.cpp
+++ b/src/mame/drivers/hp9k.cpp
@@ -353,7 +353,7 @@ GFXDECODE_END
void hp9k_state::putChar(uint8_t thec,int x,int y,bitmap_ind16 &bitmap)
{
- const uint16_t* pchar=m_gfxdecode->gfx(0)->get_data(thec);
+ const uint8_t* pchar=m_gfxdecode->gfx(0)->get_data(thec);
for (int py=0;py<HP9816_CHDIMY;py++)
{
diff --git a/src/mame/drivers/lucky37.cpp b/src/mame/drivers/lucky37.cpp
new file mode 100644
index 00000000000..f803972b8ed
--- /dev/null
+++ b/src/mame/drivers/lucky37.cpp
@@ -0,0 +1,194 @@
+// license:BSD-3-Clause
+// copyright-holders:
+
+/*
+ This hardware seems to be an evolution of the one found in lucky37.cpp. Its main components are:
+ * A001 CPU block, containing probably a Z80 or compatible CPU and ROM(s) (not dumped).
+ Dumper description after opening it: 3 unknown/white chips, which had no pins, with no markings.
+ * HD647180X0P6 MCU with internal ROM (not dumped)
+ * 1 32.000 MHz and 1 21.000 MHz XTALs
+ * 1 OKI M6295V with 1.056 MHz resonator
+ * 1 custom 06B30P
+ * 1 custom 101B10P
+ * 6 8-dip banks
+ * 1 MB8421-12L
+
+ Exact markings on CPU block and MCU from the PCBs the games were dumped from:
+
+ Lucky 37:
+ A001: marked A 9A2. Sticker: 8907 1990.6 L-37 TYPE301
+ MCU: Sticker: 8907 1990.6 L-37 M.COM
+
+ Lucky 25:
+ A001: marked B 9F2. No sticker
+ MCU: No sticker
+
+ Lucky 21:
+ A001: marked A 9B2. Sticker: 8907 199(unreadable) L-21 TYPE302
+ MCU: Sticker: 8907 1990.6 L-21 M.COM
+
+
+ Lucky 21-D:
+ A001: marked B 9G1. Sticker: 8907 1991.03 L-21-D BET/WON
+ MCU: Sticker: 8907 1990.10 L21-D M.COM
+
+ Not much can be done until main CPU and MCU ROMs are dumped.
+*/
+
+#include "emu.h"
+
+#include "cpu/z80/z80.h"
+#include "cpu/z180/z180.h"
+#include "machine/mb8421.h"
+#include "machine/nvram.h"
+#include "sound/okim6295.h"
+#include "screen.h"
+#include "speaker.h"
+
+class lucky37_state : public driver_device
+{
+public:
+ lucky37_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag)
+ { }
+
+ void lucky37(machine_config &config);
+};
+
+static INPUT_PORTS_START( lucky37 )
+ PORT_START("DSW1")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8")
+
+ PORT_START("DSW2")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8")
+
+ PORT_START("DSW3")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW3:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW3:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW3:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW3:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW3:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW3:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW3:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW3:8")
+
+ PORT_START("DSW4")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW4:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW4:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW4:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW4:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW4:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW4:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW4:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW4:8")
+
+ PORT_START("DSW5")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW5:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW5:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW5:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW5:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW5:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW5:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW5:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW5:8")
+
+ PORT_START("DSW6")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW6:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW6:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW6:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW6:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW6:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW6:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW6:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW6:8")
+INPUT_PORTS_END
+
+void lucky37_state::lucky37(machine_config &config)
+{
+ /* basic machine hardware */
+ Z80(config, "maincpu", 32_MHz_XTAL / 8); // not verified
+}
+
+ROM_START( lucky21 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "a001-a9b2", 0x0000, 0x10000, NO_DUMP )
+
+ ROM_REGION( 0x8000, "mcu", 0 )
+ ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP )
+
+ ROM_REGION( 0xc0000, "unsorted", 0 )
+ ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(2198b736) SHA1(556fd89dc9d1183a672324b7e1bb6350331459d2) )
+ ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(fe7bbfef) SHA1(5b1413d26049e4e5c04e05a71f552d2999d57ed5) )
+ ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(c4c3f642) SHA1(4dba751f74717e4ef158f21c3e2a1b2d4802bb51) )
+ ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(358d3791) SHA1(d3e01008dbfc0daea255053f1d269e898d8698ea) )
+ ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(0331c70a) SHA1(e6ace84001bfbbd78acdd30c8d5f631705731e81) )
+ ROM_LOAD( "7.bin", 0xa0000, 0x20000, CRC(e43403d2) SHA1(3beddbd0476d88aa5f7b918b95fec382c28a4fe5) )
+ROM_END
+
+ROM_START( lucky21d )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "a001-b9g1", 0x0000, 0x10000, NO_DUMP )
+
+ ROM_REGION( 0x8000, "mcu", 0 )
+ ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP )
+
+ ROM_REGION( 0xe0000, "unsorted", 0 )
+ ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(e512ec6d) SHA1(28925c54edc002ee9d575e2ef53bccb02df176a0) )
+ ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(8ffcb12c) SHA1(36c395765c8f50cf76eee18bf6c81a6bf20afb09) )
+ ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(23b72a30) SHA1(dca28dadb4ed4200a37e77706b4db003e07f7336) )
+ ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(f47ee6d7) SHA1(97235e053e2913041953be37352c51ab8399a209) )
+ ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(ba7c7d3b) SHA1(cb849218ec9716f4ed48115ab0a091a2d19d5314) )
+ ROM_LOAD( "6.bin", 0xa0000, 0x20000, CRC(f20ef81e) SHA1(5db3f106b555b98518ef0e5b11cc582369e52ff8) )
+ ROM_LOAD( "7.bin", 0xc0000, 0x20000, CRC(e43403d2) SHA1(3beddbd0476d88aa5f7b918b95fec382c28a4fe5) )
+ROM_END
+
+ROM_START( lucky25 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "a001-b9f2", 0x0000, 0x10000, NO_DUMP )
+
+ ROM_REGION( 0x8000, "mcu", 0 )
+ ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP )
+
+ ROM_REGION( 0xc0000, "unsorted", 0 )
+ ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(e504afa8) SHA1(efc984037ca692de44d7f829fec6445315bf5a54) )
+ ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(d81e51cc) SHA1(273c93bf0657da4921de55ffdfba0940ff90bc15) )
+ ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(4dc0e8c4) SHA1(3dd5b64dbe6d503872e06fcb9e9a85b645accf8c) )
+ ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(f449eae6) SHA1(07830626a4d68a6ee3721f5306addfaf05c319ca) )
+ ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(d10202a3) SHA1(3a866bc0585f90c5cfd75ba1ced2912a8a448678) )
+ ROM_LOAD( "6.bin", 0xa0000, 0x20000, CRC(6c551fee) SHA1(d69a7badfa05fa35d3cad1cf565ad554f927c4b4) )
+ROM_END
+
+ROM_START( lucky37 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "a001-a9a2", 0x0000, 0x10000, NO_DUMP )
+
+ ROM_REGION( 0x8000, "mcu", 0 )
+ ROM_LOAD( "internal_rom", 0x0000, 0x8000, NO_DUMP )
+
+ ROM_REGION( 0xc0000, "unsorted", 0 )
+ ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(15729cbb) SHA1(2e3255f0ff2e084311be41c908ab5a2be8c1b25d) )
+ ROM_LOAD( "2.bin", 0x20000, 0x20000, CRC(4a48de16) SHA1(f74fabc3523126e935ccedd8e5efbe1d1c8b80ee) )
+ ROM_LOAD( "3.bin", 0x40000, 0x20000, CRC(84a4535c) SHA1(8f6ff1503e5fd5ee6f9f2ff101c4958fad040321) )
+ ROM_LOAD( "4.bin", 0x60000, 0x20000, CRC(bd6d49ff) SHA1(b19be51a93b76e506eab8f1cee898b1750c2ee96) )
+ ROM_LOAD( "5.bin", 0x80000, 0x20000, CRC(a8fad083) SHA1(85c963859a0432b26ed66ad6e4edc56071ac55a3) )
+ ROM_LOAD( "6.bin", 0xa0000, 0x20000, CRC(3283c1b7) SHA1(7a30dd55216b47332ea7c18c2378352f405b2f0a) )
+ROM_END
+
+GAME( 199?, lucky21, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 21", MACHINE_IS_SKELETON )
+GAME( 199?, lucky21d, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 21-D", MACHINE_IS_SKELETON )
+GAME( 199?, lucky25, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 25", MACHINE_IS_SKELETON )
+GAME( 199?, lucky37, 0, lucky37, lucky37, lucky37_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 37", MACHINE_IS_SKELETON )
diff --git a/src/mame/drivers/lucky74.cpp b/src/mame/drivers/lucky74.cpp
index eef05d50adb..2cade54aa04 100644
--- a/src/mame/drivers/lucky74.cpp
+++ b/src/mame/drivers/lucky74.cpp
@@ -241,7 +241,7 @@
_
- Regarding the abobe diagram, there are 2 different states controlled by both 06B53P.
+ Regarding the above diagram, there are 2 different states controlled by both 06B53P.
Each state arrange a different palette that will be assigned to each graphics bank.
As we can see here, same pin of different PROMs are connected together in parallel.
@@ -304,7 +304,7 @@
Test Mode CANCEL DE E0 00 DF EF 01 "call attendant"
Coin EF E0 00 DF F6 01 "ready?"
- (*) "big" and "small" are splitted from the sample "big or small".
+ (*) "big" and "small" are split from the sample "big or small".
So, you can easily see that writes to ports 0x00-0x01 define the start (pos) offset,
@@ -331,7 +331,7 @@
devices from this hardware, plus V-Sync, H-Sync and (V+H)-Sync (composite) frequencies.
All generated clocks are proportional to the Clock In (12MHz). There are not fixed or
- harcoded frequencies.
+ hardcoded frequencies.
Pinout
diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp
index 5d6b36d1ce1..61f4cfae945 100644
--- a/src/mame/drivers/mediagx.cpp
+++ b/src/mame/drivers/mediagx.cpp
@@ -276,7 +276,7 @@ void mediagx_state::video_start()
void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
{
int i,j;
- const uint16_t *dp;
+ const uint8_t *dp;
int index = 0;
const pen_t *pens = &m_palette->pen(0);
@@ -287,7 +287,7 @@ void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, g
uint32_t *p = &bitmap.pix32(j);
for (i=x; i < x+8; i++)
{
- uint16_t pen = dp[index++];
+ uint8_t pen = dp[index++];
if (pen)
p[i] = pens[gfx->colorbase() + (att & 0xf)];
else
diff --git a/src/mame/drivers/mindset.cpp b/src/mame/drivers/mindset.cpp
index 3f3f006a381..eee0e5169ad 100644
--- a/src/mame/drivers/mindset.cpp
+++ b/src/mame/drivers/mindset.cpp
@@ -313,8 +313,19 @@ void mindset_state::dispctrl_w(u16 data)
{
u16 chg = m_dispctrl ^ data;
m_dispctrl = data;
- if(chg & 0xff00)
- logerror("display control %04x\n", m_dispctrl);
+ if(chg & 0xff88)
+ logerror("display control %s bank=%c %s %s h=%d ppx=%d w=%s interlace=%d rreg=%d indicator=%s wreg=%d\n",
+ m_dispctrl & 0x8000 ? "?15" : "?!15",
+ m_dispctrl & 0x4000 ? '1' : '0',
+ m_dispctrl & 0x2000 ? "ibm" : "native",
+ m_dispctrl & 0x1000 ? "?12" : "?!12",
+ m_dispctrl & 0x0800 ? "400" : "200",
+ (m_dispctrl & 0x0600) >> 9,
+ m_dispctrl & 0x0100 ? "320" : "640",
+ m_dispctrl & 0x0080 ? "on" : "off",
+ (m_dispctrl & 0x0070) >> 4,
+ m_dispctrl & 0x0008 ? "on" : "off",
+ m_dispctrl & 7);
}
u16 mindset_state::dispreg_r()
@@ -329,6 +340,7 @@ u16 mindset_state::dispreg_r()
}
case 5: {
// wants 0080 set to be able to upload the palette
+ // may be a field indicator
return 0x0080;
}
}
@@ -339,7 +351,7 @@ u16 mindset_state::dispreg_r()
void mindset_state::dispreg_w(u16 data)
{
- switch(m_dispctrl & 0xf) {
+ switch(m_dispctrl & 0x7) {
case 0:
m_screenpos = data;
logerror("screen position (%d, %d)\n", (data >> 8) & 15, (data >> 12) & 15);
@@ -377,21 +389,20 @@ void mindset_state::dispreg_w(u16 data)
}
case 4: {
data = sw(data);
- u8 r = 0x11*(((data & 0x4000) >> 11) | (data & 7));
- u8 g = 0x11*(((data & 0x2000) >> 10) | ((data & 0x38) >> 3));
- u8 b = 0x11*(((data & 0x1000) >> 9) | ((data & 0x1c0) >> 6));
-
- if(!(data & 0x8000)) {
- r = r * 0.75;
- g = g * 0.75;
- b = b * 0.75;
- }
+ u8 r = (0x49*(data & 7)) >> 1;
+ u8 g = (0x49*((data & 0x38) >> 3)) >> 1;
+ u8 b = (0x49*((data & 0x1c0) >> 6)) >> 1;
+
m_palette[m_borderidx] = (r << 16) | (g << 8) | b;
m_genlock[m_borderidx] = data & 0x0200;
logerror("palette[%x] = %04x -> %06x.%d\n", m_borderidx, data, m_palette[m_borderidx], m_genlock[m_borderidx]);
m_borderidx = (m_borderidx + 1) & 0xf;
break;
}
+ case 5: {
+ logerror("genlock %s%s, extra=%c\n", data & 0x0200 ? "on" : "off", data & 0x0100 ? " fixed" : "", data & 0x0400 ? '1' : '0');
+ break;
+ }
default:
logerror("display reg[%x] = %04x\n", m_dispctrl & 0xf, data);
diff --git a/src/mame/drivers/mpu4vid.cpp b/src/mame/drivers/mpu4vid.cpp
index b90d5df28a1..38311f62c20 100644
--- a/src/mame/drivers/mpu4vid.cpp
+++ b/src/mame/drivers/mpu4vid.cpp
@@ -416,7 +416,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(mpu4vid_state::display_pixels)
if(!lg)
{
uint16_t tile = m_vid_mainram[address & 0x7fff];
- const uint16_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff);
+ const uint8_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff);
int offset = m_gfxdecode->gfx(m_gfx_index+0)->rowbytes() * linecount;
for(int i = 0; i < 8; i++)
bitmap.pix32(y, x + i) = (tile >> 12) ? m_palette->pen(line[offset + i]) : m_palette->black_pen();
diff --git a/src/mame/drivers/pinball2k.cpp b/src/mame/drivers/pinball2k.cpp
index c301f55354a..6d337040e06 100644
--- a/src/mame/drivers/pinball2k.cpp
+++ b/src/mame/drivers/pinball2k.cpp
@@ -166,7 +166,7 @@ void pinball2k_state::video_start()
void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
{
int i,j;
- const uint16_t *dp;
+ const uint8_t *dp;
int index = 0;
const pen_t *pens = m_palette->pens();
@@ -177,7 +177,7 @@ void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect,
uint32_t *p = &bitmap.pix32(j);
for (i=x; i < x+8; i++)
{
- uint16_t pen = dp[index++];
+ uint8_t pen = dp[index++];
if (pen)
p[i] = pens[gfx->colorbase() + (att & 0xf)];
else
diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp
index eb3bb7fb4e0..08c507743d9 100644
--- a/src/mame/drivers/pk8020.cpp
+++ b/src/mame/drivers/pk8020.cpp
@@ -2,10 +2,20 @@
// copyright-holders:Miodrag Milanovic, AJR
/***************************************************************************
- PK-8020 driver by Miodrag Milanovic
- based on work of Sergey Erokhin from pk8020.narod.ru
+PK-8020 driver by Miodrag Milanovic
+ based on work of Sergey Erokhin from pk8020.narod.ru
- 18/07/2008 Preliminary driver.
+2008-07-18 Preliminary driver.
+
+Cassette is "best guess", as I was unable to locate any recordings, and
+also do not know the commands to save and load. SAVE and LOAD appear when
+F2 or shift-F2 pressed (in Korvet), but only produce errors.
+
+Status as at 2019-07-19:
+Korvet - can boot CP/M, but the keyboard then doesn't work.
+Neiva - keyboard not working
+BK8T - keyboard not working, stuck at a "config" screen.
+Kontur - needs to boot from a floppy and we don't have any that work
****************************************************************************/
@@ -306,8 +316,9 @@ void pk8020_state::pk8020(machine_config &config)
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50);
- //CASSETTE(config, m_cass).set_default_state(CASSETTE_PLAY);
- //m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
+ CASSETTE(config, m_cass);
+ m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
+ m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
CENTRONICS(config, m_printer, centronics_devices, nullptr);
m_printer->busy_handler().set(m_inr, FUNC(pic8259_device::ir6_w)).invert();
@@ -378,7 +389,7 @@ ROM_END
/* Driver */
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
-COMP( 1987, korvet, 0, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Korvet", MACHINE_SUPPORTS_SAVE)
-COMP( 1987, neiva, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Neiva", MACHINE_SUPPORTS_SAVE)
-COMP( 1987, kontur, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Kontur", MACHINE_SUPPORTS_SAVE)
-COMP( 1987, bk8t, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "BK-8T", MACHINE_SUPPORTS_SAVE)
+COMP( 1987, korvet, 0, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Korvet", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1987, neiva, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Neiva", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1987, kontur, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "PK8020 Kontur", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1987, bk8t, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "<unknown>", "BK-8T", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
diff --git a/src/mame/drivers/poly88.cpp b/src/mame/drivers/poly88.cpp
index d4f80d7fb15..4d78faaf828 100644
--- a/src/mame/drivers/poly88.cpp
+++ b/src/mame/drivers/poly88.cpp
@@ -9,6 +9,10 @@ Poly-88 driver by Miodrag Milanovic
All input must be UPPERcase.
+11K is the minimal amount of user RAM required to run BASIC. PolyMorphic's
+"System 16" package shipped with 16K of RAM (as did the 8813), though some
+of their lesser systems did not.
+
ToDo:
- Polyphase format not working because 8251 device doesn't support sync.
@@ -43,6 +47,7 @@ at least some models of the Poly-88 are known to have used.)
#include "emu.h"
#include "includes/poly88.h"
+#include "bus/s100/poly16k.h"
#include "bus/s100/polyfdc.h"
#include "bus/s100/polyvti.h"
#include "bus/s100/seals8k.h"
@@ -99,6 +104,7 @@ static void poly88_s100_devices(device_slot_interface &device)
device.option_add("vti", S100_POLY_VTI);
device.option_add("8ksc", S100_8K_SC);
device.option_add("8kscbb", S100_8K_SC_BB);
+ device.option_add("poly16k", S100_POLY_16K);
device.option_add("polyfdc", S100_POLY_FDC);
}
@@ -106,8 +112,16 @@ DEVICE_INPUT_DEFAULTS_START(poly88_vti_1800)
DEVICE_INPUT_DEFAULTS("ADDRESS", 0x3f, 0x06) // 1800-1FFF
DEVICE_INPUT_DEFAULTS_END
-DEVICE_INPUT_DEFAULTS_START(poly88_8ksc_2000)
- DEVICE_INPUT_DEFAULTS("DSW", 0xff, 0xfd) // 2000-3FFF
+DEVICE_INPUT_DEFAULTS_START(poly88_16k_2000)
+ DEVICE_INPUT_DEFAULTS("DSW", 0xf, 0xd) // 2000-5FFF
+DEVICE_INPUT_DEFAULTS_END
+
+DEVICE_INPUT_DEFAULTS_START(poly88_16k_6000)
+ DEVICE_INPUT_DEFAULTS("DSW", 0xf, 0x9) // 6000-9FFF
+DEVICE_INPUT_DEFAULTS_END
+
+DEVICE_INPUT_DEFAULTS_START(poly88_16k_a000)
+ DEVICE_INPUT_DEFAULTS("DSW", 0xf, 0x5) // A000-DFFF
DEVICE_INPUT_DEFAULTS_END
void poly88_state::poly88(machine_config &config)
@@ -152,10 +166,15 @@ void poly88_state::poly88(machine_config &config)
m_s100->vi2().set(FUNC(poly88_state::vi2_w));
m_s100->vi5().set(FUNC(poly88_state::vi5_w));
+ // Poly-88 backplane has 5 slots, but CPU uses one
S100_SLOT(config, m_s100_slot[0], poly88_s100_devices, "vti");
- S100_SLOT(config, m_s100_slot[1], poly88_s100_devices, nullptr);
+ S100_SLOT(config, m_s100_slot[1], poly88_s100_devices, "poly16k");
S100_SLOT(config, m_s100_slot[2], poly88_s100_devices, nullptr);
S100_SLOT(config, m_s100_slot[3], poly88_s100_devices, nullptr);
+
+ m_s100_slot[1]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_2000));
+ m_s100_slot[2]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_6000));
+ m_s100_slot[3]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_a000));
}
void poly88_state::poly8813(machine_config &config)
@@ -164,9 +183,8 @@ void poly88_state::poly8813(machine_config &config)
m_onboard_io->set_addrmap(0, &poly88_state::poly8813_io);
m_s100_slot[0]->set_option_device_input_defaults("vti", DEVICE_INPUT_DEFAULTS_NAME(poly88_vti_1800));
- m_s100_slot[1]->set_default_option("8ksc");
- m_s100_slot[1]->set_option_device_input_defaults("8ksc", DEVICE_INPUT_DEFAULTS_NAME(poly88_8ksc_2000));
- m_s100_slot[2]->set_default_option("polyfdc");
+ m_s100_slot[1]->set_default_option("polyfdc");
+ m_s100_slot[2]->set_default_option("poly16k");
// Poly-8813 backplane has 10 slots, but CPU uses one
S100_SLOT(config, m_s100_slot[4], poly88_s100_devices, nullptr);
@@ -174,6 +192,10 @@ void poly88_state::poly8813(machine_config &config)
S100_SLOT(config, m_s100_slot[6], poly88_s100_devices, nullptr);
S100_SLOT(config, m_s100_slot[7], poly88_s100_devices, nullptr);
S100_SLOT(config, m_s100_slot[8], poly88_s100_devices, nullptr);
+
+ m_s100_slot[2]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_2000));
+ m_s100_slot[3]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_6000));
+ m_s100_slot[4]->set_option_device_input_defaults("poly16k", DEVICE_INPUT_DEFAULTS_NAME(poly88_16k_a000));
}
/* ROM definition */
diff --git a/src/mame/drivers/saitek_stratos.cpp b/src/mame/drivers/saitek_stratos.cpp
index d297f030b19..16544f69ae5 100644
--- a/src/mame/drivers/saitek_stratos.cpp
+++ b/src/mame/drivers/saitek_stratos.cpp
@@ -5,11 +5,14 @@
Scisys Kasparov Stratos Chess Computer
TODO:
-- add LCD (188:88, 88:88, and 7*7 DMD bottom-left)
+- emulate LCD at lower level, probably an MCU with embedded LCDC
+- add LCD 7*7 DMD, it's in m_lcd_data[0x30 to 0x3b] but scrambled
- corona: different addressmap, 64 leds
-- add endgame rom (softwarelist?)
+- tking different internal artwork
+- interrupt timing is derived from the main XTAL, but result should be similar with 5MHz and 5.67MHz,
+ there are a couple of "FREQ. SEL" nodes on the PCB, maybe related (not the ones in input ports)
+- does nvram.u7 work? it's cleared during boot, but not used after
- clean up driver
-- does nvram.u7 work?
***************************************************************************/
@@ -20,8 +23,14 @@ TODO:
#include "machine/timer.h"
#include "sound/dac.h"
#include "sound/volt_reg.h"
-#include "speaker.h"
#include "video/pwm.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
+
+#include "softlist.h"
+#include "speaker.h"
+
+#include <algorithm>
// internal artwork
#include "saitek_stratos.lh" // clickable
@@ -34,13 +43,14 @@ public:
m_maincpu(*this, "maincpu"),
m_nvram(*this, "nvram.u7"),
m_rombank(*this, "rombank"),
- m_extbank(*this, "extbank"),
m_nvrambank(*this, "nvrambank"),
- m_irqtimer(*this, "irqtimer"),
m_lcd_busy(*this, "lcd_busy"),
m_board(*this, "board"),
m_display(*this, "display"),
m_dac(*this, "dac"),
+ m_extrom(*this, "extrom"),
+ m_out_digit(*this, "digit%u", 0U),
+ m_out_lcd(*this, "lcd%u.%u.%u", 0U, 0U, 0U),
m_inputs(*this, "IN.%u", 0)
{ }
@@ -49,6 +59,7 @@ public:
void tking2(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(cpu_freq) { set_cpu_freq(); }
+ DECLARE_INPUT_CHANGED_MEMBER(acl_button) { if (newval) power_off(); }
DECLARE_INPUT_CHANGED_MEMBER(go_button);
private:
@@ -61,99 +72,122 @@ private:
DECLARE_READ8_MEMBER(lcd_r);
DECLARE_WRITE8_MEMBER(lcd_w);
- void stratos_mem(address_map &map);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(extrom_load);
+ DECLARE_READ8_MEMBER(extrom_r);
+
+ void main_map(address_map &map);
- TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
void set_cpu_freq();
std::unique_ptr<uint8_t[]> m_nvram_data;
u8 m_select;
u8 m_control;
u8 m_led_data;
- bool m_lcd_written;
+ bool m_power;
- //u8 m_lcd_address;
- //u8 m_lcd_ram[0x100];
- //u8 m_lcd_latch;
+ u8 m_lcd_address;
+ u8 m_lcd_count;
+ u8 m_lcd_data[0x40];
- u8 m_lcd_data;
- void show_leds();
+ void update_leds();
+ void update_lcd();
+ void power_off();
virtual void machine_reset() override;
virtual void machine_start() override;
required_device<m65c02_device> m_maincpu;
required_device<nvram_device> m_nvram;
required_memory_bank m_rombank;
- required_memory_bank m_extbank;
required_memory_bank m_nvrambank;
- required_device<timer_device> m_irqtimer;
required_device<timer_device> m_lcd_busy;
required_device<sensorboard_device> m_board;
required_device<pwm_display_device> m_display;
required_device<dac_bit_interface> m_dac;
- required_ioport_array<8> m_inputs;
+ required_device<generic_slot_device> m_extrom;
+ output_finder<8+1> m_out_digit;
+ output_finder<4, 16, 4> m_out_lcd;
+ required_ioport_array<8+1> m_inputs;
};
void stratos_state::machine_start()
{
+ // resolve handlers
+ m_out_digit.resolve();
+ m_out_lcd.resolve();
+
m_nvram_data = std::make_unique<uint8_t[]>(0x2000);
m_nvram->set_base(m_nvram_data.get(), 0x2000);
m_rombank->configure_entries(0, 2, memregion("maincpu")->base(), 0x8000);
- m_extbank->configure_entries(0, 2, memregion("ext")->base(), 0x4000);
m_nvrambank->configure_entries(0, 2, m_nvram_data.get(), 0x1000);
- m_control = 0x40;
+ m_control = 0x00;
+ m_select = 0x00;
}
void stratos_state::machine_reset()
{
+ m_power = true;
set_cpu_freq();
- m_control = 0x40;
- m_select = 0x00;
m_rombank->set_entry(0);
- m_extbank->set_entry(0);
m_nvrambank->set_entry(0);
}
void stratos_state::set_cpu_freq()
{
m_maincpu->set_unscaled_clock((ioport("FAKE")->read() & 1) ? 5.67_MHz_XTAL : 5_MHz_XTAL);
-
- attotime period = attotime::from_hz(m_maincpu->unscaled_clock() / 0x10000);
- m_irqtimer->adjust(period, 0, period);
}
-void stratos_state::show_leds()
+void stratos_state::update_leds()
{
m_display->matrix_partial(0, 2, 1 << (m_control >> 5 & 1), (~m_led_data & 0xff) | (~m_control << 6 & 0x100));
}
-TIMER_DEVICE_CALLBACK_MEMBER(stratos_state::interrupt)
-{
- m_maincpu->set_input_line(M65C02_IRQ_LINE, HOLD_LINE);
-}
-
INPUT_CHANGED_MEMBER(stratos_state::go_button)
{
- if (newval && ~m_control & 0x40)
+ if (newval && !m_power)
{
m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
machine_reset();
}
}
+DEVICE_IMAGE_LOAD_MEMBER(stratos_state::extrom_load)
+{
+ u32 size = m_extrom->common_get_size("rom");
+
+ // 32KB ROM only?
+ if (size != 0x8000)
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid file size");
+ return image_init_result::FAIL;
+ }
+
+ m_extrom->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
+ m_extrom->common_load_rom(m_extrom->get_rom_base(), size, "rom");
+
+ return image_init_result::PASS;
+}
+
+READ8_MEMBER(stratos_state::extrom_r)
+{
+ u16 bank = BIT(m_control, 1) * 0x4000;
+ return (m_extrom->exists()) ? m_extrom->read_rom(offset | bank) : 0xff;
+}
+
+
WRITE8_MEMBER(stratos_state::p2000_w)
{
- m_dac->write(0); // guessed
+ // d0-d3: input/led mux
+ // d4-d7: chessboard led data
m_select = data;
-
m_display->matrix_partial(2, 4, ~m_select >> 4 & 0xf, 1 << (m_select & 0xf));
}
READ8_MEMBER(stratos_state::p2200_r)
{
+ // d0-d7: chessboard sensors
return ~m_board->read_file(m_select & 0xf);
}
@@ -164,9 +198,11 @@ WRITE8_MEMBER(stratos_state::p2200_w)
WRITE8_MEMBER(stratos_state::p2400_w)
{
+ // d0-d7: button leds data
m_led_data = data;
+ update_leds();
- show_leds();
+ m_dac->write(0); // guessed
}
READ8_MEMBER(stratos_state::control_r)
@@ -180,53 +216,102 @@ READ8_MEMBER(stratos_state::control_r)
if (m_lcd_busy->enabled())
data |= 0x20;
- // battery low?
- data |= 0x80;
+ // battery low
+ data |= m_inputs[8]->read();
}
+ // read button panel
if (sel < 8)
data |= m_inputs[sel]->read() << 5;
-
return data;
}
+void stratos_state::power_off()
+{
+ m_power = false;
+ m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+
+ // clear display
+ m_display->matrix(0, 0);
+
+ std::fill_n(m_lcd_data, ARRAY_LENGTH(m_lcd_data), 0);
+ update_lcd();
+}
+
WRITE8_MEMBER(stratos_state::control_w)
{
u8 prev = m_control;
-
m_control = data;
+
+ // d0: main rom bank
+ // d1: ext rom bank
+ // d1: nvram bank?
m_rombank->set_entry(data >> 0 & 1);
- m_extbank->set_entry(data >> 1 & 1); // ?
m_nvrambank->set_entry((data >> 1) & 1);
- show_leds();
+ // d2: mode led state
+ // d5: button leds select
+ update_leds();
// d6 falling edge: power-off request
if (~data & prev & 0x40)
- {
- m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
-
- // clear display
- m_display->matrix(0, 0);
- }
+ power_off();
}
+void stratos_state::update_lcd()
+{
+ // output individual segments
+ for (int i = 0; i < 0x40; i++)
+ for (int j = 0; j < 4; j++)
+ m_out_lcd[i >> 4][i & 0xf][j] = BIT(m_lcd_data[i], j);
+
+ m_out_digit[0] = 0; // where?
+
+ // upper digits
+ for (int i = 0; i < 4; i++)
+ m_out_digit[i + 1] = (m_lcd_data[0x01 + i * 2] << 4 | m_lcd_data[0x01 + i * 2 + 1]) & 0x7f;
+
+ // lower digits
+ for (int i = 0; i < 4; i++)
+ m_out_digit[i + 5] = (m_lcd_data[0x11 + i * 2] << 4 | m_lcd_data[0x11 + i * 2 + 1]) & 0x7f;
+}
READ8_MEMBER(stratos_state::lcd_r)
{
+ // unknown, maybe resets lcd controller
return 0;
}
WRITE8_MEMBER(stratos_state::lcd_w)
{
- m_lcd_data = data;
- m_lcd_written = true;
+ // d0-d3: lcd data
+ // d4-d7: unused?
+ data &= 0xf;
+
+ if (m_lcd_count == 0)
+ m_lcd_address = data;
+ else
+ {
+ // write to lcd row
+ if (m_lcd_address > 0 && m_lcd_address <= 4)
+ m_lcd_data[(((m_lcd_address - 1) << 4) + (m_lcd_count - 1)) & 0x3f] = data;
+ }
+
+ // it expects a specific number of writes for each row
+ const u8 maxcount[5] = { 1, 9, 9, 1, 12 };
+ if (m_lcd_address > 4 || m_lcd_count == maxcount[m_lcd_address])
+ {
+ m_lcd_count = 0;
+ update_lcd();
+ }
+ else
+ m_lcd_count++;
m_lcd_busy->adjust(attotime::from_usec(50)); // ?
}
-void stratos_state::stratos_mem(address_map &map)
+void stratos_state::main_map(address_map &map)
{
map(0x0000, 0x1fff).ram().share("nvram.u6");
map(0x2000, 0x2000).w(FUNC(stratos_state::p2000_w));
@@ -235,7 +320,7 @@ void stratos_state::stratos_mem(address_map &map)
map(0x2600, 0x2600).rw(FUNC(stratos_state::control_r), FUNC(stratos_state::control_w));
map(0x2800, 0x37ff).bankrw("nvrambank");
map(0x3800, 0x3800).rw(FUNC(stratos_state::lcd_r), FUNC(stratos_state::lcd_w));
- map(0x4000, 0x7fff).bankr("extbank");
+ map(0x4000, 0x7fff).r(FUNC(stratos_state::extrom_r));
map(0x8000, 0xffff).bankr("rombank");
}
@@ -243,7 +328,7 @@ static INPUT_PORTS_START( stratos )
PORT_START("IN.0")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Set Up")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_L) PORT_NAME("Level")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) // freq sel
PORT_START("IN.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Sound")
@@ -268,20 +353,26 @@ static INPUT_PORTS_START( stratos )
PORT_START("IN.5")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_EQUALS) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Function")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) // freq sel
PORT_START("IN.6")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Library")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Info")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) // freq sel
PORT_START("IN.7")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Analysis")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Normal")
+ PORT_START("IN.8")
+ PORT_CONFNAME( 0x80, 0x80, "Battery Status" )
+ PORT_CONFSETTING( 0x00, "Low" )
+ PORT_CONFSETTING( 0x80, DEF_STR( Normal ) )
+
PORT_START("RESET")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, go_button, nullptr) PORT_NAME("Go")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, acl_button, nullptr) PORT_NAME("ACL")
PORT_START("FAKE")
PORT_CONFNAME( 0x01, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_state, cpu_freq, nullptr) // factory set
@@ -289,11 +380,19 @@ static INPUT_PORTS_START( stratos )
PORT_CONFSETTING( 0x01, "5.67MHz" )
INPUT_PORTS_END
+static INPUT_PORTS_START( tking2 )
+ PORT_INCLUDE( stratos )
+
+ PORT_MODIFY("IN.5")
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM)
+INPUT_PORTS_END
+
void stratos_state::stratos(machine_config &config)
{
/* basic machine hardware */
M65C02(config, m_maincpu, 5_MHz_XTAL); // see set_cpu_freq
- m_maincpu->set_addrmap(AS_PROGRAM, &stratos_state::stratos_mem);
+ m_maincpu->set_addrmap(AS_PROGRAM, &stratos_state::main_map);
+ m_maincpu->set_periodic_int(FUNC(stratos_state::irq0_line_hold), attotime::from_hz(75));
NVRAM(config, "nvram.u6", nvram_device::DEFAULT_ALL_0);
NVRAM(config, "nvram.u7", nvram_device::DEFAULT_ALL_0);
@@ -302,7 +401,6 @@ void stratos_state::stratos(machine_config &config)
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
m_board->set_delay(attotime::from_msec(350));
- TIMER(config, "irqtimer").configure_generic(FUNC(stratos_state::interrupt));
TIMER(config, "lcd_busy").configure_generic(timer_device::expired_delegate());
/* video hardware */
@@ -313,6 +411,12 @@ void stratos_state::stratos(machine_config &config)
SPEAKER(config, "speaker").front_center();
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
+
+ /* extension rom */
+ GENERIC_CARTSLOT(config, m_extrom, generic_plain_slot, "saitek_egr", "bin");
+ m_extrom->set_device_load(FUNC(stratos_state::extrom_load), this);
+
+ SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr");
}
void stratos_state::corona(machine_config &config)
@@ -335,63 +439,52 @@ ROM_START( stratos )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("w1y01f_728m_u3.u3", 0x0000, 0x8000, CRC(b58a7256) SHA1(75b3a3a65f4ca8d52aa5b17a06319bff59d9014f) )
ROM_LOAD("bw1_819n_u4.u4", 0x8000, 0x8000, CRC(cb0de631) SHA1(f78d40213be21775966cbc832d64acd9b73de632) )
-
- ROM_REGION( 0x8000, "ext", 0 )
- ROM_FILL( 0x0000, 0x8000, 0xff )
ROM_END
-ROM_START( stratosl )
+ROM_START( stratosa )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("w1y01f_728l_u3.u3", 0x0000, 0x8000, CRC(19a22058) SHA1(a5ca54d870c70b7ce9c7be2951800bf49cc57527) )
ROM_LOAD("bw1_819n_u4.u4", 0x8000, 0x8000, CRC(cb0de631) SHA1(f78d40213be21775966cbc832d64acd9b73de632) )
-
- ROM_REGION( 0x8000, "ext", 0 )
- ROM_FILL( 0x0000, 0x8000, 0xff )
ROM_END
-ROM_START( tking )
+ROM_START( tking ) // PCB rev. 10
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("y01f_713d_u3.u3", 0x0000, 0x8000, CRC(b8c6d853) SHA1(98923f44bbbd2ea17c269850971d3df229e6057e) )
ROM_LOAD("y01f_712a_u4.u4", 0x8000, 0x8000, CRC(7d3f8f7b) SHA1(8be5d8d988ff0577ccfec0a773bfd94599f2534f) )
-
- ROM_REGION( 0x8000, "ext", 0 )
- ROM_FILL( 0x0000, 0x8000, 0xff )
ROM_END
-ROM_START( tkingl )
+ROM_START( tkinga ) // PCB rev. 3, also PCB rev. 5
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("w1y01f_728l_u3.u3", 0x0000, 0x8000, CRC(19a22058) SHA1(a5ca54d870c70b7ce9c7be2951800bf49cc57527) )
ROM_LOAD("y01f-b_819o_u4.u4", 0x8000, 0x8000, CRC(336040d4) SHA1(aca662b8cc4d6bafd61ca158c768ba8896117169) )
-
- ROM_REGION( 0x8000, "ext", 0 )
- ROM_FILL( 0x0000, 0x8000, 0xff )
ROM_END
-ROM_START( tkingp )
+ROM_START( tkingb ) // PCB rev. 7
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("w1y01f_728p_u3.u3", 0x0000, 0x8000, CRC(ad77f83e) SHA1(598fdb1e40267d9d43a3d8f287723070b9afa349) )
ROM_LOAD("y01f-b_819o_u4.u4", 0x8000, 0x8000, CRC(336040d4) SHA1(aca662b8cc4d6bafd61ca158c768ba8896117169) )
-
- ROM_REGION( 0x8000, "ext", 0 )
- ROM_FILL( 0x0000, 0x8000, 0xff )
ROM_END
ROM_START( corona )
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD("w2_708g_u2-a.u2", 0x0000, 0x8000, CRC(52568bb4) SHA1(83fe91787e17bbefc2b3ec651ddb11c88990060d) )
- ROM_LOAD("bw2_708a_u3-b.u3", 0x8000, 0x8000, CRC(32848f73) SHA1(a447543e3eb4757f9afed26fde77b66985eb96a7) )
+ ROM_LOAD("w2_708g_u2.u2", 0x0000, 0x8000, CRC(52568bb4) SHA1(83fe91787e17bbefc2b3ec651ddb11c88990060d) )
+ ROM_LOAD("bw2_708a_u3.u3", 0x8000, 0x8000, CRC(32848f73) SHA1(a447543e3eb4757f9afed26fde77b66985eb96a7) )
+ROM_END
- ROM_REGION( 0x8000, "ext", 0 )
- ROM_FILL( 0x0000, 0x8000, 0xff )
+ROM_START( coronaa )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD("w2_a14c_u2.u2", 0x0000, 0x8000, CRC(be82e199) SHA1(cfcc573774b6907ed137dca01fa7f3fce493a89f) )
+ ROM_LOAD("bw2_a14_u3.u3", 0x8000, 0x8000, CRC(abe87285) SHA1(b15f7ddeac78d252cf413ba4085523e44c6d15df) )
ROM_END
/* YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */
-CONS( 1986, stratos, 0, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (rev. M)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
-CONS( 1986, stratosl, stratos, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (rev. L)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
+CONS( 1986, stratos, 0, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK )
+CONS( 1986, stratosa, stratos, 0, stratos, stratos, stratos_state, empty_init, "SciSys", "Kasparov Stratos (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK )
-CONS( 1990, tking, 0, 0, tking2, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (rev. D)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) // aka Turbo King II
-CONS( 1988, tkingl, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (rev. L)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
-CONS( 1988, tkingp, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (rev. P)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
+CONS( 1990, tking, 0, 0, tking2, tking2, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 1, ver. D)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Turbo King II
+CONS( 1988, tkinga, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // oldest?
+CONS( 1988, tkingb, tking, 0, stratos, stratos, stratos_state, empty_init, "Saitek", "Kasparov Turbo King (set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK )
-CONS( 1988, corona, 0, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (rev. G)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
+CONS( 1988, corona, 0, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (ver. D+)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Corona II
+CONS( 1988, coronaa, corona, 0, corona, stratos, stratos_state, empty_init, "Saitek", "Kasparov Corona (ver. D)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK )
diff --git a/src/mame/drivers/sb8085.cpp b/src/mame/drivers/sb8085.cpp
new file mode 100644
index 00000000000..240f1ba3404
--- /dev/null
+++ b/src/mame/drivers/sb8085.cpp
@@ -0,0 +1,312 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/***************************************************************************
+
+ Preliminary driver for Space Byte 8085 CPU.
+
+ This is an early Intel 8085-based single-board computer whose onboard
+ I/O consists of RS232 ports for a CRT and serial printer and a parallel
+ interface intended for use with ICOM's FD 3700 or Frugal Floppy disk
+ controller. The resident monitor program also supports the Tarbell
+ cassette tape interface and the PolyMorphic Systems Video Terminal
+ Interface.
+
+ The bus connector is only somewhat S-100 compatible. Anticipating the
+ draft IEEE standard, no clock signal is placed on pin 25 or 49 (though
+ documentation recommends jumpering pin 49 to the 3.072 MHz clock on pin
+ 24 for the VTI). The conventional INT and VI0-7 pins are disregarded in
+ favor of collecting the four 8085-specific interrupts on pins 12-15 in
+ ascending order of priority. SDSB/CDSB/ASDB/DODSB are also disregarded,
+ and there is an alternate PHOLD input on pin 16.
+
+ Space Byte also advertised a 16K static RAM board and a 2708/2716
+ EPROM programmer for use in this system.
+
+***************************************************************************/
+
+#include "emu.h"
+
+#include "cpu/i8085/i8085.h"
+#include "bus/rs232/rs232.h"
+#include "bus/s100/s100.h"
+#include "bus/s100/polyvti.h"
+#include "bus/s100/seals8k.h"
+#include "machine/i8155.h"
+#include "machine/i8251.h"
+
+class sb8085_state : public driver_device
+{
+public:
+ sb8085_state(const machine_config &config, device_type type, const char *tag)
+ : driver_device(config, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_i8155(*this, "i8155")
+ , m_usart(*this, "usart")
+ , m_crt(*this, "crt")
+ , m_printer(*this, "printer")
+ , m_s100(*this, "s100")
+ , m_program(*this, "program")
+ , m_config_select(*this, "SELECT")
+ , m_portd(*this, "PORTD")
+ {
+ }
+
+ static constexpr feature_type unemulated_features() { return feature::DISK | feature::TAPE; }
+
+ void sb8085(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+private:
+ bool board_selected(offs_t offset);
+ u8 mem_r(offs_t offset);
+ void mem_w(offs_t offset, u8 data);
+ u8 in_r(offs_t offset);
+ void out_w(offs_t offset, u8 data);
+ DECLARE_WRITE_LINE_MEMBER(phantom_disable_w);
+
+ DECLARE_WRITE_LINE_MEMBER(printer_select_w);
+ DECLARE_WRITE_LINE_MEMBER(usart_txd_w);
+ DECLARE_WRITE_LINE_MEMBER(crt_rts_w);
+ DECLARE_WRITE_LINE_MEMBER(printer_rts_w);
+
+ void mem_map(address_map &map);
+ void io_map(address_map &map);
+
+ required_device<i8085a_cpu_device> m_maincpu;
+ required_device<i8155_device> m_i8155;
+ required_device<i8251_device> m_usart;
+ required_device<rs232_port_device> m_crt;
+ required_device<rs232_port_device> m_printer;
+ required_device<s100_bus_device> m_s100;
+ required_region_ptr<u8> m_program;
+ required_ioport m_config_select;
+ required_ioport m_portd;
+
+ bool m_phantom;
+ bool m_printer_select;
+ bool m_usart_txd;
+ bool m_crt_rts;
+ bool m_printer_rts;
+};
+
+void sb8085_state::machine_start()
+{
+ m_printer_select = false;
+ m_usart_txd = true;
+ m_crt_rts = true;
+ m_printer_rts = true;
+
+ // Pins 6, 8, 5 (printer) are tied to +12
+ m_crt->write_dtr(0);
+ m_printer->write_rts(0);
+ m_printer->write_dtr(0);
+
+ save_item(NAME(m_phantom));
+ save_item(NAME(m_printer_select));
+ save_item(NAME(m_usart_txd));
+ save_item(NAME(m_crt_rts));
+ save_item(NAME(m_printer_rts));
+}
+
+void sb8085_state::machine_reset()
+{
+ m_phantom = false;
+}
+
+bool sb8085_state::board_selected(offs_t offset)
+{
+ if (!m_phantom)
+ return true;
+
+ ioport_value config = m_config_select->read();
+ return !BIT(config, 1) || (offset & 0xe000) == (BIT(config, 0) ? 0xe000 : 0xc000);
+}
+
+u8 sb8085_state::mem_r(offs_t offset)
+{
+ if (board_selected(offset))
+ {
+ if ((offset & 0x1c00) < 0x0c00)
+ return m_program[offset & 0xfff];
+ else if ((offset & 0x1c00) >= 0x1800)
+ return m_i8155->memory_r(offset & 0xff);
+ else
+ return 0xff;
+ }
+ else
+ return m_s100->smemr_r(offset);
+}
+
+void sb8085_state::mem_w(offs_t offset, u8 data)
+{
+ if (board_selected(offset))
+ {
+ if ((offset & 0x1c00) >= 0x1800)
+ m_i8155->memory_w(offset & 0xff, data);
+ }
+ else
+ m_s100->mwrt_w(offset, data);
+}
+
+u8 sb8085_state::in_r(offs_t offset)
+{
+ offset |= offset << 8;
+ if (board_selected(offset))
+ {
+ if ((offset & 0x1c00) == 0x0000)
+ return m_usart->read(BIT(offset, 8));
+ else if ((offset & 0x1c00) == 0x0c00)
+ return m_portd->read() ^ 0xff;
+ else if ((offset & 0x1c00) >= 0x1800)
+ return m_i8155->io_r(offset & 7);
+ else
+ return 0xff;
+ }
+ else
+ return m_s100->sinp_r(offset);
+}
+
+void sb8085_state::out_w(offs_t offset, u8 data)
+{
+ offset |= offset << 8;
+ if (board_selected(offset))
+ {
+ if ((offset & 0x1c00) == 0x0000)
+ m_usart->write(BIT(offset, 8), data);
+ else if ((offset & 0x1c00) >= 0x1800)
+ m_i8155->io_w(offset & 7, data);
+ }
+ else
+ m_s100->sout_w(offset, data);
+}
+
+WRITE_LINE_MEMBER(sb8085_state::phantom_disable_w)
+{
+ if (!state)
+ m_phantom = true;
+}
+
+WRITE_LINE_MEMBER(sb8085_state::printer_select_w)
+{
+ if (state && m_printer_select)
+ {
+ m_printer_select = false;
+ m_crt->write_txd(m_usart_txd);
+ m_printer->write_txd(1);
+ m_usart->write_cts(m_crt_rts);
+ }
+ else if (!state && !m_printer_select)
+ {
+ m_printer_select = true;
+ m_crt->write_txd(1);
+ m_printer->write_txd(m_usart_txd);
+ m_usart->write_cts(m_printer_rts);
+ }
+}
+
+WRITE_LINE_MEMBER(sb8085_state::usart_txd_w)
+{
+ m_usart_txd = state;
+ if (m_printer_select)
+ m_printer->write_txd(state);
+ else
+ m_crt->write_txd(state);
+}
+
+WRITE_LINE_MEMBER(sb8085_state::crt_rts_w)
+{
+ m_crt_rts = state;
+ if (!m_printer_select)
+ m_usart->write_cts(state);
+}
+
+WRITE_LINE_MEMBER(sb8085_state::printer_rts_w)
+{
+ m_printer_rts = state;
+ if (m_printer_select)
+ m_usart->write_cts(state);
+}
+
+void sb8085_state::mem_map(address_map &map)
+{
+ map(0x0000, 0xffff).rw(FUNC(sb8085_state::mem_r), FUNC(sb8085_state::mem_w));
+}
+
+void sb8085_state::io_map(address_map &map)
+{
+ map(0x00, 0xff).rw(FUNC(sb8085_state::in_r), FUNC(sb8085_state::out_w));
+}
+
+INPUT_PORTS_START(sb8085)
+ PORT_START("SELECT")
+ PORT_CONFNAME(3, 2, "Board select")
+ PORT_CONFSETTING(0, "Single board")
+ PORT_CONFSETTING(2, "C000-DFFFH")
+ PORT_CONFSETTING(3, "E000-FFFFH")
+
+ PORT_START("PORTD")
+ PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNKNOWN) // from disk connector
+INPUT_PORTS_END
+
+
+static void sb8085_s100_devices(device_slot_interface &device)
+{
+ device.option_add("vti", S100_POLY_VTI);
+ device.option_add("8ksc", S100_8K_SC);
+ device.option_add("8kscbb", S100_8K_SC_BB);
+}
+
+static DEVICE_INPUT_DEFAULTS_START(terminal)
+ DEVICE_INPUT_DEFAULTS("RS232_RXBAUD", 0xff, RS232_BAUD_9600)
+ DEVICE_INPUT_DEFAULTS("RS232_TXBAUD", 0xff, RS232_BAUD_9600)
+ DEVICE_INPUT_DEFAULTS("RS232_STARTBITS", 0xff, RS232_STARTBITS_1)
+ DEVICE_INPUT_DEFAULTS("RS232_DATABITS", 0xff, RS232_DATABITS_7)
+ DEVICE_INPUT_DEFAULTS("RS232_PARITY", 0xff, RS232_PARITY_EVEN)
+ DEVICE_INPUT_DEFAULTS("RS232_STOPBITS", 0xff, RS232_STOPBITS_2)
+DEVICE_INPUT_DEFAULTS_END
+
+void sb8085_state::sb8085(machine_config &config)
+{
+ I8085A(config, m_maincpu, 6.144_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &sb8085_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &sb8085_state::io_map);
+ m_maincpu->in_sid_func().set(m_crt, FUNC(rs232_port_device::rxd_r));
+
+ I8155(config, m_i8155, 6.144_MHz_XTAL / 2);
+ m_i8155->out_pc_callback().set(FUNC(sb8085_state::phantom_disable_w)).bit(5);
+ m_i8155->out_to_callback().set(m_usart, FUNC(i8251_device::write_txc));
+ m_i8155->out_to_callback().append(m_usart, FUNC(i8251_device::write_rxc));
+
+ I8251(config, m_usart, 6.144_MHz_XTAL / 2);
+ m_usart->rts_handler().set(m_crt, FUNC(rs232_port_device::write_rts));
+ m_usart->txd_handler().set(FUNC(sb8085_state::usart_txd_w));
+ m_usart->dtr_handler().set(FUNC(sb8085_state::printer_select_w));
+
+ RS232_PORT(config, m_crt, default_rs232_devices, nullptr);
+ m_crt->rxd_handler().set(m_usart, FUNC(i8251_device::write_rxd));
+ m_crt->cts_handler().set(FUNC(sb8085_state::crt_rts_w));
+ m_crt->set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));
+
+ RS232_PORT(config, m_printer, default_rs232_devices, nullptr);
+ m_printer->cts_handler().set(FUNC(sb8085_state::printer_rts_w));
+
+ S100_BUS(config, m_s100, 6.144_MHz_XTAL / 2);
+ S100_SLOT(config, "s100:1", sb8085_s100_devices, "vti");
+ S100_SLOT(config, "s100:2", sb8085_s100_devices, nullptr);
+ S100_SLOT(config, "s100:3", sb8085_s100_devices, nullptr);
+ S100_SLOT(config, "s100:4", sb8085_s100_devices, nullptr);
+}
+
+
+ROM_START(sb8085)
+ ROM_REGION(0xc00, "program", 0)
+ // From manual listing titled "SPACE BYTE 8085 PROM MONITOR 11-14-77" to be programmed on 3 TMS2708JL
+ ROM_LOAD("1.u19", 0x000, 0x400, CRC(9e1f11dd) SHA1(4c4482baa133dd6d437aaf749e31b72c9718eb97))
+ ROM_LOAD("2.u20", 0x400, 0x400, CRC(2426af98) SHA1(b6e37041f997aeea13be79df10dc410f4b0c51a6))
+ ROM_LOAD("3.u21", 0x800, 0x400, CRC(088ad01b) SHA1(6832e63dc1769db09107bc09f4c2cfb158dd8d33))
+ROM_END
+
+COMP(1977, sb8085, 0, 0, sb8085, sb8085, sb8085_state, empty_init, "Space Byte", "Space Byte 8085", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW)
diff --git a/src/mame/drivers/scyclone.cpp b/src/mame/drivers/scyclone.cpp
index a2c9aeeb2e6..c85861d269f 100644
--- a/src/mame/drivers/scyclone.cpp
+++ b/src/mame/drivers/scyclone.cpp
@@ -126,7 +126,7 @@ private:
uint8_t m_hascollided;
/* video-related */
- const uint16_t get_sprite_pixel(int x, int y);
+ const uint8_t get_sprite_pixel(int x, int y);
const uint8_t get_bitmap_pixel(int x, int y);
uint32_t draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
uint32_t draw_bitmap_and_sprite(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -158,7 +158,7 @@ void scyclone_state::video_start()
}
}
-const uint16_t scyclone_state::get_sprite_pixel(int x, int y)
+const uint8_t scyclone_state::get_sprite_pixel(int x, int y)
{
int minx = 0xe0-m_sprite_xpos;
int miny = 0xe0-m_sprite_ypos;
@@ -178,9 +178,9 @@ const uint16_t scyclone_state::get_sprite_pixel(int x, int y)
int sprx = x-minx;
int spry = y-miny;
- const uint16_t* srcdata = m_gfxdecode->gfx(0)->get_data(code);
+ const uint8_t* srcdata = m_gfxdecode->gfx(0)->get_data(code);
- uint16_t pix = srcdata[spry*32 + sprx] + col*4;
+ uint8_t pix = srcdata[spry*32 + sprx] + col*4;
return pix;
}
@@ -275,7 +275,7 @@ uint32_t scyclone_state::draw_bitmap_and_sprite(screen_device &screen, bitmap_rg
if (pal) bitmap.pix32(y, (x*8)+i) = paldata[pal];
- uint16_t pal2 = get_sprite_pixel(realx, realy);
+ uint8_t pal2 = get_sprite_pixel(realx, realy);
if (pal2 & 0x3)
{
diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp
index 802f769b726..280c547b272 100644
--- a/src/mame/drivers/slapshot.cpp
+++ b/src/mame/drivers/slapshot.cpp
@@ -635,14 +635,14 @@ void slapshot_state::driver_init()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
- const u16 *c0base = gx0->get_data(c);
- const u16 *c1base = gx1->get_data(c);
+ const u8 *c0base = gx0->get_data(c);
+ const u8 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
- const u16 *c0 = c0base;
- const u16 *c1 = c1base;
+ const u8 *c0 = c0base;
+ const u8 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
{
diff --git a/src/mame/drivers/supstarf.cpp b/src/mame/drivers/supstarf.cpp
index 2cf19fe2b3a..597d940addf 100644
--- a/src/mame/drivers/supstarf.cpp
+++ b/src/mame/drivers/supstarf.cpp
@@ -19,27 +19,27 @@ class supstarf_state : public driver_device
{
public:
supstarf_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_soundcpu(*this, "soundcpu"),
- m_psg(*this, {"psg1", "psg2"}),
- m_soundlatch(*this, {"soundlatch1", "soundlatch2"})
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_soundcpu(*this, "soundcpu")
+ , m_psg(*this, "psg%u", 1U)
+ , m_soundlatch(*this, "soundlatch%u", 1U)
{
}
void supstarf(machine_config &config);
private:
- DECLARE_READ8_MEMBER(psg_latch_r);
- DECLARE_WRITE8_MEMBER(psg_latch_w);
- DECLARE_WRITE8_MEMBER(port1_w);
- DECLARE_WRITE8_MEMBER(port2_w);
+ u8 psg_latch_r(offs_t offset);
+ void psg_latch_w(offs_t offset, u8 data);
+ void port1_w(u8 data);
+ void port2_w(u8 data);
DECLARE_READ_LINE_MEMBER(contacts_r);
DECLARE_WRITE_LINE_MEMBER(displays_w);
- DECLARE_WRITE8_MEMBER(driver_clk_w);
+ void driver_clk_w(offs_t offset, u8 data);
DECLARE_READ_LINE_MEMBER(phase_detect_r);
- DECLARE_WRITE8_MEMBER(lights_a_w);
- DECLARE_WRITE8_MEMBER(lights_b_w);
+ void lights_a_w(u8 data);
+ void lights_b_w(u8 data);
void main_io_map(address_map &map);
void main_map(address_map &map);
@@ -81,7 +81,7 @@ void supstarf_state::sound_io_map(address_map &map)
map(0x00, 0xff).rw(FUNC(supstarf_state::psg_latch_r), FUNC(supstarf_state::psg_latch_w));
}
-READ8_MEMBER(supstarf_state::psg_latch_r)
+u8 supstarf_state::psg_latch_r(offs_t offset)
{
u8 result = 0xff; // AR3 +5v pullup
@@ -95,12 +95,12 @@ READ8_MEMBER(supstarf_state::psg_latch_r)
}
if (m_latch_select)
- result &= m_soundlatch[1]->read(space, 0);
+ result &= m_soundlatch[1]->read();
return result;
}
-WRITE8_MEMBER(supstarf_state::psg_latch_w)
+void supstarf_state::psg_latch_w(offs_t offset, u8 data)
{
for (int d = 0; d < 2; d++)
{
@@ -112,15 +112,15 @@ WRITE8_MEMBER(supstarf_state::psg_latch_w)
}
if (m_latch_select)
- m_soundlatch[0]->strobe(space, 0, data);
+ m_soundlatch[0]->strobe(data);
}
-WRITE8_MEMBER(supstarf_state::port1_w)
+void supstarf_state::port1_w(u8 data)
{
m_port1_data = data;
}
-WRITE8_MEMBER(supstarf_state::port2_w)
+void supstarf_state::port2_w(u8 data)
{
m_maincpu->set_input_line(INPUT_LINE_RESET, BIT(data, 4) ? CLEAR_LINE : ASSERT_LINE);
if (!BIT(data, 4))
@@ -145,7 +145,7 @@ WRITE_LINE_MEMBER(supstarf_state::displays_w)
{
}
-WRITE8_MEMBER(supstarf_state::driver_clk_w)
+void supstarf_state::driver_clk_w(offs_t offset, u8 data)
{
}
@@ -154,11 +154,11 @@ READ_LINE_MEMBER(supstarf_state::phase_detect_r)
return 0;
}
-WRITE8_MEMBER(supstarf_state::lights_a_w)
+void supstarf_state::lights_a_w(u8 data)
{
}
-WRITE8_MEMBER(supstarf_state::lights_b_w)
+void supstarf_state::lights_b_w(u8 data)
{
}
@@ -175,36 +175,36 @@ void supstarf_state::machine_start()
void supstarf_state::supstarf(machine_config &config)
{
- I8085A(config, m_maincpu, XTAL(5'068'800));
+ I8085A(config, m_maincpu, 5.0688_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &supstarf_state::main_map);
m_maincpu->set_addrmap(AS_IO, &supstarf_state::main_io_map);
m_maincpu->in_sid_func().set(FUNC(supstarf_state::contacts_r));
m_maincpu->out_sod_func().set(FUNC(supstarf_state::displays_w));
- I8035(config, m_soundcpu, XTAL(5'068'800) / 2); // from 8085 pin 37 (CLK OUT)
+ I8035(config, m_soundcpu, 5.0688_MHz_XTAL / 2); // from 8085 pin 37 (CLK OUT)
m_soundcpu->set_addrmap(AS_PROGRAM, &supstarf_state::sound_map);
m_soundcpu->set_addrmap(AS_IO, &supstarf_state::sound_io_map);
m_soundcpu->p1_out_cb().set(FUNC(supstarf_state::port1_w));
m_soundcpu->p2_out_cb().set(FUNC(supstarf_state::port2_w));
m_soundcpu->t1_in_cb().set(FUNC(supstarf_state::phase_detect_r));
- I8212(config, m_soundlatch[0], 0);
+ I8212(config, m_soundlatch[0]);
m_soundlatch[0]->md_rd_callback().set_constant(0);
m_soundlatch[0]->int_wr_callback().set_inputline("maincpu", I8085_RST55_LINE);
- I8212(config, m_soundlatch[1], 0);
+ I8212(config, m_soundlatch[1]);
m_soundlatch[1]->md_rd_callback().set_constant(0);
m_soundlatch[1]->int_wr_callback().set_inputline("soundcpu", MCS48_INPUT_IRQ);
//MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("maincpu", I8085_READY_LINE))
SPEAKER(config, "mono").front_center();
- AY8910(config, m_psg[0], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0)
+ AY8910(config, m_psg[0], 5.0688_MHz_XTAL / 6); // from 8035 pin 1 (T0)
m_psg[0]->port_a_write_callback().set(FUNC(supstarf_state::lights_a_w));
m_psg[0]->port_b_write_callback().set(FUNC(supstarf_state::lights_b_w));
m_psg[0]->add_route(ALL_OUTPUTS, "mono", 0.50);
- AY8910(config, m_psg[1], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0)
+ AY8910(config, m_psg[1], 5.0688_MHz_XTAL / 6); // from 8035 pin 1 (T0)
m_psg[1]->port_a_read_callback().set_ioport("JO");
m_psg[1]->port_b_read_callback().set_ioport("I1");
m_psg[1]->add_route(ALL_OUTPUTS, "mono", 0.50);
diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp
index 4bb9b1ce227..5fdd5257d23 100644
--- a/src/mame/drivers/taito_f2.cpp
+++ b/src/mame/drivers/taito_f2.cpp
@@ -5298,14 +5298,14 @@ void taitof2_state::init_finalb()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
- const u16 *c0base = gx0->get_data(c);
- const u16 *c1base = gx1->get_data(c);
+ const u8 *c0base = gx0->get_data(c);
+ const u8 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
- const u16 *c0 = c0base;
- const u16 *c1 = c1base;
+ const u8 *c0 = c0base;
+ const u8 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
{
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp
index 2615e49bdba..13db66e85d1 100644
--- a/src/mame/drivers/taito_f3.cpp
+++ b/src/mame/drivers/taito_f3.cpp
@@ -4217,14 +4217,14 @@ void taito_f3_state::tile_decode()
dest = srcdata;
for (int c = 0; c < spr_gfx->elements(); c++)
{
- const u16 *c1base = spr_gfx->get_data(c);
- const u16 *c3base = spr_gfx_hi->get_data(c);
+ const u8 *c1base = spr_gfx->get_data(c);
+ const u8 *c3base = spr_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < spr_gfx->height(); y++)
{
- const u16 *c1 = c1base;
- const u16 *c3 = c3base;
+ const u8 *c1 = c1base;
+ const u8 *c3 = c3base;
/* Expand 2bits into 4bits format */
for (int x = 0; x < spr_gfx->width(); x++)
@@ -4251,14 +4251,14 @@ void taito_f3_state::tile_decode()
dest = srcdata;
for (int c = 0; c < pf_gfx->elements(); c++)
{
- const u16 *c0base = pf_gfx->get_data(c);
- const u16 *c2base = pf_gfx_hi->get_data(c);
+ const u8 *c0base = pf_gfx->get_data(c);
+ const u8 *c2base = pf_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < pf_gfx->height(); y++)
{
- const u16 *c0 = c0base;
- const u16 *c2 = c2base;
+ const u8 *c0 = c0base;
+ const u8 *c2 = c2base;
for (int x = 0; x < pf_gfx->width(); x++)
*dest++ = (*c0++ & 0xf) | (*c2++ & 0x30);
diff --git a/src/mame/drivers/zwackery.cpp b/src/mame/drivers/zwackery.cpp
index a361e938d69..d9d7a5f4cc3 100644
--- a/src/mame/drivers/zwackery.cpp
+++ b/src/mame/drivers/zwackery.cpp
@@ -210,14 +210,14 @@ void zwackery_state::video_start()
for (int code = 0; code < gfx0->elements(); code++)
{
const uint8_t *coldata = colordatabase + code * 32;
- const uint16_t *gfxdata0 = gfx0->get_data(code);
- const uint16_t *gfxdata2 = gfx2->get_data(code);
+ const uint8_t *gfxdata0 = gfx0->get_data(code);
+ const uint8_t *gfxdata2 = gfx2->get_data(code);
// assume 16 rows
for (int y = 0; y < 16; y++)
{
- const uint16_t *gd0 = gfxdata0;
- const uint16_t *gd2 = gfxdata2;
+ const uint8_t *gd0 = gfxdata0;
+ const uint8_t *gd2 = gfxdata2;
// 16 columns
for (int x = 0; x < 16; x++, gd0++, gd2++)