trunk/hash/myvision.xml
| r0 | r26487 | |
| 1 | <?xml version="1.0"?> |
| 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | <softwarelist name="myvision" description="Nichibutsu My Vision cartridges"> |
| 4 | |
| 5 | <software name="gomoku"> |
| 6 | <description>Gomoku Narabe Renju</description> |
| 7 | <year>1983</year> |
| 8 | <publisher>Nihonbussan</publisher> |
| 9 | <info name="label" value="CORTRIDGE LT-0319953" /> |
| 10 | <info name="pcb" value="KH-1001-A" /> |
| 11 | <part name="cart" interface="myvision_cart"> |
| 12 | <dataarea name="rom" size="16384"> |
| 13 | <rom name="rj1" size="8192" crc="fa3df109" sha1="a3b5640fa465de3004a05e59c1362d440842355f" offset="000000" /> |
| 14 | <rom name="rj1" size="8192" crc="eae282e3" sha1="829a34a2d0685b68280d8251a641cadd12e3b3c4" offset="0x2000" /> |
| 15 | </dataarea> |
| 16 | </part> |
| 17 | </software> |
| 18 | |
| 19 | <software name="hanafuda"> |
| 20 | <description>Hanafuda</description> |
| 21 | <year>1983</year> |
| 22 | <publisher>Logitec Corp.</publisher> |
| 23 | <info name="label" value="CORTRIDGE LT-0730853" /> |
| 24 | <info name="pcb" value="KH-1001-A" /> |
| 25 | <part name="cart" interface="myvision_cart"> |
| 26 | <dataarea name="rom" size="24576"> |
| 27 | <rom name="f1" size="8192" crc="31f662c8" sha1="608c9fbcbcb134d3dfcecd9c3ea81d2f075b3fb9" offset="000000" /> |
| 28 | <rom name="f2" size="8192" crc="0e9fb68b" sha1="1730dededd220dd0a0c6fee41460981471283018" offset="0x2000" /> |
| 29 | <rom name="f3" size="8192" crc="057cc785" sha1="90d84df698a0166ed19e3c3f8d2da57b72cfde97" offset="0x4000" /> |
| 30 | </dataarea> |
| 31 | </part> |
| 32 | </software> |
| 33 | |
| 34 | <software name="mahjong"> |
| 35 | <description>Mahjong Nichibutsu</description> |
| 36 | <year>1983</year> |
| 37 | <publisher>Nihonbussan</publisher> |
| 38 | <info name="label" value="CORTRIDGE LT-0334653" /> |
| 39 | <info name="pcb" value="KH-1001-A" /> |
| 40 | <part name="cart" interface="myvision_cart"> |
| 41 | <dataarea name="rom" size="24576"> |
| 42 | <rom name="mj1" size="8192" crc="f7dff3c3" sha1="07d7916ebf1bf29d4da12ca11f29271da520023a" offset="000000" /> |
| 43 | <rom name="mj2" size="8192" crc="0b75671c" sha1="e69a6606d21cd487f3481afa51076320278eb543" offset="0x2000" /> |
| 44 | <rom name="mj3" size="8192" crc="b476c2c1" sha1="44d0c5738321cd4aa37b8ad25a4a4e77b144b6db" offset="0x4000" /> |
| 45 | </dataarea> |
| 46 | </part> |
| 47 | </software> |
| 48 | |
| 49 | <software name="tsumesho"> |
| 50 | <description>Tsumeshougi</description> |
| 51 | <year>1983</year> |
| 52 | <publisher>Logitec Corp.</publisher> |
| 53 | <info name="label" value="CORTRIDGE LT-0594253" /> |
| 54 | <info name="pcb" value="KH-1001-A" /> |
| 55 | <part name="cart" interface="myvision_cart"> |
| 56 | <dataarea name="rom" size="24576"> |
| 57 | <rom name="s1" size="8192" crc="bc4ae5b2" sha1="758ac3ab00d9b97026e67a9bad6b34d9e4a19e1c" offset="000000" /> |
| 58 | <rom name="s2" size="8192" crc="348b0074" sha1="d9373b04664c419cf2a2f0120a12ee2810313fb5" offset="0x2000" /> |
| 59 | <rom name="s3" size="8192" crc="d927a49d" sha1="2b8ded33cda425229d0fd5bbe236102afdcaf6cf" offset="0x4000" /> |
| 60 | </dataarea> |
| 61 | </part> |
| 62 | </software> |
| 63 | |
| 64 | </softwarelist> |
trunk/src/mess/drivers/myvision.c
| r0 | r26487 | |
| 1 | // license:BSD |
| 2 | // copyright-holders:Wilbert Pol |
| 3 | /*************************************************************************** |
| 4 | |
| 5 | Nichibutsu My Vision |
| 6 | driver by Wilbert Pol |
| 7 | |
| 8 | 2013/12/01 Skeleton driver. |
| 9 | 2013/12/02 Working driver. |
| 10 | |
| 11 | Known issues: |
| 12 | - The inputs sometimes feel a bit unresponsive. Was the real unit like |
| 13 | that? Or is it just because we have incorrect clocks? |
| 14 | |
| 15 | TODO: |
| 16 | - Review software list |
| 17 | - Implement cnd figure out ontrols |
| 18 | - Add clickable artwork |
| 19 | - Verify sound chip model |
| 20 | - Verify exact TMS9918 model |
| 21 | - Verify clock crystal(s) |
| 22 | - Verify size of vram |
| 23 | |
| 24 | ****************************************************************************/ |
| 25 | |
| 26 | |
| 27 | #include "emu.h" |
| 28 | #include "cpu/z80/z80.h" |
| 29 | #include "imagedev/cartslot.h" |
| 30 | #include "video/tms9928a.h" |
| 31 | #include "sound/ay8910.h" |
| 32 | |
| 33 | |
| 34 | class myvision_state : public driver_device |
| 35 | { |
| 36 | public: |
| 37 | myvision_state(const machine_config &mconfig, device_type type, const char *tag) |
| 38 | : driver_device(mconfig, type, tag) |
| 39 | , m_maincpu(*this, "maincpu") |
| 40 | , m_io_row0(*this, "ROW0") |
| 41 | , m_io_row1(*this, "ROW1") |
| 42 | , m_io_row2(*this, "ROW2") |
| 43 | , m_io_row3(*this, "ROW3") |
| 44 | { } |
| 45 | |
| 46 | DECLARE_WRITE_LINE_MEMBER( vdp_interrupt ); |
| 47 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( cart ); |
| 48 | DECLARE_READ8_MEMBER( ay_port_a_r ); |
| 49 | DECLARE_READ8_MEMBER( ay_port_b_r ); |
| 50 | DECLARE_WRITE8_MEMBER( ay_port_a_w ); |
| 51 | DECLARE_WRITE8_MEMBER( ay_port_b_w ); |
| 52 | |
| 53 | private: |
| 54 | virtual void machine_start(); |
| 55 | virtual void machine_reset(); |
| 56 | required_device<cpu_device> m_maincpu; |
| 57 | UINT8 m_column; |
| 58 | required_ioport m_io_row0; |
| 59 | required_ioport m_io_row1; |
| 60 | required_ioport m_io_row2; |
| 61 | required_ioport m_io_row3; |
| 62 | }; |
| 63 | |
| 64 | |
| 65 | static ADDRESS_MAP_START(myvision_mem, AS_PROGRAM, 8, myvision_state) |
| 66 | ADDRESS_MAP_UNMAP_HIGH |
| 67 | AM_RANGE( 0x0000, 0x5fff ) AM_ROM |
| 68 | AM_RANGE( 0xa000, 0xa7ff ) AM_RAM |
| 69 | AM_RANGE(0xe000, 0xe000) AM_DEVREADWRITE("tms9918", tms9918a_device, vram_read, vram_write) |
| 70 | AM_RANGE(0xe002, 0xe002) AM_DEVREADWRITE("tms9918", tms9918a_device, register_read, register_write) |
| 71 | ADDRESS_MAP_END |
| 72 | |
| 73 | |
| 74 | static ADDRESS_MAP_START(myvision_io, AS_IO, 8, myvision_state) |
| 75 | ADDRESS_MAP_UNMAP_HIGH |
| 76 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 77 | AM_RANGE(0x00, 0x00) AM_DEVWRITE("ay8910", ay8910_device, address_w) |
| 78 | AM_RANGE(0x01, 0x01) AM_DEVWRITE("ay8910", ay8910_device, data_w) |
| 79 | AM_RANGE(0x02, 0x02) AM_DEVREAD("ay8910", ay8910_device, data_r) |
| 80 | ADDRESS_MAP_END |
| 81 | |
| 82 | |
| 83 | /* Input ports */ |
| 84 | /* |
| 85 | Keyboard layout is something like: |
| 86 | B |
| 87 | A D E |
| 88 | C |
| 89 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
| 90 | */ |
| 91 | static INPUT_PORTS_START( myvision ) |
| 92 | PORT_START("ROW0") |
| 93 | PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED) |
| 94 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("13") PORT_CODE(KEYCODE_G) |
| 95 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) // C |
| 96 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("9") PORT_CODE(KEYCODE_A) |
| 97 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("5") PORT_CODE(KEYCODE_T) |
| 98 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("1") PORT_CODE(KEYCODE_Q) |
| 99 | |
| 100 | PORT_START("ROW1") |
| 101 | PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED) |
| 102 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) |
| 103 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 104 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("12") PORT_CODE(KEYCODE_F) |
| 105 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("8") PORT_CODE(KEYCODE_I) |
| 106 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("4") PORT_CODE(KEYCODE_R) |
| 107 | |
| 108 | PORT_START("ROW2") |
| 109 | PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED) |
| 110 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_START) PORT_NAME("14/Start") |
| 111 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) // D |
| 112 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("10") PORT_CODE(KEYCODE_S) |
| 113 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("6") PORT_CODE(KEYCODE_Y) |
| 114 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("2") PORT_CODE(KEYCODE_W) |
| 115 | |
| 116 | PORT_START("ROW3") |
| 117 | PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED) |
| 118 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) |
| 119 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) // E |
| 120 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("11") PORT_CODE(KEYCODE_D) |
| 121 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("7") PORT_CODE(KEYCODE_U) |
| 122 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("3") PORT_CODE(KEYCODE_E) |
| 123 | |
| 124 | INPUT_PORTS_END |
| 125 | |
| 126 | |
| 127 | void myvision_state::machine_start() |
| 128 | { |
| 129 | save_item(NAME(m_column)); |
| 130 | } |
| 131 | |
| 132 | |
| 133 | void myvision_state::machine_reset() |
| 134 | { |
| 135 | m_column = 0xff; |
| 136 | } |
| 137 | |
| 138 | |
| 139 | DEVICE_IMAGE_LOAD_MEMBER( myvision_state, cart ) |
| 140 | { |
| 141 | UINT8 *cart = memregion("maincpu")->base(); |
| 142 | |
| 143 | if (image.software_entry() == NULL) |
| 144 | { |
| 145 | UINT32 filesize = image.length(); |
| 146 | |
| 147 | if (filesize != 0x4000 && filesize != 0x6000) |
| 148 | { |
| 149 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Incorrect or not support cartridge size"); |
| 150 | return IMAGE_INIT_FAIL; |
| 151 | } |
| 152 | |
| 153 | if (image.fread( cart, filesize) != filesize) |
| 154 | { |
| 155 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file"); |
| 156 | return IMAGE_INIT_FAIL; |
| 157 | } |
| 158 | } |
| 159 | else |
| 160 | { |
| 161 | memcpy(cart, image.get_software_region("rom"), image.get_software_region_length("rom")); |
| 162 | } |
| 163 | |
| 164 | return IMAGE_INIT_PASS; |
| 165 | } |
| 166 | |
| 167 | |
| 168 | WRITE_LINE_MEMBER(myvision_state::vdp_interrupt) |
| 169 | { |
| 170 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, state); |
| 171 | } |
| 172 | |
| 173 | |
| 174 | static TMS9928A_INTERFACE(myvision_tms9918a_interface) |
| 175 | { |
| 176 | 0x4000, /* Not verified */ |
| 177 | DEVCB_DRIVER_LINE_MEMBER(myvision_state,vdp_interrupt) |
| 178 | }; |
| 179 | |
| 180 | |
| 181 | READ8_MEMBER( myvision_state::ay_port_a_r ) |
| 182 | { |
| 183 | UINT8 data = 0xFF; |
| 184 | |
| 185 | if ( ! ( m_column & 0x80 ) ) |
| 186 | { |
| 187 | data &= m_io_row0->read(); |
| 188 | } |
| 189 | |
| 190 | if ( ! ( m_column & 0x40 ) ) |
| 191 | { |
| 192 | data &= m_io_row1->read(); |
| 193 | } |
| 194 | |
| 195 | if ( ! ( m_column & 0x20 ) ) |
| 196 | { |
| 197 | data &= m_io_row2->read(); |
| 198 | } |
| 199 | |
| 200 | if ( ! ( m_column & 0x10 ) ) |
| 201 | { |
| 202 | data &= m_io_row3->read(); |
| 203 | } |
| 204 | |
| 205 | return data; |
| 206 | } |
| 207 | |
| 208 | |
| 209 | READ8_MEMBER( myvision_state::ay_port_b_r ) |
| 210 | { |
| 211 | return 0xFF; |
| 212 | } |
| 213 | |
| 214 | |
| 215 | WRITE8_MEMBER( myvision_state::ay_port_a_w ) |
| 216 | { |
| 217 | } |
| 218 | |
| 219 | |
| 220 | // Upper 4 bits select column |
| 221 | WRITE8_MEMBER( myvision_state::ay_port_b_w ) |
| 222 | { |
| 223 | m_column = data; |
| 224 | } |
| 225 | |
| 226 | |
| 227 | static const ay8910_interface myvision_ay8910_interface = |
| 228 | { |
| 229 | AY8910_LEGACY_OUTPUT, |
| 230 | AY8910_DEFAULT_LOADS, |
| 231 | DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_r), |
| 232 | DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_r), |
| 233 | DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_w), |
| 234 | DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_w) |
| 235 | }; |
| 236 | |
| 237 | |
| 238 | static MACHINE_CONFIG_START( myvision, myvision_state ) |
| 239 | /* basic machine hardware */ |
| 240 | MCFG_CPU_ADD("maincpu",Z80, XTAL_10_738635MHz/3) /* Not verified */ |
| 241 | MCFG_CPU_PROGRAM_MAP(myvision_mem) |
| 242 | MCFG_CPU_IO_MAP(myvision_io) |
| 243 | |
| 244 | /* video hardware */ |
| 245 | MCFG_TMS9928A_ADD( "tms9918", TMS9918A, myvision_tms9918a_interface ) /* Exact model not verified */ |
| 246 | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 247 | MCFG_SCREEN_UPDATE_DEVICE( "tms9918", tms9918a_device, screen_update ) |
| 248 | |
| 249 | /* sound hardware */ |
| 250 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 251 | MCFG_SOUND_ADD("ay8910", AY8910, XTAL_10_738635MHz/3/2) /* Exact model and clock not verified */ |
| 252 | MCFG_SOUND_CONFIG(myvision_ay8910_interface) |
| 253 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 254 | |
| 255 | /* cartridge */ |
| 256 | MCFG_CARTSLOT_ADD("cart") |
| 257 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 258 | MCFG_CARTSLOT_MANDATORY |
| 259 | MCFG_CARTSLOT_LOAD(myvision_state,cart) |
| 260 | MCFG_CARTSLOT_INTERFACE("myvision_cart") |
| 261 | |
| 262 | /* software lists */ |
| 263 | MCFG_SOFTWARE_LIST_ADD("cart_list","myvision") |
| 264 | MACHINE_CONFIG_END |
| 265 | |
| 266 | /* ROM definition */ |
| 267 | ROM_START( myvision ) |
| 268 | ROM_REGION( 0x6000, "maincpu", ROMREGION_ERASEFF ) |
| 269 | ROM_END |
| 270 | |
| 271 | /* Driver */ |
| 272 | |
| 273 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 274 | COMP( 1983, myvision, 0, 0, myvision, myvision, driver_device, 0, "Nichibutsu", "My Vision (KH-1000)", 0 ) |
| 275 | |