Previous 199869 Revisions Next

r41594 Thursday 5th November, 2015 at 01:27:18 UTC by Robbbert
Merge branch 'master' of https://github.com/mamedev/mame
[src/mame/drivers]a2600.c

trunk/src/mame/drivers/a2600.c
r250105r250106
1010
1111***************************************************************************/
1212
13// the new RIOT does not work with the SuperCharger
14// for example "mame64 a2600 scharger -cass offifrog" fails to load after playing the tape
15#define USE_NEW_RIOT 0
16
17
1318#include "emu.h"
14#include "machine/mos6530n.h"
19
1520#include "cpu/m6502/m6507.h"
1621#include "sound/tiaintf.h"
1722#include "video/tia.h"
r250105r250106
2328#include "bus/vcs/compumat.h"
2429#include "bus/vcs_ctrl/ctrl.h"
2530
31
32
33#if USE_NEW_RIOT
34#include "machine/mos6530n.h"
35#else
36#include "machine/6532riot.h"
37#endif
38
39
2640#define CONTROL1_TAG    "joyport1"
2741#define CONTROL2_TAG    "joyport2"
2842
2943
44
3045class a2600_state : public driver_device
3146{
3247public:
r250105r250106
7388   required_device<m6507_device> m_maincpu;
7489   required_device<screen_device> m_screen;
7590   required_ioport m_swb;
91#if USE_NEW_RIOT
7692   required_device<mos6532_t> m_riot;
93#else
94   required_device<riot6532_device> m_riot;
95#endif
96   
7797};
7898
7999
r250105r250106
88108static ADDRESS_MAP_START(a2600_mem, AS_PROGRAM, 8, a2600_state ) // 6507 has 13-bit address space, 0x0000 - 0x1fff
89109   AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0f00) AM_DEVREADWRITE("tia_video", tia_video_device, read, write)
90110   AM_RANGE(0x0080, 0x00ff) AM_MIRROR(0x0d00) AM_RAM AM_SHARE("riot_ram")
111#if USE_NEW_RIOT
91112   AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d00) AM_DEVICE("riot", mos6532_t, io_map)
113#else
114   AM_RANGE(0x0280, 0x029f) AM_MIRROR(0x0d00) AM_DEVREADWRITE("riot", riot6532_device, read, write)
115#endif
92116   // AM_RANGE(0x1000, 0x1fff) is cart data and it is configured at reset time, depending on the mounted cart!
93117ADDRESS_MAP_END
94118
r250105r250106
116140   }
117141   else if (masked_offset < 0x2a0)
118142   {
143#if USE_NEW_RIOT
119144      ret = m_riot->io_r(space, masked_offset);
145#else
146      ret = m_riot->read(space, masked_offset);
147#endif
120148   }
121149   else if (masked_offset < 0x300)
122150   {
r250105r250106
148176   }
149177   else if (masked_offset < 0x2a0)
150178   {
179#if USE_NEW_RIOT
151180      m_riot->io_w(space, masked_offset, data);
181#else
182      m_riot->write(space, masked_offset, data);
183#endif
152184   }
153185   else if (masked_offset < 0x300)
154186   {
r250105r250106
563595   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
564596
565597   /* devices */
598#if USE_NEW_RIOT
566599   MCFG_DEVICE_ADD("riot", MOS6532n, MASTER_CLOCK_NTSC / 3)
567   MCFG_MOS6530n_IN_PA_CB(READ8(a2600_state, switch_A_r))
568   MCFG_MOS6530n_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
569   MCFG_MOS6530n_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
570   MCFG_MOS6530n_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
571   MCFG_MOS6530n_IRQ_CB(WRITELINE(a2600_state, irq_callback))
600    MCFG_MOS6530n_IN_PA_CB(READ8(a2600_state, switch_A_r))
601    MCFG_MOS6530n_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
602    MCFG_MOS6530n_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
603    MCFG_MOS6530n_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
604    MCFG_MOS6530n_IRQ_CB(WRITELINE(a2600_state, irq_callback))
605#else
606   MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK_NTSC / 3)   
607   MCFG_RIOT6532_IN_PA_CB(READ8(a2600_state, switch_A_r))
608   MCFG_RIOT6532_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
609   MCFG_RIOT6532_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
610   MCFG_RIOT6532_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
611   MCFG_RIOT6532_IRQ_CB(WRITELINE(a2600_state, irq_callback))
612#endif
572613
573614   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
574615   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL)
r250105r250106
604645   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
605646
606647   /* devices */
607   MCFG_DEVICE_ADD("riot", MOS6532n, MASTER_CLOCK_PAL / 3)
608   MCFG_MOS6530n_IN_PA_CB(READ8(a2600_state, switch_A_r))
609   MCFG_MOS6530n_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
610   MCFG_MOS6530n_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
611   MCFG_MOS6530n_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
612   MCFG_MOS6530n_IRQ_CB(WRITELINE(a2600_state, irq_callback))
648#if USE_NEW_RIOT
649    MCFG_DEVICE_ADD("riot", MOS6532n, MASTER_CLOCK_PAL / 3)
650    MCFG_MOS6530n_IN_PA_CB(READ8(a2600_state, switch_A_r))
651    MCFG_MOS6530n_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
652    MCFG_MOS6530n_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
653    MCFG_MOS6530n_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
654    MCFG_MOS6530n_IRQ_CB(WRITELINE(a2600_state, irq_callback))
655#else
656   MCFG_DEVICE_ADD("riot", RIOT6532, MASTER_CLOCK_PAL / 3)
657   MCFG_RIOT6532_IN_PA_CB(READ8(a2600_state, switch_A_r))
658   MCFG_RIOT6532_OUT_PA_CB(WRITE8(a2600_state, switch_A_w))
659   MCFG_RIOT6532_IN_PB_CB(READ8(a2600_state, riot_input_port_8_r))
660   MCFG_RIOT6532_OUT_PB_CB(WRITE8(a2600_state, switch_B_w))
661   MCFG_RIOT6532_IRQ_CB(WRITELINE(a2600_state, irq_callback))
662#endif
613663
614664   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy")
615665   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team