trunk/src/emu/bus/a7800/xboard.c
| r31778 | r31779 | |
| 37 | 37 | |
| 38 | 38 | TODO: |
| 39 | 39 | - verify what happens when 2 POKEYs are present |
| 40 | | - understand why high score in XM is not written to NVRAM |
| 41 | | - add Yamaha YM2151 when more clear specs are available |
| 42 | 40 | |
| 43 | 41 | ***********************************************************************************************************/ |
| 44 | 42 | |
| r31778 | r31779 | |
| 73 | 71 | |
| 74 | 72 | |
| 75 | 73 | a78_xm_device::a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 76 | | : a78_xboard_device(mconfig, A78_XM, "Atari 7800 XM expansion module", tag, owner, clock, "a78_xm", __FILE__) |
| 74 | : a78_xboard_device(mconfig, A78_XM, "Atari 7800 XM expansion module", tag, owner, clock, "a78_xm", __FILE__), |
| 75 | m_ym(*this, "xm_ym2151") |
| 77 | 76 | { |
| 78 | 77 | } |
| 79 | 78 | |
| r31778 | r31779 | |
| 90 | 89 | m_ram_bank = 0; |
| 91 | 90 | } |
| 92 | 91 | |
| 92 | void a78_xm_device::device_start() |
| 93 | { |
| 94 | save_item(NAME(m_reg)); |
| 95 | save_item(NAME(m_ram_bank)); |
| 96 | save_item(NAME(m_ym_enabled)); |
| 97 | } |
| 93 | 98 | |
| 99 | void a78_xm_device::device_reset() |
| 100 | { |
| 101 | m_reg = 0; |
| 102 | m_ram_bank = 0; |
| 103 | m_ym_enabled = 0; |
| 104 | } |
| 105 | |
| 106 | |
| 94 | 107 | static MACHINE_CONFIG_FRAGMENT( a78_xb ) |
| 95 | 108 | MCFG_A78_CARTRIDGE_ADD("xb_slot", a7800_cart, NULL) |
| 96 | 109 | |
| r31778 | r31779 | |
| 100 | 113 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00) |
| 101 | 114 | MACHINE_CONFIG_END |
| 102 | 115 | |
| 116 | static MACHINE_CONFIG_FRAGMENT( a78_xm ) |
| 117 | MCFG_A78_CARTRIDGE_ADD("xb_slot", a7800_cart, NULL) |
| 118 | |
| 119 | MCFG_SPEAKER_STANDARD_MONO("xb_speaker") |
| 120 | |
| 121 | MCFG_SOUND_ADD("xb_pokey", POKEY, XTAL_14_31818MHz/8) |
| 122 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00) |
| 123 | |
| 124 | MCFG_SOUND_ADD("xm_ym2151", YM2151, XTAL_14_31818MHz/8) |
| 125 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "xb_speaker", 1.00) |
| 126 | MACHINE_CONFIG_END |
| 127 | |
| 103 | 128 | machine_config_constructor a78_xboard_device::device_mconfig_additions() const |
| 104 | 129 | { |
| 105 | 130 | return MACHINE_CONFIG_NAME( a78_xb ); |
| 106 | 131 | } |
| 107 | 132 | |
| 133 | machine_config_constructor a78_xm_device::device_mconfig_additions() const |
| 134 | { |
| 135 | return MACHINE_CONFIG_NAME( a78_xm ); |
| 136 | } |
| 108 | 137 | |
| 109 | 138 | /*------------------------------------------------- |
| 110 | 139 | mapper specific handlers |
| r31778 | r31779 | |
| 177 | 206 | return m_rom[offset]; |
| 178 | 207 | } |
| 179 | 208 | |
| 209 | READ8_MEMBER(a78_xm_device::read_04xx) |
| 210 | { |
| 211 | if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60) |
| 212 | return m_pokey->read(space, offset & 0x0f); |
| 213 | else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61) |
| 214 | return m_ym->read(space, offset & 1); |
| 215 | else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70) |
| 216 | return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY |
| 217 | else |
| 218 | return 0xff; |
| 219 | } |
| 220 | |
| 221 | WRITE8_MEMBER(a78_xm_device::write_04xx) |
| 222 | { |
| 223 | if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60) |
| 224 | m_pokey->write(space, offset & 0x0f, data); |
| 225 | else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61) |
| 226 | m_ym->write(space, offset & 1, data); |
| 227 | else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70) |
| 228 | m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY |
| 229 | else if (offset >= 0x70 && offset < 0x80) |
| 230 | { |
| 231 | if (data == 0x84) |
| 232 | m_ym_enabled = 1; |
| 233 | m_reg = data; |
| 234 | m_ram_bank = m_reg & 7; |
| 235 | } |
| 236 | } |
| 237 | |
trunk/src/emu/bus/a7800/xboard.h
| r31778 | r31779 | |
| 4 | 4 | #include "a78_slot.h" |
| 5 | 5 | #include "rom.h" |
| 6 | 6 | #include "sound/pokey.h" |
| 7 | #include "sound/2151intf.h" |
| 7 | 8 | |
| 8 | 9 | |
| 9 | 10 | // ======================> a78_xboard_device |
| r31778 | r31779 | |
| 41 | 42 | // construction/destruction |
| 42 | 43 | a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 43 | 44 | |
| 45 | // device-level overrides |
| 46 | virtual void device_start(); |
| 47 | virtual machine_config_constructor device_mconfig_additions() const; |
| 48 | virtual void device_reset(); |
| 49 | |
| 44 | 50 | // reading and writing |
| 51 | virtual DECLARE_READ8_MEMBER(read_04xx); |
| 52 | virtual DECLARE_WRITE8_MEMBER(write_04xx); |
| 45 | 53 | virtual DECLARE_READ8_MEMBER(read_10xx); |
| 46 | 54 | virtual DECLARE_WRITE8_MEMBER(write_10xx); |
| 47 | 55 | virtual DECLARE_READ8_MEMBER(read_30xx); |
| 56 | |
| 57 | protected: |
| 58 | required_device<ym2151_device> m_ym; |
| 59 | int m_ym_enabled; |
| 48 | 60 | }; |
| 49 | 61 | |
| 50 | 62 | |
trunk/hash/a7800.xml
| r31778 | r31779 | |
| 2436 | 2436 | |
| 2437 | 2437 | <!-- XM board enhanced --> |
| 2438 | 2438 | |
| 2439 | | <!-- these should require an XM board? but the emulation seems to be built into the base driver?--> |
| 2440 | | <!-- these have had the header stripped vs the .a78 files offered |
| 2441 | | there was also a 'binary' with size 0x24000, CRC fd503bd4 --> |
| 2442 | 2439 | <software name="dkongxm"> |
| 2443 | | <description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo)</description> |
| 2440 | <description>Donkey Kong (PAL, Demo, XM enhanced)</description> |
| 2444 | 2441 | <year>2012</year> |
| 2445 | | <publisher><homebrew></publisher> <!-- TEP392 --> |
| 2442 | <publisher><homebrew></publisher> |
| 2443 | <info name="programmer" value="TEP392" /> |
| 2446 | 2444 | <sharedfeat name="compatibility" value="PAL"/> |
| 2447 | 2445 | <part name="cart" interface="a7800_cart"> |
| 2448 | 2446 | <feature name="pcb_type" value="TYPE-XM" /> |
| 2449 | 2447 | <feature name="slot" value="a78_xmc" /> |
| 2450 | 2448 | <dataarea name="rom" size="0x24000"> |
| 2451 | | <rom name="dkxm_final_demo_pal_hsc.a78" size="0x24000" crc="6510b674" sha1="65b723b470d287af51e9888813149c43fb11ac26" offset="0" /> |
| 2452 | | </dataarea> |
| 2453 | | </part> |
| 2454 | | </software> |
| 2455 | | |
| 2456 | | <software name="dkongxmu" cloneof="dkongxm" > |
| 2457 | | <description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo) (NTSC)</description> |
| 2458 | | <year>2012</year> |
| 2459 | | <publisher><homebrew></publisher> <!-- TEP392 --> |
| 2460 | | <sharedfeat name="compatibility" value="NTSC"/> |
| 2461 | | <part name="cart" interface="a7800_cart"> |
| 2462 | | <feature name="pcb_type" value="TYPE-XM" /> |
| 2463 | | <feature name="slot" value="a78_xmc" /> |
| 2464 | | <dataarea name="rom" size="0x24000"> |
| 2465 | | <rom name="dkxm_final_demo_ntsc_hsc.a78" size="0x24000" crc="2c67fea7" sha1="7825c1946e3c7492fa9bbfae33029cd68c0d1135" offset="0" /> |
| 2466 | | </dataarea> |
| 2467 | | </part> |
| 2468 | | </software> |
| 2469 | | |
| 2470 | | <software name="dkongxmn" cloneof="dkongxm"> |
| 2471 | | <description>Donkey Kong (homebrew, XM enhanced) (Demo)</description> |
| 2472 | | <year>2012</year> |
| 2473 | | <publisher><homebrew></publisher> <!-- TEP392 --> |
| 2474 | | <sharedfeat name="compatibility" value="PAL"/> |
| 2475 | | <part name="cart" interface="a7800_cart"> |
| 2476 | | <feature name="pcb_type" value="TYPE-XM" /> |
| 2477 | | <feature name="slot" value="a78_xmc" /> |
| 2478 | | <dataarea name="rom" size="0x24000"> |
| 2479 | 2449 | <rom name="dkxm_final_demo_pal.a78" size="0x24000" crc="d362712e" sha1="118c462d6698bd23c378785f80062fdd7d65ca00" offset="0" /> |
| 2480 | 2450 | </dataarea> |
| 2481 | 2451 | </part> |
| 2482 | 2452 | </software> |
| 2483 | 2453 | |
| 2484 | 2454 | <software name="dkongxmnu" cloneof="dkongxm" > |
| 2485 | | <description>Donkey Kong (homebrew, XM enhanced) (Demo) (NTSC)</description> |
| 2455 | <description>Donkey Kong (NTSC, Demo, XM enhanced)</description> |
| 2486 | 2456 | <year>2012</year> |
| 2487 | | <publisher><homebrew></publisher> <!-- TEP392 --> |
| 2457 | <publisher><homebrew></publisher> |
| 2458 | <info name="programmer" value="TEP392" /> |
| 2488 | 2459 | <sharedfeat name="compatibility" value="NTSC"/> |
| 2489 | 2460 | <part name="cart" interface="a7800_cart"> |
| 2490 | 2461 | <feature name="pcb_type" value="TYPE-XM" /> |