Previous 199869 Revisions Next

r30964 Friday 13th June, 2014 at 21:13:45 UTC by Wilbert Pol
(MESS) msx.c: added sfg05 support (still without midi) (nw)
[src/emu/bus/msx_cart]cartridge.c yamaha.c yamaha.h
[src/emu/bus/msx_slot]cartridge.h
[src/mess/drivers]msx.c
[src/mess/includes]msx.h

trunk/src/emu/bus/msx_slot/cartridge.h
r30963r30964
1515   devcb = &msx_slot_cartridge_device::set_irq_handler(*device, DEVCB_##_devcb);
1616
1717
18#define MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, _devcb) \
18#define MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, _devcb, _default) \
1919   MCFG_DEVICE_ADD(_tag, MSX_SLOT_YAMAHA_EXPANSION, 0) \
20   MCFG_DEVICE_SLOT_INTERFACE(msx_yamaha_60pin, NULL, false) \
20   MCFG_DEVICE_SLOT_INTERFACE(msx_yamaha_60pin, _default, false) \
2121   devcb = &msx_slot_cartridge_device::set_irq_handler(*device, DEVCB_##_devcb);
2222
2323
trunk/src/emu/bus/msx_cart/yamaha.c
r30963r30964
1/**************************************************************************
2
3Yamaha SFG01/SFG05 emulation
4
5TODO:
6- Use a real YM2164 implementation for SFG05
7- Implement midi functionality (YM2148)
8
9**************************************************************************/
10
111#include "emu.h"
212#include "yamaha.h"
313
r30963r30964
313
414const device_type MSX_CART_SFG01 = &device_creator<msx_cart_sfg01>;
15const device_type MSX_CART_SFG05 = &device_creator<msx_cart_sfg05>;
516
617
7msx_cart_sfg01::msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8   : device_t(mconfig, MSX_CART_SFG01, "MSX Cartridge - SFG01", tag, owner, clock, "msx_cart_sfg01", __FILE__)
18msx_cart_sfg::msx_cart_sfg(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname)
19   : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__)
920   , msx_cart_interface(mconfig, *this)
10   , m_region_sfg01(*this, "sfg01")
21   , m_region_sfg(*this, "sfg")
1122   , m_ym2151(*this, "ym2151")
1223   , m_kbdc(*this, "kbdc")
1324   , m_ym2151_irq_state(CLEAR_LINE)
1425   , m_ym2148_irq_state(CLEAR_LINE)
26   , m_rom_mask(0)
27   , m_ym2148_irq_vector(0xff)
28   , m_ym2148_external_irq_vector(0xff)
1529{
1630}
1731
1832
19static MACHINE_CONFIG_FRAGMENT( msx_sfg01 )
33msx_cart_sfg01::msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
34   : msx_cart_sfg(mconfig, MSX_CART_SFG01, "MSX Cartridge - SFG01", tag, owner, clock, "msx_cart_sfg01")
35{
36}
37
38
39msx_cart_sfg05::msx_cart_sfg05(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
40   : msx_cart_sfg(mconfig, MSX_CART_SFG05, "MSX Cartridge - SFG05", tag, owner, clock, "msx_cart_sfg05")
41{
42}
43
44
45static MACHINE_CONFIG_FRAGMENT( msx_sfg )
2046   // YM2151 (OPM)
2147   // YM3012 (DAC)
2248   // YM2148 (MKS)
2349
2450   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
25   MCFG_YM2151_ADD("ym2151", XTAL_4MHz)
26   MCFG_YM2151_IRQ_HANDLER(WRITELINE(msx_cart_sfg01, ym2151_irq_w))
27//   MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(msx_cart_sfg01, port_w))
28   MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
29   MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
51   MCFG_YM2151_ADD("ym2151", XTAL_4MHz)  // The SFG01 uses a YM2151, the SFG05 uses a YM2164
52   MCFG_YM2151_IRQ_HANDLER(WRITELINE(msx_cart_sfg, ym2151_irq_w))
53//   MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(msx_cart_sfg, port_w))
54   MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
55   MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
3056
3157   MCFG_MSX_AUDIO_KBDC_PORT_ADD("kbdc", msx_audio_keyboards, NULL)
3258MACHINE_CONFIG_END
3359
3460
35machine_config_constructor msx_cart_sfg01::device_mconfig_additions() const
61machine_config_constructor msx_cart_sfg::device_mconfig_additions() const
3662{
37   return MACHINE_CONFIG_NAME( msx_sfg01 );
63   return MACHINE_CONFIG_NAME( msx_sfg );
3864}
3965
4066
4167ROM_START( msx_sfg01 )
42   ROM_REGION(0x4000, "sfg01", 0)
68   ROM_REGION(0x4000, "sfg", 0)
4369   ROM_LOAD("sfg01.rom", 0x0, 0x4000, CRC(0995fb36) SHA1(434651305f92aa770a89e40b81125fb22d91603d))
4470ROM_END
r30963r30964
5177}
5278
5379
54void msx_cart_sfg01::device_start()
80ROM_START( msx_sfg05 )
81   ROM_REGION(0x8000, "sfg", 0)
82   ROM_LOAD("sfg05.rom", 0x0, 0x8000, CRC(2425c279) SHA1(d956167e234f60ad916120437120f86fc8c3c321))
83ROM_END
84
85
86const rom_entry *msx_cart_sfg05::device_rom_region() const
5587{
88   return ROM_NAME( msx_sfg05 );
5689}
5790
5891
59void msx_cart_sfg01::initialize_cartridge()
92void msx_cart_sfg::device_start()
6093{
94   // Set rom mask
95   m_rom_mask = m_region_sfg->bytes() - 1;
96
97   // This should probably moved up in the bus/slot hierarchy for the msx driver
98   cpu_device *maincpu = machine().device<cpu_device>("maincpu");
99   device_execute_interface::static_set_irq_acknowledge_callback(*maincpu, device_irq_acknowledge_delegate(FUNC(msx_cart_sfg::irq_callback),this));
61100}
62101
63102
64WRITE_LINE_MEMBER(msx_cart_sfg01::ym2151_irq_w)
103IRQ_CALLBACK_MEMBER(msx_cart_sfg::irq_callback)
65104{
105   if (m_ym2148_irq_state == ASSERT_LINE)
106   {
107      return m_ym2148_irq_vector;
108   }
109
110   return m_ym2148_external_irq_vector;
111}
112
113
114WRITE_LINE_MEMBER(msx_cart_sfg::ym2151_irq_w)
115{
66116   m_ym2151_irq_state = state ? ASSERT_LINE : CLEAR_LINE;
67117   check_irq();
68118}
69119
70120
71WRITE_LINE_MEMBER(msx_cart_sfg01::ym2148_irq_w)
121WRITE_LINE_MEMBER(msx_cart_sfg::ym2148_irq_w)
72122{
73123   m_ym2148_irq_state = state ? ASSERT_LINE : CLEAR_LINE;
74124   check_irq();
75125}
76126
77127
78void msx_cart_sfg01::check_irq()
128void msx_cart_sfg::check_irq()
79129{
80130   if (m_ym2151_irq_state != CLEAR_LINE || m_ym2148_irq_state != CLEAR_LINE)
81131   {
r30963r30964
88138}
89139
90140
91READ8_MEMBER(msx_cart_sfg01::read_cart)
141READ8_MEMBER(msx_cart_sfg::read_cart)
92142{
93   switch (offset)
143   switch (offset & 0x3fff)
94144   {
95145      case 0x3ff0:     // YM-2151 status read
96146      case 0x3ff1:    // YM-2151 status read mirror?
r30963r30964
108158
109159   if (offset < 0x8000)
110160   {
111      return m_region_sfg01->u8(offset & 0x3fff);
161      return m_region_sfg->u8(offset & m_rom_mask);
112162   }
113163
114164   return 0xff;
115165}
116166
117167
118WRITE8_MEMBER(msx_cart_sfg01::write_cart)
168WRITE8_MEMBER(msx_cart_sfg::write_cart)
119169{
120   switch (offset)
170   switch (offset & 0x3fff)
121171   {
122172      case 0x3ff0:     // YM-2151 register
123173         m_ym2151->register_w(space, 0, data);
r30963r30964
132182         break;
133183
134184      case 0x3ff3:   // YM-2148 MIDI IRQ vector
185         m_ym2148_irq_vector = data;
186         break;
187
135188      case 0x3ff4:   // YM-2148 External IRQ vector
189         m_ym2148_external_irq_vector = data;
190         break;
191
136192      case 0x3ff5:   // YM-2148 MIDI UART data write register
137193      case 0x3ff6:   // YM-2148 MIDI UART command register
138194      default:
139         logerror("msx_cart_sfg01::write_cart: write %02x to %04x\n", data, offset);
195         logerror("msx_cart_sfg::write_cart: write %02x to %04x\n", data, offset);
140196         break;
141197   }
142198}
trunk/src/emu/bus/msx_cart/cartridge.c
r30963r30964
9090// not connected.
9191SLOT_INTERFACE_START(msx_yamaha_60pin)
9292   SLOT_INTERFACE("sfg01", MSX_CART_SFG01)
93   SLOT_INTERFACE("sfg05", MSX_CART_SFG05)
9394SLOT_INTERFACE_END
9495
trunk/src/emu/bus/msx_cart/yamaha.h
r30963r30964
77
88
99extern const device_type MSX_CART_SFG01;
10//extern const device_type MSX_CART_SFG05;
10extern const device_type MSX_CART_SFG05;
1111
1212
13class msx_cart_sfg01 : public device_t
14                  , public msx_cart_interface
13class msx_cart_sfg : public device_t
14               , public msx_cart_interface
1515{
1616public:
17   msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   msx_cart_sfg(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname);
1818
1919   // device-level overrides
2020   virtual machine_config_constructor device_mconfig_additions() const;
21   virtual const rom_entry *device_rom_region() const;
2221   virtual void device_start();
2322
24   virtual void initialize_cartridge();
25
2623   virtual DECLARE_READ8_MEMBER(read_cart);
2724   virtual DECLARE_WRITE8_MEMBER(write_cart);
2825
2926   DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w);
3027   DECLARE_WRITE_LINE_MEMBER(ym2148_irq_w);
3128
29   IRQ_CALLBACK_MEMBER(irq_callback);
30
3231private:
33   required_memory_region m_region_sfg01;
32   required_memory_region m_region_sfg;
3433   required_device<ym2151_device> m_ym2151;
3534   required_device<msx_audio_kbdc_port_device> m_kbdc;
3635   int m_ym2151_irq_state;
3736   int m_ym2148_irq_state;
37   UINT32 m_rom_mask;
38   UINT8 m_ym2148_irq_vector;
39   UINT8 m_ym2148_external_irq_vector;
3840
3941   void check_irq();
4042};
4143
44
45class msx_cart_sfg01 : public msx_cart_sfg
46{
47public:
48   msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
49
50   virtual const rom_entry *device_rom_region() const;
51};
52
53
54class msx_cart_sfg05 : public msx_cart_sfg
55{
56public:
57   msx_cart_sfg05(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
58
59   virtual const rom_entry *device_rom_region() const;
60};
61
4262#endif
4363
trunk/src/mess/drivers/msx.c
r30963r30964
2020** - svi738: v9938 not emulated
2121** - svi738: rs232c not emulated
2222** - hx10: Expansion slot not emulated (hx10s also??)
23** - cx5m, cx5m128, cx5m2: sfg not emulated
2423** - cx5m128: Firmware not emulated?
2524** - y503iir: Keyboard not responding correctly
2625** - y503iir, y503iir2: RTC not emulated
2726** - y503iir, y503iir2: Net not emulated
2827** - y503iir, y503iir2: Floppy support broken
29** - yis503m: sfg not emulated
3028** - cpc300: Config for MSX Tutor ON/OFF is not saved
3129** - expert20: Does not boot
3230** - fs4600: Kanji12 not emulated; how to trigger usage of kanji12??
r30963r30964
4341** - tpc310: Floppy support broken
4442**           7fbb <- c7  => seek 199???
4543** - hx23f: The builtin word processor displays white squares instead of text
46** - cx7m: sfg not emulated
4744** - expert3i: IDE not emulated
4845** - expert3t: Turbo not emulated
4946** - expertac: Does not boot
r30963r30964
27672764ROM_START (cx5m)
27682765   ROM_REGION (0x10000, "maincpu",0)
27692766   ROM_LOAD ("cx5mbios.rom", 0x0000, 0x8000, CRC(e2242b53) SHA1(706dd67036baeec7127e4ccd8c8db8f6ce7d0e4c))
2770   ROM_LOAD ("sfg05m.rom",         0x8000, 0x8000, CRC(6c2545c9) SHA1(bc4b242647116f4886bb92e86421f97b1be51938))
27712767ROM_END
27722768
27732769static MACHINE_CONFIG_DERIVED( cx5m, msx_pal )
r30963r30964
27802776   MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 2, 2)   /* 32KB RAM */
27812777   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
27822778   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0)
2783   MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 0)
2784//   MCFG_MSX_LAYOUT_ROM("sfg", 3, 0, 0, 2, "maincpu", 0x8000)  /* SFG */
2779   MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 0, "sfg01")
27852780
27862781   MCFG_FRAGMENT_ADD( msx1_cartlist )
27872782MACHINE_CONFIG_END
r30963r30964
27922787   ROM_REGION (0x18000, "maincpu",0)
27932788   ROM_LOAD ("cx5m128bios.rom", 0x0000, 0x8000, CRC(507b2caa) SHA1(0dde59e8d98fa524961cd37b0e100dbfb42cf576))
27942789   ROM_LOAD ("cx5m128ext.rom",  0x8000, 0x4000, CRC(feada82e) SHA1(48b0c2ff1f1e407cc44394219f7b3878efaa919f))
2795   ROM_LOAD ("sfg05.rom",      0xc000, 0x8000, CRC(2425c279) SHA1(d956167e234f60ad916120437120f86fc8c3c321))
27962790   ROM_LOAD ("yrm502.rom",     0x14000,0x4000, CRC(5330fe21) SHA1(7b1798561ee1844a7d6432924fbee9b4fc591c19))
27972791ROM_END
27982792
r30963r30964
28072801   MCFG_MSX_LAYOUT_ROM("ext", 3, 0, 1, 1, "maincpu", 0x8000)
28082802   MCFG_MSX_LAYOUT_ROM("yrm", 3, 1, 1, 1, "maincpu", 0x14000) /* YRM-502 */
28092803   MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x20000)   /* 128KB Mapper RAM */
2810   MCFG_MSX_LAYOUT_ROM("sfg", 3, 3, 0, 2, "maincpu", 0xc000) /* SFG-05 */
2804   MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 3, "sfg05")
28112805
28122806   MCFG_FRAGMENT_ADD( msx1_cartlist )
28132807MACHINE_CONFIG_END
r30963r30964
28182812   ROM_REGION (0x14000, "maincpu",0)
28192813   ROM_LOAD ("cx5m2bios.rom", 0x0000, 0x8000, CRC(507b2caa) SHA1(0dde59e8d98fa524961cd37b0e100dbfb42cf576))
28202814   ROM_LOAD ("cx5m2ext.rom",  0x8000, 0x4000, CRC(feada82e) SHA1(48b0c2ff1f1e407cc44394219f7b3878efaa919f))
2821   ROM_LOAD ("sfg05.rom",       0xc000, 0x8000, CRC(2425c279) SHA1(d956167e234f60ad916120437120f86fc8c3c321))
28222815ROM_END
28232816
28242817static MACHINE_CONFIG_DERIVED( cx5m2, msx_pal )
r30963r30964
28312824   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0)
28322825   MCFG_MSX_LAYOUT_ROM("ext", 3, 0, 1, 1, "maincpu", 0x8000)
28332826   MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000)   /* 64KB Mapper RAM */
2834   MCFG_MSX_LAYOUT_ROM("sfg", 3, 3, 0, 2, "maincpu", 0xc000)
2827   MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 3, "sfg05")
28352828
28362829   MCFG_FRAGMENT_ADD( msx1_cartlist )
28372830MACHINE_CONFIG_END
r30963r30964
29842977ROM_START (yis503m)
29852978   ROM_REGION (0x10000, "maincpu",0)
29862979   ROM_LOAD ("yis503mbios.rom", 0x0000, 0x8000, CRC(e2242b53) SHA1(706dd67036baeec7127e4ccd8c8db8f6ce7d0e4c))
2987   ROM_LOAD ("sfg05m.rom",        0x8000, 0x8000, CRC(6c2545c9) SHA1(bc4b242647116f4886bb92e86421f97b1be51938))
29882980ROM_END
29892981
29902982static MACHINE_CONFIG_DERIVED( yis503m, msx_pal )
r30963r30964
29952987   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
29962988   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
29972989   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0)
2998   MCFG_MSX_LAYOUT_ROM("sfg", 3, 0, 0, 2, "maincpu", 0x8000)
2990   MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 0, "sfg05")
29992991   MCFG_MSX_LAYOUT_RAM("ram", 3, 0, 2, 2)   /* 32KB RAM */
30002992
30012993   MCFG_FRAGMENT_ADD( msx1_cartlist )
r30963r30964
50945086   ROM_LOAD ("cx7mext.rom",   0x8000, 0x4000, CRC(66237ecf) SHA1(5c1f9c7fb655e43d38e5dd1fcc6b942b2ff68b02))
50955087   /* 0xc000 - 0x1ffff reserved for optional fmpac roms from msx2 parent set */
50965088   ROM_FILL (0xc000, 0x14000, 0)
5097   ROM_LOAD ("sfg05m.rom", 0x20000, 0x8000, CRC(6c2545c9) SHA1(bc4b242647116f4886bb92e86421f97b1be51938))
50985089ROM_END
50995090
51005091static MACHINE_CONFIG_DERIVED( cx7m, msx2_pal )
r30963r30964
51085099   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0)
51095100   MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000)   /* 64KB Mapper RAM */
51105101   MCFG_MSX_RAMIO_SET_BITS(0x80)
5111   MCFG_MSX_LAYOUT_ROM("sfg", 3, 3, 0, 2, "maincpu", 0x20000)
5102   MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 3, "sfg05")
51125103
51135104   MCFG_FRAGMENT_ADD( msx2_cartlist )
51145105MACHINE_CONFIG_END
r30963r30964
51215112   ROM_LOAD ("cx7mext.rom",   0x8000, 0x4000, CRC(66237ecf) SHA1(5c1f9c7fb655e43d38e5dd1fcc6b942b2ff68b02))
51225113   /* 0xc000 - 0x1ffff reserved for optional fmpac roms from msx2 parent set */
51235114   ROM_FILL (0xc000, 0x14000, 0)
5124   ROM_LOAD ("sfg05m.rom", 0x20000, 0x8000, CRC(6c2545c9) SHA1(bc4b242647116f4886bb92e86421f97b1be51938))
51255115   ROM_LOAD ("yrm502.rom", 0x28000, 0x4000, CRC(51f7ddd1) SHA1(2a4b4a4657e3077df8a88f98210b76883d3702b1))
51265116ROM_END
51275117
r30963r30964
51375127   MCFG_MSX_LAYOUT_ROM("yrm502", 3, 1, 1, 1, "maincpu", 0x28000)
51385128   MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000)   /* 64KB Mapper RAM */
51395129   MCFG_MSX_RAMIO_SET_BITS(0x80)
5140   MCFG_MSX_LAYOUT_ROM("sfg", 3, 3, 0, 2, "maincpu", 0x20000)
5130   MCFG_MSX_LAYOUT_YAMAHA_EXPANSION("expansion", 3, 3, "sfg05")
51415131
51425132   MCFG_FRAGMENT_ADD( msx2_cartlist )
51435133MACHINE_CONFIG_END
trunk/src/mess/includes/msx.h
r30963r30964
5656   MCFG_MSX_SLOT_CARTRIDGE_ADD(_tag, WRITELINE(msx_state, msx_irq_source1)) \
5757   msx_state::install_slot_pages(*owner, _prim, _sec, 0, 4, device);
5858
59#define MCFG_MSX_LAYOUT_YAMAHA_EXPANSION(_tag, _prim, _sec) \
60   MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, WRITELINE(msx_state, msx_irq_source2)) \
59#define MCFG_MSX_LAYOUT_YAMAHA_EXPANSION(_tag, _prim, _sec, _default) \
60   MCFG_MSX_SLOT_YAMAHA_EXPANSION_ADD(_tag, WRITELINE(msx_state, msx_irq_source2), _default) \
6161   msx_state::install_slot_pages(*owner, _prim, _sec, 0, 4, device);
6262
6363#define MCFG_MSX_LAYOUT_RAM_MM(_tag, _prim, _sec, _total_size) \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team