1 // license:BSD-3-Clause
2 // copyright-holders:David Haywood
3 /***************************************************************************
4 
5     xavix2000.cpp (Super XaviX)
6 
7     The dies for these are marked
8 
9     SSD 2000 NEC 85605-621
10 
11     SSD 2002 NEC 85054-611
12 
13     6502 with custom opcodes
14     integrated gfx / sound
15 
16     special notes
17 
18     see xavix.cpp for basic notes
19 
20     the 2000 chip has more opcodes than the 97/98 chips in xavix.cpp, and
21     is a similar die structure to the 2002 chip, but doesn't seem to have any
22     additional capabilities.
23 
24     the 2002 chip seems to be the one that was officially dubbed 'SuperXaviX'
25     and has additional video capabilities on top of the extended opcodes.
26 
27 
28 ***************************************************************************/
29 
30 #include "emu.h"
31 #include "xavix2000.h"
32 #include "xavix2000d.h"
33 
34 DEFINE_DEVICE_TYPE(XAVIX2000, xavix2000_device, "xavix2000", "XaviX (SSD 2000)")
35 DEFINE_DEVICE_TYPE(XAVIX2002, xavix2002_device, "xavix2002", "XaviX (SSD 2002) (SuperXaviX)")
36 
37 
38 
xavix2000_device(const machine_config & mconfig,device_type type,const char * tag,device_t * owner,uint32_t clock)39 xavix2000_device::xavix2000_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
40 	xavix_device(mconfig, type, tag, owner, clock)
41 {
42 	program_config.m_addr_width = 24;
43 	program_config.m_logaddr_width = 24;
44 	sprogram_config.m_addr_width = 24;
45 	sprogram_config.m_logaddr_width = 24;
46 }
47 
xavix2000_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)48 xavix2000_device::xavix2000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
49 	xavix2000_device(mconfig, XAVIX2000, tag, owner, clock)
50 {
51 }
52 
xavix2002_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)53 xavix2002_device::xavix2002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
54 	xavix2000_device(mconfig, XAVIX2002, tag, owner, clock)
55 {
56 }
57 
58 
device_start()59 void xavix2000_device::device_start()
60 {
61 	xavix_device::device_start();
62 
63 	state_add(SXAVIX_J, "J", m_j).callimport().formatstr("%8s");
64 	state_add(SXAVIX_K, "K", m_k).callimport().formatstr("%8s");
65 	state_add(SXAVIX_L, "L", m_l).callimport().formatstr("%8s");
66 	state_add(SXAVIX_M, "M", m_m).callimport().formatstr("%8s");
67 	state_add(SXAVIX_PA, "PA", m_pa).callimport().formatstr("%8s");
68 	state_add(SXAVIX_PB, "PB", m_pb).callimport().formatstr("%8s");
69 }
70 
create_disassembler()71 std::unique_ptr<util::disasm_interface> xavix2000_device::create_disassembler()
72 {
73 	return std::make_unique<xavix2000_disassembler>();
74 }
75 
76 
state_import(const device_state_entry & entry)77 void xavix2000_device::state_import(const device_state_entry &entry)
78 {
79 	xavix_device::state_import(entry);
80 
81 	switch(entry.index())
82 	{
83 	case SXAVIX_J:
84 		break;
85 	case SXAVIX_K:
86 		break;
87 	case SXAVIX_L:
88 		break;
89 	case SXAVIX_M:
90 		break;
91 	case SXAVIX_PA:
92 		break;
93 	case SXAVIX_PB:
94 		break;
95 	}
96 }
97 
state_string_export(const device_state_entry & entry,std::string & str) const98 void xavix2000_device::state_string_export(const device_state_entry &entry, std::string &str) const
99 {
100 	xavix_device::state_string_export(entry, str);
101 
102 	switch(entry.index())
103 	{
104 	case SXAVIX_J:
105 		str = string_format("%02x", m_j);
106 		break;
107 	case SXAVIX_K:
108 		str = string_format("%02x", m_k);
109 		break;
110 	case SXAVIX_L:
111 		str = string_format("%02x", m_l);
112 		break;
113 	case SXAVIX_M:
114 		str = string_format("%02x", m_m);
115 		break;
116 	case SXAVIX_PA:
117 		str = string_format("%08x", m_pa);
118 		break;
119 	case SXAVIX_PB:
120 		str = string_format("%08x", m_pb);
121 		break;
122 	}
123 }
124 
125 
126 #include "cpu/m6502/xavix2000.hxx"
127