trunk/src/emu/bus/msx_slot/cartridge.c
| r30762 | r30763 | |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | const device_type MSX_SLOT_CARTRIDGE = &device_creator<msx_slot_cartridge_device>; |
| 31 | const device_type MSX_SLOT_YAMAHA_EXPANSION = &device_creator<msx_slot_yamaha_expansion_device>; |
| 31 | 32 | |
| 32 | 33 | |
| 33 | 34 | msx_slot_cartridge_device::msx_slot_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| r30762 | r30763 | |
| 35 | 36 | , device_image_interface(mconfig, *this) |
| 36 | 37 | , device_slot_interface(mconfig, *this) |
| 37 | 38 | , msx_internal_slot_interface() |
| 39 | , m_irq_handler(*this) |
| 40 | , m_cartridge(NULL) |
| 38 | 41 | { |
| 39 | 42 | } |
| 40 | 43 | |
| 41 | 44 | |
| 45 | msx_slot_cartridge_device::msx_slot_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 46 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source) |
| 47 | , device_image_interface(mconfig, *this) |
| 48 | , device_slot_interface(mconfig, *this) |
| 49 | , msx_internal_slot_interface() |
| 50 | , m_irq_handler(*this) |
| 51 | , m_cartridge(NULL) |
| 52 | { |
| 53 | } |
| 54 | |
| 55 | |
| 42 | 56 | static const struct |
| 43 | 57 | { |
| 44 | 58 | int pcb_id; |
| r30762 | r30763 | |
| 81 | 95 | |
| 82 | 96 | void msx_slot_cartridge_device::device_start() |
| 83 | 97 | { |
| 98 | m_irq_handler.resolve_safe(); |
| 84 | 99 | m_cartridge = dynamic_cast<msx_cart_interface *>(get_card_device()); |
| 85 | 100 | } |
| 86 | 101 | |
| r30762 | r30763 | |
| 133 | 148 | } |
| 134 | 149 | } |
| 135 | 150 | |
| 151 | m_cartridge->set_out_irq_cb(DEVCB_WRITELINE(msx_slot_cartridge_device, irq_out)); |
| 136 | 152 | m_cartridge->initialize_cartridge(); |
| 137 | 153 | |
| 138 | 154 | if (m_cartridge->get_sram_size() > 0) |
| r30762 | r30763 | |
| 163 | 179 | } |
| 164 | 180 | |
| 165 | 181 | |
| 182 | WRITE_LINE_MEMBER(msx_slot_cartridge_device::irq_out) |
| 183 | { |
| 184 | m_irq_handler(state); |
| 185 | } |
| 186 | |
| 187 | |
| 166 | 188 | int msx_slot_cartridge_device::get_cart_type(UINT8 *rom, UINT32 length) |
| 167 | 189 | { |
| 168 | 190 | if (length < 0x2000) |
| r30762 | r30763 | |
| 315 | 337 | } |
| 316 | 338 | } |
| 317 | 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | msx_slot_yamaha_expansion_device::msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 344 | : msx_slot_cartridge_device(mconfig, MSX_SLOT_YAMAHA_EXPANSION, "MSX Yamaha Expansion slot", tag, owner, clock, "msx_slot_yamaha_expansion", __FILE__) |
| 345 | { |
| 346 | } |
| 347 | |
| 348 | |
| 349 | void msx_slot_yamaha_expansion_device::device_start() |
| 350 | { |
| 351 | m_irq_handler.resolve_safe(); |
| 352 | m_cartridge = dynamic_cast<msx_cart_interface *>(get_card_device()); |
| 353 | if (m_cartridge) |
| 354 | { |
| 355 | m_cartridge->set_out_irq_cb(DEVCB_WRITELINE(msx_slot_cartridge_device, irq_out)); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | |
trunk/src/emu/bus/msx_slot/cartridge.h
| r30762 | r30763 | |
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | extern const device_type MSX_SLOT_CARTRIDGE; |
| 9 | extern const device_type MSX_SLOT_YAMAHA_EXPANSION; |
| 9 | 10 | |
| 10 | 11 | |
| 11 | | #define MCFG_MSX_SLOT_CARTRIDGE_ADD(_tag) \ |
| 12 | #define MCFG_MSX_SLOT_CARTRIDGE_ADD(_tag, _devcb) \ |
| 12 | 13 | MCFG_DEVICE_ADD(_tag, MSX_SLOT_CARTRIDGE, 0) \ |
| 13 | | MCFG_DEVICE_SLOT_INTERFACE(msx_cart, NULL, false) |
| 14 | MCFG_DEVICE_SLOT_INTERFACE(msx_cart, NULL, false) \ |
| 15 | devcb = &msx_slot_cartridge_device::set_irq_handler(*device, DEVCB_##_devcb); |
| 14 | 16 | |
| 15 | 17 | |
| 18 | #define MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, _devcb) \ |
| 19 | MCFG_DEVICE_ADD(_tag, MSX_SLOT_YAMAHA_EXPANSION, 0) \ |
| 20 | MCFG_DEVICE_SLOT_INTERFACE(msx_yamaha_60pin, NULL, false) \ |
| 21 | devcb = &msx_slot_cartridge_device::set_irq_handler(*device, DEVCB_##_devcb); |
| 22 | |
| 23 | |
| 16 | 24 | class msx_slot_cartridge_device : public device_t |
| 17 | 25 | , public device_image_interface |
| 18 | 26 | , public device_slot_interface |
| r30762 | r30763 | |
| 20 | 28 | { |
| 21 | 29 | public: |
| 22 | 30 | // construction/destruction |
| 31 | msx_slot_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); |
| 23 | 32 | msx_slot_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 24 | 33 | |
| 34 | // static configuration helpers |
| 35 | template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast<msx_slot_cartridge_device &>(device).m_irq_handler.set_callback(object); } |
| 36 | |
| 25 | 37 | // device-level overrides |
| 26 | 38 | virtual void device_start(); |
| 27 | 39 | virtual void device_config_complete() { update_names(MSX_SLOT_CARTRIDGE, "cartridge", "cart"); } |
| r30762 | r30763 | |
| 47 | 59 | virtual DECLARE_READ8_MEMBER(read); |
| 48 | 60 | virtual DECLARE_WRITE8_MEMBER(write); |
| 49 | 61 | |
| 50 | | private: |
| 62 | DECLARE_WRITE_LINE_MEMBER(irq_out); |
| 63 | |
| 64 | protected: |
| 65 | devcb_write_line m_irq_handler; |
| 51 | 66 | msx_cart_interface *m_cartridge; |
| 52 | 67 | |
| 53 | 68 | int get_cart_type(UINT8 *rom, UINT32 length); |
| 54 | 69 | }; |
| 55 | 70 | |
| 71 | |
| 72 | class msx_slot_yamaha_expansion_device : public msx_slot_cartridge_device |
| 73 | { |
| 74 | public: |
| 75 | // construction/destruction |
| 76 | msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 77 | |
| 78 | virtual void device_start(); |
| 79 | }; |
| 80 | |
| 81 | |
| 56 | 82 | #endif |
| 57 | 83 | |
trunk/src/emu/bus/msx_cart/msx_audio.c
| r30762 | r30763 | |
| 136 | 136 | |
| 137 | 137 | static MACHINE_CONFIG_FRAGMENT( msx_audio_nms1205 ) |
| 138 | 138 | // This is actually incorrect. The sound output is passed back into the MSX machine where it is mixed internally and output through the system 'speaker'. |
| 139 | // At the same time the sound is also output on two output on the nms1205 cartridge itself |
| 139 | 140 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 140 | 141 | MCFG_SOUND_ADD("y8950", Y8950, XTAL_3_579545MHz) |
| 141 | 142 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 142 | 143 | MCFG_Y8950_KEYBOARD_WRITE_HANDLER(DEVWRITE8("kbdc", msx_audio_kbdc_port_device, write)) |
| 143 | 144 | MCFG_Y8950_KEYBOARD_READ_HANDLER(DEVREAD8("kbdc", msx_audio_kbdc_port_device, read)) |
| 145 | MCFG_Y8950_IRQ_HANDLER(WRITELINE(msx_cart_msx_audio_nms1205, irq_write)) |
| 144 | 146 | |
| 145 | 147 | MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, NULL) |
| 146 | 148 | |
| r30762 | r30763 | |
| 174 | 176 | } |
| 175 | 177 | |
| 176 | 178 | |
| 179 | WRITE_LINE_MEMBER(msx_cart_msx_audio_nms1205::irq_write) |
| 180 | { |
| 181 | // Trigger IRQ on the maincpu |
| 182 | // The 8950 seems to trigger an irq on reset, this causes an infinite loop of continuously triggering |
| 183 | // the MSX's interrupt handler. The 8950 irq will never be cleared the nms1205's irq handler hook hasn't |
| 184 | // been installed yet. |
| 185 | // m_out_irq_cb(state); |
| 186 | } |
| 187 | |
| 188 | |
| 177 | 189 | WRITE_LINE_MEMBER(msx_cart_msx_audio_nms1205::midi_in) |
| 178 | 190 | { |
| 179 | 191 | // MIDI in signals is sent to both the 6850 and the MIDI thru output port |
trunk/src/emu/bus/msx_cart/yamaha.c
| r0 | r30763 | |
| 1 | #include "emu.h" |
| 2 | #include "yamaha.h" |
| 3 | |
| 4 | |
| 5 | const device_type MSX_CART_SFG01 = &device_creator<msx_cart_sfg01>; |
| 6 | |
| 7 | |
| 8 | msx_cart_sfg01::msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 9 | : device_t(mconfig, MSX_CART_SFG01, "MSX Cartridge - SFG01", tag, owner, clock, "msx_cart_sfg01", __FILE__) |
| 10 | , msx_cart_interface(mconfig, *this) |
| 11 | , m_region_sfg01(*this, "sfg01") |
| 12 | , m_ym2151(*this, "ym2151") |
| 13 | , m_kbdc(*this, "kbdc") |
| 14 | , m_ym2151_irq_state(CLEAR_LINE) |
| 15 | , m_ym2148_irq_state(CLEAR_LINE) |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | |
| 20 | static MACHINE_CONFIG_FRAGMENT( msx_sfg01 ) |
| 21 | // YM2151 (OPM) |
| 22 | // YM3012 (DAC) |
| 23 | // YM2148 (MKS) |
| 24 | |
| 25 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 26 | MCFG_YM2151_ADD("ym2151", XTAL_4MHz) |
| 27 | MCFG_YM2151_IRQ_HANDLER(WRITELINE(msx_cart_sfg01, ym2151_irq_w)) |
| 28 | // MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(msx_cart_sfg01, port_w)) |
| 29 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) |
| 30 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) |
| 31 | |
| 32 | MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, NULL) |
| 33 | MACHINE_CONFIG_END |
| 34 | |
| 35 | |
| 36 | machine_config_constructor msx_cart_sfg01::device_mconfig_additions() const |
| 37 | { |
| 38 | return MACHINE_CONFIG_NAME( msx_sfg01 ); |
| 39 | } |
| 40 | |
| 41 | |
| 42 | ROM_START( msx_sfg01 ) |
| 43 | ROM_REGION(0x4000, "sfg01", 0) |
| 44 | ROM_LOAD("sfg01.rom", 0x0, 0x4000, CRC(0995fb36) SHA1(434651305f92aa770a89e40b81125fb22d91603d)) |
| 45 | ROM_END |
| 46 | |
| 47 | |
| 48 | const rom_entry *msx_cart_sfg01::device_rom_region() const |
| 49 | { |
| 50 | return ROM_NAME( msx_sfg01 ); |
| 51 | } |
| 52 | |
| 53 | |
| 54 | void msx_cart_sfg01::device_start() |
| 55 | { |
| 56 | } |
| 57 | |
| 58 | |
| 59 | void msx_cart_sfg01::initialize_cartridge() |
| 60 | { |
| 61 | } |
| 62 | |
| 63 | |
| 64 | WRITE_LINE_MEMBER(msx_cart_sfg01::ym2151_irq_w) |
| 65 | { |
| 66 | m_ym2151_irq_state = state ? ASSERT_LINE : CLEAR_LINE; |
| 67 | check_irq(); |
| 68 | } |
| 69 | |
| 70 | |
| 71 | WRITE_LINE_MEMBER(msx_cart_sfg01::ym2148_irq_w) |
| 72 | { |
| 73 | m_ym2148_irq_state = state ? ASSERT_LINE : CLEAR_LINE; |
| 74 | check_irq(); |
| 75 | } |
| 76 | |
| 77 | |
| 78 | void msx_cart_sfg01::check_irq() |
| 79 | { |
| 80 | if (m_ym2151_irq_state != CLEAR_LINE || m_ym2148_irq_state != CLEAR_LINE) |
| 81 | { |
| 82 | m_out_irq_cb(ASSERT_LINE); |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | m_out_irq_cb(CLEAR_LINE); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | |
| 91 | READ8_MEMBER(msx_cart_sfg01::read_cart) |
| 92 | { |
| 93 | switch (offset) |
| 94 | { |
| 95 | case 0x3ff0: // YM-2151 status read |
| 96 | case 0x3ff1: // YM-2151 status read mirror? |
| 97 | return m_ym2151->status_r(space, 0); |
| 98 | |
| 99 | case 0x3ff2: // YM-2148 keyboard column read |
| 100 | return m_kbdc->read(space, 0); |
| 101 | |
| 102 | case 0x3ff3: // YM-2148 -- |
| 103 | case 0x3ff4: // YM-2148 -- |
| 104 | case 0x3ff5: // YM-2148 MIDI UART data read register |
| 105 | case 0x3ff6: // YM-2148 MIDI UART status register |
| 106 | break; |
| 107 | } |
| 108 | |
| 109 | if (offset < 0x8000) |
| 110 | { |
| 111 | return m_region_sfg01->u8(offset & 0x3fff); |
| 112 | } |
| 113 | |
| 114 | return 0xff; |
| 115 | } |
| 116 | |
| 117 | |
| 118 | WRITE8_MEMBER(msx_cart_sfg01::write_cart) |
| 119 | { |
| 120 | switch (offset) |
| 121 | { |
| 122 | case 0x3ff0: // YM-2151 register |
| 123 | m_ym2151->register_w(space, 0, data); |
| 124 | break; |
| 125 | |
| 126 | case 0x3ff1: // YM-2151 data |
| 127 | m_ym2151->data_w(space, 0, data); |
| 128 | break; |
| 129 | |
| 130 | case 0x3ff2: // YM-2148 write keyboard row |
| 131 | m_kbdc->write(space, 0, data); |
| 132 | break; |
| 133 | |
| 134 | case 0x3ff3: // YM-2148 MIDI IRQ vector |
| 135 | case 0x3ff4: // YM-2148 External IRQ vector |
| 136 | case 0x3ff5: // YM-2148 MIDI UART data write register |
| 137 | case 0x3ff6: // YM-2148 MIDI UART command register |
| 138 | default: |
| 139 | logerror("msx_cart_sfg01::write_cart: write %02x to %04x\n", data, offset); |
| 140 | break; |
| 141 | } |
| 142 | } |
| 143 | |
trunk/src/emu/bus/msx_cart/yamaha.h
| r0 | r30763 | |
| 1 | #ifndef __MSX_CART_YAMAHA_H |
| 2 | #define __MSX_CART_YAMAHA_H |
| 3 | |
| 4 | #include "bus/msx_cart/cartridge.h" |
| 5 | #include "sound/2151intf.h" |
| 6 | #include "bus/msx_cart/msx_audio_kb.h" |
| 7 | |
| 8 | |
| 9 | extern const device_type MSX_CART_SFG01; |
| 10 | //extern const device_type MSX_CART_SFG05; |
| 11 | |
| 12 | |
| 13 | class msx_cart_sfg01 : public device_t |
| 14 | , public msx_cart_interface |
| 15 | { |
| 16 | public: |
| 17 | msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 18 | |
| 19 | // device-level overrides |
| 20 | virtual machine_config_constructor device_mconfig_additions() const; |
| 21 | virtual const rom_entry *device_rom_region() const; |
| 22 | virtual void device_start(); |
| 23 | |
| 24 | virtual void initialize_cartridge(); |
| 25 | |
| 26 | virtual DECLARE_READ8_MEMBER(read_cart); |
| 27 | virtual DECLARE_WRITE8_MEMBER(write_cart); |
| 28 | |
| 29 | DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w); |
| 30 | DECLARE_WRITE_LINE_MEMBER(ym2148_irq_w); |
| 31 | |
| 32 | private: |
| 33 | required_memory_region m_region_sfg01; |
| 34 | required_device<ym2151_device> m_ym2151; |
| 35 | required_device<msx_audio_kbdc_port_device> m_kbdc; |
| 36 | int m_ym2151_irq_state; |
| 37 | int m_ym2148_irq_state; |
| 38 | |
| 39 | void check_irq(); |
| 40 | }; |
| 41 | |
| 42 | #endif |
| 43 | |
trunk/src/mess/drivers/msx.c
| r30762 | r30763 | |
| 1244 | 1244 | /* Video hardware */ |
| 1245 | 1245 | MCFG_DEVICE_ADD( "tms9928a", TMS9928A, XTAL_10_738635MHz / 2 ) |
| 1246 | 1246 | MCFG_TMS9928A_VRAM_SIZE(0x4000) |
| 1247 | | MCFG_TMS9928A_OUT_INT_LINE_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 1247 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0)) |
| 1248 | 1248 | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 1249 | 1249 | MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update) |
| 1250 | 1250 | MACHINE_CONFIG_END |
| r30762 | r30763 | |
| 1254 | 1254 | /* Video hardware */ |
| 1255 | 1255 | MCFG_DEVICE_ADD( "tms9928a", TMS9929A, XTAL_10_738635MHz / 2 ) |
| 1256 | 1256 | MCFG_TMS9928A_VRAM_SIZE(0x4000) |
| 1257 | | MCFG_TMS9928A_OUT_INT_LINE_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 1257 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0)) |
| 1258 | 1258 | MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" ) |
| 1259 | 1259 | MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update) |
| 1260 | 1260 | MACHINE_CONFIG_END |
| r30762 | r30763 | |
| 1285 | 1285 | |
| 1286 | 1286 | /* video hardware */ |
| 1287 | 1287 | MCFG_V9938_ADD("v9938", "screen", 0x20000) |
| 1288 | | MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(msx_state,msx_vdp_interrupt)) |
| 1288 | MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(msx_state,msx_irq_source0)) |
| 1289 | 1289 | |
| 1290 | 1290 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1291 | 1291 | MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r30762 | r30763 | |
| 1353 | 1353 | |
| 1354 | 1354 | /* video hardware */ |
| 1355 | 1355 | MCFG_V9958_ADD("v9958", "screen", 0x20000) |
| 1356 | | MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(msx_state,msx_vdp_interrupt)) |
| 1356 | MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(msx_state,msx_irq_source0)) |
| 1357 | 1357 | |
| 1358 | 1358 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1359 | 1359 | MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r30762 | r30763 | |
| 2774 | 2774 | // YM2149 |
| 2775 | 2775 | // FDC: None, 0 drives |
| 2776 | 2776 | // 2 Cartridge slots |
| 2777 | // 1 Expansion slot (60 pins interface instead of regular 50 pin cartridge interface) |
| 2777 | 2778 | |
| 2778 | 2779 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) |
| 2779 | 2780 | MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 2, 2) /* 32KB RAM */ |
| 2780 | 2781 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0) |
| 2781 | 2782 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0) |
| 2782 | | MCFG_MSX_LAYOUT_ROM("sfg", 3, 0, 0, 2, "maincpu", 0x8000) /* SFG */ |
| 2783 | MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 0) |
| 2784 | // MCFG_MSX_LAYOUT_ROM("sfg", 3, 0, 0, 2, "maincpu", 0x8000) /* SFG */ |
| 2783 | 2785 | |
| 2784 | 2786 | MCFG_FRAGMENT_ADD( msx1_cartlist ) |
| 2785 | 2787 | MACHINE_CONFIG_END |
trunk/src/mess/includes/msx.h
| r30762 | r30763 | |
| 53 | 53 | msx_state::install_slot_pages(*owner, _prim, _sec, _page, _numpages, device); |
| 54 | 54 | |
| 55 | 55 | #define MCFG_MSX_LAYOUT_CARTRIDGE(_tag, _prim, _sec) \ |
| 56 | | MCFG_MSX_SLOT_CARTRIDGE_ADD(_tag) \ |
| 56 | MCFG_MSX_SLOT_CARTRIDGE_ADD(_tag, WRITELINE(msx_state, msx_irq_source1)) \ |
| 57 | 57 | msx_state::install_slot_pages(*owner, _prim, _sec, 0, 4, device); |
| 58 | 58 | |
| 59 | #define MCFG_MSX_LAYOUT_YAMAHA_EXPANSION(_tag, _prim, _sec) \ |
| 60 | MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, WRITELINE(msx_state, msx_irq_source2)) \ |
| 61 | msx_state::install_slot_pages(*owner, _prim, _sec, 0, 4, device); |
| 62 | |
| 59 | 63 | #define MCFG_MSX_LAYOUT_RAM_MM(_tag, _prim, _sec, _total_size) \ |
| 60 | 64 | MCFG_MSX_SLOT_RAM_MM_ADD(_tag, _total_size) \ |
| 61 | 65 | msx_state::install_slot_pages(*owner, _prim, _sec, 0, 4, device); |
| r30762 | r30763 | |
| 148 | 152 | } |
| 149 | 153 | m_mouse[0] = m_mouse[1] = 0; |
| 150 | 154 | m_mouse_stat[0] = m_mouse_stat[1] = 0; |
| 155 | for (int i = 0; i < ARRAY_LENGTH(m_irq_state); i++) |
| 156 | { |
| 157 | m_irq_state[i] = CLEAR_LINE; |
| 158 | } |
| 151 | 159 | } |
| 152 | 160 | |
| 153 | 161 | // static configuration helpers |
| r30762 | r30763 | |
| 218 | 226 | DECLARE_WRITE8_MEMBER(msx_ay8910_w); |
| 219 | 227 | void msx_memory_init(); |
| 220 | 228 | |
| 221 | | DECLARE_WRITE_LINE_MEMBER(msx_vdp_interrupt); |
| 229 | DECLARE_WRITE_LINE_MEMBER(msx_irq_source0) { msx_irq_source(0, state); } // usually tms9918/v9938/v9958 |
| 230 | DECLARE_WRITE_LINE_MEMBER(msx_irq_source1) { msx_irq_source(1, state); } // usually first cartridge slot |
| 231 | DECLARE_WRITE_LINE_MEMBER(msx_irq_source2) { msx_irq_source(2, state); } // usually second cartridge slot |
| 232 | DECLARE_WRITE_LINE_MEMBER(msx_irq_source3) { msx_irq_source(3, state); } // sometimes expansion slot |
| 222 | 233 | |
| 223 | 234 | protected: |
| 224 | 235 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == 0) ? &m_switched_device_as_config : NULL; } |
| r30762 | r30763 | |
| 237 | 248 | required_ioport m_io_key3; |
| 238 | 249 | required_ioport m_io_key4; |
| 239 | 250 | required_ioport m_io_key5; |
| 251 | |
| 252 | private: |
| 253 | int m_irq_state[4]; |
| 254 | |
| 255 | void msx_irq_source(int source, int level); |
| 256 | void check_irq(); |
| 240 | 257 | }; |
| 241 | 258 | |
| 242 | 259 | |