summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author David Haywood <hazemamewip@hotmail.com>2018-02-14 20:41:10 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2018-02-14 15:41:10 -0500
commit37223350a90a539d525675cca373408e95f910af (patch)
tree68c3adeea285afa7d0e013f959c35c8947d1348f
parent80c9f0496fd38a1ff2afba40ee4a4e7d200ac3a0 (diff)
xavix - rad_mtrk sprite improvements (#3202)
* xavix - rad_mtrk sprite improvements * alt addressing mode for taitons1 xavix logo, not sure how this gets enabled yet (nw) * there's a 2nd tilemap (nw) * various stubs for notekeeping (nw)
-rw-r--r--src/mame/drivers/xavix.cpp581
1 files changed, 501 insertions, 80 deletions
diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp
index 4de7e25d6fe..48448335f6b 100644
--- a/src/mame/drivers/xavix.cpp
+++ b/src/mame/drivers/xavix.cpp
@@ -46,18 +46,20 @@ public:
m_mainram(*this, "mainram"),
m_spr_attr0(*this, "spr_attr0"),
m_spr_attr1(*this, "spr_attr1"),
- m_spr_ypos(*this, "spr_attr2"),
- m_spr_xpos(*this, "spr_attr3"),
- m_spr_attr5(*this, "spr_attr5"),
- m_spr_attr6(*this, "spr_attr6"),
- m_spr_attr7(*this, "spr_attr7"),
+ m_spr_ypos(*this, "spr_ypos"),
+ m_spr_xpos(*this, "spr_xpos"),
+ m_spr_addr_lo(*this, "spr_addr_lo"),
+ m_spr_addr_md(*this, "spr_addr_md"),
+ m_spr_addr_hi(*this, "spr_addr_hi"),
m_palram1(*this, "palram1"),
m_palram2(*this, "palram2"),
m_spr_attra(*this, "spr_attra"),
m_palette(*this, "palette"),
m_in0(*this, "IN0"),
m_in1(*this, "IN1"),
- m_gfxdecode(*this, "gfxdecode")
+ m_gfxdecode(*this, "gfxdecode"),
+ m_alt_addressing(0),
+ m_tilemap_enabled(1)
{ }
// devices
@@ -94,14 +96,48 @@ public:
DECLARE_WRITE8_MEMBER(irq_vector1_lo_w);
DECLARE_WRITE8_MEMBER(irq_vector1_hi_w);
+ DECLARE_READ8_MEMBER(xavix_6ff0_r);
+ DECLARE_WRITE8_MEMBER(xavix_6ff0_w);
+
+ DECLARE_READ8_MEMBER(xavix_6ff8_r);
+ DECLARE_WRITE8_MEMBER(xavix_6ff8_w);
+
+ DECLARE_READ8_MEMBER(xavix_75f0_r);
+ DECLARE_WRITE8_MEMBER(xavix_75f0_w);
+
+ DECLARE_READ8_MEMBER(xavix_75f1_r);
+ DECLARE_WRITE8_MEMBER(xavix_75f1_w);
+
DECLARE_READ8_MEMBER(xavix_75f4_r);
DECLARE_READ8_MEMBER(xavix_75f5_r);
+ DECLARE_READ8_MEMBER(xavix_75f6_r);
DECLARE_WRITE8_MEMBER(xavix_75f6_w);
+
DECLARE_WRITE8_MEMBER(xavix_75f7_w);
+
+ DECLARE_READ8_MEMBER(xavix_75f8_r);
DECLARE_WRITE8_MEMBER(xavix_75f8_w);
+
+ DECLARE_READ8_MEMBER(xavix_75f9_r);
DECLARE_WRITE8_MEMBER(xavix_75f9_w);
+
+ DECLARE_READ8_MEMBER(xavix_75fa_r);
+ DECLARE_WRITE8_MEMBER(xavix_75fa_w);
+ DECLARE_READ8_MEMBER(xavix_75fb_r);
+ DECLARE_WRITE8_MEMBER(xavix_75fb_w);
+ DECLARE_READ8_MEMBER(xavix_75fc_r);
+ DECLARE_WRITE8_MEMBER(xavix_75fc_w);
+ DECLARE_READ8_MEMBER(xavix_75fd_r);
+ DECLARE_WRITE8_MEMBER(xavix_75fd_w);
+
+ DECLARE_WRITE8_MEMBER(xavix_75fe_w);
DECLARE_WRITE8_MEMBER(xavix_75ff_w);
- DECLARE_READ8_MEMBER(xavix_75f9_r);
+
+ DECLARE_WRITE8_MEMBER(xavix_6fc0_w);
+ DECLARE_WRITE8_MEMBER(xavix_6fc8_w);
+ DECLARE_WRITE8_MEMBER(xavix_6fd8_w);
+ DECLARE_WRITE8_MEMBER(xavix_6fd7_w);
+ DECLARE_READ8_MEMBER(xavix_6fd7_r);
DECLARE_READ8_MEMBER(pal_ntsc_r);
@@ -112,6 +148,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
DECLARE_DRIVER_INIT(xavix);
+ DECLARE_DRIVER_INIT(taitons1);
void xavix_map(address_map &map);
protected:
@@ -144,6 +181,21 @@ private:
uint8_t m_vid_dma_param1[2];
uint8_t m_vid_dma_param2[2];
+ uint8_t m_6fc8_regs[8];
+
+ uint8_t m_6ff0;
+ uint8_t m_6ff8;
+
+ uint8_t m_75f0;
+ uint8_t m_75f1;
+
+ uint8_t m_75f6;
+ uint8_t m_75f8;
+ uint8_t m_75fa;
+ uint8_t m_75fb;
+ uint8_t m_75fc;
+ uint8_t m_75fd;
+
uint8_t get_vectors(int which, int half);
required_shared_ptr<uint8_t> m_mainram;
@@ -153,9 +205,9 @@ private:
required_shared_ptr<uint8_t> m_spr_ypos;
required_shared_ptr<uint8_t> m_spr_xpos;
- required_shared_ptr<uint8_t> m_spr_attr5;
- required_shared_ptr<uint8_t> m_spr_attr6;
- required_shared_ptr<uint8_t> m_spr_attr7;
+ required_shared_ptr<uint8_t> m_spr_addr_lo;
+ required_shared_ptr<uint8_t> m_spr_addr_md;
+ required_shared_ptr<uint8_t> m_spr_addr_hi;
required_shared_ptr<uint8_t> m_palram1;
required_shared_ptr<uint8_t> m_palram2;
@@ -174,8 +226,42 @@ private:
int m_rgnlen;
uint8_t* m_rgn;
+
+ // variables used by rendering
+ int m_tmp_dataaddress;
+ int m_tmp_databit;
+ void set_data_address(int address, int bit);
+ uint8_t get_next_bit();
+
+ int m_alt_addressing;
+ int m_tilemap_enabled;
+
};
+void xavix_state::set_data_address(int address, int bit)
+{
+ m_tmp_dataaddress = address;
+ m_tmp_databit = bit;
+}
+
+uint8_t xavix_state::get_next_bit()
+{
+ uint8_t bit = m_rgn[m_tmp_dataaddress & (m_rgnlen - 1)];
+ bit = bit >> m_tmp_databit;
+ bit &= 1;
+
+ m_tmp_databit++;
+
+ if (m_tmp_databit == 8)
+ {
+ m_tmp_databit = 0;
+ m_tmp_dataaddress++;
+ }
+
+ return bit;
+}
+
+
void xavix_state::video_start()
{
}
@@ -207,13 +293,13 @@ void xavix_state::handle_palette(screen_device &screen, bitmap_ind16 &bitmap, co
int h_raw = (dat & 0x001f) >> 0;
//if (h_raw > 24)
- // printf("hraw >24 (%02x)\n", h_raw);
+ // logerror("hraw >24 (%02x)\n", h_raw);
//if (l_raw > 17)
- // printf("lraw >17 (%02x)\n", l_raw);
+ // logerror("lraw >17 (%02x)\n", l_raw);
//if (sl_raw > 7)
- // printf("sl_raw >5 (%02x)\n", sl_raw);
+ // logerror("sl_raw >5 (%02x)\n", sl_raw);
double l = (double)l_raw / 17.0f;
double s = (double)sl_raw / 7.0f;
@@ -242,54 +328,192 @@ void xavix_state::handle_palette(screen_device &screen, bitmap_ind16 &bitmap, co
}
-uint32_t xavix_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
+uint32_t xavix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
handle_palette(screen, bitmap, cliprect);
- // why are the first two logos in Monster Truck stored as tilemaps in main ram?
- // test mode isn't? is the code meant to process them instead? - there are no sprites in the sprite list at the time (and only one in test mode)
- gfx_element *gfx = m_gfxdecode->gfx(1);
- int count = 0;
- for (int y = 0; y < 16; y++)
+ bitmap.fill(0, cliprect);
+
+ if (m_tilemap_enabled)
{
- for (int x = 0; x < 16; x++)
+ // why are the first two logos in Monster Truck stored as tilemaps in main ram?
+ // test mode isn't? is the code meant to process them instead? - there are no sprites in the sprite list at the time (and only one in test mode)
+ gfx_element *gfx;
+ int count;
+
+ count = 0;
+ gfx = m_gfxdecode->gfx(1);
+ for (int y = 0; y < 16; y++)
{
- int tile = m_mainram[count++];
-
- int gfxbase = (m_spr_attra[1] << 8) | (m_spr_attra[0]);
- // upper bit is often set, maybe just because it relies on mirroring, maybe other purpose
+ for (int x = 0; x < 16; x++)
+ {
+ int tile = m_mainram[count];
+ tile |= (m_mainram[count+0x100]<<8);
+ count++;
+
+ int gfxbase = (m_spr_attra[1] << 8) | (m_spr_attra[0]);
+ // upper bit is often set, maybe just because it relies on mirroring, maybe other purpose
- tile += (gfxbase<<1);
+ tile += (gfxbase << 1);
- gfx->opaque(bitmap,cliprect,tile,0,0,0,x*16,y*16);
+ gfx->opaque(bitmap, cliprect, tile, 0, 0, 0, x * 16, y * 16);
+ }
}
+
+
+ // there is a 2nd layer in monster truck too, there must be more to the gfxbase tho, because the lower layer can't be using the same gfxbase..
+ count = 0x200;
+ gfx = m_gfxdecode->gfx(0);
+ for (int y = 0; y < 32; y++)
+ {
+ for (int x = 0; x < 32; x++)
+ {
+ int tile = m_mainram[count];
+ tile |= (m_mainram[count+0x400]<<8);
+ count++;
+
+ int gfxbase = (m_spr_attra[1] << 8) | (m_spr_attra[0]);
+ // upper bit is often set, maybe just because it relies on mirroring, maybe other purpose
+
+ // even the transpen makes no sense here, it's 0 on the used elements, 15 on the unused ones.. are 00 tiles just ignored?
+ if (tile)
+ {
+ tile += (gfxbase << 3);
+ gfx->transpen(bitmap, cliprect, tile, 0, 0, 0, x * 8, (y * 8) - 16, 0);
+ }
+ }
+ }
+
+
+
+
}
-
- //printf("frame\n");
- for (int i = 0; i < 0x100; i++)
+
+ //logerror("frame\n");
+ // priority doesn't seem to be based on list order, there are bad sprite-sprite priorities with either forward or reverse
+ for (int i = 0xff; i >= 0; i--)
{
+ /* attribute 0 bits
+ pppp bbb- p = palette, b = bpp
+
+ attribute 1 bits
+ ---- ss-f s = size, f = flipx
+ */
+
int ypos = m_spr_ypos[i];
int xpos = m_spr_xpos[i];
- int tile = m_spr_attr6[i];
- tile += 0x4b00;
+ int tile = (m_spr_addr_hi[i] << 16) | (m_spr_addr_md[i] << 8) | m_spr_addr_lo[i];
+ int attr0 = m_spr_attr0[i];
+ int attr1 = m_spr_attr1[i];
+
+ int pal = (attr0 & 0xf0) >> 4;
+ int flipx = (attr1 & 0x01);
+
+ int drawheight = 16;
+ int drawwidth = 16;
+
+ tile &= (m_rgnlen - 1);
+
+ // taito nostalgia 1 also seems to use a different addressing, is it selectable or is the chip different?
+ // taito nost attr1 is 84 / 80 / 88 / 8c for the various elements of the xavix logo. monster truck uses ec / fc / dc / 4c / 5c / 6c (final 6 sprites ingame are 00 00 f0 f0 f0 f0, radar?)
+
+ if ((attr1 & 0x0c) == 0x0c)
+ {
+ drawheight = 16;
+ drawwidth = 16;
+ if (m_alt_addressing)
+ tile = tile * 128;
+ }
+ else if ((attr1 & 0x0c) == 0x08)
+ {
+ drawheight = 16;
+ drawwidth = 8;
+ xpos += 4;
+ if (m_alt_addressing)
+ tile = tile * 64;
+ }
+ else if ((attr1 & 0x0c) == 0x04)
+ {
+ drawheight = 8;
+ drawwidth = 16;
+ ypos -= 4;
+ if (m_alt_addressing)
+ tile = tile * 64;
+ }
+ else if ((attr1 & 0x0c) == 0x00)
+ {
+ drawheight = 8;
+ drawwidth = 8;
+ xpos += 4;
+ ypos -= 4;
+ if (m_alt_addressing)
+ tile = tile * 32;
+ }
+
+ if (m_alt_addressing)
+ tile += 0xd8000;
ypos = 0xff - ypos;
xpos -= 136;
- ypos -= 192;
+ ypos -= 152;
+ xpos &= 0xff;
+ ypos &= 0xff;
- xpos &=0xff;
- ypos &=0xff;
+ if (ypos >=192)
+ ypos -= 256;
+
+ int bpp = 1;
+
+ bpp = (attr0 & 0x0e) >> 1;
+ bpp += 1;
+
+ // set the address here so we can increment in bits in the draw function
+ set_data_address(tile, 0);
+
+ for (int y = 0; y < drawheight; y++)
+ {
+ int row = ypos + y;
+
+ for (int x = 0; x < drawwidth; x++)
+ {
+
+ int col;
+
+ if (flipx)
+ {
+ col = xpos - x;
+ }
+ else
+ {
+ col = xpos + x;
+ }
+
+ uint8_t dat = 0;
+
+ for (int i = 0; i < bpp; i++)
+ {
+ dat |= (get_next_bit() << i);
+ }
+
+ if ((row >= cliprect.min_x && row < cliprect.max_x) && (col >= cliprect.min_y && col < cliprect.max_y))
+ {
+ uint16_t* rowptr;
+
+ rowptr = &bitmap.pix16(row);
+ if (dat)
+ rowptr[col] = (dat + (pal << 4)) & 0xff;
+ }
+ }
+
+ }
- //if (!(ypos & 1))
-
- gfx->transpen(bitmap,cliprect,tile,10,0,0,xpos,ypos,0);
/*
if ((m_spr_ypos[i] != 0x81) && (m_spr_ypos[i] != 0x80) && (m_spr_ypos[i] != 0x00))
{
- printf("sprite with enable? %02x attr0 %02x attr1 %02x attr3 %02x attr5 %02x attr6 %02x attr7 %02x\n", m_spr_ypos[i], m_spr_attr0[i], m_spr_attr1[i], m_spr_xpos[i], m_spr_attr5[i], m_spr_attr6[i], m_spr_attr7[i] );
+ logerror("sprite with enable? %02x attr0 %02x attr1 %02x attr3 %02x attr5 %02x attr6 %02x attr7 %02x\n", m_spr_ypos[i], m_spr_attr0[i], m_spr_attr1[i], m_spr_xpos[i], m_spr_addr_lo[i], m_spr_addr_md[i], m_spr_addr_hi[i] );
}
*/
}
@@ -427,25 +651,153 @@ TIMER_DEVICE_CALLBACK_MEMBER(xavix_state::scanline_cb)
INTERRUPT_GEN_MEMBER(xavix_state::interrupt)
{
-// if (m_irq_enable_data != 0)
-// m_maincpu->set_input_line(INPUT_LINE_IRQ0,HOLD_LINE);
+ // if (m_irq_enable_data != 0)
+ // m_maincpu->set_input_line(INPUT_LINE_IRQ0,HOLD_LINE);
if (m_irq_enable_data != 0)
- m_maincpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE);
+ {
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ }
+}
+
+
+
+READ8_MEMBER(xavix_state::xavix_6ff0_r)
+{
+ //logerror("%s: xavix_6ff0_r\n", machine().describe_context());
+ return m_6ff0;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_6ff0_w)
+{
+ // expected to return data written
+ m_6ff0 = data;
+ //logerror("%s: xavix_6ff0_w %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_6ff8_r)
+{
+ //logerror("%s: xavix_6ff8_r\n", machine().describe_context());
+ return m_6ff8;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_6ff8_w)
+{
+ // I think this is something to do with IRQ ack / enable
+ m_6ff8 = data;
+ logerror("%s: xavix_6ff8_w %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_75f0_r)
+{
+ logerror("%s: xavix_75f0_r\n", machine().describe_context());
+ return m_75f0;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_75f0_w)
+{
+ // expected to return data written
+ m_75f0 = data;
+ logerror("%s: xavix_75f0_w %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_75f1_r)
+{
+ logerror("%s: xavix_75f1_r\n", machine().describe_context());
+ return m_75f1;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_75f1_w)
+{
+ // expected to return data written
+ m_75f1 = data;
+ logerror("%s: xavix_75f1_w %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_75f6_r)
+{
+ logerror("%s: xavix_75f6_w\n", machine().describe_context());
+ return m_75f6;
}
WRITE8_MEMBER(xavix_state::xavix_75f6_w)
{
+ // expected to return data written
+ m_75f6 = data;
logerror("%s: xavix_75f6_w %02x\n", machine().describe_context(), data);
}
+READ8_MEMBER(xavix_state::xavix_75fa_r)
+{
+ logerror("%s: xavix_75fa_w\n", machine().describe_context());
+ return m_75fa;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_75fa_w)
+{
+ // expected to return data written
+ m_75fa = data;
+ logerror("%s: xavix_75fa_w %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_75fb_r)
+{
+ logerror("%s: xavix_75fb_w\n", machine().describe_context());
+ return m_75fb;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_75fb_w)
+{
+ // expected to return data written
+ m_75fb = data;
+ logerror("%s: xavix_75fb_w %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_75fc_r)
+{
+ logerror("%s: xavix_75fc_w\n", machine().describe_context());
+ return m_75fc;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_75fc_w)
+{
+ // expected to return data written
+ m_75fc = data;
+ logerror("%s: xavix_75fc_w %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_75fd_r)
+{
+ logerror("%s: xavix_75fd_w\n", machine().describe_context());
+ return m_75fd;
+}
+
+WRITE8_MEMBER(xavix_state::xavix_75fd_w)
+{
+ // expected to return data written
+ m_75fd = data;
+ logerror("%s: xavix_75fd_w %02x\n", machine().describe_context(), data);
+}
+
+
+
+
+
WRITE8_MEMBER(xavix_state::xavix_75f7_w)
{
logerror("%s: xavix_75f7_w %02x\n", machine().describe_context(), data);
}
+READ8_MEMBER(xavix_state::xavix_75f8_r)
+{
+ logerror("%s: xavix_75f8_r\n", machine().describe_context());
+ return m_75f8;
+}
+
WRITE8_MEMBER(xavix_state::xavix_75f8_w)
{
+ // expected to return data written
+ m_75f8 = data;
logerror("%s: xavix_75f8_w %02x\n", machine().describe_context(), data);
}
@@ -454,6 +806,11 @@ WRITE8_MEMBER(xavix_state::xavix_75f9_w)
logerror("%s: xavix_75f9_w %02x\n", machine().describe_context(), data);
}
+WRITE8_MEMBER(xavix_state::xavix_75fe_w)
+{
+ logerror("%s: xavix_75fe_w %02x\n", machine().describe_context(), data);
+}
+
WRITE8_MEMBER(xavix_state::xavix_75ff_w)
{
logerror("%s: xavix_75ff_w %02x\n", machine().describe_context(), data);
@@ -615,9 +972,44 @@ READ8_MEMBER(xavix_state::pal_ntsc_r)
{
// only seen 0x10 checked in code
// in monster truck the tile base address gets set based on this, there are 2 copies of the test screen in rom, one for pal, one for ntsc, see 1854c
- return 0x10;
+ return 0x00; // NTSC
+ //return 0x10; // PAL
+}
+
+WRITE8_MEMBER(xavix_state::xavix_6fc0_w)
+{
+ //logerror("%s: xavix_6fc0_w data %02x\n", machine().describe_context(), data);
+}
+
+WRITE8_MEMBER(xavix_state::xavix_6fc8_w)
+{
+ // 0x4 and 0x5 appear to be bg tilemap scroll
+
+ if ((offset != 0x4) && (offset != 0x5))
+ {
+ logerror("%s: xavix_6fc8_w offset %02x data %02x\n", machine().describe_context(), offset, data);
+ }
+
+ COMBINE_DATA(&m_6fc8_regs[offset]);
+}
+
+WRITE8_MEMBER(xavix_state::xavix_6fd8_w)
+{
+ logerror("%s: xavix_6fd8_w data %02x\n", machine().describe_context(), data);
+}
+
+WRITE8_MEMBER(xavix_state::xavix_6fd7_w)
+{
+ logerror("%s: xavix_6fd7_w data %02x\n", machine().describe_context(), data);
+}
+
+READ8_MEMBER(xavix_state::xavix_6fd7_r)
+{
+ logerror("%s: xavix_6fd7_r\n", machine().describe_context());
+ return machine().rand();
}
+
// DATA reads from 0x8000-0xffff are banked by byte 0xff of 'ram' (this is handled in the CPU core)
ADDRESS_MAP_START(xavix_state::xavix_map)
@@ -628,31 +1020,24 @@ ADDRESS_MAP_START(xavix_state::xavix_map)
// appears to be 256 sprites (shares will be renamed once their purpose is known)
AM_RANGE(0x006000, 0x0060ff) AM_RAM AM_SHARE("spr_attr0")
AM_RANGE(0x006100, 0x0061ff) AM_RAM AM_SHARE("spr_attr1")
- AM_RANGE(0x006200, 0x0062ff) AM_RAM AM_SHARE("spr_attr2") // cleared to 0x8f0 by both games, maybe enable registers?
- AM_RANGE(0x006300, 0x0063ff) AM_RAM AM_SHARE("spr_attr3")
+ AM_RANGE(0x006200, 0x0062ff) AM_RAM AM_SHARE("spr_ypos") // cleared to 0x8f0 by both games, maybe enable registers?
+ AM_RANGE(0x006300, 0x0063ff) AM_RAM AM_SHARE("spr_xpos")
AM_RANGE(0x006400, 0x0064ff) AM_RAM // 6400 range unused by code, does it exist?
- AM_RANGE(0x006500, 0x0065ff) AM_RAM AM_SHARE("spr_attr5")
- AM_RANGE(0x006600, 0x0066ff) AM_RAM AM_SHARE("spr_attr6")
- AM_RANGE(0x006700, 0x0067ff) AM_RAM AM_SHARE("spr_attr7")
+ AM_RANGE(0x006500, 0x0065ff) AM_RAM AM_SHARE("spr_addr_lo")
+ AM_RANGE(0x006600, 0x0066ff) AM_RAM AM_SHARE("spr_addr_md")
+ AM_RANGE(0x006700, 0x0067ff) AM_RAM AM_SHARE("spr_addr_hi")
AM_RANGE(0x006800, 0x0068ff) AM_RAM AM_SHARE("palram1") // written with 6900
AM_RANGE(0x006900, 0x0069ff) AM_RAM AM_SHARE("palram2") // startup (taitons1)
AM_RANGE(0x006a00, 0x006a1f) AM_RAM AM_SHARE("spr_attra") // test mode, pass flag 0x20
- /*
- AM_RANGE(0x006fc0, 0x006fc0) AM_WRITENOP // startup
+
+ AM_RANGE(0x006fc0, 0x006fc0) AM_WRITE(xavix_6fc0_w) // startup
- AM_RANGE(0x006fc8, 0x006fc8) AM_WRITENOP
- AM_RANGE(0x006fc9, 0x006fc9) AM_WRITENOP
- AM_RANGE(0x006fca, 0x006fca) AM_WRITENOP
- AM_RANGE(0x006fcb, 0x006fcb) AM_WRITENOP
- AM_RANGE(0x006fcc, 0x006fcc) AM_WRITENOP
- AM_RANGE(0x006fcd, 0x006fcd) AM_WRITENOP
- AM_RANGE(0x006fce, 0x006fce) AM_WRITENOP
- AM_RANGE(0x006fcf, 0x006fcf) AM_WRITENOP
+ AM_RANGE(0x006fc8, 0x006fcf) AM_WRITE(xavix_6fc8_w) // video registers
- //AM_RANGE(0x006fd7, 0x006fd7) AM_READNOP AM_WRITENOP
- AM_RANGE(0x006fd8, 0x006fd8) AM_WRITENOP // startup (taitons1)
- */
+ AM_RANGE(0x006fd7, 0x006fd7) AM_READWRITE(xavix_6fd7_r, xavix_6fd7_w)
+ AM_RANGE(0x006fd8, 0x006fd8) AM_WRITE(xavix_6fd8_w) // startup (taitons1)
+
AM_RANGE(0x006fe0, 0x006fe0) AM_READWRITE(vid_dma_trigger_r, vid_dma_trigger_w) // after writing to 6fe1/6fe2 and 6fe5/6fe6 rad_mtrk writes 0x43/0x44 here then polls on 0x40 (see function call at c273) write values are hardcoded, similar code at 18401
AM_RANGE(0x006fe1, 0x006fe2) AM_WRITE(vid_dma_params_1_w)
AM_RANGE(0x006fe5, 0x006fe6) AM_WRITE(vid_dma_params_2_w)
@@ -660,38 +1045,38 @@ ADDRESS_MAP_START(xavix_state::xavix_map)
// function in rad_mtrk at 0184b7 uses this
AM_RANGE(0x006fe8, 0x006fe8) AM_RAM // r/w tested
AM_RANGE(0x006fe9, 0x006fe9) AM_RAM // r/w tested
- AM_RANGE(0x006fea, 0x006fea) AM_WRITENOP
+ //AM_RANGE(0x006fea, 0x006fea) AM_WRITENOP
- AM_RANGE(0x006ff0, 0x006ff0) AM_RAM // r/w tested
- AM_RANGE(0x006ff1, 0x006ff1) AM_WRITENOP // startup - cleared in interrupt 0
- AM_RANGE(0x006ff2, 0x006ff2) AM_WRITENOP // set to 07 after clearing above things in interrupt 0
+ AM_RANGE(0x006ff0, 0x006ff0) AM_READWRITE(xavix_6ff0_r, xavix_6ff0_w) // r/w tested
+ //AM_RANGE(0x006ff1, 0x006ff1) AM_WRITENOP // startup - cleared in interrupt 0
+ //AM_RANGE(0x006ff2, 0x006ff2) AM_WRITENOP // set to 07 after clearing above things in interrupt 0
- AM_RANGE(0x006ff8, 0x006ff8) AM_RAM // always seems to be a read/store or read/modify/store
+ AM_RANGE(0x006ff8, 0x006ff8) AM_READWRITE(xavix_6ff8_r, xavix_6ff8_w) // always seems to be a read/store or read/modify/store
AM_RANGE(0x006ff9, 0x006ff9) AM_READ(pal_ntsc_r)
// 7xxx ranges system controller?
- AM_RANGE(0x0075f0, 0x0075f0) AM_RAM // r/w tested read/written 8 times in a row
- AM_RANGE(0x0075f1, 0x0075f1) AM_RAM // r/w tested read/written 8 times in a row
+ AM_RANGE(0x0075f0, 0x0075f0) AM_READWRITE(xavix_75f0_r, xavix_75f0_w) // r/w tested read/written 8 times in a row
+ AM_RANGE(0x0075f1, 0x0075f1) AM_READWRITE(xavix_75f1_r, xavix_75f1_w) // r/w tested read/written 8 times in a row
+ AM_RANGE(0x0075f3, 0x0075f3) AM_RAM
AM_RANGE(0x0075f4, 0x0075f4) AM_READ(xavix_75f4_r) // related to 75f0 (read after writing there - rad_mtrk)
AM_RANGE(0x0075f5, 0x0075f5) AM_READ(xavix_75f5_r) // related to 75f1 (read after writing there - rad_mtrk)
// taitons1 after 75f7/75f8
- AM_RANGE(0x0075f6, 0x0075f6) AM_RAM // r/w tested AM_WRITE(xavix_75f6_w)
+ AM_RANGE(0x0075f6, 0x0075f6) AM_READWRITE(xavix_75f6_r, xavix_75f6_w) // r/w tested
// taitons1 written as a pair
- //AM_RANGE(0x0075f7, 0x0075f7) AM_WRITE(xavix_75f7_w)
- AM_RANGE(0x0075f8, 0x0075f8) AM_RAM // r/w tested AM_WRITE(xavix_75f8_w)
+ AM_RANGE(0x0075f7, 0x0075f7) AM_WRITE(xavix_75f7_w)
+ AM_RANGE(0x0075f8, 0x0075f8) AM_READWRITE(xavix_75f8_r, xavix_75f8_w) // r/w tested
// taitons1 written after 75f6, then read
- //AM_RANGE(0x0075f9, 0x0075f9) AM_READWRITE(xavix_75f9_r, xavix_75f9_w)
+ AM_RANGE(0x0075f9, 0x0075f9) AM_READWRITE(xavix_75f9_r, xavix_75f9_w)
// at another time
- AM_RANGE(0x0075fa, 0x0075fa) AM_RAM // r/w tested
- AM_RANGE(0x0075fb, 0x0075fb) AM_RAM // r/w tested
- AM_RANGE(0x0075fc, 0x0075fc) AM_RAM // r/w tested
-
- AM_RANGE(0x0075fd, 0x0075fd) AM_RAM // r/w tested
- //AM_RANGE(0x0075fe, 0x0075fe) AM_WRITENOP
+ AM_RANGE(0x0075fa, 0x0075fa) AM_READWRITE(xavix_75fa_r, xavix_75fa_w) // r/w tested
+ AM_RANGE(0x0075fb, 0x0075fb) AM_READWRITE(xavix_75fb_r, xavix_75fb_w) // r/w tested
+ AM_RANGE(0x0075fc, 0x0075fc) AM_READWRITE(xavix_75fc_r, xavix_75fc_w) // r/w tested
+ AM_RANGE(0x0075fd, 0x0075fd) AM_READWRITE(xavix_75fd_r, xavix_75fd_w) // r/w tested
+ AM_RANGE(0x0075fe, 0x0075fe) AM_WRITE(xavix_75fe_w)
// taitons1 written other 75xx operations
- //AM_RANGE(0x0075ff, 0x0075ff) AM_WRITE(xavix_75ff_w)
+ AM_RANGE(0x0075ff, 0x0075ff) AM_WRITE(xavix_75ff_w)
//AM_RANGE(0x007810, 0x007810) AM_WRITENOP // startup
@@ -720,7 +1105,7 @@ ADDRESS_MAP_START(xavix_state::xavix_map)
//AM_RANGE(0x007a80, 0x007a80) AM_WRITENOP
//AM_RANGE(0x007b80, 0x007b80) AM_READNOP
- //AM_RANGE(0x007b81, 0x007b81) AM_WRITENOP
+ //AM_RANGE(0x007b81, 0x007b81) AM_WRITENOP // every frame?
//AM_RANGE(0x007b82, 0x007b82) AM_WRITENOP
//AM_RANGE(0x007c01, 0x007c01) AM_RAM // r/w tested
@@ -901,6 +1286,34 @@ void xavix_state::machine_reset()
m_irq_vector0_hi_data = 0;
m_irq_vector1_lo_data = 0;
m_irq_vector1_hi_data = 0;
+
+ m_6ff0 = 0;
+ m_6ff8 = 0;
+
+ m_75f0 = 0;
+ m_75f1 = 0;
+
+ m_75f6 = 0;
+ m_75f8 = 0;
+ m_75fa = 0;
+ m_75fb = 0;
+ m_75fc = 0;
+ m_75fd = 0;
+
+ for (int i = 0; i < 3; i++)
+ m_multparams[i] = 0;
+
+ for (int i = 0; i < 2; i++)
+ m_multresults[i] = 0;
+
+ for (int i = 0; i < 2; i++)
+ {
+ m_vid_dma_param1[i] = 0;
+ m_vid_dma_param2[i] = 0;
+ }
+
+ for (int i = 0; i < 8; i++)
+ m_6fc8_regs[i] = 0;
}
typedef device_delegate<uint8_t (int which, int half)> xavix_interrupt_vector_delegate;
@@ -964,6 +1377,14 @@ DRIVER_INIT_MEMBER(xavix_state,xavix)
space.install_rom(0x8000, m_rgnlen, ((~(m_rgnlen-1))<<1)&0xffffff, m_rgn+0x8000);
}
+DRIVER_INIT_MEMBER(xavix_state, taitons1)
+{
+ DRIVER_INIT_CALL(xavix);
+ m_alt_addressing = 1;
+ m_tilemap_enabled = 0;
+}
+
+
/***************************************************************************
Game driver(s)
@@ -1007,7 +1428,7 @@ ROM_END
/* Standalone TV Games */
-CONS( 2006, taitons1, 0, 0, xavix, xavix, xavix_state, xavix, "Bandai / SSD Company LTD / Taito", "Let's! TV Play Classic - Taito Nostalgia 1", MACHINE_IS_SKELETON )
+CONS( 2006, taitons1, 0, 0, xavix, xavix, xavix_state, taitons1, "Bandai / SSD Company LTD / Taito", "Let's! TV Play Classic - Taito Nostalgia 1", MACHINE_IS_SKELETON )
CONS( 2000, rad_ping, 0, 0, xavix, xavix, xavix_state, xavix, "Radica / SSD Company LTD / Simmer Technology", "Play TV Ping Pong", MACHINE_IS_SKELETON ) // "Simmer Technology" is also known as "Hummer Technology Co., Ltd"
CONS( 2003, rad_mtrk, 0, 0, xavix, rad_mtrk, xavix_state, xavix, "Radica / SSD Company LTD", "Play TV Monster Truck", MACHINE_IS_SKELETON )