src/mess/video/vectrex.c
| r2387 | r2388 | |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | | static int lightpen_check (void) |
| 109 | |
| 110 | static int lightpen_check(running_machine *machine) |
| 110 | 111 | { |
| 111 | 112 | int dx, dy; |
| 112 | 113 | if (vectrex_lightpen_port != 0) |
| 113 | 114 | { |
| 114 | | lightpen_down = readinputportbytag("LPENCONF") & 0x10; |
| 115 | lightpen_down = input_port_read(machine, "LPENCONF") & 0x10; |
| 115 | 116 | |
| 116 | 117 | if (lightpen_down) |
| 117 | 118 | { |
| 118 | | pen_x = readinputportbytag("LPENX") * (x_max / 0xff); |
| 119 | | pen_y = readinputportbytag("LPENY") * (y_max / 0xff); |
| 119 | pen_x = input_port_read(machine, "LPENX") * (x_max / 0xff); |
| 120 | pen_y = input_port_read(machine, "LPENY") * (y_max / 0xff); |
| 120 | 121 | |
| 121 | 122 | dx = abs(pen_x - x_int); |
| 122 | 123 | dy = abs(pen_y - y_int); |
| r2387 | r2388 | |
| 196 | 197 | { |
| 197 | 198 | int i; |
| 198 | 199 | |
| 199 | | vectrex_configuration(); |
| 200 | vectrex_configuration(screen->machine); |
| 200 | 201 | |
| 201 | 202 | /* start black */ |
| 202 | 203 | vector_add_point(vectrex_points[display_start].x, |
| r2387 | r2388 | |
| 454 | 455 | |
| 455 | 456 | if (cb2 != data) |
| 456 | 457 | { |
| 457 | | if (data & lightpen_check()) |
| 458 | if (data & lightpen_check(machine)) |
| 458 | 459 | timer_set(attotime_zero, NULL, 0, lightpen_trigger); |
| 459 | 460 | |
| 460 | 461 | timer_set(attotime_zero, &blank, data, update_signal); |
src/mess/machine/vectrex.c
| r2387 | r2388 | |
| 123 | 123 | |
| 124 | 124 | *********************************************************************/ |
| 125 | 125 | |
| 126 | | void vectrex_configuration(void) |
| 126 | void vectrex_configuration(running_machine *machine) |
| 127 | 127 | { |
| 128 | | unsigned char cport = readinputportbytag("3DCONF"); |
| 128 | unsigned char cport = input_port_read(machine, "3DCONF"); |
| 129 | 129 | |
| 130 | 130 | /* Vectrex 'dipswitch' configuration */ |
| 131 | 131 | |
| r2387 | r2388 | |
| 202 | 202 | vectrex_beam_color = RGB_WHITE; |
| 203 | 203 | imager_colors[0]=imager_colors[1]=imager_colors[2]=imager_colors[3]=imager_colors[4]=imager_colors[5]=RGB_WHITE; |
| 204 | 204 | } |
| 205 | | vectrex_lightpen_port = readinputportbytag("LPENCONF") & 0x03; |
| 205 | vectrex_lightpen_port = input_port_read(machine, "LPENCONF") & 0x03; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /********************************************************************* |
| r2387 | r2388 | |
| 219 | 219 | READ8_HANDLER( v_via_pb_r ) |
| 220 | 220 | { |
| 221 | 221 | int pot; |
| 222 | | pot = readinputport(((vectrex_via_out[PORTB] & 0x6) >> 1)) - 0x80; |
| 222 | pot = input_port_read_indexed(machine, ((vectrex_via_out[PORTB] & 0x6) >> 1)) - 0x80; |
| 223 | 223 | |
| 224 | 224 | if (pot > (signed char)vectrex_via_out[PORTA]) |
| 225 | 225 | vectrex_via_out[PORTB] |= 0x20; |
| r2387 | r2388 | |
| 242 | 242 | |
| 243 | 243 | READ8_HANDLER( s1_via_pb_r ) |
| 244 | 244 | { |
| 245 | | return (vectrex_via_out[PORTB] & ~0x40) | (readinputportbytag("COIN") & 0x40); |
| 245 | return (vectrex_via_out[PORTB] & ~0x40) | (input_port_read(machine, "COIN") & 0x40); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |