trunk/src/emu/bus/msx_slot/cartridge.c
| r30815 | r30816 | |
| 106 | 106 | { |
| 107 | 107 | if ( software_entry() ) |
| 108 | 108 | { |
| 109 | UINT32 length; |
| 110 | |
| 109 | 111 | // Allocate and copy rom contents |
| 110 | | UINT32 length = get_software_region_length("rom"); |
| 111 | | |
| 112 | length = get_software_region_length("rom"); |
| 112 | 113 | m_cartridge->rom_alloc( length ); |
| 113 | | UINT8 *rom_base = m_cartridge->get_rom_base(); |
| 114 | | memcpy(rom_base, get_software_region("rom"), length); |
| 114 | if (length > 0) |
| 115 | { |
| 116 | UINT8 *rom_base = m_cartridge->get_rom_base(); |
| 117 | memcpy(rom_base, get_software_region("rom"), length); |
| 118 | } |
| 115 | 119 | |
| 120 | // Allocate and copy vlm5030 rom contents |
| 121 | length = get_software_region_length("vlm5030"); |
| 122 | m_cartridge->rom_vlm5030_alloc(length); |
| 123 | if (length > 0) |
| 124 | { |
| 125 | UINT8 *rom_base = m_cartridge->get_rom_vlm5030_base(); |
| 126 | memcpy(rom_base, get_software_region("vlm5030"), length); |
| 127 | } |
| 128 | |
| 116 | 129 | // Allocate ram |
| 117 | 130 | length = get_software_region_length("ram"); |
| 118 | 131 | m_cartridge->ram_alloc( length ); |
trunk/src/emu/bus/msx_cart/konami.c
| r30815 | r30816 | |
| 7 | 7 | const device_type MSX_CART_SYNTHESIZER = &device_creator<msx_cart_synthesizer>; |
| 8 | 8 | const device_type MSX_CART_SOUND_SNATCHER = &device_creator<msx_cart_konami_sound_snatcher>; |
| 9 | 9 | const device_type MSX_CART_SOUND_SDSNATCHER = &device_creator<msx_cart_konami_sound_sdsnatcher>; |
| 10 | const device_type MSX_CART_KEYBOARD_MASTER = &device_creator<msx_cart_keyboard_master>; |
| 10 | 11 | |
| 11 | 12 | |
| 12 | 13 | msx_cart_konami::msx_cart_konami(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| r30815 | r30816 | |
| 866 | 867 | |
| 867 | 868 | } |
| 868 | 869 | |
| 870 | |
| 871 | |
| 872 | msx_cart_keyboard_master::msx_cart_keyboard_master(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 873 | : device_t(mconfig, MSX_CART_KEYBOARD_MASTER, "MSX Cartridge - Keyboard Master", tag, owner, clock, "msx_cart_keyboard_master", __FILE__) |
| 874 | , msx_cart_interface(mconfig, *this) |
| 875 | , m_vlm5030(*this, "vlm5030") |
| 876 | { |
| 877 | } |
| 878 | |
| 879 | |
| 880 | static MACHINE_CONFIG_FRAGMENT( msx_cart_keyboard_master ) |
| 881 | // 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'. |
| 882 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 883 | MCFG_SOUND_ADD("vlm5030", VLM5030, XTAL_3_579545MHz) |
| 884 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 885 | MACHINE_CONFIG_END |
| 886 | |
| 887 | |
| 888 | machine_config_constructor msx_cart_keyboard_master::device_mconfig_additions() const |
| 889 | { |
| 890 | return MACHINE_CONFIG_NAME( msx_cart_keyboard_master ); |
| 891 | } |
| 892 | |
| 893 | |
| 894 | void msx_cart_keyboard_master::device_start() |
| 895 | { |
| 896 | // Install IO read/write handlers |
| 897 | address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO); |
| 898 | space.install_write_handler(0x00, 0x00, write8_delegate(FUNC(vlm5030_device::data_w), m_vlm5030.target())); |
| 899 | space.install_write_handler(0x20, 0x20, write8_delegate(FUNC(msx_cart_keyboard_master::io_20_w), this)); |
| 900 | space.install_read_handler(0x00, 0x00, read8_delegate(FUNC(msx_cart_keyboard_master::io_00_r), this)); |
| 901 | } |
| 902 | |
| 903 | |
| 904 | void msx_cart_keyboard_master::initialize_cartridge() |
| 905 | { |
| 906 | if (get_rom_size() != 0x4000) |
| 907 | { |
| 908 | fatalerror("keyboard_master: Invalid ROM size\n"); |
| 909 | } |
| 910 | m_vlm5030->set_rom(m_rom_vlm5030); |
| 911 | } |
| 912 | |
| 913 | |
| 914 | READ8_MEMBER(msx_cart_keyboard_master::read_cart) |
| 915 | { |
| 916 | if (offset >= 0x4000 && offset < 0x8000) |
| 917 | { |
| 918 | return m_rom[offset & 0x3fff]; |
| 919 | } |
| 920 | return 0xff; |
| 921 | } |
| 922 | |
| 923 | |
| 924 | WRITE8_MEMBER(msx_cart_keyboard_master::io_20_w) |
| 925 | { |
| 926 | m_vlm5030->rst((data & 0x01) ? 1 : 0); |
| 927 | m_vlm5030->vcu((data & 0x04) ? 1 : 0); |
| 928 | m_vlm5030->st((data & 0x02) ? 1 : 0); |
| 929 | } |
| 930 | |
| 931 | |
| 932 | READ8_MEMBER(msx_cart_keyboard_master::io_00_r) |
| 933 | { |
| 934 | return m_vlm5030->bsy() ? 0x10 : 0x00; |
| 935 | } |
| 936 | |
trunk/src/emu/bus/msx_cart/konami.h
| r30815 | r30816 | |
| 3 | 3 | |
| 4 | 4 | #include "bus/msx_cart/cartridge.h" |
| 5 | 5 | #include "sound/k051649.h" |
| 6 | #include "sound/vlm5030.h" |
| 6 | 7 | #include "sound/dac.h" |
| 7 | 8 | |
| 8 | 9 | |
| r30815 | r30816 | |
| 12 | 13 | extern const device_type MSX_CART_SYNTHESIZER; |
| 13 | 14 | extern const device_type MSX_CART_SOUND_SNATCHER; |
| 14 | 15 | extern const device_type MSX_CART_SOUND_SDSNATCHER; |
| 16 | extern const device_type MSX_CART_KEYBOARD_MASTER; |
| 15 | 17 | |
| 16 | 18 | |
| 17 | 19 | class msx_cart_konami : public device_t |
| r30815 | r30816 | |
| 166 | 168 | }; |
| 167 | 169 | |
| 168 | 170 | |
| 171 | |
| 172 | class msx_cart_keyboard_master : public device_t |
| 173 | , public msx_cart_interface |
| 174 | { |
| 175 | public: |
| 176 | msx_cart_keyboard_master(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 177 | |
| 178 | // device-level overrides |
| 179 | virtual machine_config_constructor device_mconfig_additions() const; |
| 180 | virtual void device_start(); |
| 181 | |
| 182 | virtual void initialize_cartridge(); |
| 183 | |
| 184 | virtual DECLARE_READ8_MEMBER(read_cart); |
| 185 | |
| 186 | DECLARE_WRITE8_MEMBER(io_20_w); |
| 187 | DECLARE_READ8_MEMBER(io_00_r); |
| 188 | |
| 189 | private: |
| 190 | required_device<vlm5030_device> m_vlm5030; |
| 191 | }; |
| 192 | |
| 193 | |
| 194 | |
| 169 | 195 | #endif |
trunk/src/emu/bus/msx_cart/cartridge.h
| r30815 | r30816 | |
| 26 | 26 | // Mainly used by the cartridge slot when loading images |
| 27 | 27 | void rom_alloc(UINT32 size); |
| 28 | 28 | void ram_alloc(UINT32 size); |
| 29 | void rom_vlm5030_alloc(UINT32 size); |
| 29 | 30 | void sram_alloc(UINT32 size); |
| 30 | 31 | |
| 31 | 32 | UINT8* get_rom_base() { return m_rom; } |
| 33 | UINT8* get_rom_vlm5030_base() { return m_rom_vlm5030; } |
| 32 | 34 | UINT8* get_ram_base() { return m_ram; } |
| 33 | 35 | UINT8* get_sram_base() { return m_sram; } |
| 34 | 36 | UINT32 get_rom_size() { return m_rom.count(); } |
| 37 | UINT32 get_rom_vlm5030_size() { return m_rom_vlm5030.count(); } |
| 35 | 38 | UINT32 get_ram_size() { return m_ram.count(); } |
| 36 | 39 | UINT32 get_sram_size() { return m_sram.count(); } |
| 37 | 40 | |
| 38 | 41 | protected: |
| 39 | 42 | dynamic_buffer m_rom; |
| 40 | 43 | dynamic_buffer m_ram; |
| 44 | dynamic_buffer m_rom_vlm5030; |
| 41 | 45 | dynamic_buffer m_sram; |
| 42 | 46 | devcb_write_line m_out_irq_cb; |
| 43 | 47 | }; |
trunk/hash/msx1_cart.xml
| r30815 | r30816 | |
| 7147 | 7147 | </part> |
| 7148 | 7148 | </software> |
| 7149 | 7149 | |
| 7150 | <software name="keybmstr"> |
| 7151 | <description>Keyboard Master (Prototype)</description> |
| 7152 | <year>1984</year> |
| 7153 | <publisher>Konami</publisher> |
| 7154 | <info name="serial" value="RC-719" /> |
| 7155 | <part name="cart" interface="msx_cart"> |
| 7156 | <feature name="slot" value="keyboard_master" /> |
| 7157 | <dataarea name="rom" size="16384"> |
| 7158 | <rom name="keyboard_master_prototype.rom" size="16384" crc="a076a5ab" sha1="2308dd0f15fb5395a1d8a08489daff65ead8e0f2" offset="0" /> |
| 7159 | </dataarea> |
| 7160 | <dataarea name="vlm5030" size="16384"> |
| 7161 | <rom name="keyboard_master_vlm5030.rom" size="16384" crc="3ae325dc" sha1="4f36d139ee4baa7d5980f765de9895570ee05f40" offset="0" /> |
| 7162 | </dataarea> |
| 7163 | </part> |
| 7164 | </software> |
| 7165 | |
| 7150 | 7166 | <software name="legkage"> |
| 7151 | 7167 | <description>Kage no Densetsu - The Legend of Kage (Jpn)</description> |
| 7152 | 7168 | <year>1986</year> |