Previous 199869 Revisions Next

r20859 Saturday 9th February, 2013 at 12:05:46 UTC by Wilbert Pol
vectrex.c: Reduce tagmap lookups and some minor cleanups. (nw)
[src/mame/includes]vectrex.h
[src/mame/machine]vectrex.c
[src/mame/video]vectrex.c

trunk/src/mame/machine/vectrex.c
r20858r20859
6666
6767DEVICE_IMAGE_LOAD_MEMBER(vectrex_state,vectrex_cart)
6868{
69   vectrex_state *state = image.device().machine().driver_data<vectrex_state>();
70   UINT8 *mem = state->memregion("maincpu")->base();
69   UINT8 *mem = memregion("maincpu")->base();
7170   if (image.software_entry() == NULL)
7271   {
7372      image.fread( mem, 0x8000);
7473      if (image.length() > 0x8000)
7574      {
7675         image.fread( mem+0x10000, 0x8000);
77         state->m_64k_cart = 1;
76         m_64k_cart = 1;
7877      }
7978   } else {
8079      int size = image.get_software_region_length("rom");
r20858r20859
8988   }
9089
9190   if (memcmp(mem + 0x06,"SRAM",4)) {
92      image.device().machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x0000, 0x7fff);
91      m_maincpu->space(AS_PROGRAM).unmap_write(0x0000, 0x7fff);
9392   }
9493
9594   /* If VIA T2 starts, reset refresh timer.
9695      This is the best strategy for most games. */
97   state->m_reset_refresh = 1;
96   m_reset_refresh = 1;
9897
99   state->m_imager_angles = narrow_escape_angles;
98   m_imager_angles = narrow_escape_angles;
10099
101100   /* let's do this 3D detection with a strcmp using data inside the cart images */
102101   /* slightly prettier than having to hardcode CRCs */
r20858r20859
104103   /* handle 3D Narrow Escape but skip the 2-d hack of it from Fred Taft */
105104   if (!memcmp(mem + 0x11,"NARROW",6) && (((char*)mem)[0x39] == 0x0c))
106105   {
107      state->m_imager_angles = narrow_escape_angles;
106      m_imager_angles = narrow_escape_angles;
108107   }
109108
110109   if (!memcmp(mem + 0x11,"CRAZY COASTER", 13))
111110   {
112      state->m_imager_angles = crazy_coaster_angles;
111      m_imager_angles = crazy_coaster_angles;
113112   }
114113
115114   if (!memcmp(mem + 0x11,"3D MINE STORM", 13))
116115   {
117      state->m_imager_angles = minestorm_3d_angles;
116      m_imager_angles = minestorm_3d_angles;
118117
119118      /* Don't reset T2 each time it's written.
120119         This would cause jerking in mine3. */
121      state->m_reset_refresh = 0;
120      m_reset_refresh = 0;
122121   }
123122
124123   return IMAGE_INIT_PASS;
r20858r20859
131130
132131*********************************************************************/
133132
134void vectrex_configuration(running_machine &machine)
133void vectrex_state::vectrex_configuration()
135134{
136   vectrex_state *state = machine.driver_data<vectrex_state>();
137   unsigned char cport = state->ioport("3DCONF")->read();
135   unsigned char cport = m_io_3dconf->read();
138136
139137   /* Vectrex 'dipswitch' configuration */
140138
141139   /* Imager control */
142140   if (cport & 0x01) /* Imager enabled */
143141   {
144      if (state->m_imager_status == 0)
145         state->m_imager_status = cport & 0x01;
142      if (m_imager_status == 0)
143         m_imager_status = cport & 0x01;
146144
147      state->vector_add_point_function = cport & 0x02 ? vectrex_add_point_stereo: vectrex_add_point;
145      vector_add_point_function = cport & 0x02 ? &vectrex_state::vectrex_add_point_stereo: &vectrex_state::vectrex_add_point;
148146
149147      switch ((cport >> 2) & 0x07)
150148      {
151149      case 0x00:
152         state->m_imager_colors[0] = state->m_imager_colors[1] = state->m_imager_colors[2] = RGB_BLACK;
150         m_imager_colors[0] = m_imager_colors[1] = m_imager_colors[2] = RGB_BLACK;
153151         break;
154152      case 0x01:
155         state->m_imager_colors[0] = state->m_imager_colors[1] = state->m_imager_colors[2] = VC_DARKRED;
153         m_imager_colors[0] = m_imager_colors[1] = m_imager_colors[2] = VC_DARKRED;
156154         break;
157155      case 0x02:
158         state->m_imager_colors[0] = state->m_imager_colors[1] = state->m_imager_colors[2] = VC_GREEN;
156         m_imager_colors[0] = m_imager_colors[1] = m_imager_colors[2] = VC_GREEN;
159157         break;
160158      case 0x03:
161         state->m_imager_colors[0] = state->m_imager_colors[1] = state->m_imager_colors[2] = VC_BLUE;
159         m_imager_colors[0] = m_imager_colors[1] = m_imager_colors[2] = VC_BLUE;
162160         break;
163161      case 0x04:
164162         /* mine3 has a different color sequence */
165         if (state->m_imager_angles == minestorm_3d_angles)
163         if (m_imager_angles == minestorm_3d_angles)
166164         {
167            state->m_imager_colors[0] = VC_GREEN;
168            state->m_imager_colors[1] = VC_RED;
165            m_imager_colors[0] = VC_GREEN;
166            m_imager_colors[1] = VC_RED;
169167         }
170168         else
171169         {
172            state->m_imager_colors[0] = VC_RED;
173            state->m_imager_colors[1] = VC_GREEN;
170            m_imager_colors[0] = VC_RED;
171            m_imager_colors[1] = VC_GREEN;
174172         }
175         state->m_imager_colors[2]=VC_BLUE;
173         m_imager_colors[2]=VC_BLUE;
176174         break;
177175      }
178176
179177      switch ((cport >> 5) & 0x07)
180178      {
181179      case 0x00:
182         state->m_imager_colors[3] = state->m_imager_colors[4] = state->m_imager_colors[5] = RGB_BLACK;
180         m_imager_colors[3] = m_imager_colors[4] = m_imager_colors[5] = RGB_BLACK;
183181         break;
184182      case 0x01:
185         state->m_imager_colors[3] = state->m_imager_colors[4] = state->m_imager_colors[5] = VC_DARKRED;
183         m_imager_colors[3] = m_imager_colors[4] = m_imager_colors[5] = VC_DARKRED;
186184         break;
187185      case 0x02:
188         state->m_imager_colors[3] = state->m_imager_colors[4] = state->m_imager_colors[5] = VC_GREEN;
186         m_imager_colors[3] = m_imager_colors[4] = m_imager_colors[5] = VC_GREEN;
189187         break;
190188      case 0x03:
191         state->m_imager_colors[3] = state->m_imager_colors[4] = state->m_imager_colors[5] = VC_BLUE;
189         m_imager_colors[3] = m_imager_colors[4] = m_imager_colors[5] = VC_BLUE;
192190         break;
193191      case 0x04:
194         if (state->m_imager_angles == minestorm_3d_angles)
192         if (m_imager_angles == minestorm_3d_angles)
195193         {
196            state->m_imager_colors[3] = VC_GREEN;
197            state->m_imager_colors[4] = VC_RED;
194            m_imager_colors[3] = VC_GREEN;
195            m_imager_colors[4] = VC_RED;
198196         }
199197         else
200198         {
201            state->m_imager_colors[3] = VC_RED;
202            state->m_imager_colors[4] = VC_GREEN;
199            m_imager_colors[3] = VC_RED;
200            m_imager_colors[4] = VC_GREEN;
203201         }
204         state->m_imager_colors[5]=VC_BLUE;
202         m_imager_colors[5]=VC_BLUE;
205203         break;
206204      }
207205   }
208206   else
209207   {
210      state->vector_add_point_function = vectrex_add_point;
211      state->m_beam_color = RGB_WHITE;
212      state->m_imager_colors[0] = state->m_imager_colors[1] = state->m_imager_colors[2] = state->m_imager_colors[3] = state->m_imager_colors[4] = state->m_imager_colors[5] = RGB_WHITE;
208      vector_add_point_function = &vectrex_state::vectrex_add_point;
209      m_beam_color = RGB_WHITE;
210      m_imager_colors[0] = m_imager_colors[1] = m_imager_colors[2] = m_imager_colors[3] = m_imager_colors[4] = m_imager_colors[5] = RGB_WHITE;
213211   }
214   state->m_lightpen_port = machine.root_device().ioport("LPENCONF")->read() & 0x03;
212   m_lightpen_port = m_io_lpenconf->read() & 0x03;
215213}
216214
217215
r20858r20859
221219
222220*********************************************************************/
223221
224void vectrex_via_irq(device_t *device, int level)
222WRITE_LINE_MEMBER(vectrex_state::vectrex_via_irq)
225223{
226   device->machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, level);
224   m_maincpu->set_input_line(M6809_IRQ_LINE, state);
227225}
228226
229227
230228READ8_MEMBER(vectrex_state::vectrex_via_pb_r)
231229{
232230   int pot;
233   static const char *const ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" };
231   ioport_port *io_port[4] = { m_io_contr1x, m_io_contr1y, m_io_contr2x, m_io_contr2y };
234232
235   pot = machine().root_device().ioport(ctrlnames[(m_via_out[PORTB] & 0x6) >> 1])->read() - 0x80;
233   pot = io_port[(m_via_out[PORTB] & 0x6) >> 1]->read() - 0x80;
236234
237235   if (pot > (signed char)m_via_out[PORTA])
238236      m_via_out[PORTB] |= 0x20;
r20858r20859
248246   if ((!(m_via_out[PORTB] & 0x10)) && (m_via_out[PORTB] & 0x08))
249247      /* BDIR inactive, we can read the PSG. BC1 has to be active. */
250248   {
251      device_t *ay = machine().device("ay8912");
252
253      m_via_out[PORTA] = ay8910_r(ay, space, 0)
249      m_via_out[PORTA] = ay8910_r(m_ay8912, space, 0)
254250         & ~(m_imager_pinlevel & 0x80);
255251   }
256252   return m_via_out[PORTA];
r20858r20859
259255
260256READ8_MEMBER(vectrex_state::vectrex_s1_via_pb_r)
261257{
262   return (m_via_out[PORTB] & ~0x40) | (ioport("COIN")->read() & 0x40);
258   return (m_via_out[PORTB] & ~0x40) | (m_io_coin->read() & 0x40);
263259}
264260
265261
r20858r20859
284280
285281TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_imager_eye)
286282{
287   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
288283   int coffset;
289284   double rtime = (1.0 / m_imager_freq);
290285
r20858r20859
301296         machine().scheduler().timer_set (attotime::from_double(rtime * 0.50), timer_expired_delegate(FUNC(vectrex_state::vectrex_imager_eye),this), 1);
302297
303298         /* Index hole sensor is connected to IO7 which triggers also CA1 of VIA */
304         via_0->write_ca1(1);
305         via_0->write_ca1(0);
299         m_via6522_0->write_ca1(1);
300         m_via6522_0->write_ca1(0);
306301         m_imager_pinlevel |= 0x80;
307302         machine().scheduler().timer_set (attotime::from_double(rtime / 360.0), timer_expired_delegate(FUNC(vectrex_state::update_level),this), 0, &m_imager_pinlevel);
308303      }
trunk/src/mame/includes/vectrex.h
r20858r20859
88#define VECTREX_H_
99
1010#include "machine/6522via.h"
11#include "sound/dac.h"
1112
13
1214#define NVECT 10000
1315
1416struct vectrex_point
r20858r20859
2224{
2325public:
2426   vectrex_state(const machine_config &mconfig, device_type type, const char *tag)
25      : driver_device(mconfig, type, tag) ,
26      m_gce_vectorram(*this, "gce_vectorram"){ }
27      : driver_device(mconfig, type, tag)
28      , m_gce_vectorram(*this, "gce_vectorram")
29      , m_maincpu(*this, "maincpu")
30      , m_via6522_0(*this, "via6522_0")
31      , m_dac(*this, "dac")
32      , m_ay8912(*this, "ay8912")
33      , m_io_contr1x(*this, "CONTR1X")
34      , m_io_contr1y(*this, "CONTR1Y")
35      , m_io_contr2x(*this, "CONTR2X")
36      , m_io_contr2y(*this, "CONTR2Y")
37      , m_io_buttons(*this, "BUTTONS")
38      , m_io_3dconf(*this, "3DCONF")
39      , m_io_lpenconf(*this, "LPENCONF")
40      , m_io_lpenx(*this, "LPENX")
41      , m_io_lpeny(*this, "LPENY")
42      , m_io_coin(*this, "COIN")
43   { }
2744
2845   required_shared_ptr<UINT8> m_gce_vectorram;
2946   int m_64k_cart;
r20858r20859
6178   UINT16 m_via_timer2;
6279   attotime m_vector_start_time;
6380   UINT8 m_cb2;
64   void (*vector_add_point_function) (running_machine &, int, int, rgb_t, int);
81   void (vectrex_state::*vector_add_point_function)(int, int, rgb_t, int);
6582   DECLARE_WRITE8_MEMBER(vectrex_psg_port_w);
6683   DECLARE_READ8_MEMBER(vectrex_via_r);
6784   DECLARE_WRITE8_MEMBER(vectrex_via_w);
r20858r20859
85102   DECLARE_WRITE8_MEMBER(v_via_ca2_w);
86103   DECLARE_WRITE8_MEMBER(v_via_cb2_w);
87104   DECLARE_DEVICE_IMAGE_LOAD_MEMBER( vectrex_cart );
88};
105   DECLARE_WRITE_LINE_MEMBER(vectrex_via_irq);
89106
107protected:
108   required_device<cpu_device> m_maincpu;
109   required_device<via6522_device> m_via6522_0;
110   required_device<dac_device> m_dac;
111   required_device<device_t> m_ay8912;
112   optional_ioport m_io_contr1x;
113   optional_ioport m_io_contr1y;
114   optional_ioport m_io_contr2x;
115   optional_ioport m_io_contr2y;
116   required_ioport m_io_buttons;
117   required_ioport m_io_3dconf;
118   required_ioport m_io_lpenconf;
119   required_ioport m_io_lpenx;
120   required_ioport m_io_lpeny;
121   optional_ioport m_io_coin;
90122
91/*----------- defined in machine/vectrex.c -----------*/
123   void vectrex_configuration();
124   void vectrex_multiplexer(int mux);
125   void vectrex_add_point(int x, int y, rgb_t color, int intensity);
126   void vectrex_add_point_stereo(int x, int y, rgb_t color, int intensity);
127};
92128
93void vectrex_configuration(running_machine &machine);
94void vectrex_via_irq (device_t *device, int level);
129/*---------- defined in video/vectrex.c -----------*/
95130
96/*----------- defined in video/vectrex.c -----------*/
97
98131extern const via6522_interface vectrex_via6522_interface;
99132extern const via6522_interface spectrum1_via6522_interface;
100133
101void vectrex_add_point_stereo (running_machine &machine, int x, int y, rgb_t color, int intensity);
102void vectrex_add_point (running_machine &machine, int x, int y, rgb_t color, int intensity);
103
104134#endif /* VECTREX_H_ */
trunk/src/mame/video/vectrex.c
r20858r20859
22#include "emu.h"
33#include "includes/vectrex.h"
44#include "video/vector.h"
5#include "machine/6522via.h"
65#include "cpu/m6809/m6809.h"
76#include "sound/ay8910.h"
8#include "sound/dac.h"
97
108
119#define ANALOG_DELAY 7800
r20858r20859
4745   DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,                     /* read ca1, cb1, ca2, cb2 */
4846   DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pa_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pb_w),         /* write PA/B */
4947   DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(vectrex_state,v_via_ca2_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_cb2_w), /* write ca1, cb1, ca2, cb2 */
50   DEVCB_LINE(vectrex_via_irq),                      /* IRQ */
48   DEVCB_DRIVER_LINE_MEMBER(vectrex_state,vectrex_via_irq),                      /* IRQ */
5149};
5250
5351
r20858r20859
6260{
6361   if (m_lightpen_port & 1)
6462   {
65      via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
66      via_0->write_ca1(1);
67      via_0->write_ca1(0);
63      m_via6522_0->write_ca1(1);
64      m_via6522_0->write_ca1(0);
6865   }
6966
7067   if (m_lightpen_port & 2)
7168   {
72      machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, PULSE_LINE);
69      m_maincpu->set_input_line(M6809_FIRQ_LINE, PULSE_LINE);
7370   }
7471}
7572
r20858r20859
9592
9693READ8_MEMBER(vectrex_state::vectrex_via_r)
9794{
98   via6522_device *via = machine().device<via6522_device>("via6522_0");
99   return via->read(space, offset);
95   return m_via6522_0->read(space, offset);
10096}
10197
10298WRITE8_MEMBER(vectrex_state::vectrex_via_w)
10399{
104   via6522_device *via = machine().device<via6522_device>("via6522_0");
105100   attotime period;
106101
107102   switch (offset)
r20858r20859
113108   case 9:
114109      m_via_timer2 = (m_via_timer2 & 0x00ff) | (data << 8);
115110
116      period = (attotime::from_hz(machine().device("maincpu")->unscaled_clock()) * m_via_timer2);
111      period = (attotime::from_hz(m_maincpu->unscaled_clock()) * m_via_timer2);
117112
118113      if (m_reset_refresh)
119114         m_refresh->adjust(period, 0, period);
r20858r20859
124119                           period);
125120      break;
126121   }
127   via->write(space, offset, data);
122   m_via6522_0->write(space, offset, data);
128123}
129124
130125
r20858r20859
147142{
148143   int i;
149144
150   vectrex_configuration(machine());
145   vectrex_configuration();
151146
152147   /* start black */
153148   vector_add_point(machine(),
r20858r20859
177172
178173*********************************************************************/
179174
180void vectrex_add_point(running_machine &machine, int x, int y, rgb_t color, int intensity)
175void vectrex_state::vectrex_add_point(int x, int y, rgb_t color, int intensity)
181176{
182   vectrex_state *state = machine.driver_data<vectrex_state>();
183177   vectrex_point *newpoint;
184178
185   state->m_point_index = (state->m_point_index+1) % NVECT;
186   newpoint = &state->m_points[state->m_point_index];
179   m_point_index = (m_point_index+1) % NVECT;
180   newpoint = &m_points[m_point_index];
187181
188182   newpoint->x = x;
189183   newpoint->y = y;
r20858r20859
192186}
193187
194188
195void vectrex_add_point_stereo(running_machine &machine, int x, int y, rgb_t color, int intensity)
189void vectrex_state::vectrex_add_point_stereo(int x, int y, rgb_t color, int intensity)
196190{
197   vectrex_state *state = machine.driver_data<vectrex_state>();
198   if (state->m_imager_status == 2) /* left = 1, right = 2 */
199      vectrex_add_point(machine, (int)(y * M_SQRT1_2)+ state->m_x_center,
200                     (int)(((state->m_x_max - x) * M_SQRT1_2)),
191   if (m_imager_status == 2) /* left = 1, right = 2 */
192      vectrex_add_point((int)(y * M_SQRT1_2)+ m_x_center,
193                     (int)(((m_x_max - x) * M_SQRT1_2)),
201194                     color,
202195                     intensity);
203196   else
204      vectrex_add_point(machine, (int)(y * M_SQRT1_2),
205                     (int)((state->m_x_max - x) * M_SQRT1_2),
197      vectrex_add_point((int)(y * M_SQRT1_2),
198                     (int)((m_x_max - x) * M_SQRT1_2),
206199                     color,
207200                     intensity);
208201}
r20858r20859
212205{
213206   m_x_int = m_x_center + (m_analog[A_ZR] * INT_PER_CLOCK);
214207   m_y_int = m_y_center + (m_analog[A_ZR] * INT_PER_CLOCK);
215   (*vector_add_point_function)(machine(), m_x_int, m_y_int, m_beam_color, 0);
208   (this->*vector_add_point_function)(m_x_int, m_y_int, m_beam_color, 0);
216209}
217210
218211
r20858r20859
232225
233226   if (!m_ramp)
234227   {
235      length = machine().device("maincpu")->unscaled_clock() * INT_PER_CLOCK
228      length = m_maincpu->unscaled_clock() * INT_PER_CLOCK
236229         * (machine().time() - m_vector_start_time).as_double();
237230
238231      m_x_int += length * (m_analog[A_X] + m_analog[A_ZR]);
239232      m_y_int += length * (m_analog[A_Y] + m_analog[A_ZR]);
240233
241      (*vector_add_point_function)(machine(), m_x_int, m_y_int, m_beam_color, 2 * m_analog[A_Z] * m_blank);
234      (this->*vector_add_point_function)(m_x_int, m_y_int, m_beam_color, 2 * m_analog[A_Z] * m_blank);
242235   }
243236   else
244237   {
245238      if (m_blank)
246         (*vector_add_point_function)(machine(), m_x_int, m_y_int, m_beam_color, 2 * m_analog[A_Z]);
239         (this->*vector_add_point_function)(m_x_int, m_y_int, m_beam_color, 2 * m_analog[A_Z]);
247240   }
248241
249242   m_vector_start_time = machine().time();
r20858r20859
271264
272265   m_imager_freq = 1;
273266
274   vector_add_point_function = vectrex_add_point;
267   vector_add_point_function = &vectrex_state::vectrex_add_point;
275268   m_imager_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vectrex_state::vectrex_imager_eye),this));
276269   m_imager_timer->adjust(
277270                     attotime::from_hz(m_imager_freq),
r20858r20859
292285
293286*********************************************************************/
294287
295static void vectrex_multiplexer(running_machine &machine, int mux)
288void vectrex_state::vectrex_multiplexer(int mux)
296289{
297   vectrex_state *state = machine.driver_data<vectrex_state>();
298   dac_device *dac = machine.device<dac_device>("dac");
290   machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),this), m_via_out[PORTA], &m_analog[mux]);
299291
300   machine.scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state), state->m_via_out[PORTA], &state->m_analog[mux]);
301
302292   if (mux == A_AUDIO)
303      dac->write_unsigned8(state->m_via_out[PORTA]);
293      m_dac->write_unsigned8(m_via_out[PORTA]);
304294}
305295
306296
r20858r20859
344334                  +(double)(m_pen_y - m_y_int) * (m_pen_y - m_y_int);
345335               d2 = b2 - ab * ab / a2;
346336               if (d2 < 2e10 && m_analog[A_Z] * m_blank > 0)
347                  m_lp_t->adjust(attotime::from_double(ab / a2 / (machine().device("maincpu")->unscaled_clock() * INT_PER_CLOCK)));
337                  m_lp_t->adjust(attotime::from_double(ab / a2 / (m_maincpu->unscaled_clock() * INT_PER_CLOCK)));
348338            }
349339         }
350340      }
r20858r20859
386376   }
387377
388378   if (!(data & 0x1) && (m_via_out[PORTB] & 0x1))
389      vectrex_multiplexer (machine(), (data >> 1) & 0x3);
379      vectrex_multiplexer((data >> 1) & 0x3);
390380
391381   m_via_out[PORTB] = data;
392382   machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),this), data & 0x80, &m_ramp);
r20858r20859
400390   machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),this), data, &m_analog[A_Y]);
401391
402392   if (!(m_via_out[PORTB] & 0x1))
403      vectrex_multiplexer (machine(), (m_via_out[PORTB] >> 1) & 0x3);
393      vectrex_multiplexer((m_via_out[PORTB] >> 1) & 0x3);
404394}
405395
406396
r20858r20859
450440{
451441   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_DRIVER_MEMBER(vectrex_state,vectrex_via_pa_r), DEVCB_DRIVER_MEMBER(vectrex_state,vectrex_s1_via_pb_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
452442   /*outputs: A/B,CA/B1,CA/B2 */ DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pa_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pb_w), DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(vectrex_state,v_via_ca2_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_cb2_w),
453   /*irq                      */ DEVCB_LINE(vectrex_via_irq),
443   /*irq                      */ DEVCB_DRIVER_LINE_MEMBER(vectrex_state,vectrex_via_irq),
454444};
455445
456446
r20858r20859
472462   m_x_max = visarea.max_x << 16;
473463   m_y_max = visarea.max_y << 16;
474464
475   vector_add_point_function = vectrex_add_point;
465   vector_add_point_function = &vectrex_state::vectrex_add_point;
476466   m_refresh = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vectrex_state::vectrex_refresh),this));
477467
478468   VIDEO_START_CALL_LEGACY(vector);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team