Previous 199869 Revisions Next

r21783 Sunday 10th March, 2013 at 13:29:09 UTC by Nathan Woods
Minor cleanups (nw)
[src/mess/includes]coco.h
[src/mess/machine]coco.c

trunk/src/mess/machine/coco.c
r21782r21783
7575//**************************************************************************
7676
7777//-------------------------------------------------
78//  ctor
79//-------------------------------------------------
80
81coco_state::coco_state(const machine_config &mconfig, device_type type, const char *tag)
82   : driver_device(mconfig, type, tag),
83   m_maincpu(*this, MAINCPU_TAG),
84   m_pia_0(*this, PIA0_TAG),
85   m_pia_1(*this, PIA1_TAG),
86   m_dac(*this, DAC_TAG),
87   m_wave(*this, WAVE_TAG),
88   m_cococart(*this, CARTRIDGE_TAG),
89   m_ram(*this, RAM_TAG),
90   m_cassette(*this, CASSETTE_TAG),
91   m_bitbanger(*this, BITBANGER_TAG),
92   m_vhd_0(*this, VHD0_TAG),
93   m_vhd_1(*this, VHD1_TAG)
94{
95}
96
97
98//-------------------------------------------------
7899//  analog_port_start
79100//-------------------------------------------------
80101
trunk/src/mess/includes/coco.h
r21782r21783
3434
3535SLOT_INTERFACE_EXTERN( coco_cart );
3636
37/* constants */
37// constants
3838#define JOYSTICK_DELTA          10
3939#define JOYSTICK_SENSITIVITY    100
4040
41/* devices */
41// devices
4242#define MAINCPU_TAG                 "maincpu"
4343#define PIA0_TAG                    "pia0"
4444#define PIA1_TAG                    "pia1"
r21782r21783
5151#define VHD0_TAG                    "vhd0"
5252#define VHD1_TAG                    "vhd1"
5353
54/* inputs */
54// inputs
5555#define CTRL_SEL_TAG                "ctrl_sel"
5656#define HIRES_INTF_TAG              "hires_intf"
5757#define CART_AUTOSTART_TAG          "cart_autostart"
r21782r21783
8282class coco_state : public driver_device
8383{
8484public:
85   coco_state(const machine_config &mconfig, device_type type, const char *tag)
86   : driver_device(mconfig, type, tag),
87      m_maincpu(*this, MAINCPU_TAG),
88      m_pia_0(*this, PIA0_TAG),
89      m_pia_1(*this, PIA1_TAG),
90      m_dac(*this, DAC_TAG),
91      m_wave(*this, WAVE_TAG),
92      m_cococart(*this, CARTRIDGE_TAG),
93      m_ram(*this, RAM_TAG),
94      m_cassette(*this, CASSETTE_TAG),
95      m_bitbanger(*this, BITBANGER_TAG),
96      m_vhd_0(*this, VHD0_TAG),
97      m_vhd_1(*this, VHD1_TAG)
98   {
99   }
85   coco_state(const machine_config &mconfig, device_type type, const char *tag);
10086
10187   required_device<cpu_device> m_maincpu;
10288   required_device<pia6821_device> m_pia_0;
r21782r21783
116102   static const bitbanger_config coco_bitbanger_config;
117103   static const cassette_interface coco_cassette_interface;
118104
119   /* driver update handlers */
105   // driver update handlers
120106   DECLARE_INPUT_CHANGED_MEMBER(keyboard_changed);
121107   DECLARE_INPUT_CHANGED_MEMBER(joystick_mode_changed);
122108   static void bitbanger_callback(running_machine &machine, UINT8 bit);
123109
124   /* IO */
110   // IO
125111   virtual DECLARE_READ8_MEMBER( ff00_read );
126112   virtual DECLARE_WRITE8_MEMBER( ff00_write );
127113   virtual DECLARE_READ8_MEMBER( ff20_read );
r21782r21783
131117   DECLARE_READ8_MEMBER( ff60_read );
132118   DECLARE_WRITE8_MEMBER( ff60_write );
133119
134   /* floating bus */
120   // floating bus
135121   DECLARE_READ8_MEMBER( floating_bus_read )   { return floating_bus_read(); }
136122
137123protected:
138   /* device-level overrides */
124   // device-level overrides
139125   virtual void device_start();
140126   virtual void device_reset();
141127   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
142128
143   /* interrupts */
129   // interrupts
144130   virtual bool firq_get_line(void);
145131   virtual bool irq_get_line(void);
146132   void recalculate_irq(void);
147133   void recalculate_firq(void);
148134
149   /* changed handlers */
135   // changed handlers
150136   virtual void pia1_pa_changed(void);
151137   virtual void pia1_pb_changed(void);
152138   virtual void bitbanger_changed(bool newvalue);
153139
154   /* miscellaneous */
140   // miscellaneous
155141   virtual void update_keyboard_input(UINT8 value, UINT8 z);
156142   virtual void cart_w(bool state);
157143   DECLARE_WRITE_LINE_MEMBER( cart_w ) { cart_w((bool) state); }
158144   virtual void update_cart_base(UINT8 *cart_base) = 0;
159145
160   /* PIA0 */
146   // PIA0
161147   DECLARE_WRITE8_MEMBER( pia0_pa_w );
162148   DECLARE_WRITE8_MEMBER( pia0_pb_w );
163149   DECLARE_WRITE_LINE_MEMBER( pia0_ca2_w );
r21782r21783
165151   DECLARE_WRITE_LINE_MEMBER( pia0_irq_a );
166152   DECLARE_WRITE_LINE_MEMBER( pia0_irq_b );
167153
168   /* PIA1 */
154   // PIA1
169155   DECLARE_READ8_MEMBER( pia1_pa_r );
170156   DECLARE_READ8_MEMBER( pia1_pb_r );
171157   DECLARE_WRITE8_MEMBER( pia1_pa_w );
r21782r21783
216202
217203   void analog_port_start(analog_input_t *analog, const char *rx_tag, const char *ry_tag, const char *lx_tag, const char *ly_tag, const char *buttons_tag);
218204
219   /* wrappers for configuration */
205   // wrappers for configuration
220206   joystick_type_t joystick_type(int index);
221207   hires_type_t hires_interface_type(void);
222208   bool is_joystick_hires(int joystick_index);
r21782r21783
233219   DECLARE_WRITE_LINE_MEMBER( bitbanger_callback );
234220   void diecom_lightgun_clock(void);
235221
236   /* thin wrappers for PIA output */
237   UINT8 dac_output(void)  { return m_dac_output; }    /* PA drives the DAC */
222   // thin wrappers for PIA output
223   UINT8 dac_output(void)  { return m_dac_output; }    // PA drives the DAC
238224   bool sel1(void)         { return m_pia_0->ca2_output() ? true : false; }
239225   bool sel2(void)         { return m_pia_0->cb2_output() ? true : false; }
240226   bool snden(void)        { return m_pia_1->cb2_output() ? true : false; }
241227
242   /* VHD selection */
228   // VHD selection
243229   coco_vhd_image_device *current_vhd(void);
244230
245   /* floating bus */
231   // floating bus
246232   UINT8 floating_bus_read(void);
247233
248   /* disassembly override */
234   // disassembly override
249235   static offs_t dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
250236
251   /* input ports */
237   // input ports
252238   ioport_port *m_keyboard[7];
253239   ioport_port *m_joystick_type_control;
254240   ioport_port *m_joystick_hires_control;
r21782r21783
256242   analog_input_t m_rat_mouse;
257243   analog_input_t m_diecom_lightgun;
258244
259   /* DAC output */
245   // DAC output
260246   UINT8 m_dac_output;
261247
262   /* hires interface */
248   // hires interface
263249   emu_timer *m_hiresjoy_transition_timer[2];
264250   bool m_hiresjoy_ca;
265251
266   /* diecom lightgun */
252   // diecom lightgun
267253   emu_timer *m_diecom_lightgun_timer;
268254   bool m_dclg_previous_bit;
269255   UINT8 m_dclg_output_h;
r21782r21783
271257   UINT8 m_dclg_state;
272258   UINT16 m_dclg_timer;
273259
274   /* VHD selection */
260   // VHD selection
275261   UINT8 m_vhd_select;
276262};
277263
278#endif /* __COCO__ */
264#endif // __COCO__

Previous 199869 Revisions Next


© 1997-2024 The MAME Team