summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/bus/hp_dio/hp98543.cpp3
-rw-r--r--src/devices/bus/hp_dio/hp98544.cpp1
-rw-r--r--src/devices/bus/hp_dio/hp98644.cpp4
-rw-r--r--src/devices/bus/hp_hil/hlebase.cpp4
-rw-r--r--src/devices/bus/hp_hil/hlebase.h4
-rw-r--r--src/devices/bus/hp_hil/hp_hil.cpp39
-rw-r--r--src/devices/bus/hp_hil/hp_hil.h13
-rw-r--r--src/devices/machine/tms9914.cpp49
-rw-r--r--src/devices/video/topcat.cpp10
-rw-r--r--src/mame/drivers/hp16500.cpp6
-rw-r--r--src/mame/drivers/hp9k_3xx.cpp19
-rw-r--r--src/mame/drivers/hp_ipc.cpp17
-rw-r--r--src/mame/drivers/xavix.cpp120
-rw-r--r--src/mame/includes/xavix.h66
-rw-r--r--src/mame/machine/xavix.cpp184
-rw-r--r--src/mame/video/xavix.cpp150
16 files changed, 428 insertions, 261 deletions
diff --git a/src/devices/bus/hp_dio/hp98543.cpp b/src/devices/bus/hp_dio/hp98543.cpp
index d6ef2a1065d..49bc08827e5 100644
--- a/src/devices/bus/hp_dio/hp98543.cpp
+++ b/src/devices/bus/hp_dio/hp98543.cpp
@@ -99,6 +99,9 @@ dio16_98543_device::dio16_98543_device(const machine_config &mconfig, device_typ
void dio16_98543_device::device_start()
{
+ save_item(NAME(m_intreg));
+ save_item(NAME(m_ints));
+
dio().install_memory(
0x200000, 0x27ffff,
read16_delegate(FUNC(dio16_98543_device::vram_r), this),
diff --git a/src/devices/bus/hp_dio/hp98544.cpp b/src/devices/bus/hp_dio/hp98544.cpp
index cebfa814ffd..9735541a6ef 100644
--- a/src/devices/bus/hp_dio/hp98544.cpp
+++ b/src/devices/bus/hp_dio/hp98544.cpp
@@ -100,6 +100,7 @@ device_memory_interface::space_config_vector dio16_98544_device::memory_space_co
void dio16_98544_device::device_start()
{
+ save_item(NAME(m_intreg));
dio().install_memory(
0x200000, 0x2fffff,
read16_delegate(FUNC(topcat_device::vram_r), static_cast<topcat_device*>(m_topcat)),
diff --git a/src/devices/bus/hp_dio/hp98644.cpp b/src/devices/bus/hp_dio/hp98644.cpp
index efc93c3e834..c45b3a5e593 100644
--- a/src/devices/bus/hp_dio/hp98644.cpp
+++ b/src/devices/bus/hp_dio/hp98644.cpp
@@ -139,6 +139,10 @@ ioport_constructor dio16_98644_device::device_input_ports() const
void dio16_98644_device::device_start()
{
+ save_item(NAME(m_installed_io));
+ save_item(NAME(m_control));
+ save_item(NAME(m_loopback));
+ save_item(NAME(m_data));
m_installed_io = false;
}
diff --git a/src/devices/bus/hp_hil/hlebase.cpp b/src/devices/bus/hp_hil/hlebase.cpp
index 5ac421a2497..836ef11cae8 100644
--- a/src/devices/bus/hp_hil/hlebase.cpp
+++ b/src/devices/bus/hp_hil/hlebase.cpp
@@ -42,6 +42,10 @@ hle_device_base::~hle_device_base()
void hle_device_base::device_start()
{
+
+ save_item(NAME(m_powerup));
+ save_item(NAME(m_passthru));
+
set_hp_hil_mlc_device();
m_powerup = true;
diff --git a/src/devices/bus/hp_hil/hlebase.h b/src/devices/bus/hp_hil/hlebase.h
index 58e320507fe..b5cbfa84bef 100644
--- a/src/devices/bus/hp_hil/hlebase.h
+++ b/src/devices/bus/hp_hil/hlebase.h
@@ -33,8 +33,10 @@ protected:
virtual int hil_poll() = 0;
private:
-
util::fifo<uint8_t, 8> m_fifo;
+
+ bool m_powerup;
+ bool m_passthru;
};
} // namespace bus::hp_hil
diff --git a/src/devices/bus/hp_hil/hp_hil.cpp b/src/devices/bus/hp_hil/hp_hil.cpp
index d1e20ec163e..02dbf69b61c 100644
--- a/src/devices/bus/hp_hil/hp_hil.cpp
+++ b/src/devices/bus/hp_hil/hp_hil.cpp
@@ -9,20 +9,8 @@
#include "emu.h"
#include "hp_hil.h"
-
-
-#define VERBOSE_DBG 0
-
-#define DBG_LOG(N,M,A) \
- do { \
- if(VERBOSE_DBG>=N) \
- { \
- if( M ) \
- logerror("%11.6f at %s: %-10s",machine().time().as_double(),machine().describe_context(),(char*)M ); \
- logerror A; \
- } \
- } while (0)
-
+//#define VERBOSE 1
+#include "logmacro.h"
//**************************************************************************
// GLOBAL VARIABLES
@@ -88,6 +76,13 @@ void hp_hil_mlc_device::device_start()
// resolve callbacks
int_cb.resolve_safe();
nmi_cb.resolve_safe();
+
+ save_item(NAME(m_r2));
+ save_item(NAME(m_r3));
+ save_item(NAME(m_w1));
+ save_item(NAME(m_w2));
+ save_item(NAME(m_w3));
+ save_item(NAME(m_loop));
}
@@ -107,17 +102,17 @@ WRITE8_MEMBER(hp_hil_mlc_device::write)
{
device_hp_hil_interface *entry = m_device_list.first();
uint16_t tmp = data | (m_w1 << 8);
- DBG_LOG(2,"Write", ("%d <- %02x\n", offset, data));
switch (offset)
{
case 0:
- DBG_LOG(1,"Transmit", ("%scommand 0x%02x to device %d\n", !m_loop?"loopback ":"", data, m_w1 & 7));
+ LOG("write: %scommand 0x%02x to device %d\n", !m_loop?"loopback ":"", data, m_w1 & 7);
m_fifo.clear();
if (m_loop & 2) // no devices on 2nd link loop
return;
+
if (m_loop == 0)
{
if (!m_fifo.full()) {
@@ -138,14 +133,17 @@ WRITE8_MEMBER(hp_hil_mlc_device::write)
break;
case 1:
+ LOG("write: W1=%02x\n", 0xf);
m_w1 = data & 0xf;
break;
case 2:
+ LOG("write: W2=%02x\n", data);
m_w2 = data;
break;
case 3:
+ LOG("write: W3=%02x\n", data);
m_w3 = data;
break;
@@ -183,15 +181,17 @@ READ8_MEMBER(hp_hil_mlc_device::read)
break;
}
- DBG_LOG(2,"Read", ("%d == %02x\n", offset, data));
+ LOG("Read %d == %02x\n", offset, data);
return data;
}
void hp_hil_mlc_device::hil_write(uint16_t data)
{
- DBG_LOG(1,"Receive", ("%s %04X fifo %s\n",
- BIT(data, 11)?"command":"data", data, m_fifo.full()?"full":(m_fifo.empty()?"empty":"ok")));
+ LOG("hil_write: %s %04X fifo %s\n",
+ BIT(data, 11) ? "command" : "data",
+ data,
+ m_fifo.full() ? "full" : (m_fifo.empty()?"empty":"ok"));
if (!m_fifo.full())
{
@@ -248,7 +248,6 @@ device_hp_hil_interface::device_hp_hil_interface(const machine_config &mconfig,
{
}
-
//-------------------------------------------------
// ~device_hp_hil_interface - destructor
//-------------------------------------------------
diff --git a/src/devices/bus/hp_hil/hp_hil.h b/src/devices/bus/hp_hil/hp_hil.h
index 6ed9d791ff7..4ee8984cdc9 100644
--- a/src/devices/bus/hp_hil/hp_hil.h
+++ b/src/devices/bus/hp_hil/hp_hil.h
@@ -79,17 +79,6 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
-#define MCFG_HP_HIL_INT_CALLBACK(_devcb) \
- downcast<hp_hil_mlc_device &>(*device).set_int_callback(DEVCB_##_devcb);
-
-#define MCFG_HP_HIL_NMI_CALLBACK(_devcb) \
- downcast<hp_hil_mlc_device &>(*device).set_nmi_callback(DEVCB_##_devcb);
-
-#define MCFG_HP_HIL_SLOT_ADD(_mlc_tag, _tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, HP_HIL_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
- downcast<hp_hil_slot_device &>(*device).set_hp_hil_slot(this, _mlc_tag);
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -193,8 +182,6 @@ protected:
int m_device_id;
uint16_t m_device_id16;
- bool m_powerup;
- bool m_passthru;
private:
device_hp_hil_interface *m_next;
diff --git a/src/devices/machine/tms9914.cpp b/src/devices/machine/tms9914.cpp
index 10010848f9d..a2892eed1cd 100644
--- a/src/devices/machine/tms9914.cpp
+++ b/src/devices/machine/tms9914.cpp
@@ -431,6 +431,55 @@ READ_LINE_MEMBER(tms9914_device::cont_r)
// device-level overrides
void tms9914_device::device_start()
{
+ save_item(NAME(m_int_line));
+ save_item(NAME(m_accrq_line));
+ save_item(NAME(m_dio));
+ save_item(NAME(m_signals));
+ save_item(NAME(m_ext_signals));
+ save_item(NAME(m_no_reflection));
+ save_item(NAME(m_ext_state_change));
+ save_item(NAME(m_reg_int0_status));
+ save_item(NAME(m_reg_int0_mask));
+ save_item(NAME(m_reg_int1_status));
+ save_item(NAME(m_reg_int1_mask));
+ save_item(NAME(m_reg_address));
+ save_item(NAME(m_reg_serial_p));
+ save_item(NAME(m_reg_parallel_p));
+ save_item(NAME(m_reg_2nd_parallel_p));
+ save_item(NAME(m_reg_di));
+ save_item(NAME(m_reg_do));
+ save_item(NAME(m_reg_ulpa));
+ save_item(NAME(m_swrst));
+ save_item(NAME(m_hdfa));
+ save_item(NAME(m_hdfe));
+ save_item(NAME(m_rtl));
+ save_item(NAME(m_gts));
+ save_item(NAME(m_rpp));
+ save_item(NAME(m_sic));
+ save_item(NAME(m_sre));
+ save_item(NAME(m_dai));
+ save_item(NAME(m_pts));
+ save_item(NAME(m_stdl));
+ save_item(NAME(m_shdw));
+ save_item(NAME(m_vstdl));
+ save_item(NAME(m_ah_state));
+ save_item(NAME(m_ah_adhs));
+ save_item(NAME(m_ah_anhs));
+ save_item(NAME(m_sh_state));
+ save_item(NAME(m_sh_shfs));
+ save_item(NAME(m_sh_vsts));
+ save_item(NAME(m_t_state));
+ save_item(NAME(m_t_tpas));
+ save_item(NAME(m_t_spms));
+ save_item(NAME(m_t_eoi_state));
+ save_item(NAME(m_l_state));
+ save_item(NAME(m_l_lpas));
+ save_item(NAME(m_sr_state));
+ save_item(NAME(m_rl_state));
+ save_item(NAME(m_pp_ppas));
+ save_item(NAME(m_c_state));
+ save_item(NAME(m_next_eoi));
+
m_dio_read_func.resolve_safe(0xff);
m_dio_write_func.resolve_safe();
for (auto& f : m_signal_wr_fns) {
diff --git a/src/devices/video/topcat.cpp b/src/devices/video/topcat.cpp
index 3d1bf8f6d24..87bb60cb1d7 100644
--- a/src/devices/video/topcat.cpp
+++ b/src/devices/video/topcat.cpp
@@ -45,14 +45,18 @@ void topcat_device::device_start()
save_item(NAME(m_dst_y_pixel));
save_item(NAME(m_block_mover_pixel_width));
save_item(NAME(m_block_mover_pixel_height));
+ save_item(NAME(m_unknown_reg4a));
+ save_item(NAME(m_unknown_reg4c));
+ save_item(NAME(m_cursor_state));
+ save_item(NAME(m_cursor_x_pos));
+ save_item(NAME(m_cursor_y_pos));
+ save_item(NAME(m_cursor_width));
save_item(NAME(m_fb_width));
save_item(NAME(m_fb_height));
+ save_item(NAME(m_plane_mask));
save_item(NAME(m_read_enable));
save_item(NAME(m_write_enable));
save_item(NAME(m_fb_enable));
- save_item(NAME(m_unknown_reg4a));
- save_item(NAME(m_unknown_reg4c));
- save_item(NAME(m_cursor_state));
save_item(NAME(m_changed));
}
diff --git a/src/mame/drivers/hp16500.cpp b/src/mame/drivers/hp16500.cpp
index a8a05fb2873..a816ef21a55 100644
--- a/src/mame/drivers/hp16500.cpp
+++ b/src/mame/drivers/hp16500.cpp
@@ -493,8 +493,10 @@ MACHINE_CONFIG_START(hp16500_state::hp16500)
// TODO: for now hook up the ipc hil keyboard - this might be replaced
// later with a 16500b specific keyboard implementation
- MCFG_HP_HIL_SLOT_ADD("mlc", "hil1", hp_hil_devices, "hp_ipc_kbd")
- MCFG_HP_HIL_SLOT_ADD("mlc", "hil2", hp_hil_devices, "hp_ipc_kbd")
+ hp_hil_slot_device &keyboard(HP_HIL_SLOT(config, "hil1", 0));
+ hp_hil_devices(keyboard);
+ keyboard.set_default_option("hp_ipc_kbd");
+ keyboard.set_hp_hil_slot(this, "mlc");
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/mame/drivers/hp9k_3xx.cpp b/src/mame/drivers/hp9k_3xx.cpp
index 652d9ea8300..a0a35086961 100644
--- a/src/mame/drivers/hp9k_3xx.cpp
+++ b/src/mame/drivers/hp9k_3xx.cpp
@@ -284,6 +284,7 @@ void hp9k3xx_state::machine_reset()
void hp9k3xx_state::machine_start()
{
m_bus_error_timer = timer_alloc(0);
+ save_item(NAME(m_bus_error));
}
void hp9k3xx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@@ -554,12 +555,12 @@ ROM_START( hp9k382 )
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
-COMP( 1985, hp9k310, 0, 0, hp9k310, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/310", MACHINE_NOT_WORKING)
-COMP( 1985, hp9k320, 0, 0, hp9k320, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/320", MACHINE_NOT_WORKING)
-COMP( 1987, hp9k330, 0, 0, hp9k330, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/330", MACHINE_NOT_WORKING)
-COMP( 1987, hp9k332, 0, 0, hp9k332, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/332", MACHINE_NOT_WORKING)
-COMP( 1989, hp9k340, hp9k330, 0, hp9k340, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/340", MACHINE_NOT_WORKING)
-COMP( 1988, hp9k360, hp9k330, 0, hp9k360, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/360", MACHINE_NOT_WORKING)
-COMP( 1988, hp9k370, hp9k330, 0, hp9k370, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/370", MACHINE_NOT_WORKING)
-COMP( 1991, hp9k380, 0, 0, hp9k380, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/380", MACHINE_NOT_WORKING)
-COMP( 1991, hp9k382, 0, 0, hp9k382, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/382", MACHINE_NOT_WORKING)
+COMP( 1985, hp9k310, 0, 0, hp9k310, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/310", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1985, hp9k320, 0, 0, hp9k320, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/320", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1987, hp9k330, 0, 0, hp9k330, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/330", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1987, hp9k332, 0, 0, hp9k332, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/332", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1989, hp9k340, hp9k330, 0, hp9k340, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/340", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1988, hp9k360, hp9k330, 0, hp9k360, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/360", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1988, hp9k370, hp9k330, 0, hp9k370, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/370", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1991, hp9k380, 0, 0, hp9k380, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/380", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
+COMP( 1991, hp9k382, 0, 0, hp9k382, hp9k330, hp9k3xx_state, empty_init, "Hewlett-Packard", "HP9000/382", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)
diff --git a/src/mame/drivers/hp_ipc.cpp b/src/mame/drivers/hp_ipc.cpp
index de97ac955c5..a4cb3238067 100644
--- a/src/mame/drivers/hp_ipc.cpp
+++ b/src/mame/drivers/hp_ipc.cpp
@@ -754,11 +754,18 @@ MACHINE_CONFIG_START(hp_ipc_state::hp_ipc_base)
MCFG_MM58167_IRQ_CALLBACK(WRITELINE(*this, hp_ipc_state, irq_1))
// MCFG_MM58167_STANDBY_IRQ_CALLBACK(WRITELINE(*this, hp_ipc_state, irq_6))
- MCFG_DEVICE_ADD("mlc", HP_HIL_MLC, 15.92_MHz_XTAL / 2)
- MCFG_HP_HIL_INT_CALLBACK(WRITELINE(*this, hp_ipc_state, irq_2))
- MCFG_HP_HIL_NMI_CALLBACK(WRITELINE(*this, hp_ipc_state, irq_7))
- MCFG_HP_HIL_SLOT_ADD("mlc", "hil1", hp_hil_devices, "hp_ipc_kbd")
- MCFG_HP_HIL_SLOT_ADD("mlc", "hil2", hp_hil_devices, "hp_46060b")
+ hp_hil_mlc_device &mlc(HP_HIL_MLC(config, "mlc", XTAL(15'920'000)/2));
+ mlc.int_callback().set(FUNC(hp_ipc_state::irq_2));
+ mlc.nmi_callback().set(FUNC(hp_ipc_state::irq_7));
+ hp_hil_slot_device &keyboard(HP_HIL_SLOT(config, "hil1", 0));
+ hp_hil_devices(keyboard);
+ keyboard.set_default_option("hp_ipc_kbd");
+ keyboard.set_hp_hil_slot(this, "mlc");
+
+ hp_hil_slot_device &mouse(HP_HIL_SLOT(config, "hil2", 0));
+ hp_hil_devices(mouse);
+ mouse.set_default_option("hp_46060b");
+ mouse.set_hp_hil_slot(this, "mlc");
MCFG_DEVICE_ADD("hpib", TMS9914, 4_MHz_XTAL)
MCFG_TMS9914_INT_WRITE_CB(WRITELINE(*this, hp_ipc_state, irq_3))
diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp
index dcc66f2ed47..f035da53173 100644
--- a/src/mame/drivers/xavix.cpp
+++ b/src/mame/drivers/xavix.cpp
@@ -296,8 +296,7 @@ void xavix_state::xavix_map(address_map &map)
void xavix_state::xavix_lowbus_map(address_map &map)
{
- map(0x0000, 0x01ff).ram();
- map(0x0200, 0x3fff).ram().share("mainram");
+ map(0x0000, 0x3fff).ram().share("mainram");
// Memory Emulator / Text Array
map(0x4000, 0x4fff).rw(FUNC(xavix_state::xavix_memoryemu_txarray_r), FUNC(xavix_state::xavix_memoryemu_txarray_w));
@@ -326,21 +325,21 @@ void xavix_state::xavix_lowbus_map(address_map &map)
map(0x6fe1, 0x6fe2).w(FUNC(xavix_state::spritefragment_dma_params_1_w));
map(0x6fe5, 0x6fe6).w(FUNC(xavix_state::spritefragment_dma_params_2_w));
- // Arena Registers
+ // Arena Registers (controls visible window + more?)
map(0x6fe8, 0x6fe8).rw(FUNC(xavix_state::arena_start_r), FUNC(xavix_state::arena_start_w)); // r/w tested
map(0x6fe9, 0x6fe9).rw(FUNC(xavix_state::arena_end_r), FUNC(xavix_state::arena_end_w)); // r/w tested
- map(0x6fea, 0x6fea).w(FUNC(xavix_state::arena_control_w));
+ map(0x6fea, 0x6fea).rw(FUNC(xavix_state::arena_control_r), FUNC(xavix_state::arena_control_w));
// Colour Mixing / Enabling Registers
- map(0x6ff0, 0x6ff0).ram().share("colmix_sh"); // a single colour (for effects or bgpen?)
+ map(0x6ff0, 0x6ff0).ram().share("colmix_sh"); // a single colour (for effects?) not bgpen
map(0x6ff1, 0x6ff1).ram().share("colmix_l");
map(0x6ff2, 0x6ff2).w(FUNC(xavix_state::colmix_6ff2_w)); // set to 07 after clearing above things in interrupt 0
// Display Control Register / Status Flags
map(0x6ff8, 0x6ff8).rw(FUNC(xavix_state::dispctrl_6ff8_r), FUNC(xavix_state::dispctrl_6ff8_w)); // always seems to be a read/store or read/modify/store
map(0x6ff9, 0x6ff9).r(FUNC(xavix_state::pal_ntsc_r));
- map(0x6ffa, 0x6ffa).w(FUNC(xavix_state::dispctrl_6ffa_w));
- map(0x6ffb, 0x6ffb).w(FUNC(xavix_state::dispctrl_6ffb_w)); // increases / decreases when you jump in snowboard, maybe raster irq pos or part of a clipping window?
+ map(0x6ffa, 0x6ffa).w(FUNC(xavix_state::dispctrl_posirq_x_w));
+ map(0x6ffb, 0x6ffb).w(FUNC(xavix_state::dispctrl_posirq_y_w)); // increases / decreases when you jump in snowboard (snowboard, used to blank ground)
// Lightgun / pen 1 control
// map(0x6ffc, 0x6fff)
@@ -351,7 +350,7 @@ void xavix_state::xavix_lowbus_map(address_map &map)
// Sound Control
map(0x75f0, 0x75f0).rw(FUNC(xavix_state::sound_75f0_r), FUNC(xavix_state::sound_75f0_w)); // r/w tested read/written 8 times in a row
map(0x75f1, 0x75f1).rw(FUNC(xavix_state::sound_75f1_r), FUNC(xavix_state::sound_75f1_w)); // r/w tested read/written 8 times in a row
- map(0x75f3, 0x75f3).ram();
+ map(0x75f2, 0x75f3).ram();
map(0x75f4, 0x75f4).r(FUNC(xavix_state::sound_75f4_r)); // related to 75f0 (read after writing there - rad_mtrk)
map(0x75f5, 0x75f5).r(FUNC(xavix_state::sound_75f5_r)); // related to 75f1 (read after writing there - rad_mtrk)
// taitons1 after 75f7/75f8
@@ -379,20 +378,16 @@ void xavix_state::xavix_lowbus_map(address_map &map)
map(0x7902, 0x7902).w(FUNC(xavix_state::extintrf_7902_w));
// DMA Controller
- map(0x7980, 0x7980).rw(FUNC(xavix_state::rom_dmatrg_r), FUNC(xavix_state::rom_dmatrg_w));
- map(0x7981, 0x7981).w(FUNC(xavix_state::rom_dmasrc_lo_w)); // DMA source
- map(0x7982, 0x7982).w(FUNC(xavix_state::rom_dmasrc_md_w));
- map(0x7983, 0x7983).w(FUNC(xavix_state::rom_dmasrc_hi_w));
- map(0x7984, 0x7984).w(FUNC(xavix_state::rom_dmadst_lo_w)); // DMA dest
- map(0x7985, 0x7985).w(FUNC(xavix_state::rom_dmadst_hi_w));
- map(0x7986, 0x7986).w(FUNC(xavix_state::rom_dmalen_lo_w)); // DMA length
- map(0x7987, 0x7987).w(FUNC(xavix_state::rom_dmalen_hi_w));
+ map(0x7980, 0x7980).rw(FUNC(xavix_state::rom_dmastat_r), FUNC(xavix_state::rom_dmatrg_w));
+ map(0x7981, 0x7983).ram().w(FUNC(xavix_state::rom_dmasrc_w)).share("rom_dma_src");
+ map(0x7984, 0x7985).ram().w(FUNC(xavix_state::rom_dmadst_w)).share("rom_dma_dst");
+ map(0x7986, 0x7987).ram().w(FUNC(xavix_state::rom_dmalen_w)).share("rom_dma_len");
// IO Ports
map(0x7a00, 0x7a00).rw(FUNC(xavix_state::io_0_r),FUNC(xavix_state::io_0_w));
- map(0x7a01, 0x7a01).rw(FUNC(xavix_state::io_1_r),FUNC(xavix_state::io_1_w)); // startup (taitons1)
- map(0x7a02, 0x7a02).rw(FUNC(xavix_state::io_2_r),FUNC(xavix_state::io_2_w)); // startup, gets set to 20, 7a00 is then also written with 20
- map(0x7a03, 0x7a03).rw(FUNC(xavix_state::io_3_r),FUNC(xavix_state::io_3_w)); // startup (gets set to 84 which is the same as the bits checked on 7a01, possible port direction register?)
+ map(0x7a01, 0x7a01).rw(FUNC(xavix_state::io_1_r),FUNC(xavix_state::io_1_w));
+ map(0x7a02, 0x7a02).rw(FUNC(xavix_state::io_2_r),FUNC(xavix_state::io_2_w));
+ map(0x7a03, 0x7a03).rw(FUNC(xavix_state::io_3_r),FUNC(xavix_state::io_3_w));
// Interrupt control registers
map(0x7a80, 0x7a80).w(FUNC(xavix_state::xavix_7a80_w)); // still IO? ADC related?
@@ -405,7 +400,7 @@ void xavix_state::xavix_lowbus_map(address_map &map)
// ADC registers
map(0x7b80, 0x7b80).rw(FUNC(xavix_state::adc_7b80_r), FUNC(xavix_state::adc_7b80_w)); // rad_snow (not often)
- map(0x7b81, 0x7b81).w(FUNC(xavix_state::adc_7b81_w)); // written (often, m_trck, analog related?)
+ map(0x7b81, 0x7b81).rw(FUNC(xavix_state::adc_7b81_r), FUNC(xavix_state::adc_7b81_w)); // written (often, m_trck, analog related?)
// Sleep control
//map(7b82, 7b83)
@@ -419,16 +414,17 @@ void xavix_state::xavix_lowbus_map(address_map &map)
// map(0x7ff0, 0x7ff1)
// Multiply / Divide registers
- map(0x7ff2, 0x7ff4).w(FUNC(xavix_state::mult_param_w));
+ map(0x7ff2, 0x7ff4).rw(FUNC(xavix_state::mult_param_r), FUNC(xavix_state::mult_param_w));
map(0x7ff5, 0x7ff6).rw(FUNC(xavix_state::mult_r), FUNC(xavix_state::mult_w));
// CPU Vector registers
- map(0x7ff9, 0x7ff9).w(FUNC(xavix_state::vector_enable_w)); // interrupt related, but probalby not a simple 'enable' otherwise interrupts happen before we're ready for them.
- map(0x7ffa, 0x7ffa).w(FUNC(xavix_state::irq_vector0_lo_w)); // an IRQ vector (nmi?)
- map(0x7ffb, 0x7ffb).w(FUNC(xavix_state::irq_vector0_hi_w));
+ map(0x7ff9, 0x7ff9).w(FUNC(xavix_state::vector_enable_w)); // enables / disables the custom vectors
+ map(0x7ffa, 0x7ffa).w(FUNC(xavix_state::nmi_vector_lo_w)); // an IRQ vector (nmi?)
+ map(0x7ffb, 0x7ffb).w(FUNC(xavix_state::nmi_vector_hi_w));
map(0x7ffc, 0x7ffc).rw(FUNC(xavix_state::irq_source_r), FUNC(xavix_state::irq_source_w));
- map(0x7ffe, 0x7ffe).w(FUNC(xavix_state::irq_vector1_lo_w)); // an IRQ vector (irq?)
- map(0x7fff, 0x7fff).w(FUNC(xavix_state::irq_vector1_hi_w));
+ // map(0x7ffd, 0x7ffd) some of the Nostalgia games read here, why?
+ map(0x7ffe, 0x7ffe).w(FUNC(xavix_state::irq_vector_lo_w)); // an IRQ vector (irq?)
+ map(0x7fff, 0x7fff).w(FUNC(xavix_state::irq_vector_hi_w));
}
static INPUT_PORTS_START( xavix )
@@ -488,12 +484,14 @@ static INPUT_PORTS_START( xavix )
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM )
INPUT_PORTS_END
+/*
static INPUT_PORTS_START( xavixp )
PORT_INCLUDE(xavix)
PORT_MODIFY("REGION") // PAL/NTSC flag
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM )
INPUT_PORTS_END
+*/
/* Test mode lists the following
@@ -576,6 +574,22 @@ static INPUT_PORTS_START( rad_boxp )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM )
INPUT_PORTS_END
+static INPUT_PORTS_START( rad_bass )
+ PORT_INCLUDE(xavix)
+
+ PORT_MODIFY("IN0")
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
+INPUT_PORTS_END
+
+static INPUT_PORTS_START( rad_bassp )
+ PORT_INCLUDE(rad_bass)
+
+ PORT_MODIFY("REGION") // PAL/NTSC flag
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM )
+INPUT_PORTS_END
+
static INPUT_PORTS_START( rad_snow )
PORT_INCLUDE(xavix)
@@ -598,15 +612,20 @@ INPUT_PORTS_END
static INPUT_PORTS_START( namcons2 )
PORT_INCLUDE(xavix)
- PORT_MODIFY("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Fire1?
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // Fire2?
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) // Pause / Add Coins
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 )
+ PORT_MODIFY("IN0") // mappings based on Dragon Buster button list, inputs don't seem to work properly in some games, probably because bad EEPROM support means all buttons are mapped to the same thing?
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) // Fire4
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) // Fire3
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // not a button? (but can be used to pass prompts?)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) // Pause / Add Coins, marked 'Credit' (but not a coin slot)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
+
+ PORT_MODIFY("IN1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // Fire2
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Fire1
+
INPUT_PORTS_END
// to access hidden test mode reset while holding Button1 and Button2 (works every other reset)
@@ -699,7 +718,7 @@ MACHINE_CONFIG_START(xavix_state::xavix)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
MCFG_SCREEN_UPDATE_DRIVER(xavix_state, screen_update)
MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 28*8-1)
+ MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_xavix)
@@ -848,30 +867,35 @@ ROM_START( rad_rh )
ROM_END
/*
- There's more code in here than in the 'eka_strt' set, but all it seems to do is display an 'insert cartridge' message,
- however eka_strt also seems a complete program in it's own right, it's unclear if it can see any of the data from this
- ROM.
-
- (TODO: turn the cartridges into a software list once the mapping is properly understood)
+ The e-kara cartridges require the BIOS rom to map into 2nd external bus space as they fetch palette data from
+ it etc.
*/
+#define EKARA_BASE_ROM \
+ ROM_LOAD( "ekara.bin", 0x600000, 0x100000, CRC(9b27c4a2) SHA1(d75dda7434933135d2f7e353840a9384e9a0d586) )
+
+
ROM_START( eka_base )
- ROM_REGION( 0x100000, "bios", ROMREGION_ERASE00 )
- ROM_LOAD( "ekara.bin", 0x000000, 0x100000, CRC(9b27c4a2) SHA1(d75dda7434933135d2f7e353840a9384e9a0d586) )
+ ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 )
+ EKARA_BASE_ROM
+ ROM_RELOAD(0x000000, 0x100000)
ROM_END
ROM_START( eka_strt )
- ROM_REGION( 0x080000, "bios", ROMREGION_ERASE00 )
+ ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 )
+ EKARA_BASE_ROM
ROM_LOAD( "ekarastartcart.bin", 0x000000, 0x080000, CRC(8c12c0c2) SHA1(8cc1b098894af25a4bfccada884125b66f5fe8b2) )
ROM_END
ROM_START( eka_vol1 )
- ROM_REGION( 0x100000, "bios", ROMREGION_ERASE00 )
+ ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 )
+ EKARA_BASE_ROM
ROM_LOAD( "ekaravol1.bin", 0x000000, 0x100000, CRC(29df4aea) SHA1(b95835aaf8630b61b47e5da0968cd4a1dd3bc517) )
ROM_END
ROM_START( eka_vol2 )
- ROM_REGION( 0x100000, "bios", ROMREGION_ERASE00 )
+ ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 )
+ EKARA_BASE_ROM
ROM_LOAD( "ekaravol2.bin", 0x000000, 0x100000, CRC(6c66772e) SHA1(e1e719df1e51caaafd9b3af187059334f7abbba3) )
ROM_END
@@ -903,8 +927,8 @@ CONS( 200?, rad_crdnp, rad_crdn, 0, xavixp, rad_crdnp,xavix_state, init_xavix
CONS( 2002, rad_bb2, 0, 0, xavix, rad_bb2, xavix_state, init_xavix, "Radica / SSD Company LTD", "Play TV Baseball 2", MACHINE_IS_SKELETON ) // contains string "Radica RBB2 V1.0"
-CONS( 2001, rad_bass, 0, 0, xavix, xavix, xavix_state, init_xavix, "Radica / SSD Company LTD", "Play TV Bass Fishin' (NTSC)", MACHINE_IS_SKELETON)
-CONS( 2001, rad_bassp, rad_bass, 0, xavixp, xavixp, xavix_state, init_xavix, "Radica / SSD Company LTD", "ConnecTV Bass Fishin' (PAL)", MACHINE_IS_SKELETON)
+CONS( 2001, rad_bass, 0, 0, xavix, rad_bass, xavix_state, init_xavix, "Radica / SSD Company LTD", "Play TV Bass Fishin' (NTSC)", MACHINE_IS_SKELETON)
+CONS( 2001, rad_bassp, rad_bass, 0, xavixp, rad_bassp,xavix_state, init_xavix, "Radica / SSD Company LTD", "ConnecTV Bass Fishin' (PAL)", MACHINE_IS_SKELETON)
// there is another 'Snowboarder' with a white coloured board, it appears to be a newer game closer to 'SSX Snowboarder' but without the SSX license.
CONS( 2001, rad_snow, 0, 0, xavix, rad_snow, xavix_state, init_xavix, "Radica / SSD Company LTD", "Play TV Snowboarder (Blue) (NTSC)", MACHINE_IS_SKELETON)
@@ -920,13 +944,13 @@ CONS( 200?, epo_efdx, 0, 0, xavix, xavix, xavix_state, init_xavix
CONS( 200?, has_wamg, 0, 0, xavix, xavix, xavix_state, init_xavix, "Hasbro / Milton Bradley / SSD Company LTD", "TV Wild Adventure Mini Golf", MACHINE_IS_SKELETON)
-CONS( 200?, eka_base, 0, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara (US?)", MACHINE_IS_SKELETON)
+CONS( 200?, eka_base, 0, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara (US?)", MACHINE_IS_SKELETON|MACHINE_IS_BIOS_ROOT)
-CONS( 200?, eka_strt, 0, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Starter (US?)", MACHINE_IS_SKELETON)
+CONS( 200?, eka_strt, eka_base, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Starter (US?)", MACHINE_IS_SKELETON)
-CONS( 200?, eka_vol1, 0, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Volume 1 (US?)", MACHINE_IS_SKELETON) // insert calls it 'HIT MIX Vol 1'
+CONS( 200?, eka_vol1, eka_base, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Volume 1 (US?)", MACHINE_IS_SKELETON) // insert calls it 'HIT MIX Vol 1'
-CONS( 200?, eka_vol2, 0, 0, xavix, xavix , xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Volume 2 (US?)", MACHINE_IS_SKELETON) // insert calls it 'HIT MIX Vol 2'
+CONS( 200?, eka_vol2, eka_base, 0, xavix, xavix , xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Volume 2 (US?)", MACHINE_IS_SKELETON) // insert calls it 'HIT MIX Vol 2'
/* The 'XaviXPORT' isn't a real console, more of a TV adapter, all the actual hardware (CPU including video hw, sound hw) is in the cartridges and controllers
and can vary between games, see notes at top of driver.
diff --git a/src/mame/includes/xavix.h b/src/mame/includes/xavix.h
index 30dcc588696..d3c361a0038 100644
--- a/src/mame/includes/xavix.h
+++ b/src/mame/includes/xavix.h
@@ -18,8 +18,12 @@ public:
xavix_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_screen(*this, "screen"),
m_mainram(*this, "mainram"),
m_fragment_sprite(*this, "fragment_sprite"),
+ m_rom_dma_src(*this,"rom_dma_src"),
+ m_rom_dma_dst(*this,"rom_dma_dst"),
+ m_rom_dma_len(*this,"rom_dma_len"),
m_palram_sh(*this, "palram_sh"),
m_palram_l(*this, "palram_l"),
m_colmix_sh(*this, "colmix_sh"),
@@ -68,19 +72,18 @@ private:
DECLARE_WRITE8_MEMBER(adc_7b00_w);
DECLARE_READ8_MEMBER(adc_7b80_r);
DECLARE_WRITE8_MEMBER(adc_7b80_w);
+ DECLARE_READ8_MEMBER(adc_7b81_r);
DECLARE_WRITE8_MEMBER(adc_7b81_w);
DECLARE_WRITE8_MEMBER(slotreg_7810_w);
DECLARE_WRITE8_MEMBER(rom_dmatrg_w);
- DECLARE_WRITE8_MEMBER(rom_dmasrc_lo_w);
- DECLARE_WRITE8_MEMBER(rom_dmasrc_md_w);
- DECLARE_WRITE8_MEMBER(rom_dmasrc_hi_w);
- DECLARE_WRITE8_MEMBER(rom_dmadst_lo_w);
- DECLARE_WRITE8_MEMBER(rom_dmadst_hi_w);
- DECLARE_WRITE8_MEMBER(rom_dmalen_lo_w);
- DECLARE_WRITE8_MEMBER(rom_dmalen_hi_w);
- DECLARE_READ8_MEMBER(rom_dmatrg_r);
+
+ DECLARE_WRITE8_MEMBER(rom_dmasrc_w);
+
+ DECLARE_WRITE8_MEMBER(rom_dmadst_w);
+ DECLARE_WRITE8_MEMBER(rom_dmalen_w);
+ DECLARE_READ8_MEMBER(rom_dmastat_r);
DECLARE_WRITE8_MEMBER(spritefragment_dma_params_1_w);
DECLARE_WRITE8_MEMBER(spritefragment_dma_params_2_w);
@@ -98,10 +101,10 @@ private:
DECLARE_WRITE8_MEMBER(io_3_w);
DECLARE_WRITE8_MEMBER(vector_enable_w);
- DECLARE_WRITE8_MEMBER(irq_vector0_lo_w);
- DECLARE_WRITE8_MEMBER(irq_vector0_hi_w);
- DECLARE_WRITE8_MEMBER(irq_vector1_lo_w);
- DECLARE_WRITE8_MEMBER(irq_vector1_hi_w);
+ DECLARE_WRITE8_MEMBER(nmi_vector_lo_w);
+ DECLARE_WRITE8_MEMBER(nmi_vector_hi_w);
+ DECLARE_WRITE8_MEMBER(irq_vector_lo_w);
+ DECLARE_WRITE8_MEMBER(irq_vector_hi_w);
DECLARE_READ8_MEMBER(irq_source_r);
DECLARE_WRITE8_MEMBER(irq_source_w);
@@ -110,6 +113,7 @@ private:
DECLARE_WRITE8_MEMBER(arena_start_w);
DECLARE_READ8_MEMBER(arena_end_r);
DECLARE_WRITE8_MEMBER(arena_end_w);
+ DECLARE_READ8_MEMBER(arena_control_r);
DECLARE_WRITE8_MEMBER(arena_control_w);
DECLARE_READ8_MEMBER(colmix_6ff0_r);
@@ -121,8 +125,8 @@ private:
DECLARE_READ8_MEMBER(dispctrl_6ff8_r);
DECLARE_WRITE8_MEMBER(dispctrl_6ff8_w);
- DECLARE_WRITE8_MEMBER(dispctrl_6ffa_w);
- DECLARE_WRITE8_MEMBER(dispctrl_6ffb_w);
+ DECLARE_WRITE8_MEMBER(dispctrl_posirq_x_w);
+ DECLARE_WRITE8_MEMBER(dispctrl_posirq_y_w);
DECLARE_READ8_MEMBER(sound_75f0_r);
DECLARE_WRITE8_MEMBER(sound_75f0_w);
@@ -175,25 +179,17 @@ private:
DECLARE_READ8_MEMBER(mult_r);
DECLARE_WRITE8_MEMBER(mult_w);
+ DECLARE_READ8_MEMBER(mult_param_r);
DECLARE_WRITE8_MEMBER(mult_param_w);
required_device<cpu_device> m_maincpu;
-
- uint8_t m_rom_dmasrc_lo_data;
- uint8_t m_rom_dmasrc_md_data;
- uint8_t m_rom_dmasrc_hi_data;
-
- uint8_t m_rom_dmadst_lo_data;
- uint8_t m_rom_dmadst_hi_data;
-
- uint8_t m_rom_dmalen_lo_data;
- uint8_t m_rom_dmalen_hi_data;
-
+ required_device<screen_device> m_screen;
+
uint8_t m_vectorenable;
- uint8_t m_irq_vector0_lo_data;
- uint8_t m_irq_vector0_hi_data;
- uint8_t m_irq_vector1_lo_data;
- uint8_t m_irq_vector1_hi_data;
+ uint8_t m_nmi_vector_lo_data;
+ uint8_t m_nmi_vector_hi_data;
+ uint8_t m_irq_vector_lo_data;
+ uint8_t m_irq_vector_hi_data;
uint8_t m_multparams[3];
uint8_t m_multresults[2];
@@ -204,8 +200,9 @@ private:
uint8_t m_tmap1_regs[8];
uint8_t m_tmap2_regs[8];
- uint8_t m_arena_start;
- uint8_t m_arena_end;
+ int m_arena_start;
+ int m_arena_end;
+ uint8_t m_arena_control;
uint8_t m_6ff0;
uint8_t m_6ff8;
@@ -217,8 +214,10 @@ private:
int16_t get_vectors(int which, int half);
required_shared_ptr<uint8_t> m_mainram;
-
required_shared_ptr<uint8_t> m_fragment_sprite;
+ required_shared_ptr<uint8_t> m_rom_dma_src;
+ required_shared_ptr<uint8_t> m_rom_dma_dst;
+ required_shared_ptr<uint8_t> m_rom_dma_len;
required_shared_ptr<uint8_t> m_palram_sh;
required_shared_ptr<uint8_t> m_palram_l;
@@ -238,9 +237,10 @@ private:
void handle_palette(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
double hue2rgb(double p, double q, double t);
- void draw_tile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int opaque);
+ void draw_tile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int zval);
void draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ bitmap_ind16 m_zbuffer;
uint8_t m_spritereg;
diff --git a/src/mame/machine/xavix.cpp b/src/mame/machine/xavix.cpp
index f0c3b370362..89ba1683440 100644
--- a/src/mame/machine/xavix.cpp
+++ b/src/mame/machine/xavix.cpp
@@ -4,25 +4,40 @@
#include "emu.h"
#include "includes/xavix.h"
-// general DMA fro ROM, not Video DMA
+// general DMA to/from entire main map (not dedicated sprite DMA)
WRITE8_MEMBER(xavix_state::rom_dmatrg_w)
{
if (data & 0x01) // namcons2 writes 0x81, most of the time things write 0x01
{
logerror("%s: rom_dmatrg_w (do DMA?) %02x\n", machine().describe_context(), data);
- uint32_t source = (m_rom_dmasrc_hi_data << 16) | (m_rom_dmasrc_md_data << 8) | m_rom_dmasrc_lo_data;
- uint16_t dest = (m_rom_dmadst_hi_data << 8) | m_rom_dmadst_lo_data;
- uint16_t len = (m_rom_dmalen_hi_data << 8) | m_rom_dmalen_lo_data;
+ uint32_t source = (m_rom_dma_src[2] << 16) | (m_rom_dma_src[1] << 8) | m_rom_dma_src[0];
+ uint16_t dest = (m_rom_dma_dst[1] << 8) | m_rom_dma_dst[0];
+ uint16_t len = (m_rom_dma_len[1] << 8) | m_rom_dma_len[0];
- source &= m_rgnlen - 1;
logerror(" (possible DMA op SRC %08x DST %04x LEN %04x)\n", source, dest, len);
address_space& destspace = m_maincpu->space(AS_PROGRAM);
for (int i = 0; i < len; i++)
{
- uint8_t dat = m_rgn[(source + i) & (m_rgnlen - 1)];
+ uint32_t m_tmpaddress = source+i;
+
+ // many games explicitly want to access with the high bank bit set, so probably the same logic as when grabbing tile data
+ // we have to be careful here or we get the zero page memory read, hence not just using read8 on the whole space
+ // this again probably indicates there is 'data space' where those don't appear
+ uint8_t dat = 0;
+ // if bank is > 0x80, or address is >0x8000 it's a plain ROM read
+ if ((m_tmpaddress >= 0x80000) || (m_tmpaddress & 0x8000))
+ {
+ dat= m_rgn[m_tmpaddress & (m_rgnlen - 1)];
+ }
+ else
+ {
+ address_space& mainspace = m_maincpu->space(AS_PROGRAM);
+ dat = m_lowbus->read8(mainspace, m_tmpaddress & 0x7fff);
+ }
+
destspace.write_byte(dest + i, dat);
}
}
@@ -32,57 +47,30 @@ WRITE8_MEMBER(xavix_state::rom_dmatrg_w)
}
}
-WRITE8_MEMBER(xavix_state::rom_dmasrc_lo_w)
-{
- logerror("%s: rom_dmasrc_lo_w %02x\n", machine().describe_context(), data);
- m_rom_dmasrc_lo_data = data;
-}
-WRITE8_MEMBER(xavix_state::rom_dmasrc_md_w)
+WRITE8_MEMBER(xavix_state::rom_dmasrc_w)
{
- logerror("%s: rom_dmasrc_md_w %02x\n", machine().describe_context(), data);
- m_rom_dmasrc_md_data = data;
+ // has_wamg expects to be able to read back the source to modify it (need to check if it expects it to change after an operation)
+ logerror("%s: rom_dmasrc_w (%02x) %02x\n", machine().describe_context(), offset, data);
+ m_rom_dma_src[offset] = data;
}
-WRITE8_MEMBER(xavix_state::rom_dmasrc_hi_w)
+WRITE8_MEMBER(xavix_state::rom_dmadst_w)
{
- logerror("%s: rom_dmasrc_hi_w %02x\n", machine().describe_context(), data);
- m_rom_dmasrc_hi_data = data;
- // this would mean Taito Nostalgia relies on mirroring tho, as it has the high bits set... so could just be wrong
- logerror(" (DMA ROM source of %02x%02x%02x)\n", m_rom_dmasrc_hi_data, m_rom_dmasrc_md_data, m_rom_dmasrc_lo_data);
+ logerror("%s: rom_dmadst_w (%02x) %02x\n", machine().describe_context(), offset, data);
+ m_rom_dma_dst[offset] = data;
}
-WRITE8_MEMBER(xavix_state::rom_dmadst_lo_w)
+WRITE8_MEMBER(xavix_state::rom_dmalen_w)
{
- logerror("%s: rom_dmadst_lo_w %02x\n", machine().describe_context(), data);
- m_rom_dmadst_lo_data = data;
+ logerror("%s: rom_dmalen_w (%02x) %02x\n", machine().describe_context(), offset, data);
+ m_rom_dma_len[offset] = data;
}
-WRITE8_MEMBER(xavix_state::rom_dmadst_hi_w)
-{
- logerror("%s: rom_dmadst_hi_w %02x\n", machine().describe_context(), data);
- m_rom_dmadst_hi_data = data;
-
- logerror(" (DMA dest of %02x%02x)\n", m_rom_dmadst_hi_data, m_rom_dmadst_lo_data);
-}
-
-WRITE8_MEMBER(xavix_state::rom_dmalen_lo_w)
-{
- logerror("%s: rom_dmalen_lo_w %02x\n", machine().describe_context(), data);
- m_rom_dmalen_lo_data = data;
-}
-WRITE8_MEMBER(xavix_state::rom_dmalen_hi_w)
+READ8_MEMBER(xavix_state::rom_dmastat_r)
{
- logerror("%s: rom_dmalen_hi_w %02x\n", machine().describe_context(), data);
- m_rom_dmalen_hi_data = data;
-
- logerror(" (DMA len of %02x%02x)\n", m_rom_dmalen_hi_data, m_rom_dmalen_lo_data);
-}
-
-READ8_MEMBER(xavix_state::rom_dmatrg_r)
-{
- logerror("%s: rom_dmatrg_r (operation status?)\n", machine().describe_context());
+ logerror("%s: rom_dmastat_r (operation status?)\n", machine().describe_context());
return 0x00;
}
@@ -94,28 +82,28 @@ WRITE8_MEMBER(xavix_state::vector_enable_w)
m_vectorenable = data;
}
-WRITE8_MEMBER(xavix_state::irq_vector0_lo_w)
+WRITE8_MEMBER(xavix_state::nmi_vector_lo_w)
{
- logerror("%s: irq_vector0_lo_w %02x\n", machine().describe_context(), data);
- m_irq_vector0_lo_data = data;
+ logerror("%s: nmi_vector_lo_w %02x\n", machine().describe_context(), data);
+ m_nmi_vector_lo_data = data;
}
-WRITE8_MEMBER(xavix_state::irq_vector0_hi_w)
+WRITE8_MEMBER(xavix_state::nmi_vector_hi_w)
{
- logerror("%s: irq_vector0_hi_w %02x\n", machine().describe_context(), data);
- m_irq_vector0_hi_data = data;
+ logerror("%s: nmi_vector_hi_w %02x\n", machine().describe_context(), data);
+ m_nmi_vector_hi_data = data;
}
-WRITE8_MEMBER(xavix_state::irq_vector1_lo_w)
+WRITE8_MEMBER(xavix_state::irq_vector_lo_w)
{
- logerror("%s: irq_vector1_lo_w %02x\n", machine().describe_context(), data);
- m_irq_vector1_lo_data = data;
+ logerror("%s: irq_vector_lo_w %02x\n", machine().describe_context(), data);
+ m_irq_vector_lo_data = data;
}
-WRITE8_MEMBER(xavix_state::irq_vector1_hi_w)
+WRITE8_MEMBER(xavix_state::irq_vector_hi_w)
{
- logerror("%s: irq_vector1_hi_w %02x\n", machine().describe_context(), data);
- m_irq_vector1_hi_data = data;
+ logerror("%s: irq_vector_hi_w %02x\n", machine().describe_context(), data);
+ m_irq_vector_hi_data = data;
}
@@ -160,6 +148,12 @@ WRITE8_MEMBER(xavix_state::adc_7b81_w)
logerror("%s: adc_7b81_w %02x\n", machine().describe_context(), data);
}
+READ8_MEMBER(xavix_state::adc_7b81_r)
+{
+ return machine().rand();
+}
+
+
WRITE8_MEMBER(xavix_state::slotreg_7810_w)
{
@@ -200,14 +194,14 @@ WRITE8_MEMBER(xavix_state::dispctrl_6ff8_w)
logerror("%s: dispctrl_6ff8_w %02x\n", machine().describe_context(), data);
}
-WRITE8_MEMBER(xavix_state::dispctrl_6ffa_w)
+WRITE8_MEMBER(xavix_state::dispctrl_posirq_x_w)
{
- logerror("%s: dispctrl_6ffa_w %02x\n", machine().describe_context(), data);
+ logerror("%s: dispctrl_posirq_x_w %02x\n", machine().describe_context(), data);
}
-WRITE8_MEMBER(xavix_state::dispctrl_6ffb_w)
+WRITE8_MEMBER(xavix_state::dispctrl_posirq_y_w)
{
- logerror("%s: dispctrl_6ffb_w %02x\n", machine().describe_context(), data);
+ logerror("%s: dispctrl_posirq_y_w %02x\n", machine().describe_context(), data);
}
READ8_MEMBER(xavix_state::io_0_r)
@@ -229,14 +223,15 @@ READ8_MEMBER(xavix_state::io_1_r)
return m_in1->read();
}
+// has_wamg crashes on boot if these return high, either it's a button causing the game to eventually crash, or an invalid input (inputs are ACTIVE HIGH so returning 0x00 is safer
READ8_MEMBER(xavix_state::io_2_r)
{
- return 0xff;
+ return 0x00;
}
READ8_MEMBER(xavix_state::io_3_r)
{
- return 0xff;
+ return 0x00;
}
@@ -268,7 +263,7 @@ READ8_MEMBER(xavix_state::arena_start_r)
WRITE8_MEMBER(xavix_state::arena_start_w)
{
- //logerror("%s: arena_start_w %02x\n", machine().describe_context(), data);
+ logerror("%s: arena_start_w %02x\n", machine().describe_context(), data);
m_arena_start = data; // expected to return data written
}
@@ -280,13 +275,19 @@ READ8_MEMBER(xavix_state::arena_end_r)
WRITE8_MEMBER(xavix_state::arena_end_w)
{
- //logerror("%s: arena_end_w %02x\n", machine().describe_context(), data);
+ logerror("%s: arena_end_w %02x\n", machine().describe_context(), data);
m_arena_end = data; // expected to return data written
}
+READ8_MEMBER(xavix_state::arena_control_r)
+{
+ return m_arena_control;
+}
+
WRITE8_MEMBER(xavix_state::arena_control_w)
{
- //logerror("%s: arena_control_w %02x\n", machine().describe_context(), data);
+ logerror("%s: arena_control_w %02x\n", machine().describe_context(), data);
+ m_arena_control = data;
}
@@ -326,6 +327,11 @@ WRITE8_MEMBER(xavix_state::mult_w)
m_multresults[offset] = data;
}
+READ8_MEMBER(xavix_state::mult_param_r)
+{
+ return m_multparams[offset];
+}
+
WRITE8_MEMBER(xavix_state::mult_param_w)
{
COMBINE_DATA(&m_multparams[offset]);
@@ -408,24 +414,28 @@ void xavix_state::machine_start()
void xavix_state::machine_reset()
{
- m_rom_dmasrc_lo_data = 0;
- m_rom_dmasrc_md_data = 0;
- m_rom_dmasrc_hi_data = 0;
+ m_rom_dma_src[0] = 0;
+ m_rom_dma_src[1] = 0;
+ m_rom_dma_src[2] = 0;
- m_rom_dmadst_lo_data = 0;
- m_rom_dmadst_hi_data = 0;
+ m_rom_dma_dst[0] = 0;
+ m_rom_dma_dst[1] = 0;
- m_rom_dmalen_lo_data = 0;
- m_rom_dmalen_hi_data = 0;
+ m_rom_dma_len[0] = 0;
+ m_rom_dma_len[1] = 0;
m_vectorenable = 0;
- m_irq_vector0_lo_data = 0;
- m_irq_vector0_hi_data = 0;
- m_irq_vector1_lo_data = 0;
- m_irq_vector1_hi_data = 0;
+ m_nmi_vector_lo_data = 0;
+ m_nmi_vector_hi_data = 0;
+ m_irq_vector_lo_data = 0;
+ m_irq_vector_hi_data = 0;
m_6ff8 = 0;
+ m_arena_control = 0;
+ m_arena_start = 0;
+ m_arena_end = 0;
+
m_spritereg = 0;
m_soundregs[0] = 0;
@@ -461,6 +471,18 @@ void xavix_state::machine_reset()
m_txarray[i] = 0x00;
}
+ for (int i = 0; i < 0x800; i++)
+ {
+ // taito nostalgia 1 never initializes the ram at 0x6400 but there's no condition on using it at present?
+ m_fragment_sprite[i] = 0x00;
+ }
+
+ for (int i = 0; i < 0x4000; i++)
+ {
+ // card night expects RAM to be initialized to 0xff or it will show the pause menu over the startup graphics?!
+ m_mainram[i] = 0xff;
+ }
+
m_lowbus->set_bank(0);
}
@@ -475,16 +497,16 @@ int16_t xavix_state::get_vectors(int which, int half)
if (which == 0) // irq?
{
if (half == 0)
- return m_irq_vector0_hi_data;
+ return m_nmi_vector_hi_data;
else
- return m_irq_vector0_lo_data;
+ return m_nmi_vector_lo_data;
}
else
{
if (half == 0)
- return m_irq_vector1_hi_data;
+ return m_irq_vector_hi_data;
else
- return m_irq_vector1_lo_data;
+ return m_irq_vector_lo_data;
}
}
diff --git a/src/mame/video/xavix.cpp b/src/mame/video/xavix.cpp
index 3ecc0a4fc8e..f246100e249 100644
--- a/src/mame/video/xavix.cpp
+++ b/src/mame/video/xavix.cpp
@@ -57,6 +57,7 @@ inline int xavix_state::get_current_address_byte()
void xavix_state::video_start()
{
+ m_screen->register_screen_bitmap(m_zbuffer);
}
@@ -134,17 +135,13 @@ void xavix_state::handle_palette(screen_device &screen, bitmap_ind16 &bitmap, co
void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which)
{
uint8_t* tileregs;
- int opaque = 0;
-
if (which == 0)
{
tileregs = m_tmap1_regs;
- opaque = 1;
}
else
{
tileregs = m_tmap2_regs;
- opaque = 0;
}
// bail if tilemap is disabled
@@ -221,16 +218,13 @@ void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, cons
// there's a tilemap register to specify base in main ram, although in the monster truck test mode it points to an unmapped region
// and expected a fixed layout, we handle that in the memory map at the moment
- int count;
-
- count = 0;// ;
+ int count = 0;
for (int y = 0; y < ydimension; y++)
{
for (int x = 0; x < xdimension; x++)
{
address_space& mainspace = m_maincpu->space(AS_PROGRAM);
- int bpp, pal, scrolly, scrollx;
int tile = 0;
// the register being 0 probably isn't the condition here
@@ -245,11 +239,12 @@ void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, cons
tile |= mainspace.read_byte((tileregs[0x2] << 8) + count) << 16;
- bpp = (tileregs[0x3] & 0x0e) >> 1;
+ int bpp = (tileregs[0x3] & 0x0e) >> 1;
bpp++;
- pal = (tileregs[0x6] & 0xf0) >> 4;
- scrolly = tileregs[0x5];
- scrollx = tileregs[0x4];
+ int pal = (tileregs[0x6] & 0xf0) >> 4;
+ int zval = (tileregs[0x6] & 0x0f) >> 0;
+ int scrolly = tileregs[0x5];
+ int scrollx = tileregs[0x4];
int basereg;
int flipx = 0;
@@ -302,7 +297,7 @@ void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, cons
uint8_t extraattr = mainspace.read_byte((tileregs[0x2] << 8) + count);
// make use of the extraattr stuff?
pal = (extraattr & 0xf0)>>4;
- // low bits are priority?
+ zval = (extraattr & 0x0f) >> 0;
}
}
else
@@ -398,10 +393,10 @@ void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, cons
if (test == 1) pal = machine().rand() & 0xf;
- draw_tile(screen, bitmap, cliprect, tile, bpp, (x * xtilesize) + scrollx, ((y * ytilesize) - 16) - scrolly, ytilesize, xtilesize, flipx, flipy, pal, opaque);
- draw_tile(screen, bitmap, cliprect, tile, bpp, (x * xtilesize) + scrollx, (((y * ytilesize) - 16) - scrolly) + 256, ytilesize, xtilesize, flipx, flipy, pal, opaque); // wrap-y
- draw_tile(screen, bitmap, cliprect, tile, bpp, ((x * xtilesize) + scrollx) - 256, ((y * ytilesize) - 16) - scrolly, ytilesize, xtilesize, flipx, flipy, pal, opaque); // wrap-x
- draw_tile(screen, bitmap, cliprect, tile, bpp, ((x * xtilesize) + scrollx) - 256, (((y * ytilesize) - 16) - scrolly) + 256, ytilesize, xtilesize, flipx, flipy, pal, opaque); // wrap-y and x
+ draw_tile(screen, bitmap, cliprect, tile, bpp, (x * xtilesize) + scrollx, ((y * ytilesize) - 16) - scrolly, ytilesize, xtilesize, flipx, flipy, pal, zval);
+ draw_tile(screen, bitmap, cliprect, tile, bpp, (x * xtilesize) + scrollx, (((y * ytilesize) - 16) - scrolly) + 256, ytilesize, xtilesize, flipx, flipy, pal, zval); // wrap-y
+ draw_tile(screen, bitmap, cliprect, tile, bpp, ((x * xtilesize) + scrollx) - 256, ((y * ytilesize) - 16) - scrolly, ytilesize, xtilesize, flipx, flipy, pal, zval); // wrap-x
+ draw_tile(screen, bitmap, cliprect, tile, bpp, ((x * xtilesize) + scrollx) - 256, (((y * ytilesize) - 16) - scrolly) + 256, ytilesize, xtilesize, flipx, flipy, pal, zval); // wrap-y and x
count++;
}
@@ -443,7 +438,7 @@ void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons
uint8_t* spr_attr1 = m_fragment_sprite + 0x100;
uint8_t* spr_ypos = m_fragment_sprite + 0x200;
uint8_t* spr_xpos = m_fragment_sprite + 0x300;
- // + 0x400
+ uint8_t* spr_xposh = m_fragment_sprite + 0x400;
uint8_t* spr_addr_lo = m_fragment_sprite + 0x500;
uint8_t* spr_addr_md = m_fragment_sprite + 0x600;
uint8_t* spr_addr_hi = m_fragment_sprite + 0x700;
@@ -453,16 +448,30 @@ void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons
pppp bbb- p = palette, b = bpp
attribute 1 bits
- ---- ss-f s = size, f = flipx
+ zzzz ssFf s = size, F = flipy f = flipx
*/
int ypos = spr_ypos[i];
int xpos = spr_xpos[i];
- int tile = (spr_addr_hi[i] << 16) | (spr_addr_md[i] << 8) | spr_addr_lo[i];
+ int tile = 0;
+
+ // high 8-bits only used in 24-bit mode
+ if (((m_spritereg & 0x7f) == 0x04) || ((m_spritereg & 0x7f) == 0x15))
+ tile |= (spr_addr_hi[i] << 16);
+
+ // mid 8-bits used in everything except 8-bit mode
+ if ((m_spritereg & 0x7f) != 0x00)
+ tile |= (spr_addr_md[i] << 8);
+
+ // low 8-bits always read
+ tile |= spr_addr_lo[i];
+
int attr0 = spr_attr0[i];
int attr1 = spr_attr1[i];
int pal = (attr0 & 0xf0) >> 4;
+
+ int zval = (attr1 & 0xf0) >> 4;
int flipx = (attr1 & 0x01);
int flipy = (attr1 & 0x02);
@@ -529,11 +538,34 @@ void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons
this makes the calculation a bit more annoying in terms of knowing when to apply offsets, when to wrap etc.
this is likely still incorrect
- I think there is also an additional x bit
- */
+ Use of additional x-bit is very confusing rad_snow, taitons1 (ingame) etc. clearly need to use it
+ but the taitons1 xavix logo doesn't even initialize the RAM for it and behavior conflicts with ingame?
+ maybe only works with certain tile sizes?
+
+ some code even suggests this should be bit 0 of attr0, but it never gets set there
+
+ there must be a register somewhere (or a side-effect of another mode) that enables / disables this
+ behavior, as we need to make use of xposh for the left side in cases that need it, but that
+ completely breaks the games that never set it at all (monster truck, xavix logo on taitons1)
+
+ */
+
+ int xposh = spr_xposh[i]&1;
+
+ if (xpos & 0x80) // left side of center
+ {
+ xpos &=0x7f;
+ xpos = -0x80+xpos;
+ }
+ else // right side of center
+ {
+ xpos &= 0x7f;
- xpos -= 136;
- xpos &= 0xff;
+ if (xposh)
+ xpos += 0x80;
+ }
+
+ xpos += 128 - 8;
ypos ^= 0xff;
@@ -554,10 +586,8 @@ void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons
bpp = (attr0 & 0x0e) >> 1;
bpp += 1;
- draw_tile(screen, bitmap, cliprect, tile, bpp, xpos + xpos_adjust, ypos - ypos_adjust, drawheight, drawwidth, flipx, flipy, pal, 0);
- draw_tile(screen, bitmap, cliprect, tile, bpp, xpos + xpos_adjust - 256, ypos - ypos_adjust, drawheight, drawwidth, flipx, flipy, pal, 0); // wrap-x
- draw_tile(screen, bitmap, cliprect, tile, bpp, xpos + xpos_adjust, ypos - 256 - ypos_adjust, drawheight, drawwidth, flipx, flipy, pal, 0); // wrap-y
- draw_tile(screen, bitmap, cliprect, tile, bpp, xpos + xpos_adjust - 256, ypos - 256 - ypos_adjust, drawheight, drawwidth, flipx, flipy, pal, 0); // wrap-x,y
+ draw_tile(screen, bitmap, cliprect, tile, bpp, xpos + xpos_adjust, ypos - ypos_adjust, drawheight, drawwidth, flipx, flipy, pal, zval);
+ draw_tile(screen, bitmap, cliprect, tile, bpp, xpos + xpos_adjust, ypos - 256 - ypos_adjust, drawheight, drawwidth, flipx, flipy, pal, zval); // wrap-y
/*
if ((spr_ypos[i] != 0x81) && (spr_ypos[i] != 0x80) && (spr_ypos[i] != 0x00))
@@ -568,7 +598,7 @@ void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons
}
}
-void xavix_state::draw_tile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int opaque)
+void xavix_state::draw_tile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tile, int bpp, int xpos, int ypos, int drawheight, int drawwidth, int flipx, int flipy, int pal, int zval)
{
// set the address here so we can increment in bits in the draw function
set_data_address(tile, 0);
@@ -608,19 +638,20 @@ void xavix_state::draw_tile(screen_device &screen, bitmap_ind16 &bitmap, const r
if ((row >= cliprect.min_y && row <= cliprect.max_y) && (col >= cliprect.min_x && col <= cliprect.max_x))
{
- uint16_t* rowptr;
+ uint16_t* rowptr = &bitmap.pix16(row);
+ uint16_t* zrowptr = &m_zbuffer.pix16(row);
- rowptr = &bitmap.pix16(row);
- if (opaque)
- {
- rowptr[col] = (dat + (pal << 4)) & 0xff;
- }
- else
+ if (zval >= zrowptr[col])
{
- if (dat)
- rowptr[col] = (dat + (pal << 4)) & 0xff;
- }
+ int pen = (dat + (pal << 4)) & 0xff;
+
+ if ((m_palram_sh[pen] & 0x1f) < 24) // hue values 24-31 are transparent
+ {
+ rowptr[col] = pen;
+ zrowptr[col] = zval;
+ }
+ }
}
}
}
@@ -630,14 +661,41 @@ uint32_t xavix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
handle_palette(screen, bitmap, cliprect);
- // monster truck, taito nostalgia 1, madden and more look worse with black pen, baseball 2 hidden test mode looks worse with forced pen 0
- // probably depends on transparency etc.
- //bitmap.fill(m_palette->black_pen(), cliprect);
- bitmap.fill(0, cliprect);
+ // not sure what you end up with if you fall through all layers as transparent, so far no issues noticed
+ bitmap.fill(m_palette->black_pen(), cliprect);
+ m_zbuffer.fill(0,cliprect);
+
+ rectangle clip = cliprect;
+
+ clip.min_y = cliprect.min_y;
+ clip.max_y = cliprect.max_y;
+ clip.min_x = cliprect.min_x;
+ clip.max_x = cliprect.max_x;
+
+ if (m_arena_control & 0x01)
+ {
+ // some games enable it with both regs as 00, which causes a problem
+ if (m_arena_start > m_arena_end)
+ {
+ // controls the clipping area (for all layers?) used for effect at start of Slap Fight and to add black borders in other cases
+ // based on Slap Fight Tiger lives display (and reference videos) this is slightly offset as all gfx must display
+ // other games don't correct the offset so will display a tiny bit of extra space at times?
+ // (there is some tilemap draw-in on Monster Truck)
+ clip.max_x = m_arena_start + 1;
+ clip.min_x = m_arena_end - 2;
+
+ if (clip.min_x < cliprect.min_x)
+ clip.min_x = cliprect.min_x;
+
+ if (clip.max_x > cliprect.max_x)
+ clip.max_x = cliprect.max_x;
+ }
+ }
+ bitmap.fill(0, clip);
- draw_tilemap(screen,bitmap,cliprect,0);
- draw_sprites(screen,bitmap,cliprect);
- draw_tilemap(screen,bitmap,cliprect,1);
+ draw_tilemap(screen,bitmap,clip,1);
+ draw_tilemap(screen,bitmap,clip,0);
+ draw_sprites(screen,bitmap,clip);
//popmessage("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", m_soundregs[0],m_soundregs[1],m_soundregs[2],m_soundregs[3],m_soundregs[4],m_soundregs[5],m_soundregs[6],m_soundregs[7],m_soundregs[8],m_soundregs[9],m_soundregs[10],m_soundregs[11],m_soundregs[12],m_soundregs[13],m_soundregs[14],m_soundregs[15]);