| Previous | 15994 Revisions | Next |
| r11518 Thursday 12th May, 2011 at 07:49:01 UTC by Miodrag Milanović |
|---|
| Sync with MAME (r12504) (no whatsnew) |
| [src/emu] | delegate.h devintrf.h inptport.c inptport.h memory.c |
| [src/emu/machine] | eeprom.c eeprom.h generic.c nvram.c |
| [src/mame/audio] | cchasm.c gorf.c gottlieb.c jedi.c wow.c |
| [src/mame/drivers] | 20pacgal.c 39in1.c 8080bw.c acefruit.c albazg.c alg.c arcadia.c artmagic.c asterix.c asteroid.c astinvad.c astrocde.c astrocdh.c astrocorp.c astrof.c ataxx.c backfire.c battlex.c brkthru.c btime.c btoads.c bwidow.c bwing.c bzone.c cave.c cbasebal.c ccastles.c cd32.c cdi.c champbas.c cheekyms.c cidelsa.c cinemat.c cloud9.c cntsteer.c cop01.c cosmic.c cps1.c cps2.c crbaloon.c crshrace.c dacholer.c darkhors.c dcheese.c ddayjlc.c ddenlovr.c ddragon.c deco156.c deco32.c deco_mlc.c dkong.c dlair.c dorachan.c enigma2.c eolith.c eolith16.c equites.c esd16.c esripsys.c exerion.c exidy.c exidy440.c exprraid.c f-32.c fantland.c fcombat.c fgoal.c firefox.c firetrk.c flstory.c fortecar.c fromanc2.c gaelco2.c gaelco3d.c galaga.c galastrm.c galaxi.c galaxian.c galaxold.c galdrvr.c galpani2.c gijoe.c gottlieb.c groundfx.c gstream.c gticlub.c guab.c gunbustr.c homerun.c hornet.c igs009.c igs011.c igspoker.c inufuku.c itech32.c itech8.c jack.c jackie.c jackpool.c jaguar.c jpmsys5.c kaneko16.c kickgoal.c konamigq.c konamigv.c konamigx.c kongambl.c kopunch.c ksys573.c ladybug.c lasso.c leland.c lethal.c lethalj.c limenko.c lordgun.c m10.c m14.c m92.c madalien.c mainsnk.c maxaflex.c meadows.c merit.c metro.c mhavoc.c midas.c midyunit.c midzeus.c missile.c mitchell.c model2.c model3.c moo.c ms32.c multfish.c multigam.c mw8080bw.c mystston.c mystwarr.c namcos22.c naomi.c naughtyb.c neogeo.c ng_aes.c niyanpai.c nova2001.c othunder.c overdriv.c pastelg.c peplus.c pirates.c playmark.c plygonet.c pntnpuzl.c polepos.c policetr.c powerbal.c progolf.c psikyo.c psikyo4.c psikyosh.c punchout.c pzletime.c qdrmfgp.c r2dtank.c r2dx_v33.c rabbit.c rbmk.c redclash.c renegade.c rgum.c rpunch.c rungun.c saturn.c scobra.c scramble.c segag80r.c segag80v.c segas32.c seibuspi.c seta2.c sg1000.c shootout.c sigmab98.c simpl156.c simpsons.c skyfox.c snes.c snk.c snk6502.c spoker.c spool99.c sprint4.c ssingles.c ssozumo.c ssv.c stactics.c starshp1.c statriv2.c stlforce.c superchs.c suprnova.c suprridr.c system1.c taito_b.c taito_f3.c taito_z.c taitojc.c taitosj.c tankbatt.c tecmosys.c tempest.c tetrisp2.c thayers.c tmaster.c tmmjprd.c tmnt.c toaplan2.c tryout.c ultratnk.c ultrsprt.c undrfire.c unico.c vamphalf.c vendetta.c vicdual.c welltris.c wolfpack.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c xorworld.c xxmissio.c zaccaria.c zaxxon.c zn.c zr107.c |
| [src/mame/includes] | btoads.h esd16.h othunder.h playmark.h taito_z.h |
| [src/mame/machine] | amiga.c amigakbd.c arkanoid.c balsente.c cdislave.c decoprot.c gaelco2.c galaxold.c jvs13551.c jvs13551.h leland.c mhavoc.c micro3d.c playch10.c scramble.c segasms.c starwars.c williams.c |
| [src/mame/video] | phoenix.c stactics.c |
| [src/mess/drivers] | amstrad.c aquarius.c at.c atom.c beta.c c80.c cosmicos.c crvision.c elf.c ex800.c exp85.c fidelz80.c geneve.c gizmondo.c hp49gp.c ip20.c junior.c kim1.c lc80.c mpf1.c nakajies.c ngp.c palm.c pc9801.c pecom.c pockstat.c poly880.c psion.c px4.c qx10.c rex6000.c ssem.c studio2.c ti89.c ti99_4x.c tmc1800.c vidbrain.c vip.c x07.c x1.c |
| [src/mess/machine] | abc77.c abc99.c cbmipt.c coco.c comx35.c z80ne.c |
| r11517 | r11518 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | CUSTOM_INPUT( gorf_speech_status_r ) |
| 179 | 179 | { |
| 180 | device_t *samples = field | |
| 180 | device_t *samples = field. | |
| 181 | 181 | return !sample_playing(samples, 0); |
| 182 | 182 | } |
| r11517 | r11518 | |
|---|---|---|
| 466 | 466 | |
| 467 | 467 | static CUSTOM_INPUT( speech_drq_custom_r ) |
| 468 | 468 | { |
| 469 | return sp0250_drq_r(field | |
| 469 | return sp0250_drq_r(field. | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 |
| r11517 | r11518 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | CUSTOM_INPUT( jedi_audio_comm_stat_r ) |
| 105 | 105 | { |
| 106 | jedi_state *state = field | |
| 106 | jedi_state *state = field. | |
| 107 | 107 | return *state->m_audio_comm_stat >> 6; |
| 108 | 108 | } |
| 109 | 109 |
| r11517 | r11518 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | INPUT_CHANGED( cchasm_set_coin_flag ) |
| 26 | 26 | { |
| 27 | cchasm_state *state = field | |
| 27 | cchasm_state *state = field. | |
| 28 | 28 | if (!newval && !state->m_coin_flag) |
| 29 | 29 | { |
| 30 | 30 | state->m_coin_flag = 1; |
| r11517 | r11518 | |
|---|---|---|
| 171 | 171 | |
| 172 | 172 | CUSTOM_INPUT( wow_speech_status_r ) |
| 173 | 173 | { |
| 174 | device_t *samples = field | |
| 174 | device_t *samples = field. | |
| 175 | 175 | return !sample_playing(samples, 0); |
| 176 | 176 | } |
| r11517 | r11518 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | CUSTOM_INPUT( tms5220_r ) |
| 215 | 215 | { |
| 216 | return tms5220_readyq_r(field | |
| 216 | return tms5220_readyq_r(field. | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | CUSTOM_INPUT( mhavoc_bit67_r ) |
| 220 | 220 | { |
| 221 | mhavoc_state *state = field | |
| 221 | mhavoc_state *state = field. | |
| 222 | 222 | const char *tag1 = (const char *)param; |
| 223 | 223 | const char *tag2 = tag1 + strlen(tag1) + 1; |
| 224 | return input_port_read(field | |
| 224 | return input_port_read(field. | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | CUSTOM_INPUT( gamma_rcvd_r ) |
| 228 | 228 | { |
| 229 | mhavoc_state *state = field | |
| 229 | mhavoc_state *state = field. | |
| 230 | 230 | /* Gamma rcvd flag */ |
| 231 | 231 | return state->m_gamma_rcvd; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | CUSTOM_INPUT( gamma_xmtd_r ) |
| 235 | 235 | { |
| 236 | mhavoc_state *state = field | |
| 236 | mhavoc_state *state = field. | |
| 237 | 237 | /* Gamma xmtd flag */ |
| 238 | 238 | return state->m_gamma_xmtd; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | CUSTOM_INPUT( alpha_rcvd_r ) |
| 242 | 242 | { |
| 243 | mhavoc_state *state = field | |
| 243 | mhavoc_state *state = field. | |
| 244 | 244 | /* Alpha rcvd flag */ |
| 245 | 245 | return (state->m_has_gamma_cpu && state->m_alpha_rcvd); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | CUSTOM_INPUT( alpha_xmtd_r ) |
| 249 | 249 | { |
| 250 | mhavoc_state *state = field | |
| 250 | mhavoc_state *state = field. | |
| 251 | 251 | /* Alpha xmtd flag */ |
| 252 | 252 | return (state->m_has_gamma_cpu && state->m_alpha_xmtd); |
| 253 | 253 | } |
| r11517 | r11518 | |
|---|---|---|
| 1110 | 1110 | |
| 1111 | 1111 | CUSTOM_INPUT( nstocker_bits_r ) |
| 1112 | 1112 | { |
| 1113 | balsente_state *state = field | |
| 1113 | balsente_state *state = field. | |
| 1114 | 1114 | return state->m_nstocker_bits; |
| 1115 | 1115 | } |
| 1116 | 1116 |
| r11517 | r11518 | |
|---|---|---|
| 413 | 413 | |
| 414 | 414 | CUSTOM_INPUT( amiga_joystick_convert ) |
| 415 | 415 | { |
| 416 | UINT8 bits = input_port_read(field | |
| 416 | UINT8 bits = input_port_read(field. | |
| 417 | 417 | int up = (bits >> 0) & 1; |
| 418 | 418 | int down = (bits >> 1) & 1; |
| 419 | 419 | int left = (bits >> 2) & 1; |
| r11517 | r11518 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | INPUT_CHANGED( cdislave_device::mouse_update ) |
| 121 | 121 | { |
| 122 | cdislave_device *slave = static_cast<cdislave_device *>(field | |
| 122 | cdislave_device *slave = static_cast<cdislave_device *>(field. | |
| 123 | 123 | slave->perform_mouse_update(); |
| 124 | 124 | } |
| 125 | 125 |
| r11517 | r11518 | |
|---|---|---|
| 62 | 62 | static INPUT_CHANGED( kbd_update ) |
| 63 | 63 | { |
| 64 | 64 | int index = (int)(FPTR)param, i; |
| 65 | UINT32 oldvalue = oldval * field | |
| 65 | UINT32 oldvalue = oldval * field. | |
| 66 | 66 | UINT32 delta = oldvalue ^ newvalue; |
| 67 | 67 | |
| 68 | 68 | /* Special case Page UP, which we will use as Action Replay button */ |
| 69 | 69 | if ( (index == 3) && ( delta & 0x80000000 ) && ( newvalue & 0x80000000 ) ) |
| 70 | 70 | { |
| 71 | const amiga_machine_interface *amiga_intf = amiga_get_interface(field | |
| 71 | const amiga_machine_interface *amiga_intf = amiga_get_interface(field. | |
| 72 | 72 | |
| 73 | 73 | if ( amiga_intf != NULL && amiga_intf->nmi_callback ) |
| 74 | 74 | { |
| 75 | (*amiga_intf->nmi_callback)(field | |
| 75 | (*amiga_intf->nmi_callback)(field. | |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | else |
| r11517 | r11518 | |
| 96 | 96 | /* if the buffer was empty and we have new data, start a timer to send the keystrokes */ |
| 97 | 97 | if ( key_buf_was_empty && ( kbd.buf_pos != kbd.cur_pos ) ) |
| 98 | 98 | { |
| 99 | kbd.timer->adjust(field | |
| 99 | kbd.timer->adjust(field. | |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | } |
| r11517 | r11518 | |
|---|---|---|
| 1311 | 1311 | |
| 1312 | 1312 | // case 0x582: return input_port_read(space->machine(), "IN0"); /* IN0 */ |
| 1313 | 1313 | // case 0x672: return input_port_read(space->machine(), "IN1"); /* IN1 */ |
| 1314 | // case 0x04c: return | |
| 1314 | // case 0x04c: return | |
| 1315 | 1315 | |
| 1316 | 1316 | case 0x468: |
| 1317 | 1317 | val=DECO_PORT(0x570); |
| r11517 | r11518 | |
| 1660 | 1660 | { |
| 1661 | 1661 | case 0x582: return (input_port_read(space->machine(), "IN0")<<16) | 0xffff; /* IN0 */ |
| 1662 | 1662 | case 0x672: return (input_port_read(space->machine(), "IN1")<<16) | 0xffff; /* IN1 */ |
| 1663 | case 0x04c: return ( | |
| 1663 | case 0x04c: return ( | |
| 1664 | 1664 | } |
| 1665 | 1665 | |
| 1666 | 1666 | /* Handle 'one shots' - writing data to an address, then immediately reading it back */ |
| r11517 | r11518 | |
|---|---|---|
| 545 | 545 | |
| 546 | 546 | CUSTOM_INPUT( botssa_hwchk_r ) |
| 547 | 547 | { |
| 548 | micro3d_state *state = field | |
| 548 | micro3d_state *state = field. | |
| 549 | 549 | |
| 550 | 550 | return state->m_botssa_latch; |
| 551 | 551 | } |
| r11517 | r11518 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | CUSTOM_INPUT( pc10_int_detect_r ) |
| 95 | 95 | { |
| 96 | playch10_state *state = field | |
| 96 | playch10_state *state = field. | |
| 97 | 97 | return ~state->m_pc10_int_detect & 1; |
| 98 | 98 | } |
| 99 | 99 |
| r11517 | r11518 | |
|---|---|---|
| 841 | 841 | { |
| 842 | 842 | if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", device->machine().describe_context(), |
| 843 | 843 | (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); |
| 844 | eeprom_write_bit (device, (data & 0x10) >> 4); | |
| 845 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 846 | eeprom_set_cs_line (device, (~data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 844 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 845 | eeprom->write_bit ((data & 0x10) >> 4); | |
| 846 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 847 | eeprom->set_cs_line ((~data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 847 | 848 | } |
| 848 | 849 | |
| 849 | 850 | |
| r11517 | r11518 | |
| 1140 | 1141 | WRITE8_HANDLER( leland_master_output_w ) |
| 1141 | 1142 | { |
| 1142 | 1143 | leland_state *state = space->machine().driver_data<leland_state>(); |
| 1143 | device | |
| 1144 | eeprom_device | |
| 1144 | 1145 | |
| 1145 | 1146 | switch (offset) |
| 1146 | 1147 | { |
| r11517 | r11518 | |
| 1150 | 1151 | cputag_set_input_line(space->machine(), "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); |
| 1151 | 1152 | cputag_set_input_line(space->machine(), "slave", 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); |
| 1152 | 1153 | |
| 1153 | eeprom = space->machine().device("eeprom"); | |
| 1154 | eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 1154 | 1155 | if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", cpu_get_pc(&space->device()), |
| 1155 | 1156 | (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); |
| 1156 | eeprom_write_bit (eeprom, (data & 0x10) >> 4); | |
| 1157 | eeprom_set_clock_line(eeprom, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 1158 | eeprom_set_cs_line (eeprom, (~data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 1157 | eeprom->write_bit ((data & 0x10) >> 4); | |
| 1158 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 1159 | eeprom->set_cs_line ((~data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 1159 | 1160 | break; |
| 1160 | 1161 | |
| 1161 | 1162 | case 0x0a: /* /OGIA */ |
| r11517 | r11518 | |
|---|---|---|
| 43 | 43 | 0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b, |
| 44 | 44 | 0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f, |
| 45 | 45 | 0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 }; |
| 46 | UINT8 val = input_port_read(field | |
| 46 | UINT8 val = input_port_read(field. | |
| 47 | 47 | |
| 48 | 48 | return remap[val >> 2]; |
| 49 | 49 | } |
| r11517 | r11518 | |
|---|---|---|
| 319 | 319 | |
| 320 | 320 | INPUT_CHANGED( lgun1_changed ) |
| 321 | 321 | { |
| 322 | sms_state *state = field | |
| 322 | sms_state *state = field. | |
| 323 | 323 | if (!state->m_lphaser_1_timer || |
| 324 | (input_port_read_safe(field | |
| 324 | (input_port_read_safe(field. | |
| 325 | 325 | return; |
| 326 | 326 | |
| 327 | 327 | if (newval != oldval) |
| 328 | lphaser1_sensor_check(field | |
| 328 | lphaser1_sensor_check(field. | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | INPUT_CHANGED( lgun2_changed ) |
| 332 | 332 | { |
| 333 | sms_state *state = field | |
| 333 | sms_state *state = field. | |
| 334 | 334 | if (!state->m_lphaser_2_timer || |
| 335 | (input_port_read_safe(field | |
| 335 | (input_port_read_safe(field. | |
| 336 | 336 | return; |
| 337 | 337 | |
| 338 | 338 | if (newval != oldval) |
| 339 | lphaser2_sensor_check(field | |
| 339 | lphaser2_sensor_check(field. | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 |
| r11517 | r11518 | |
|---|---|---|
| 223 | 223 | |
| 224 | 224 | CUSTOM_INPUT( wrally2_analog_bit_r ) |
| 225 | 225 | { |
| 226 | gaelco2_state *state = field | |
| 226 | gaelco2_state *state = field. | |
| 227 | 227 | int which = (FPTR)param; |
| 228 | 228 | return (state->m_analog_ports[which] >> 7) & 0x01; |
| 229 | 229 | } |
| r11517 | r11518 | |
| 271 | 271 | WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w ) |
| 272 | 272 | { |
| 273 | 273 | /* bit 0 is CS (active low) */ |
| 274 | eeprom_set_cs_line(device, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 274 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 275 | eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 275 | 276 | } |
| 276 | 277 | |
| 277 | 278 | WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w ) |
| 278 | 279 | { |
| 279 | 280 | /* bit 0 is SK (active high) */ |
| 280 | eeprom_set_clock_line(device, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 281 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 282 | eeprom->set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 281 | 283 | } |
| 282 | 284 | |
| 283 | 285 | WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w ) |
| 284 | 286 | { |
| 285 | 287 | /* bit 0 is EEPROM data (DIN) */ |
| 286 | eeprom_write_bit(device, data & 0x01); | |
| 288 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 289 | eeprom->write_bit(data & 0x01); | |
| 287 | 290 | } |
| 288 | 291 | |
| 289 | 292 | /*************************************************************************** |
| r11517 | r11518 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | CUSTOM_INPUT( arkanoid_68705_input_r ) |
| 108 | 108 | { |
| 109 | arkanoid_state *state = field | |
| 109 | arkanoid_state *state = field. | |
| 110 | 110 | int res = 0; |
| 111 | 111 | |
| 112 | 112 | /* bit 0x40 of comes from the sticky bit */ |
| r11517 | r11518 | |
| 122 | 122 | |
| 123 | 123 | CUSTOM_INPUT( arkanoid_input_mux ) |
| 124 | 124 | { |
| 125 | arkanoid_state *state = field | |
| 125 | arkanoid_state *state = field. | |
| 126 | 126 | const char *tag1 = (const char *)param; |
| 127 | 127 | const char *tag2 = tag1 + strlen(tag1) + 1; |
| 128 | return input_port_read(field | |
| 128 | return input_port_read(field. | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /* |
| r11517 | r11518 | |
|---|---|---|
| 257 | 257 | |
| 258 | 258 | CUSTOM_INPUT( _4in1_fake_port_r ) |
| 259 | 259 | { |
| 260 | galaxold_state *state = field | |
| 260 | galaxold_state *state = field. | |
| 261 | 261 | static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" }; |
| 262 | 262 | int bit_mask = (FPTR)param; |
| 263 | 263 | |
| 264 | return (input_port_read(field | |
| 264 | return (input_port_read(field. | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | #ifdef UNUSED_FUNCTION |
| r11517 | r11518 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | const device_type SEGA_837_13551 = &device_creator<sega_837_13551>; |
| 4 | 4 | |
| 5 | WRITE_LINE_ | |
| 5 | WRITE_LINE_MEMB | |
| 6 | 6 | { |
| 7 | 7 | if(state) |
| 8 | | |
| 8 | | |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | WRITE_LINE_ | |
| 11 | WRITE_LINE_MEMB | |
| 12 | 12 | { |
| 13 | 13 | if(state) |
| 14 | | |
| 14 | | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | static INPUT_PORTS_START(sega_837_13551_coins) |
| 18 | 18 | PORT_START("COINS") |
| 19 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_WRITE_LINE_DEVICE(DEVICE_SELF, jvs13551_coin_1_w) | |
| 20 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_WRITE_LINE_DEVICE(DEVICE_SELF, jvs13551_coin_2_w) | |
| 19 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, sega_837_13551, jvs13551_coin_1_w) | |
| 20 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, sega_837_13551, jvs13551_coin_2_w) | |
| 21 | 21 | INPUT_PORTS_END |
| 22 | 22 | |
| 23 | 23 | void sega_837_13551::static_set_port_tag(device_t &device, int port, const char *tag) |
| r11517 | r11518 | |
|---|---|---|
| 28 | 28 | static void static_set_port_tag(device_t &device, int port, const char *tag); |
| 29 | 29 | ioport_constructor device_input_ports() const; |
| 30 | 30 | |
| 31 | DECLARE_WRITE_LINE_MEMBER(jvs13551_coin_1_w); | |
| 32 | DECLARE_WRITE_LINE_MEMBER(jvs13551_coin_2_w); | |
| 31 | 33 | void inc_coin(int coin); |
| 32 | 34 | |
| 33 | 35 | protected: |
| r11517 | r11518 | |
|---|---|---|
| 577 | 577 | |
| 578 | 578 | CUSTOM_INPUT( williams_mux_r ) |
| 579 | 579 | { |
| 580 | williams_state *state = field | |
| 580 | williams_state *state = field. | |
| 581 | 581 | const char *tag = (const char *)param; |
| 582 | 582 | |
| 583 | 583 | if (state->m_port_select != 0) |
| 584 | 584 | tag += strlen(tag) + 1; |
| 585 | 585 | |
| 586 | return input_port_read(field | |
| 586 | return input_port_read(field. | |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | /* |
| r11517 | r11518 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | CUSTOM_INPUT( matrix_flag_r ) |
| 112 | 112 | { |
| 113 | starwars_state *state = field | |
| 113 | starwars_state *state = field. | |
| 114 | 114 | /* set the matrix processor flag */ |
| 115 | 115 | return state->m_math_run ? 1 : 0; |
| 116 | 116 | } |
| r11517 | r11518 | |
|---|---|---|
| 1 | 1 | #include "sound/okim6295.h" |
| 2 | #include "machine/eeprom.h" | |
| 2 | 3 | |
| 3 | 4 | class playmark_state : public driver_device |
| 4 | 5 | { |
| r11517 | r11518 | |
| 46 | 47 | |
| 47 | 48 | /* devices */ |
| 48 | 49 | okim6295_device *m_oki; |
| 49 | device | |
| 50 | eeprom_device | |
| 50 | 51 | }; |
| 51 | 52 | |
| 52 | 53 | /*----------- defined in video/playmark.c -----------*/ |
| r11517 | r11518 | |
|---|---|---|
| 1 | ||
| 1 | ||
| 2 | 2 | |
| 3 | 3 | ESD 16 Bit Games |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | #include "machine/eeprom.h" | |
| 8 | ||
| 7 | 9 | class esd16_state : public driver_device |
| 8 | 10 | { |
| 9 | 11 | public: |
| r11517 | r11518 | |
| 31 | 33 | |
| 32 | 34 | /* devices */ |
| 33 | 35 | device_t *m_audio_cpu; |
| 34 | device | |
| 36 | eeprom_device | |
| 35 | 37 | }; |
| 36 | 38 | |
| 37 | 39 |
| r11517 | r11518 | |
|---|---|---|
| 31 | 31 | // in drivers/btoads |
| 32 | 32 | DECLARE_WRITE16_MEMBER( main_sound_w ); |
| 33 | 33 | DECLARE_READ16_MEMBER( main_sound_r ); |
| 34 | static CUSTOM_INPUT( static_main_to_sound_r ); | |
| 35 | static CUSTOM_INPUT( static_sound_to_main_r ); | |
| 34 | DECLARE_CUSTOM_INPUT_MEMBER( main_to_sound_r ); | |
| 35 | DECLARE_CUSTOM_INPUT_MEMBER( sound_to_main_r ); | |
| 36 | 36 | DECLARE_WRITE8_MEMBER( sound_data_w ); |
| 37 | 37 | DECLARE_READ8_MEMBER( sound_data_r ); |
| 38 | 38 | DECLARE_READ8_MEMBER( sound_ready_to_send_r ); |
| r11517 | r11518 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | #include "machine/eeprom.h" | |
| 8 | ||
| 7 | 9 | struct othunder_tempsprite |
| 8 | 10 | { |
| 9 | 11 | int gfx; |
| r11517 | r11518 | |
| 37 | 39 | /* devices */ |
| 38 | 40 | device_t *m_maincpu; |
| 39 | 41 | device_t *m_audiocpu; |
| 40 | device | |
| 42 | eeprom_device | |
| 41 | 43 | device_t *m_tc0220ioc; |
| 42 | 44 | device_t *m_tc0100scn; |
| 43 | 45 | device_t *m_tc0110pcr; |
| r11517 | r11518 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | *************************************************************************/ |
| 7 | 7 | |
| 8 | #include "machine/eeprom.h" | |
| 9 | ||
| 8 | 10 | class taitoz_state : public driver_device |
| 9 | 11 | { |
| 10 | 12 | public: |
| r11517 | r11518 | |
| 35 | 37 | device_t *m_maincpu; |
| 36 | 38 | device_t *m_audiocpu; |
| 37 | 39 | device_t *m_subcpu; |
| 38 | device | |
| 40 | eeprom_device | |
| 39 | 41 | device_t *m_tc0480scp; |
| 40 | 42 | device_t *m_tc0150rod; |
| 41 | 43 | device_t *m_tc0100scn; |
| r11517 | r11518 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | CUSTOM_INPUT( stactics_get_frame_count_d3 ) |
| 116 | 116 | { |
| 117 | stactics_state *state = field | |
| 117 | stactics_state *state = field. | |
| 118 | 118 | |
| 119 | 119 | return (state->m_frame_count >> 3) & 0x01; |
| 120 | 120 | } |
| r11517 | r11518 | |
| 172 | 172 | |
| 173 | 173 | CUSTOM_INPUT( stactics_get_shot_standby ) |
| 174 | 174 | { |
| 175 | stactics_state *state = field | |
| 175 | stactics_state *state = field. | |
| 176 | 176 | |
| 177 | 177 | return state->m_shot_standby; |
| 178 | 178 | } |
| r11517 | r11518 | |
| 180 | 180 | |
| 181 | 181 | CUSTOM_INPUT( stactics_get_not_shot_arrive ) |
| 182 | 182 | { |
| 183 | stactics_state *state = field | |
| 183 | stactics_state *state = field. | |
| 184 | 184 | |
| 185 | 185 | return !state->m_shot_arrive; |
| 186 | 186 | } |
| r11517 | r11518 | |
|---|---|---|
| 310 | 310 | |
| 311 | 311 | CUSTOM_INPUT( player_input_r ) |
| 312 | 312 | { |
| 313 | phoenix_state *state = field | |
| 313 | phoenix_state *state = field. | |
| 314 | 314 | if (state->m_cocktail_mode) |
| 315 | return (input_port_read(field | |
| 315 | return (input_port_read(field. | |
| 316 | 316 | else |
| 317 | return (input_port_read(field | |
| 317 | return (input_port_read(field. | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | CUSTOM_INPUT( pleiads_protection_r ) |
| 321 | 321 | { |
| 322 | phoenix_state *state = field | |
| 322 | phoenix_state *state = field. | |
| 323 | 323 | /* handle Pleiads protection */ |
| 324 | 324 | switch (state->m_pleiads_protection_question) |
| 325 | 325 | { |
| r11517 | r11518 | |
| 332 | 332 | /* Bit 3 is 1 */ |
| 333 | 333 | return 1; |
| 334 | 334 | default: |
| 335 | logerror("%s:Unknown protection question %02X\n", field | |
| 335 | logerror("%s:Unknown protection question %02X\n", field. | |
| 336 | 336 | return 0; |
| 337 | 337 | } |
| 338 | 338 | } |
| r11517 | r11518 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | static READ8_HANDLER( pang_port5_r ) |
| 115 | 115 | { |
| 116 | int bit = | |
| 116 | int bit = | |
| 117 | 117 | |
| 118 | 118 | /* bits 0 and (sometimes) 3 are checked in the interrupt handler. |
| 119 | 119 | bit 3 is checked before updating the palette so it really seems to be vblank. |
| r11517 | r11518 | |
| 129 | 129 | |
| 130 | 130 | static WRITE8_DEVICE_HANDLER( eeprom_cs_w ) |
| 131 | 131 | { |
| 132 | eeprom_set_cs_line(device, data ? CLEAR_LINE : ASSERT_LINE); | |
| 132 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 133 | eeprom->set_cs_line(data ? CLEAR_LINE : ASSERT_LINE); | |
| 133 | 134 | } |
| 134 | 135 | |
| 135 | 136 | static WRITE8_DEVICE_HANDLER( eeprom_clock_w ) |
| 136 | 137 | { |
| 137 | eeprom_set_clock_line(device, data ? CLEAR_LINE : ASSERT_LINE); | |
| 138 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 139 | eeprom->set_clock_line(data ? CLEAR_LINE : ASSERT_LINE); | |
| 138 | 140 | } |
| 139 | 141 | |
| 140 | 142 | static WRITE8_DEVICE_HANDLER( eeprom_serial_w ) |
| 141 | 143 | { |
| 142 | eeprom_write_bit(device, data); | |
| 144 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 145 | eeprom->write_bit(data); | |
| 143 | 146 | } |
| 144 | 147 | |
| 145 | 148 |
| r11517 | r11518 | |
|---|---|---|
| 132 | 132 | if (ACCESSING_BITS_8_15) { |
| 133 | 133 | UINT8 ebyte=(data>>8)&0xff; |
| 134 | 134 | // if (ebyte&0x80) { |
| 135 | eeprom_set_clock_line(device, (ebyte & 0x2) ? ASSERT_LINE : CLEAR_LINE); | |
| 136 | eeprom_write_bit(device, ebyte & 0x1); | |
| 137 | eeprom_set_cs_line(device, (ebyte & 0x4) ? CLEAR_LINE : ASSERT_LINE); | |
| 135 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 136 | eeprom->set_clock_line((ebyte & 0x2) ? ASSERT_LINE : CLEAR_LINE); | |
| 137 | eeprom->write_bit(ebyte & 0x1); | |
| 138 | eeprom->set_cs_line((ebyte & 0x4) ? CLEAR_LINE : ASSERT_LINE); | |
| 138 | 139 | // } |
| 139 | 140 | } |
| 140 | 141 | else if (ACCESSING_BITS_0_7) { |
| r11517 | r11518 | |
| 308 | 309 | PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 309 | 310 | PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 310 | 311 | PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 311 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 312 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 312 | 313 | PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) |
| 313 | 314 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 314 | 315 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | static INPUT_CHANGED( coin_inserted ) |
| 86 | 86 | { |
| 87 | skyfox_state *state = field | |
| 87 | skyfox_state *state = field. | |
| 88 | 88 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| 89 | 89 | } |
| 90 | 90 |
| r11517 | r11518 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | static CUSTOM_INPUT( fgoal_80_r ) |
| 108 | 108 | { |
| 109 | UINT8 ret = (field | |
| 109 | UINT8 ret = (field. | |
| 110 | 110 | |
| 111 | 111 | return ret; |
| 112 | 112 | } |
| r11517 | r11518 | |
|---|---|---|
| 59 | 59 | static INPUT_CHANGED( coin_inserted ) |
| 60 | 60 | { |
| 61 | 61 | /* coin insertion causes an NMI */ |
| 62 | cputag_set_input_line(field | |
| 62 | cputag_set_input_line(field. | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 |
| r11517 | r11518 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | static CUSTOM_INPUT( mainsnk_sound_r ) |
| 138 | 138 | { |
| 139 | mainsnk_state *state = field | |
| 139 | mainsnk_state *state = field. | |
| 140 | 140 | |
| 141 | 141 | return (state->m_sound_cpu_busy) ? 0x01 : 0x00; |
| 142 | 142 | } |
| r11517 | r11518 | |
|---|---|---|
| 672 | 672 | |
| 673 | 673 | static INPUT_CHANGED( coin_inserted ) |
| 674 | 674 | { |
| 675 | cntsteer_state *state = field | |
| 675 | cntsteer_state *state = field. | |
| 676 | 676 | device_set_input_line(state->m_subcpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| 677 | 677 | } |
| 678 | 678 |
| r11517 | r11518 | |
|---|---|---|
| 440 | 440 | UINT8 r = 0; |
| 441 | 441 | static const char *const portnames[] = { "IN0", "IN1", "IN2" }; |
| 442 | 442 | device_t *adc12138 = space->machine().device("adc12138"); |
| 443 | device | |
| 443 | eeprom_device | |
| 444 | 444 | |
| 445 | 445 | switch (offset) |
| 446 | 446 | { |
| r11517 | r11518 | |
| 460 | 460 | 0x02 = ADDOR (ADC DOR) |
| 461 | 461 | 0x01 = ADDO (ADC DO) |
| 462 | 462 | */ |
| 463 | r = 0xf0 | (eeprom | |
| 463 | r = 0xf0 | (eeprom->read_bit( | |
| 464 | 464 | r |= adc1213x_do_r(adc12138, 0) | (adc1213x_eoc_r(adc12138, 0) << 2); |
| 465 | 465 | break; |
| 466 | 466 | |
| r11517 | r11518 | |
| 783 | 783 | PORT_DIPSETTING( 0x00, "15KHz" ) |
| 784 | 784 | |
| 785 | 785 | PORT_START( "EEPROMOUT" ) |
| 786 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 787 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 788 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 786 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 787 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 788 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 789 | 789 | INPUT_PORTS_END |
| 790 | 790 | |
| 791 | 791 | static INPUT_PORTS_START( sscope ) |
| r11517 | r11518 | |
| 835 | 835 | PORT_DIPSETTING( 0x00, "15KHz" ) |
| 836 | 836 | |
| 837 | 837 | PORT_START( "EEPROMOUT" ) |
| 838 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 839 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 840 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 838 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 839 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 840 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 841 | 841 | INPUT_PORTS_END |
| 842 | 842 | |
| 843 | 843 | static const sharc_config sharc_cfg = |
| r11517 | r11518 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | static CUSTOM_INPUT( get_vblank ) |
| 175 | 175 | { |
| 176 | ccastles_state *state = field->machine().driver_data<ccastles_state>(); | |
| 177 | int scanline = field->machine().primary_screen->vpos(); | |
| 176 | ccastles_state *state = field.machine().driver_data<ccastles_state>(); | |
| 177 | int scanline = field.machine().primary_screen->vpos(); | |
| 178 | 178 | return state->m_syncprom[scanline & 0xff] & 1; |
| 179 | 179 | } |
| 180 | 180 |
| r11517 | r11518 | |
|---|---|---|
| 137 | 137 | /* handle EEPROM I/O */ |
| 138 | 138 | if (ACCESSING_BITS_16_23) |
| 139 | 139 | { |
| 140 | device_t *device = space->machine().device("eeprom"); | |
| 141 | eeprom_write_bit(device, data & 0x00800000); | |
| 142 | eeprom_set_cs_line(device, (data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE); | |
| 143 | eeprom_set_clock_line(device, (data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE); | |
| 140 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 141 | eeprom->write_bit(data & 0x00800000); | |
| 142 | eeprom->set_cs_line((data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE); | |
| 143 | eeprom->set_clock_line((data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /* toggling BSMT off then on causes a reset */ |
| r11517 | r11518 | |
| 183 | 183 | |
| 184 | 184 | static CUSTOM_INPUT( bsmt_status_r ) |
| 185 | 185 | { |
| 186 | return field | |
| 186 | return field. | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
| r11517 | r11518 | |
| 332 | 332 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 333 | 333 | PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 334 | 334 | PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 335 | PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* EEPROM read */ | |
| 335 | PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* EEPROM read */ | |
| 336 | 336 | PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 337 | 337 | PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 338 | 338 |
| r11517 | r11518 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | static READ16_DEVICE_HANDLER( gundamex_eeprom_r ) |
| 175 | 175 | { |
| 176 | return ((eeprom_read_bit(device) & 1)) << 3; | |
| 176 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 177 | return ((eeprom->read_bit() & 1)) << 3; | |
| 177 | 178 | } |
| 178 | 179 | |
| 179 | 180 | static WRITE16_DEVICE_HANDLER( gundamex_eeprom_w ) |
| 180 | 181 | { |
| 181 | eeprom_set_clock_line(device, (data & 0x2) ? ASSERT_LINE : CLEAR_LINE); | |
| 182 | eeprom_write_bit(device, data & 0x1); | |
| 183 | eeprom_set_cs_line(device, (data & 0x4) ? CLEAR_LINE : ASSERT_LINE); | |
| 182 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 183 | eeprom->set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE); | |
| 184 | eeprom->write_bit(data & 0x1); | |
| 185 | eeprom->set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE); | |
| 184 | 186 | } |
| 185 | 187 | |
| 186 | 188 | static ADDRESS_MAP_START( gundamex_map, AS_PROGRAM, 16 ) |
| r11517 | r11518 | |
|---|---|---|
| 2066 | 2066 | |
| 2067 | 2067 | static CUSTOM_INPUT( jdredd_gun_mux_read ) |
| 2068 | 2068 | { |
| 2069 | zn_state *state = field | |
| 2069 | zn_state *state = field. | |
| 2070 | 2070 | |
| 2071 | 2071 | return state->m_jdredd_gun_mux; |
| 2072 | 2072 | } |
| r11517 | r11518 | |
|---|---|---|
| 398 | 398 | switch (offset) { |
| 399 | 399 | case 0: return 0xffff0000 | input_port_read(space->machine(), "IN0"); |
| 400 | 400 | case 1: return 0xffff0000 | input_port_read(space->machine(), "IN1"); //check top bits?? |
| 401 | case 2: return 0xfffffffe | | |
| 401 | case 2: return 0xfffffffe | | |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | return 0xffffffff; |
| r11517 | r11518 | |
| 407 | 407 | static WRITE32_HANDLER( fghthist_eeprom_w ) |
| 408 | 408 | { |
| 409 | 409 | if (ACCESSING_BITS_0_7) { |
| 410 | eeprom_device *device = space->machine().device<eeprom_device>("eeprom"); | |
| 411 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 412 | eeprom_write_bit(device, data & 0x10); | |
| 413 | eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 410 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 411 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 412 | eeprom->write_bit(data & 0x10); | |
| 413 | eeprom->set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 414 | 414 | |
| 415 | 415 | deco32_pri_w(space,0,data&0x1,0xffffffff); /* Bit 0 - layer priority toggle */ |
| 416 | 416 | } |
| r11517 | r11518 | |
| 480 | 480 | |
| 481 | 481 | static READ32_DEVICE_HANDLER( dragngun_eeprom_r ) |
| 482 | 482 | { |
| 483 | return 0xfffffffe | eeprom_read_bit(device); | |
| 483 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 484 | return 0xfffffffe | eeprom->read_bit(); | |
| 484 | 485 | } |
| 485 | 486 | |
| 486 | 487 | static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w ) |
| 487 | 488 | { |
| 488 | 489 | if (ACCESSING_BITS_0_7) { |
| 489 | eeprom_set_clock_line(device, (data & 0x2) ? ASSERT_LINE : CLEAR_LINE); | |
| 490 | eeprom_write_bit(device, data & 0x1); | |
| 491 | eeprom_set_cs_line(device, (data & 0x4) ? CLEAR_LINE : ASSERT_LINE); | |
| 490 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 491 | eeprom->set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE); | |
| 492 | eeprom->write_bit(data & 0x1); | |
| 493 | eeprom->set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE); | |
| 492 | 494 | return; |
| 493 | 495 | } |
| 494 | 496 | logerror("%s:Write control 1 %08x %08x\n",device->machine().describe_context(),offset,data); |
| r11517 | r11518 | |
| 662 | 664 | switch (offset<<1) { |
| 663 | 665 | case 0x280: return input_port_read(space->machine(), "IN0") << 16| 0xffff; /* IN0 */ |
| 664 | 666 | case 0x4c4: return input_port_read(space->machine(), "IN1") << 16| 0xffff; /* IN1 */ |
| 665 | case 0x35a: return ( | |
| 667 | case 0x35a: return ( | |
| 666 | 668 | } |
| 667 | 669 | |
| 668 | 670 | //logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(&space->device()),offset<<1,mem_mask); |
| r11517 | r11518 | |
| 674 | 676 | { |
| 675 | 677 | if (ACCESSING_BITS_0_7) |
| 676 | 678 | { |
| 677 | eeprom_device *device = space->machine().device<eeprom_device>("eeprom"); | |
| 678 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 679 | eeprom_write_bit(device, data & 0x10); | |
| 680 | eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 679 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 680 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 681 | eeprom->write_bit(data & 0x10); | |
| 682 | eeprom->set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 681 | 683 | |
| 682 | 684 | deco32_pri_w(space,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */ |
| 683 | 685 | } |
| r11517 | r11518 | |
|---|---|---|
| 432 | 432 | static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 }; |
| 433 | 433 | const char *namex = (const char *)param; |
| 434 | 434 | const char *namey = namex + strlen(namex) + 1; |
| 435 | return (translate49[input_port_read(field | |
| 435 | return (translate49[input_port_read(field. | |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | |
| r11517 | r11518 | |
| 445 | 445 | |
| 446 | 446 | static CUSTOM_INPUT( keypad_r ) |
| 447 | 447 | { |
| 448 | UINT32 bits = input_port_read(field | |
| 448 | UINT32 bits = input_port_read(field. | |
| 449 | 449 | UINT8 select = keypad_select; |
| 450 | 450 | while ((select & 1) != 0) |
| 451 | 451 | { |
| r11517 | r11518 | |
|---|---|---|
| 293 | 293 | { |
| 294 | 294 | /* pressing the service switch sends an NMI */ |
| 295 | 295 | if (newval) |
| 296 | cputag_set_input_line(field | |
| 296 | cputag_set_input_line(field. | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
| r11517 | r11518 | |
| 355 | 355 | |
| 356 | 356 | static CUSTOM_INPUT( razmataz_dial_r ) |
| 357 | 357 | { |
| 358 | zaxxon_state *state = field | |
| 358 | zaxxon_state *state = field. | |
| 359 | 359 | static const char *const dialname[2] = { "DIAL0", "DIAL1" }; |
| 360 | 360 | int num = (FPTR)param; |
| 361 | 361 | int delta, res; |
| 362 | 362 | |
| 363 | delta = input_port_read(field | |
| 363 | delta = input_port_read(field. | |
| 364 | 364 | |
| 365 | 365 | if (delta < 0x80) |
| 366 | 366 | { |
| r11517 | r11518 | |
| 408 | 408 | { |
| 409 | 409 | if (newval) |
| 410 | 410 | { |
| 411 | zaxxon_state *state = field | |
| 411 | zaxxon_state *state = field. | |
| 412 | 412 | |
| 413 | 413 | state->m_coin_status[(int)(FPTR)param] = state->m_coin_enable[(int)(FPTR)param]; |
| 414 | 414 | } |
| r11517 | r11518 | |
| 417 | 417 | |
| 418 | 418 | static CUSTOM_INPUT( zaxxon_coin_r ) |
| 419 | 419 | { |
| 420 | zaxxon_state *state = field | |
| 420 | zaxxon_state *state = field. | |
| 421 | 421 | |
| 422 | 422 | return state->m_coin_status[(int)(FPTR)param]; |
| 423 | 423 | } |
| r11517 | r11518 | |
|---|---|---|
| 122 | 122 | static CUSTOM_INPUT( punchout_vlm5030_busy_r ) |
| 123 | 123 | { |
| 124 | 124 | /* bit 4 of DSW1 is busy pin level */ |
| 125 | return (vlm5030_bsy(field | |
| 125 | return (vlm5030_bsy(field. | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | static WRITE8_DEVICE_HANDLER( punchout_speech_reset_w ) |
| r11517 | r11518 | |
|---|---|---|
| 256 | 256 | static INPUT_CHANGED( coin_inserted ) |
| 257 | 257 | { |
| 258 | 258 | if (!newval) |
| 259 | cputag_set_input_line(field | |
| 259 | cputag_set_input_line(field. | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | int atari_input_disabled(running_machine &machine) |
| r11517 | r11518 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | static INPUT_CHANGED( left_coin_inserted ) |
| 72 | 72 | { |
| 73 | kopunch_state *state = field | |
| 73 | kopunch_state *state = field. | |
| 74 | 74 | |
| 75 | 75 | /* left coin insertion causes a rst6.5 (vector 0x34) */ |
| 76 | 76 | if (newval) |
| r11517 | r11518 | |
| 79 | 79 | |
| 80 | 80 | static INPUT_CHANGED( right_coin_inserted ) |
| 81 | 81 | { |
| 82 | kopunch_state *state = field | |
| 82 | kopunch_state *state = field. | |
| 83 | 83 | |
| 84 | 84 | /* right coin insertion causes a rst5.5 (vector 0x2c) */ |
| 85 | 85 | if (newval) |
| r11517 | r11518 | |
|---|---|---|
| 51 | 51 | static WRITE16_DEVICE_HANDLER( eeprom_chip_select_w ) |
| 52 | 52 | { |
| 53 | 53 | /* bit 0 is CS (active low) */ |
| 54 | eeprom_set_cs_line(device, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 54 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 55 | eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | static WRITE16_DEVICE_HANDLER( eeprom_serial_clock_w ) |
| 58 | 59 | { |
| 59 | 60 | /* bit 0 is SK (active high) */ |
| 60 | eeprom_set_clock_line(device, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 61 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 62 | eeprom->set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 61 | 63 | } |
| 62 | 64 | |
| 63 | 65 | static WRITE16_DEVICE_HANDLER( eeprom_data_w ) |
| 64 | 66 | { |
| 65 | 67 | /* bit 0 is EEPROM data (DIN) */ |
| 66 | eeprom_write_bit(device, data & 0x01); | |
| 68 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 69 | eeprom->write_bit(data & 0x01); | |
| 67 | 70 | } |
| 68 | 71 | |
| 69 | 72 | |
| r11517 | r11518 | |
| 99 | 102 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) |
| 100 | 103 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 101 | 104 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 102 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* used for accessing the NVRAM */ | |
| 105 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* used for accessing the NVRAM */ | |
| 103 | 106 | PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) |
| 104 | 107 | PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) |
| 105 | 108 | PORT_DIPSETTING( 0x60, DEF_STR( Normal ) ) |
| r11517 | r11518 | |
|---|---|---|
| 315 | 315 | { "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" } |
| 316 | 316 | }; |
| 317 | 317 | |
| 318 | return input_port_read_safe(field | |
| 318 | return input_port_read_safe(field. | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| r11517 | r11518 | |
| 334 | 334 | { |
| 335 | 335 | default: |
| 336 | 336 | case 0x00: ret = 0x0000; break; /* nothing? */ |
| 337 | case 0x09: ret = input_port_read(field->machine(), "MAHJONG1"); break; | |
| 338 | case 0x12: ret = input_port_read(field->machine(), "MAHJONG2"); break; | |
| 339 | case 0x1b: ret = input_port_read(field->machine(), "MAHJONG3"); break; /* player 1 normal inputs? */ | |
| 340 | case 0x24: ret = input_port_read(field->machine(), "MAHJONG4"); break; | |
| 337 | case 0x09: ret = input_port_read(field.machine(), "MAHJONG1"); break; | |
| 338 | case 0x12: ret = input_port_read(field.machine(), "MAHJONG2"); break; | |
| 339 | case 0x1b: ret = input_port_read(field.machine(), "MAHJONG3"); break; /* player 1 normal inputs? */ | |
| 340 | case 0x24: ret = input_port_read(field.machine(), "MAHJONG4"); break; | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | return ret; |
| r11517 | r11518 | |
| 430 | 430 | |
| 431 | 431 | static CUSTOM_INPUT( get_calendar_status ) |
| 432 | 432 | { |
| 433 | neogeo_state *state = field | |
| 433 | neogeo_state *state = field. | |
| 434 | 434 | return (upd4990a_databit_r(state->m_upd4990a, 0) << 1) | upd4990a_testbit_r(state->m_upd4990a, 0); |
| 435 | 435 | } |
| 436 | 436 | |
| r11517 | r11518 | |
| 487 | 487 | { |
| 488 | 488 | /* D0 and D1 are memcard presence indicators, D2 indicates memcard |
| 489 | 489 | write protect status (we are always write enabled) */ |
| 490 | if(strcmp((char*)field | |
| 490 | if(strcmp((char*)field. | |
| 491 | 491 | return 0x00; // On the Neo Geo CD, the memory card is internal and therefore always present. |
| 492 | 492 | else |
| 493 | return (memcard_present(field | |
| 493 | return (memcard_present(field. | |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | static READ16_HANDLER( memcard_r ) |
| r11517 | r11518 | |
| 604 | 604 | |
| 605 | 605 | static CUSTOM_INPUT( get_audio_result ) |
| 606 | 606 | { |
| 607 | neogeo_state *state = field | |
| 607 | neogeo_state *state = field. | |
| 608 | 608 | UINT32 ret = state->m_audio_result; |
| 609 | 609 | |
| 610 | // if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field | |
| 610 | // if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field. | |
| 611 | 611 | |
| 612 | 612 | return ret; |
| 613 | 613 | } |
| r11517 | r11518 | |
|---|---|---|
| 1409 | 1409 | |
| 1410 | 1410 | static CUSTOM_INPUT( ddenlovr_special_r ) |
| 1411 | 1411 | { |
| 1412 | dynax_state *state = field | |
| 1412 | dynax_state *state = field. | |
| 1413 | 1413 | return state->m_ddenlovr_blitter_irq_flag; |
| 1414 | 1414 | } |
| 1415 | 1415 | |
| r11517 | r11518 | |
| 1781 | 1781 | |
| 1782 | 1782 | static CUSTOM_INPUT( ddenlovj_blitter_r ) |
| 1783 | 1783 | { |
| 1784 | dynax_state *state = field | |
| 1784 | dynax_state *state = field. | |
| 1785 | 1785 | return state->m_ddenlovr_blitter_irq_flag ? 0x03 : 0x00; // bit 4 = 1 -> blitter busy |
| 1786 | 1786 | } |
| 1787 | 1787 | |
| r11517 | r11518 | |
| 1921 | 1921 | |
| 1922 | 1922 | static CUSTOM_INPUT( nettoqc_special_r ) |
| 1923 | 1923 | { |
| 1924 | dynax_state *state = field | |
| 1924 | dynax_state *state = field. | |
| 1925 | 1925 | return state->m_ddenlovr_blitter_irq_flag ? 0x03 : 0x00; |
| 1926 | 1926 | } |
| 1927 | 1927 | |
| r11517 | r11518 | |
| 3446 | 3446 | |
| 3447 | 3447 | static CUSTOM_INPUT( mjflove_blitter_r ) |
| 3448 | 3448 | { |
| 3449 | dynax_state *state = field | |
| 3449 | dynax_state *state = field. | |
| 3450 | 3450 | |
| 3451 | 3451 | // bit 7 = 1 -> blitter busy |
| 3452 | 3452 | // bit 6 = 0 -> VBLANK? |
| r11517 | r11518 | |
|---|---|---|
| 957 | 957 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 958 | 958 | |
| 959 | 959 | PORT_START( "EEPROMOUT" ) |
| 960 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 961 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 960 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 961 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 962 | 962 | INPUT_PORTS_END |
| 963 | 963 | |
| 964 | 964 | |
| r11517 | r11518 | |
| 1532 | 1532 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1533 | 1533 | |
| 1534 | 1534 | PORT_START( "EEPROMOUT" ) |
| 1535 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1536 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1535 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1536 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1537 | 1537 | INPUT_PORTS_END |
| 1538 | 1538 | |
| 1539 | 1539 | |
| r11517 | r11518 | |
| 1608 | 1608 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1609 | 1609 | |
| 1610 | 1610 | PORT_START( "EEPROMOUT" ) |
| 1611 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1612 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1611 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1612 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1613 | 1613 | INPUT_PORTS_END |
| 1614 | 1614 | |
| 1615 | 1615 | |
| r11517 | r11518 | |
| 1684 | 1684 | ******************************************************/ |
| 1685 | 1685 | |
| 1686 | 1686 | PORT_START( "EEPROMOUT" ) |
| 1687 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1688 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1687 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1688 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1689 | 1689 | INPUT_PORTS_END |
| 1690 | 1690 | |
| 1691 | 1691 | |
| r11517 | r11518 | |
| 1778 | 1778 | { |
| 1779 | 1779 | // FIXME: the device line cannot be directly put in the interface due to inverse value! |
| 1780 | 1780 | // we might want to define a "reversed" set_cs_line handler |
| 1781 | device | |
| 1781 | eeprom_device | |
| 1782 | 1782 | // reset line asserted: reset. |
| 1783 | eeprom | |
| 1783 | eeprom->set_cs_line( | |
| 1784 | 1784 | } |
| 1785 | 1785 | |
| 1786 | 1786 | static const ay8910_interface ay8910_intf_eeprom = |
| 1787 | 1787 | { |
| 1788 | 1788 | AY8910_LEGACY_OUTPUT, |
| 1789 | 1789 | AY8910_DEFAULT_LOADS, |
| 1790 | DEVCB_DEVICE_LINE("eeprom", eeprom_read_bit), /* inputs A: 0,EEPROM bit read */ | |
| 1790 | DEVCB_DEVICE_LINE_MEMBER("eeprom", eeprom_device, read_bit), /* inputs A: 0,EEPROM bit read */ | |
| 1791 | 1791 | DEVCB_NULL, /* inputs B */ |
| 1792 | 1792 | DEVCB_NULL, /* outputs A */ |
| 1793 | 1793 | DEVCB_HANDLER(kaneko16_eeprom_reset_w) /* outputs B: 0,EEPROM reset */ |
| r11517 | r11518 | |
|---|---|---|
| 176 | 176 | |
| 177 | 177 | static CUSTOM_INPUT( mahjong_ctrl_r ) |
| 178 | 178 | { |
| 179 | ms32_state *state = field | |
| 179 | ms32_state *state = field. | |
| 180 | 180 | UINT32 mj_input; |
| 181 | 181 | |
| 182 | 182 | switch (state->m_mahjong_input_select[0]) |
| 183 | 183 | { |
| 184 | 184 | case 0x01: |
| 185 | mj_input = input_port_read(field | |
| 185 | mj_input = input_port_read(field. | |
| 186 | 186 | break; |
| 187 | 187 | case 0x02: |
| 188 | mj_input = input_port_read(field | |
| 188 | mj_input = input_port_read(field. | |
| 189 | 189 | break; |
| 190 | 190 | case 0x04: |
| 191 | mj_input = input_port_read(field | |
| 191 | mj_input = input_port_read(field. | |
| 192 | 192 | break; |
| 193 | 193 | case 0x08: |
| 194 | mj_input = input_port_read(field | |
| 194 | mj_input = input_port_read(field. | |
| 195 | 195 | break; |
| 196 | 196 | case 0x10: |
| 197 | mj_input = input_port_read(field | |
| 197 | mj_input = input_port_read(field. | |
| 198 | 198 | break; |
| 199 | 199 | default: |
| 200 | 200 | mj_input = 0; |
| r11517 | r11518 | |
|---|---|---|
| 274 | 274 | |
| 275 | 275 | static CUSTOM_INPUT( wwfsstar_vblank_r ) |
| 276 | 276 | { |
| 277 | wwfsstar_state *state = field | |
| 277 | wwfsstar_state *state = field. | |
| 278 | 278 | |
| 279 | 279 | return state->m_vblank; |
| 280 | 280 | } |
| r11517 | r11518 | |
|---|---|---|
| 1371 | 1371 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) /*ok*/ |
| 1372 | 1372 | |
| 1373 | 1373 | PORT_START("COIN") |
| 1374 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1374 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1375 | 1375 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1376 | 1376 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1377 | 1377 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 1431 | 1431 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) |
| 1432 | 1432 | |
| 1433 | 1433 | PORT_START( "EEPROMOUT" ) |
| 1434 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1435 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1436 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1434 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1435 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1436 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1437 | 1437 | INPUT_PORTS_END |
| 1438 | 1438 | |
| 1439 | 1439 | static INPUT_PORTS_START( spacedxo ) |
| r11517 | r11518 | |
| 1533 | 1533 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) /*ok*/ |
| 1534 | 1534 | |
| 1535 | 1535 | PORT_START("COIN") |
| 1536 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1536 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1537 | 1537 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1538 | 1538 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1539 | 1539 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 1593 | 1593 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) |
| 1594 | 1594 | |
| 1595 | 1595 | PORT_START( "EEPROMOUT" ) |
| 1596 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1597 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1598 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1596 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1597 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1598 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1599 | 1599 | INPUT_PORTS_END |
| 1600 | 1600 | |
| 1601 | 1601 | static INPUT_PORTS_START( viofight ) |
| r11517 | r11518 | |
|---|---|---|
| 319 | 319 | |
| 320 | 320 | static CUSTOM_INPUT( seawolf_erase_input_r ) |
| 321 | 321 | { |
| 322 | return input_port_read(field->machine(), SEAWOLF_ERASE_SW_PORT_TAG) & | |
| 323 | input_port_read(field->machine(), SEAWOLF_ERASE_DIP_PORT_TAG); | |
| 322 | return input_port_read(field.machine(), SEAWOLF_ERASE_SW_PORT_TAG) & | |
| 323 | input_port_read(field.machine(), SEAWOLF_ERASE_DIP_PORT_TAG); | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| r11517 | r11518 | |
| 559 | 559 | |
| 560 | 560 | static CUSTOM_INPUT( tornbase_hit_left_input_r ) |
| 561 | 561 | { |
| 562 | return input_port_read(field | |
| 562 | return input_port_read(field. | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | |
| r11517 | r11518 | |
| 567 | 567 | { |
| 568 | 568 | UINT32 ret; |
| 569 | 569 | |
| 570 | switch (tornbase_get_cabinet_type(field | |
| 570 | switch (tornbase_get_cabinet_type(field. | |
| 571 | 571 | { |
| 572 | 572 | case TORNBASE_CAB_TYPE_UPRIGHT_OLD: |
| 573 | ret = input_port_read(field | |
| 573 | ret = input_port_read(field. | |
| 574 | 574 | break; |
| 575 | 575 | |
| 576 | 576 | case TORNBASE_CAB_TYPE_UPRIGHT_NEW: |
| 577 | 577 | case TORNBASE_CAB_TYPE_COCKTAIL: |
| 578 | 578 | default: |
| 579 | ret = input_port_read(field | |
| 579 | ret = input_port_read(field. | |
| 580 | 580 | break; |
| 581 | 581 | } |
| 582 | 582 | |
| r11517 | r11518 | |
| 588 | 588 | { |
| 589 | 589 | UINT32 ret; |
| 590 | 590 | |
| 591 | switch (tornbase_get_cabinet_type(field | |
| 591 | switch (tornbase_get_cabinet_type(field. | |
| 592 | 592 | { |
| 593 | 593 | case TORNBASE_CAB_TYPE_UPRIGHT_OLD: |
| 594 | 594 | case TORNBASE_CAB_TYPE_UPRIGHT_NEW: |
| 595 | ret = input_port_read(field | |
| 595 | ret = input_port_read(field. | |
| 596 | 596 | break; |
| 597 | 597 | |
| 598 | 598 | case TORNBASE_CAB_TYPE_COCKTAIL: |
| 599 | 599 | default: |
| 600 | ret = input_port_read(field | |
| 600 | ret = input_port_read(field. | |
| 601 | 601 | break; |
| 602 | 602 | } |
| 603 | 603 | |
| r11517 | r11518 | |
| 607 | 607 | |
| 608 | 608 | static CUSTOM_INPUT( tornbase_pitch_right_input_r ) |
| 609 | 609 | { |
| 610 | return input_port_read(field | |
| 610 | return input_port_read(field. | |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | |
| 614 | 614 | static CUSTOM_INPUT( tornbase_score_input_r ) |
| 615 | 615 | { |
| 616 | return input_port_read(field->machine(), TORNBASE_SCORE_SW_PORT_TAG) & | |
| 617 | input_port_read(field->machine(), TORNBASE_SCORE_DIP_PORT_TAG); | |
| 616 | return input_port_read(field.machine(), TORNBASE_SCORE_SW_PORT_TAG) & | |
| 617 | input_port_read(field.machine(), TORNBASE_SCORE_DIP_PORT_TAG); | |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | |
| r11517 | r11518 | |
| 1194 | 1194 | |
| 1195 | 1195 | static CUSTOM_INPUT( desertgu_gun_input_r ) |
| 1196 | 1196 | { |
| 1197 | mw8080bw_state *state = field | |
| 1197 | mw8080bw_state *state = field. | |
| 1198 | 1198 | UINT32 ret; |
| 1199 | 1199 | |
| 1200 | 1200 | if (state->m_desertgun_controller_select) |
| 1201 | ret = input_port_read(field | |
| 1201 | ret = input_port_read(field. | |
| 1202 | 1202 | else |
| 1203 | ret = input_port_read(field | |
| 1203 | ret = input_port_read(field. | |
| 1204 | 1204 | |
| 1205 | 1205 | return ret; |
| 1206 | 1206 | } |
| r11517 | r11518 | |
| 1208 | 1208 | |
| 1209 | 1209 | static CUSTOM_INPUT( desertgu_dip_sw_0_1_r ) |
| 1210 | 1210 | { |
| 1211 | mw8080bw_state *state = field | |
| 1211 | mw8080bw_state *state = field. | |
| 1212 | 1212 | UINT32 ret; |
| 1213 | 1213 | |
| 1214 | 1214 | if (state->m_desertgun_controller_select) |
| 1215 | ret = input_port_read(field | |
| 1215 | ret = input_port_read(field. | |
| 1216 | 1216 | else |
| 1217 | ret = input_port_read(field | |
| 1217 | ret = input_port_read(field. | |
| 1218 | 1218 | |
| 1219 | 1219 | return ret; |
| 1220 | 1220 | } |
| r11517 | r11518 | |
| 1327 | 1327 | { |
| 1328 | 1328 | UINT32 ret; |
| 1329 | 1329 | |
| 1330 | if (input_port_read(field->machine(), DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT) | |
| 1331 | ret = input_port_read(field->machine(), DPLAY_L_PITCH_PORT_TAG); | |
| 1330 | if (input_port_read(field.machine(), DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT) | |
| 1331 | ret = input_port_read(field.machine(), DPLAY_L_PITCH_PORT_TAG); | |
| 1332 | 1332 | else |
| 1333 | ret = input_port_read(field | |
| 1333 | ret = input_port_read(field. | |
| 1334 | 1334 | |
| 1335 | 1335 | return ret; |
| 1336 | 1336 | } |
| r11517 | r11518 | |
| 1338 | 1338 | |
| 1339 | 1339 | static CUSTOM_INPUT( dplay_pitch_right_input_r ) |
| 1340 | 1340 | { |
| 1341 | return input_port_read(field | |
| 1341 | return input_port_read(field. | |
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | 1344 | |
| r11517 | r11518 | |
| 1716 | 1716 | |
| 1717 | 1717 | static CUSTOM_INPUT( clowns_controller_r ) |
| 1718 | 1718 | { |
| 1719 | mw8080bw_state *state = field | |
| 1719 | mw8080bw_state *state = field. | |
| 1720 | 1720 | UINT32 ret; |
| 1721 | 1721 | |
| 1722 | 1722 | if (state->m_clowns_controller_select) |
| 1723 | 1723 | { |
| 1724 | ret = input_port_read(field | |
| 1724 | ret = input_port_read(field. | |
| 1725 | 1725 | } |
| 1726 | 1726 | else |
| 1727 | 1727 | { |
| 1728 | ret = input_port_read(field | |
| 1728 | ret = input_port_read(field. | |
| 1729 | 1729 | } |
| 1730 | 1730 | |
| 1731 | 1731 | return ret; |
| r11517 | r11518 | |
| 2548 | 2548 | |
| 2549 | 2549 | static CUSTOM_INPUT( invaders_coin_input_r ) |
| 2550 | 2550 | { |
| 2551 | UINT32 ret = input_port_read(field | |
| 2551 | UINT32 ret = input_port_read(field. | |
| 2552 | 2552 | |
| 2553 | coin_counter_w(field | |
| 2553 | coin_counter_w(field. | |
| 2554 | 2554 | |
| 2555 | 2555 | return ret; |
| 2556 | 2556 | } |
| r11517 | r11518 | |
| 2563 | 2563 | /* upright PCB : switches visible |
| 2564 | 2564 | cocktail PCB: HI */ |
| 2565 | 2565 | |
| 2566 | if (invaders_is_cabinet_cocktail(field | |
| 2566 | if (invaders_is_cabinet_cocktail(field. | |
| 2567 | 2567 | ret = 0x03; |
| 2568 | 2568 | else |
| 2569 | ret = input_port_read(field | |
| 2569 | ret = input_port_read(field. | |
| 2570 | 2570 | |
| 2571 | 2571 | return ret; |
| 2572 | 2572 | } |
| r11517 | r11518 | |
| 2579 | 2579 | /* upright PCB : switch visible |
| 2580 | 2580 | cocktail PCB: HI */ |
| 2581 | 2581 | |
| 2582 | if (invaders_is_cabinet_cocktail(field | |
| 2582 | if (invaders_is_cabinet_cocktail(field. | |
| 2583 | 2583 | ret = 0x01; |
| 2584 | 2584 | else |
| 2585 | ret = input_port_read(field | |
| 2585 | ret = input_port_read(field. | |
| 2586 | 2586 | |
| 2587 | 2587 | return ret; |
| 2588 | 2588 | } |
| r11517 | r11518 | |
| 2595 | 2595 | /* upright PCB : P1 controls |
| 2596 | 2596 | cocktail PCB: HI */ |
| 2597 | 2597 | |
| 2598 | if (invaders_is_cabinet_cocktail(field | |
| 2598 | if (invaders_is_cabinet_cocktail(field. | |
| 2599 | 2599 | ret = 0x07; |
| 2600 | 2600 | else |
| 2601 | ret = input_port_read(field | |
| 2601 | ret = input_port_read(field. | |
| 2602 | 2602 | |
| 2603 | 2603 | return ret; |
| 2604 | 2604 | } |
| r11517 | r11518 | |
| 2606 | 2606 | |
| 2607 | 2607 | CUSTOM_INPUT( invaders_in1_control_r ) |
| 2608 | 2608 | { |
| 2609 | return input_port_read(field | |
| 2609 | return input_port_read(field. | |
| 2610 | 2610 | } |
| 2611 | 2611 | |
| 2612 | 2612 | |
| r11517 | r11518 | |
| 2617 | 2617 | /* upright PCB : P1 controls |
| 2618 | 2618 | cocktail PCB: P2 controls */ |
| 2619 | 2619 | |
| 2620 | if (invaders_is_cabinet_cocktail(field->machine())) | |
| 2621 | ret = input_port_read(field->machine(), INVADERS_P2_CONTROL_PORT_TAG); | |
| 2620 | if (invaders_is_cabinet_cocktail(field.machine())) | |
| 2621 | ret = input_port_read(field.machine(), INVADERS_P2_CONTROL_PORT_TAG); | |
| 2622 | 2622 | else |
| 2623 | ret = input_port_read(field | |
| 2623 | ret = input_port_read(field. | |
| 2624 | 2624 | |
| 2625 | 2625 | return ret; |
| 2626 | 2626 | } |
| r11517 | r11518 | |
| 2755 | 2755 | |
| 2756 | 2756 | static CUSTOM_INPUT( blueshrk_coin_input_r ) |
| 2757 | 2757 | { |
| 2758 | UINT32 ret = input_port_read(field | |
| 2758 | UINT32 ret = input_port_read(field. | |
| 2759 | 2759 | |
| 2760 | coin_counter_w(field | |
| 2760 | coin_counter_w(field. | |
| 2761 | 2761 | |
| 2762 | 2762 | return ret; |
| 2763 | 2763 | } |
| r11517 | r11518 | |
|---|---|---|
| 525 | 525 | |
| 526 | 526 | static INPUT_CHANGED( coin_inserted_irq_hi ) |
| 527 | 527 | { |
| 528 | btime_state *state = field | |
| 528 | btime_state *state = field. | |
| 529 | 529 | |
| 530 | 530 | if (newval) |
| 531 | 531 | device_set_input_line(state->m_maincpu, 0, HOLD_LINE); |
| r11517 | r11518 | |
| 533 | 533 | |
| 534 | 534 | static INPUT_CHANGED( coin_inserted_irq_lo ) |
| 535 | 535 | { |
| 536 | btime_state *state = field | |
| 536 | btime_state *state = field. | |
| 537 | 537 | |
| 538 | 538 | if (!newval) |
| 539 | 539 | device_set_input_line(state->m_maincpu, 0, HOLD_LINE); |
| r11517 | r11518 | |
| 541 | 541 | |
| 542 | 542 | static INPUT_CHANGED( coin_inserted_nmi_lo ) |
| 543 | 543 | { |
| 544 | btime_state *state = field | |
| 544 | btime_state *state = field. | |
| 545 | 545 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| 546 | 546 | } |
| 547 | 547 |
| r11517 | r11518 | |
|---|---|---|
| 222 | 222 | |
| 223 | 223 | static INPUT_CHANGED( left_coin_inserted ) |
| 224 | 224 | { |
| 225 | m14_state *state = field | |
| 225 | m14_state *state = field. | |
| 226 | 226 | /* left coin insertion causes a rst6.5 (vector 0x34) */ |
| 227 | 227 | if (newval) |
| 228 | 228 | device_set_input_line(state->m_maincpu, I8085_RST65_LINE, HOLD_LINE); |
| r11517 | r11518 | |
| 230 | 230 | |
| 231 | 231 | static INPUT_CHANGED( right_coin_inserted ) |
| 232 | 232 | { |
| 233 | m14_state *state = field | |
| 233 | m14_state *state = field. | |
| 234 | 234 | /* right coin insertion causes a rst5.5 (vector 0x2c) */ |
| 235 | 235 | if (newval) |
| 236 | 236 | device_set_input_line(state->m_maincpu, I8085_RST55_LINE, HOLD_LINE); |
| r11517 | r11518 | |
|---|---|---|
| 134 | 134 | |
| 135 | 135 | static CUSTOM_INPUT( ninjakun_io_A002_ctrl_r ) |
| 136 | 136 | { |
| 137 | nova2001_state *state = field | |
| 137 | nova2001_state *state = field. | |
| 138 | 138 | return state->m_ninjakun_io_a002_ctrl; |
| 139 | 139 | } |
| 140 | 140 |
| r11517 | r11518 | |
|---|---|---|
| 296 | 296 | result |= gaelco_serial_status_r(device->machine().device("serial"), 0); |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | if (eeprom_read_bit(device)) | |
| 299 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 300 | if (eeprom->read_bit()) | |
| 300 | 301 | result ^= 0x0004; |
| 301 | 302 | if (LOG) |
| 302 | 303 | logerror("eeprom_data_r(%02X)\n", result); |
| r11517 | r11518 | |
| 324 | 325 | static WRITE16_DEVICE_HANDLER( eeprom_data_w ) |
| 325 | 326 | { |
| 326 | 327 | if (ACCESSING_BITS_0_7) |
| 327 | eeprom_write_bit(device, data & 0x01); | |
| 328 | { | |
| 329 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 330 | eeprom->write_bit(data & 0x01); | |
| 331 | } | |
| 328 | 332 | else if (mem_mask != 0xffff) |
| 329 | 333 | logerror("write mask: %08x data %08x\n", mem_mask, data); |
| 330 | 334 | } |
| r11517 | r11518 | |
| 333 | 337 | static WRITE16_DEVICE_HANDLER( eeprom_clock_w ) |
| 334 | 338 | { |
| 335 | 339 | if (ACCESSING_BITS_0_7) |
| 336 | eeprom_set_clock_line(device, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 340 | { | |
| 341 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 342 | eeprom->set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); | |
| 343 | } | |
| 337 | 344 | } |
| 338 | 345 | |
| 339 | 346 | |
| 340 | 347 | static WRITE16_DEVICE_HANDLER( eeprom_cs_w ) |
| 341 | 348 | { |
| 342 | 349 | if (ACCESSING_BITS_0_7) |
| 343 | eeprom_set_cs_line(device, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 350 | { | |
| 351 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 352 | eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 353 | } | |
| 344 | 354 | } |
| 345 | 355 | |
| 346 | 356 | |
| r11517 | r11518 | |
| 409 | 419 | |
| 410 | 420 | static CUSTOM_INPUT( analog_bit_r ) |
| 411 | 421 | { |
| 412 | gaelco3d_state *state = field | |
| 422 | gaelco3d_state *state = field. | |
| 413 | 423 | int which = (FPTR)param; |
| 414 | 424 | return (state->m_analog_ports[which] >> 7) & 0x01; |
| 415 | 425 | } |
| r11517 | r11518 | |
|---|---|---|
| 333 | 333 | |
| 334 | 334 | static CUSTOM_INPUT( marvins_sound_busy ) |
| 335 | 335 | { |
| 336 | snk_state *state = field | |
| 336 | snk_state *state = field. | |
| 337 | 337 | |
| 338 | 338 | return state->m_marvins_sound_busy_flag; |
| 339 | 339 | } |
| r11517 | r11518 | |
| 500 | 500 | |
| 501 | 501 | static CUSTOM_INPUT( snk_sound_busy ) |
| 502 | 502 | { |
| 503 | snk_state *state = field | |
| 503 | snk_state *state = field. | |
| 504 | 504 | |
| 505 | 505 | return (state->m_sound_status & 4) ? 1 : 0; |
| 506 | 506 | } |
| r11517 | r11518 | |
| 752 | 752 | |
| 753 | 753 | static CUSTOM_INPUT( gwar_rotary ) |
| 754 | 754 | { |
| 755 | snk_state *state = field | |
| 755 | snk_state *state = field. | |
| 756 | 756 | static const char *const ports[] = { "P1ROT", "P2ROT" }; |
| 757 | 757 | int which = (int)(FPTR)param; |
| 758 | int value = input_port_read(field | |
| 758 | int value = input_port_read(field. | |
| 759 | 759 | |
| 760 | 760 | if ((state->m_last_value[which] == 0x5 && value == 0x6) || (state->m_last_value[which] == 0x6 && value == 0x5)) |
| 761 | 761 | { |
| r11517 | r11518 | |
| 770 | 770 | |
| 771 | 771 | static CUSTOM_INPUT( gwarb_rotary ) |
| 772 | 772 | { |
| 773 | if (input_port_read(field | |
| 773 | if (input_port_read(field. | |
| 774 | 774 | { |
| 775 | 775 | return gwar_rotary(device, field, param); |
| 776 | 776 | } |
| r11517 | r11518 | |
| 819 | 819 | |
| 820 | 820 | static CUSTOM_INPUT( countryc_trackball_x ) |
| 821 | 821 | { |
| 822 | snk_state *state = field | |
| 822 | snk_state *state = field. | |
| 823 | 823 | |
| 824 | return input_port_read(field | |
| 824 | return input_port_read(field. | |
| 825 | 825 | } |
| 826 | 826 | |
| 827 | 827 | static CUSTOM_INPUT( countryc_trackball_y ) |
| 828 | 828 | { |
| 829 | snk_state *state = field | |
| 829 | snk_state *state = field. | |
| 830 | 830 | |
| 831 | return input_port_read(field | |
| 831 | return input_port_read(field. | |
| 832 | 832 | } |
| 833 | 833 | |
| 834 | 834 | |
| r11517 | r11518 | |
| 841 | 841 | switch (bit_mask) |
| 842 | 842 | { |
| 843 | 843 | case 0x01: /* older games : "Occurence" Dip Switch (DSW2:1) */ |
| 844 | return ((input_port_read(field | |
| 844 | return ((input_port_read(field. | |
| 845 | 845 | case 0xc0: /* older games : "Bonus Life" Dip Switches (DSW1:7,8) */ |
| 846 | return ((input_port_read(field | |
| 846 | return ((input_port_read(field. | |
| 847 | 847 | |
| 848 | 848 | case 0x04: /* later games : "Occurence" Dip Switch (DSW1:3) */ |
| 849 | return ((input_port_read(field | |
| 849 | return ((input_port_read(field. | |
| 850 | 850 | case 0x30: /* later games : "Bonus Life" Dip Switches (DSW2:5,6) */ |
| 851 | return ((input_port_read(field | |
| 851 | return ((input_port_read(field. | |
| 852 | 852 | |
| 853 | 853 | default: |
| 854 | 854 | logerror("snk_bonus_r : invalid %02X bit_mask\n",bit_mask); |
| r11517 | r11518 | |
|---|---|---|
| 117 | 117 | PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 118 | 118 | |
| 119 | 119 | PORT_START( "EEPROMIN" ) |
| 120 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 120 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 121 | 121 | |
| 122 | 122 | PORT_START( "EEPROMOUT" ) |
| 123 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 123 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 124 | 124 | |
| 125 | 125 | PORT_START( "EEPROMCLK" ) |
| 126 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 126 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 127 | 127 | |
| 128 | 128 | PORT_START( "EEPROMCS" ) |
| 129 | PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 129 | PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 130 | 130 | INPUT_PORTS_END |
| 131 | 131 | |
| 132 | 132 | static MACHINE_CONFIG_START( mosaicf2, mosaicf2_state ) |
| r11517 | r11518 | |
|---|---|---|
| 414 | 414 | |
| 415 | 415 | static INPUT_CHANGED( panic_coin_inserted ) |
| 416 | 416 | { |
| 417 | panic_sound_output_w(field | |
| 417 | panic_sound_output_w(field. | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | static INPUT_PORTS_START( panic ) |
| r11517 | r11518 | |
| 475 | 475 | |
| 476 | 476 | static INPUT_CHANGED( cosmica_coin_inserted ) |
| 477 | 477 | { |
| 478 | cputag_set_input_line(field | |
| 478 | cputag_set_input_line(field. | |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | static INPUT_PORTS_START( cosmica ) |
| r11517 | r11518 | |
| 530 | 530 | |
| 531 | 531 | static INPUT_CHANGED( cosmicg_coin_inserted ) |
| 532 | 532 | { |
| 533 | cputag_set_input_line_and_vector(field | |
| 533 | cputag_set_input_line_and_vector(field. | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | static INPUT_PORTS_START( cosmicg ) |
| r11517 | r11518 | |
| 577 | 577 | |
| 578 | 578 | static INPUT_CHANGED( coin_inserted_irq0 ) |
| 579 | 579 | { |
| 580 | cputag_set_input_line(field | |
| 580 | cputag_set_input_line(field. | |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | static INPUT_CHANGED( coin_inserted_nmi ) |
| 584 | 584 | { |
| 585 | cputag_set_input_line(field | |
| 585 | cputag_set_input_line(field. | |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | static INPUT_PORTS_START( magspot ) |
| r11517 | r11518 | |
|---|---|---|
| 424 | 424 | model2_state *state = space->machine().driver_data<model2_state>(); |
| 425 | 425 | if(ACCESSING_BITS_0_7) |
| 426 | 426 | { |
| 427 | eeprom_device * | |
| 427 | eeprom_device * | |
| 428 | 428 | state->m_ctrlmode = data & 0x01; |
| 429 | eeprom_write_bit(device, data & 0x20); | |
| 430 | eeprom_set_clock_line(device, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 431 | eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 429 | eeprom->write_bit(data & 0x20); | |
| 430 | eeprom->set_clock_line((data & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 431 | eeprom->set_cs_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | |
| r11517 | r11518 | |
| 460 | 460 | |
| 461 | 461 | static CUSTOM_INPUT( _1c00000_r ) |
| 462 | 462 | { |
| 463 | model2_state *state = field->machine().driver_data<model2_state>(); | |
| 464 | UINT32 ret = input_port_read(field->machine(), "IN0"); | |
| 463 | model2_state *state = field.machine().driver_data<model2_state>(); | |
| 464 | UINT32 ret = input_port_read(field.machine(), "IN0"); | |
| 465 | 465 | |
| 466 | 466 | if(state->m_ctrlmode == 0) |
| 467 | 467 | { |
| r11517 | r11518 | |
| 470 | 470 | else |
| 471 | 471 | { |
| 472 | 472 | ret &= ~0x0030; |
| 473 | return ret | 0x00d0 | ( | |
| 473 | return ret | 0x00d0 | ( | |
| 474 | 474 | } |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | static CUSTOM_INPUT( _1c0001c_r ) |
| 478 | 478 | { |
| 479 | model2_state *state = field | |
| 479 | model2_state *state = field. | |
| 480 | 480 | UINT32 iptval = 0x00ff; |
| 481 | 481 | if(state->m_analog_channel < 4) |
| 482 | 482 | { |
| 483 | 483 | static const char *const ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" }; |
| 484 | iptval = input_port_read_safe(field | |
| 484 | iptval = input_port_read_safe(field. | |
| 485 | 485 | ++state->m_analog_channel; |
| 486 | 486 | } |
| 487 | 487 | return iptval; |
| r11517 | r11518 | |
|---|---|---|
| 119 | 119 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 120 | 120 | |
| 121 | 121 | PORT_START("IN2") /* 0x20 */ |
| 122 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 122 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 123 | 123 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 124 | 124 | |
| 125 | 125 | PORT_START("AN0") /* 0x00 - analog X */ |
| r11517 | r11518 | |
| 150 | 150 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 151 | 151 | |
| 152 | 152 | PORT_START("IN2") /* 0x20 */ |
| 153 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 153 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 154 | 154 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 155 | 155 | PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) |
| 156 | 156 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 202 | 202 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 203 | 203 | |
| 204 | 204 | PORT_START("IN2") /* 0x20 */ |
| 205 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 205 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 206 | 206 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 207 | 207 | |
| 208 | 208 | PORT_START("AN0") /* Analog wheel 1 */ |
| r11517 | r11518 | |
| 248 | 248 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 249 | 249 | |
| 250 | 250 | PORT_START("IN2") /* 0x20 */ |
| 251 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 251 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 252 | 252 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 253 | 253 | |
| 254 | 254 | PORT_START("P1") /* 0x0E */ |
| r11517 | r11518 | |
|---|---|---|
| 168 | 168 | int result; |
| 169 | 169 | |
| 170 | 170 | /* PORT_SERVICE_NO_TOGGLE */ |
| 171 | result = (input_port_read(field | |
| 171 | result = (input_port_read(field. | |
| 172 | 172 | |
| 173 | 173 | return ~result; |
| 174 | 174 | } |
| r11517 | r11518 | |
| 178 | 178 | int result; |
| 179 | 179 | |
| 180 | 180 | /* IPT_COIN1 */ |
| 181 | result = ((input_port_read(field | |
| 181 | result = ((input_port_read(field. | |
| 182 | 182 | /* IPT_COIN2 */ |
| 183 | result |= ((input_port_read(field | |
| 183 | result |= ((input_port_read(field. | |
| 184 | 184 | /* IPT_START1 */ |
| 185 | result |= ((input_port_read(field | |
| 185 | result |= ((input_port_read(field. | |
| 186 | 186 | /* IPT_START2 */ |
| 187 | result |= ((input_port_read(field | |
| 187 | result |= ((input_port_read(field. | |
| 188 | 188 | /* PORT_SERVICE_NO_TOGGLE */ |
| 189 | result |= ((input_port_read(field | |
| 189 | result |= ((input_port_read(field. | |
| 190 | 190 | |
| 191 | 191 | return ~result; |
| 192 | 192 | } |
| r11517 | r11518 | |
|---|---|---|
| 922 | 922 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) |
| 923 | 923 | |
| 924 | 924 | PORT_START("IN2") /* (0x20) */ |
| 925 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 925 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 926 | 926 | PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW ) |
| 927 | 927 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 928 | 928 | PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 936 | 936 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 937 | 937 | |
| 938 | 938 | PORT_START( "EEPROMOUT" ) |
| 939 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 940 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 941 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 939 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 940 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 941 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 942 | 942 | INPUT_PORTS_END |
| 943 | 943 | |
| 944 | 944 | /* 4 players and 3 buttons */ |
| r11517 | r11518 | |
|---|---|---|
| 475 | 475 | static CUSTOM_INPUT( ckongs_coinage_r ) |
| 476 | 476 | { |
| 477 | 477 | int bit_mask = (FPTR)param; |
| 478 | return (input_port_read(field | |
| 478 | return (input_port_read(field. | |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 |
| r11517 | r11518 | |
|---|---|---|
| 93 | 93 | coin_counter_w(space->machine(), 3, data & 0x08); |
| 94 | 94 | |
| 95 | 95 | /* bits 5-7 control EEPROM */ |
| 96 | eeprom_set_cs_line(state->m_eeprom, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 97 | eeprom_write_bit(state->m_eeprom, data & 0x80); | |
| 98 | eeprom_set_clock_line(state->m_eeprom, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 96 | state->m_eeprom->set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 97 | state->m_eeprom->write_bit(data & 0x80); | |
| 98 | state->m_eeprom->set_clock_line((data & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| r11517 | r11518 | |
| 107 | 107 | { |
| 108 | 108 | coin_counter_w(space->machine(), 0,data & 0x20); |
| 109 | 109 | |
| 110 | eeprom_set_cs_line(state->m_eeprom, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 111 | eeprom_write_bit(state->m_eeprom, data & 4); | |
| 112 | eeprom_set_clock_line(state->m_eeprom, (data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 110 | state->m_eeprom->set_cs_line((data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
| 111 | state->m_eeprom->write_bit(data & 4); | |
| 112 | state->m_eeprom->set_clock_line((data & 2) ? ASSERT_LINE : CLEAR_LINE ); | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r11517 | r11518 | |
| 567 | 567 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 568 | 568 | PORT_SERVICE_NO_TOGGLE(0x20, IP_ACTIVE_LOW) |
| 569 | 569 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* ?? see code at 746a. sound status? */ |
| 570 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* EEPROM data */ | |
| 570 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* EEPROM data */ | |
| 571 | 571 | |
| 572 | 572 | PORT_START("P1") |
| 573 | 573 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| r11517 | r11518 | |
| 733 | 733 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 734 | 734 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 735 | 735 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 736 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* EEPROM data */ | |
| 736 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* EEPROM data */ | |
| 737 | 737 | |
| 738 | 738 | PORT_START("DSW1") |
| 739 | 739 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) |
| r11517 | r11518 | |
| 1038 | 1038 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 1039 | 1039 | |
| 1040 | 1040 | state->m_oki = machine.device<okim6295_device>("oki"); |
| 1041 | state->m_eeprom = machine.device("eeprom"); | |
| 1041 | state->m_eeprom = machine.device<eeprom_device>("eeprom"); | |
| 1042 | 1042 | |
| 1043 | 1043 | state->save_item(NAME(state->m_bgscrollx)); |
| 1044 | 1044 | state->save_item(NAME(state->m_bgscrolly)); |
| r11517 | r11518 | |
|---|---|---|
| 288 | 288 | static CUSTOM_INPUT(controls_r) |
| 289 | 289 | { |
| 290 | 290 | int data = 7; |
| 291 | switch(input_port_read(field | |
| 291 | switch(input_port_read(field. | |
| 292 | 292 | { |
| 293 | 293 | case 0x01: data = 1; break; |
| 294 | 294 | case 0x02: data = 2; break; |
| r11517 | r11518 | |
|---|---|---|
| 172 | 172 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) |
| 173 | 173 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) |
| 174 | 174 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK ) /* ? */ |
| 175 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 175 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 176 | 176 | |
| 177 | 177 | PORT_START( "IO_01" ) |
| 178 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 178 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 179 | 179 | |
| 180 | 180 | PORT_START( "IO_02" ) |
| 181 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 181 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 182 | 182 | |
| 183 | 183 | PORT_START( "IO_03" ) |
| 184 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 184 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 185 | 185 | INPUT_PORTS_END |
| 186 | 186 | |
| 187 | 187 |
| r11517 | r11518 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | static CUSTOM_INPUT( battlex_in0_b4_r ) |
| 59 | 59 | { |
| 60 | battlex_state *state = field | |
| 60 | battlex_state *state = field. | |
| 61 | 61 | UINT32 ret = state->m_in0_b4; |
| 62 | 62 | if (state->m_in0_b4) |
| 63 | 63 | { |
| 64 | cputag_set_input_line(field | |
| 64 | cputag_set_input_line(field. | |
| 65 | 65 | state->m_in0_b4 = 0; |
| 66 | 66 | } |
| 67 | 67 |
| r11517 | r11518 | |
|---|---|---|
| 483 | 483 | PORT_DIPSETTING( 0x00, "Independent" ) |
| 484 | 484 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 485 | 485 | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 486 | PORT_BIT( 0x00010000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 486 | PORT_BIT( 0x00010000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 487 | 487 | |
| 488 | 488 | PORT_START( "EEPROMOUT" ) |
| 489 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 490 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 491 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 489 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 490 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 491 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 492 | 492 | INPUT_PORTS_END |
| 493 | 493 | |
| 494 | 494 | ROM_START( cryptklr ) |
| r11517 | r11518 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | static CUSTOM_INPUT( snes_mouse_speed_input ) |
| 115 | 115 | { |
| 116 | snes_state *state = field | |
| 116 | snes_state *state = field. | |
| 117 | 117 | int port = (FPTR)param; |
| 118 | 118 | |
| 119 | 119 | if (snes_ram[OLDJOY1] & 0x1) |
| r11517 | r11518 | |
| 128 | 128 | |
| 129 | 129 | static CUSTOM_INPUT( snes_superscope_offscreen_input ) |
| 130 | 130 | { |
| 131 | snes_state *state = field | |
| 131 | snes_state *state = field. | |
| 132 | 132 | int port = (FPTR)param; |
| 133 | 133 | static const char *const portnames[2][3] = |
| 134 | 134 | { |
| r11517 | r11518 | |
| 136 | 136 | { "SUPERSCOPE2", "SUPERSCOPE2_X", "SUPERSCOPE2_Y" }, |
| 137 | 137 | }; |
| 138 | 138 | |
| 139 | INT16 x = input_port_read(field->machine(), portnames[port][1]); | |
| 140 | INT16 y = input_port_read(field->machine(), portnames[port][2]); | |
| 139 | INT16 x = input_port_read(field.machine(), portnames[port][1]); | |
| 140 | INT16 y = input_port_read(field.machine(), portnames[port][2]); | |
| 141 | 141 | |
| 142 | 142 | /* these are the theoretical boundaries, but we currently are always onscreen... */ |
| 143 | 143 | if (x < 0 || x >= SNES_SCR_WIDTH || y < 0 || y >= snes_ppu.beam.last_visible_line) |
| r11517 | r11518 | |
|---|---|---|
| 713 | 713 | |
| 714 | 714 | static CUSTOM_INPUT( c2map_r ) |
| 715 | 715 | { |
| 716 | toaplan2_state *state = field | |
| 716 | toaplan2_state *state = field. | |
| 717 | 717 | |
| 718 | 718 | // For Teki Paki hardware |
| 719 | 719 | // bit 4 high signifies secondary CPU is ready |
| r11517 | r11518 | |
| 1077 | 1077 | // ROM code. Failure to return the correct status incurrs a Sound Error. |
| 1078 | 1078 | |
| 1079 | 1079 | int data; |
| 1080 | data = ((eeprom | |
| 1080 | data = ((eeprom->read_bit( | |
| 1081 | 1081 | data |= ((state->m_z80_busreq >> 4) & 0x01); // Loop BUSRQ to BUSAK |
| 1082 | 1082 | |
| 1083 | 1083 | return data; |
| r11517 | r11518 | |
| 2188 | 2188 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused |
| 2189 | 2189 | |
| 2190 | 2190 | PORT_START("EEPROM") |
| 2191 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2192 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2193 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2194 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2191 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2192 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2193 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2194 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2195 | 2195 | INPUT_PORTS_END |
| 2196 | 2196 | |
| 2197 | 2197 | |
| r11517 | r11518 | |
| 2966 | 2966 | PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) |
| 2967 | 2967 | |
| 2968 | 2968 | PORT_START( "EEPROMOUT" ) |
| 2969 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2970 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2971 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2969 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2970 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2971 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2972 | 2972 | INPUT_PORTS_END |
| 2973 | 2973 | |
| 2974 | 2974 |
| r11517 | r11518 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | static INPUT_CHANGED( coin_inserted ) |
| 101 | 101 | { |
| 102 | cinemat_state *state = field | |
| 102 | cinemat_state *state = field. | |
| 103 | 103 | /* on the falling edge of a new coin, set the coin_detected flag */ |
| 104 | 104 | if (newval == 0) |
| 105 | 105 | state->m_coin_detected = 1; |
| r11517 | r11518 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | static CUSTOM_INPUT( pc3092_r ) |
| 72 | 72 | { |
| 73 | crbaloon_state *state = field | |
| 73 | crbaloon_state *state = field. | |
| 74 | 74 | UINT32 ret; |
| 75 | 75 | |
| 76 | 76 | /* enable coin & start input? Wild guess!!! */ |
| 77 | 77 | if (state->m_pc3092_data[1] & 0x02) |
| 78 | ret = input_port_read(field | |
| 78 | ret = input_port_read(field. | |
| 79 | 79 | else |
| 80 | 80 | ret = 0x00; |
| 81 | 81 | |
| 82 | if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", field | |
| 82 | if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", field. | |
| 83 | 83 | |
| 84 | 84 | return ret; |
| 85 | 85 | } |
| r11517 | r11518 | |
|---|---|---|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | CUSTOM_INPUT( btoads_state:: | |
| 73 | CUSTOM_INPUT_MEMBER( btoads_state:: | |
| 74 | 74 | { |
| 75 | return | |
| 75 | return | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | CUSTOM_INPUT( btoads_state:: | |
| 79 | CUSTOM_INPUT_MEMBER( btoads_state:: | |
| 80 | 80 | { |
| 81 | return | |
| 81 | return | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| r11517 | r11518 | |
| 259 | 259 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 260 | 260 | |
| 261 | 261 | PORT_START("SPECIAL") |
| 262 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(btoads_state | |
| 262 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, btoads_state, | |
| 263 | 263 | PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW ) |
| 264 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(btoads_state | |
| 264 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, btoads_state, | |
| 265 | 265 | PORT_BIT( 0xff7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 266 | 266 | |
| 267 | 267 | PORT_START("SW1") |
| r11517 | r11518 | |
|---|---|---|
| 78 | 78 | */ |
| 79 | 79 | static INPUT_CHANGED( left_coin_inserted ) |
| 80 | 80 | { |
| 81 | ladybug_state *state = field | |
| 81 | ladybug_state *state = field. | |
| 82 | 82 | |
| 83 | 83 | if(newval) |
| 84 | 84 | device_set_input_line(state->m_maincpu, 0, ASSERT_LINE); |
| r11517 | r11518 | |
| 86 | 86 | |
| 87 | 87 | static INPUT_CHANGED( right_coin_inserted ) |
| 88 | 88 | { |
| 89 | ladybug_state *state = field | |
| 89 | ladybug_state *state = field. | |
| 90 | 90 | |
| 91 | 91 | if(newval) |
| 92 | 92 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, PULSE_LINE); |
| r11517 | r11518 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | static CUSTOM_INPUT( vicdual_read_coin_status ) |
| 85 | 85 | { |
| 86 | vicdual_state *state = field | |
| 86 | vicdual_state *state = field. | |
| 87 | 87 | return state->m_coin_status; |
| 88 | 88 | } |
| 89 | 89 | |
| r11517 | r11518 | |
| 93 | 93 | if (newval && !oldval) |
| 94 | 94 | { |
| 95 | 95 | /* increment the coin counter */ |
| 96 | coin_counter_w(field->machine(), 0, 1); | |
| 97 | coin_counter_w(field->machine(), 0, 0); | |
| 96 | coin_counter_w(field.machine(), 0, 1); | |
| 97 | coin_counter_w(field.machine(), 0, 0); | |
| 98 | 98 | |
| 99 | cputag_set_input_line(field | |
| 99 | cputag_set_input_line(field. | |
| 100 | 100 | |
| 101 | 101 | /* simulate the coin switch being closed for a while */ |
| 102 | field | |
| 102 | field. | |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| r11517 | r11518 | |
| 137 | 137 | |
| 138 | 138 | static CUSTOM_INPUT( vicdual_get_64v ) |
| 139 | 139 | { |
| 140 | return (get_vcounter(field | |
| 140 | return (get_vcounter(field. | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | static CUSTOM_INPUT( vicdual_get_vblank_comp ) |
| 145 | 145 | { |
| 146 | return (get_vcounter(field | |
| 146 | return (get_vcounter(field. | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
| 150 | 150 | static CUSTOM_INPUT( vicdual_get_composite_blank_comp ) |
| 151 | 151 | { |
| 152 | return (vicdual_get_vblank_comp(device, field, 0) && !field | |
| 152 | return (vicdual_get_vblank_comp(device, field, 0) && !field. | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | static CUSTOM_INPUT( vicdual_get_timer_value ) |
| 157 | 157 | { |
| 158 | 158 | /* return the state of the timer (old code claims "4MHz square wave", but it was toggled once every 2msec, or 500Hz) */ |
| 159 | return field | |
| 159 | return field. | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| r11517 | r11518 | |
| 1632 | 1632 | static CUSTOM_INPUT( brdrline_lives ) |
| 1633 | 1633 | { |
| 1634 | 1634 | int bit_mask = (FPTR)param; |
| 1635 | return (input_port_read(field | |
| 1635 | return (input_port_read(field. | |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | 1638 | static INPUT_PORTS_START( brdrline ) |
| r11517 | r11518 | |
| 2053 | 2053 | |
| 2054 | 2054 | static CUSTOM_INPUT( samurai_protection_r ) |
| 2055 | 2055 | { |
| 2056 | vicdual_state *state = field | |
| 2056 | vicdual_state *state = field. | |
| 2057 | 2057 | int offset = (FPTR)param; |
| 2058 | 2058 | UINT32 answer = 0; |
| 2059 | 2059 |
| r11517 | r11518 | |
|---|---|---|
| 342 | 342 | |
| 343 | 343 | static CUSTOM_INPUT( pending_sound_r ) |
| 344 | 344 | { |
| 345 | welltris_state *state = field | |
| 345 | welltris_state *state = field. | |
| 346 | 346 | return state->m_pending_command ? 1 : 0; |
| 347 | 347 | } |
| 348 | 348 |
| r11517 | r11518 | |
|---|---|---|
| 379 | 379 | |
| 380 | 380 | static CUSTOM_INPUT( custom_soundstatus_r ) |
| 381 | 381 | { |
| 382 | metro_state *state = field | |
| 382 | metro_state *state = field. | |
| 383 | 383 | return (state->m_busy_sndcpu ? 0x01 : 0x00); |
| 384 | 384 | } |
| 385 | 385 | |
| r11517 | r11518 | |
| 1308 | 1308 | |
| 1309 | 1309 | static READ16_DEVICE_HANDLER( gakusai_eeprom_r ) |
| 1310 | 1310 | { |
| 1311 | return eeprom_read_bit(device) & 1; | |
| 1311 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1312 | return eeprom->read_bit() & 1; | |
| 1312 | 1313 | } |
| 1313 | 1314 | |
| 1314 | 1315 | static WRITE16_DEVICE_HANDLER( gakusai_eeprom_w ) |
| 1315 | 1316 | { |
| 1316 | 1317 | if (ACCESSING_BITS_0_7) |
| 1317 | 1318 | { |
| 1319 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1320 | ||
| 1318 | 1321 | // latch the bit |
| 1319 | eeprom | |
| 1322 | eeprom->write_bit( | |
| 1320 | 1323 | |
| 1321 | 1324 | // reset line asserted: reset. |
| 1322 | eeprom | |
| 1325 | eeprom->set_cs_line( | |
| 1323 | 1326 | |
| 1324 | 1327 | // clock line asserted: write latch or select next bit to read |
| 1325 | eeprom | |
| 1328 | eeprom->set_clock_line( | |
| 1326 | 1329 | } |
| 1327 | 1330 | } |
| 1328 | 1331 | |
| r11517 | r11518 | |
| 1404 | 1407 | static READ16_DEVICE_HANDLER( dokyusp_eeprom_r ) |
| 1405 | 1408 | { |
| 1406 | 1409 | // clock line asserted: write latch or select next bit to read |
| 1407 | eeprom_set_clock_line(device, CLEAR_LINE); | |
| 1408 | eeprom_set_clock_line(device, ASSERT_LINE); | |
| 1410 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1411 | eeprom->set_clock_line(CLEAR_LINE); | |
| 1412 | eeprom->set_clock_line(ASSERT_LINE); | |
| 1409 | 1413 | |
| 1410 | return eeprom | |
| 1414 | return eeprom->read_bit( | |
| 1411 | 1415 | } |
| 1412 | 1416 | |
| 1413 | 1417 | static WRITE16_DEVICE_HANDLER( dokyusp_eeprom_bit_w ) |
| r11517 | r11518 | |
| 1415 | 1419 | if (ACCESSING_BITS_0_7) |
| 1416 | 1420 | { |
| 1417 | 1421 | // latch the bit |
| 1418 | eeprom_write_bit(device, BIT(data, 0)); | |
| 1422 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1423 | eeprom->write_bit(BIT(data, 0)); | |
| 1419 | 1424 | |
| 1420 | 1425 | // clock line asserted: write latch or select next bit to read |
| 1421 | eeprom_set_clock_line(device, CLEAR_LINE); | |
| 1422 | eeprom_set_clock_line(device, ASSERT_LINE); | |
| 1426 | eeprom->set_clock_line(CLEAR_LINE); | |
| 1427 | eeprom->set_clock_line(ASSERT_LINE); | |
| 1423 | 1428 | } |
| 1424 | 1429 | } |
| 1425 | 1430 | |
| r11517 | r11518 | |
| 1428 | 1433 | if (ACCESSING_BITS_0_7) |
| 1429 | 1434 | { |
| 1430 | 1435 | // reset line asserted: reset. |
| 1431 | eeprom_set_cs_line(device, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE); | |
| 1436 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1437 | eeprom->set_cs_line(BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE); | |
| 1432 | 1438 | } |
| 1433 | 1439 | } |
| 1434 | 1440 |
| r11517 | r11518 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | static CUSTOM_INPUT( rgum_heartbeat_r ) |
| 83 | 83 | { |
| 84 | rgum_state *state = field | |
| 84 | rgum_state *state = field. | |
| 85 | 85 | |
| 86 | 86 | state->m_hbeat ^= 1; |
| 87 | 87 |
| r11517 | r11518 | |
|---|---|---|
| 342 | 342 | |
| 343 | 343 | static CUSTOM_INPUT( acs_r ) |
| 344 | 344 | { |
| 345 | zaccaria_state *state = field | |
| 345 | zaccaria_state *state = field. | |
| 346 | 346 | return (state->m_acs & 0x08) ? 1 : 0; |
| 347 | 347 | } |
| 348 | 348 |
| r11517 | r11518 | |
|---|---|---|
| 139 | 139 | PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 ) |
| 140 | 140 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 ) |
| 141 | 141 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 142 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 142 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 143 | 143 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 144 | 144 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 145 | 145 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL) |
| r11517 | r11518 | |
| 167 | 167 | PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 168 | 168 | |
| 169 | 169 | PORT_START( "EEPROMOUT" ) |
| 170 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 171 | PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 172 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 170 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 171 | PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 172 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 173 | 173 | INPUT_PORTS_END |
| 174 | 174 | |
| 175 | 175 | static INPUT_PORTS_START( ironfort ) |
| r11517 | r11518 | |
| 177 | 177 | PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 ) |
| 178 | 178 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 ) |
| 179 | 179 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 180 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 180 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 181 | 181 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 182 | 182 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 183 | 183 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL) |
| r11517 | r11518 | |
| 226 | 226 | PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 227 | 227 | |
| 228 | 228 | PORT_START( "EEPROMOUT" ) |
| 229 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 230 | PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 231 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 229 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 230 | PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 231 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 232 | 232 | INPUT_PORTS_END |
| 233 | 233 | |
| 234 | 234 | static INPUT_PORTS_START( ironfortj ) |
| r11517 | r11518 | |
|---|---|---|
| 584 | 584 | */ |
| 585 | 585 | static WRITE32_HANDLER( jaguar_eeprom_w ) |
| 586 | 586 | { |
| 587 | device | |
| 587 | eeprom_device | |
| 588 | 588 | eeprom_bit_count++; |
| 589 | 589 | if (eeprom_bit_count != 9) /* kill extra bit at end of address */ |
| 590 | 590 | { |
| 591 | eeprom_write_bit(eeprom,data >> 31); | |
| 592 | eeprom_set_clock_line(eeprom,PULSE_LINE); | |
| 591 | eeprom->write_bit(data >> 31); | |
| 592 | eeprom->set_clock_line(PULSE_LINE); | |
| 593 | 593 | } |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | static READ32_HANDLER( jaguar_eeprom_clk ) |
| 597 | 597 | { |
| 598 | device_t *eeprom = space->machine().device("eeprom"); | |
| 599 | eeprom_set_clock_line(eeprom,PULSE_LINE); /* get next bit when reading */ | |
| 598 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 599 | eeprom->set_clock_line(PULSE_LINE); /* get next bit when reading */ | |
| 600 | 600 | return 0; |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | static READ32_HANDLER( jaguar_eeprom_cs ) |
| 604 | 604 | { |
| 605 | device_t *eeprom = space->machine().device("eeprom"); | |
| 606 | eeprom_set_cs_line(eeprom,ASSERT_LINE); /* must do at end of an operation */ | |
| 607 | eeprom_set_cs_line(eeprom,CLEAR_LINE); /* enable chip for next operation */ | |
| 608 | eeprom_write_bit(eeprom,1); /* write a start bit */ | |
| 609 | eeprom_set_clock_line(eeprom,PULSE_LINE); | |
| 605 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 606 | eeprom->set_cs_line(ASSERT_LINE); /* must do at end of an operation */ | |
| 607 | eeprom->set_cs_line(CLEAR_LINE); /* enable chip for next operation */ | |
| 608 | eeprom->write_bit(1); /* write a start bit */ | |
| 609 | eeprom->set_clock_line(PULSE_LINE); | |
| 610 | 610 | eeprom_bit_count = 0; |
| 611 | 611 | return 0; |
| 612 | 612 | } |
| r11517 | r11518 | |
| 769 | 769 | } |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | joystick_result |= | |
| 772 | joystick_result |= | |
| 773 | 773 | joybuts_result |= (input_port_read(space->machine(), "CONFIG") & 0x10); |
| 774 | 774 | |
| 775 | 775 | return (joystick_result << 16) | joybuts_result; |
| r11517 | r11518 | |
|---|---|---|
| 1393 | 1393 | int res; |
| 1394 | 1394 | |
| 1395 | 1395 | /* bit 3 is EEPROM data */ |
| 1396 | res = eeprom_ | |
| 1396 | res = downcast<eeprom_ | |
| 1397 | 1397 | return res; |
| 1398 | 1398 | } |
| 1399 | 1399 | |
| r11517 | r11518 | |
| 1402 | 1402 | /* bit 4 is data */ |
| 1403 | 1403 | /* bit 2 is clock */ |
| 1404 | 1404 | /* bit 5 is cs */ |
| 1405 | eeprom_write_bit(device, data & 0x8); | |
| 1406 | eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 1407 | eeprom_set_clock_line(device, (data & 0x4) ? ASSERT_LINE : CLEAR_LINE); | |
| 1405 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1406 | eeprom->write_bit(data & 0x8); | |
| 1407 | eeprom->set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 1408 | eeprom->set_clock_line((data & 0x4) ? ASSERT_LINE : CLEAR_LINE); | |
| 1408 | 1409 | } |
| 1409 | 1410 | |
| 1410 | 1411 | /* Dreamcast MAP |
| r11517 | r11518 | |
| 1736 | 1737 | |
| 1737 | 1738 | static INPUT_PORTS_START( naomi_mie ) |
| 1738 | 1739 | PORT_START("MIE:3") |
| 1739 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("mie_eeprom", eeprom_write_bit) | |
| 1740 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("mie_eeprom", eeprom_set_cs_line) | |
| 1741 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("mie_eeprom", eeprom_set_clock_line) | |
| 1740 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, write_bit) | |
| 1741 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, set_cs_line) | |
| 1742 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, set_clock_line) | |
| 1742 | 1743 | |
| 1743 | 1744 | PORT_START("MIE:5") |
| 1744 | 1745 | PORT_DIPNAME( 0x01, 0x00, "Monitor" ) PORT_DIPLOCATION("SW1:1") |
| r11517 | r11518 | |
| 1756 | 1757 | PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW ) |
| 1757 | 1758 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1758 | 1759 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1759 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("mie_eeprom", eeprom_read_bit) | |
| 1760 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, read_bit) | |
| 1760 | 1761 | INPUT_PORTS_END |
| 1761 | 1762 | |
| 1762 | 1763 | /* 2 players with 1 joystick and 6 buttons each */ |
| r11517 | r11518 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | static INPUT_CHANGED( coin_inserted ) |
| 16 | 16 | { |
| 17 | cheekyms_state *state = field | |
| 17 | cheekyms_state *state = field. | |
| 18 | 18 | |
| 19 | 19 | /* this starts a 556 one-shot timer (and triggers a sound effect) */ |
| 20 | 20 | if (newval) |
| r11517 | r11518 | |
|---|---|---|
| 308 | 308 | |
| 309 | 309 | static CUSTOM_INPUT( clock_r ) |
| 310 | 310 | { |
| 311 | return (field | |
| 311 | return (field. | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static INPUT_PORTS_START( asteroid ) |
| r11517 | r11518 | |
|---|---|---|
| 69 | 69 | static READ16_DEVICE_HANDLER( eeprom_r ) |
| 70 | 70 | { |
| 71 | 71 | if(offset) |
| 72 | return eeprom_read_bit(device); | |
| 72 | { | |
| 73 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 74 | return eeprom->read_bit(); | |
| 75 | } | |
| 73 | 76 | else |
| 74 | 77 | return 0; |
| 75 | 78 | } |
| 76 | 79 | |
| 77 | 80 | static READ32_DEVICE_HANDLER( eeprom32_r ) |
| 78 | 81 | { |
| 79 | return eeprom_read_bit(device); | |
| 82 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 83 | return eeprom->read_bit(); | |
| 80 | 84 | } |
| 81 | 85 | |
| 82 | 86 | static WRITE16_DEVICE_HANDLER( eeprom_w ) |
| 83 | 87 | { |
| 84 | 88 | if(offset) |
| 85 | 89 | { |
| 86 | eeprom_write_bit(device, data & 0x01); | |
| 87 | eeprom_set_cs_line(device, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE ); | |
| 88 | eeprom_set_clock_line(device, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE ); | |
| 90 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 91 | eeprom->write_bit(data & 0x01); | |
| 92 | eeprom->set_cs_line((data & 0x04) ? CLEAR_LINE : ASSERT_LINE ); | |
| 93 | eeprom->set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE ); | |
| 89 | 94 | |
| 90 | 95 | // data & 8? |
| 91 | 96 | } |
| r11517 | r11518 | |
| 93 | 98 | |
| 94 | 99 | static WRITE32_DEVICE_HANDLER( eeprom32_w ) |
| 95 | 100 | { |
| 96 | eeprom_write_bit(device, data & 0x01); | |
| 97 | eeprom_set_cs_line(device, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE ); | |
| 98 | eeprom_set_clock_line(device, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE ); | |
| 101 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 102 | eeprom->write_bit(data & 0x01); | |
| 103 | eeprom->set_cs_line((data & 0x04) ? CLEAR_LINE : ASSERT_LINE ); | |
| 104 | eeprom->set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE ); | |
| 99 | 105 | } |
| 100 | 106 | |
| 101 | 107 | static WRITE32_DEVICE_HANDLER( finalgdr_eeprom_w ) |
| 102 | 108 | { |
| 103 | eeprom_write_bit(device, data & 0x4000); | |
| 104 | eeprom_set_cs_line(device, (data & 0x1000) ? CLEAR_LINE : ASSERT_LINE ); | |
| 105 | eeprom_set_clock_line(device, (data & 0x2000) ? ASSERT_LINE : CLEAR_LINE ); | |
| 109 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 110 | eeprom->write_bit(data & 0x4000); | |
| 111 | eeprom->set_cs_line((data & 0x1000) ? CLEAR_LINE : ASSERT_LINE ); | |
| 112 | eeprom->set_clock_line((data & 0x2000) ? ASSERT_LINE : CLEAR_LINE ); | |
| 106 | 113 | } |
| 107 | 114 | |
| 108 | 115 | static WRITE16_HANDLER( flipscreen_w ) |
| r11517 | r11518 | |
| 616 | 623 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 ) |
| 617 | 624 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 618 | 625 | PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 619 | PORT_BIT( 0x00000010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) // eeprom bit | |
| 626 | PORT_BIT( 0x00000010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // eeprom bit | |
| 620 | 627 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 621 | 628 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 622 | 629 | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 75 | 75 | |
| 76 | 76 | static CUSTOM_INPUT( subcpu_int_r ) |
| 77 | 77 | { |
| 78 | fromanc2_state *state = field | |
| 78 | fromanc2_state *state = field. | |
| 79 | 79 | return state->m_subcpu_int_flag & 0x01; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static CUSTOM_INPUT( sndcpu_nmi_r ) |
| 83 | 83 | { |
| 84 | fromanc2_state *state = field | |
| 84 | fromanc2_state *state = field. | |
| 85 | 85 | return state->m_sndcpu_nmi_flag & 0x01; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static CUSTOM_INPUT( subcpu_nmi_r ) |
| 89 | 89 | { |
| 90 | fromanc2_state *state = field | |
| 90 | fromanc2_state *state = field. | |
| 91 | 91 | return state->m_subcpu_nmi_flag & 0x01; |
| 92 | 92 | } |
| 93 | 93 | |
| r11517 | r11518 | |
| 328 | 328 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(subcpu_int_r, NULL) // SUBCPU INT FLAG |
| 329 | 329 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sndcpu_nmi_r, NULL) // SNDCPU NMI FLAG |
| 330 | 330 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(subcpu_nmi_r, NULL) // SUBCPU NMI FLAG |
| 331 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 331 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 332 | 332 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( "Service Mode (1P)" ) PORT_CODE(KEYCODE_F2) // TEST (1P) |
| 333 | 333 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( "Service Mode (2P)" ) PORT_CODE(KEYCODE_F2) // TEST (2P) |
| 334 | 334 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 411 | 411 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 412 | 412 | |
| 413 | 413 | PORT_START( "EEPROMOUT" ) |
| 414 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 415 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 416 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 414 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 415 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 416 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 417 | 417 | INPUT_PORTS_END |
| 418 | 418 | |
| 419 | 419 | #ifdef UNREFERENCED_CODE |
| r11517 | r11518 | |
| 421 | 421 | PORT_INCLUDE( fromanc2 ) |
| 422 | 422 | |
| 423 | 423 | PORT_MODIFY("EEPROMOUT") |
| 424 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 425 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 426 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 424 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 425 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 426 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 427 | 427 | INPUT_PORTS_END |
| 428 | 428 | #endif |
| 429 | 429 | |
| r11517 | r11518 | |
| 438 | 438 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 439 | 439 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sndcpu_nmi_r, NULL) // SNDCPU NMI FLAG |
| 440 | 440 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 441 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 441 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 442 | 442 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 443 | 443 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 444 | 444 | |
| 445 | 445 | PORT_MODIFY("EEPROMOUT") |
| 446 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 447 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 448 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 446 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 447 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 448 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 449 | 449 | INPUT_PORTS_END |
| 450 | 450 | |
| 451 | 451 |
| r11517 | r11518 | |
|---|---|---|
| 157 | 157 | static CUSTOM_INPUT( coin_counter_r ) |
| 158 | 158 | { |
| 159 | 159 | int coin = (FPTR)param; |
| 160 | UINT8 *coin_counter = field | |
| 160 | UINT8 *coin_counter = field. | |
| 161 | 161 | |
| 162 | 162 | /* return coin counter values */ |
| 163 | 163 | return coin_counter[coin] & 3; |
| r11517 | r11518 | |
| 167 | 167 | static INPUT_CHANGED( coin_changed_callback ) |
| 168 | 168 | { |
| 169 | 169 | int coin = (FPTR)param; |
| 170 | UINT8 *coin_counter = field | |
| 170 | UINT8 *coin_counter = field. | |
| 171 | 171 | |
| 172 | 172 | /* check for a 0 -> 1 transition */ |
| 173 | 173 | if (!oldval && newval && coin_counter[coin] < 3) |
| r11517 | r11518 | |
|---|---|---|
| 145 | 145 | |
| 146 | 146 | if (ACCESSING_BITS_0_7) |
| 147 | 147 | { |
| 148 | device_t *device = space->machine().device("eeprom"); | |
| 149 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 150 | eeprom_write_bit(device, data & 0x40); | |
| 151 | eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 148 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 149 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 150 | eeprom->write_bit(data & 0x40); | |
| 151 | eeprom->set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 152 | 152 | return; |
| 153 | 153 | } |
| 154 | 154 | |
| r11517 | r11518 | |
| 259 | 259 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 260 | 260 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 261 | 261 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 262 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* reserved for EEROM */ | |
| 262 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* reserved for EEROM */ | |
| 263 | 263 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("Seat Center") /* seat center (cockpit only) */ |
| 264 | 264 | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 265 | 265 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 276 | 276 | |
| 277 | 277 | static CUSTOM_INPUT( xain_vblank_r ) |
| 278 | 278 | { |
| 279 | xain_state *state = field | |
| 279 | xain_state *state = field. | |
| 280 | 280 | return state->m_vblank; |
| 281 | 281 | } |
| 282 | 282 | |
| r11517 | r11518 | |
| 368 | 368 | |
| 369 | 369 | static CUSTOM_INPUT( mcu_status_r ) |
| 370 | 370 | { |
| 371 | xain_state *state = field | |
| 371 | xain_state *state = field. | |
| 372 | 372 | UINT8 res = 0; |
| 373 | 373 | |
| 374 | if (field | |
| 374 | if (field. | |
| 375 | 375 | { |
| 376 | 376 | if (state->m_mcu_ready == 1) |
| 377 | 377 | res |= 0x01; |
| r11517 | r11518 | |
|---|---|---|
| 2354 | 2354 | |
| 2355 | 2355 | static CUSTOM_INPUT( moonwar_dial_r ) |
| 2356 | 2356 | { |
| 2357 | galaxian_state *state = field | |
| 2357 | galaxian_state *state = field. | |
| 2358 | 2358 | static const char *const dialname[2] = { "P1_DIAL", "P2_DIAL" }; |
| 2359 | 2359 | int p = (~state->m_moonwar_port_select >> 4) & 1; |
| 2360 | 2360 | |
| 2361 | 2361 | // see http://www.cityofberwyn.com/schematics/stern/MoonWar_opto.tiff for schematic |
| 2362 | 2362 | // I.e. a 74ls161 counts from 0 to 15 which is the absolute number of bars passed on the quadrature |
| 2363 | 2363 | |
| 2364 | signed char dialread = input_port_read(field | |
| 2364 | signed char dialread = input_port_read(field. | |
| 2365 | 2365 | |
| 2366 | 2366 | UINT8 ret; |
| 2367 | 2367 |
| r11517 | r11518 | |
|---|---|---|
| 265 | 265 | |
| 266 | 266 | static CUSTOM_INPUT( mainflag_r ) |
| 267 | 267 | { |
| 268 | firefox_state *state = field | |
| 268 | firefox_state *state = field. | |
| 269 | 269 | return state->m_main_to_sound_flag; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | static CUSTOM_INPUT( soundflag_r ) |
| 273 | 273 | { |
| 274 | firefox_state *state = field | |
| 274 | firefox_state *state = field. | |
| 275 | 275 | return state->m_sound_to_main_flag; |
| 276 | 276 | } |
| 277 | 277 |
| r11517 | r11518 | |
|---|---|---|
| 186 | 186 | PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 187 | 187 | PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 188 | 188 | PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 189 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 189 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 190 | 190 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) |
| 191 | 191 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) |
| 192 | 192 | PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 196 | 196 | PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 197 | 197 | |
| 198 | 198 | PORT_START( "EEPROMOUT" ) |
| 199 | PORT_BIT( 0x00000010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 200 | PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 201 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 199 | PORT_BIT( 0x00000010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 200 | PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 201 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 202 | 202 | INPUT_PORTS_END |
| 203 | 203 | |
| 204 | 204 | static INPUT_PORTS_START( wcvol95 ) |
| r11517 | r11518 | |
| 228 | 228 | PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */ |
| 229 | 229 | PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 230 | 230 | PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 231 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 231 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 232 | 232 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) |
| 233 | 233 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) |
| 234 | 234 | PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 238 | 238 | PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 239 | 239 | |
| 240 | 240 | PORT_START( "EEPROMOUT" ) |
| 241 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 242 | PORT_BIT( 0x00000002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 243 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 241 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 242 | PORT_BIT( 0x00000002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 243 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 244 | 244 | INPUT_PORTS_END |
| 245 | 245 | |
| 246 | 246 |
| r11517 | r11518 | |
|---|---|---|
| 608 | 608 | |
| 609 | 609 | static CUSTOM_INPUT( mcu_status_r ) |
| 610 | 610 | { |
| 611 | renegade_state *state = field | |
| 611 | renegade_state *state = field. | |
| 612 | 612 | UINT8 res = 0; |
| 613 | 613 | |
| 614 | 614 | if (state->m_mcu_sim == TRUE) |
| r11517 | r11518 | |
|---|---|---|
| 450 | 450 | |
| 451 | 451 | static CUSTOM_INPUT( get_vblank ) |
| 452 | 452 | { |
| 453 | missile_state *state = field->machine().driver_data<missile_state>(); | |
| 454 | int v = scanline_to_v(state, field->machine().primary_screen->vpos()); | |
| 453 | missile_state *state = field.machine().driver_data<missile_state>(); | |
| 454 | int v = scanline_to_v(state, field.machine().primary_screen->vpos()); | |
| 455 | 455 | return v < 24; |
| 456 | 456 | } |
| 457 | 457 |
| r11517 | r11518 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | static CUSTOM_INPUT( sound_check_r ) |
| 85 | 85 | { |
| 86 | jack_state *state = field | |
| 86 | jack_state *state = field. | |
| 87 | 87 | UINT8 ret = 0; |
| 88 | 88 | |
| 89 | if ((input_port_read(field | |
| 89 | if ((input_port_read(field. | |
| 90 | 90 | ret = 1; |
| 91 | 91 | |
| 92 | 92 | return ret; |
| r11517 | r11518 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | static CUSTOM_INPUT( input_port_4_f0_r ) |
| 195 | 195 | { |
| 196 | taitosj_state *state = field | |
| 196 | taitosj_state *state = field. | |
| 197 | 197 | return state->m_input_port_4_f0; |
| 198 | 198 | } |
| 199 | 199 | |
| r11517 | r11518 | |
| 282 | 282 | |
| 283 | 283 | static CUSTOM_INPUT( kikstart_gear_r ) |
| 284 | 284 | { |
| 285 | taitosj_state *state = field | |
| 285 | taitosj_state *state = field. | |
| 286 | 286 | const char *port_tag; |
| 287 | 287 | |
| 288 | 288 | int player = (int)(FPTR)param; |
| r11517 | r11518 | |
| 293 | 293 | port_tag = "GEARP2"; |
| 294 | 294 | |
| 295 | 295 | /* gear MUST be 1, 2 or 3 */ |
| 296 | if (input_port_read(field->machine(), port_tag) & 0x01) state->m_kikstart_gears[player] = 0x02; | |
| 297 | if (input_port_read(field->machine(), port_tag) & 0x02) state->m_kikstart_gears[player] = 0x03; | |
| 298 | if (input_port_read(field->machine(), port_tag) & 0x04) state->m_kikstart_gears[player] = 0x01; | |
| 296 | if (input_port_read(field.machine(), port_tag) & 0x01) state->m_kikstart_gears[player] = 0x02; | |
| 297 | if (input_port_read(field.machine(), port_tag) & 0x02) state->m_kikstart_gears[player] = 0x03; | |
| 298 | if (input_port_read(field.machine(), port_tag) & 0x04) state->m_kikstart_gears[player] = 0x01; | |
| 299 | 299 | |
| 300 | 300 | return state->m_kikstart_gears[player]; |
| 301 | 301 | } |
| r11517 | r11518 | |
|---|---|---|
| 345 | 345 | |
| 346 | 346 | static READ16_DEVICE_HANDLER( eeprom_r ) |
| 347 | 347 | { |
| 348 | return ((eeprom_read_bit(device) & 0x01) << 11); | |
| 348 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 349 | return ((eeprom->read_bit() & 0x01) << 11); | |
| 349 | 350 | } |
| 350 | 351 | |
| 351 | 352 | |
| r11517 | r11518 | |
| 353 | 354 | { |
| 354 | 355 | if ( ACCESSING_BITS_8_15 ) |
| 355 | 356 | { |
| 356 | eeprom_write_bit(device, data & 0x0800); | |
| 357 | eeprom_set_cs_line(device, (data & 0x0200) ? CLEAR_LINE : ASSERT_LINE ); | |
| 358 | eeprom_set_clock_line(device, (data & 0x0400) ? CLEAR_LINE: ASSERT_LINE ); | |
| 357 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 358 | eeprom->write_bit(data & 0x0800); | |
| 359 | eeprom->set_cs_line((data & 0x0200) ? CLEAR_LINE : ASSERT_LINE ); | |
| 360 | eeprom->set_clock_line((data & 0x0400) ? CLEAR_LINE: ASSERT_LINE ); | |
| 359 | 361 | } |
| 360 | 362 | } |
| 361 | 363 |
| r11517 | r11518 | |
|---|---|---|
| 306 | 306 | |
| 307 | 307 | static CUSTOM_INPUT( snk6502_music0_r ) |
| 308 | 308 | { |
| 309 | return (snk6502_music0_playing(field | |
| 309 | return (snk6502_music0_playing(field. | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | static CUSTOM_INPUT( sasuke_count_r ) |
| 313 | 313 | { |
| 314 | snk6502_state *state = field | |
| 314 | snk6502_state *state = field. | |
| 315 | 315 | |
| 316 | 316 | return (state->m_sasuke_counter >> 4); |
| 317 | 317 | } |
| r11517 | r11518 | |
|---|---|---|
| 256 | 256 | { |
| 257 | 257 | /* if we got a coin, set the IRQ on the main CPU */ |
| 258 | 258 | if (newval == 0) |
| 259 | cputag_set_input_line(field | |
| 259 | cputag_set_input_line(field. | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
| r11517 | r11518 | |
| 269 | 269 | |
| 270 | 270 | static CUSTOM_INPUT( firq_beam_r ) |
| 271 | 271 | { |
| 272 | exidy440_state *state = field | |
| 272 | exidy440_state *state = field. | |
| 273 | 273 | return state->m_firq_beam; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| 277 | 277 | static CUSTOM_INPUT( firq_vblank_r ) |
| 278 | 278 | { |
| 279 | exidy440_state *state = field | |
| 279 | exidy440_state *state = field. | |
| 280 | 280 | return state->m_firq_vblank; |
| 281 | 281 | } |
| 282 | 282 | |
| r11517 | r11518 | |
| 284 | 284 | static CUSTOM_INPUT( hitnmiss_button1_r ) |
| 285 | 285 | { |
| 286 | 286 | /* button 1 shows up in two bits */ |
| 287 | UINT32 button1 = input_port_read(field | |
| 287 | UINT32 button1 = input_port_read(field. | |
| 288 | 288 | return (button1 << 1) | button1; |
| 289 | 289 | } |
| 290 | 290 |
| r11517 | r11518 | |
|---|---|---|
| 228 | 228 | |
| 229 | 229 | static CUSTOM_INPUT( get_ttl74123_output ) |
| 230 | 230 | { |
| 231 | r2dtank_state *state = field | |
| 231 | r2dtank_state *state = field. | |
| 232 | 232 | return state->m_ttl74123_output; |
| 233 | 233 | } |
| 234 | 234 |
| r11517 | r11518 | |
|---|---|---|
| 730 | 730 | static CUSTOM_INPUT( wheelrun_wheel_r ) |
| 731 | 731 | { |
| 732 | 732 | int player = (FPTR)param; |
| 733 | int delta = input_port_read(field | |
| 733 | int delta = input_port_read(field. | |
| 734 | 734 | delta = (delta & 0x7f) - (delta & 0x80) + 4; |
| 735 | 735 | |
| 736 | 736 | if (delta > 7) delta = 7; |
| r11517 | r11518 | |
|---|---|---|
| 203 | 203 | if (ACCESSING_BITS_0_7) |
| 204 | 204 | { |
| 205 | 205 | // latch the bit |
| 206 | eeprom_write_bit(device, data & 0x04); | |
| 206 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 207 | eeprom->write_bit(data & 0x04); | |
| 207 | 208 | |
| 208 | 209 | // reset line asserted: reset. |
| 209 | eeprom | |
| 210 | eeprom->set_cs_line( | |
| 210 | 211 | |
| 211 | 212 | // clock line asserted: write latch or select next bit to read |
| 212 | eeprom | |
| 213 | eeprom->set_clock_line( | |
| 213 | 214 | } |
| 214 | 215 | } |
| 215 | 216 | |
| r11517 | r11518 | |
| 443 | 444 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 444 | 445 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 445 | 446 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 446 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) // EEPROM | |
| 447 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // EEPROM | |
| 447 | 448 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 448 | 449 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 449 | 450 | PORT_SERVICE_NO_TOGGLE( 0x0040, IP_ACTIVE_LOW ) |
| r11517 | r11518 | |
| 576 | 577 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 577 | 578 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 578 | 579 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 579 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 580 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 580 | 581 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 581 | 582 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 582 | 583 | PORT_SERVICE_NO_TOGGLE( 0x0040, IP_ACTIVE_LOW ) |
| r11517 | r11518 | |
|---|---|---|
| 261 | 261 | |
| 262 | 262 | static CUSTOM_INPUT( ticket_r ) |
| 263 | 263 | { |
| 264 | galaxi_state *state = field->machine().driver_data<galaxi_state>(); | |
| 265 | return state->m_ticket && !(field->machine().primary_screen->frame_number() % 10); | |
| 264 | galaxi_state *state = field.machine().driver_data<galaxi_state>(); | |
| 265 | return state->m_ticket && !(field.machine().primary_screen->frame_number() % 10); | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | static CUSTOM_INPUT( hopper_r ) |
| 269 | 269 | { |
| 270 | galaxi_state *state = field->machine().driver_data<galaxi_state>(); | |
| 271 | return state->m_hopper && !(field->machine().primary_screen->frame_number() % 10); | |
| 270 | galaxi_state *state = field.machine().driver_data<galaxi_state>(); | |
| 271 | return state->m_hopper && !(field.machine().primary_screen->frame_number() % 10); | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 |
| r11517 | r11518 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | static CUSTOM_INPUT(cubo_input) |
| 232 | 232 | { |
| 233 | cd32_state *state = field->machine().driver_data<cd32_state>(); | |
| 234 | return handle_joystick_potgor(field->machine(), state->m_potgo_value) >> 10; | |
| 233 | cd32_state *state = field.machine().driver_data<cd32_state>(); | |
| 234 | return handle_joystick_potgor(field.machine(), state->m_potgo_value) >> 10; | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | static INPUT_PORTS_START( cd32 ) |
| r11517 | r11518 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | static CUSTOM_INPUT( get_collision ) |
| 22 | 22 | { |
| 23 | ultratnk_state *state = field | |
| 23 | ultratnk_state *state = field. | |
| 24 | 24 | return state->m_collision[(FPTR) param]; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | static CUSTOM_INPUT( get_joystick ) |
| 29 | 29 | { |
| 30 | ultratnk_state *state = field->machine().driver_data<ultratnk_state>(); | |
| 31 | UINT8 joy = input_port_read(field->machine(), (const char *)param) & 3; | |
| 30 | ultratnk_state *state = field.machine().driver_data<ultratnk_state>(); | |
| 31 | UINT8 joy = input_port_read(field.machine(), (const char *)param) & 3; | |
| 32 | 32 | |
| 33 | 33 | if (joy == 1) |
| 34 | 34 | { |
| r11517 | r11518 | |
|---|---|---|
| 235 | 235 | { |
| 236 | 236 | if (ACCESSING_BITS_0_7) |
| 237 | 237 | { |
| 238 | eeprom_set_clock_line(device, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); | |
| 239 | eeprom_write_bit(device, data & 0x20); | |
| 240 | eeprom_set_cs_line(device, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 238 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 239 | eeprom->set_clock_line((data & 0x10) ? ASSERT_LINE : CLEAR_LINE); | |
| 240 | eeprom->write_bit(data & 0x20); | |
| 241 | eeprom->set_cs_line((data & 0x08) ? CLEAR_LINE : ASSERT_LINE); | |
| 241 | 242 | |
| 242 | 243 | if (data&0xc7) logerror("eeprom_w extra bits used %04x\n",data); |
| 243 | 244 | } |
| r11517 | r11518 | |
| 531 | 532 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 532 | 533 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 533 | 534 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 534 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 535 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 535 | 536 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 536 | 537 | PORT_DIPNAME( 0x0040, 0x0040, "Test Mode" ) |
| 537 | 538 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| r11517 | r11518 | |
| 570 | 571 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 571 | 572 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 572 | 573 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 573 | //PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 574 | //PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 574 | 575 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 575 | 576 | PORT_DIPNAME( 0x0040, 0x0040, "Test Mode" ) |
| 576 | 577 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| r11517 | r11518 | |
|---|---|---|
| 210 | 210 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) |
| 211 | 211 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START3 ) |
| 212 | 212 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START4 ) |
| 213 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 213 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 214 | 214 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SPECIAL ) // EEPROM ready (always 1) |
| 215 | 215 | PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW ) |
| 216 | 216 | |
| 217 | 217 | PORT_START( "EEPROMOUT" ) |
| 218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 219 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 220 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 219 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 220 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 221 | 221 | |
| 222 | 222 | PORT_START("SYSTEM") |
| 223 | 223 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r11517 | r11518 | |
|---|---|---|
| 673 | 673 | |
| 674 | 674 | if (which == 0) |
| 675 | 675 | { |
| 676 | eeprom_device *device = space->machine().device<eeprom_device>("eeprom"); | |
| 677 | eeprom_write_bit(device, data & 0x80); | |
| 678 | eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 679 | eeprom_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 676 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 677 | eeprom->write_bit(data & 0x80); | |
| 678 | eeprom->set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 679 | eeprom->set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 680 | 680 | } |
| 681 | 681 | /* coin_lockout_w(space->machine(), 1 + 2*which, data & 0x08); |
| 682 | 682 | coin_lockout_w(space->machine(), 0 + 2*which, data & 0x04);*/ |
| r11517 | r11518 | |
| 691 | 691 | else |
| 692 | 692 | { |
| 693 | 693 | /* multi-32 EEPROM access */ |
| 694 | eeprom_device *device = space->machine().device<eeprom_device>("eeprom"); | |
| 695 | eeprom_write_bit(device, data & 0x80); | |
| 696 | eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 697 | eeprom_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 694 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 695 | eeprom->write_bit(data & 0x80); | |
| 696 | eeprom->set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 697 | eeprom->set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 698 | 698 | } |
| 699 | 699 | break; |
| 700 | 700 | |
| r11517 | r11518 | |
| 1350 | 1350 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) /* sometimes mirrors SERVICE1 */ |
| 1351 | 1351 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE4 ) /* tends to also work as a test switch */ |
| 1352 | 1352 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1353 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1353 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1354 | 1354 | |
| 1355 | 1355 | PORT_START("PORTG_A") |
| 1356 | 1356 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 1385 | 1385 | |
| 1386 | 1386 | PORT_START("SERVICE34_B") |
| 1387 | 1387 | PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1388 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1388 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1389 | 1389 | |
| 1390 | 1390 | PORT_START("PORTG_B") |
| 1391 | 1391 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
|---|---|---|
| 90 | 90 | static INPUT_CHANGED( set_write_protect ) // run when RAM expansion write protect switch is changed |
| 91 | 91 | { |
| 92 | 92 | int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0; |
| 93 | address_space *space = field->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 94 | UINT8 *expram = ram_get_ptr(field->machine().device("ram_tag")); | |
| 93 | address_space *space = field.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 94 | UINT8 *expram = ram_get_ptr(field.machine().device("ram_tag")); | |
| 95 | 95 | |
| 96 | 96 | get_ram_expansion_settings(space, ram_expansion_installed, write_protect_on, expansion_ram_start, expansion_ram_end, shadow_ram_end); // passing by reference |
| 97 | 97 |
| r11517 | r11518 | |
|---|---|---|
| 323 | 323 | { |
| 324 | 324 | if (ACCESSING_BITS_24_31) |
| 325 | 325 | { |
| 326 | eeprom_write_bit(device, (data & 0x20000000) ? 1 : 0); | |
| 327 | eeprom_set_cs_line(device, (data & 0x80000000) ? CLEAR_LINE : ASSERT_LINE); | |
| 328 | eeprom_set_clock_line(device, (data & 0x40000000) ? ASSERT_LINE : CLEAR_LINE); | |
| 326 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 327 | eeprom->write_bit((data & 0x20000000) ? 1 : 0); | |
| 328 | eeprom->set_cs_line((data & 0x80000000) ? CLEAR_LINE : ASSERT_LINE); | |
| 329 | eeprom->set_clock_line((data & 0x40000000) ? ASSERT_LINE : CLEAR_LINE); | |
| 329 | 330 | |
| 330 | 331 | return; |
| 331 | 332 | } |
| r11517 | r11518 | |
| 621 | 622 | PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) ) |
| 622 | 623 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 623 | 624 | PORT_DIPSETTING( 0x01000000, DEF_STR( World ) ) |
| 624 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 625 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 625 | 626 | INPUT_PORTS_END |
| 626 | 627 | |
| 627 | 628 | static INPUT_PORTS_START( soldivid ) |
| r11517 | r11518 | |
| 631 | 632 | PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) ) |
| 632 | 633 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 633 | 634 | PORT_DIPSETTING( 0x01000000, DEF_STR( World ) ) |
| 634 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 635 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 635 | 636 | INPUT_PORTS_END |
| 636 | 637 | |
| 637 | 638 | static INPUT_PORTS_START( daraku ) |
| r11517 | r11518 | |
| 649 | 650 | PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) ) |
| 650 | 651 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 651 | 652 | PORT_DIPSETTING( 0x01000000, DEF_STR( World ) ) /* Title screen is different, English is default now */ |
| 652 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 653 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 653 | 654 | INPUT_PORTS_END |
| 654 | 655 | |
| 655 | 656 | static INPUT_PORTS_START( sbomberb ) |
| r11517 | r11518 | |
| 664 | 665 | PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) ) |
| 665 | 666 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 666 | 667 | PORT_DIPSETTING( 0x01000000, DEF_STR( World ) ) |
| 667 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 668 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 668 | 669 | INPUT_PORTS_END |
| 669 | 670 | |
| 670 | 671 | static INPUT_PORTS_START( gunbird2 ) /* Different Region */ |
| r11517 | r11518 | |
| 676 | 677 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 677 | 678 | PORT_DIPSETTING( 0x01000000, "International Ver A." ) |
| 678 | 679 | PORT_DIPSETTING( 0x02000000, "International Ver B." ) |
| 679 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 680 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 680 | 681 | INPUT_PORTS_END |
| 681 | 682 | |
| 682 | 683 | static INPUT_PORTS_START( s1945iii ) /* Different Region again */ |
| r11517 | r11518 | |
| 688 | 689 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 689 | 690 | PORT_DIPSETTING( 0x02000000, "International Ver A." ) |
| 690 | 691 | PORT_DIPSETTING( 0x01000000, "International Ver B." ) |
| 691 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 692 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 692 | 693 | INPUT_PORTS_END |
| 693 | 694 | |
| 694 | 695 | static INPUT_PORTS_START( dragnblz ) /* Security requires bit high */ |
| r11517 | r11518 | |
| 704 | 705 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 705 | 706 | PORT_DIPSETTING( 0x02000000, "International Ver A." ) |
| 706 | 707 | PORT_DIPSETTING( 0x01000000, "International Ver B." ) |
| 707 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 708 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 708 | 709 | INPUT_PORTS_END |
| 709 | 710 | |
| 710 | 711 | static INPUT_PORTS_START( gnbarich ) /* Same as S1945iii except only one button */ |
| r11517 | r11518 | |
| 716 | 717 | PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 717 | 718 | PORT_DIPSETTING( 0x02000000, "International Ver A." ) |
| 718 | 719 | PORT_DIPSETTING( 0x01000000, "International Ver B." ) |
| 719 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 720 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 720 | 721 | INPUT_PORTS_END |
| 721 | 722 | |
| 722 | 723 | static INPUT_PORTS_START( tgm2 ) |
| r11517 | r11518 | |
| 728 | 729 | // PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 729 | 730 | // PORT_DIPSETTING( 0x02000000, "International Ver A." ) |
| 730 | 731 | // PORT_DIPSETTING( 0x01000000, "International Ver B." ) |
| 731 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 732 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 732 | 733 | INPUT_PORTS_END |
| 733 | 734 | |
| 734 | 735 | static INPUT_PORTS_START( mjgtaste ) |
| r11517 | r11518 | |
| 782 | 783 | // PORT_DIPSETTING( 0x00000000, DEF_STR( Japan ) ) |
| 783 | 784 | // PORT_DIPSETTING( 0x02000000, "International Ver A." ) |
| 784 | 785 | // PORT_DIPSETTING( 0x01000000, "International Ver B." ) |
| 785 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 786 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 786 | 787 | INPUT_PORTS_END |
| 787 | 788 | |
| 788 | 789 |
| r11517 | r11518 | |
|---|---|---|
| 275 | 275 | |
| 276 | 276 | static INPUT_CHANGED( spaceint_coin_inserted ) |
| 277 | 277 | { |
| 278 | astinvad_state *state = field | |
| 278 | astinvad_state *state = field. | |
| 279 | 279 | /* coin insertion causes an NMI */ |
| 280 | 280 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); |
| 281 | 281 | } |
| r11517 | r11518 | |
|---|---|---|
| 428 | 428 | |
| 429 | 429 | static CUSTOM_INPUT( multiplexed_controller_r ) |
| 430 | 430 | { |
| 431 | neogeo_state *state = field | |
| 431 | neogeo_state *state = field. | |
| 432 | 432 | int port = (FPTR)param; |
| 433 | 433 | |
| 434 | 434 | static const char *const cntrl[2][2] = |
| r11517 | r11518 | |
| 436 | 436 | { "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" } |
| 437 | 437 | }; |
| 438 | 438 | |
| 439 | return input_port_read_safe(field | |
| 439 | return input_port_read_safe(field. | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| 443 | 443 | static CUSTOM_INPUT( mahjong_controller_r ) |
| 444 | 444 | { |
| 445 | neogeo_state *state = field | |
| 445 | neogeo_state *state = field. | |
| 446 | 446 | UINT32 ret; |
| 447 | 447 | |
| 448 | 448 | /* |
| r11517 | r11518 | |
| 456 | 456 | { |
| 457 | 457 | default: |
| 458 | 458 | case 0x00: ret = 0x0000; break; /* nothing? */ |
| 459 | case 0x09: ret = input_port_read(field->machine(), "MAHJONG1"); break; | |
| 460 | case 0x12: ret = input_port_read(field->machine(), "MAHJONG2"); break; | |
| 461 | case 0x1b: ret = input_port_read(field->machine(), "MAHJONG3"); break; /* player 1 normal inputs? */ | |
| 462 | case 0x24: ret = input_port_read(field->machine(), "MAHJONG4"); break; | |
| 459 | case 0x09: ret = input_port_read(field.machine(), "MAHJONG1"); break; | |
| 460 | case 0x12: ret = input_port_read(field.machine(), "MAHJONG2"); break; | |
| 461 | case 0x1b: ret = input_port_read(field.machine(), "MAHJONG3"); break; /* player 1 normal inputs? */ | |
| 462 | case 0x24: ret = input_port_read(field.machine(), "MAHJONG4"); break; | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | return ret; |
| r11517 | r11518 | |
| 525 | 525 | |
| 526 | 526 | static CUSTOM_INPUT( get_calendar_status ) |
| 527 | 527 | { |
| 528 | neogeo_state *state = field | |
| 528 | neogeo_state *state = field. | |
| 529 | 529 | return (upd4990a_databit_r(state->m_upd4990a, 0) << 1) | upd4990a_testbit_r(state->m_upd4990a, 0); |
| 530 | 530 | } |
| 531 | 531 | |
| r11517 | r11518 | |
| 567 | 567 | { |
| 568 | 568 | /* D0 and D1 are memcard presence indicators, D2 indicates memcard |
| 569 | 569 | write protect status (we are always write enabled) */ |
| 570 | return (memcard_present(field | |
| 570 | return (memcard_present(field. | |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | |
| r11517 | r11518 | |
| 663 | 663 | |
| 664 | 664 | static CUSTOM_INPUT( get_audio_result ) |
| 665 | 665 | { |
| 666 | neogeo_state *state = field | |
| 666 | neogeo_state *state = field. | |
| 667 | 667 | UINT32 ret = state->m_audio_result; |
| 668 | 668 | |
| 669 | // if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field | |
| 669 | // if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field. | |
| 670 | 670 | |
| 671 | 671 | return ret; |
| 672 | 672 | } |
| r11517 | r11518 | |
|---|---|---|
| 244 | 244 | |
| 245 | 245 | static CUSTOM_INPUT( latched_coin_r ) |
| 246 | 246 | { |
| 247 | statriv2_state *state = field | |
| 247 | statriv2_state *state = field. | |
| 248 | 248 | return state->m_latched_coin; |
| 249 | 249 | } |
| 250 | 250 |
| r11517 | r11518 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | static INPUT_CHANGED( coin1_inserted ) |
| 191 | 191 | { |
| 192 | ladybug_state *state = field | |
| 192 | ladybug_state *state = field. | |
| 193 | 193 | |
| 194 | 194 | /* left coin insertion causes an NMI */ |
| 195 | 195 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); |
| r11517 | r11518 | |
| 197 | 197 | |
| 198 | 198 | static INPUT_CHANGED( coin2_inserted ) |
| 199 | 199 | { |
| 200 | ladybug_state *state = field | |
| 200 | ladybug_state *state = field. | |
| 201 | 201 | |
| 202 | 202 | /* right coin insertion causes an IRQ */ |
| 203 | 203 | if (newval) |
| r11517 | r11518 | |
| 210 | 210 | |
| 211 | 211 | static CUSTOM_INPUT( ladybug_p1_control_r ) |
| 212 | 212 | { |
| 213 | return input_port_read(field | |
| 213 | return input_port_read(field. | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | static CUSTOM_INPUT( ladybug_p2_control_r ) |
| r11517 | r11518 | |
| 218 | 218 | UINT32 ret; |
| 219 | 219 | |
| 220 | 220 | /* upright cabinet only uses a single set of controls */ |
| 221 | if (input_port_read(field->machine(), "DSW0") & 0x20) | |
| 222 | ret = input_port_read(field->machine(), LADYBUG_P2_CONTROL_PORT_TAG); | |
| 221 | if (input_port_read(field.machine(), "DSW0") & 0x20) | |
| 222 | ret = input_port_read(field.machine(), LADYBUG_P2_CONTROL_PORT_TAG); | |
| 223 | 223 | else |
| 224 | ret = input_port_read(field | |
| 224 | ret = input_port_read(field. | |
| 225 | 225 | |
| 226 | 226 | return ret; |
| 227 | 227 | } |
| r11517 | r11518 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | static CUSTOM_INPUT( starshp1_analog_r ) |
| 69 | 69 | { |
| 70 | starshp1_state *state = field | |
| 70 | starshp1_state *state = field. | |
| 71 | 71 | int val = 0; |
| 72 | 72 | |
| 73 | 73 | switch (state->m_analog_in_select) |
| 74 | 74 | { |
| 75 | 75 | case 0: |
| 76 | val = input_port_read(field | |
| 76 | val = input_port_read(field. | |
| 77 | 77 | break; |
| 78 | 78 | case 1: |
| 79 | val = input_port_read(field | |
| 79 | val = input_port_read(field. | |
| 80 | 80 | break; |
| 81 | 81 | case 2: |
| 82 | 82 | val = 0x20; /* DAC feedback, not used */ |
| 83 | 83 | break; |
| 84 | 84 | case 3: |
| 85 | val = input_port_read(field | |
| 85 | val = input_port_read(field. | |
| 86 | 86 | break; |
| 87 | 87 | } |
| 88 | 88 | |
| r11517 | r11518 | |
| 92 | 92 | |
| 93 | 93 | static CUSTOM_INPUT( collision_latch_r ) |
| 94 | 94 | { |
| 95 | starshp1_state *state = field | |
| 95 | starshp1_state *state = field. | |
| 96 | 96 | return state->m_collision_latch & 0x0f; |
| 97 | 97 | } |
| 98 | 98 |
| r11517 | r11518 | |
|---|---|---|
| 295 | 295 | |
| 296 | 296 | static CUSTOM_INPUT( analog_delta_r ) |
| 297 | 297 | { |
| 298 | gottlieb_state *state = field | |
| 298 | gottlieb_state *state = field. | |
| 299 | 299 | const char *string = (const char *)param; |
| 300 | 300 | int which = string[0] - '0'; |
| 301 | 301 | |
| 302 | return input_port_read(field | |
| 302 | return input_port_read(field. | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| r11517 | r11518 | |
| 314 | 314 | |
| 315 | 315 | static CUSTOM_INPUT( stooges_joystick_r ) |
| 316 | 316 | { |
| 317 | gottlieb_state *state = field | |
| 317 | gottlieb_state *state = field. | |
| 318 | 318 | static const char *const joyport[] = { "P2JOY", "P3JOY", "P1JOY", NULL }; |
| 319 | return (joyport[state->m_joystick_select & 3] != NULL) ? input_port_read(field | |
| 319 | return (joyport[state->m_joystick_select & 3] != NULL) ? input_port_read(field. | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 |
| r11517 | r11518 | |
|---|---|---|
| 357 | 357 | |
| 358 | 358 | static CUSTOM_INPUT( sub_cpu_busy ) |
| 359 | 359 | { |
| 360 | ddragon_state *state = field | |
| 360 | ddragon_state *state = field. | |
| 361 | 361 | return state->m_dd_sub_cpu_busy; |
| 362 | 362 | } |
| 363 | 363 |
| r11517 | r11518 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | PORT_START("IN1") |
| 220 | 220 | KONAMI16_LSB(2, IPT_UNKNOWN, IPT_START2) |
| 221 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 221 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 222 | 222 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) // EEPROM ready (always 1) |
| 223 | 223 | PORT_SERVICE_NO_TOGGLE(0x0400, IP_ACTIVE_LOW ) |
| 224 | 224 | PORT_BIT( 0xf800, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 225 | 225 | |
| 226 | 226 | PORT_START( "EEPROMOUT" ) |
| 227 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 228 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 229 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 227 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 228 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 229 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 230 | 230 | INPUT_PORTS_END |
| 231 | 231 | |
| 232 | 232 |
| r11517 | r11518 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | static CUSTOM_INPUT( xxmissio_status_r ) |
| 23 | 23 | { |
| 24 | xxmissio_state *state = field | |
| 24 | xxmissio_state *state = field. | |
| 25 | 25 | int bit_mask = (FPTR)param; |
| 26 | 26 | return (state->m_status & bit_mask) ? 1 : 0; |
| 27 | 27 | } |
| r11517 | r11518 | |
|---|---|---|
| 386 | 386 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 ) |
| 387 | 387 | |
| 388 | 388 | PORT_START("IN1") |
| 389 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 389 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 390 | 390 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 391 | 391 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 392 | 392 | PORT_SERVICE_NO_TOGGLE(0x08, IP_ACTIVE_LOW) |
| r11517 | r11518 | |
| 402 | 402 | PORT_DIPSETTING( 0x80, "4") |
| 403 | 403 | |
| 404 | 404 | PORT_START( "EEPROMOUT" ) |
| 405 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 406 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 407 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 405 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 406 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 407 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 408 | 408 | |
| 409 | 409 | PORT_START("P1_P3") |
| 410 | 410 | KONAMI16_LSB( 1, IPT_UNKNOWN, IPT_START1 ) |
| r11517 | r11518 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | static INPUT_PORTS_START( eolith16 ) |
| 90 | 90 | PORT_START("SPECIAL") |
| 91 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 91 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 92 | 92 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL) |
| 93 | 93 | PORT_BIT( 0xff6f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 94 | 94 | |
| r11517 | r11518 | |
| 111 | 111 | PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 112 | 112 | |
| 113 | 113 | PORT_START( "EEPROMOUT" ) |
| 114 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 115 | PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 116 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 114 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 115 | PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 116 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 117 | 117 | INPUT_PORTS_END |
| 118 | 118 | |
| 119 | 119 | static VIDEO_START( eolith16 ) |
| r11517 | r11518 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | static CUSTOM_INPUT( frame_counter_r ) |
| 128 | 128 | { |
| 129 | groundfx_state *state = field | |
| 129 | groundfx_state *state = field. | |
| 130 | 130 | return state->m_frame_counter; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static CUSTOM_INPUT( coin_word_r ) |
| 134 | 134 | { |
| 135 | groundfx_state *state = field | |
| 135 | groundfx_state *state = field. | |
| 136 | 136 | return state->m_coin_word; |
| 137 | 137 | } |
| 138 | 138 | |
| r11517 | r11518 | |
| 249 | 249 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 250 | 250 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 251 | 251 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 252 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 252 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 253 | 253 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* shift hi */ |
| 254 | 254 | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* brake */ |
| 255 | 255 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 261 | 261 | PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 262 | 262 | |
| 263 | 263 | PORT_START( "EEPROMOUT" ) |
| 264 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 265 | PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 266 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 264 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 265 | PORT_BIT( 0x00000020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 266 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 267 | 267 | |
| 268 | 268 | PORT_START("SYSTEM") |
| 269 | 269 | PORT_SERVICE_NO_TOGGLE( 0x00000001, IP_ACTIVE_LOW ) |
| r11517 | r11518 | |
|---|---|---|
| 289 | 289 | |
| 290 | 290 | static CUSTOM_INPUT( m92_sprite_busy_r ) |
| 291 | 291 | { |
| 292 | m92_state *state = field | |
| 292 | m92_state *state = field. | |
| 293 | 293 | return state->m_sprite_buffer_busy; |
| 294 | 294 | } |
| 295 | 295 |
| r11517 | r11518 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | static INPUT_CHANGED( coin_inserted ) |
| 38 | 38 | { |
| 39 | fcombat_state *state = field | |
| 39 | fcombat_state *state = field. | |
| 40 | 40 | |
| 41 | 41 | /* coin insertion causes an NMI */ |
| 42 | 42 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| r11517 | r11518 | |
|---|---|---|
| 181 | 181 | static CUSTOM_INPUT( dsw_3f_r ) |
| 182 | 182 | { |
| 183 | 183 | const char *tag = (const char *)param; |
| 184 | return input_port_read(field | |
| 184 | return input_port_read(field. | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | static CUSTOM_INPUT( dsw_c0_r ) |
| 188 | 188 | { |
| 189 | 189 | const char *tag = (const char *)param; |
| 190 | return (input_port_read(field | |
| 190 | return (input_port_read(field. | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 |
| r11517 | r11518 | |
|---|---|---|
| 262 | 262 | |
| 263 | 263 | static CUSTOM_INPUT( multigam_inputs_r ) |
| 264 | 264 | { |
| 265 | multigam_state *state = field | |
| 265 | multigam_state *state = field. | |
| 266 | 266 | /* bit 0: serial input (dsw) |
| 267 | 267 | bit 1: coin */ |
| 268 | 268 | return (state->m_in_dsw >> state->m_in_dsw_shift++) & 0x01; |
| r11517 | r11518 | |
|---|---|---|
| 809 | 809 | { |
| 810 | 810 | case PXA255_GPLR0: |
| 811 | 811 | verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin-Level Register 0: %08x & %08x\n", gpio_regs->gplr0 | (1 << 1), mem_mask ); |
| 812 | return gpio_regs->gplr0 | (1 << 1) | ( | |
| 812 | return gpio_regs->gplr0 | (1 << 1) | ( | |
| 813 | 813 | case PXA255_GPLR1: |
| 814 | 814 | verboselog( space->machine(), 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 1: %08x & %08x\n", gpio_regs->gplr1, mem_mask ); |
| 815 | 815 | return 0xff9fffff; |
| r11517 | r11518 | |
| 931 | 931 | gpio_regs->gpsr0 |= data & gpio_regs->gpdr0; |
| 932 | 932 | if(data & 0x00000004) |
| 933 | 933 | { |
| 934 | eeprom | |
| 934 | state->m_eeprom->set_cs_line( | |
| 935 | 935 | } |
| 936 | 936 | if(data & 0x00000008) |
| 937 | 937 | { |
| 938 | eeprom | |
| 938 | state->m_eeprom->set_clock_line( | |
| 939 | 939 | } |
| 940 | 940 | if(data & 0x00000010) |
| 941 | 941 | { |
| 942 | eeprom | |
| 942 | state->m_eeprom->write_bit( | |
| 943 | 943 | } |
| 944 | 944 | break; |
| 945 | 945 | case PXA255_GPSR1: |
| r11517 | r11518 | |
| 955 | 955 | gpio_regs->gpsr0 &= ~(data & gpio_regs->gpdr0); |
| 956 | 956 | if(data & 0x00000004) |
| 957 | 957 | { |
| 958 | eeprom | |
| 958 | state->m_eeprom->set_cs_line( | |
| 959 | 959 | } |
| 960 | 960 | if(data & 0x00000008) |
| 961 | 961 | { |
| 962 | eeprom | |
| 962 | state->m_eeprom->set_clock_line( | |
| 963 | 963 | } |
| 964 | 964 | if(data & 0x00000010) |
| 965 | 965 | { |
| 966 | eeprom | |
| 966 | state->m_eeprom->write_bit( | |
| 967 | 967 | } |
| 968 | 968 | break; |
| 969 | 969 | case PXA255_GPCR1: |
| r11517 | r11518 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | static WRITE8_DEVICE_HANDLER( ppi0_portc_w ) |
| 75 | 75 | { |
| 76 | eeprom_write_bit(device, data & 0x04); | |
| 77 | eeprom_set_cs_line(device, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 78 | eeprom_set_clock_line(device, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 76 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 77 | eeprom->write_bit(data & 0x04); | |
| 78 | eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 79 | eeprom->set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 82 | static READ8_DEVICE_HANDLER( ppi0_portc_r ) |
| 82 | 83 | { |
| 83 | 84 | // popmessage("%s",device->machine().describe_context()); |
| 84 | return (~(eeprom_read_bit(device)<<1) & 2); | |
| 85 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 86 | return (~(eeprom->read_bit()<<1) & 2); | |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | 89 | static const ppi8255_interface ppi0intf = |
| r11517 | r11518 | |
|---|---|---|
| 594 | 594 | if (newval == 0) |
| 595 | 595 | { |
| 596 | 596 | UINT32 credit; |
| 597 | address_space *space = field | |
| 597 | address_space *space = field. | |
| 598 | 598 | |
| 599 | 599 | /* Get the current credit value and add the new coin value */ |
| 600 | 600 | credit = space->read_dword(0x8002c) + (UINT32)(FPTR)param; |
| r11517 | r11518 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | static CUSTOM_INPUT( sound_latch_state_r ) |
| 121 | 121 | { |
| 122 | dcheese_state *state = field | |
| 122 | dcheese_state *state = field. | |
| 123 | 123 | return state->m_soundlatch_full; |
| 124 | 124 | } |
| 125 | 125 | |
| r11517 | r11518 | |
| 261 | 261 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) /* says tilt */ |
| 262 | 262 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_TILT ) /* says test */ |
| 263 | 263 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 264 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 264 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 265 | 265 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 266 | 266 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* bump left */ |
| 267 | 267 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) /* bump right */ |
| r11517 | r11518 | |
| 299 | 299 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 300 | 300 | |
| 301 | 301 | PORT_START( "EEPROMOUT" ) |
| 302 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 303 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 304 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 302 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 303 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 304 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 305 | 305 | INPUT_PORTS_END |
| 306 | 306 | |
| 307 | 307 | |
| r11517 | r11518 | |
| 313 | 313 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 314 | 314 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_TILT ) |
| 315 | 315 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 316 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 316 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 317 | 317 | PORT_BIT( 0x1f00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 318 | 318 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* button */ |
| 319 | 319 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* ticket */ |
| r11517 | r11518 | |
| 347 | 347 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 348 | 348 | |
| 349 | 349 | PORT_START( "EEPROMOUT" ) |
| 350 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 351 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 352 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 350 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 351 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 352 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 353 | 353 | INPUT_PORTS_END |
| 354 | 354 | |
| 355 | 355 | |
| r11517 | r11518 | |
| 361 | 361 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) |
| 362 | 362 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_TILT ) |
| 363 | 363 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 364 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 364 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 365 | 365 | PORT_BIT( 0x1f00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 366 | 366 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_5_PAD) |
| 367 | 367 | PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 397 | 397 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 398 | 398 | |
| 399 | 399 | PORT_START( "EEPROMOUT" ) |
| 400 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 401 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 402 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 400 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 401 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 402 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 403 | 403 | INPUT_PORTS_END |
| 404 | 404 | |
| 405 | 405 |
| r11517 | r11518 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | static INPUT_CHANGED( coin_inserted ) |
| 94 | 94 | { |
| 95 | brkthru_state *state = field | |
| 95 | brkthru_state *state = field. | |
| 96 | 96 | /* coin insertion causes an IRQ */ |
| 97 | 97 | device_set_input_line(state->m_maincpu, 0, newval ? CLEAR_LINE : ASSERT_LINE); |
| 98 | 98 | } |
| r11517 | r11518 | |
|---|---|---|
| 97 | 97 | //bad ? |
| 98 | 98 | if( ACCESSING_BITS_0_7 ) |
| 99 | 99 | { |
| 100 | eeprom_write_bit(device, data & 0x04); | |
| 101 | eeprom_set_cs_line(device, (data & 0x01) ? CLEAR_LINE:ASSERT_LINE ); | |
| 100 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 101 | eeprom->write_bit(data & 0x04); | |
| 102 | eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE:ASSERT_LINE ); | |
| 102 | 103 | |
| 103 | eeprom | |
| 104 | eeprom->set_clock_line( | |
| 104 | 105 | } |
| 105 | 106 | } |
| 106 | 107 | |
| r11517 | r11518 | |
| 353 | 354 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) |
| 354 | 355 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 355 | 356 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 356 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 357 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 357 | 358 | |
| 358 | 359 | PORT_START("IN4") /* 16bit */ |
| 359 | 360 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) |
| r11517 | r11518 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | static CUSTOM_INPUT( get_vblank ) |
| 144 | 144 | { |
| 145 | cloud9_state *state = field->machine().driver_data<cloud9_state>(); | |
| 146 | int scanline = field->machine().primary_screen->vpos(); | |
| 145 | cloud9_state *state = field.machine().driver_data<cloud9_state>(); | |
| 146 | int scanline = field.machine().primary_screen->vpos(); | |
| 147 | 147 | return (~state->m_syncprom[scanline & 0xff] >> 1) & 1; |
| 148 | 148 | } |
| 149 | 149 |
| r11517 | r11518 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | static CUSTOM_INPUT( hi_bits_r ) |
| 148 | 148 | { |
| 149 | return input_port_read(field | |
| 149 | return input_port_read(field. | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 |
| r11517 | r11518 | |
|---|---|---|
| 260 | 260 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Coin Out") |
| 261 | 261 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") |
| 262 | 262 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Init SW") |
| 263 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 263 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 264 | 264 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 265 | 265 | |
| 266 | 266 | PORT_START("IN0") |
| r11517 | r11518 | |
| 314 | 314 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 315 | 315 | |
| 316 | 316 | PORT_START( "EEPROMOUT" ) |
| 317 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 318 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 319 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 317 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 318 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 319 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 320 | 320 | |
| 321 | 321 | /* Unused, on the PCB there's just one bank */ |
| 322 | 322 | PORT_START("DSW1") |
| r11517 | r11518 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | device_t *m_lscreen; |
| 47 | 47 | device_t *m_rscreen; |
| 48 | device | |
| 48 | eeprom_device | |
| 49 | 49 | |
| 50 | 50 | /* memory */ |
| 51 | 51 | UINT16 m_pf1_rowscroll[0x0800/2]; |
| r11517 | r11518 | |
| 144 | 144 | { |
| 145 | 145 | /* some kind of screen indicator? checked by backfirea set before it will boot */ |
| 146 | 146 | int backfire_screen = device->machine().rand() & 1; |
| 147 | return ((eeprom_read_bit(device) << 24) | input_port_read(device->machine(), "IN0") | |
| 147 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 148 | return ((eeprom->read_bit() << 24) | input_port_read(device->machine(), "IN0") | |
| 148 | 149 | | ((input_port_read(device->machine(), "IN2") & 0xbf) << 16) |
| 149 | 150 | | ((input_port_read(device->machine(), "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ; |
| 150 | 151 | } |
| r11517 | r11518 | |
| 154 | 155 | backfire_state *state = space->machine().driver_data<backfire_state>(); |
| 155 | 156 | |
| 156 | 157 | // logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space->device()), offset << 1, mem_mask); |
| 157 | return ( | |
| 158 | return ( | |
| 158 | 159 | } |
| 159 | 160 | |
| 160 | 161 | #ifdef UNUSED_FUNCTION |
| r11517 | r11518 | |
| 163 | 164 | backfire_state *state = space->machine().driver_data<backfire_state>(); |
| 164 | 165 | |
| 165 | 166 | // logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space->device()), offset << 1, mem_mask); |
| 166 | return ( | |
| 167 | return ( | |
| 167 | 168 | } |
| 168 | 169 | #endif |
| 169 | 170 | |
| r11517 | r11518 | |
| 173 | 174 | logerror("%s:write eprom %08x (%08x) %08x\n",device->machine().describe_context(),offset<<1,mem_mask,data); |
| 174 | 175 | if (ACCESSING_BITS_0_7) |
| 175 | 176 | { |
| 176 | eeprom_set_clock_line(device, BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); | |
| 177 | eeprom_write_bit(device, BIT(data, 0)); | |
| 178 | eeprom_set_cs_line(device, BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE); | |
| 177 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 178 | eeprom->set_clock_line(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); | |
| 179 | eeprom->write_bit(BIT(data, 0)); | |
| 180 | eeprom->set_cs_line(BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE); | |
| 179 | 181 | } |
| 180 | 182 | } |
| 181 | 183 | |
| r11517 | r11518 | |
| 447 | 449 | state->m_deco_tilegen2 = machine.device("tilegen2"); |
| 448 | 450 | state->m_lscreen = machine.device("lscreen"); |
| 449 | 451 | state->m_rscreen = machine.device("rscreen"); |
| 450 | state->m_eeprom = machine.device("eeprom"); | |
| 452 | state->m_eeprom = machine.device<eeprom_device>("eeprom"); | |
| 451 | 453 | } |
| 452 | 454 | |
| 453 | 455 | UINT16 backfire_pri_callback(UINT16 x) |
| r11517 | r11518 | |
|---|---|---|
| 133 | 133 | static CUSTOM_INPUT( exerion_controls_r ) |
| 134 | 134 | { |
| 135 | 135 | static const char *const inname[2] = { "P1", "P2" }; |
| 136 | exerion_state *state = field->machine().driver_data<exerion_state>(); | |
| 137 | return input_port_read(field->machine(), inname[state->m_cocktail_flip]) & 0x3f; | |
| 136 | exerion_state *state = field.machine().driver_data<exerion_state>(); | |
| 137 | return input_port_read(field.machine(), inname[state->m_cocktail_flip]) & 0x3f; | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | static INPUT_CHANGED( coin_inserted ) |
| 142 | 142 | { |
| 143 | exerion_state *state = field | |
| 143 | exerion_state *state = field. | |
| 144 | 144 | /* coin insertion causes an NMI */ |
| 145 | 145 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| 146 | 146 | } |
| r11517 | r11518 | |
|---|---|---|
| 368 | 368 | |
| 369 | 369 | PORT_START( "EEPROMIN" ) |
| 370 | 370 | PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 371 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 371 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 372 | 372 | |
| 373 | 373 | PORT_START( "EEPROMOUT" ) |
| 374 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 375 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 376 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 374 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 375 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 376 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 377 | 377 | INPUT_PORTS_END |
| 378 | 378 | |
| 379 | 379 | static INPUT_PORTS_START( showhanc ) |
| r11517 | r11518 | |
| 397 | 397 | |
| 398 | 398 | PORT_START( "EEPROMIN" ) |
| 399 | 399 | PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 400 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 400 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 401 | 401 | |
| 402 | 402 | PORT_START( "EEPROMOUT" ) |
| 403 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 404 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 405 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 403 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 404 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 405 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 406 | 406 | INPUT_PORTS_END |
| 407 | 407 | |
| 408 | 408 | static INPUT_PORTS_START( skilldrp ) |
| r11517 | r11518 | |
| 426 | 426 | |
| 427 | 427 | PORT_START( "EEPROMIN" ) |
| 428 | 428 | PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 429 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 429 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 430 | 430 | |
| 431 | 431 | PORT_START( "EEPROMOUT" ) |
| 432 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 433 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 434 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 432 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 433 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 434 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 435 | 435 | INPUT_PORTS_END |
| 436 | 436 | |
| 437 | 437 | /*************************************************************************** |
| r11517 | r11518 | |
|---|---|---|
| 84 | 84 | static INPUT_CHANGED( coin_inserted ) |
| 85 | 85 | { |
| 86 | 86 | if(newval != oldval) |
| 87 | cputag_set_input_line(field | |
| 87 | cputag_set_input_line(field. | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static INPUT_PORTS_START( tryout ) |
| r11517 | r11518 | |
|---|---|---|
| 277 | 277 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 278 | 278 | |
| 279 | 279 | PORT_START("DSW") |
| 280 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 280 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 281 | 281 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 282 | 282 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) |
| 283 | 283 | PORT_DIPNAME( 0x10, 0x00, "Monitors" ) |
| r11517 | r11518 | |
| 297 | 297 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 298 | 298 | |
| 299 | 299 | PORT_START( "EEPROMOUT" ) |
| 300 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 301 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 302 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 300 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 301 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 302 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 303 | 303 | |
| 304 | 304 | PORT_START("P1") |
| 305 | 305 | KONAMI8_B123_START(1) |
| r11517 | r11518 | |
|---|---|---|
| 332 | 332 | |
| 333 | 333 | static CUSTOM_INPUT( tempest_knob_r ) |
| 334 | 334 | { |
| 335 | tempest_state *state = field->machine().driver_data<tempest_state>(); | |
| 336 | return input_port_read(field->machine(), (state->m_player_select == 0) ? | |
| 335 | tempest_state *state = field.machine().driver_data<tempest_state>(); | |
| 336 | return input_port_read(field.machine(), (state->m_player_select == 0) ? | |
| 337 | 337 | TEMPEST_KNOB_P1_TAG : TEMPEST_KNOB_P2_TAG); |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | static CUSTOM_INPUT( tempest_buttons_r ) |
| 341 | 341 | { |
| 342 | tempest_state *state = field->machine().driver_data<tempest_state>(); | |
| 343 | return input_port_read(field->machine(), (state->m_player_select == 0) ? | |
| 342 | tempest_state *state = field.machine().driver_data<tempest_state>(); | |
| 343 | return input_port_read(field.machine(), (state->m_player_select == 0) ? | |
| 344 | 344 | TEMPEST_BUTTONS_P1_TAG : TEMPEST_BUTTONS_P2_TAG); |
| 345 | 345 | } |
| 346 | 346 | |
| r11517 | r11518 | |
| 348 | 348 | static CUSTOM_INPUT( clock_r ) |
| 349 | 349 | { |
| 350 | 350 | /* Emulate the 3kHz source on bit 7 (divide 1.5MHz by 512) */ |
| 351 | return (field | |
| 351 | return (field. | |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 |
| r11517 | r11518 | |
|---|---|---|
| 83 | 83 | static CUSTOM_INPUT( analog_ctrl_r ) |
| 84 | 84 | { |
| 85 | 85 | const char *tag = (const char *)param; |
| 86 | return input_port_read(field | |
| 86 | return input_port_read(field. | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static WRITE32_HANDLER( int_ack_w ) |
| r11517 | r11518 | |
| 172 | 172 | PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_START2 ) |
| 173 | 173 | |
| 174 | 174 | PORT_START("SERVICE") |
| 175 | PORT_BIT( 0x02000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 175 | PORT_BIT( 0x02000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 176 | 176 | PORT_SERVICE_NO_TOGGLE( 0x08000000, IP_ACTIVE_LOW ) |
| 177 | 177 | |
| 178 | 178 | PORT_START( "EEPROMOUT" ) |
| 179 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 180 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 181 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 179 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 180 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 181 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 182 | 182 | |
| 183 | 183 | PORT_START("STICKX1") |
| 184 | 184 | PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_X ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(1) |
| r11517 | r11518 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | static CUSTOM_INPUT( narc_talkback_strobe_r ) |
| 154 | 154 | { |
| 155 | return (williams_narc_talkback_r(field | |
| 155 | return (williams_narc_talkback_r(field. | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | static CUSTOM_INPUT( narc_talkback_data_r ) |
| 160 | 160 | { |
| 161 | return williams_narc_talkback_r(field | |
| 161 | return williams_narc_talkback_r(field. | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | static CUSTOM_INPUT( adpcm_irq_state_r ) |
| 166 | 166 | { |
| 167 | return williams_adpcm_sound_irq_r(field | |
| 167 | return williams_adpcm_sound_irq_r(field. | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 |
| r11517 | r11518 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | static CUSTOM_INPUT( clock_r ) |
| 260 | 260 | { |
| 261 | return (field | |
| 261 | return (field. | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 |
| r11517 | r11518 | |
|---|---|---|
| 320 | 320 | static CUSTOM_INPUT( clock_r ) |
| 321 | 321 | { |
| 322 | 322 | /* 2.4kHz (divide 2.5MHz by 1024) */ |
| 323 | return (field | |
| 323 | return (field. | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 |
| r11517 | r11518 | |
|---|---|---|
| 175 | 175 | case 0xafe4: return input_port_read(space->machine(),"SERVICE2");//attract mode |
| 176 | 176 | // case 0xafe5: return 1; |
| 177 | 177 | // case 0xafe6: return 1; |
| 178 | case 0xafe7: return | |
| 178 | case 0xafe7: return | |
| 179 | 179 | case 0xaff8: return space->machine().device<okim6295_device>("oki")->read(*space,0); |
| 180 | 180 | } |
| 181 | 181 | } |
| r11517 | r11518 | |
| 188 | 188 | static WRITE8_DEVICE_HANDLER( eeprom_resetline_w ) |
| 189 | 189 | { |
| 190 | 190 | // reset line asserted: reset. |
| 191 | eeprom_set_cs_line(device, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE ); | |
| 191 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 192 | eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE ); | |
| 192 | 193 | } |
| 193 | 194 | |
| 194 | 195 | static WRITE8_DEVICE_HANDLER( eeprom_clockline_w ) |
| 195 | 196 | { |
| 196 | 197 | // clock line asserted: write latch or select next bit to read |
| 197 | eeprom_set_clock_line(device, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE ); | |
| 198 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 199 | eeprom->set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE ); | |
| 198 | 200 | } |
| 199 | 201 | |
| 200 | 202 | static WRITE8_DEVICE_HANDLER( eeprom_dataline_w ) |
| 201 | 203 | { |
| 202 | 204 | // latch the bit |
| 203 | eeprom_write_bit(device, data & 0x01); | |
| 205 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 206 | eeprom->write_bit(data & 0x01); | |
| 204 | 207 | } |
| 205 | 208 | |
| 206 | 209 | static ADDRESS_MAP_START( spool99_map, AS_PROGRAM, 8 ) |
| r11517 | r11518 | |
| 240 | 243 | case 0xa7a2: return input_port_read(space->machine(),"START"); |
| 241 | 244 | case 0xa7a3: return input_port_read(space->machine(),"BET");//system 2 |
| 242 | 245 | |
| 243 | case 0xa7a7: return | |
| 246 | case 0xa7a7: return | |
| 244 | 247 | |
| 245 | 248 | } |
| 246 | 249 | } |
| r11517 | r11518 | |
|---|---|---|
| 130 | 130 | static READ32_HANDLER( simpl156_inputs_read ) |
| 131 | 131 | { |
| 132 | 132 | simpl156_state *state = space->machine().driver_data<simpl156_state>(); |
| 133 | int eep = | |
| 133 | int eep = | |
| 134 | 134 | UINT32 returndata = input_port_read(space->machine(), "IN0") ^ 0xffff0000; |
| 135 | 135 | |
| 136 | 136 | returndata ^= ((eep << 8)); |
| r11517 | r11518 | |
| 176 | 176 | |
| 177 | 177 | state->m_okimusic->set_bank_base(0x40000 * (data & 0x7)); |
| 178 | 178 | |
| 179 | eeprom_set_clock_line(state->m_eeprom, BIT(data, 5) ? ASSERT_LINE : CLEAR_LINE); | |
| 180 | eeprom_write_bit(state->m_eeprom, BIT(data, 4)); | |
| 181 | eeprom_set_cs_line(state->m_eeprom, BIT(data, 6) ? CLEAR_LINE : ASSERT_LINE); | |
| 179 | state->m_eeprom->set_clock_line(BIT(data, 5) ? ASSERT_LINE : CLEAR_LINE); | |
| 180 | state->m_eeprom->write_bit(BIT(data, 4)); | |
| 181 | state->m_eeprom->set_cs_line(BIT(data, 6) ? CLEAR_LINE : ASSERT_LINE); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 |
| r11517 | r11518 | |
|---|---|---|
| 387 | 387 | |
| 388 | 388 | static CUSTOM_INPUT( prot_r ) |
| 389 | 389 | { |
| 390 | artmagic_state *state = field | |
| 390 | artmagic_state *state = field. | |
| 391 | 391 | return state->m_prot_output_bit; |
| 392 | 392 | } |
| 393 | 393 |
| r11517 | r11518 | |
|---|---|---|
| 378 | 378 | |
| 379 | 379 | static CUSTOM_INPUT( multfish_hopper_r ) |
| 380 | 380 | { |
| 381 | multfish_state *state = field | |
| 381 | multfish_state *state = field. | |
| 382 | 382 | |
| 383 | 383 | if ( state->m_hopper_motor != 0 ) |
| 384 | 384 | { |
| r11517 | r11518 | |
|---|---|---|
| 38 | 38 | static READ16_DEVICE_HANDLER(galpani2_eeprom_r) |
| 39 | 39 | { |
| 40 | 40 | galpani2_state *state = device->machine().driver_data<galpani2_state>(); |
| 41 | return (state->m_eeprom_word & ~1) | (eeprom_read_bit(device) & 1); | |
| 41 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 42 | return (state->m_eeprom_word & ~1) | (eeprom->read_bit() & 1); | |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | static WRITE16_DEVICE_HANDLER(galpani2_eeprom_w) |
| r11517 | r11518 | |
| 48 | 49 | if ( ACCESSING_BITS_0_7 ) |
| 49 | 50 | { |
| 50 | 51 | // latch the bit |
| 51 | eeprom_write_bit(device, data & 0x02); | |
| 52 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 53 | eeprom->write_bit(data & 0x02); | |
| 52 | 54 | |
| 53 | 55 | // reset line asserted: reset. |
| 54 | eeprom | |
| 56 | eeprom->set_cs_line( | |
| 55 | 57 | |
| 56 | 58 | // clock line asserted: write latch or select next bit to read |
| 57 | eeprom | |
| 59 | eeprom->set_clock_line( | |
| 58 | 60 | } |
| 59 | 61 | } |
| 60 | 62 |
| r11517 | r11518 | |
|---|---|---|
| 878 | 878 | // tile banks |
| 879 | 879 | if( ACCESSING_BITS_16_23 ) { |
| 880 | 880 | rf2_set_layer_banks(device->machine(), data >> 16); |
| 881 | eeprom_write_bit(device, (data & 0x800000) ? 1 : 0); | |
| 882 | eeprom_set_clock_line(device, (data & 0x400000) ? ASSERT_LINE : CLEAR_LINE); | |
| 883 | eeprom_set_cs_line(device, (data & 0x200000) ? CLEAR_LINE : ASSERT_LINE); | |
| 881 | ||
| 882 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 883 | eeprom->write_bit((data & 0x800000) ? 1 : 0); | |
| 884 | eeprom->set_clock_line((data & 0x400000) ? ASSERT_LINE : CLEAR_LINE); | |
| 885 | eeprom->set_cs_line((data & 0x200000) ? CLEAR_LINE : ASSERT_LINE); | |
| 884 | 886 | } |
| 885 | 887 | |
| 886 | 888 | // oki banking |
| r11517 | r11518 | |
| 936 | 938 | |
| 937 | 939 | static CUSTOM_INPUT( ejsakura_keyboard_r ) |
| 938 | 940 | { |
| 939 | seibuspi_state *state = field | |
| 941 | seibuspi_state *state = field. | |
| 940 | 942 | switch(state->m_ejsakura_input_port) |
| 941 | 943 | { |
| 942 | 944 | case 0x01: |
| 943 | return input_port_read(field | |
| 945 | return input_port_read(field. | |
| 944 | 946 | case 0x02: |
| 945 | return input_port_read(field | |
| 947 | return input_port_read(field. | |
| 946 | 948 | case 0x04: |
| 947 | return input_port_read(field | |
| 949 | return input_port_read(field. | |
| 948 | 950 | case 0x08: |
| 949 | return input_port_read(field | |
| 951 | return input_port_read(field. | |
| 950 | 952 | case 0x10: |
| 951 | return input_port_read(field | |
| 953 | return input_port_read(field. | |
| 952 | 954 | default: |
| 953 | return input_port_read(field | |
| 955 | return input_port_read(field. | |
| 954 | 956 | } |
| 955 | 957 | return 0xffffffff; |
| 956 | 958 | } |
| r11517 | r11518 | |
| 1113 | 1115 | |
| 1114 | 1116 | static WRITE32_DEVICE_HANDLER(sys386f2_eeprom_w) |
| 1115 | 1117 | { |
| 1116 | eeprom_write_bit(device, (data & 0x80) ? 1 : 0); | |
| 1117 | eeprom_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 1118 | eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 1118 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1119 | eeprom->write_bit((data & 0x80) ? 1 : 0); | |
| 1120 | eeprom->set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 1121 | eeprom->set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE); | |
| 1119 | 1122 | } |
| 1120 | 1123 | |
| 1121 | 1124 | static const ymf271_interface ymf271_config = |
| r11517 | r11518 | |
| 1204 | 1207 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 ) |
| 1205 | 1208 | PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW) /* Test Button */ |
| 1206 | 1209 | PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7) |
| 1207 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1210 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1208 | 1211 | PORT_BIT( 0x000000b0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1209 | 1212 | PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1210 | 1213 | |
| r11517 | r11518 | |
| 1256 | 1259 | PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7) |
| 1257 | 1260 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1258 | 1261 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1259 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1262 | PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1260 | 1263 | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1261 | 1264 | PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1262 | 1265 | |
| r11517 | r11518 | |
| 1295 | 1298 | static CUSTOM_INPUT( ejanhs_encode ) |
| 1296 | 1299 | { |
| 1297 | 1300 | static const UINT8 encoding[] = { 0x02, 0x10, 0x03, 0x18, 0x04, 0x20, 0x05, 0x28, 0x06, 0x30, 0x07 }; |
| 1298 | input_port_value state = input_port_read(field | |
| 1301 | input_port_value state = input_port_read(field. | |
| 1299 | 1302 | int bit; |
| 1300 | 1303 | |
| 1301 | 1304 | for (bit = 0; bit < ARRAY_LENGTH(encoding); bit++) |
| r11517 | r11518 | |
| 1405 | 1408 | PORT_START("SYSTEM") |
| 1406 | 1409 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1407 | 1410 | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 1408 | PORT_BIT( 0x00004000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1411 | PORT_BIT( 0x00004000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1409 | 1412 | PORT_BIT( 0xffffbf3f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1410 | 1413 | |
| 1411 | 1414 | INPUT_PORTS_END |
| r11517 | r11518 | |
|---|---|---|
| 428 | 428 | |
| 429 | 429 | static CUSTOM_INPUT( dakkochn_mux_data_r ) |
| 430 | 430 | { |
| 431 | system1_state *state = field | |
| 431 | system1_state *state = field. | |
| 432 | 432 | static const char *const ports[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" }; |
| 433 | return input_port_read(field | |
| 433 | return input_port_read(field. | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | |
| 437 | 437 | static CUSTOM_INPUT( dakkochn_mux_status_r ) |
| 438 | 438 | { |
| 439 | system1_state *state = field | |
| 439 | system1_state *state = field. | |
| 440 | 440 | /* reads from here indicate which mux port is selected */ |
| 441 | 441 | return 1 << (state->m_dakkochn_mux_data); |
| 442 | 442 | } |
| r11517 | r11518 | |
|---|---|---|
| 337 | 337 | |
| 338 | 338 | static CUSTOM_INPUT( musobana_outcoin_flag_r ) |
| 339 | 339 | { |
| 340 | niyanpai_state *state = field->machine().driver_data<niyanpai_state>(); | |
| 341 | address_space *space = field->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 340 | niyanpai_state *state = field.machine().driver_data<niyanpai_state>(); | |
| 341 | address_space *space = field.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 342 | 342 | // tmp68301_parallel_interface[0x05] |
| 343 | 343 | // bit 0 coin counter |
| 344 | 344 | // bit 2 motor on |
| r11517 | r11518 | |
|---|---|---|
| 491 | 491 | if (mem_mask == 0xff000000) |
| 492 | 492 | { |
| 493 | 493 | // latch the bit |
| 494 | eeprom_write_bit(device, data & 0x01000000); | |
| 494 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 495 | eeprom->write_bit(data & 0x01000000); | |
| 495 | 496 | |
| 496 | 497 | // reset line asserted: reset. |
| 497 | eeprom | |
| 498 | eeprom->set_cs_line( | |
| 498 | 499 | |
| 499 | 500 | // clock line asserted: write latch or select next bit to read |
| 500 | eeprom | |
| 501 | eeprom->set_clock_line( | |
| 501 | 502 | } |
| 502 | 503 | } |
| 503 | 504 | |
| r11517 | r11518 | |
| 528 | 529 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Right Screen Coin B") // might actually be service 1 |
| 529 | 530 | PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) |
| 530 | 531 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 531 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) // CHECK! | |
| 532 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // CHECK! | |
| 532 | 533 | |
| 533 | 534 | PORT_START("PL1_1") |
| 534 | 535 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(1) |
| r11517 | r11518 | |
|---|---|---|
| 438 | 438 | static CUSTOM_INPUT( paddle_r ) |
| 439 | 439 | { |
| 440 | 440 | const char *tag = (const char *)param; |
| 441 | return input_port_read(field | |
| 441 | return input_port_read(field. | |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | static INPUT_PORTS_START( skns ) /* 3 buttons, 2 players */ |
| r11517 | r11518 | |
|---|---|---|
| 386 | 386 | { |
| 387 | 387 | sigmab98_state *state = device->machine().driver_data<sigmab98_state>(); |
| 388 | 388 | // latch the bit |
| 389 | eeprom_write_bit(device, data & 0x40); | |
| 389 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 390 | eeprom->write_bit(data & 0x40); | |
| 390 | 391 | |
| 391 | 392 | // reset line asserted: reset. |
| 392 | 393 | // if ((state->m_c0 ^ data) & 0x20) |
| 393 | eeprom | |
| 394 | eeprom->set_cs_line( | |
| 394 | 395 | |
| 395 | 396 | // clock line asserted: write latch or select next bit to read |
| 396 | eeprom | |
| 397 | eeprom->set_clock_line( | |
| 397 | 398 | |
| 398 | 399 | state->m_c0 = data; |
| 399 | 400 | show_outputs(state); |
| r11517 | r11518 | |
| 591 | 592 | |
| 592 | 593 | static READ8_DEVICE_HANDLER( sammymdl_eeprom_r ) |
| 593 | 594 | { |
| 594 | return eeprom_read_bit(device) ? 0x80 : 0; | |
| 595 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 596 | return eeprom->read_bit() ? 0x80 : 0; | |
| 595 | 597 | } |
| 596 | 598 | |
| 597 | 599 | static WRITE8_DEVICE_HANDLER( sammymdl_eeprom_w ) |
| 598 | 600 | { |
| 599 | 601 | // latch the bit |
| 600 | eeprom_write_bit(device, data & 0x40); | |
| 602 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 603 | eeprom->write_bit(data & 0x40); | |
| 601 | 604 | |
| 602 | 605 | // reset line asserted: reset. |
| 603 | eeprom | |
| 606 | eeprom->set_cs_line( | |
| 604 | 607 | |
| 605 | 608 | // clock line asserted: write latch or select next bit to read |
| 606 | eeprom | |
| 609 | eeprom->set_clock_line( | |
| 607 | 610 | |
| 608 | 611 | if (data & 0x8f) |
| 609 | 612 | logerror("%s: unknown eeeprom bits written %02x\n", device->machine().describe_context(), data); |
| r11517 | r11518 | |
| 1484 | 1487 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1485 | 1488 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1486 | 1489 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1487 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1490 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1488 | 1491 | |
| 1489 | 1492 | PORT_START("IN1") |
| 1490 | 1493 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // ? (coin error, pulses mask 4 of port c6) |
| r11517 | r11518 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | static INPUT_CHANGED( coin_inserted ) |
| 109 | 109 | { |
| 110 | cputag_set_input_line(field | |
| 110 | cputag_set_input_line(field. | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | static INPUT_PORTS_START( shootout ) |
| r11517 | r11518 | |
|---|---|---|
| 466 | 466 | |
| 467 | 467 | static CUSTOM_INPUT( special_port_r ) |
| 468 | 468 | { |
| 469 | itech32_state *state = field | |
| 469 | itech32_state *state = field. | |
| 470 | 470 | if (state->m_sound_int_state) |
| 471 | 471 | state->m_special_result ^= 1; |
| 472 | 472 |
| r11517 | r11518 | |
|---|---|---|
| 253 | 253 | |
| 254 | 254 | static CUSTOM_INPUT(frame_counter_r) |
| 255 | 255 | { |
| 256 | undrfire_state *state = field | |
| 256 | undrfire_state *state = field. | |
| 257 | 257 | return state->m_frame_counter; |
| 258 | 258 | } |
| 259 | 259 | |
| r11517 | r11518 | |
| 290 | 290 | |
| 291 | 291 | if (ACCESSING_BITS_0_7) |
| 292 | 292 | { |
| 293 | device_t *device = space->machine().device("eeprom"); | |
| 294 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 295 | eeprom_write_bit(device, data & 0x40); | |
| 296 | eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 293 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 294 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 295 | eeprom->write_bit(data & 0x40); | |
| 296 | eeprom->set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 297 | 297 | return; |
| 298 | 298 | } |
| 299 | 299 | |
| r11517 | r11518 | |
| 524 | 524 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 525 | 525 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 526 | 526 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 527 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* reserved for EEROM */ | |
| 527 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* reserved for EEROM */ | |
| 528 | 528 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 529 | 529 | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 530 | 530 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 592 | 592 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 593 | 593 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 594 | 594 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 595 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* reserved for EEROM */ | |
| 595 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* reserved for EEROM */ | |
| 596 | 596 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 597 | 597 | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 598 | 598 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | static INPUT_CHANGED( coin_inserted ) |
| 106 | 106 | { |
| 107 | astrof_state *state = field | |
| 107 | astrof_state *state = field. | |
| 108 | 108 | |
| 109 | 109 | /* coin insertion causes an NMI */ |
| 110 | 110 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); |
| 111 | coin_counter_w(field | |
| 111 | coin_counter_w(field. | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | static INPUT_CHANGED( service_coin_inserted ) |
| 116 | 116 | { |
| 117 | astrof_state *state = field | |
| 117 | astrof_state *state = field. | |
| 118 | 118 | |
| 119 | 119 | /* service coin insertion causes an NMI */ |
| 120 | 120 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); |
| r11517 | r11518 | |
| 123 | 123 | |
| 124 | 124 | static CUSTOM_INPUT( astrof_p1_controls_r ) |
| 125 | 125 | { |
| 126 | return input_port_read(field | |
| 126 | return input_port_read(field. | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
| r11517 | r11518 | |
| 134 | 134 | /* on an upright cabinet, a single set of controls |
| 135 | 135 | is connected to both sets of pins on the edge |
| 136 | 136 | connector */ |
| 137 | if (input_port_read(field->machine(), "CAB")) | |
| 138 | ret = input_port_read(field->machine(), "P2"); | |
| 137 | if (input_port_read(field.machine(), "CAB")) | |
| 138 | ret = input_port_read(field.machine(), "P2"); | |
| 139 | 139 | else |
| 140 | ret = input_port_read(field | |
| 140 | ret = input_port_read(field. | |
| 141 | 141 | |
| 142 | 142 | return ret; |
| 143 | 143 | } |
| r11517 | r11518 | |
| 146 | 146 | static CUSTOM_INPUT( tomahawk_controls_r ) |
| 147 | 147 | { |
| 148 | 148 | UINT32 ret; |
| 149 | astrof_state *state = field | |
| 149 | astrof_state *state = field. | |
| 150 | 150 | |
| 151 | 151 | /* on a cocktail cabinet, two sets of controls are |
| 152 | 152 | multiplexed on a single set of inputs |
| 153 | 153 | (not verified on pcb) */ |
| 154 | 154 | |
| 155 | 155 | if (state->m_flipscreen) |
| 156 | ret = input_port_read(field | |
| 156 | ret = input_port_read(field. | |
| 157 | 157 | else |
| 158 | ret = input_port_read(field | |
| 158 | ret = input_port_read(field. | |
| 159 | 159 | |
| 160 | 160 | return ret; |
| 161 | 161 | } |
| r11517 | r11518 | |
|---|---|---|
| 416 | 416 | |
| 417 | 417 | static CUSTOM_INPUT( p1_controls_r ) |
| 418 | 418 | { |
| 419 | return input_port_read(field | |
| 419 | return input_port_read(field. | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | |
| 423 | 423 | static CUSTOM_INPUT( p2_controls_r ) |
| 424 | 424 | { |
| 425 | enigma2_state *state = field | |
| 425 | enigma2_state *state = field. | |
| 426 | 426 | if (state->m_flip_screen) |
| 427 | return input_port_read(field | |
| 427 | return input_port_read(field. | |
| 428 | 428 | else |
| 429 | return input_port_read(field | |
| 429 | return input_port_read(field. | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 |
| r11517 | r11518 | |
|---|---|---|
| 320 | 320 | |
| 321 | 321 | static CUSTOM_INPUT( hopper_r ) |
| 322 | 322 | { |
| 323 | igspoker_state *state = field->machine().driver_data<igspoker_state>(); | |
| 324 | if (state->m_hopper) return !(field->machine().primary_screen->frame_number()%10); | |
| 325 | return input_code_pressed(field->machine(), KEYCODE_H); | |
| 323 | igspoker_state *state = field.machine().driver_data<igspoker_state>(); | |
| 324 | if (state->m_hopper) return !(field.machine().primary_screen->frame_number()%10); | |
| 325 | return input_code_pressed(field.machine(), KEYCODE_H); | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | static READ8_HANDLER( exp_rom_r ) |
| r11517 | r11518 | |
|---|---|---|
| 322 | 322 | { |
| 323 | 323 | static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; |
| 324 | 324 | device_t *adc1038 = space->machine().device("adc1038"); |
| 325 | device | |
| 325 | eeprom_device | |
| 326 | 326 | |
| 327 | 327 | switch (offset) |
| 328 | 328 | { |
| r11517 | r11518 | |
| 342 | 342 | // a = ADC readout |
| 343 | 343 | // e = EEPROM data out |
| 344 | 344 | |
| 345 | UINT32 eeprom_bit = (eeprom | |
| 345 | UINT32 eeprom_bit = (eeprom->read_bit( | |
| 346 | 346 | UINT32 adc_bit = (adc1038_do_read(adc1038) << 2); |
| 347 | 347 | return (eeprom_bit | adc_bit); |
| 348 | 348 | } |
| r11517 | r11518 | |
| 357 | 357 | static WRITE8_HANDLER( sysreg_w ) |
| 358 | 358 | { |
| 359 | 359 | device_t *adc1038 = space->machine().device("adc1038"); |
| 360 | device | |
| 360 | eeprom_device | |
| 361 | 361 | |
| 362 | 362 | switch (offset) |
| 363 | 363 | { |
| r11517 | r11518 | |
| 367 | 367 | break; |
| 368 | 368 | |
| 369 | 369 | case 3: |
| 370 | eeprom_write_bit(eeprom, (data & 0x01) ? 1 : 0); | |
| 371 | eeprom_set_clock_line(eeprom, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 372 | eeprom_set_cs_line(eeprom, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 370 | eeprom->write_bit((data & 0x01) ? 1 : 0); | |
| 371 | eeprom->set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 372 | eeprom->set_cs_line((data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 373 | 373 | break; |
| 374 | 374 | |
| 375 | 375 | case 4: |
| r11517 | r11518 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | static INPUT_CHANGED( mcu_input ) |
| 83 | 83 | { |
| 84 | cdi_state *state = field | |
| 84 | cdi_state *state = field. | |
| 85 | 85 | scc68070_regs_t *scc68070 = &state->m_scc68070_regs; |
| 86 | 86 | bool send = false; |
| 87 | 87 | |
| 88 | 88 | switch((FPTR)param) |
| 89 | 89 | { |
| 90 | 90 | case 0x39: |
| 91 | if(input_port_read(field | |
| 91 | if(input_port_read(field. | |
| 92 | 92 | break; |
| 93 | 93 | case 0x37: |
| 94 | if(input_port_read(field | |
| 94 | if(input_port_read(field. | |
| 95 | 95 | break; |
| 96 | 96 | case 0x31: |
| 97 | if(input_port_read(field | |
| 97 | if(input_port_read(field. | |
| 98 | 98 | break; |
| 99 | 99 | case 0x32: |
| 100 | if(input_port_read(field | |
| 100 | if(input_port_read(field. | |
| 101 | 101 | break; |
| 102 | 102 | case 0x33: |
| 103 | if(input_port_read(field | |
| 103 | if(input_port_read(field. | |
| 104 | 104 | break; |
| 105 | 105 | |
| 106 | 106 | case 0x30: |
| 107 | if(input_port_read(field | |
| 107 | if(input_port_read(field. | |
| 108 | 108 | break; |
| 109 | 109 | case 0x38: |
| 110 | if(input_port_read(field | |
| 110 | if(input_port_read(field. | |
| 111 | 111 | break; |
| 112 | 112 | case 0x34: |
| 113 | if(input_port_read(field | |
| 113 | if(input_port_read(field. | |
| 114 | 114 | break; |
| 115 | 115 | case 0x35: |
| 116 | if(input_port_read(field | |
| 116 | if(input_port_read(field. | |
| 117 | 117 | break; |
| 118 | 118 | case 0x36: |
| 119 | if(input_port_read(field | |
| 119 | if(input_port_read(field. | |
| 120 | 120 | break; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | if(send) |
| 124 | 124 | { |
| 125 | 125 | UINT8 data = (UINT8)((FPTR)param & 0x000000ff); |
| 126 | scc68070_quizard_rx(field | |
| 126 | scc68070_quizard_rx(field. | |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 |
| r11517 | r11518 | |
|---|---|---|
| 1616 | 1616 | |
| 1617 | 1617 | static READ8_DEVICE_HANDLER( braze_eeprom_r ) |
| 1618 | 1618 | { |
| 1619 | return eeprom_read_bit(device); | |
| 1619 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1620 | return eeprom->read_bit(); | |
| 1620 | 1621 | } |
| 1621 | 1622 | |
| 1622 | 1623 | static WRITE8_HANDLER( braze_a15_w ) |
| r11517 | r11518 | |
| 1627 | 1628 | |
| 1628 | 1629 | static WRITE8_DEVICE_HANDLER( braze_eeprom_w ) |
| 1629 | 1630 | { |
| 1630 | eeprom_write_bit(device, data & 0x01); | |
| 1631 | eeprom_set_cs_line(device, data & 0x04 ? CLEAR_LINE : ASSERT_LINE); | |
| 1632 | eeprom_set_clock_line(device, data & 0x02 ? ASSERT_LINE : CLEAR_LINE); | |
| 1631 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 1632 | eeprom->write_bit(data & 0x01); | |
| 1633 | eeprom->set_cs_line(data & 0x04 ? CLEAR_LINE : ASSERT_LINE); | |
| 1634 | eeprom->set_clock_line(data & 0x02 ? ASSERT_LINE : CLEAR_LINE); | |
| 1633 | 1635 | } |
| 1634 | 1636 | |
| 1635 | 1637 | static void braze_decrypt_rom(running_machine &machine, UINT8 *dest) |
| r11517 | r11518 | |
|---|---|---|
| 168 | 168 | switch (bit_mask) |
| 169 | 169 | { |
| 170 | 170 | case 0x01: |
| 171 | return ((input_port_read(field | |
| 171 | return ((input_port_read(field. | |
| 172 | 172 | case 0x02: |
| 173 | return ((input_port_read(field | |
| 173 | return ((input_port_read(field. | |
| 174 | 174 | default: |
| 175 | 175 | logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask); |
| 176 | 176 | return 0; |
| r11517 | r11518 | |
| 184 | 184 | switch (bit_mask) |
| 185 | 185 | { |
| 186 | 186 | case 0x01: |
| 187 | return ((input_port_read(field | |
| 187 | return ((input_port_read(field. | |
| 188 | 188 | case 0x02: |
| 189 | return ((input_port_read(field | |
| 189 | return ((input_port_read(field. | |
| 190 | 190 | case 0x04: |
| 191 | return ((input_port_read(field | |
| 191 | return ((input_port_read(field. | |
| 192 | 192 | case 0x08: |
| 193 | return ((input_port_read(field | |
| 193 | return ((input_port_read(field. | |
| 194 | 194 | default: |
| 195 | 195 | logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask); |
| 196 | 196 | return 0; |
| r11517 | r11518 | |
| 204 | 204 | switch (bit_mask) |
| 205 | 205 | { |
| 206 | 206 | case 0x01: |
| 207 | return ((input_port_read(field | |
| 207 | return ((input_port_read(field. | |
| 208 | 208 | case 0x02: |
| 209 | return ((input_port_read(field | |
| 209 | return ((input_port_read(field. | |
| 210 | 210 | case 0x04: |
| 211 | return ((input_port_read(field | |
| 211 | return ((input_port_read(field. | |
| 212 | 212 | default: |
| 213 | 213 | logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask); |
| 214 | 214 | return 0; |
| r11517 | r11518 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | static CUSTOM_INPUT( get_lever ) |
| 21 | 21 | { |
| 22 | sprint4_state *state = field | |
| 22 | sprint4_state *state = field. | |
| 23 | 23 | int n = (FPTR) param; |
| 24 | 24 | |
| 25 | 25 | return 4 * state->m_gear[n] > state->m_da_latch; |
| r11517 | r11518 | |
| 28 | 28 | |
| 29 | 29 | static CUSTOM_INPUT( get_wheel ) |
| 30 | 30 | { |
| 31 | sprint4_state *state = field | |
| 31 | sprint4_state *state = field. | |
| 32 | 32 | int n = (FPTR) param; |
| 33 | 33 | |
| 34 | 34 | return 8 * state->m_steer_FF1[n] + 8 * state->m_steer_FF2[n] > state->m_da_latch; |
| r11517 | r11518 | |
| 37 | 37 | |
| 38 | 38 | static CUSTOM_INPUT( get_collision ) |
| 39 | 39 | { |
| 40 | sprint4_state *state = field | |
| 40 | sprint4_state *state = field. | |
| 41 | 41 | int n = (FPTR) param; |
| 42 | 42 | |
| 43 | 43 | return state->m_collision[n]; |
| r11517 | r11518 | |
|---|---|---|
| 286 | 286 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) |
| 287 | 287 | |
| 288 | 288 | PORT_START( "EEPROMIN" ) |
| 289 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* bit 7 is EEPROM data */ | |
| 289 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* bit 7 is EEPROM data */ | |
| 290 | 290 | |
| 291 | 291 | PORT_START( "EEPROMOUT" ) |
| 292 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) /* bit 5 is cs (active low) */ | |
| 293 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) /* bit 6 is clock (active high) */ | |
| 294 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) /* bit 7 is data */ | |
| 292 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) /* bit 5 is cs (active low) */ | |
| 293 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) /* bit 6 is clock (active high) */ | |
| 294 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) /* bit 7 is data */ | |
| 295 | 295 | INPUT_PORTS_END |
| 296 | 296 | |
| 297 | 297 |
| r11517 | r11518 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | static CUSTOM_INPUT( spriteram_bit_r ) |
| 114 | 114 | { |
| 115 | limenko_state *state = field | |
| 115 | limenko_state *state = field. | |
| 116 | 116 | return state->m_spriteram_bit; |
| 117 | 117 | } |
| 118 | 118 | |
| r11517 | r11518 | |
| 535 | 535 | PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 536 | 536 | PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW ) |
| 537 | 537 | PORT_BIT( 0x00400000, IP_ACTIVE_HIGH, IPT_SPECIAL ) //security bit |
| 538 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 538 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 539 | 539 | PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START3 ) |
| 540 | 540 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_START4 ) |
| 541 | 541 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_COIN3 ) |
| r11517 | r11518 | |
| 548 | 548 | PORT_BIT( 0x4000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 549 | 549 | |
| 550 | 550 | PORT_START( "EEPROMOUT" ) |
| 551 | PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 552 | PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 553 | PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 551 | PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 552 | PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 553 | PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 554 | 554 | // PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 0x80000 -> video disabled? |
| 555 | 555 | INPUT_PORTS_END |
| 556 | 556 | |
| r11517 | r11518 | |
| 584 | 584 | PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 585 | 585 | PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW ) |
| 586 | 586 | PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SPECIAL ) //security bit |
| 587 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 587 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 588 | 588 | PORT_DIPNAME( 0x20000000, 0x00000000, "Sound Enable" ) |
| 589 | 589 | PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) ) |
| 590 | 590 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) |
| r11517 | r11518 | |
| 593 | 593 | PORT_BIT( 0x5f00ffff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 594 | 594 | |
| 595 | 595 | PORT_START( "EEPROMOUT" ) |
| 596 | PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 597 | PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 598 | PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 596 | PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 597 | PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 598 | PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 599 | 599 | // PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 0x80000 -> video disabled? |
| 600 | 600 | INPUT_PORTS_END |
| 601 | 601 | |
| r11517 | r11518 | |
| 629 | 629 | PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location |
| 630 | 630 | PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW ) |
| 631 | 631 | PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SPECIAL ) //security bit |
| 632 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 632 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 633 | 633 | PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Demo_Sounds ) ) |
| 634 | 634 | PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) |
| 635 | 635 | PORT_DIPSETTING( 0x20000000, DEF_STR( On ) ) |
| r11517 | r11518 | |
| 637 | 637 | PORT_BIT( 0x5f10ffff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 638 | 638 | |
| 639 | 639 | PORT_START( "EEPROMOUT" ) |
| 640 | PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 641 | PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 642 | PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 640 | PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 641 | PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 642 | PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 643 | 643 | // PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 0x80000 -> video disabled? |
| 644 | 644 | INPUT_PORTS_END |
| 645 | 645 |
| r11517 | r11518 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | PORT_START("TEST") |
| 176 | 176 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) |
| 177 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 177 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 178 | 178 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // eeprom ack |
| 179 | 179 | PORT_BIT( 0xce, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 180 | 180 | |
| 181 | 181 | PORT_START( "EEPROMOUT" ) |
| 182 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 183 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 184 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 182 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 183 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 184 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 185 | 185 | INPUT_PORTS_END |
| 186 | 186 | |
| 187 | 187 | static INPUT_PORTS_START( simpsn2p ) |
| r11517 | r11518 | |
| 209 | 209 | |
| 210 | 210 | PORT_START("TEST") |
| 211 | 211 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) |
| 212 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 212 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 213 | 213 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // eeprom ack |
| 214 | 214 | PORT_BIT( 0xce, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 215 | 215 | |
| 216 | 216 | PORT_START( "EEPROMOUT" ) |
| 217 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 218 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 219 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 217 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 218 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 219 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 220 | 220 | INPUT_PORTS_END |
| 221 | 221 | |
| 222 | 222 |
| r11517 | r11518 | |
|---|---|---|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | |
| 351 | static CUSTOM_INPUT( high_port_r ) { return input_port_read(field->machine(), (const char *)param) >> 4; } | |
| 352 | static CUSTOM_INPUT( low_port_r ) { return input_port_read(field->machine(), (const char *)param) & 0x0f; } | |
| 351 | static CUSTOM_INPUT( high_port_r ) { return input_port_read(field.machine(), (const char *)param) >> 4; } | |
| 352 | static CUSTOM_INPUT( low_port_r ) { return input_port_read(field.machine(), (const char *)param) & 0x0f; } | |
| 353 | 353 | static CUSTOM_INPUT( auto_start_r ) |
| 354 | 354 | { |
| 355 | polepos_state *state = field | |
| 355 | polepos_state *state = field. | |
| 356 | 356 | return state->m_auto_start_mask; |
| 357 | 357 | } |
| 358 | 358 |
| r11517 | r11518 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | static CUSTOM_INPUT( inputs_r ) |
| 39 | 39 | { |
| 40 | qdrmfgp_state *state = field | |
| 40 | qdrmfgp_state *state = field. | |
| 41 | 41 | const char *tag1 = (const char *)param; |
| 42 | 42 | const char *tag2 = tag1 + strlen(tag1) + 1; |
| 43 | return input_port_read(field | |
| 43 | return input_port_read(field. | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static CUSTOM_INPUT( battery_sensor_r ) |
| r11517 | r11518 | |
|---|---|---|
| 2212 | 2212 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2213 | 2213 | |
| 2214 | 2214 | PORT_START( "EEPROMIN" ) |
| 2215 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2215 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2216 | 2216 | |
| 2217 | 2217 | PORT_START( "EEPROMOUT" ) |
| 2218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2219 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2220 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2219 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2220 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2221 | 2221 | INPUT_PORTS_END |
| 2222 | 2222 | |
| 2223 | 2223 | /* Needs further checking */ |
| r11517 | r11518 | |
| 2247 | 2247 | PORT_INCLUDE( dinopic ) |
| 2248 | 2248 | |
| 2249 | 2249 | PORT_START( "EEPROMIN" ) |
| 2250 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2250 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2251 | 2251 | |
| 2252 | 2252 | PORT_START( "EEPROMOUT" ) |
| 2253 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2254 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2255 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2253 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2254 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2255 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2256 | 2256 | INPUT_PORTS_END |
| 2257 | 2257 | |
| 2258 | 2258 | |
| r11517 | r11518 | |
| 2380 | 2380 | PORT_INCLUDE( punipic ) |
| 2381 | 2381 | |
| 2382 | 2382 | PORT_START( "EEPROMIN" ) |
| 2383 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2383 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2384 | 2384 | |
| 2385 | 2385 | PORT_START( "EEPROMOUT" ) |
| 2386 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2387 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2388 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2386 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2387 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2388 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2389 | 2389 | INPUT_PORTS_END |
| 2390 | 2390 | |
| 2391 | 2391 | |
| r11517 | r11518 | |
| 2480 | 2480 | PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2481 | 2481 | |
| 2482 | 2482 | PORT_START( "EEPROMIN" ) |
| 2483 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2483 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2484 | 2484 | |
| 2485 | 2485 | PORT_START( "EEPROMOUT" ) |
| 2486 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2487 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2488 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2486 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2487 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2488 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2489 | 2489 | INPUT_PORTS_END |
| 2490 | 2490 | |
| 2491 | 2491 | /* Needs further checking */ |
| r11517 | r11518 | |
| 2722 | 2722 | PORT_DIPUNUSED( 0x80, 0x80 ) /* doubles up as an extra service switch */ |
| 2723 | 2723 | |
| 2724 | 2724 | PORT_START( "EEPROMIN" ) |
| 2725 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2725 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2726 | 2726 | |
| 2727 | 2727 | PORT_START( "EEPROMOUT" ) |
| 2728 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2729 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2730 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2728 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2729 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2730 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2731 | 2731 | INPUT_PORTS_END |
| 2732 | 2732 | |
| 2733 | 2733 | /* Needs further checking */ |
| r11517 | r11518 | |
| 2933 | 2933 | PORT_INCLUDE( sfzch ) |
| 2934 | 2934 | |
| 2935 | 2935 | PORT_START( "EEPROMIN" ) |
| 2936 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2936 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2937 | 2937 | |
| 2938 | 2938 | PORT_START( "EEPROMOUT" ) |
| 2939 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2940 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2941 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2939 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2940 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2941 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2942 | 2942 | INPUT_PORTS_END |
| 2943 | 2943 | |
| 2944 | 2944 | /* |
| r11517 | r11518 | |
|---|---|---|
| 264 | 264 | static CUSTOM_INPUT( stratgyx_coinage_r ) |
| 265 | 265 | { |
| 266 | 266 | int bit_mask = (FPTR)param; |
| 267 | return (input_port_read(field | |
| 267 | return (input_port_read(field. | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 |
| r11517 | r11518 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static CUSTOM_INPUT( get_motor_not_ready ) |
| 57 | 57 | { |
| 58 | stactics_state *state = field | |
| 58 | stactics_state *state = field. | |
| 59 | 59 | |
| 60 | 60 | /* if the motor is self-centering, but not centered yet */ |
| 61 | 61 | return ((*state->m_motor_on & 0x01) == 0) && |
| r11517 | r11518 | |
| 130 | 130 | static CUSTOM_INPUT( get_rng ) |
| 131 | 131 | { |
| 132 | 132 | /* this is a 555 timer, but cannot read one of the resistor values */ |
| 133 | return field | |
| 133 | return field. | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 |
| r11517 | r11518 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static CUSTOM_INPUT( cclownz_paddle ) |
| 163 | 163 | { |
| 164 | int value = input_port_read(field | |
| 164 | int value = input_port_read(field. | |
| 165 | 165 | return ((value << 4) & 0xf00) | (value & 0x00f); |
| 166 | 166 | } |
| 167 | 167 |
| r11517 | r11518 | |
|---|---|---|
| 451 | 451 | kickgoal_state *state = space->machine().driver_data<kickgoal_state>(); |
| 452 | 452 | if (ACCESSING_BITS_0_7) |
| 453 | 453 | { |
| 454 | return | |
| 454 | return | |
| 455 | 455 | } |
| 456 | 456 | return 0; |
| 457 | 457 | } |
| r11517 | r11518 | |
| 465 | 465 | switch (offset) |
| 466 | 466 | { |
| 467 | 467 | case 0: |
| 468 | eeprom | |
| 468 | state->m_eeprom->set_cs_line( | |
| 469 | 469 | break; |
| 470 | 470 | case 1: |
| 471 | eeprom | |
| 471 | state->m_eeprom->set_clock_line( | |
| 472 | 472 | break; |
| 473 | 473 | case 2: |
| 474 | eeprom | |
| 474 | state->m_eeprom->write_bit( | |
| 475 | 475 | break; |
| 476 | 476 | } |
| 477 | 477 | } |
| r11517 | r11518 | |
|---|---|---|
| 728 | 728 | |
| 729 | 729 | static CUSTOM_INPUT( special_r ) |
| 730 | 730 | { |
| 731 | itech8_state *state = field | |
| 731 | itech8_state *state = field. | |
| 732 | 732 | return state->m_pia_portb_data & 0x01; |
| 733 | 733 | } |
| 734 | 734 | |
| r11517 | r11518 | |
| 1102 | 1102 | { |
| 1103 | 1103 | const char *tag1 = (const char *)param; |
| 1104 | 1104 | const char *tag2 = tag1 + strlen(tag1) + 1; |
| 1105 | return input_port_read(field | |
| 1105 | return input_port_read(field. | |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | 1108 | static INPUT_PORTS_START( gtg ) |
| r11517 | r11518 | |
|---|---|---|
| 728 | 728 | |
| 729 | 729 | static CUSTOM_INPUT( scramble_protection_alt_r ) |
| 730 | 730 | { |
| 731 | galaxian_state *state = field | |
| 731 | galaxian_state *state = field. | |
| 732 | 732 | /* |
| 733 | 733 | There are two additional bits that are derived from bit 7 of |
| 734 | 734 | the protection result. This is just a guess but works well enough |
| r11517 | r11518 | |
| 1008 | 1008 | |
| 1009 | 1009 | static INPUT_CHANGED( gmgalax_game_changed ) |
| 1010 | 1010 | { |
| 1011 | galaxian_state *state = field->machine().driver_data<galaxian_state>(); | |
| 1012 | address_space *space = field->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 1011 | galaxian_state *state = field.machine().driver_data<galaxian_state>(); | |
| 1012 | address_space *space = field.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 1013 | 1013 | |
| 1014 | 1014 | /* new value is the selected game */ |
| 1015 | 1015 | state->m_gmgalax_selected_game = newval; |
| 1016 | 1016 | |
| 1017 | 1017 | /* select the bank and graphics bank based on it */ |
| 1018 | memory_set_bank(field | |
| 1018 | memory_set_bank(field. | |
| 1019 | 1019 | galaxian_gfxbank_w(space, 0, state->m_gmgalax_selected_game); |
| 1020 | 1020 | |
| 1021 | 1021 | /* reset the stars */ |
| 1022 | 1022 | galaxian_stars_enable_w(space, 0, 0); |
| 1023 | 1023 | |
| 1024 | 1024 | /* reset the CPU */ |
| 1025 | cputag_set_input_line(field | |
| 1025 | cputag_set_input_line(field. | |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | |
| 1029 | 1029 | static CUSTOM_INPUT( gmgalax_port_r ) |
| 1030 | 1030 | { |
| 1031 | galaxian_state *state = field | |
| 1031 | galaxian_state *state = field. | |
| 1032 | 1032 | const char *portname = (const char *)param; |
| 1033 | 1033 | if (state->m_gmgalax_selected_game != 0) |
| 1034 | 1034 | portname += strlen(portname) + 1; |
| 1035 | return input_port_read(field | |
| 1035 | return input_port_read(field. | |
| 1036 | 1036 | } |
| 1037 | 1037 | |
| 1038 | 1038 | |
| r11517 | r11518 | |
| 1084 | 1084 | |
| 1085 | 1085 | static CUSTOM_INPUT( azurian_port_r ) |
| 1086 | 1086 | { |
| 1087 | return (input_port_read(field | |
| 1087 | return (input_port_read(field. | |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | 1090 | |
| r11517 | r11518 | |
| 1097 | 1097 | |
| 1098 | 1098 | static CUSTOM_INPUT( kingball_muxbit_r ) |
| 1099 | 1099 | { |
| 1100 | galaxian_state *state = field | |
| 1100 | galaxian_state *state = field. | |
| 1101 | 1101 | /* multiplex the service mode switch with a speech DIP switch */ |
| 1102 | return (input_port_read(field | |
| 1102 | return (input_port_read(field. | |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | |
| r11517 | r11518 | |
| 1108 | 1108 | /* bit 5 is the NOISE line from the sound circuit. The code just verifies |
| 1109 | 1109 | that it's working, doesn't actually use return value, so we can just use |
| 1110 | 1110 | rand() */ |
| 1111 | return field | |
| 1111 | return field. | |
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | |
| r11517 | r11518 | |
| 2689 | 2689 | memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000); |
| 2690 | 2690 | |
| 2691 | 2691 | /* callback when the game select is toggled */ |
| 2692 | gmgalax_game_changed(*state, machine.m_portlist.first()->fieldlist().first(), NULL, 0, 0); | |
| 2692 | gmgalax_game_changed(*state, *machine.m_portlist.first()->fieldlist().first(), NULL, 0, 0); | |
| 2693 | 2693 | state_save_register_global(machine, state->m_gmgalax_selected_game); |
| 2694 | 2694 | } |
| 2695 | 2695 |
| r11517 | r11518 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | static CUSTOM_INPUT( victnine_mcu_status_bit01_r ) |
| 126 | 126 | { |
| 127 | flstory_state *state = field | |
| 127 | flstory_state *state = field. | |
| 128 | 128 | address_space *space = state->m_maincpu->memory().space(AS_PROGRAM); |
| 129 | 129 | |
| 130 | 130 | return (victnine_mcu_status_r(space, 0) & 3); |
| r11517 | r11518 | |
|---|---|---|
| 145 | 145 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 146 | 146 | |
| 147 | 147 | PORT_START("IN3") /* 0x91 */ |
| 148 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 148 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 149 | 149 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 150 | 150 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 151 | 151 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 191 | 191 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 192 | 192 | |
| 193 | 193 | PORT_START("IN3") /* 0xD1 */ |
| 194 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 194 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 195 | 195 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 196 | 196 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 197 | 197 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 224 | 224 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Aim") PORT_PLAYER(1) |
| 225 | 225 | |
| 226 | 226 | PORT_START("IN3") /* 0x91 */ |
| 227 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 227 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 228 | 228 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 229 | 229 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) PORT_PLAYER(1) |
| 230 | 230 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1) |
| r11517 | r11518 | |
| 263 | 263 | // PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* redundant inputs */ |
| 264 | 264 | |
| 265 | 265 | PORT_START("IN3") /* 0xD1 */ |
| 266 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 266 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 267 | 267 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 268 | 268 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) PORT_PLAYER(1) |
| 269 | 269 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1) |
| r11517 | r11518 | |
| 299 | 299 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 300 | 300 | |
| 301 | 301 | PORT_START("IN3") /* 0xD1 */ |
| 302 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 302 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 303 | 303 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 304 | 304 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) PORT_PLAYER(1) |
| 305 | 305 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1) |
| r11517 | r11518 | |
| 334 | 334 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 335 | 335 | |
| 336 | 336 | PORT_START("IN3") /* 0x91 */ |
| 337 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 337 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 338 | 338 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 339 | 339 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 340 | 340 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 369 | 369 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Run/Cutoff") PORT_PLAYER(1) |
| 370 | 370 | |
| 371 | 371 | PORT_START("IN3") /* 0x51/D1 */ |
| 372 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 372 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 373 | 373 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 374 | 374 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) PORT_PLAYER(1) |
| 375 | 375 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1) |
| r11517 | r11518 | |
| 406 | 406 | PORT_BIT( 0xe0, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(64) PORT_PLAYER(2) |
| 407 | 407 | |
| 408 | 408 | PORT_START("IN3") /* 0xD1 */ |
| 409 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 409 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 410 | 410 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 411 | 411 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 412 | 412 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 444 | 444 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 445 | 445 | |
| 446 | 446 | PORT_START("IN3") /* 0x91 */ |
| 447 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 447 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 448 | 448 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 449 | 449 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 450 | 450 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 486 | 486 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 487 | 487 | |
| 488 | 488 | PORT_START("IN3") /* 0x91 */ |
| 489 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 489 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 490 | 490 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 491 | 491 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) |
| 492 | 492 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 544 | 544 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 545 | 545 | |
| 546 | 546 | PORT_START("IN3") /* 0x91 */ |
| 547 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 547 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 548 | 548 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 549 | 549 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 550 | 550 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 599 | 599 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 600 | 600 | |
| 601 | 601 | PORT_START("IN3") /* 0xD1 */ |
| 602 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 602 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 603 | 603 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 604 | 604 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 605 | 605 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) |
| r11517 | r11518 | |
| 659 | 659 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 660 | 660 | |
| 661 | 661 | PORT_START("IN3") /* 0x51 */ |
| 662 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 662 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 663 | 663 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 664 | 664 | PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) |
| 665 | 665 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
|---|---|---|
| 145 | 145 | static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w ) |
| 146 | 146 | { |
| 147 | 147 | lordgun_state *state = device->machine().driver_data<lordgun_state>(); |
| 148 | device | |
| 148 | eeprom_device | |
| 149 | 149 | int i; |
| 150 | 150 | |
| 151 | 151 | if (data & ~0xfd) |
| r11517 | r11518 | |
| 162 | 162 | lordgun_update_gun(device->machine(), i); |
| 163 | 163 | |
| 164 | 164 | // latch the bit |
| 165 | eeprom | |
| 165 | eeprom->write_bit( | |
| 166 | 166 | |
| 167 | 167 | // reset line asserted: reset. |
| 168 | eeprom | |
| 168 | eeprom->set_cs_line( | |
| 169 | 169 | |
| 170 | 170 | // clock line asserted: write latch or select next bit to read |
| 171 | eeprom | |
| 171 | eeprom->set_clock_line( | |
| 172 | 172 | |
| 173 | 173 | state->m_whitescreen = data & 0x80; |
| 174 | 174 | |
| r11517 | r11518 | |
| 178 | 178 | static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w ) |
| 179 | 179 | { |
| 180 | 180 | lordgun_state *state = device->machine().driver_data<lordgun_state>(); |
| 181 | device | |
| 181 | eeprom_device | |
| 182 | 182 | |
| 183 | 183 | if (~data & ~0xf8) |
| 184 | 184 | { |
| r11517 | r11518 | |
| 193 | 193 | coin_counter_w(device->machine(), 1, data & 0x10); |
| 194 | 194 | |
| 195 | 195 | // latch the bit |
| 196 | eeprom | |
| 196 | eeprom->write_bit( | |
| 197 | 197 | |
| 198 | 198 | // reset line asserted: reset. |
| 199 | eeprom | |
| 199 | eeprom->set_cs_line( | |
| 200 | 200 | |
| 201 | 201 | // clock line asserted: write latch or select next bit to read |
| 202 | eeprom | |
| 202 | eeprom->set_clock_line( | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| r11517 | r11518 | |
| 443 | 443 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 444 | 444 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 445 | 445 | PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) |
| 446 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 446 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 447 | 447 | |
| 448 | 448 | PORT_START("START1") |
| 449 | 449 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) |
| r11517 | r11518 | |
| 564 | 564 | PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW3:8" ) /* Listed as "Unused" */ |
| 565 | 565 | |
| 566 | 566 | PORT_START("SERVICE") |
| 567 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 567 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 568 | 568 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 569 | 569 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 570 | 570 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 149 | 149 | { |
| 150 | 150 | /* pressing the service switch sends an NMI */ |
| 151 | 151 | if (newval) |
| 152 | cputag_set_input_line(field | |
| 152 | cputag_set_input_line(field. | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 |
| r11517 | r11518 | |
|---|---|---|
| 1715 | 1715 | KONAMI16_LSB( 2, IPT_UNKNOWN, IPT_UNKNOWN ) |
| 1716 | 1716 | |
| 1717 | 1717 | PORT_START("EEPROM") |
| 1718 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1718 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1719 | 1719 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 1720 | 1720 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1721 | 1721 | |
| 1722 | 1722 | PORT_START( "EEPROMOUT" ) |
| 1723 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1724 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1725 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1723 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1724 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1725 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1726 | 1726 | INPUT_PORTS_END |
| 1727 | 1727 | |
| 1728 | 1728 | static INPUT_PORTS_START( glfgreat ) |
| r11517 | r11518 | |
| 1811 | 1811 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1812 | 1812 | |
| 1813 | 1813 | PORT_START("EEPROM") |
| 1814 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1814 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1815 | 1815 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 1816 | 1816 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */ |
| 1817 | 1817 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK */ |
| r11517 | r11518 | |
| 1820 | 1820 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) |
| 1821 | 1821 | |
| 1822 | 1822 | PORT_START( "EEPROMOUT" ) |
| 1823 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1824 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1825 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1823 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1824 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1825 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1826 | 1826 | INPUT_PORTS_END |
| 1827 | 1827 | |
| 1828 | 1828 | static INPUT_PORTS_START( ssridr4p ) |
| r11517 | r11518 | |
| 1849 | 1849 | KONAMI16_LSB( 4, IPT_UNKNOWN, IPT_UNKNOWN ) |
| 1850 | 1850 | |
| 1851 | 1851 | PORT_START("EEPROM") |
| 1852 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1852 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1853 | 1853 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 1854 | 1854 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */ |
| 1855 | 1855 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK */ |
| r11517 | r11518 | |
| 1858 | 1858 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) |
| 1859 | 1859 | |
| 1860 | 1860 | PORT_START( "EEPROMOUT" ) |
| 1861 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1862 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1863 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1861 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1862 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1863 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1864 | 1864 | INPUT_PORTS_END |
| 1865 | 1865 | |
| 1866 | 1866 | /* Same as 'ssridr4p', but additional Start button for each player. |
| r11517 | r11518 | |
| 1889 | 1889 | KONAMI16_LSB( 4, IPT_UNKNOWN, IPT_START4 ) |
| 1890 | 1890 | |
| 1891 | 1891 | PORT_START("EEPROM") |
| 1892 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1892 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1893 | 1893 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 1894 | 1894 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */ |
| 1895 | 1895 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK */ |
| r11517 | r11518 | |
| 1898 | 1898 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) |
| 1899 | 1899 | |
| 1900 | 1900 | PORT_START( "EEPROMOUT" ) |
| 1901 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1902 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1903 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1901 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1902 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1903 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1904 | 1904 | INPUT_PORTS_END |
| 1905 | 1905 | |
| 1906 | 1906 | /* Version for the bootleg, which has the service switch a little different */ |
| r11517 | r11518 | |
| 1928 | 1928 | KONAMI16_LSB( 4, IPT_UNKNOWN, IPT_START4 ) |
| 1929 | 1929 | |
| 1930 | 1930 | PORT_START("EEPROM") |
| 1931 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1931 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1932 | 1932 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 1933 | 1933 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1934 | 1934 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) |
| 1935 | 1935 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */ |
| 1936 | 1936 | |
| 1937 | 1937 | PORT_START( "EEPROMOUT" ) |
| 1938 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1939 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1940 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1938 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1939 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1940 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1941 | 1941 | INPUT_PORTS_END |
| 1942 | 1942 | |
| 1943 | 1943 | static INPUT_PORTS_START( qgakumon ) |
| r11517 | r11518 | |
| 1978 | 1978 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1979 | 1979 | |
| 1980 | 1980 | PORT_START("EEPROM") |
| 1981 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1981 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1982 | 1982 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 1983 | 1983 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */ |
| 1984 | 1984 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK (needs to be ACTIVE_HIGH to avoid problems) */ |
| r11517 | r11518 | |
| 1987 | 1987 | PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) |
| 1988 | 1988 | |
| 1989 | 1989 | PORT_START( "EEPROMOUT" ) |
| 1990 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1991 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1992 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1990 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1991 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1992 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1993 | 1993 | INPUT_PORTS_END |
| 1994 | 1994 | |
| 1995 | 1995 | static INPUT_PORTS_START( thndrx2 ) |
| r11517 | r11518 | |
| 2006 | 2006 | |
| 2007 | 2007 | PORT_START("P2/EEPROM") |
| 2008 | 2008 | KONAMI16_LSB( 2, IPT_UNKNOWN, IPT_START2 ) |
| 2009 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2009 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2010 | 2010 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 2011 | 2011 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2012 | 2012 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* VBLK?? */ |
| r11517 | r11518 | |
| 2016 | 2016 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2017 | 2017 | |
| 2018 | 2018 | PORT_START( "EEPROMOUT" ) |
| 2019 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2020 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2021 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2019 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2020 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2021 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2022 | 2022 | INPUT_PORTS_END |
| 2023 | 2023 | |
| 2024 | 2024 | static INPUT_PORTS_START( prmrsocr ) |
| r11517 | r11518 | |
| 2043 | 2043 | |
| 2044 | 2044 | PORT_START("P2/EEPROM") |
| 2045 | 2045 | KONAMI16_LSB( 2, IPT_UNKNOWN, IPT_START2 ) |
| 2046 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2046 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2047 | 2047 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */ |
| 2048 | 2048 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 2049 | 2049 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 2053 | 2053 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2054 | 2054 | |
| 2055 | 2055 | PORT_START( "EEPROMOUT" ) |
| 2056 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2057 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2058 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2056 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2057 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2058 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2059 | 2059 | INPUT_PORTS_END |
| 2060 | 2060 | |
| 2061 | 2061 |
| r11517 | r11518 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | static INPUT_PORTS_START( kongambl ) |
| 97 | 97 | PORT_START( "SYSTEM" ) |
| 98 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 98 | PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 99 | 99 | |
| 100 | 100 | PORT_START( "EEPROMOUT" ) |
| 101 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 102 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 103 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 101 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 102 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 103 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 104 | 104 | INPUT_PORTS_END |
| 105 | 105 | |
| 106 | 106 | static ADDRESS_MAP_START( kongamaud_map, AS_PROGRAM, 16 ) |
| r11517 | r11518 | |
|---|---|---|
| 1082 | 1082 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1083 | 1083 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1084 | 1084 | //PORT_SERVICE(0x02, 0x00) |
| 1085 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1085 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1086 | 1086 | |
| 1087 | 1087 | PORT_START("START") |
| 1088 | 1088 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) |
| r11517 | r11518 | |
| 1108 | 1108 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) |
| 1109 | 1109 | |
| 1110 | 1110 | PORT_START( "EEPROMOUT" ) |
| 1111 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1112 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1113 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1111 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1112 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1113 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1114 | 1114 | INPUT_PORTS_END |
| 1115 | 1115 | #endif |
| 1116 | 1116 | |
| r11517 | r11518 | |
| 1119 | 1119 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1120 | 1120 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1121 | 1121 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1122 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1122 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1123 | 1123 | |
| 1124 | 1124 | PORT_START("START") |
| 1125 | 1125 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 1128 | 1128 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) |
| 1129 | 1129 | |
| 1130 | 1130 | PORT_START( "EEPROMOUT" ) |
| 1131 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1132 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1133 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1131 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1132 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1133 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1134 | 1134 | |
| 1135 | 1135 | PORT_START("UNUSED") |
| 1136 | 1136 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) // Horn |
| r11517 | r11518 | |
| 1155 | 1155 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1156 | 1156 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1157 | 1157 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1158 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1158 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1159 | 1159 | |
| 1160 | 1160 | PORT_START("START") |
| 1161 | 1161 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 1164 | 1164 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) |
| 1165 | 1165 | |
| 1166 | 1166 | PORT_START( "EEPROMOUT" ) |
| 1167 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1168 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1169 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1167 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1168 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1169 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1170 | 1170 | |
| 1171 | 1171 | PORT_START("UNUSED") |
| 1172 | 1172 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // View button |
| r11517 | r11518 | |
| 1190 | 1190 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1191 | 1191 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1192 | 1192 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1193 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1193 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1194 | 1194 | |
| 1195 | 1195 | PORT_START("START") |
| 1196 | 1196 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 1201 | 1201 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) |
| 1202 | 1202 | |
| 1203 | 1203 | PORT_START( "EEPROMOUT" ) |
| 1204 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1205 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1206 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1204 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1205 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1206 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1207 | 1207 | |
| 1208 | 1208 | PORT_START("UNUSED") |
| 1209 | 1209 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 1230 | 1230 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1231 | 1231 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1232 | 1232 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| 1233 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1233 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1234 | 1234 | |
| 1235 | 1235 | PORT_START("START") |
| 1236 | 1236 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 1241 | 1241 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) |
| 1242 | 1242 | |
| 1243 | 1243 | PORT_START( "EEPROMOUT" ) |
| 1244 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1245 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1246 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1244 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1245 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1246 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1247 | 1247 | |
| 1248 | 1248 | PORT_START("UNUSED") |
| 1249 | 1249 | PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
|---|---|---|
| 228 | 228 | UINT32 ret; |
| 229 | 229 | |
| 230 | 230 | /* screen flip multiplexes controls */ |
| 231 | if (suprridr_is_screen_flipped(field->machine())) | |
| 232 | ret = input_port_read(field->machine(), SUPRRIDR_P2_CONTROL_PORT_TAG); | |
| 231 | if (suprridr_is_screen_flipped(field.machine())) | |
| 232 | ret = input_port_read(field.machine(), SUPRRIDR_P2_CONTROL_PORT_TAG); | |
| 233 | 233 | else |
| 234 | ret = input_port_read(field | |
| 234 | ret = input_port_read(field. | |
| 235 | 235 | |
| 236 | 236 | return ret; |
| 237 | 237 | } |
| r11517 | r11518 | |
|---|---|---|
| 342 | 342 | |
| 343 | 343 | static CUSTOM_INPUT( hopper_r ) |
| 344 | 344 | { |
| 345 | igs009_state *state = field->machine().driver_data<igs009_state>(); | |
| 346 | return state->m_hopper && !(field->machine().primary_screen->frame_number()%10); | |
| 345 | igs009_state *state = field.machine().driver_data<igs009_state>(); | |
| 346 | return state->m_hopper && !(field.machine().primary_screen->frame_number()%10); | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 |
| r11517 | r11518 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static CUSTOM_INPUT( z80_nmi_r ) |
| 81 | 81 | { |
| 82 | psikyo_state *state = field | |
| 82 | psikyo_state *state = field. | |
| 83 | 83 | int ret = 0x00; |
| 84 | 84 | |
| 85 | 85 | if (state->m_z80_nmi) |
| r11517 | r11518 | |
| 88 | 88 | |
| 89 | 89 | /* main CPU might be waiting for sound CPU to finish NMI, |
| 90 | 90 | so set a timer to give sound CPU a chance to run */ |
| 91 | field | |
| 91 | field. | |
| 92 | 92 | // logerror("%s - Read coin port during Z80 NMI\n", machine.describe_context()); |
| 93 | 93 | } |
| 94 | 94 | |
| r11517 | r11518 | |
| 97 | 97 | |
| 98 | 98 | static CUSTOM_INPUT( mcu_status_r ) |
| 99 | 99 | { |
| 100 | psikyo_state *state = field | |
| 100 | psikyo_state *state = field. | |
| 101 | 101 | int ret = 0x00; |
| 102 | 102 | |
| 103 | 103 | /* Don't know exactly what this bit is, but s1945 and tengai |
| r11517 | r11518 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | static CUSTOM_INPUT( snd_ack_r ) |
| 144 | 144 | { |
| 145 | dacholer_state *state = field | |
| 145 | dacholer_state *state = field. | |
| 146 | 146 | return state->m_snd_ack; //guess ... |
| 147 | 147 | } |
| 148 | 148 |
| r11517 | r11518 | |
|---|---|---|
| 118 | 118 | esd16_state *state = space->machine().driver_data<esd16_state>(); |
| 119 | 119 | if (ACCESSING_BITS_8_15) |
| 120 | 120 | { |
| 121 | return (( | |
| 121 | return (( | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | // logerror("(0x%06x) unk EEPROM read: %04x\n", cpu_get_pc(&space->device()), mem_mask); |
| r11517 | r11518 | |
| 377 | 377 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 378 | 378 | |
| 379 | 379 | PORT_START( "EEPROMOUT" ) |
| 380 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 381 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 382 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 380 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 381 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 382 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 383 | 383 | INPUT_PORTS_END |
| 384 | 384 | |
| 385 | 385 | |
| r11517 | r11518 | |
| 414 | 414 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 415 | 415 | |
| 416 | 416 | PORT_START( "EEPROMOUT" ) |
| 417 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 418 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 419 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 417 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 418 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 419 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 420 | 420 | INPUT_PORTS_END |
| 421 | 421 | |
| 422 | 422 | /*************************************************************************** |
| r11517 | r11518 | |
| 524 | 524 | memory_configure_bank(machine, "bank1", 0, 17, &AUDIO[0x0000], 0x4000); |
| 525 | 525 | |
| 526 | 526 | state->m_audio_cpu = machine.device("audiocpu"); |
| 527 | state->m_eeprom = machine.device("eeprom"); | |
| 527 | state->m_eeprom = machine.device<eeprom_device>("eeprom"); | |
| 528 | 528 | |
| 529 | 529 | state->save_item(NAME(state->m_tilemap0_color)); |
| 530 | 530 | } |
| r11517 | r11518 | |
|---|---|---|
| 1351 | 1351 | case 0: |
| 1352 | 1352 | if (ACCESSING_BITS_56_63) |
| 1353 | 1353 | { |
| 1354 | device | |
| 1354 | eeprom_device | |
| 1355 | 1355 | int reg = (data >> 56) & 0xff; |
| 1356 | eeprom_write_bit(device, (reg & 0x20) ? 1 : 0); | |
| 1357 | eeprom_set_clock_line(device, (reg & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 1358 | eeprom_set_cs_line(device, (reg & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 1356 | eeprom->write_bit((reg & 0x20) ? 1 : 0); | |
| 1357 | eeprom->set_clock_line((reg & 0x80) ? ASSERT_LINE : CLEAR_LINE); | |
| 1358 | eeprom->set_cs_line((reg & 0x40) ? CLEAR_LINE : ASSERT_LINE); | |
| 1359 | 1359 | state->m_controls_bank = reg & 0xff; |
| 1360 | 1360 | } |
| 1361 | 1361 | return; |
| r11517 | r11518 | |
| 1826 | 1826 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1827 | 1827 | |
| 1828 | 1828 | PORT_START("IN1") |
| 1829 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1829 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1830 | 1830 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button B") PORT_CODE(KEYCODE_8) |
| 1831 | 1831 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Button B") PORT_CODE(KEYCODE_7) |
| 1832 | 1832 | PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
| 2061 | 2061 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) /* Select 2 */ |
| 2062 | 2062 | |
| 2063 | 2063 | PORT_START("IN1") |
| 2064 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 2064 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 2065 | 2065 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button B") PORT_CODE(KEYCODE_8) |
| 2066 | 2066 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Button B") PORT_CODE(KEYCODE_7) |
| 2067 | 2067 | PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r11517 | r11518 | |
|---|---|---|
| 401 | 401 | KONAMI16_LSB(2, IPT_UNKNOWN, IPT_START2 ) |
| 402 | 402 | |
| 403 | 403 | PORT_START("EEPROM") |
| 404 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 404 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 405 | 405 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 406 | 406 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 407 | 407 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) |
| 408 | 408 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 409 | 409 | |
| 410 | 410 | PORT_START( "EEPROMOUT" ) |
| 411 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 412 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 413 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 411 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 412 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 413 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 414 | 414 | INPUT_PORTS_END |
| 415 | 415 | |
| 416 | 416 |
| r11517 | r11518 | |
|---|---|---|
| 217 | 217 | // stops the game hanging.. |
| 218 | 218 | static CUSTOM_INPUT( nb1413m3_hackbusyflag_r ) |
| 219 | 219 | { |
| 220 | return field | |
| 220 | return field. | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static INPUT_PORTS_START( threeds ) |
| r11517 | r11518 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | static CUSTOM_INPUT( frame_counter_r ) |
| 94 | 94 | { |
| 95 | galastrm_state *state = field | |
| 95 | galastrm_state *state = field. | |
| 96 | 96 | return state->m_frame_counter; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | static CUSTOM_INPUT( coin_word_r ) |
| 100 | 100 | { |
| 101 | galastrm_state *state = field | |
| 101 | galastrm_state *state = field. | |
| 102 | 102 | return state->m_coin_word; |
| 103 | 103 | } |
| 104 | 104 | |
| r11517 | r11518 | |
| 127 | 127 | |
| 128 | 128 | if (ACCESSING_BITS_0_7) |
| 129 | 129 | { |
| 130 | device_t *device = space->machine().device("eeprom"); | |
| 131 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 132 | eeprom_write_bit(device, data & 0x40); | |
| 133 | eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 130 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 131 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 132 | eeprom->write_bit(data & 0x40); | |
| 133 | eeprom->set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 134 | 134 | return; |
| 135 | 135 | } |
| 136 | 136 | return; |
| r11517 | r11518 | |
| 204 | 204 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 205 | 205 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 206 | 206 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 207 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 207 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 208 | 208 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START1 ) |
| 209 | 209 | PORT_BIT( 0x00000200, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(frame_counter_r, NULL) |
| 210 | 210 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 267 | 267 | |
| 268 | 268 | static CUSTOM_INPUT( rocknms_main2sub_status_r ) |
| 269 | 269 | { |
| 270 | tetrisp2_state *state = field | |
| 270 | tetrisp2_state *state = field. | |
| 271 | 271 | return state->m_rocknms_sub2main & 0x0003; |
| 272 | 272 | } |
| 273 | 273 |
| r11517 | r11518 | |
|---|---|---|
| 567 | 567 | static READ16_HANDLER( galgames_eeprom_r ) |
| 568 | 568 | { |
| 569 | 569 | tmaster_state *state = space->machine().driver_data<tmaster_state>(); |
| 570 | device | |
| 570 | eeprom_device | |
| 571 | 571 | |
| 572 | return eeprom | |
| 572 | return eeprom->read_bit( | |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | static WRITE16_HANDLER( galgames_eeprom_w ) |
| r11517 | r11518 | |
| 580 | 580 | |
| 581 | 581 | if ( ACCESSING_BITS_0_7 ) |
| 582 | 582 | { |
| 583 | device | |
| 583 | eeprom_device | |
| 584 | 584 | |
| 585 | 585 | // latch the bit |
| 586 | eeprom | |
| 586 | eeprom->write_bit( | |
| 587 | 587 | |
| 588 | 588 | // clock line asserted: write latch or select next bit to read |
| 589 | eeprom | |
| 589 | eeprom->set_clock_line( | |
| 590 | 590 | } |
| 591 | 591 | } |
| 592 | 592 | |
| r11517 | r11518 | |
| 656 | 656 | { |
| 657 | 657 | case 0x07: // 7 resets the eeprom |
| 658 | 658 | for (i = 0; i < 5; i++) |
| 659 | | |
| 659 | | |
| 660 | 660 | break; |
| 661 | 661 | |
| 662 | 662 | case 0x00: |
| r11517 | r11518 | |
| 664 | 664 | case 0x02: |
| 665 | 665 | case 0x03: |
| 666 | 666 | case 0x04: |
| 667 | | |
| 667 | | |
| 668 | 668 | galgames_update_rombank(space->machine(), data & 0xff); |
| 669 | 669 | break; |
| 670 | 670 | |
| 671 | 671 | default: |
| 672 | | |
| 672 | | |
| 673 | 673 | galgames_update_rombank(space->machine(), 0); |
| 674 | 674 | logerror("%06x: unknown cart sel = %04x\n", cpu_get_pc(&space->device()), data); |
| 675 | 675 | break; |
| r11517 | r11518 | |
|---|---|---|
| 5290 | 5290 | |
| 5291 | 5291 | static CUSTOM_INPUT( acedrvr_shift_read ) |
| 5292 | 5292 | { |
| 5293 | namcos22_state *state = field->machine().driver_data<namcos22_state>(); | |
| 5294 | int shift = input_port_read(field->machine(), "SHIFT"); | |
| 5293 | namcos22_state *state = field.machine().driver_data<namcos22_state>(); | |
| 5294 | int shift = input_port_read(field.machine(), "SHIFT"); | |
| 5295 | 5295 | |
| 5296 | 5296 | if (shift > 0 && shift != state->m_prev_stick_state) |
| 5297 | 5297 | { |
| r11517 | r11518 | |
| 5471 | 5471 | |
| 5472 | 5472 | static CUSTOM_INPUT( ridger_gear_read ) |
| 5473 | 5473 | { |
| 5474 | namcos22_state *state = field->machine().driver_data<namcos22_state>(); | |
| 5475 | int gear = input_port_read(field->machine(), "GEARS"); | |
| 5474 | namcos22_state *state = field.machine().driver_data<namcos22_state>(); | |
| 5475 | int gear = input_port_read(field.machine(), "GEARS"); | |
| 5476 | 5476 | |
| 5477 | 5477 | if (gear > 0 && gear != state->m_prev_stick_state) |
| 5478 | 5478 | { |
| r11517 | r11518 | |
|---|---|---|
| 917 | 917 | switch (bit_mask) |
| 918 | 918 | { |
| 919 | 919 | case 0x40: /* vpool : IN1 (0xa800) bit 6 */ |
| 920 | return ((input_port_read(field | |
| 920 | return ((input_port_read(field. | |
| 921 | 921 | case 0x01: /* vpool : DSW (0xb000) bit 0 */ |
| 922 | return ((input_port_read(field | |
| 922 | return ((input_port_read(field. | |
| 923 | 923 | |
| 924 | 924 | default: |
| 925 | 925 | logerror("vpool_lives_r : invalid %02X bit_mask\n",bit_mask); |
| r11517 | r11518 | |
| 1064 | 1064 | switch (bit_mask) |
| 1065 | 1065 | { |
| 1066 | 1066 | case 0x0c: /* ckongg : DSW (0xc800) bits 2 and 3 */ |
| 1067 | return ((input_port_read(field | |
| 1067 | return ((input_port_read(field. | |
| 1068 | 1068 | case 0x40: /* ckongg : IN1 (0xc400) bit 6 */ |
| 1069 | return ((input_port_read(field | |
| 1069 | return ((input_port_read(field. | |
| 1070 | 1070 | |
| 1071 | 1071 | case 0xc0: /* ckongmc : IN1 (0xa800) bits 6 and 7 */ |
| 1072 | return ((input_port_read(field | |
| 1072 | return ((input_port_read(field. | |
| 1073 | 1073 | case 0x01: /* ckongmc : DSW (0xb000) bit 0 */ |
| 1074 | return ((input_port_read(field | |
| 1074 | return ((input_port_read(field. | |
| 1075 | 1075 | |
| 1076 | 1076 | default: |
| 1077 | 1077 | logerror("ckongg_coinage_r : invalid %02X bit_mask\n",bit_mask); |
| r11517 | r11518 | |
| 1432 | 1432 | switch (bit_mask) |
| 1433 | 1433 | { |
| 1434 | 1434 | case 0xc0: /* dkongjrm : IN1 (0xa8??) bits 6 and 7 */ |
| 1435 | return ((input_port_read(field | |
| 1435 | return ((input_port_read(field. | |
| 1436 | 1436 | case 0x01: /* dkongjrm : DSW (0xb0??) bit 0 */ |
| 1437 | return ((input_port_read(field | |
| 1437 | return ((input_port_read(field. | |
| 1438 | 1438 | |
| 1439 | 1439 | default: |
| 1440 | 1440 | logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",bit_mask); |
| r11517 | r11518 | |
|---|---|---|
| 463 | 463 | ssv_state *state = device->machine().driver_data<ssv_state>(); |
| 464 | 464 | static const char *const gunnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" }; |
| 465 | 465 | |
| 466 | return (((state->m_gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(device->machine(), gunnames[state->m_gdfs_lightgun_select])) | (eeprom_read_bit(device) << 8); | |
| 466 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 467 | return (((state->m_gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(device->machine(), gunnames[state->m_gdfs_lightgun_select])) | (eeprom->read_bit() << 8); | |
| 467 | 468 | } |
| 468 | 469 | |
| 469 | 470 | static WRITE16_DEVICE_HANDLER( gdfs_eeprom_w ) |
| r11517 | r11518 | |
| 479 | 480 | // data & 0x0001 ? |
| 480 | 481 | |
| 481 | 482 | // latch the bit |
| 482 | eeprom_write_bit(device, data & 0x4000); | |
| 483 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 484 | eeprom->write_bit(data & 0x4000); | |
| 483 | 485 | |
| 484 | 486 | // reset line asserted: reset. |
| 485 | eeprom | |
| 487 | eeprom->set_cs_line( | |
| 486 | 488 | |
| 487 | 489 | // clock line asserted: write latch or select next bit to read |
| 488 | eeprom | |
| 490 | eeprom->set_clock_line( | |
| 489 | 491 | |
| 490 | 492 | if (!(state->m_gdfs_eeprom_old & 0x0800) && (data & 0x0800)) // rising clock |
| 491 | 493 | state->m_gdfs_lightgun_select = (data & 0x0300) >> 8; |
| r11517 | r11518 | |
|---|---|---|
| 100 | 100 | static CUSTOM_INPUT( mightguy_area_r ) |
| 101 | 101 | { |
| 102 | 102 | int bit_mask = (FPTR)param; |
| 103 | return (input_port_read(field | |
| 103 | return (input_port_read(field. | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | static WRITE8_HANDLER( cop01_irq_ack_w ) |
| r11517 | r11518 | |
|---|---|---|
| 115 | 115 | |
| 116 | 116 | static CUSTOM_INPUT( soundflag_r ) |
| 117 | 117 | { |
| 118 | inufuku_state *state = field | |
| 118 | inufuku_state *state = field. | |
| 119 | 119 | UINT16 soundflag = state->m_pending_command ? 0 : 1; |
| 120 | 120 | |
| 121 | 121 | return soundflag; |
| r11517 | r11518 | |
| 233 | 233 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 234 | 234 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 235 | 235 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 236 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 236 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 237 | 237 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(soundflag_r, NULL) // pending sound command |
| 238 | 238 | |
| 239 | 239 | PORT_START( "EEPROMOUT" ) |
| 240 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 241 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 242 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 240 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 241 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 242 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 243 | 243 | |
| 244 | 244 | PORT_START("P3") |
| 245 | 245 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3) |
| r11517 | r11518 | |
|---|---|---|
| 105 | 105 | { |
| 106 | 106 | if (ACCESSING_BITS_0_15) |
| 107 | 107 | { |
| 108 | return 0x0200 | (eeprom_read_bit(device) << 8); | |
| 108 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 109 | return 0x0200 | (eeprom->read_bit() << 8); | |
| 109 | 110 | } |
| 110 | 111 | else |
| 111 | 112 | { |
| r11517 | r11518 | |
| 706 | 707 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 707 | 708 | |
| 708 | 709 | PORT_START( "EEPROMOUT" ) |
| 709 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 710 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 711 | PORT_BIT( 0x04000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 710 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 711 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 712 | PORT_BIT( 0x04000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 712 | 713 | INPUT_PORTS_END |
| 713 | 714 | |
| 714 | 715 | static INPUT_PORTS_START( polynetw ) |
| r11517 | r11518 | |
| 733 | 734 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 734 | 735 | |
| 735 | 736 | PORT_START( "EEPROMOUT" ) |
| 736 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 737 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 738 | PORT_BIT( 0x04000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 737 | PORT_BIT( 0x01000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 738 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 739 | PORT_BIT( 0x04000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 739 | 740 | INPUT_PORTS_END |
| 740 | 741 | |
| 741 | 742 |
| r11517 | r11518 | |
|---|---|---|
| 268 | 268 | |
| 269 | 269 | static INPUT_CHANGED( coin_inserted ) |
| 270 | 270 | { |
| 271 | cputag_set_input_line(field | |
| 271 | cputag_set_input_line(field. | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | static INPUT_PORTS_START( progolf ) |
| r11517 | r11518 | |
|---|---|---|
| 38 | 38 | { |
| 39 | 39 | coin_counter_w(device->machine(), 0, data & 0x20); |
| 40 | 40 | |
| 41 | eeprom_set_cs_line(device, (data & 8) ? CLEAR_LINE : ASSERT_LINE); | |
| 42 | eeprom_write_bit(device, data & 2); | |
| 43 | eeprom_set_clock_line(device, (data & 4) ? CLEAR_LINE : ASSERT_LINE); | |
| 41 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 42 | eeprom->set_cs_line((data & 8) ? CLEAR_LINE : ASSERT_LINE); | |
| 43 | eeprom->write_bit(data & 2); | |
| 44 | eeprom->set_clock_line((data & 4) ? CLEAR_LINE : ASSERT_LINE); | |
| 44 | 45 | } |
| 45 | 46 | } |
| 46 | 47 | |
| r11517 | r11518 | |
| 220 | 221 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 221 | 222 | |
| 222 | 223 | PORT_START("IN2") |
| 223 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* EEPROM data */ | |
| 224 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* EEPROM data */ | |
| 224 | 225 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 225 | 226 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 226 | 227 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 317 | 318 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 318 | 319 | |
| 319 | 320 | PORT_START("IN2") |
| 320 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* EEPROM data */ | |
| 321 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* EEPROM data */ | |
| 321 | 322 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 322 | 323 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 323 | 324 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 391 | 391 | |
| 392 | 392 | static CUSTOM_INPUT( hopper_r ) |
| 393 | 393 | { |
| 394 | jackie_state *state = field->machine().driver_data<jackie_state>(); | |
| 395 | if (state->m_hopper) return !(field->machine().primary_screen->frame_number()%10); | |
| 396 | return input_code_pressed(field->machine(), KEYCODE_H); | |
| 394 | jackie_state *state = field.machine().driver_data<jackie_state>(); | |
| 395 | if (state->m_hopper) return !(field.machine().primary_screen->frame_number()%10); | |
| 396 | return input_code_pressed(field.machine(), KEYCODE_H); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | static INPUT_PORTS_START( jackie ) |
| r11517 | r11518 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | static CUSTOM_INPUT( lightgun_pos_r ) |
| 187 | 187 | { |
| 188 | alg_state *state = field | |
| 188 | alg_state *state = field. | |
| 189 | 189 | int x = 0, y = 0; |
| 190 | 190 | |
| 191 | 191 | /* get the position based on the input select */ |
| 192 | get_lightgun_pos(*field | |
| 192 | get_lightgun_pos(*field. | |
| 193 | 193 | return (y << 8) | (x >> 2); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| 197 | 197 | static CUSTOM_INPUT( lightgun_trigger_r ) |
| 198 | 198 | { |
| 199 | alg_state *state = field | |
| 199 | alg_state *state = field. | |
| 200 | 200 | |
| 201 | 201 | /* read the trigger control based on the input select */ |
| 202 | return (input_port_read(field | |
| 202 | return (input_port_read(field. | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| 206 | 206 | static CUSTOM_INPUT( lightgun_holster_r ) |
| 207 | 207 | { |
| 208 | alg_state *state = field | |
| 208 | alg_state *state = field. | |
| 209 | 209 | |
| 210 | 210 | /* read the holster control based on the input select */ |
| 211 | return (input_port_read(field | |
| 211 | return (input_port_read(field. | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 |
| r11517 | r11518 | |
|---|---|---|
| 204 | 204 | if ( ACCESSING_BITS_24_31 ) |
| 205 | 205 | { |
| 206 | 206 | // latch the bit |
| 207 | eeprom_write_bit(device, data & 0x04000000); | |
| 207 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 208 | eeprom->write_bit(data & 0x04000000); | |
| 208 | 209 | |
| 209 | 210 | // reset line asserted: reset. |
| 210 | eeprom | |
| 211 | eeprom->set_cs_line( | |
| 211 | 212 | |
| 212 | 213 | // clock line asserted: write latch or select next bit to read |
| 213 | eeprom | |
| 214 | eeprom->set_clock_line( | |
| 214 | 215 | } |
| 215 | 216 | } |
| 216 | 217 | |
| r11517 | r11518 | |
| 507 | 508 | PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 508 | 509 | PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 509 | 510 | PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 510 | PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) // EEPROM | |
| 511 | PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // EEPROM | |
| 511 | 512 | |
| 512 | 513 | PORT_START("Y0") /* $800140.b */ |
| 513 | 514 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) |
| r11517 | r11518 | |
|---|---|---|
| 162 | 162 | { |
| 163 | 163 | /* pressing the service switch sends an NMI */ |
| 164 | 164 | if (newval) |
| 165 | cputag_set_input_line(field | |
| 165 | cputag_set_input_line(field. | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| r11517 | r11518 | |
| 293 | 293 | |
| 294 | 294 | static CUSTOM_INPUT( elim4_joint_coin_r ) |
| 295 | 295 | { |
| 296 | return (input_port_read(field | |
| 296 | return (input_port_read(field. | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 |
| r11517 | r11518 | |
|---|---|---|
| 259 | 259 | |
| 260 | 260 | static CUSTOM_INPUT( ebases_trackball_r ) |
| 261 | 261 | { |
| 262 | astrocde_state *state = field | |
| 262 | astrocde_state *state = field. | |
| 263 | 263 | static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" }; |
| 264 | return input_port_read(field | |
| 264 | return input_port_read(field. | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | |
| r11517 | r11518 | |
| 487 | 487 | |
| 488 | 488 | static CUSTOM_INPUT( demndragn_joystick_r ) |
| 489 | 489 | { |
| 490 | astrocde_state *state = field | |
| 490 | astrocde_state *state = field. | |
| 491 | 491 | static const char *const names[] = { "MOVEX", "MOVEY" }; |
| 492 | return input_port_read(field | |
| 492 | return input_port_read(field. | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
| r11517 | r11518 | |
| 841 | 841 | |
| 842 | 842 | static INPUT_CHANGED( spacezap_monitor ) |
| 843 | 843 | { |
| 844 | astrocde_state *state = field | |
| 844 | astrocde_state *state = field. | |
| 845 | 845 | if (newval) |
| 846 | 846 | state->m_video_config &= ~AC_MONITOR_BW; |
| 847 | 847 | else |
| r11517 | r11518 | |
|---|---|---|
| 242 | 242 | |
| 243 | 243 | static INPUT_CHANGED( trigger_nmi ) |
| 244 | 244 | { |
| 245 | cputag_set_input_line(field | |
| 245 | cputag_set_input_line(field. | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /*------------------------------------------------- |
| r11517 | r11518 | |
|---|---|---|
| 779 | 779 | } |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field | |
| 782 | static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field. | |
| 783 | 783 | |
| 784 | 784 | static WRITE8_DEVICE_HANDLER( out_0 ) |
| 785 | 785 | { |
| r11517 | r11518 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | static INPUT_CHANGED( coin_inserted ) |
| 40 | 40 | { |
| 41 | lasso_state *state = field | |
| 41 | lasso_state *state = field. | |
| 42 | 42 | |
| 43 | 43 | /* coin insertion causes an NMI */ |
| 44 | 44 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| r11517 | r11518 | |
|---|---|---|
| 1155 | 1155 | |
| 1156 | 1156 | static CUSTOM_INPUT( sflush_80_r ) |
| 1157 | 1157 | { |
| 1158 | return (field | |
| 1158 | return (field. | |
| 1159 | 1159 | } |
| 1160 | 1160 | |
| 1161 | 1161 | static ADDRESS_MAP_START( sflush_map, AS_PROGRAM, 8 ) |
| r11517 | r11518 | |
|---|---|---|
| 336 | 336 | if (data & 4) |
| 337 | 337 | popmessage("OBPRI SET!"); |
| 338 | 338 | |
| 339 | eeprom_write_bit(state->m_eeprom, data & 0x40); | |
| 340 | eeprom_set_clock_line(state->m_eeprom, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 341 | eeprom_set_cs_line(state->m_eeprom, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 339 | state->m_eeprom->write_bit(data & 0x40); | |
| 340 | state->m_eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 341 | state->m_eeprom->set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 342 | 342 | break; |
| 343 | 343 | |
| 344 | 344 | default: |
| r11517 | r11518 | |
| 359 | 359 | switch (offset) |
| 360 | 360 | { |
| 361 | 361 | case 0x03: |
| 362 | return ( | |
| 362 | return ( | |
| 363 | 363 | |
| 364 | 364 | default: |
| 365 | 365 | return tc0220ioc_r(state->m_tc0220ioc, offset); |
| r11517 | r11518 | |
| 685 | 685 | |
| 686 | 686 | state->m_maincpu = machine.device("maincpu"); |
| 687 | 687 | state->m_audiocpu = machine.device("audiocpu"); |
| 688 | state->m_eeprom = machine.device("eeprom"); | |
| 688 | state->m_eeprom = machine.device<eeprom_device>("eeprom"); | |
| 689 | 689 | state->m_tc0220ioc = machine.device("tc0220ioc"); |
| 690 | 690 | state->m_tc0100scn = machine.device("tc0100scn"); |
| 691 | 691 | state->m_tc0110pcr = machine.device("tc0110pcr"); |
| r11517 | r11518 | |
|---|---|---|
| 169 | 169 | { |
| 170 | 170 | if (ACCESSING_BITS_16_31) |
| 171 | 171 | { |
| 172 | eeprom_write_bit(device, (data & 0x00200000) ? 1 : 0); | |
| 173 | eeprom_set_cs_line(device, (data & 0x00800000) ? CLEAR_LINE : ASSERT_LINE); | |
| 174 | eeprom_set_clock_line(device, (data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE); | |
| 172 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 173 | eeprom->write_bit((data & 0x00200000) ? 1 : 0); | |
| 174 | eeprom->set_cs_line((data & 0x00800000) ? CLEAR_LINE : ASSERT_LINE); | |
| 175 | eeprom->set_clock_line((data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE); | |
| 175 | 176 | |
| 176 | 177 | return; |
| 177 | 178 | } |
| r11517 | r11518 | |
| 198 | 199 | |
| 199 | 200 | static CUSTOM_INPUT( system_port_r ) |
| 200 | 201 | { |
| 201 | return input_port_read(field | |
| 202 | return input_port_read(field. | |
| 202 | 203 | } |
| 203 | 204 | |
| 204 | 205 | static CUSTOM_INPUT( mahjong_ctrl_r ) /* used by hotgmck/hgkairak */ |
| 205 | 206 | { |
| 206 | psikyo4_state *state = field | |
| 207 | psikyo4_state *state = field. | |
| 207 | 208 | int player = (FPTR)param; |
| 208 | 209 | int sel = (state->m_io_select[0] & 0x0000ff00) >> 8; |
| 209 | 210 | int ret = 0xff; |
| 210 | 211 | |
| 211 | if (sel & 1) ret &= input_port_read(field->machine(), player ? "KEY4" : "KEY0" ); | |
| 212 | if (sel & 2) ret &= input_port_read(field->machine(), player ? "KEY5" : "KEY1" ); | |
| 213 | if (sel & 4) ret &= input_port_read(field->machine(), player ? "KEY6" : "KEY2" ); | |
| 214 | if (sel & 8) ret &= input_port_read(field->machine(), player ? "KEY7" : "KEY3" ); | |
| 212 | if (sel & 1) ret &= input_port_read(field.machine(), player ? "KEY4" : "KEY0" ); | |
| 213 | if (sel & 2) ret &= input_port_read(field.machine(), player ? "KEY5" : "KEY1" ); | |
| 214 | if (sel & 4) ret &= input_port_read(field.machine(), player ? "KEY6" : "KEY2" ); | |
| 215 | if (sel & 8) ret &= input_port_read(field.machine(), player ? "KEY7" : "KEY3" ); | |
| 215 | 216 | |
| 216 | 217 | return ret; |
| 217 | 218 | } |
| r11517 | r11518 | |
| 415 | 416 | |
| 416 | 417 | PORT_START("JP4")/* jumper pads 'JP4' on the PCB */ |
| 417 | 418 | /* EEPROM is read here */ |
| 418 | PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 419 | PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 419 | 420 | |
| 420 | 421 | PORT_START("SYSTEM") /* system inputs */ |
| 421 | 422 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) // Screen 1 |
| r11517 | r11518 | |
| 598 | 599 | PORT_DIPSETTING( 0x00000000, "Japan (Shows Version Number)" ) |
| 599 | 600 | PORT_DIPSETTING( 0x00010000, "World (Does Not Show Version Number)" ) |
| 600 | 601 | /* EEPROM is read here */ |
| 601 | PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 602 | PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 602 | 603 | INPUT_PORTS_END |
| 603 | 604 | |
| 604 | 605 | /* unused inputs also act as duplicate buttons */ |
| r11517 | r11518 | |
| 681 | 682 | |
| 682 | 683 | PORT_START("JP4")/* jumper pads 'JP4' on the PCB */ |
| 683 | 684 | /* EEPROM is read here */ |
| 684 | PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 685 | PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 685 | 686 | INPUT_PORTS_END |
| 686 | 687 | |
| 687 | 688 |
| r11517 | r11518 | |
|---|---|---|
| 414 | 414 | |
| 415 | 415 | static INPUT_CHANGED( keypad_interrupt ) |
| 416 | 416 | { |
| 417 | esripsys_state *state = field | |
| 417 | esripsys_state *state = field. | |
| 418 | 418 | if (newval == 0) |
| 419 | 419 | { |
| 420 | 420 | state->m_io_firq_status |= 2; |
| 421 | 421 | state->m_keypad_status |= 0x20; |
| 422 | cputag_set_input_line(field | |
| 422 | cputag_set_input_line(field. | |
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | static INPUT_CHANGED( coin_interrupt ) |
| 427 | 427 | { |
| 428 | esripsys_state *state = field | |
| 428 | esripsys_state *state = field. | |
| 429 | 429 | if (newval == 1) |
| 430 | 430 | { |
| 431 | 431 | state->m_io_firq_status |= 2; |
| 432 | state->m_coin_latch = input_port_read(field->machine(), "COINS") << 2; | |
| 433 | cputag_set_input_line(field->machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE); | |
| 432 | state->m_coin_latch = input_port_read(field.machine(), "COINS") << 2; | |
| 433 | cputag_set_input_line(field.machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE); | |
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 |
| r11517 | r11518 | |
|---|---|---|
| 614 | 614 | |
| 615 | 615 | static CUSTOM_INPUT( laserdisc_enter_r ) |
| 616 | 616 | { |
| 617 | thayers_state *state = field | |
| 617 | thayers_state *state = field. | |
| 618 | 618 | switch (laserdisc_get_type(state->m_laserdisc)) |
| 619 | 619 | { |
| 620 | 620 | case LASERDISC_TYPE_PIONEER_PR7820: |
| r11517 | r11518 | |
| 629 | 629 | |
| 630 | 630 | static CUSTOM_INPUT( laserdisc_ready_r ) |
| 631 | 631 | { |
| 632 | thayers_state *state = field | |
| 632 | thayers_state *state = field. | |
| 633 | 633 | switch (laserdisc_get_type(state->m_laserdisc)) |
| 634 | 634 | { |
| 635 | 635 | case LASERDISC_TYPE_PIONEER_PR7820: |
| r11517 | r11518 | |
|---|---|---|
| 346 | 346 | |
| 347 | 347 | static CUSTOM_INPUT(rndbit_r) |
| 348 | 348 | { |
| 349 | return field | |
| 349 | return field. | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | static ADDRESS_MAP_START( pitboss_map, AS_PROGRAM, 8 ) |
| r11517 | r11518 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | static INPUT_CHANGED( coin_inserted ) |
| 201 | 201 | { |
| 202 | cputag_set_input_line_and_vector(field | |
| 202 | cputag_set_input_line_and_vector(field. | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 |
| r11517 | r11518 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static CUSTOM_INPUT( hopper_r ) |
| 107 | 107 | { |
| 108 | running_machine &machine = field | |
| 108 | running_machine &machine = field. | |
| 109 | 109 | spoker_state *state = machine.driver_data<spoker_state>(); |
| 110 | 110 | |
| 111 | 111 | if (state->m_hopper) return !(machine.primary_screen->frame_number()%10); |
| r11517 | r11518 | |
|---|---|---|
| 19 | 19 | static INPUT_CHANGED( coin_inserted ) |
| 20 | 20 | { |
| 21 | 21 | /* coin insertion causes an NMI */ |
| 22 | cputag_set_input_line(field | |
| 22 | cputag_set_input_line(field. | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 |
| r11517 | r11518 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | static WRITE32_DEVICE_HANDLER( eeprom_w ) |
| 152 | 152 | { |
| 153 | eeprom_write_bit(device, (data&0x01) ? 1 : 0); | |
| 154 | eeprom_set_clock_line(device, (data&0x04) ? ASSERT_LINE : CLEAR_LINE); | |
| 155 | eeprom_set_cs_line(device, (data&0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 153 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 154 | eeprom->write_bit((data&0x01) ? 1 : 0); | |
| 155 | eeprom->set_clock_line((data&0x04) ? ASSERT_LINE : CLEAR_LINE); | |
| 156 | eeprom->set_cs_line((data&0x02) ? CLEAR_LINE : ASSERT_LINE); | |
| 156 | 157 | } |
| 157 | 158 | |
| 158 | 159 | static WRITE32_HANDLER( mb89371_w ) |
| r11517 | r11518 | |
| 380 | 381 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 381 | 382 | PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 382 | 383 | PORT_SERVICE_NO_TOGGLE( 0x00001000, IP_ACTIVE_LOW ) |
| 383 | PORT_BIT( 0x00002000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE( "eeprom", eeprom_read_bit ) | |
| 384 | PORT_BIT( 0x00002000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER( "eeprom", eeprom_device, read_bit ) | |
| 384 | 385 | PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 385 | 386 | PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 386 | 387 | PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | if( ACCESSING_BITS_0_7 ) |
| 80 | 80 | { |
| 81 | eeprom_write_bit(device, data & 0x01); | |
| 82 | eeprom_set_cs_line(device, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE ); | |
| 83 | eeprom_set_clock_line(device, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE ); | |
| 81 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 82 | eeprom->write_bit(data & 0x01); | |
| 83 | eeprom->set_cs_line((data & 0x02) ? CLEAR_LINE : ASSERT_LINE ); | |
| 84 | eeprom->set_clock_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE ); | |
| 84 | 85 | } |
| 85 | 86 | } |
| 86 | 87 | |
| r11517 | r11518 | |
| 138 | 139 | PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW ) |
| 139 | 140 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 140 | 141 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 141 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* eeprom */ | |
| 142 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* eeprom */ | |
| 142 | 143 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 143 | 144 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 144 | 145 | INPUT_PORTS_END |
| r11517 | r11518 | |
|---|---|---|
| 534 | 534 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* PARAACK */ |
| 535 | 535 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 536 | 536 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("adc0838",adc083x_sars_read) |
| 537 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom",eeprom_read_bit) | |
| 537 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom",eeprom_device,read_bit) | |
| 538 | 538 | |
| 539 | 539 | PORT_START("EEPROMOUT") |
| 540 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 541 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 542 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 540 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 541 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 542 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 543 | 543 | |
| 544 | 544 | PORT_START("OUT4") |
| 545 | 545 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("adc0838", adc083x_cs_write) |
| r11517 | r11518 | |
|---|---|---|
| 1653 | 1653 | |
| 1654 | 1654 | static CUSTOM_INPUT( gn845pwbb_read ) |
| 1655 | 1655 | { |
| 1656 | ksys573_state *state = field | |
| 1656 | ksys573_state *state = field. | |
| 1657 | 1657 | |
| 1658 | return input_port_read(field | |
| 1658 | return input_port_read(field. | |
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | static void gn845pwbb_output_callback( running_machine &machine, int offset, int data ) |
| r11517 | r11518 | |
| 2881 | 2881 | |
| 2882 | 2882 | static CUSTOM_INPUT( gunmania_tank_shutter_sensor ) |
| 2883 | 2883 | { |
| 2884 | ksys573_state *state = field | |
| 2884 | ksys573_state *state = field. | |
| 2885 | 2885 | |
| 2886 | 2886 | if( state->m_tank_shutter_position == 0 ) |
| 2887 | 2887 | { |
| r11517 | r11518 | |
| 2893 | 2893 | |
| 2894 | 2894 | static CUSTOM_INPUT( gunmania_cable_holder_sensor ) |
| 2895 | 2895 | { |
| 2896 | ksys573_state *state = field | |
| 2896 | ksys573_state *state = field. | |
| 2897 | 2897 | |
| 2898 | 2898 | return state->m_cable_holder_release; |
| 2899 | 2899 | } |
| r11517 | r11518 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | static CUSTOM_INPUT( clock_r ) |
| 318 | 318 | { |
| 319 | return (field | |
| 319 | return (field. | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 |
| r11517 | r11518 | |
|---|---|---|
| 222 | 222 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 223 | 223 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) |
| 224 | 224 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 225 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 225 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 226 | 226 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 227 | 227 | |
| 228 | 228 | PORT_START("SYSTEM") |
| r11517 | r11518 | |
| 239 | 239 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(50) |
| 240 | 240 | |
| 241 | 241 | PORT_START( "EEPROMOUT" ) |
| 242 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 243 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 244 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 242 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 243 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 244 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 245 | 245 | INPUT_PORTS_END |
| 246 | 246 | |
| 247 | 247 |
| r11517 | r11518 | |
|---|---|---|
| 109 | 109 | case 0x1c: return input_port_read(space->machine(),"BET"); |
| 110 | 110 | case 0x1e: return 0xff; //ticket motor |
| 111 | 111 | case 0x20: return 0xff; //hopper motor |
| 112 | case 0x2c: return eeprom_read_bit(space->machine().device("eeprom")); | |
| 113 | case 0x2e: return eeprom_read_bit(space->machine().device("eeprom")); | |
| 112 | case 0x2c: return space->machine().device<eeprom_device>("eeprom")->read_bit(); | |
| 113 | case 0x2e: return space->machine().device<eeprom_device>("eeprom")->read_bit(); | |
| 114 | 114 | // default: printf("R %02x\n",offset*2); break; |
| 115 | 115 | } |
| 116 | 116 | |
| r11517 | r11518 | |
| 138 | 138 | case 0x4a: /* ---- ---x Ticket motor */break; |
| 139 | 139 | case 0x4c: /* ---- ---x Hopper motor */break; |
| 140 | 140 | case 0x4e: state->m_map_vreg = data & 1; break; |
| 141 | case 0x50: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; | |
| 142 | case 0x52: eeprom_set_clock_line(space->machine().device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break; | |
| 143 | case 0x54: eeprom_write_bit(space->machine().device("eeprom"), data & 1); break; | |
| 144 | // case 0x5a: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; | |
| 145 | // case 0x5c: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; | |
| 141 | case 0x50: space->machine().device<eeprom_device>("eeprom")->set_cs_line((data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; | |
| 142 | case 0x52: space->machine().device<eeprom_device>("eeprom")->set_clock_line((data & 1) ? ASSERT_LINE : CLEAR_LINE ); break; | |
| 143 | case 0x54: space->machine().device<eeprom_device>("eeprom")->write_bit(data & 1); break; | |
| 144 | // case 0x5a: space->machine().device<eeprom_device>("eeprom")->set_cs_line((data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; | |
| 145 | // case 0x5c: space->machine().device<eeprom_device>("eeprom")->set_cs_line((data & 1) ? CLEAR_LINE : ASSERT_LINE ); break; | |
| 146 | 146 | case 0x60: break; |
| 147 | 147 | // default: printf("[%02x] <- %02x W\n",offset*2,data); break; |
| 148 | 148 | } |
| r11517 | r11518 | |
| 151 | 151 | if(offset*2 == 0x54) |
| 152 | 152 | { |
| 153 | 153 | printf("Write bit %02x\n",data); |
| 154 | | |
| 154 | | |
| 155 | 155 | } |
| 156 | 156 | if(offset*2 == 0x52) |
| 157 | 157 | { |
| 158 | 158 | printf("Clock bit %02x\n",data); |
| 159 | | |
| 159 | | |
| 160 | 160 | } |
| 161 | 161 | if(offset*2 == 0x50) |
| 162 | 162 | { |
| 163 | 163 | printf("chip select bit %02x\n",data); |
| 164 | | |
| 164 | | |
| 165 | 165 | } |
| 166 | 166 | #endif |
| 167 | 167 | } |
| r11517 | r11518 | |
|---|---|---|
| 211 | 211 | |
| 212 | 212 | PORT_START("EEPROM") |
| 213 | 213 | PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */ |
| 214 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 214 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 215 | 215 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* EEPROM status - always 1 */ |
| 216 | 216 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) |
| 217 | 217 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 ) |
| r11517 | r11518 | |
| 222 | 222 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */ |
| 223 | 223 | |
| 224 | 224 | PORT_START( "EEPROMOUT" ) |
| 225 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 226 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 227 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 225 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 226 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 227 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 228 | 228 | INPUT_PORTS_END |
| 229 | 229 | |
| 230 | 230 | static INPUT_PORTS_START( xmen2p ) |
| r11517 | r11518 | |
| 240 | 240 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 241 | 241 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE2 ) |
| 242 | 242 | PORT_BIT( 0x003c, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */ |
| 243 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 243 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 244 | 244 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* EEPROM status - always 1 */ |
| 245 | 245 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) |
| 246 | 246 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 ) |
| r11517 | r11518 | |
| 251 | 251 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */ |
| 252 | 252 | |
| 253 | 253 | PORT_START( "EEPROMOUT" ) |
| 254 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 255 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 256 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 254 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 255 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 256 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 257 | 257 | INPUT_PORTS_END |
| 258 | 258 | |
| 259 | 259 | static CUSTOM_INPUT( xmen_frame_r ) |
| 260 | 260 | { |
| 261 | xmen_state *state = field | |
| 261 | xmen_state *state = field. | |
| 262 | 262 | return state->m_current_frame; |
| 263 | 263 | } |
| 264 | 264 | |
| r11517 | r11518 | |
| 277 | 277 | |
| 278 | 278 | PORT_START("EEPROM") |
| 279 | 279 | PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */ |
| 280 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 280 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 281 | 281 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* EEPROM status - always 1 */ |
| 282 | 282 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) |
| 283 | 283 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 ) |
| r11517 | r11518 | |
| 289 | 289 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(xmen_frame_r, NULL) /* screen indicator? */ |
| 290 | 290 | |
| 291 | 291 | PORT_START( "EEPROMOUT" ) |
| 292 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 293 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 294 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 292 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 293 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 294 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 295 | 295 | INPUT_PORTS_END |
| 296 | 296 | |
| 297 | 297 |
| r11517 | r11518 | |
|---|---|---|
| 513 | 513 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) |
| 514 | 514 | |
| 515 | 515 | PORT_START("DSW") |
| 516 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 516 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 517 | 517 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* it must be 1 ? */ |
| 518 | 518 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 519 | 519 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 531 | 531 | PORT_DIPSETTING( 0x0080, DEF_STR( Stereo ) ) |
| 532 | 532 | |
| 533 | 533 | PORT_START( "EEPROMOUT" ) |
| 534 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 535 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 536 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 534 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 535 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 536 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 537 | 537 | |
| 538 | 538 | PORT_START("LIGHT0_X") |
| 539 | 539 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| r11517 | r11518 | |
|---|---|---|
| 280 | 280 | |
| 281 | 281 | static INPUT_CHANGED( coin_inserted_deco16 ) |
| 282 | 282 | { |
| 283 | exprraid_state *state = field | |
| 283 | exprraid_state *state = field. | |
| 284 | 284 | device_set_input_line(state->m_maincpu, DECO16_IRQ_LINE, newval ? CLEAR_LINE : ASSERT_LINE); |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | static INPUT_CHANGED( coin_inserted_nmi ) |
| 288 | 288 | { |
| 289 | exprraid_state *state = field | |
| 289 | exprraid_state *state = field. | |
| 290 | 290 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| 291 | 291 | } |
| 292 | 292 |
| r11517 | r11518 | |
|---|---|---|
| 284 | 284 | |
| 285 | 285 | static INPUT_CHANGED( coin_inserted ) |
| 286 | 286 | { |
| 287 | cputag_set_input_line(field | |
| 287 | cputag_set_input_line(field. | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | static INPUT_PORTS_START( naughtyb ) |
| r11517 | r11518 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | static CUSTOM_INPUT( coin_word_r ) |
| 82 | 82 | { |
| 83 | gunbustr_state *state = field | |
| 83 | gunbustr_state *state = field. | |
| 84 | 84 | return state->m_coin_word; |
| 85 | 85 | } |
| 86 | 86 | |
| r11517 | r11518 | |
| 109 | 109 | |
| 110 | 110 | if (ACCESSING_BITS_0_7) |
| 111 | 111 | { |
| 112 | device_t *device = space->machine().device("eeprom"); | |
| 113 | eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 114 | eeprom_write_bit(device, data & 0x40); | |
| 115 | eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 112 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 113 | eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); | |
| 114 | eeprom->write_bit(data & 0x40); | |
| 115 | eeprom->set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE); | |
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | 118 | return; |
| r11517 | r11518 | |
| 220 | 220 | PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 221 | 221 | PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 222 | 222 | PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 223 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 223 | PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 224 | 224 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 225 | 225 | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 226 | 226 | PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| r11517 | r11518 | |
|---|---|---|
| 1256 | 1256 | switch (offset) |
| 1257 | 1257 | { |
| 1258 | 1258 | case 0x03: |
| 1259 | return | |
| 1259 | return | |
| 1260 | 1260 | |
| 1261 | 1261 | default: |
| 1262 | 1262 | return tc0220ioc_r(state->m_tc0220ioc, offset); /* might be a 510NIO ! */ |
| r11517 | r11518 | |
| 2638 | 2638 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2639 | 2639 | |
| 2640 | 2640 | PORT_START( "EEPROMOUT" ) |
| 2641 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 2642 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 2643 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 2641 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 2642 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 2643 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 2644 | 2644 | |
| 2645 | 2645 | PORT_START("STICKX1") |
| 2646 | 2646 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(1) |
| r11517 | r11518 | |
| 2971 | 2971 | state->m_maincpu = machine.device("maincpu"); |
| 2972 | 2972 | state->m_subcpu = machine.device("sub"); |
| 2973 | 2973 | state->m_audiocpu = machine.device("audiocpu"); |
| 2974 | state->m_eeprom = machine.device("eeprom"); | |
| 2974 | state->m_eeprom = machine.device<eeprom_device>("eeprom"); | |
| 2975 | 2975 | state->m_tc0100scn = machine.device("tc0100scn"); |
| 2976 | 2976 | state->m_tc0150rod = machine.device("tc0150rod"); |
| 2977 | 2977 | state->m_tc0480scp = machine.device("tc0480scp"); |
| r11517 | r11518 | |
|---|---|---|
| 152 | 152 | { |
| 153 | 153 | if (ACCESSING_BITS_0_7) |
| 154 | 154 | { |
| 155 | eeprom_write_bit(device, data & 0x01); | |
| 156 | eeprom_set_cs_line(device, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE ); | |
| 157 | eeprom_set_clock_line(device, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE ); | |
| 155 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 156 | eeprom->write_bit(data & 0x01); | |
| 157 | eeprom->set_cs_line((data & 0x02) ? CLEAR_LINE : ASSERT_LINE ); | |
| 158 | eeprom->set_clock_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE ); | |
| 158 | 159 | } |
| 159 | 160 | } |
| 160 | 161 | |
| r11517 | r11518 | |
| 202 | 203 | |
| 203 | 204 | static CUSTOM_INPUT( ticket_status_r ) |
| 204 | 205 | { |
| 205 | pzletime_state *state = field->machine().driver_data<pzletime_state>(); | |
| 206 | return (state->m_ticket && !(field->machine().primary_screen->frame_number() % 128)); | |
| 206 | pzletime_state *state = field.machine().driver_data<pzletime_state>(); | |
| 207 | return (state->m_ticket && !(field.machine().primary_screen->frame_number() % 128)); | |
| 207 | 208 | } |
| 208 | 209 | |
| 209 | 210 | static ADDRESS_MAP_START( pzletime_map, AS_PROGRAM, 16 ) |
| r11517 | r11518 | |
| 231 | 232 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_VBLANK ) |
| 232 | 233 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 233 | 234 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 234 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* eeprom */ | |
| 235 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* eeprom */ | |
| 235 | 236 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ticket_status_r, NULL) /* ticket dispenser */ |
| 236 | 237 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 237 | 238 |
| r11517 | r11518 | |
|---|---|---|
| 161 | 161 | { |
| 162 | 162 | pntnpuzl_state *state = device->machine().driver_data<pntnpuzl_state>(); |
| 163 | 163 | /* bit 11 is EEPROM data */ |
| 164 | return (state->m_eeprom & 0xf4ff) | (eeprom_read_bit(device)<<11) | (input_port_read(device->machine(), "IN1") & 0x0300); | |
| 164 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 165 | return (state->m_eeprom & 0xf4ff) | (eeprom->read_bit()<<11) | (input_port_read(device->machine(), "IN1") & 0x0300); | |
| 165 | 166 | } |
| 166 | 167 | |
| 167 | 168 | static WRITE16_DEVICE_HANDLER( pntnpuzl_eeprom_w ) |
| r11517 | r11518 | |
| 173 | 174 | /* bit 13 is clock (active high) */ |
| 174 | 175 | /* bit 14 is cs (active high) */ |
| 175 | 176 | |
| 176 | eeprom_write_bit(device, data & 0x1000); | |
| 177 | eeprom_set_cs_line(device, (data & 0x4000) ? CLEAR_LINE : ASSERT_LINE); | |
| 178 | eeprom_set_clock_line(device, (data & 0x2000) ? ASSERT_LINE : CLEAR_LINE); | |
| 177 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 178 | eeprom->write_bit(data & 0x1000); | |
| 179 | eeprom->set_cs_line((data & 0x4000) ? CLEAR_LINE : ASSERT_LINE); | |
| 180 | eeprom->set_clock_line((data & 0x2000) ? ASSERT_LINE : CLEAR_LINE); | |
| 179 | 181 | } |
| 180 | 182 | |
| 181 | 183 |
| r11517 | r11518 | |
|---|---|---|
| 249 | 249 | if ( ACCESSING_BITS_24_31 ) |
| 250 | 250 | { |
| 251 | 251 | // latch the bit |
| 252 | eeprom_write_bit(device, data & 0x04000000); | |
| 252 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 253 | eeprom->write_bit(data & 0x04000000); | |
| 253 | 254 | |
| 254 | 255 | // reset line asserted: reset. |
| 255 | eeprom | |
| 256 | eeprom->set_cs_line( | |
| 256 | 257 | |
| 257 | 258 | // clock line asserted: write latch or select next bit to read |
| 258 | eeprom | |
| 259 | eeprom->set_clock_line( | |
| 259 | 260 | } |
| 260 | 261 | } |
| 261 | 262 | |
| r11517 | r11518 | |
| 421 | 422 | PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) // test |
| 422 | 423 | PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // door 1 |
| 423 | 424 | PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // door 2 |
| 424 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 425 | PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 425 | 426 | PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 ) // start |
| 426 | 427 | PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Payout") PORT_CODE(KEYCODE_LCONTROL) // payout |
| 427 | 428 | PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Cancel") PORT_CODE(KEYCODE_LALT) // cancel |
| r11517 | r11518 | |
|---|---|---|
| 657 | 657 | |
| 658 | 658 | static CUSTOM_INPUT( gekisou_unknown_status ) |
| 659 | 659 | { |
| 660 | equites_state *state = field | |
| 660 | equites_state *state = field. | |
| 661 | 661 | return state->m_unknown_bit; |
| 662 | 662 | } |
| 663 | 663 |
| r11517 | r11518 | |
|---|---|---|
| 631 | 631 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 632 | 632 | |
| 633 | 633 | PORT_START("IN1") |
| 634 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 634 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 635 | 635 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 636 | 636 | PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) |
| 637 | 637 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* game loops if this is set */ |
| r11517 | r11518 | |
| 655 | 655 | KONAMI16_MSB(4, IPT_BUTTON3, IPT_START4 ) |
| 656 | 656 | |
| 657 | 657 | PORT_START( "EEPROMOUT" ) |
| 658 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 659 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 660 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 658 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 659 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 660 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 661 | 661 | INPUT_PORTS_END |
| 662 | 662 | |
| 663 | 663 | static INPUT_PORTS_START( metamrph ) |
| r11517 | r11518 | |
| 672 | 672 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 673 | 673 | |
| 674 | 674 | PORT_START("IN1") |
| 675 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 675 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 676 | 676 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 677 | 677 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) |
| 678 | 678 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) |
| r11517 | r11518 | |
| 698 | 698 | KONAMI16_MSB(4, IPT_BUTTON3, IPT_START4 ) |
| 699 | 699 | |
| 700 | 700 | PORT_START( "EEPROMOUT" ) |
| 701 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 702 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 703 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 701 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 702 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 703 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 704 | 704 | INPUT_PORTS_END |
| 705 | 705 | |
| 706 | 706 | static INPUT_PORTS_START( viostorm ) |
| r11517 | r11518 | |
| 715 | 715 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 716 | 716 | |
| 717 | 717 | PORT_START("IN1") |
| 718 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 718 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 719 | 719 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 720 | 720 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) |
| 721 | 721 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) |
| r11517 | r11518 | |
| 741 | 741 | KONAMI16_MSB(4, IPT_BUTTON3, IPT_START4 ) |
| 742 | 742 | |
| 743 | 743 | PORT_START( "EEPROMOUT" ) |
| 744 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 745 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 746 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 744 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 745 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 746 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 747 | 747 | INPUT_PORTS_END |
| 748 | 748 | |
| 749 | 749 | static INPUT_PORTS_START( dadandrn ) |
| r11517 | r11518 | |
| 759 | 759 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 760 | 760 | |
| 761 | 761 | PORT_START("IN1") |
| 762 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 762 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 763 | 763 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 764 | 764 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) |
| 765 | 765 | PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) |
| r11517 | r11518 | |
| 782 | 782 | KONAMI8_B123_START(4) |
| 783 | 783 | |
| 784 | 784 | PORT_START( "EEPROMOUT" ) |
| 785 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 786 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 787 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 785 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 786 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 787 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 788 | 788 | INPUT_PORTS_END |
| 789 | 789 | |
| 790 | 790 | static INPUT_PORTS_START( martchmp ) |
| r11517 | r11518 | |
| 799 | 799 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 800 | 800 | |
| 801 | 801 | PORT_START("IN1") |
| 802 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 802 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 803 | 803 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM ready (always 1) */ |
| 804 | 804 | PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) |
| 805 | 805 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* game loops if this is set */ |
| r11517 | r11518 | |
| 821 | 821 | KONAMI16_MSB(4, IPT_BUTTON3, IPT_START4 ) |
| 822 | 822 | |
| 823 | 823 | PORT_START( "EEPROMOUT" ) |
| 824 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 825 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 826 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 824 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 825 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 826 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 827 | 827 | INPUT_PORTS_END |
| 828 | 828 | |
| 829 | 829 | /**********************************************************************************/ |
| r11517 | r11518 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | static CUSTOM_INPUT( laserdisc_status_r ) |
| 318 | 318 | { |
| 319 | dlair_state *state = field | |
| 319 | dlair_state *state = field. | |
| 320 | 320 | switch (laserdisc_get_type(state->m_laserdisc)) |
| 321 | 321 | { |
| 322 | 322 | case LASERDISC_TYPE_PIONEER_PR7820: |
| r11517 | r11518 | |
| 334 | 334 | |
| 335 | 335 | static CUSTOM_INPUT( laserdisc_command_r ) |
| 336 | 336 | { |
| 337 | dlair_state *state = field | |
| 337 | dlair_state *state = field. | |
| 338 | 338 | switch (laserdisc_get_type(state->m_laserdisc)) |
| 339 | 339 | { |
| 340 | 340 | case LASERDISC_TYPE_PIONEER_PR7820: |
| r11517 | r11518 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | static INPUT_CHANGED( service_mode_switch_changed ) |
| 31 | 31 | { |
| 32 | set_service_mode(field | |
| 32 | set_service_mode(field. | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | static INPUT_CHANGED( firetrk_horn_changed ) |
| 37 | 37 | { |
| 38 | device_t *discrete = field | |
| 38 | device_t *discrete = field. | |
| 39 | 39 | discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | static INPUT_CHANGED( gear_changed ) |
| 44 | 44 | { |
| 45 | firetrk_state *state = field | |
| 45 | firetrk_state *state = field. | |
| 46 | 46 | if (newval) |
| 47 | 47 | state->m_gear = (FPTR)param; |
| 48 | 48 | } |
| r11517 | r11518 | |
| 200 | 200 | |
| 201 | 201 | static CUSTOM_INPUT( steer_dir_r ) |
| 202 | 202 | { |
| 203 | firetrk_state *state = field | |
| 203 | firetrk_state *state = field. | |
| 204 | 204 | return state->m_steer_dir[(FPTR)param]; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | |
| 208 | 208 | static CUSTOM_INPUT( steer_flag_r ) |
| 209 | 209 | { |
| 210 | firetrk_state *state = field | |
| 210 | firetrk_state *state = field. | |
| 211 | 211 | return state->m_steer_flag[(FPTR)param]; |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| 215 | 215 | static CUSTOM_INPUT( skid_r ) |
| 216 | 216 | { |
| 217 | firetrk_state *state = field | |
| 217 | firetrk_state *state = field. | |
| 218 | 218 | UINT32 ret; |
| 219 | 219 | int which = (FPTR)param; |
| 220 | 220 | |
| r11517 | r11518 | |
| 229 | 229 | |
| 230 | 230 | static CUSTOM_INPUT( crash_r ) |
| 231 | 231 | { |
| 232 | firetrk_state *state = field | |
| 232 | firetrk_state *state = field. | |
| 233 | 233 | UINT32 ret; |
| 234 | 234 | int which = (FPTR)param; |
| 235 | 235 | |
| r11517 | r11518 | |
| 244 | 244 | |
| 245 | 245 | static CUSTOM_INPUT( gear_r ) |
| 246 | 246 | { |
| 247 | firetrk_state *state = field | |
| 247 | firetrk_state *state = field. | |
| 248 | 248 | return (state->m_gear == (FPTR)param) ? 1 : 0; |
| 249 | 249 | } |
| 250 | 250 |
| r11517 | r11518 | |
|---|---|---|
| 799 | 799 | static CUSTOM_INPUT( peplus_input_r ) |
| 800 | 800 | { |
| 801 | 801 | UINT8 inp_ret = 0x00; |
| 802 | UINT8 inp_read = input_port_read(field | |
| 802 | UINT8 inp_read = input_port_read(field. | |
| 803 | 803 | |
| 804 | 804 | if (inp_read & 0x01) inp_ret = 0x01; |
| 805 | 805 | if (inp_read & 0x02) inp_ret = 0x02; |
| r11517 | r11518 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | static CUSTOM_INPUT( prot_r ) |
| 132 | 132 | { |
| 133 | ddayjlc_state *state = field | |
| 133 | ddayjlc_state *state = field. | |
| 134 | 134 | return prot_data[state->m_prot_addr]; |
| 135 | 135 | } |
| 136 | 136 |
| r11517 | r11518 | |
|---|---|---|
| 1392 | 1392 | // excpuint stat, objdma stat, eeprom do |
| 1393 | 1393 | |
| 1394 | 1394 | // note: racin' force expects bit 1 of the eeprom port to toggle |
| 1395 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1395 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1396 | 1396 | PORT_BIT( 0x000000fe, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gx_rdport1_3_r, NULL) |
| 1397 | 1397 | PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 1398 | 1398 | PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_COIN2 ) |
| r11517 | r11518 | |
| 1405 | 1405 | PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED ) /* DIP#1 & DIP#2 */ |
| 1406 | 1406 | |
| 1407 | 1407 | PORT_START( "EEPROMOUT" ) |
| 1408 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 1409 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 1410 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 1408 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 1409 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 1410 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 1411 | 1411 | INPUT_PORTS_END |
| 1412 | 1412 | |
| 1413 | 1413 |
| r11517 | r11518 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | static CUSTOM_INPUT( dorachan_protection_r ) |
| 43 | 43 | { |
| 44 | dorachan_state *state = field | |
| 44 | dorachan_state *state = field. | |
| 45 | 45 | UINT8 ret = 0; |
| 46 | 46 | |
| 47 | 47 | switch (cpu_get_previouspc(state->m_main_cpu)) |
| r11517 | r11518 | |
| 129 | 129 | |
| 130 | 130 | static CUSTOM_INPUT( dorachan_v128_r ) |
| 131 | 131 | { |
| 132 | dorachan_state *state = field | |
| 132 | dorachan_state *state = field. | |
| 133 | 133 | |
| 134 | 134 | /* to avoid resetting (when player 2 starts) bit 0 need to be inverted when screen is flipped */ |
| 135 | return ((field | |
| 135 | return ((field. | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 |
| r11517 | r11518 | |
|---|---|---|
| 157 | 157 | |
| 158 | 158 | static CUSTOM_INPUT( teetert_input_r ) |
| 159 | 159 | { |
| 160 | exidy_state *state = field->machine().driver_data<exidy_state>(); | |
| 161 | UINT8 dial = input_port_read(field->machine(), "DIAL"); | |
| 160 | exidy_state *state = field.machine().driver_data<exidy_state>(); | |
| 161 | UINT8 dial = input_port_read(field.machine(), "DIAL"); | |
| 162 | 162 | int result = 0; |
| 163 | 163 | |
| 164 | 164 | result = (dial != state->m_last_dial) << 4; |
| r11517 | r11518 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | static CUSTOM_INPUT( cdp1869_pcb_r ) |
| 274 | 274 | { |
| 275 | cidelsa_state *state = field | |
| 275 | cidelsa_state *state = field. | |
| 276 | 276 | |
| 277 | 277 | return state->m_cdp1869_pcb; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | static INPUT_CHANGED( ef_w ) |
| 281 | 281 | { |
| 282 | cputag_set_input_line(field | |
| 282 | cputag_set_input_line(field. | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static INPUT_PORTS_START( destryer ) |
| r11517 | r11518 | |
|---|---|---|
| 325 | 325 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 326 | 326 | |
| 327 | 327 | PORT_START("EEPROM") |
| 328 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 328 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 329 | 329 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* EEPROM ready */ |
| 330 | 330 | PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW) |
| 331 | 331 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */ |
| 332 | 332 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 333 | 333 | |
| 334 | 334 | PORT_START( "EEPROMOUT" ) |
| 335 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 336 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 337 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 335 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 336 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 337 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 338 | 338 | INPUT_PORTS_END |
| 339 | 339 | |
| 340 | 340 | static INPUT_PORTS_START( vendetta ) |
| r11517 | r11518 | |
| 381 | 381 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 382 | 382 | |
| 383 | 383 | PORT_START("EEPROM") |
| 384 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 384 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 385 | 385 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* EEPROM ready */ |
| 386 | 386 | PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW) |
| 387 | 387 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */ |
| 388 | 388 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 389 | 389 | |
| 390 | 390 | PORT_START( "EEPROMOUT" ) |
| 391 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 392 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 393 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 391 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 392 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 393 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 394 | 394 | INPUT_PORTS_END |
| 395 | 395 | |
| 396 | 396 | static INPUT_PORTS_START( esckidsj ) |
| r11517 | r11518 | |
|---|---|---|
| 484 | 484 | return_data = input_port_read(space->machine(), "DSW1"); |
| 485 | 485 | |
| 486 | 486 | if (offset == 0x77)//PDR2 read |
| 487 | return_data= (0xfe | | |
| 487 | return_data= (0xfe | | |
| 488 | 488 | |
| 489 | 489 | // if (offset == 0x33) //country code |
| 490 | 490 | // return_data = input_port_read(machine, "FAKE"); |
| r11517 | r11518 | |
| 508 | 508 | |
| 509 | 509 | if(offset == 0x75) |
| 510 | 510 | { |
| 511 | eeprom_device *device = space->machine().device<eeprom_device>("eeprom"); | |
| 512 | eeprom_set_clock_line(device, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 513 | eeprom_write_bit(device, data & 0x10); | |
| 514 | eeprom_set_cs_line(device, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 511 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 512 | eeprom->set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE); | |
| 513 | eeprom->write_bit(data & 0x10); | |
| 514 | eeprom->set_cs_line((data & 0x04) ? CLEAR_LINE : ASSERT_LINE); | |
| 515 | 515 | |
| 516 | 516 | |
| 517 | 517 | // if (data & 0x01) |
| r11517 | r11518 | |
|---|---|---|
| 51 | 51 | const char *tag = (const char *)param; |
| 52 | 52 | UINT32 ipt = 0; |
| 53 | 53 | |
| 54 | ipt = ((input_port_read(field | |
| 54 | ipt = ((input_port_read(field. | |
| 55 | 55 | |
| 56 | 56 | return ipt; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static CUSTOM_INPUT( f3_coin_r ) |
| 60 | 60 | { |
| 61 | taito_f3_state *state = field | |
| 61 | taito_f3_state *state = field. | |
| 62 | 62 | int num = (FPTR)param; |
| 63 | 63 | return state->m_coin_word[num]; |
| 64 | 64 | } |
| r11517 | r11518 | |
| 291 | 291 | |
| 292 | 292 | /* These are not read directly, but through PORT_CUSTOMs above */ |
| 293 | 293 | PORT_START("EEPROMIN") |
| 294 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 294 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 295 | 295 | PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) |
| 296 | 296 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 297 | 297 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* Another service mode */ |
| r11517 | r11518 | |
| 307 | 307 | PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) |
| 308 | 308 | |
| 309 | 309 | PORT_START( "EEPROMOUT" ) |
| 310 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit) | |
| 311 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line) | |
| 312 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line) | |
| 310 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) | |
| 311 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) | |
| 312 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) | |
| 313 | 313 | INPUT_PORTS_END |
| 314 | 314 | |
| 315 | 315 | static INPUT_PORTS_START( kn ) |
| r11517 | r11518 | |
|---|---|---|
| 368 | 368 | |
| 369 | 369 | static INPUT_CHANGED( touchscreen_press ) |
| 370 | 370 | { |
| 371 | jpmsys5_state *state = field | |
| 371 | jpmsys5_state *state = field. | |
| 372 | 372 | if (newval == 0) |
| 373 | 373 | { |
| 374 | 374 | attotime rx_period = attotime::from_hz(10000) * 16; |
| 375 | 375 | |
| 376 | 376 | /* Each touch screen packet is 3 bytes */ |
| 377 | 377 | state->m_touch_data[0] = 0x2a; |
| 378 | state->m_touch_data[1] = 0x7 - (input_port_read(field->machine(), "TOUCH_Y") >> 5) + 0x30; | |
| 379 | state->m_touch_data[2] = (input_port_read(field->machine(), "TOUCH_X") >> 5) + 0x30; | |
| 378 | state->m_touch_data[1] = 0x7 - (input_port_read(field.machine(), "TOUCH_Y") >> 5) + 0x30; | |
| 379 | state->m_touch_data[2] = (input_port_read(field.machine(), "TOUCH_X") >> 5) + 0x30; | |
| 380 | 380 | |
| 381 | 381 | /* Start sending the data to the 68000 serially */ |
| 382 | 382 | state->m_touch_data_count = 0; |
| r11517 | r11518 | |
|---|---|---|
| 252 | 252 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 253 | 253 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) |
| 254 | 254 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 ) |
| 255 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* bit 6 is EEPROM data (DOUT) */ | |
| 255 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* bit 6 is EEPROM data (DOUT) */ | |
| 256 | 256 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL ) /* bit 7 is EEPROM ready */ |
| 257 | 257 | |
| 258 | 258 | PORT_START("LIGHT0_X") |
| r11517 | r11518 | |
| 958 | 958 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 959 | 959 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) |
| 960 | 960 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) |
| 961 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) /* bit 6 is EEPROM data (DOUT) */ | |
| 961 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* bit 6 is EEPROM data (DOUT) */ | |
| 962 | 962 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) /* bit 7 is EEPROM ready */ |
| 963 | 963 | INPUT_PORTS_END |
| 964 | 964 |
| r11517 | r11518 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | static CUSTOM_INPUT( homerun_40_r ) |
| 66 | 66 | { |
| 67 | UINT8 ret = (field | |
| 67 | UINT8 ret = (field. | |
| 68 | 68 | |
| 69 | 69 | return ret; |
| 70 | 70 | } |
| r11517 | r11518 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | static CUSTOM_INPUT( champbas_watchdog_bit2 ) |
| 121 | 121 | { |
| 122 | champbas_state *state = field | |
| 122 | champbas_state *state = field. | |
| 123 | 123 | return BIT(state->m_watchdog_count, 2); |
| 124 | 124 | } |
| 125 | 125 |
| r11517 | r11518 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | static INPUT_CHANGED( coin_inserted ) |
| 53 | 53 | { |
| 54 | cputag_set_input_line(field | |
| 54 | cputag_set_input_line(field. | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static INPUT_PORTS_START( ssozumo ) |
| r11517 | r11518 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | static CUSTOM_INPUT( country_sndpending_r ) |
| 176 | 176 | { |
| 177 | crshrace_state *state = field | |
| 177 | crshrace_state *state = field. | |
| 178 | 178 | return state->m_pending_command; |
| 179 | 179 | } |
| 180 | 180 |
| r11517 | r11518 | |
|---|---|---|
| 466 | 466 | |
| 467 | 467 | static CUSTOM_INPUT( igs_hopper_r ) |
| 468 | 468 | { |
| 469 | igs011_state *state = field->machine().driver_data<igs011_state>(); | |
| 470 | return (state->m_igs_hopper && ((field->machine().primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001; | |
| 469 | igs011_state *state = field.machine().driver_data<igs011_state>(); | |
| 470 | return (state->m_igs_hopper && ((field.machine().primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001; | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | static WRITE16_HANDLER( igs_dips_w ) |
| r11517 | r11518 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | static INPUT_CHANGED( coin_inserted ) |
| 202 | 202 | { |
| 203 | cputag_set_input_line(field | |
| 203 | cputag_set_input_line(field. | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | static INPUT_CHANGED( tilt_pressed ) |
| 207 | 207 | { |
| 208 | cputag_set_input_line(field | |
| 208 | cputag_set_input_line(field. | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | static INPUT_PORTS_START( bwing ) |
| r11517 | r11518 | |
|---|---|---|
| 299 | 299 | coin_counter_w(device->machine(), 0, data & 0x1000); |
| 300 | 300 | |
| 301 | 301 | // latch the bit |
| 302 | eeprom_write_bit(device, data & 0x0800); | |
| 302 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 303 | eeprom->write_bit(data & 0x0800); | |
| 303 | 304 | |
| 304 | 305 | // reset line asserted: reset. |
| 305 | eeprom | |
| 306 | eeprom->set_cs_line( | |
| 306 | 307 | |
| 307 | 308 | // clock line asserted: write latch or select next bit to read |
| 308 | eeprom | |
| 309 | eeprom->set_clock_line( | |
| 309 | 310 | } |
| 310 | 311 | } |
| 311 | 312 | |
| r11517 | r11518 | |
| 320 | 321 | if (ACCESSING_BITS_8_15) // even address |
| 321 | 322 | { |
| 322 | 323 | // latch the bit |
| 323 | eeprom_write_bit(device, data & 0x0800); | |
| 324 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 325 | eeprom->write_bit(data & 0x0800); | |
| 324 | 326 | |
| 325 | 327 | // reset line asserted: reset. |
| 326 | eeprom | |
| 328 | eeprom->set_cs_line( | |
| 327 | 329 | |
| 328 | 330 | // clock line asserted: write latch or select next bit to read |
| 329 | eeprom | |
| 331 | eeprom->set_clock_line( | |
| 330 | 332 | } |
| 331 | 333 | } |
| 332 | 334 | |
| r11517 | r11518 | |
| 343 | 345 | coin_counter_w(device->machine(), 0, data & 0x0001); |
| 344 | 346 | |
| 345 | 347 | // latch the bit |
| 346 | eeprom_write_bit(device, data & 0x80); | |
| 348 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 349 | eeprom->write_bit(data & 0x80); | |
| 347 | 350 | |
| 348 | 351 | // reset line asserted: reset. |
| 349 | eeprom | |
| 352 | eeprom->set_cs_line( | |
| 350 | 353 | |
| 351 | 354 | // clock line asserted: write latch or select next bit to read |
| 352 | eeprom | |
| 355 | eeprom->set_clock_line( | |
| 353 | 356 | } |
| 354 | 357 | } |
| 355 | 358 | |
| r11517 | r11518 | |
| 378 | 381 | if (~data & 0x0100) |
| 379 | 382 | { |
| 380 | 383 | // latch the bit |
| 381 | eeprom_write_bit(device, data & 0x0800); | |
| 384 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 385 | eeprom->write_bit(data & 0x0800); | |
| 382 | 386 | |
| 383 | 387 | // reset line asserted: reset. |
| 384 | eeprom | |
| 388 | eeprom->set_cs_line( | |
| 385 | 389 | |
| 386 | 390 | // clock line asserted: write latch or select next bit to read |
| 387 | eeprom | |
| 391 | eeprom->set_clock_line( | |
| 388 | 392 | } |
| 389 | 393 | } |
| 390 | 394 | } |
| r11517 | r11518 | |
| 680 | 684 | state->m_hopper = data & 0x0100; // ??? |
| 681 | 685 | |
| 682 | 686 | // latch the bit |
| 683 | eeprom_write_bit(device, data & 0x4000); | |
| 687 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 688 | eeprom->write_bit(data & 0x4000); | |
| 684 | 689 | |
| 685 | 690 | // reset line asserted: reset. |
| 686 | eeprom | |
| 691 | eeprom->set_cs_line( | |
| 687 | 692 | |
| 688 | 693 | // clock line asserted: write latch or select next bit to read |
| 689 | eeprom | |
| 694 | eeprom->set_clock_line( | |
| 690 | 695 | } |
| 691 | 696 | } |
| 692 | 697 | |
| 693 | 698 | static CUSTOM_INPUT( korokoro_hopper_r ) |
| 694 | 699 | { |
| 695 | cave_state *state = field | |
| 700 | cave_state *state = field. | |
| 696 | 701 | return state->m_hopper ? 1 : 0; |
| 697 | 702 | } |
| 698 | 703 | |
| r11517 | r11518 | |
| 795 | 800 | |
| 796 | 801 | static READ16_DEVICE_HANDLER( pwrinst2_eeprom_r ) |
| 797 | 802 | { |
| 798 | return ~8 + ((eeprom_read_bit(device) & 1) ? 8 : 0); | |
| 803 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 804 | return ~8 + ((eeprom->read_bit() & 1) ? 8 : 0); | |
| 799 | 805 | } |
| 800 | 806 | |
| 801 | 807 | INLINE void vctrl_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int GFX) |
| r11517 | r11518 | |
| 898 | 904 | if (ACCESSING_BITS_0_7) // odd address |
| 899 | 905 | { |
| 900 | 906 | // latch the bit |
| 901 | eeprom_write_bit(device, data & 0x0020); | |
| 907 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 908 | eeprom->write_bit(data & 0x0020); | |
| 902 | 909 | |
| 903 | 910 | // reset line asserted: reset. |
| 904 | eeprom | |
| 911 | eeprom->set_cs_line( | |
| 905 | 912 | |
| 906 | 913 | // clock line asserted: write latch or select next bit to read |
| 907 | eeprom | |
| 914 | eeprom->set_clock_line( | |
| 908 | 915 | } |
| 909 | 916 | } |
| 910 | 917 | |
| r11517 | r11518 | |
| 928 | 935 | |
| 929 | 936 | static CUSTOM_INPUT( tjumpman_hopper_r ) |
| 930 | 937 | { |
| 931 | cave_state *state = field->machine().driver_data<cave_state>(); | |
| 932 | return (state->m_hopper && !(field->machine().primary_screen->frame_number() % 10)) ? 0 : 1; | |
| 938 | cave_state *state = field.machine().driver_data<cave_state>(); | |
| 939 | return (state->m_hopper && !(field.machine().primary_screen->frame_number() % 10)) ? 0 : 1; | |
| 933 | 940 | } |
| 934 | 941 | |
| 935 | 942 | static ADDRESS_MAP_START( tjumpman_map, AS_PROGRAM, 16 ) |
| r11517 | r11518 | |
| 1291 | 1298 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(6) |
| 1292 | 1299 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 1293 | 1300 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1294 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1301 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1295 | 1302 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1296 | 1303 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1297 | 1304 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 1444 | 1451 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1445 | 1452 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1446 | 1453 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1447 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1454 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1448 | 1455 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1449 | 1456 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1450 | 1457 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 1488 | 1495 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1489 | 1496 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1490 | 1497 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1491 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1498 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1492 | 1499 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1493 | 1500 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1494 | 1501 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r11517 | r11518 | |
| 1500 | 1507 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) |
| 1501 | 1508 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1502 | 1509 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1503 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1510 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1504 | 1511 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do") |
| 1505 | 1512 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) |
| 1506 | 1513 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "1 Bet" ) |
| r11517 | r11518 | |
| 1525 | 1532 | PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) |
| 1526 | 1533 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) // credits |
| 1527 | 1534 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1528 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) | |
| 1535 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) | |
| 1529 | 1536 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Pac-Man" ) PORT_CODE(KEYCODE_Y) |
| 1530 | 1537 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) |
| 1531 | 1538 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" ) |
| r11517 | r11518 | |
|---|---|---|
| 725 | 725 | if (mem_mask == 0xff000000) |
| 726 | 726 | { |
| 727 | 727 | // latch the bit |
| 728 | eeprom_write_bit(device, data & 0x01000000); | |
| 728 | eeprom_device *eeprom = downcast<eeprom_device *>(device); | |
| 729 | eeprom->write_bit(data & 0x01000000); | |
| 729 | 730 | |
| 730 | 731 | // reset line asserted: reset. |
| 731 | eeprom | |
| 732 | eeprom->set_cs_line( | |
| 732 | 733 | |
| 733 | 734 | // clock line asserted: write latch or select next bit to read |
| 734 | eeprom | |
| 735 | eeprom->set_clock_line( | |
| 735 | 736 | } |
| 736 | 737 | } |
| 737 | 738 | |
| r11517 | r11518 | |
| 775 | 776 | |
| 776 | 777 | static INPUT_PORTS_START( rabbit ) |
| 777 | 778 | PORT_START("INPUTS") |
| 778 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) // as per code at 4d932 | |
| 779 | PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // as per code at 4d932 | |
| 779 | 780 | PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unlabeled in input test |
| 780 | 781 | PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_START1 ) |
| 781 | 782 | PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_START2 ) |
| r11517 | r11518 | |
|---|---|---|
| 33 | 33 | static CUSTOM_INPUT( wolfpack_dial_r ) |
| 34 | 34 | { |
| 35 | 35 | int bit = (FPTR)param; |
| 36 | return ((input_port_read(field | |
| 36 | return ((input_port_read(field. | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 |
| r11517 | r11518 | |
|---|---|---|
| 112 | 112 | eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom"); |
| 113 | 113 | |
| 114 | 114 | /* bits 0-2 control EEPROM */ |
| 115 | eeprom_write_bit(eeprom, data & 0x04); | |
| 116 | eeprom_set_cs_line(eeprom, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 117 | eeprom_set_clock_line(eeprom, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 115 | eeprom->write_bit(data & 0x04); | |
| 116 | eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE); | |
| 117 | eeprom->set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE); | |
| 118 | 118 | |
| 119 | 119 | /* bit 6 selects oki bank */ |
| 120 | 120 | okim6295_device *oki = space->machine().device<okim6295_device>("oki"); |
| r11517 | r11518 | |
| 132 | 132 | // offs_t pc; |
| 133 | 133 | int bit; |
| 134 | 134 | |
| 135 | // logerror("%s: IN1_r\n",field | |
| 135 | // logerror("%s: IN1_r\n",field. | |
| 136 | 136 | |
| 137 | 137 | #if 0 |
| 138 | 138 | /* Pirates protection workaround. It more complicated than this... see code at |
| 139 | 139 | 602e and 62a6 */ |
| 140 | 140 | /* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */ |
| 141 | 141 | |
| 142 | pc = cpu_get_pc(field | |
| 142 | pc = cpu_get_pc(field. | |
| 143 | 143 | if (pc == 0x6134) |
| 144 | 144 | { |
| 145 | 145 | bit = prot & 1; |
| r11517 | r11518 | |
| 209 | 209 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 210 | 210 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 211 | 211 | PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW ) |
| 212 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit) // EEPROM data | |
| 212 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // EEPROM data | |
| 213 | 213 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode" |
| 214 | 214 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode" |
| 215 | 215 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM(prot_r, NULL) // protection |
| r11517 | r11518 | |
|---|---|---|
| 194 | 194 | |
| 195 | 195 | static INPUT_CHANGED( coin_inserted ) |
| 196 | 196 | { |
| 197 | cputag_set_input_line(field | |
| 197 | cputag_set_input_line(field. | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | static INPUT_PORTS_START( tankbatt ) |
| r11517 | r11518 | |
|---|---|---|
| 508 | 508 | |
| 509 | 509 | static INPUT_CHANGED( coin_inserted ) |
| 510 | 510 | { |
| 511 | m10_state *state = field | |
| 511 | m10_state *state = field. | |
| 512 | 512 | /* coin insertion causes an NMI */ |
| 513 | 513 | device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); |
| 514 | 514 | } |
| r11517 | r11518 | |
|---|---|---|
| 1486 | 1486 | if (input_condition_true(port->machine(), &device_field->field->condition)) |
| 1487 | 1487 | { |
| 1488 | 1488 | /* replace the bits with bits from the device */ |
| 1489 | input_port_value newval = | |
| 1489 | input_port_value newval = | |
| 1490 | 1490 | device_field->oldval = newval; |
| 1491 | 1491 | result = (result & ~device_field->field->mask) | ((newval << device_field->shift) & device_field->field->mask); |
| 1492 | 1492 | } |
| r11517 | r11518 | |
| 1608 | 1608 | value += field->crossoffset; |
| 1609 | 1609 | |
| 1610 | 1610 | /* apply custom mapping if necessary */ |
| 1611 | if (field->crossmapper != NULL) | |
| 1612 | value = (*field->crossmapper)(field, value); | |
| 1611 | if (!field->crossmapper.isnull()) | |
| 1612 | value = field->crossmapper(*field, value); | |
| 1613 | 1613 | |
| 1614 | 1614 | /* handle X axis */ |
| 1615 | 1615 | if (field->crossaxis == CROSSHAIR_AXIS_X) |
| r11517 | r11518 | |
| 1732 | 1732 | /* if the bits have write, call the handler */ |
| 1733 | 1733 | if (device_field->oldval != newval) |
| 1734 | 1734 | { |
| 1735 | | |
| 1735 | | |
| 1736 | 1736 | |
| 1737 | 1737 | device_field->oldval = newval; |
| 1738 | 1738 | } |
| r11517 | r11518 | |
| 2002 | 2002 | states based on the tokens |
| 2003 | 2003 | -------------------------------------------------*/ |
| 2004 | 2004 | |
| 2005 | inline const char *get_device_tag(const device_t &device, const char *tag, astring &finaltag) | |
| 2006 | { | |
| 2007 | if (strcmp(tag, DEVICE_SELF) == 0) | |
| 2008 | finaltag.cpy(device.tag()); | |
| 2009 | else if (strcmp(tag, DEVICE_SELF_OWNER) == 0) | |
| 2010 | { | |
| 2011 | assert(device.owner() != NULL); | |
| 2012 | finaltag.cpy(device.owner()->tag()); | |
| 2013 | } | |
| 2014 | else | |
| 2015 | device.subtag(finaltag, tag); | |
| 2016 | return finaltag; | |
| 2017 | } | |
| 2018 | ||
| 2005 | 2019 | static void init_port_state(running_machine &machine) |
| 2006 | 2020 | { |
| 2007 | 2021 | const char *joystick_map_default = machine.options().joystick_map(); |
| 2008 | 2022 | input_port_private *portdata = machine.input_port_data; |
| 2009 | const input_field_config *field; | |
| 2010 | const input_port_config *port; | |
| 2023 | input_field_config *field; | |
| 2024 | input_port_config *port; | |
| 2011 | 2025 | |
| 2012 | 2026 | /* allocate live structures to mirror the configuration */ |
| 2013 | 2027 | for (port = machine.m_portlist.first(); port != NULL; port = port->next()) |
| r11517 | r11518 | |
| 2058 | 2072 | } |
| 2059 | 2073 | |
| 2060 | 2074 | /* if this entry has device input, allocate memory for the tracking structure */ |
| 2061 | if (field->read != NULL) | |
| 2075 | astring devicetag; | |
| 2076 | if (!field->read.isnull()) | |
| 2062 | 2077 | { |
| 2063 | *readdevicetail = init_field_device_info(field,field->read_device); | |
| 2078 | *readdevicetail = init_field_device_info(field, get_device_tag(port->owner(), field->read_device, devicetag)); | |
| 2079 | field->read.late_bind(*(*readdevicetail)->device); | |
| 2064 | 2080 | readdevicetail = &(*readdevicetail)->next; |
| 2065 | 2081 | } |
| 2066 | 2082 | |
| 2067 | 2083 | /* if this entry has device output, allocate memory for the tracking structure */ |
| 2068 | if (field->write | |
| 2084 | if (!field->write.isnull()) | |
| 2069 | 2085 | { |
| 2070 | *writedevicetail = init_field_device_info(field,field->write_device); | |
| 2086 | *writedevicetail = init_field_device_info(field, get_device_tag(port->owner(), field->write_device, devicetag)); | |
| 2087 | field->write.late_bind(*(*writedevicetail)->device); | |
| 2071 | 2088 | writedevicetail = &(*writedevicetail)->next; |
| 2072 | 2089 | } |
| 2073 | 2090 | |
| 2091 | /* if this entry has device output, allocate memory for the tracking structure */ | |
| 2092 | if (!field->crossmapper.isnull()) | |
| 2093 | { | |
| 2094 | device_t *device = machine.device(get_device_tag(port->owner(), field->crossmapper_device, devicetag)); | |
| 2095 | field->crossmapper.late_bind(*device); | |
| 2096 | } | |
| 2097 | ||
| 2074 | 2098 | /* Name keyboard key names */ |
| 2075 | 2099 | if ((field->type == IPT_KEYBOARD || field->type == IPT_KEYPAD) && (field->name == NULL)) |
| 2076 | 2100 | { |
| r11517 | r11518 | |
| 2184 | 2208 | for (mask = field->mask; !(mask & 1); mask >>= 1) |
| 2185 | 2209 | info->shift++; |
| 2186 | 2210 | |
| 2187 | if (device_name != NULL) | |
| 2188 | info->device = field->machine().device(device_name); | |
| 2189 | else | |
| 2190 | info->device = &field->port().owner(); | |
| 2211 | info->device = (device_name != NULL) ? field->machine().device(device_name) : &field->port().owner(); | |
| 2191 | 2212 | |
| 2192 | 2213 | info->oldval = field->defvalue >> info->shift; |
| 2193 | 2214 | return info; |
| r11517 | r11518 | |
| 2536 | 2557 | /* if the bits have write, call the handler */ |
| 2537 | 2558 | if (device_field->oldval != newval) |
| 2538 | 2559 | { |
| 2539 | | |
| 2560 | | |
| 2540 | 2561 | |
| 2541 | 2562 | device_field->oldval = newval; |
| 2542 | 2563 | } |
| r11517 | r11518 | |
| 2910 | 2931 | flags(0), |
| 2911 | 2932 | impulse(0), |
| 2912 | 2933 | name(_name), |
| 2913 | read(NULL), | |
| 2914 | 2934 | read_param(NULL), |
| 2915 | read_device(NULL), | |
| 2916 | write(NULL), | |
| 2935 | read_device(DEVICE_SELF), | |
| 2917 | 2936 | write_param(NULL), |
| 2918 | write_device( | |
| 2937 | write_device(DEVICE_SELF), | |
| 2919 | 2938 | min(0), |
| 2920 | 2939 | max(_maskbits), |
| 2921 | 2940 | sensitivity(0), |
| r11517 | r11518 | |
| 2925 | 2944 | crossscale(0), |
| 2926 | 2945 | crossoffset(0), |
| 2927 | 2946 | crossaltaxis(0), |
| 2928 | crossmapper( | |
| 2947 | crossmapper_device(DEVICE_SELF), | |
| 2929 | 2948 | full_turn_count(0), |
| 2930 | 2949 | remap_table(NULL), |
| 2931 | 2950 | way(0), |
| r11517 | r11518 | |
|---|---|---|
| 541 | 541 | |
| 542 | 542 | |
| 543 | 543 | /* read input port callback function */ |
| 544 | typedef UINT32 ( | |
| 544 | typedef delegate<UINT32 ( | |
| 545 | 545 | |
| 546 | 546 | /* input port write callback function */ |
| 547 | typedef | |
| 547 | typedef | |
| 548 | 548 | |
| 549 | 549 | /* crosshair mapping function */ |
| 550 | typedef | |
| 550 | typedef delegat | |
| 551 | 551 | |
| 552 | 552 | |
| 553 | 553 | /* encapsulates a condition on a port field or setting */ |
| r11517 | r11518 | |
| 629 | 629 | UINT8 impulse; /* number of frames before reverting to defvalue */ |
| 630 | 630 | const char * name; /* user-friendly name to display */ |
| 631 | 631 | input_seq seq[SEQ_TYPE_TOTAL];/* sequences of all types */ |
| 632 | input_field_read_ | |
| 632 | input_field_read_delegate read; /* read callback routine */ | |
| 633 | 633 | void * read_param; /* parameter for read callback routine */ |
| 634 | 634 | const char * read_device; /* parameter for read callback routine */ |
| 635 | input_field_write_ | |
| 635 | input_field_write_delegate write; /* write callback routine */ | |
| 636 | 636 | void * write_param; /* parameter for write callback routine */ |
| 637 | 637 | const char * write_device; /* parameter for write callback routine */ |
| 638 | 638 | |
| r11517 | r11518 | |
| 643 | 643 | INT32 delta; /* delta to apply each frame a digital inc/dec key is pressed */ |
| 644 | 644 | INT32 centerdelta; /* delta to apply each frame no digital inputs are pressed */ |
| 645 | 645 | UINT8 crossaxis; /* crosshair axis */ |
| 646 | float crossscale; /* crosshair scale */ | |
| 647 | float crossoffset; /* crosshair offset */ | |
| 648 | float crossaltaxis; /* crosshair alternate axis value */ | |
| 649 | input_field_crossmap_func crossmapper; /* crosshair mapping function */ | |
| 646 | double crossscale; /* crosshair scale */ | |
| 647 | double crossoffset; /* crosshair offset */ | |
| 648 | double crossaltaxis; /* crosshair alternate axis value */ | |
| 649 | input_field_crossmap_delegate crossmapper; /* crosshair mapping function */ | |
| 650 | const char * crossmapper_device; /* parameter for write callback routine */ | |
| 650 | 651 | UINT16 full_turn_count;/* number of optical counts for 1 full turn of the original control */ |
| 651 | 652 | const input_port_value * remap_table; /* pointer to an array that remaps the port value */ |
| 652 | 653 | |
| r11517 | r11518 | |
| 757 | 758 | ***************************************************************************/ |
| 758 | 759 | |
| 759 | 760 | /* macro for a read callback function (PORT_CUSTOM) */ |
| 760 | #define CUSTOM_INPUT(name) input_port_value name(device_t &device, const input_field_config *field, void *param) | |
| 761 | #define CUSTOM_INPUT(name) input_port_value name(device_t &device, const input_field_config &field, void *param) | |
| 762 | #define CUSTOM_INPUT_MEMBER(name) input_port_value name(const input_field_config &field, void *param) | |
| 763 | #define DECLARE_CUSTOM_INPUT_MEMBER(name) input_port_value name(const input_field_config &field, void *param) | |
| 761 | 764 | |
| 762 | 765 | /* macro for port write callback functions (PORT_CHANGED) */ |
| 763 | #define INPUT_CHANGED(name) void name(device_t &device, const input_field_config *field, void *param, input_port_value oldval, input_port_value newval) | |
| 766 | #define INPUT_CHANGED(name) void name(device_t &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval) | |
| 767 | #define INPUT_CHANGED_MEMBER(name) void name(const input_field_config &field, void *param, input_port_value oldval, input_port_value newval) | |
| 768 | #define DECLARE_INPUT_CHANGED_MEMBER(name) void name(const input_field_config &field, void *param, input_port_value oldval, input_port_value newval) | |
| 764 | 769 | |
| 765 | 770 | /* macro for port changed callback functions (PORT_CROSSHAIR_MAPPER) */ |
| 766 | #define CROSSHAIR_MAPPER(name) float name(const input_field_config *field, float linear_value) | |
| 771 | #define CROSSHAIR_MAPPER(name) float name(device_t &device, const input_field_config &field, float linear_value) | |
| 772 | #define CROSSHAIR_MAPPER_MEMBER(name) float name(const input_field_config &field, float linear_value) | |
| 773 | #define DECLARE_CROSSHAIR_MAPPER_MEMBER(name) float name(const input_field_config &field, float linear_value) | |
| 767 | 774 | |
| 768 | 775 | /* macro for wrapping a default string */ |
| 769 | 776 | #define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num) |
| 770 | 777 | |
| 771 | 778 | |
| 772 | template<int (*_ReadLine)(device_t *)> | |
| 773 | input_port_value ioport_read_line_wrapper(device_t &device, const input_field_config *field, void *param) | |
| 779 | template<int (*_FunctionPointer)(device_t *)> | |
| 780 | input_port_value ioport_read_line_wrapper(device_t &device, const input_field_config &field, void *param) | |
| 774 | 781 | { |
| 775 | return (*_ | |
| 782 | return (*_FunctionPointer)(&device); | |
| 776 | 783 | } |
| 777 | 784 | |
| 778 | template<void (*_WriteLine)(device_t *, int)> | |
| 779 | void ioport_write_line_wrapper(device_t &device, const input_field_config *field, void *param, input_port_value oldval, input_port_value newval) | |
| 785 | template<class _FunctionClass, int (_FunctionClass::*_FunctionPointer)()> | |
| 786 | input_port_value ioport_read_line_wrapper(_FunctionClass &device, const input_field_config &field, void *param) | |
| 780 | 787 | { |
| 781 | return ( | |
| 788 | return ( | |
| 782 | 789 | } |
| 783 | 790 | |
| 791 | template<void (*_FunctionPointer)(device_t *, int)> | |
| 792 | void ioport_write_line_wrapper(device_t &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval) | |
| 793 | { | |
| 794 | return (*_FunctionPointer)(&device, newval); | |
| 795 | } | |
| 784 | 796 | |
| 797 | template<class _FunctionClass, void (_FunctionClass::*_FunctionPointer)(int)> | |
| 798 | void ioport_write_line_wrapper(_FunctionClass &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval) | |
| 799 | { | |
| 800 | return (device.*_FunctionPointer)(newval); | |
| 801 | } | |
| 785 | 802 | |
| 803 | ||
| 804 | ||
| 786 | 805 | /*************************************************************************** |
| 787 | 806 | MACROS FOR BUILDING INPUT PORTS |
| 788 | 807 | ***************************************************************************/ |
| r11517 | r11518 | |
| 918 | 937 | curfield->crossoffset = offset; |
| 919 | 938 | |
| 920 | 939 | #define PORT_CROSSHAIR_MAPPER(_callback) \ |
| 921 | curfield->crossmapper = _callback; | |
| 940 | curfield->crossmapper = input_field_crossmap_delegate(_callback, #_callback, (device_t *)NULL); \ | |
| 941 | curfield->crossmapper_device = DEVICE_SELF; | |
| 922 | 942 | |
| 943 | #define PORT_CROSSHAIR_MAPPER_MEMBER(_device, _class, _member) \ | |
| 944 | curfield->crossmapper = input_field_crossmap_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \ | |
| 945 | curfield->crossmapper_device = _device; | |
| 946 | ||
| 923 | 947 | /* how many optical counts for 1 full turn of the control */ |
| 924 | 948 | #define PORT_FULL_TURN_COUNT(_count) \ |
| 925 | 949 | curfield->full_turn_count = _count; |
| r11517 | r11518 | |
| 945 | 969 | |
| 946 | 970 | /* read callbacks */ |
| 947 | 971 | #define PORT_CUSTOM(_callback, _param) \ |
| 948 | curfield->read = _callback; \ | |
| 972 | curfield->read = input_field_read_delegate(_callback, #_callback, (device_t *)NULL); \ | |
| 949 | 973 | curfield->read_param = (void *)(_param); \ |
| 950 | curfield->read_device = | |
| 974 | curfield->read_device = DEVICE_SELF; | |
| 951 | 975 | |
| 976 | #define PORT_CUSTOM_MEMBER(_device, _class, _member, _param) \ | |
| 977 | curfield->read = input_field_read_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \ | |
| 978 | curfield->read_param = (void *)(_param); \ | |
| 979 | curfield->read_device = (_device); | |
| 980 | ||
| 952 | 981 | /* write callbacks */ |
| 953 | 982 | #define PORT_CHANGED(_callback, _param) \ |
| 954 | curfield->write = _callback; \ | |
| 983 | curfield->write = input_field_write_delegate(_callback, #_callback, (device_t *)NULL); \ | |
| 955 | 984 | curfield->write_param = (void *)(_param); \ |
| 956 | curfield->write_device = | |
| 985 | curfield->write_device = DEVICE_SELF; | |
| 957 | 986 | |
| 987 | #define PORT_CHANGED_MEMBER(_device, _class, _member, _param) \ | |
| 988 | curfield->write = input_field_write_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \ | |
| 989 | curfield->write_param = (void *)(_param); \ | |
| 990 | curfield->write_device = (_device); | |
| 991 | ||
| 958 | 992 | /* input device handler */ |
| 959 | 993 | #define PORT_READ_LINE_DEVICE(_device, _read_line_device) \ |
| 960 | curfield->read = &ioport_read_line_wrapper<_read_line_device>; \ | |
| 994 | curfield->read = input_field_read_delegate(&ioport_read_line_wrapper<_read_line_device>, #_read_line_device, (device_t *)NULL); \ | |
| 961 | 995 | curfield->read_param = NULL; \ |
| 962 | 996 | curfield->read_device = _device; |
| 963 | 997 | |
| 998 | #define PORT_READ_LINE_DEVICE_MEMBER(_device, _class, _member) \ | |
| 999 | curfield->read = input_field_read_delegate(&ioport_read_line_wrapper<_class, &_class::_member>, #_class "::" #_member, (_class *)NULL); \ | |
| 1000 | curfield->read_param = NULL; \ | |
| 1001 | curfield->read_device = _device; | |
| 1002 | ||
| 964 | 1003 | /* output device handler */ |
| 965 | 1004 | #define PORT_WRITE_LINE_DEVICE(_device, _write_line_device) \ |
| 966 | curfield->write = &ioport_write_line_wrapper<_write_line_device>; \ | |
| 1005 | curfield->write = input_field_write_delegate(&ioport_write_line_wrapper<_write_line_device>, #_write_line_device, (device_t *)NULL); \ | |
| 967 | 1006 | curfield->write_param = NULL; \ |
| 968 | 1007 | curfield->write_device = _device; |
| 969 | 1008 | |
| 1009 | #define PORT_WRITE_LINE_DEVICE_MEMBER(_device, _class, _member) \ | |
| 1010 | curfield->write = input_field_write_delegate(&ioport_write_line_wrapper<_class, &_class::_member>, #_class "::" #_member, (_class *)NULL); \ | |
| 1011 | curfield->write_param = NULL; \ | |
| 1012 | curfield->write_device = _device; | |
| 1013 | ||
| 970 | 1014 | /* dip switch definition */ |
| 971 | 1015 | #define PORT_DIPNAME(_mask, _default, _name) \ |
| 972 | 1016 | curfield = ioconfig_alloc_field(*curport, IPT_DIPSWITCH, (_default), (_mask), (_name)); \ |
| r11517 | r11518 | |
|---|---|---|
| 175 | 175 | // ======================> device_t |
| 176 | 176 | |
| 177 | 177 | // device_t represents a device |
| 178 | class device_t | |
| 178 | class device_t : public delegate_late_bind | |
| 179 | 179 | { |
| 180 | 180 | DISABLE_COPYING(device_t); |
| 181 | 181 |
| r11517 | r11518 | |
|---|---|---|
| 2039 | 2039 | void address_space::populate_map_entry(const address_map_entry &entry, read_or_write readorwrite) |
| 2040 | 2040 | { |
| 2041 | 2041 | const map_handler_data &data = (readorwrite == ROW_READ) ? entry.m_read : entry.m_write; |
| 2042 | void *object; | |
| 2043 | 2042 | device_t *device; |
| 2044 | 2043 | |
| 2045 | 2044 | // based on the handler type, alter the bits, name, funcptr, and object |
| r11517 | r11518 | |
| 2067 | 2066 | break; |
| 2068 | 2067 | |
| 2069 | 2068 | case AMH_DEVICE_DELEGATE: |
| 2070 | object = machine().device(data.m_tag); | |
| 2071 | if (object == NULL) | |
| 2069 | device = machine().device(data.m_tag); | |
| 2070 | if (device == NULL) | |
| 2072 | 2071 | throw emu_fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", data.m_tag, m_name, m_device.tag()); |
| 2073 | 2072 | |
| 2074 | 2073 | if (readorwrite == ROW_READ) |
| 2075 | 2074 | switch (data.m_bits) |
| 2076 | 2075 | { |
| 2077 | case 8: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, object), data.m_mask); break; | |
| 2078 | case 16: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, object), data.m_mask); break; | |
| 2079 | case 32: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, object), data.m_mask); break; | |
| 2080 | case 64: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, object), data.m_mask); break; | |
| 2076 | case 8: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, *device), data.m_mask); break; | |
| 2077 | case 16: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, *device), data.m_mask); break; | |
| 2078 | case 32: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, *device), data.m_mask); break; | |
| 2079 | case 64: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, *device), data.m_mask); break; | |
| 2081 | 2080 | } |
| 2082 | 2081 | else |
| 2083 | 2082 | switch (data.m_bits) |
| 2084 | 2083 | { |
| 2085 | case 8: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, object), data.m_mask); break; | |
| 2086 | case 16: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, object), data.m_mask); break; | |
| 2087 | case 32: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, object), data.m_mask); break; | |
| 2088 | case 64: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, object), data.m_mask); break; | |
| 2084 | case 8: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, *device), data.m_mask); break; | |
| 2085 | case 16: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, *device), data.m_mask); break; | |
| 2086 | case 32: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, *device), data.m_mask); break; | |
| 2087 | case 64: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, *device), data.m_mask); break; | |
| 2089 | 2088 | } |
| 2090 | 2089 | break; |
| 2091 | 2090 |
| r11517 | r11518 | |
|---|---|---|
| 748 | 748 | CUSTOM_INPUT( custom_port_read ) |
| 749 | 749 | { |
| 750 | 750 | const char *tag = (const char *)param; |
| 751 | return input_port_read(field | |
| 751 | return input_port_read(field. | |
| 752 | 752 | } |
| r11517 | r11518 | |
|---|---|---|
| 96 | 96 | { |
| 97 | 97 | // bind our handler |
| 98 | 98 | if (!m_custom_handler.isnull()) |
| 99 | m_custom_handler = nvram_init_delegate(m_custom_handler, m_owner); | |
| 99 | m_custom_handler = nvram_init_delegate(m_custom_handler, *m_owner); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 |
| r11517 | r11518 | |
|---|---|---|
| 313 | 313 | // READ/WRITE HANDLERS |
| 314 | 314 | //************************************************************************** |
| 315 | 315 | |
| 316 | WRITE_LINE_ | |
| 316 | WRITE_LINE_MEMB | |
| 317 | 317 | { |
| 318 | downcast<eeprom_device *>(device)->write_bit(state); | |
| 319 | } | |
| 320 | ||
| 321 | void eeprom_device::write_bit(int state) | |
| 322 | { | |
| 323 | 318 | LOG(("write bit %d\n",state)); |
| 324 | 319 | m_latch = state; |
| 325 | 320 | } |
| r11517 | r11518 | |
| 330 | 325 | return downcast<eeprom_device *>(device)->read_bit(); |
| 331 | 326 | } |
| 332 | 327 | |
| 333 | ||
| 328 | READ_LINE_MEMBER( eeprom_device::read_bit ) | |
| 334 | 329 | { |
| 335 | 330 | int res; |
| 336 | 331 | |
| r11517 | r11518 | |
| 355 | 350 | |
| 356 | 351 | |
| 357 | 352 | |
| 358 | WRITE_LINE_ | |
| 353 | WRITE_LINE_MEMB | |
| 359 | 354 | { |
| 360 | downcast<eeprom_device *>(device)->set_cs_line(state); | |
| 361 | } | |
| 362 | ||
| 363 | void eeprom_device::set_cs_line(int state) | |
| 364 | { | |
| 365 | 355 | LOG(("set reset line %d\n",state)); |
| 366 | 356 | m_reset_line = state; |
| 367 | 357 | |
| r11517 | r11518 | |
| 378 | 368 | |
| 379 | 369 | |
| 380 | 370 | |
| 381 | WRITE_LINE_ | |
| 371 | WRITE_LINE_MEMB | |
| 382 | 372 | { |
| 383 | downcast<eeprom_device *>(device)->set_clock_line(state); | |
| 384 | } | |
| 385 | ||
| 386 | void eeprom_device::set_clock_line(int state) | |
| 387 | { | |
| 388 | 373 | LOG(("set clock line %d\n",state)); |
| 389 | 374 | if (state == PULSE_LINE || (m_clock_line == CLEAR_LINE && state != CLEAR_LINE)) |
| 390 | 375 | { |
| r11517 | r11518 | |
|---|---|---|
| 79 | 79 | static void static_set_default_value(device_t &device, UINT16 value); |
| 80 | 80 | |
| 81 | 81 | // I/O operations |
| 82 | void write_bit(int state); | |
| 83 | int read_bit(); | |
| 84 | void set_cs_line(int state); | |
| 85 | void set_clock_line(int state); | |
| 82 | DECLARE_WRITE_LINE_MEMBER( write_bit ); | |
| 83 | DECLARE_READ_LINE_MEMBER( read_bit ); | |
| 84 | DECLARE_WRITE_LINE_MEMBER( set_cs_line ); | |
| 85 | DECLARE_WRITE_LINE_MEMBER( set_clock_line ); | |
| 86 | 86 | |
| 87 | 87 | protected: |
| 88 | 88 | // device-level overrides |
| r11517 | r11518 | |
| 139 | 139 | extern const eeprom_interface eeprom_interface_93C66B; |
| 140 | 140 | |
| 141 | 141 | |
| 142 | ||
| 143 | //************************************************************************** | |
| 144 | // READ/WRITE HANDLERS | |
| 145 | //************************************************************************** | |
| 146 | ||
| 147 | WRITE_LINE_DEVICE_HANDLER( eeprom_write_bit ); | |
| 148 | READ_LINE_DEVICE_HANDLER( eeprom_read_bit ); | |
| 149 | WRITE_LINE_DEVICE_HANDLER( eeprom_set_cs_line ); | |
| 150 | WRITE_LINE_DEVICE_HANDLER( eeprom_set_clock_line ); | |
| 151 | ||
| 152 | 142 | #endif |
| r11517 | r11518 | |
|---|---|---|
| 140 | 140 | #endif |
| 141 | 141 | |
| 142 | 142 | |
| 143 | // ======================> delegate_late_bind | |
| 144 | ||
| 145 | // simple polymorphic class that must be mixed into any object that is late-bound | |
| 146 | class delegate_late_bind | |
| 147 | { | |
| 148 | public: | |
| 149 | delegate_late_bind() { } | |
| 150 | virtual ~delegate_late_bind() { } | |
| 151 | }; | |
| 152 | ||
| 153 | ||
| 143 | 154 | // ======================> delegate_traits |
| 144 | 155 | |
| 145 | 156 | // delegate_traits is a meta-template that is used to provide a static function pointer |
| r11517 | r11518 | |
| 254 | 265 | template<typename _ReturnType, typename _P1Type = _noparam, typename _P2Type = _noparam, typename _P3Type = _noparam, typename _P4Type = _noparam> |
| 255 | 266 | class delegate_base |
| 256 | 267 | { |
| 268 | typedef delegate_generic_class *(*late_bind_func)(delegate_late_bind &object); | |
| 257 | 269 | typedef typename delegate_traits<delegate_generic_class, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type generic_static_func; |
| 258 | 270 | |
| 259 | 271 | public: |
| 260 | 272 | // generic constructor |
| 261 | 273 | delegate_base() |
| 262 | 274 | : m_name(NULL), |
| 275 | m_object(NULL), | |
| 276 | m_callobject(NULL), | |
| 263 | 277 | m_function(NULL), |
| 264 | m_object(NULL), | |
| 265 | m_callobject(NULL) { } | |
| 278 | m_latebinder(NULL) { } | |
| 266 | 279 | |
| 267 | 280 | // copy constructor |
| 268 | 281 | delegate_base(const delegate_base &src) |
| r11517 | r11518 | |
| 270 | 283 | m_object(src.m_object), |
| 271 | 284 | m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object), |
| 272 | 285 | m_function(src.m_function), |
| 273 | m_rawfunction(src.m_rawfunction) { } | |
| 286 | m_rawfunction(src.m_rawfunction), | |
| 287 | m_latebinder(src.m_latebinder) { } | |
| 274 | 288 | |
| 275 | // copy constructor with re-bind | |
| 276 | template<class _FunctionClass> | |
| 277 | delegate_base(const delegate_base &src, _FunctionClass *object) | |
| 289 | // copy constructor with late bind | |
| 290 | delegate_base(const delegate_base &src, delegate_late_bind &object) | |
| 278 | 291 | : m_name(src.m_name), |
| 279 | 292 | m_object(src.m_object), |
| 280 | 293 | m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object), |
| 281 | 294 | m_function(src.m_function), |
| 282 | m_rawfunction(src.m_rawfunction) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 295 | m_rawfunction(src.m_rawfunction), | |
| 296 | m_latebinder(src.m_latebinder) { late_bind(object); } | |
| 283 | 297 | |
| 284 | 298 | // construct from member function with object pointer |
| 285 | 299 | template<class _FunctionClass> |
| 286 | 300 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type funcptr, const char *name, _FunctionClass *object) |
| 287 | 301 | : m_name(name), |
| 288 | m_function(&delegate_base::method_stub<_FunctionClass>), | |
| 289 | 302 | m_object(NULL), |
| 290 | 303 | m_callobject(reinterpret_cast<delegate_generic_class *>(this)), |
| 291 | m_rawfunction(funcptr) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 304 | m_function(&delegate_base::method_stub<_FunctionClass>), | |
| 305 | m_rawfunction(funcptr), | |
| 306 | m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 292 | 307 | |
| 293 | 308 | // construct from static function with object pointer |
| 294 | 309 | template<class _FunctionClass> |
| r11517 | r11518 | |
| 296 | 311 | : m_name(name), |
| 297 | 312 | m_object(NULL), |
| 298 | 313 | m_callobject(NULL), |
| 299 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 314 | m_function(reinterpret_cast<generic_static_func>(funcptr)), | |
| 315 | m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 300 | 316 | |
| 301 | 317 | // construct from static reference function with object pointer |
| 302 | 318 | template<class _FunctionClass> |
| r11517 | r11518 | |
| 304 | 320 | : m_name(name), |
| 305 | 321 | m_object(NULL), |
| 306 | 322 | m_callobject(NULL), |
| 307 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 323 | m_function(reinterpret_cast<generic_static_func>(funcptr)), | |
| 324 | m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 308 | 325 | |
| 309 | 326 | // copy operator |
| 310 | 327 | delegate_base &operator=(const delegate_base &src) |
| r11517 | r11518 | |
| 316 | 333 | m_callobject = src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object; |
| 317 | 334 | m_function = src.m_function; |
| 318 | 335 | m_rawfunction = src.m_rawfunction; |
| 336 | m_latebinder = src.m_latebinder; | |
| 319 | 337 | } |
| 320 | 338 | return *this; |
| 321 | 339 | } |
| r11517 | r11518 | |
| 338 | 356 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_callobject, p1, p2, p3); } |
| 339 | 357 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_callobject, p1, p2, p3, p4); } |
| 340 | 358 | |
| 341 | // static stub creators | |
| 342 | template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type _Function> | |
| 343 | static delegate_base static_creator(const char *name) | |
| 344 | { | |
| 345 | return delegate_base(_Function, name, (_FunctionClass *)NULL); | |
| 346 | } | |
| 359 | // late binding | |
| 360 | void late_bind(delegate_late_bind &object) { bind((*m_latebinder)(object)); } | |
| 347 | 361 | |
| 348 | template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type _Function> | |
| 349 | static delegate_base static_creator(const char *name) | |
| 350 | { | |
| 351 | return delegate_base(_Function, name, (_FunctionClass *)NULL); | |
| 352 | } | |
| 353 | ||
| 354 | template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type _Function> | |
| 355 | static delegate_base static_creator(const char *name) | |
| 356 | { | |
| 357 | return delegate_base(_Function, name, (_FunctionClass *)NULL); | |
| 358 | } | |
| 359 | ||
| 360 | 362 | protected: |
| 361 | 363 | // bind the actual object |
| 362 | 364 | void bind(delegate_generic_class *object) |
| r11517 | r11518 | |
| 414 | 416 | return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(p1, p2, p3, p4); |
| 415 | 417 | } |
| 416 | 418 | |
| 419 | // late binding helper | |
| 420 | template<class _FunctionClass> | |
| 421 | static delegate_generic_class *late_bind_helper(delegate_late_bind &object) | |
| 422 | { | |
| 423 | return reinterpret_cast<delegate_generic_class *>(dynamic_cast<_FunctionClass *>(&object)); | |
| 424 | } | |
| 425 | ||
| 417 | 426 | // internal state |
| 418 | 427 | const char * m_name; // name string |
| 428 | delegate_generic_class * m_object; // pointer to the post-cast object | |
| 429 | delegate_generic_class * m_callobject; // pointer to the object used for calling | |
| 419 | 430 | generic_static_func m_function; // generic static function pointer |
| 420 | 431 | delegate_raw_mfp m_rawfunction; // copy of raw MFP |
| 421 | delegate_generic_class * m_object; // pointer to the post-cast object | |
| 422 | delegate_generic_class * m_callobject; // pointer to the object used for calling | |
| 432 | late_bind_func m_latebinder; // late binding helper | |
| 423 | 433 | }; |
| 424 | 434 | |
| 425 | 435 | #endif |
| r11517 | r11518 | |
| 488 | 498 | template<typename _ReturnType, typename _P1Type = _noparam, typename _P2Type = _noparam, typename _P3Type = _noparam, typename _P4Type = _noparam> |
| 489 | 499 | class delegate_base |
| 490 | 500 | { |
| 501 | typedef delegate_generic_class *(*late_bind_func)(delegate_late_bind &object); | |
| 491 | 502 | typedef typename delegate_traits<delegate_generic_class, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type generic_static_func; |
| 492 | 503 | |
| 493 | 504 | public: |
| r11517 | r11518 | |
| 495 | 506 | delegate_base() |
| 496 | 507 | : m_name(NULL), |
| 497 | 508 | m_object(NULL), |
| 498 | m_function(NULL) { } | |
| 509 | m_function(NULL), | |
| 510 | m_latebinder(NULL) { } | |
| 499 | 511 | |
| 500 | 512 | // copy constructor |
| 501 | 513 | delegate_base(const delegate_base &src) |
| 502 | 514 | : m_name(src.m_name), |
| 503 | 515 | m_object(src.m_object), |
| 504 | 516 | m_function(src.m_function), |
| 505 | m_rawfunction(src.m_rawfunction) { } | |
| 517 | m_rawfunction(src.m_rawfunction), | |
| 518 | m_latebinder(src.m_latebinder) { } | |
| 506 | 519 | |
| 507 | // copy constructor with re-bind | |
| 508 | template<class _FunctionClass> | |
| 509 | delegate_base(const delegate_base &src, _FunctionClass *object) | |
| 520 | // copy constructor with late bind | |
| 521 | delegate_base(const delegate_base &src, delegate_late_bind &object) | |
| 510 | 522 | : m_name(src.m_name), |
| 511 | 523 | m_object(src.m_object), |
| 512 | 524 | m_function(src.m_function), |
| 513 | m_rawfunction(src.m_rawfunction) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 525 | m_rawfunction(src.m_rawfunction), | |
| 526 | m_latebinder(src.m_latebinder) { late_bind(object); } | |
| 514 | 527 | |
| 515 | 528 | // construct from member function with object pointer |
| 516 | 529 | template<class _FunctionClass> |
| r11517 | r11518 | |
| 518 | 531 | : m_name(name), |
| 519 | 532 | m_object(NULL), |
| 520 | 533 | m_function(NULL), |
| 521 | m_rawfunction(funcptr) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 534 | m_rawfunction(funcptr), | |
| 535 | m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 522 | 536 | |
| 523 | 537 | // construct from static function with object pointer |
| 524 | 538 | template<class _FunctionClass> |
| 525 | 539 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type funcptr, const char *name, _FunctionClass *object) |
| 526 | 540 | : m_name(name), |
| 527 | 541 | m_object(NULL), |
| 528 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 542 | m_function(reinterpret_cast<generic_static_func>(funcptr)), | |
| 543 | m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 529 | 544 | |
| 530 | 545 | // construct from static reference function with object pointer |
| 531 | 546 | template<class _FunctionClass> |
| 532 | 547 | delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) |
| 533 | 548 | : m_name(name), |
| 534 | 549 | m_object(NULL), |
| 535 | m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 550 | m_function(reinterpret_cast<generic_static_func>(funcptr)), | |
| 551 | m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); } | |
| 536 | 552 | |
| 537 | 553 | // copy operator |
| 538 | 554 | delegate_base &operator=(const delegate_base &src) |
| r11517 | r11518 | |
| 543 | 559 | m_object = src.m_object; |
| 544 | 560 | m_function = src.m_function; |
| 545 | 561 | m_rawfunction = src.m_rawfunction; |
| 562 | m_latebinder = src.m_latebinder; | |
| 546 | 563 | } |
| 547 | 564 | return *this; |
| 548 | 565 | } |
| r11517 | r11518 | |
| 565 | 582 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); } |
| 566 | 583 | _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); } |
| 567 | 584 | |
| 568 | // static stub creators | |
| 569 | template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type _Function> | |
| 570 | static delegate_base static_creator(const char *name) | |
| 571 | { | |
| 572 | return delegate_base(_Function, name, (_FunctionClass *)NULL); | |
| 573 | } | |
| 585 | // late binding | |
| 586 | void late_bind(delegate_late_bind &object) { bind((*m_latebinder)(object)); } | |
| 574 | 587 | |
| 575 | template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type _Function> | |
| 576 | static delegate_base static_creator(const char *name) | |
| 577 | { | |
| 578 | return delegate_base(_Function, name, (_FunctionClass *)NULL); | |
| 579 | } | |
| 580 | ||
| 581 | template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type _Function> | |
| 582 | static delegate_base static_creator(const char *name) | |
| 583 | { | |
| 584 | return delegate_base(_Function, name, (_FunctionClass *)NULL); | |
| 585 | } | |
| 586 | ||
| 587 | 588 | protected: |
| 588 | 589 | // bind the actual object |
| 589 | 590 | void bind(delegate_generic_class *object) |
| r11517 | r11518 | |
| 592 | 593 | if (m_object != NULL && m_rawfunction.m_function != 0) |
| 593 | 594 | m_function = reinterpret_cast<generic_static_func>(m_rawfunction.convert_to_generic(m_object)); |
| 594 | 595 | } |
| 596 | ||
| 597 | // late binding helper | |
| 598 | template<class _FunctionClass> | |
| 599 | static delegate_generic_class *late_bind_helper(delegate_late_bind &object) | |
| 600 | { | |
| 601 | return reinterpret_cast<delegate_generic_class *>(dynamic_cast<_FunctionClass *>(&object)); | |
| 602 | } | |
| 595 | 603 | |
| 596 | 604 | // internal state |
| 597 | 605 | const char * m_name; // name string |
| 598 | 606 | delegate_generic_class * m_object; // pointer to the post-cast object |
| 599 | 607 | generic_static_func m_function; // generic static function pointer |
| 600 | 608 | delegate_internal_mfp m_rawfunction; // raw member function definition |
| 609 | late_bind_func m_latebinder; // late binding helper | |
| 601 | 610 | }; |
| 602 | 611 | |
| 603 | 612 | #endif |
| r11517 | r11518 | |
| 620 | 629 | public: |
| 621 | 630 | delegate() : basetype() { } |
| 622 | 631 | delegate(const basetype &src) : basetype(src) { } |
| 623 | | |
| 632 | | |
| 624 | 633 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _noparam, _noparam, _noparam, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 625 | 634 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _noparam, _noparam, _noparam, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 626 | 635 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _noparam, _noparam, _noparam, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| r11517 | r11518 | |
| 635 | 644 | public: |
| 636 | 645 | delegate() : basetype() { } |
| 637 | 646 | delegate(const basetype &src) : basetype(src) { } |
| 638 | | |
| 647 | | |
| 639 | 648 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _noparam, _noparam, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 640 | 649 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _noparam, _noparam, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 641 | 650 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _noparam, _noparam, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| r11517 | r11518 | |
| 650 | 659 | public: |
| 651 | 660 | delegate() : basetype() { } |
| 652 | 661 | delegate(const basetype &src) : basetype(src) { } |
| 653 | | |
| 662 | | |
| 654 | 663 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _noparam, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 655 | 664 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _noparam, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 656 | 665 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _noparam, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| r11517 | r11518 | |
| 665 | 674 | public: |
| 666 | 675 | delegate() : basetype() { } |
| 667 | 676 | delegate(const basetype &src) : basetype(src) { } |
| 668 | | |
| 677 | | |
| 669 | 678 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 670 | 679 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 671 | 680 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| r11517 | r11518 | |
| 680 | 689 | public: |
| 681 | 690 | delegate() : basetype() { } |
| 682 | 691 | delegate(const basetype &src) : basetype(src) { } |
| 683 | | |
| 692 | | |
| 684 | 693 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 685 | 694 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| 686 | 695 | template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } |
| r11517 | r11518 | |
|---|---|---|
| 1489 | 1489 | |
| 1490 | 1490 | INPUT_CHANGED( coco_keyboard_changed ) |
| 1491 | 1491 | { |
| 1492 | coco_state *state = field->machine().driver_data<coco_state>(); | |
| 1493 | (*state->update_keyboard)(field->machine()); | |
| 1492 | coco_state *state = field.machine().driver_data<coco_state>(); | |
| 1493 | (*state->update_keyboard)(field.machine()); | |
| 1494 | 1494 | } |
| 1495 | 1495 | |
| 1496 | 1496 | static TIMER_CALLBACK( coco_m_update_keyboard_timerproc ) |
| r11517 | r11518 | |
| 2913 | 2913 | |
| 2914 | 2914 | INPUT_CHANGED( coco_joystick_mode_changed ) |
| 2915 | 2915 | { |
| 2916 | update_lightgun(field | |
| 2916 | update_lightgun(field. | |
| 2917 | 2917 | } |
| 2918 | 2918 | |
| 2919 | 2919 | static TIMER_CALLBACK( update_lightgun_timer_callback ) |
| r11517 | r11518 | |
|---|---|---|
| 1056 | 1056 | int bit_mask = (FPTR)param; |
| 1057 | 1057 | UINT8 port = 0; |
| 1058 | 1058 | |
| 1059 | if ((input_port_read(field->machine(), "CTRLSEL") & 0xf0) == 0x10) | |
| 1060 | port |= (input_port_read(field->machine(), "FAKE0") & bit_mask) ? 1 : 0; | |
| 1059 | if ((input_port_read(field.machine(), "CTRLSEL") & 0xf0) == 0x10) | |
| 1060 | port |= (input_port_read(field.machine(), "FAKE0") & bit_mask) ? 1 : 0; | |
| 1061 | 1061 | |
| 1062 | if ((input_port_read(field->machine(), "CTRLSEL") & 0xf0) == 0x00) | |
| 1063 | port |= (input_port_read(field->machine(), "FAKE1") & bit_mask) ? 1 : 0; | |
| 1062 | if ((input_port_read(field.machine(), "CTRLSEL") & 0xf0) == 0x00) | |
| 1063 | port |= (input_port_read(field.machine(), "FAKE1") & bit_mask) ? 1 : 0; | |
| 1064 | 1064 | |
| 1065 | 1065 | return port; |
| 1066 | 1066 | } |
| r11517 | r11518 | |
|---|---|---|
| 627 | 627 | |
| 628 | 628 | INPUT_CHANGED( comx35_reset ) |
| 629 | 629 | { |
| 630 | comx35_state *state = field | |
| 630 | comx35_state *state = field. | |
| 631 | 631 | |
| 632 | if (BIT(input_port_read(field | |
| 632 | if (BIT(input_port_read(field. | |
| 633 | 633 | { |
| 634 | 634 | state->machine_reset(); |
| 635 | 635 | } |
| r11517 | r11518 | |
|---|---|---|
| 376 | 376 | INPUT_CHANGED( z80ne_reset ) |
| 377 | 377 | { |
| 378 | 378 | UINT8 rst; |
| 379 | rst = input_port_read(field | |
| 379 | rst = input_port_read(field. | |
| 380 | 380 | |
| 381 | 381 | if ( ! BIT(rst, 0)) |
| 382 | 382 | { |
| 383 | running_machine &machine = field | |
| 383 | running_machine &machine = field. | |
| 384 | 384 | machine.schedule_soft_reset(); |
| 385 | 385 | } |
| 386 | 386 | } |
| r11517 | r11518 | |
| 388 | 388 | INPUT_CHANGED( z80ne_nmi ) |
| 389 | 389 | { |
| 390 | 390 | UINT8 nmi; |
| 391 | nmi = input_port_read(field | |
| 391 | nmi = input_port_read(field. | |
| 392 | 392 | |
| 393 | 393 | if ( ! BIT(nmi, 0)) |
| 394 | 394 | { |
| 395 | cputag_set_input_line(field | |
| 395 | cputag_set_input_line(field. | |
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 |
| r11517 | r11518 | |
|---|---|---|
| 240 | 240 | |
| 241 | 241 | INPUT_CHANGED( abc99_device::keyboard_reset ) |
| 242 | 242 | { |
| 243 | abc99_device *keyboard = static_cast<abc99_device *>(field | |
| 243 | abc99_device *keyboard = static_cast<abc99_device *>(field. | |
| 244 | 244 | |
| 245 | 245 | device_set_input_line(keyboard->m_mousecpu, INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); |
| 246 | 246 | } |
| r11517 | r11518 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | INPUT_CHANGED( abc77_device::keyboard_reset ) |
| 183 | 183 | { |
| 184 | abc77_device *keyboard = static_cast<abc77_device *>(field | |
| 184 | abc77_device *keyboard = static_cast<abc77_device *>(field. | |
| 185 | 185 | |
| 186 | 186 | if (oldval && !newval) |
| 187 | 187 | { |
| r11517 | r11518 | |
|---|---|---|
| 303 | 303 | |
| 304 | 304 | static INPUT_CHANGED( reset_w ) |
| 305 | 305 | { |
| 306 | vip_state *state = field | |
| 306 | vip_state *state = field. | |
| 307 | 307 | |
| 308 | 308 | if (oldval && !newval) |
| 309 | 309 | { |
| r11517 | r11518 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | static INPUT_CHANGED( input_w ) |
| 89 | 89 | { |
| 90 | elf2_state *state = field | |
| 90 | elf2_state *state = field. | |
| 91 | 91 | |
| 92 | 92 | if (newval) |
| 93 | 93 | { |
| r11517 | r11518 | |
|---|---|---|
| 1547 | 1547 | /* TODO: key repeat, remove port impulse! */ |
| 1548 | 1548 | static INPUT_CHANGED( key_stroke ) |
| 1549 | 1549 | { |
| 1550 | pc9801_state *state = field | |
| 1550 | pc9801_state *state = field. | |
| 1551 | 1551 | |
| 1552 | 1552 | if(newval && !oldval) |
| 1553 | 1553 | { |
| 1554 | 1554 | state->m_keyb_press = (UINT8)(FPTR)(param) & 0x7f; |
| 1555 | pic8259_ir1_w(field | |
| 1555 | pic8259_ir1_w(field. | |
| 1556 | 1556 | } |
| 1557 | 1557 | |
| 1558 | 1558 | if(oldval && !newval) |
| r11517 | r11518 | |
| 1562 | 1562 | /* for key modifiers */ |
| 1563 | 1563 | static INPUT_CHANGED( shift_stroke ) |
| 1564 | 1564 | { |
| 1565 | pc9801_state *state = field | |
| 1565 | pc9801_state *state = field. | |
| 1566 | 1566 | |
| 1567 | 1567 | if((newval && !oldval) || (oldval && !newval)) |
| 1568 | 1568 | { |
| 1569 | 1569 | state->m_keyb_press = (UINT8)(FPTR)(param) & 0x7f; |
| 1570 | pic8259_ir1_w(field | |
| 1570 | pic8259_ir1_w(field. | |
| 1571 | 1571 | } |
| 1572 | 1572 | else |
| 1573 | 1573 | state->m_keyb_press = 0; |
| r11517 | r11518 | |
|---|---|---|
| 310 | 310 | |
| 311 | 311 | static INPUT_CHANGED( trigger_irq ) |
| 312 | 312 | { |
| 313 | nakajies_state *state = field->machine().driver_data<nakajies_state>(); | |
| 314 | UINT8 irqs = input_port_read( field->machine(), "debug" ); | |
| 313 | nakajies_state *state = field.machine().driver_data<nakajies_state>(); | |
| 314 | UINT8 irqs = input_port_read( field.machine(), "debug" ); | |
| 315 | 315 | |
| 316 | 316 | state->m_irq_active |= irqs; |
| 317 | nakajies_update_irqs(field | |
| 317 | nakajies_update_irqs(field. | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 |
| r11517 | r11518 | |
|---|---|---|
| 2007 | 2007 | |
| 2008 | 2008 | static INPUT_CHANGED( ipl_reset ) |
| 2009 | 2009 | { |
| 2010 | //address_space *space = field->machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 2011 | x1_state *state = field->machine().driver_data<x1_state>(); | |
| 2010 | //address_space *space = field.machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 2011 | x1_state *state = field.machine().driver_data<x1_state>(); | |
| 2012 | 2012 | |
| 2013 | cputag_set_input_line(field | |
| 2013 | cputag_set_input_line(field. | |
| 2014 | 2014 | |
| 2015 | 2015 | state->m_ram_bank = 0x00; |
| 2016 | 2016 | if(state->m_is_turbo) { state->m_ex_bank = 0x10; } |
| r11517 | r11518 | |
| 2020 | 2020 | /* Apparently most games doesn't support this (not even the Konami ones!), one that does is...177 :o */ |
| 2021 | 2021 | static INPUT_CHANGED( nmi_reset ) |
| 2022 | 2022 | { |
| 2023 | cputag_set_input_line(field | |
| 2023 | cputag_set_input_line(field. | |
| 2024 | 2024 | } |
| 2025 | 2025 | |
| 2026 | 2026 | static INPUT_PORTS_START( x1 ) |
| r11517 | r11518 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | static INPUT_CHANGED( pen_check ) |
| 38 | 38 | { |
| 39 | UINT8 button = input_port_read(field->machine(), "PENB"); | |
| 40 | device_t *mc68328_device = field->machine().device("dragonball"); | |
| 39 | UINT8 button = input_port_read(field.machine(), "PENB"); | |
| 40 | device_t *mc68328_device = field.machine().device("dragonball"); | |
| 41 | 41 | if(button) |
| 42 | 42 | { |
| 43 | 43 | mc68328_set_penirq_line(mc68328_device, 1); |
| r11517 | r11518 | |
| 50 | 50 | |
| 51 | 51 | static INPUT_CHANGED( button_check ) |
| 52 | 52 | { |
| 53 | UINT8 button_state = input_port_read(field->machine(), "PORTD"); | |
| 54 | device_t *mc68328_device = field->machine().device("dragonball"); | |
| 53 | UINT8 button_state = input_port_read(field.machine(), "PORTD"); | |
| 54 | device_t *mc68328_device = field.machine().device("dragonball"); | |
| 55 | 55 | |
| 56 | 56 | mc68328_set_port_d_lines(mc68328_device, button_state, (int)(FPTR)param); |
| 57 | 57 | } |
| r11517 | r11518 | |
|---|---|---|
| 118 | 118 | static INPUT_CHANGED( kim1_reset ) |
| 119 | 119 | { |
| 120 | 120 | if (newval == 0) |
| 121 | field | |
| 121 | field. | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 |
| r11517 | r11518 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static INPUT_CHANGED( trigger_nmi ) |
| 81 | 81 | { |
| 82 | cputag_set_input_line(field | |
| 82 | cputag_set_input_line(field. | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | static INPUT_CHANGED( trigger_irq ) |
| 86 | 86 | { |
| 87 | cputag_set_input_line(field | |
| 87 | cputag_set_input_line(field. | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static INPUT_PORTS_START( mpf1 ) |
| r11517 | r11518 | |
|---|---|---|
| 259 | 259 | |
| 260 | 260 | static INPUT_CHANGED( reset_w ) |
| 261 | 261 | { |
| 262 | studio2_state *state = field | |
| 262 | studio2_state *state = field. | |
| 263 | 263 | |
| 264 | 264 | if (oldval && !newval) |
| 265 | 265 | { |
| r11517 | r11518 | |
|---|---|---|
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | static ADDRESS_MAP_START(at386_io, AS_IO, 32) |
| 166 | AM_RANGE(0x0000, 0x00 | |
| 166 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE8("dma8237_1", i8237_r, i8237_w, 0xffffffff) | |
| 167 | 167 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_master", pic8259_r, pic8259_w, 0xffffffff) |
| 168 | 168 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff) |
| 169 | 169 | AM_RANGE(0x0060, 0x0063) AM_READWRITE8(at_keybc_r, at_keybc_w, 0xffff) |
| r11517 | r11518 | |
| 171 | 171 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write , 0xffffffff) |
| 172 | 172 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r, at_page8_w, 0xffffffff) |
| 173 | 173 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_slave", pic8259_r, pic8259_w, 0xffffffff) |
| 174 | AM_RANGE(0x00c0, 0x00 | |
| 174 | AM_RANGE(0x00c0, 0x00cf) AM_DEVREADWRITE8("dma8237_2", at_dma8237_1_r, at_dma8237_1_w, 0xffffffff) | |
| 175 | 175 | AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE("ide", ide_r, ide_w) |
| 176 | 176 | AM_RANGE(0x0278, 0x027f) AM_DEVREADWRITE8("lpt_2", pc_lpt_r, pc_lpt_w, 0x000000ff) |
| 177 | 177 | AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ns16450_3", ins8250_r, ins8250_w, 0xffffffff) |
| r11517 | r11518 | |
|---|---|---|
| 179 | 179 | /* The ON LINE switch is directly connected to the INT1 input of the CPU */ |
| 180 | 180 | static INPUT_CHANGED( online_switch ) |
| 181 | 181 | { |
| 182 | ex800_state *state = field | |
| 182 | ex800_state *state = field. | |
| 183 | 183 | if (newval) |
| 184 | 184 | { |
| 185 | cputag_set_input_line(field | |
| 185 | cputag_set_input_line(field. | |
| 186 | 186 | state->m_irq_state = (state->m_irq_state == ASSERT_LINE) ? CLEAR_LINE : ASSERT_LINE; |
| 187 | 187 | } |
| 188 | 188 | } |
| r11517 | r11518 | |
|---|---|---|
| 411 | 411 | |
| 412 | 412 | static INPUT_CHANGED( trigger_irq ) |
| 413 | 413 | { |
| 414 | rex6000_state *state = field | |
| 414 | rex6000_state *state = field. | |
| 415 | 415 | |
| 416 | 416 | if (!(state->m_irq_mask & IRQ_FLAG_KEYCHANGE)) |
| 417 | 417 | { |
| r11517 | r11518 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | static INPUT_CHANGED( panel_check ) |
| 81 | 81 | { |
| 82 | ssem_state *state = field->machine().driver_data<ssem_state>(); | |
| 83 | UINT8 edit0_state = input_port_read(field->machine(), "EDIT0"); | |
| 84 | UINT8 edit1_state = input_port_read(field->machine(), "EDIT1"); | |
| 85 | UINT8 edit2_state = input_port_read(field->machine(), "EDIT2"); | |
| 86 | UINT8 edit3_state = input_port_read(field->machine(), "EDIT3"); | |
| 87 | UINT8 misc_state = input_port_read(field->machine(), "MISC"); | |
| 88 | device_t *ssem_cpu = field->machine().device("maincpu"); | |
| 82 | ssem_state *state = field.machine().driver_data<ssem_state>(); | |
| 83 | UINT8 edit0_state = input_port_read(field.machine(), "EDIT0"); | |
| 84 | UINT8 edit1_state = input_port_read(field.machine(), "EDIT1"); | |
| 85 | UINT8 edit2_state = input_port_read(field.machine(), "EDIT2"); | |
| 86 | UINT8 edit3_state = input_port_read(field.machine(), "EDIT3"); | |
| 87 | UINT8 misc_state = input_port_read(field.machine(), "MISC"); | |
| 88 | device_t *ssem_cpu = field.machine().device("maincpu"); | |
| 89 | 89 | |
| 90 | 90 | switch( (int)(FPTR)param ) |
| 91 | 91 | { |
| r11517 | r11518 | |
|---|---|---|
| 668 | 668 | /* TODO: shift break */ |
| 669 | 669 | static INPUT_CHANGED( key_stroke ) |
| 670 | 670 | { |
| 671 | qx10_state *state = field | |
| 671 | qx10_state *state = field. | |
| 672 | 672 | |
| 673 | 673 | if(newval && !oldval) |
| 674 | 674 | { |
| 675 | 675 | state->m_keyb.rx = (UINT8)(FPTR)(param) & 0x7f; |
| 676 | pic8259_ir4_w(field | |
| 676 | pic8259_ir4_w(field. | |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | if(oldval && !newval) |
| r11517 | r11518 | |
|---|---|---|
| 324 | 324 | |
| 325 | 325 | static INPUT_CHANGED( tmc2000_run_pressed ) |
| 326 | 326 | { |
| 327 | running_machine &machine = field | |
| 327 | running_machine &machine = field. | |
| 328 | 328 | tmc2000_state *state = machine.driver_data<tmc2000_state>(); |
| 329 | 329 | |
| 330 | 330 | if (oldval && !newval) |
| r11517 | r11518 | |
| 420 | 420 | |
| 421 | 421 | static INPUT_CHANGED( run_pressed ) |
| 422 | 422 | { |
| 423 | running_machine &machine = field | |
| 423 | running_machine &machine = field. | |
| 424 | 424 | nano_state *state = machine.driver_data<nano_state>(); |
| 425 | 425 | |
| 426 | 426 | if (oldval && !newval) |
| r11517 | r11518 | |
| 431 | 431 | |
| 432 | 432 | static INPUT_CHANGED( monitor_pressed ) |
| 433 | 433 | { |
| 434 | running_machine &machine = field | |
| 434 | running_machine &machine = field. | |
| 435 | 435 | nano_state *state = machine.driver_data<nano_state>(); |
| 436 | 436 | |
| 437 | 437 | if (oldval && !newval) |
| r11517 | r11518 | |
|---|---|---|
| 203 | 203 | |
| 204 | 204 | static INPUT_CHANGED( trigger_nmi ) |
| 205 | 205 | { |
| 206 | crvision_state *state = field | |
| 206 | crvision_state *state = field. | |
| 207 | 207 | |
| 208 | 208 | state->m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| 209 | 209 | } |
| r11517 | r11518 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | static INPUT_CHANGED( port_changed ) |
| 118 | 118 | { |
| 119 | gizmondo_state *gizmondo = field | |
| 119 | gizmondo_state *gizmondo = field. | |
| 120 | 120 | s3c2440_request_eint( gizmondo->m_s3c2440, 4); |
| 121 | 121 | //s3c2440_request_irq( device, S3C2440_INT_EINT1); |
| 122 | 122 | } |
| r11517 | r11518 | |
|---|---|---|
| 312 | 312 | /* Steph 2000-10-27 I remapped the 'Machine Name' Dip Switches (easier to understand) */ |
| 313 | 313 | static INPUT_CHANGED( cpc_monitor_changed ) |
| 314 | 314 | { |
| 315 | running_machine &machine = field | |
| 315 | running_machine &machine = field. | |
| 316 | 316 | const UINT8 *color_prom = NULL; |
| 317 | 317 | |
| 318 | 318 | if ( (input_port_read(machine, "green_display")) & 0x01 ) |
| r11517 | r11518 | |
|---|---|---|
| 39 | 39 | static INPUT_CHANGED( junior_reset ) |
| 40 | 40 | { |
| 41 | 41 | if (newval == 0) |
| 42 | field | |
| 42 | field. | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 |
| r11517 | r11518 | |
|---|---|---|
| 763 | 763 | |
| 764 | 764 | static INPUT_CHANGED( input_update ) |
| 765 | 765 | { |
| 766 | UINT32 buttons = input_port_read(field | |
| 766 | UINT32 buttons = input_port_read(field. | |
| 767 | 767 | |
| 768 | ps_intc_set_interrupt_line(field->machine(), PS_INT_BTN_ACTION, (buttons & 1) ? 1 : 0); | |
| 769 | ps_intc_set_interrupt_line(field->machine(), PS_INT_BTN_RIGHT, (buttons & 2) ? 1 : 0); | |
| 770 | ps_intc_set_interrupt_line(field->machine(), PS_INT_BTN_LEFT, (buttons & 4) ? 1 : 0); | |
| 771 | ps_intc_set_interrupt_line(field->machine(), PS_INT_BTN_DOWN, (buttons & 8) ? 1 : 0); | |
| 772 | ps_intc_set_interrupt_line(field->machine(), PS_INT_BTN_UP, (buttons & 16) ? 1 : 0); | |
| 768 | ps_intc_set_interrupt_line(field.machine(), PS_INT_BTN_ACTION, (buttons & 1) ? 1 : 0); | |
| 769 | ps_intc_set_interrupt_line(field.machine(), PS_INT_BTN_RIGHT, (buttons & 2) ? 1 : 0); | |
| 770 | ps_intc_set_interrupt_line(field.machine(), PS_INT_BTN_LEFT, (buttons & 4) ? 1 : 0); | |
| 771 | ps_intc_set_interrupt_line(field.machine(), PS_INT_BTN_DOWN, (buttons & 8) ? 1 : 0); | |
| 772 | ps_intc_set_interrupt_line(field.machine(), PS_INT_BTN_UP, (buttons & 16) ? 1 : 0); | |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | static READ32_HANDLER(ps_rombank_r) |
| r11517 | r11518 | |
|---|---|---|
| 1114 | 1114 | |
| 1115 | 1115 | static INPUT_CHANGED( update_udk ) |
| 1116 | 1116 | { |
| 1117 | x07_state *state = field | |
| 1117 | x07_state *state = field. | |
| 1118 | 1118 | |
| 1119 | state->draw_udk(field | |
| 1119 | state->draw_udk(field. | |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | 1122 | static INPUT_CHANGED( kb_keys ) |
| 1123 | 1123 | { |
| 1124 | x07_state *state = field | |
| 1124 | x07_state *state = field. | |
| 1125 | 1125 | |
| 1126 | 1126 | if (!newval) |
| 1127 | state->kb_scan_keys(field | |
| 1127 | state->kb_scan_keys(field. | |
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | static INPUT_CHANGED( kb_func_keys ) |
| 1131 | 1131 | { |
| 1132 | x07_state *state = field | |
| 1132 | x07_state *state = field. | |
| 1133 | 1133 | |
| 1134 | 1134 | if (newval) |
| 1135 | state->kb_fun_keys(field | |
| 1135 | state->kb_fun_keys(field. | |
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | static INPUT_CHANGED( kb_break ) |
| 1139 | 1139 | { |
| 1140 | x07_state *state = field | |
| 1140 | x07_state *state = field. | |
| 1141 | 1141 | |
| 1142 | 1142 | if (newval) |
| 1143 | 1143 | { |
| r11517 | r11518 | |
|---|---|---|
| 240 | 240 | |
| 241 | 241 | static INPUT_CHANGED( trigger_reset ) |
| 242 | 242 | { |
| 243 | cputag_set_input_line(field | |
| 243 | cputag_set_input_line(field. | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 |
| r11517 | r11518 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | static INPUT_CHANGED( trigger_reset ) |
| 51 | 51 | { |
| 52 | cputag_set_input_line(field | |
| 52 | cputag_set_input_line(field. | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static INPUT_CHANGED( trigger_rst75 ) |
| 56 | 56 | { |
| 57 | cputag_set_input_line(field | |
| 57 | cputag_set_input_line(field. | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static INPUT_PORTS_START( exp85 ) |
| r11517 | r11518 | |
|---|---|---|
| 229 | 229 | |
| 230 | 230 | static INPUT_CHANGED( port_changed ) |
| 231 | 231 | { |
| 232 | hp49gp_state *hp49gp = field | |
| 232 | hp49gp_state *hp49gp = field. | |
| 233 | 233 | s3c2410_request_eint( hp49gp->m_s3c2410, (FPTR)param + 8); |
| 234 | 234 | } |
| 235 | 235 |
| r11517 | r11518 | |
|---|---|---|
| 554 | 554 | |
| 555 | 555 | static INPUT_CHANGED( power_callback ) |
| 556 | 556 | { |
| 557 | ngp_state *state = field | |
| 557 | ngp_state *state = field. | |
| 558 | 558 | |
| 559 | 559 | if ( state->m_io_reg[0x33] & 0x04 ) |
| 560 | 560 | { |
| 561 | 561 | device_set_input_line( state->m_tlcs900, TLCS900_NMI, |
| 562 | (input_port_read(field | |
| 562 | (input_port_read(field. | |
| 563 | 563 | } |
| 564 | 564 | } |
| 565 | 565 |
| r11517 | r11518 | |
|---|---|---|
| 262 | 262 | /* the 'reset' key is directly tied to the reset line of the cpu */ |
| 263 | 263 | static INPUT_CHANGED( aquarius_reset ) |
| 264 | 264 | { |
| 265 | cputag_set_input_line(field | |
| 265 | cputag_set_input_line(field. | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | static INPUT_PORTS_START( aquarius ) |
| r11517 | r11518 | |
|---|---|---|
| 237 | 237 | |
| 238 | 238 | static INPUT_CHANGED( gm_changed ) |
| 239 | 239 | { |
| 240 | device_t *board = field | |
| 240 | device_t *board = field. | |
| 241 | 241 | set_gm_switches(board, (UINT8)((UINT64)param&0x03), newval); |
| 242 | 242 | } |
| 243 | 243 |
| r11517 | r11518 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | static INPUT_CHANGED( trigger_reset ) |
| 31 | 31 | { |
| 32 | cputag_set_input_line(field | |
| 32 | cputag_set_input_line(field. | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static INPUT_PORTS_START( beta ) |
| r11517 | r11518 | |
|---|---|---|
| 918 | 918 | |
| 919 | 919 | static INPUT_CHANGED( key_callback ) |
| 920 | 920 | { |
| 921 | px4_state *px4 = field->machine().driver_data<px4_state>(); | |
| 922 | UINT32 oldvalue = oldval * field->mask, newvalue = newval * field->mask; | |
| 921 | px4_state *px4 = field.machine().driver_data<px4_state>(); | |
| 922 | UINT32 oldvalue = oldval * field.mask, newvalue = newval * field.mask; | |
| 923 | 923 | UINT32 delta = oldvalue ^ newvalue; |
| 924 | 924 | int i, scancode = 0xff, down = 0; |
| 925 | 925 | |
| r11517 | r11518 | |
| 951 | 951 | logerror("upd7508: key interrupt\n"); |
| 952 | 952 | |
| 953 | 953 | px4->m_isr |= INT0_7508; |
| 954 | gapnit_interrupt(field | |
| 954 | gapnit_interrupt(field. | |
| 955 | 955 | } |
| 956 | 956 | } |
| 957 | 957 | } |
| r11517 | r11518 | |
|---|---|---|
| 65 | 65 | |
| 66 | 66 | static INPUT_CHANGED( trigger_reset ) |
| 67 | 67 | { |
| 68 | cputag_set_input_line(field | |
| 68 | cputag_set_input_line(field. | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static INPUT_CHANGED( trigger_nmi ) |
| 72 | 72 | { |
| 73 | cputag_set_input_line(field | |
| 73 | cputag_set_input_line(field. | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static INPUT_PORTS_START( poly880 ) |
| r11517 | r11518 | |
|---|---|---|
| 217 | 217 | |
| 218 | 218 | static INPUT_CHANGED( trigger_reset ) |
| 219 | 219 | { |
| 220 | cputag_set_input_line(field | |
| 220 | cputag_set_input_line(field. | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /*------------------------------------------------- |
| r11517 | r11518 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | static INPUT_CHANGED( trigger_reset ) |
| 52 | 52 | { |
| 53 | cputag_set_input_line(field | |
| 53 | cputag_set_input_line(field. | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static INPUT_CHANGED( trigger_nmi ) |
| 57 | 57 | { |
| 58 | cputag_set_input_line(field | |
| 58 | cputag_set_input_line(field. | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static INPUT_PORTS_START( lc80 ) |
| r11517 | r11518 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | static INPUT_CHANGED( trigger_reset ) |
| 29 | 29 | { |
| 30 | cputag_set_input_line(field | |
| 30 | cputag_set_input_line(field. | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static INPUT_CHANGED( trigger_nmi ) |
| 34 | 34 | { |
| 35 | cputag_set_input_line(field | |
| 35 | cputag_set_input_line(field. | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | static INPUT_PORTS_START( c80 ) |
| r11517 | r11518 | |
|---|---|---|
| 1109 | 1109 | |
| 1110 | 1110 | static INPUT_CHANGED( fidelz80_trigger_reset ) |
| 1111 | 1111 | { |
| 1112 | fidelz80_state *state = field | |
| 1112 | fidelz80_state *state = field. | |
| 1113 | 1113 | |
| 1114 | 1114 | device_set_input_line(state->m_maincpu, INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); |
| 1115 | 1115 | } |
| 1116 | 1116 | |
| 1117 | 1117 | static INPUT_CHANGED( abc_trigger_reset ) |
| 1118 | 1118 | { |
| 1119 | fidelz80_state *state = field | |
| 1119 | fidelz80_state *state = field. | |
| 1120 | 1120 | |
| 1121 | 1121 | device_set_input_line(state->m_maincpu, INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); |
| 1122 | 1122 | device_set_input_line(state->m_i8041, INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); |
| r11517 | r11518 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | static INPUT_CHANGED( ti68k_on_key ) |
| 238 | 238 | { |
| 239 | ti68k_state *state = field | |
| 239 | ti68k_state *state = field. | |
| 240 | 240 | |
| 241 | 241 | state->m_on_key = newval; |
| 242 | 242 |
| r11517 | r11518 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | static INPUT_CHANGED( ef_w ) |
| 52 | 52 | { |
| 53 | cputag_set_input_line(field | |
| 53 | cputag_set_input_line(field. | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static INPUT_PORTS_START( pecom ) |
| r11517 | r11518 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | static INPUT_CHANGED( gk_changed ) |
| 90 | 90 | { |
| 91 | device_t *cartsys = field | |
| 91 | device_t *cartsys = field. | |
| 92 | 92 | set_gk_switches(cartsys, (UINT8)((UINT64)param&0x07), newval); |
| 93 | 93 | } |
| 94 | 94 |
| r11517 | r11518 | |
|---|---|---|
| 149 | 149 | return state->m_HPC.nMiscStatus; |
| 150 | 150 | case 0x01bc: |
| 151 | 151 | // verboselog(machine, 2, "HPC CPU Serial EEPROM Read\n" ); |
| 152 | return ( ( | |
| 152 | return ( ( | |
| 153 | 153 | case 0x01c4: |
| 154 | 154 | verboselog(machine, 2, "HPC Local IO Register 0 Mask Read: %08x (%08x)\n", state->m_HPC.nLocalIOReg0Mask, mem_mask ); |
| 155 | 155 | return state->m_HPC.nLocalIOReg0Mask; |
| r11517 | r11518 | |
| 225 | 225 | { |
| 226 | 226 | ip20_state *state = space->machine().driver_data<ip20_state>(); |
| 227 | 227 | device_t *scc; |
| 228 | device | |
| 228 | eeprom_device | |
| 229 | 229 | running_machine &machine = space->machine(); |
| 230 | 230 | |
| 231 | eeprom = space->machine().device("eeprom"); | |
| 231 | eeprom = space->machine().device<eeprom_device>("eeprom"); | |
| 232 | 232 | offset <<= 2; |
| 233 | 233 | if( offset >= 0x0e00 && offset <= 0x0e7c ) |
| 234 | 234 | { |
| r11517 | r11518 | |
| 341 | 341 | { |
| 342 | 342 | verboselog(machine, 2, " CPU board LED on\n" ); |
| 343 | 343 | } |
| 344 | eeprom_write_bit(eeprom, (data & 0x00000008) ? 1 : 0 ); | |
| 345 | eeprom_set_cs_line(eeprom,(data & 0x00000002) ? ASSERT_LINE : CLEAR_LINE ); | |
| 346 | eeprom_set_clock_line(eeprom,(data & 0x00000004) ? CLEAR_LINE : ASSERT_LINE ); | |
| 344 | eeprom->write_bit((data & 0x00000008) ? 1 : 0 ); | |
| 345 | eeprom->set_cs_line((data & 0x00000002) ? ASSERT_LINE : CLEAR_LINE ); | |
| 346 | eeprom->set_clock_line((data & 0x00000004) ? CLEAR_LINE : ASSERT_LINE ); | |
| 347 | 347 | break; |
| 348 | 348 | case 0x01c4: |
| 349 | 349 | verboselog(machine, 2, "HPC Local IO Register 0 Mask Write: %08x (%08x)\n", data, mem_mask ); |
| r11517 | r11518 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | static INPUT_CHANGED( data ) |
| 161 | 161 | { |
| 162 | cosmicos_state *state = field->machine().driver_data<cosmicos_state>(); | |
| 163 | UINT8 data = input_port_read(field->machine(), "DATA"); | |
| 162 | cosmicos_state *state = field.machine().driver_data<cosmicos_state>(); | |
| 163 | UINT8 data = input_port_read(field.machine(), "DATA"); | |
| 164 | 164 | int i; |
| 165 | 165 | |
| 166 | 166 | for (i = 0; i < 8; i++) |
| r11517 | r11518 | |
| 175 | 175 | |
| 176 | 176 | static INPUT_CHANGED( enter ) |
| 177 | 177 | { |
| 178 | cosmicos_state *state = field | |
| 178 | cosmicos_state *state = field. | |
| 179 | 179 | |
| 180 | 180 | if (!newval && !state->m_wait && !state->m_clear) |
| 181 | 181 | { |
| 182 | cputag_set_input_line(field | |
| 182 | cputag_set_input_line(field. | |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| r11517 | r11518 | |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | static INPUT_CHANGED( run ) { cosmicos_state *state = field->machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_RUN); } | |
| 235 | static INPUT_CHANGED( load ) { cosmicos_state *state = field->machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_LOAD); } | |
| 236 | static INPUT_CHANGED( cosmicos_pause ) { cosmicos_state *state = field->machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_PAUSE); } | |
| 237 | static INPUT_CHANGED( reset ) { cosmicos_state *state = field->machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_RESET); } | |
| 234 | static INPUT_CHANGED( run ) { cosmicos_state *state = field.machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_RUN); } | |
| 235 | static INPUT_CHANGED( load ) { cosmicos_state *state = field.machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_LOAD); } | |
| 236 | static INPUT_CHANGED( cosmicos_pause ) { cosmicos_state *state = field.machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_PAUSE); } | |
| 237 | static INPUT_CHANGED( reset ) { cosmicos_state *state = field.machine().driver_data<cosmicos_state>(); if (!newval) state->set_cdp1802_mode(MODE_RESET); } | |
| 238 | 238 | |
| 239 | 239 | void cosmicos_state::clear_input_data() |
| 240 | 240 | { |
| r11517 | r11518 | |
| 250 | 250 | |
| 251 | 251 | static INPUT_CHANGED( clear_data ) |
| 252 | 252 | { |
| 253 | cosmicos_state *state = field | |
| 253 | cosmicos_state *state = field. | |
| 254 | 254 | |
| 255 | 255 | state->clear_input_data(); |
| 256 | 256 | } |
| r11517 | r11518 | |
| 279 | 279 | |
| 280 | 280 | static INPUT_CHANGED( memory_protect ) |
| 281 | 281 | { |
| 282 | cosmicos_state *state = field | |
| 282 | cosmicos_state *state = field. | |
| 283 | 283 | |
| 284 | 284 | state->m_ram_protect = newval; |
| 285 | 285 | |
| r11517 | r11518 | |
| 288 | 288 | |
| 289 | 289 | static INPUT_CHANGED( memory_disable ) |
| 290 | 290 | { |
| 291 | cosmicos_state *state = field | |
| 291 | cosmicos_state *state = field. | |
| 292 | 292 | |
| 293 | 293 | state->m_ram_disable = newval; |
| 294 | 294 |
| r11517 | r11518 | |
|---|---|---|
| 461 | 461 | |
| 462 | 462 | static INPUT_CHANGED( psion_on ) |
| 463 | 463 | { |
| 464 | cpu_device *cpu = field | |
| 464 | cpu_device *cpu = field. | |
| 465 | 465 | |
| 466 | 466 | /* reset the CPU for resume from standby */ |
| 467 | 467 | if (cpu->suspended(SUSPEND_REASON_HALT)) |
| Previous | 15994 Revisions | Next |